Mercurial > octave-nkf
comparison src/interp-core/jit-typeinfo.h @ 15102:d29f2583cf7b
Support end in multi indexing in JIT
* src/interp-core/jit-ir.cc (jit_magic_end::context::context): New function.
(jit_magic_end::jit_magic_end): Take context vector as argument.
(jit_magic_end::resolve_context): Return a context.
(jit_magic_end::print): Prettify output.
(jit_magic_end::overload): Use context.
* src/interp-core/jit-ir.h (jit_magic_end::context::context,
jit_magic_end::print): Move implementation to src/jit-ir.cc.
(jit_magic_end::short_print): Prettify output.
(jit_magic_end::resolve_context): Return a context.
* src/interp-core/jit-typeinfo.cc (octave_jit_end_matrix): New function.
(jit_typeinfo::jit_typeinfo): Initilaize end_fn and end1_fn.
(jit_typeinfo::do_end): New function.
(jit_typeinfo::new_type): Moved location in file.
* src/interp-core/jit-typeinfo.h (jit_typeinfo::end): Take index and count
arguments.
(jit_typeinfo::do_end): New declaration.
* src/interp-core/pt-jit.cc (jit_convert::resolve): Pass extra argument to
context constructor.
(jit_convert::convert_llvm::visit): New arguments to jit_magic_end overload.
author | Max Brister <max@2bass.com> |
---|---|
date | Sat, 04 Aug 2012 00:19:07 -0500 |
parents | 909a2797935b |
children | 0464e3ceb85b |
comparison
equal
deleted
inserted
replaced
15101:2512448babac | 15102:d29f2583cf7b |
---|---|
265 | 265 |
266 #define JIT_CALL(N) JIT_EXPAND (llvm::Value *, call, jit_value *, const, N) | 266 #define JIT_CALL(N) JIT_EXPAND (llvm::Value *, call, jit_value *, const, N) |
267 | 267 |
268 JIT_CALL (1); | 268 JIT_CALL (1); |
269 JIT_CALL (2); | 269 JIT_CALL (2); |
270 JIT_CALL (3); | |
270 | 271 |
271 #undef JIT_CALL | 272 #undef JIT_CALL |
272 #undef JIT_PARAMS | 273 #undef JIT_PARAMS |
273 #undef JIT_PARAM_ARGS | 274 #undef JIT_PARAM_ARGS |
274 | 275 |
547 static const jit_operation& end (void) | 548 static const jit_operation& end (void) |
548 { | 549 { |
549 return instance->end_fn; | 550 return instance->end_fn; |
550 } | 551 } |
551 | 552 |
552 static const jit_function& end (jit_type *ty) | 553 static const jit_function& end (jit_value *value, jit_value *index, |
553 { | 554 jit_value *count) |
554 return instance->end_fn.overload (ty); | 555 { |
556 return instance->do_end (value, index, count); | |
555 } | 557 } |
556 private: | 558 private: |
557 jit_typeinfo (llvm::Module *m, llvm::ExecutionEngine *e); | 559 jit_typeinfo (llvm::Module *m, llvm::ExecutionEngine *e); |
558 | 560 |
559 // FIXME: Do these methods really need to be in jit_typeinfo? | 561 // FIXME: Do these methods really need to be in jit_typeinfo? |
617 const jit_function& do_cast (jit_type *to, jit_type *from) | 619 const jit_function& do_cast (jit_type *to, jit_type *from) |
618 { | 620 { |
619 return do_cast (to).overload (from); | 621 return do_cast (to).overload (from); |
620 } | 622 } |
621 | 623 |
624 const jit_function& do_end (jit_value *value, jit_value *index, | |
625 jit_value *count); | |
626 | |
622 jit_type *new_type (const std::string& name, jit_type *parent, | 627 jit_type *new_type (const std::string& name, jit_type *parent, |
623 llvm::Type *llvm_type); | 628 llvm::Type *llvm_type); |
624 | 629 |
625 | 630 |
626 void add_print (jit_type *ty, void *fptr); | 631 void add_print (jit_type *ty, void *fptr); |
736 jit_operation for_index_fn; | 741 jit_operation for_index_fn; |
737 jit_operation logically_true_fn; | 742 jit_operation logically_true_fn; |
738 jit_operation make_range_fn; | 743 jit_operation make_range_fn; |
739 jit_paren_subsref paren_subsref_fn; | 744 jit_paren_subsref paren_subsref_fn; |
740 jit_paren_subsasgn paren_subsasgn_fn; | 745 jit_paren_subsasgn paren_subsasgn_fn; |
746 jit_operation end1_fn; | |
741 jit_operation end_fn; | 747 jit_operation end_fn; |
742 | 748 |
743 // type id -> cast function TO that type | 749 // type id -> cast function TO that type |
744 std::vector<jit_operation> casts; | 750 std::vector<jit_operation> casts; |
745 | 751 |