On Thu, Dec 18, 2014 at 11:46:00AM +0100, Thomas Schwinge wrote: > > just > > rtx v1 = GEN_INT (...); > > rtx v2 = GEN_INT (...); > > machine_mode mode = TYPE_MODE (TREE_TYPE (arg)); > > rtx ret = gen_reg_rtx (TYPE_MODE (integer_type_node)); > > emit_move_insn (ret, const0_rtx); > > rtx_code_label *done_label = gen_label_rtx (); > > emit_cmp_and_jump_insns (op, v1, NE, NULL_RTX, mode, > > false, done_label, PROB_EVEN); > > emit_cmp_and_jump_insns (op, v2, NE, NULL_RTX, mode, > > false, done_label, PROB_EVEN); > > emit_move_insn (ret, const1_rtx); > > emit_label (done_label); > > return ret; > > or similar. > > Thanks for the review/suggestion/code!
Note, as I found later, emit_cmp_and_jump_insns is good enough only for certain modes on certain architectures (in particular, for cases where can_compare_p returns true). So it is better to use do_compare_rtx_and_jump instead of emit_cmp_and_jump_insns, because it handles also the cases which emit_cmp_and_jump_insns silently mishandles. You'll need to reorder the arguments a little bit and add one NULL_RTX argument. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63848#c4 Jakub