This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS elimate trap-if-zero instruction if possible for divisions


Hi Jeff, Richard,

Not sure if that working.

I created some rtl using TRAP_IF to represent the TEQ and emiited via an expander 

The TRAP_IF rtl make ait all the way though the rtl optimizers which are run after expand
even though it should be possible to determine is false.


(insn 7 3 20 2 (set (reg:SI 2 $2 [201])
        (const_int 27 [0x1b])) bug.c:67 289 {*movsi_internal}
     (expr_list:REG_EQUIV (const_int 27 [0x1b])
        (nil)))

(insn 20 7 21 2 (trap_if (eq:SI (reg:SI 2 $2 [201])
            (const_int 0 [0]))
        (const_int 7 [0x7])) bug.c:68 8 {*conditional_trapNsi_if_zero}
     (nil))

I grepped the RTL code for any code handling TRAP_IF that looked like it might remove the TRAP_IF but
only found some code is final_scan which only applied to CC0 backends. 

Is using a conditional trap (TRAP_IF)  the right way to go?

Graham


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]