# HG changeset patch # User Max Brister # Date 1340830168 18000 # Node ID 95bfd032f4c7af0ff7c55a9e2d26b8e7a29c360d # Parent e3cd4c9d7ccce44fb47502c56fbcfbde4f81ec0b Add element wise boolean And and Or in JIT diff -r e3cd4c9d7ccc -r 95bfd032f4c7 src/pt-jit.cc --- a/src/pt-jit.cc Wed Jun 27 14:14:20 2012 -0500 +++ b/src/pt-jit.cc Wed Jun 27 15:49:28 2012 -0500 @@ -613,6 +613,10 @@ // now for binary index operators add_binary_op (index, octave_value::op_add, llvm::Instruction::Add); + // and binary bool operators + add_binary_op (boolean, octave_value::op_el_or, llvm::Instruction::Or); + add_binary_op (boolean, octave_value::op_el_and, llvm::Instruction::And); + // now for printing functions print_fn.stash_name ("print"); add_print (any, reinterpret_cast (&octave_jit_print_any)); @@ -1880,9 +1884,9 @@ void jit_convert::visit_binary_expression (tree_binary_expression& be) { + // this is the case for bool_or and bool_and if (be.op_type () >= octave_value::num_binary_ops) - // this is the case for bool_or and bool_and - fail (); + fail ("Unsupported binary operator"); tree_expression *lhs = be.lhs (); jit_value *lhsv = visit (lhs);