This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [mips patch' RFA] handle trap_if with DI-mode arguments.
I updated my source tree, and there were conflicts w/ some of
Richard's improvements, so i cleaned them up and retested. (same
result. 8-)
2003-08-19 Chris Demetriou <cgd@broadcom.com>
* config/mips/mips.md: Adjust SI-mode "trap_if" instruction
to use better predicates and constraints. Define new
instruction to handle "trap_if" with DI-mode arguments.
(conditional_trap): FAIL if trap code is not 0.
Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.190
diff -u -p -r1.190 mips.md
--- config/mips/mips.md 18 Aug 2003 08:00:13 -0000 1.190
+++ config/mips/mips.md 19 Aug 2003 17:44:06 -0000
@@ -640,16 +640,29 @@
(match_operand 1 "const_int_operand" ""))]
"ISA_HAS_COND_TRAP"
{
- mips_gen_conditional_trap (operands);
- DONE;
+ if (operands[1] == const0_rtx)
+ {
+ mips_gen_conditional_trap (operands);
+ DONE;
+ }
+ else
+ FAIL;
})
(define_insn ""
[(trap_if (match_operator 0 "trap_cmp_op"
- [(match_operand:SI 1 "reg_or_0_operand" "d")
- (match_operand:SI 2 "nonmemory_operand" "dI")])
+ [(match_operand:SI 1 "reg_or_0_operand" "dJ")
+ (match_operand:SI 2 "arith_operand" "dI")])
(const_int 0))]
"ISA_HAS_COND_TRAP"
+ "t%C0\t%z1,%z2")
+
+(define_insn ""
+ [(trap_if (match_operator 0 "trap_cmp_op"
+ [(match_operand:DI 1 "reg_or_0_operand" "dJ")
+ (match_operand:DI 2 "arith_operand" "dI")])
+ (const_int 0))]
+ "TARGET_64BIT && ISA_HAS_COND_TRAP"
"t%C0\t%z1,%z2")
;;