* config/s390/s390.md ("trap", "conditional_trap", "*trap"): New insns.
authorhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Sep 2002 09:46:57 +0000 (09:46 +0000)
committerhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Sep 2002 09:46:57 +0000 (09:46 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57102 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.md

index 09ee078..523f275 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-13  Hartmut Penner  <hpenner@de.ibm.com>
+
+       * config/s390/s390.md ("trap", "conditional_trap", "*trap"): New
+       insns.
+
 2002-09-12  Richard Henderson  <rth@redhat.com>
 
        * Makefile.in (HOST_PRINT): Use print-rtl1.o
index 3974e21..418165c 100644 (file)
                       (const_string "RR") (const_string "RX")))
    (set_attr "atype" "mem")])
 
+;;
+;;- Trap instructions.
+;;
+
+(define_insn "trap"
+  [(trap_if (const_int 1) (const_int 0))]
+  ""
+  "j\\t.+2"
+  [(set_attr "op_type" "RX")])
+
+(define_expand "conditional_trap"
+  [(set (match_dup 2) (match_dup 3))
+   (trap_if (match_operator 0 "comparison_operator"
+                           [(match_dup 2) (const_int 0)])
+           (match_operand:SI 1 "general_operand" ""))]
+  ""
+  "
+{
+   enum machine_mode ccmode;
+
+   if (operands[1] != const0_rtx) FAIL;        
+
+   ccmode = s390_select_ccmode (GET_CODE (operands[0]), 
+                               s390_compare_op0, s390_compare_op1);    
+   operands[2] = gen_rtx_REG (ccmode, 33);
+   operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
+}")
+
+(define_insn "*trap"
+  [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
+           (const_int 0))]
+  ""
+  "j%C0\\t.+2";
+  [(set_attr "op_type" "RX")])
 
 ;;
 ;;- Loop instructions.