From eb5ce910419ea79722f9e5ea88331a8051c8fac4 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 8 Jun 1996 13:55:15 -0400 Subject: [PATCH] (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 --- gcc/config/ns32k/ns32k.md | 53 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/gcc/config/ns32k/ns32k.md b/gcc/config/ns32k/ns32k.md index 679ca9a6ca5..a1a08851f00 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. -- 2.30.2