aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gnu.org>1993-03-17 20:56:40 +0000
committerTorbjorn Granlund <tege@gnu.org>1993-03-17 20:56:40 +0000
commite19ee6593aa1659a51cffd84139131f6922c52b3 (patch)
treec21ea4f631dcbea7949ae6a5de882533eb0f6059
parent635c74203f7c41b1a407072a9ba8f386877693c6 (diff)
downloadgcc-e19ee6593aa1659a51cffd84139131f6922c52b3.zip
gcc-e19ee6593aa1659a51cffd84139131f6922c52b3.tar.gz
gcc-e19ee6593aa1659a51cffd84139131f6922c52b3.tar.bz2
(branch-on-bit): New patterns.
From-SVN: r3764
-rw-r--r--gcc/config/pa/pa.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 0f220c8..831107c 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -720,6 +720,59 @@
(const_int 1)
(const_int 2)))])
+;; Branch on bit patterns
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else
+ (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
+ (const_int 1)
+ (match_operand:SI 1 "uint5_operand" ""))
+ (const_int 0))
+ (match_operand 2 "pc_or_label_operand" "")
+ (match_operand 3 "pc_or_label_operand" "")))]
+ ""
+ "*
+{
+ if (operands[3] == pc_rtx)
+ return (get_attr_length (insn) == 1
+ ? \"bb,< %0,%1,%2%#\" : \"extrs,>= %0,%1,1,0\;bl %2,0%#\");
+ else
+ return (get_attr_length (insn) == 1
+ ? \"bb,>= %0,%1,%3%#\" : \"extrs,< %0,%1,1,0\;bl %3,0%#\");
+}"
+ [(set_attr "type" "cbranch")
+ (set (attr "length") (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 2))))
+ (const_int 1023))
+ (const_int 1)
+ (const_int 2)))])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else
+ (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
+ (const_int 1)
+ (match_operand:SI 1 "uint5_operand" ""))
+ (const_int 0))
+ (match_operand 2 "pc_or_label_operand" "")
+ (match_operand 3 "pc_or_label_operand" "")))]
+ ""
+ "*
+{
+ if (operands[3] == pc_rtx)
+ return (get_attr_length (insn) == 1
+ ? \"bb,>= %0,%1,%2%#\" : \"extrs,< %0,%1,1,0\;bl %2,0%#\");
+ else
+ return (get_attr_length (insn) == 1
+ ? \"bb,< %0,%1,%3%#\" : \"extrs,>= %0,%1,1,0\;bl %3,0%#\");
+}"
+ [(set_attr "type" "cbranch")
+ (set (attr "length") (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 2))))
+ (const_int 1023))
+ (const_int 1)
+ (const_int 2)))])
;; Floating point branches
(define_insn ""