aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-01-13 02:03:49 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-01-13 02:03:49 +0000
commit2a7f30be9d302ef16c54fdc6714687e361880218 (patch)
treec270625009b1eb8ee1ebb5afab229fdc744c2ace /gcc/config/mips
parent467d5ed44d3d905ba4e5017b2eaef78b449e2ae3 (diff)
(norsi3, nordi3): Use canonical RTL. Prepend `*' to pattern
name. Don't match immediates. (norsi3_const, nordi3_const): New patterns. (anddi3, iordi3, xordi3): Test TARGET_64BIT, not mips_isa in length attribute calculation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13485 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips')
-rw-r--r--gcc/config/mips/mips.md114
1 files changed, 66 insertions, 48 deletions
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index e833273977b..9d8bd5496d0 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -2029,51 +2029,6 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 1) (not:SI (subreg:SI (match_dup 1) 1)))]
"")
-;; Simple hack to recognize the "nor" instruction on the MIPS
-;; This must appear before the normal or patterns, so that the
-;; combiner will correctly fold things.
-
-(define_insn "norsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (not:SI (ior:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:SI 2 "reg_or_0_operand" "dJ"))))]
- ""
- "nor\\t%0,%z1,%z2"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "nordi3"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (not:DI (ior:DI (match_operand:DI 1 "se_register_operand" "d")
- (match_operand:DI 2 "se_register_operand" "d"))))]
- ""
- "*
-{
- if (TARGET_64BIT)
- return \"nor\\t%0,%z1,%z2\";
- return \"nor\\t%M0,%M1,%M2\;nor\\t%L0,%L1,%L2\";
-}"
- [(set_attr "type" "darith")
- (set_attr "mode" "DI")
- (set (attr "length")
- (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
- (const_int 1)
- (const_int 2)))])
-
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (not:DI (ior:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "register_operand" ""))))]
- "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
- && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
- && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
-
- [(set (subreg:SI (match_dup 0) 0) (not:SI (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0))))
- (set (subreg:SI (match_dup 0) 1) (not:SI (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1))))]
- "")
-
;;
;; ....................
@@ -2109,7 +2064,7 @@ move\\t%0,%z4\\n\\
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set (attr "length")
- (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
+ (if_then_else (ne (symbol_ref "TARGET_64BIT") (const_int 0))
(const_int 1)
(const_int 2)))])
@@ -2167,7 +2122,7 @@ move\\t%0,%z4\\n\\
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set (attr "length")
- (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
+ (if_then_else (ne (symbol_ref "TARGET_64BIT") (const_int 0))
(const_int 1)
(const_int 2)))])
@@ -2212,7 +2167,7 @@ move\\t%0,%z4\\n\\
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set (attr "length")
- (if_then_else (ge (symbol_ref "mips_isa") (const_int 3))
+ (if_then_else (ne (symbol_ref "TARGET_64BIT") (const_int 0))
(const_int 1)
(const_int 2)))])
@@ -2239,6 +2194,69 @@ move\\t%0,%z4\\n\\
(set_attr "mode" "DI")
(set_attr "length" "1")])
+(define_insn "*norsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (and:SI (not:SI (match_operand:SI 1 "register_operand" "d"))
+ (not:SI (match_operand:SI 2 "register_operand" "d"))))]
+ ""
+ "nor\\t%0,%z1,%z2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "1")])
+
+(define_insn "*nordi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (not:DI (match_operand:DI 1 "se_register_operand" "d"))
+ (not:DI (match_operand:DI 2 "se_register_operand" "d"))))]
+ ""
+ "*
+{
+ if (TARGET_64BIT)
+ return \"nor\\t%0,%z1,%z2\";
+ return \"nor\\t%M0,%M1,%M2\;nor\\t%L0,%L1,%L2\";
+}"
+ [(set_attr "type" "darith")
+ (set_attr "mode" "DI")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (const_int 1)
+ (const_int 2)))])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (and:DI (not:DI (match_operand:DI 1 "register_operand" ""))
+ (not:DI (match_operand:DI 2 "register_operand" ""))))]
+ "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE
+ && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
+ && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
+ && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"
+
+ [(set (subreg:SI (match_dup 0) 0) (and:SI (not:SI (subreg:SI (match_dup 1) 0)) (not:SI (subreg:SI (match_dup 2) 0))))
+ (set (subreg:SI (match_dup 0) 1) (and:SI (not:SI (subreg:SI (match_dup 1) 1)) (not:SI (subreg:SI (match_dup 2) 1))))]
+ "")
+
+(define_insn "*norsi3_const"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (and:SI (not:SI (match_operand:SI 1 "register_operand" "d"))
+ (match_operand:SI 2 "complemented_arith_operand" "")))]
+ ""
+ "nor\\t%0,%z1,%e2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "1")])
+
+(define_insn "*nordi3_const"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (not:DI (match_operand:DI 1 "se_register_operand" "d"))
+ (match_operand:DI 2 "complemented_arith_operand" "")))]
+ "TARGET_64BIT"
+ "nor\\t%0,%z1,%e2"
+ [(set_attr "type" "darith")
+ (set_attr "mode" "DI")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (const_int 1)
+ (const_int 2)))])
;;
;; ....................