aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-06-08 13:55:15 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-06-08 13:55:15 -0400
commiteb5ce910419ea79722f9e5ea88331a8051c8fac4 (patch)
tree92e0ce5b11add3236bef534fe8c8f5a086d01c89 /gcc
parent0e09cc26eee23001577e0851562172fa92cb1a53 (diff)
downloadgcc-eb5ce910419ea79722f9e5ea88331a8051c8fac4.zip
gcc-eb5ce910419ea79722f9e5ea88331a8051c8fac4.tar.gz
gcc-eb5ce910419ea79722f9e5ea88331a8051c8fac4.tar.bz2
(define_insns for ffs[qhs]i2): Deleted.
(define_insns for ffs[qhs]i2): Deleted. These patterns only worked when the input operand was not the same as the output operand. (define_expand for ffssi2): New pattern. This uses an anonymous pattern that describes what the ns32k's ffsd instruction (really) does. From-SVN: r12244
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/ns32k/ns32k.md53
1 files changed, 27 insertions, 26 deletions
diff --git a/gcc/config/ns32k/ns32k.md b/gcc/config/ns32k/ns32k.md
index 679ca9a..a1a0885 100644
--- a/gcc/config/ns32k/ns32k.md
+++ b/gcc/config/ns32k/ns32k.md
@@ -2607,32 +2607,33 @@
;; ffs instructions
-(define_insn "ffsqi2"
- [(set (match_operand:QI 0 "general_operand" "=g")
- (ffs:QI (match_operand:SI 1 "general_operand" "g")))]
- ""
- "*
-{
- return \"movqb 0,%0; ffsd %1,%0; bfs 1f; addqb 1,%0; 1:\";
-}")
-
-(define_insn "ffshi2"
- [(set (match_operand:HI 0 "general_operand" "=g")
- (ffs:HI (match_operand:SI 1 "general_operand" "g")))]
- ""
- "*
-{
- return \"movqw 0,%0; ffsd %1,%0; bfs 1f; addqw 1,%0; 1:\";
-}")
-
-(define_insn "ffssi2"
- [(set (match_operand:SI 0 "general_operand" "=g")
- (ffs:SI (match_operand:SI 1 "general_operand" "g")))]
- ""
- "*
-{
- return \"movqd 0,%0; ffsd %1,%0; bfs 1f; addqd 1,%0; 1:\";
-}")
+(define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "ro")
+ (minus:SI
+ (plus:SI (ffs:SI (zero_extract:SI
+ (match_operand:SI 1 "general_operand" "g")
+ (minus:SI (const_int 32) (match_dup 0))
+ (match_dup 0)))
+ (match_dup 0))
+ (const_int 1)))]
+ ""
+ "ffsd %1,%0; bfc 1f; addqd %$-1,%0; 1:")
+
+(define_expand "ffssi2"
+ [(set (match_operand:SI 0 "general_operand" "=g") (const_int 0))
+ (set (match_dup 0)
+ (minus:SI
+ (plus:SI (ffs:SI (zero_extract:SI
+ (match_operand:SI 1 "general_operand" "g")
+ (minus:SI (const_int 32) (match_dup 0))
+ (match_dup 0)))
+ (match_dup 0))
+ (const_int 1)))
+ (set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (const_int 1)))]
+ ""
+ "operands[1] = make_safe_from(operands[1], operands[0]);")
;; Speed up stack adjust followed by a HI fixedpoint push.