From e19ee6593aa1659a51cffd84139131f6922c52b3 Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Wed, 17 Mar 1993 20:56:40 +0000 Subject: [PATCH] (branch-on-bit): New patterns. From-SVN: r3764 --- gcc/config/pa/pa.md | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 0f220c8e08b..831107c7ec7 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 "" -- 2.30.2