]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.md (trap): New insn.
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 7 Nov 2014 01:04:17 +0000 (01:04 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 7 Nov 2014 01:04:17 +0000 (01:04 +0000)
* config/pa/pa.md (trap): New insn.  Add "trap" to attribute type.
Don't allow trap insn in in_branch_delay, in_nullified_branch_delay
or in_call_delay.

From-SVN: r217210

gcc/ChangeLog
gcc/config/pa/pa.md

index 9c0c23d33a78e4530703f8055f8bff4fd0e0bbde..27e65cf2d1053d8e973d7178e0d0db384e58bb3a 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-06  John David Anglin  <danglin@gcc.gnu.org>
+
+       * config/pa/pa.md (trap): New insn.  Add "trap" to attribute type.
+       Don't allow trap insn in in_branch_delay, in_nullified_branch_delay
+       or in_call_delay.
+       
 2014-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64-elf-raw.h (CA53_ERR_835769_SPEC): Define.
index af24886cd599f84d5a93d0af42cb4fcb576c1a36..ce98d8aedfdf81a4533c1e5c26d13c75f3f5d9f3 100644 (file)
 ;; type "binary" insns have two input operands (1,2) and one output (0)
 
 (define_attr "type"
-  "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,sh_func_adrs,parallel_branch,fpstore_load,store_fpload"
+  "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,sh_func_adrs,parallel_branch,fpstore_load,store_fpload,trap"
   (const_string "binary"))
 
 (define_attr "pa_combine_type"
 ;; For conditional branches. Frame related instructions are not allowed
 ;; because they confuse the unwind support.
 (define_attr "in_branch_delay" "false,true"
-  (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch")
+  (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch,trap")
                     (eq_attr "length" "4")
                     (not (match_test "RTX_FRAME_RELATED_P (insn)")))
                (const_string "true")
 ;; Disallow instructions which use the FPU since they will tie up the FPU
 ;; even if the instruction is nullified.
 (define_attr "in_nullified_branch_delay" "false,true"
-  (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch")
+  (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch,trap")
                     (eq_attr "length" "4")
                     (not (match_test "RTX_FRAME_RELATED_P (insn)")))
                (const_string "true")
 ;; For calls and millicode calls.  Allow unconditional branches in the
 ;; delay slot.
 (define_attr "in_call_delay" "false,true"
-  (cond [(and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch")
+  (cond [(and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch,trap")
              (eq_attr "length" "4")
              (not (match_test "RTX_FRAME_RELATED_P (insn)")))
           (const_string "true")
   [(set_attr "type" "binary,binary")
    (set_attr "length" "4,4")])
 
+;; Trap instructions.
+
+(define_insn "trap"
+  [(trap_if (const_int 1) (const_int 0))]
+  ""
+  "{addit|addi,tc},<> 1,%%r0,%%r0"
+  [(set_attr "type" "trap")
+   (set_attr "length" "4")])
+
 ;; Clobbering a "register_operand" instead of a match_scratch
 ;; in operand3 of millicode calls avoids spilling %r1 and
 ;; produces better code.