Mercurial > octave-nkf
diff src/jit-ir.cc @ 15067:df4538e3b50b
ND scalar indexing in JIT.
* src/jit-ir.cc (jit_magic_end::jit_magic_end): Use jit_magic_end::context.
* src/jit-ir.h (jit_call::jit_call): New overload.
(jit_magic_end::context): New class.
(jit_magic_end::jit_magic_end): moved to src/jit-ir.cc.
* src/jit-typeinfo.cc (octave_jit_paren_scalar): New function.
(jit_typeinfo::jit_typeinfo): Generate ND scalar indexing.
(jit_typeinfo::gen_subsref): New function.
* src/jit-typeinfo.h (jit_typeinfo::gen_subsref): New declaration.
* src/pt-jit.cc (jit_convert::visit_index_expression, jit_convert::do_assign):
Update resolve call.
(jit_convert::resolve): Resolve ND indices.
* src/pt-jit.h (jit_convert::resolve): Change function signature.
author | Max Brister <max@2bass.com> |
---|---|
date | Tue, 31 Jul 2012 11:51:01 -0500 |
parents | bc32288f4a42 |
children |
line wrap: on
line diff
--- a/src/jit-ir.cc Tue Jul 31 14:14:03 2012 -0400 +++ b/src/jit-ir.cc Tue Jul 31 11:51:01 2012 -0500 @@ -599,6 +599,22 @@ } // -------------------- jit_magic_end -------------------- +jit_magic_end::jit_magic_end (const std::vector<context>& full_context) +{ + // for now we only support end in 1 dimensional indexing + resize_arguments (full_context.size ()); + + size_t i; + std::vector<context>::const_iterator iter; + for (iter = full_context.begin (), i = 0; iter != full_context.end (); ++iter, + ++i) + { + if (iter->count != 1) + throw jit_fail_exception ("end is only supported in linear contexts"); + stash_argument (i, iter->value); + } +} + const jit_function& jit_magic_end::overload () const {