]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sse.md (copysign<mode>3): Use "and-not" SSE instruction instead of "and" with inverte...
authorUros Bizjak <ubizjak@gmail.com>
Wed, 15 Jul 2009 15:40:15 +0000 (17:40 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 15 Jul 2009 15:40:15 +0000 (17:40 +0200)
* config/i386/sse.md (copysign<mode>3): Use "and-not" SSE instruction
instead of "and" with inverted sign bit mask value.  Use
"nonimmediate_operand" for operand 1 and operand 2 predicate.
Allocate registers only for operand 4 and operand 5.

From-SVN: r149691

gcc/ChangeLog
gcc/config/i386/sse.md

index 812c7944a60a600400606acf1b074c57efbb18ab..b87b62ac6a4857188c5d8c4d023952d342ae9d6c 100644 (file)
@@ -1,7 +1,9 @@
-2009-07-15 Uros Bizjak  <ubizjak@gmail.com>
+2009-07-15  Uros Bizjak  <ubizjak@gmail.com>
 
-       * config/i386/sse.md (copysign<mode>3): Allocate registers only for
-       operands[5] and operands[6].
+       * config/i386/sse.md (copysign<mode>3): Use "and-not" SSE instruction
+       instead of "and" with inverted sign bit mask value.  Use
+       "nonimmediate_operand" for operand 1 and operand 2 predicate.
+       Allocate registers only for operand 4 and operand 5.
 
 2009-07-15  Jakub Jelinek  <jakub@redhat.com>
 
index cde91e4eea12c80c34ef6f39faa63667ddf7c3bf..ce830298df447eb6cdc1f87ea973d6bb91c74cd2 100644 (file)
    (set_attr "mode" "<MODE>")])
 
 (define_expand "copysign<mode>3"
-  [(set (match_dup 5)
-       (and:SSEMODEF2P (match_operand:SSEMODEF2P 1 "register_operand" "")
-                       (match_dup 3)))
-   (set (match_dup 6)
-       (and:SSEMODEF2P (match_operand:SSEMODEF2P 2 "register_operand" "")
-                       (match_dup 4)))
+  [(set (match_dup 4)
+       (and:SSEMODEF2P 
+         (not:SSEMODEF2P (match_dup 3))
+         (match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")))
+   (set (match_dup 5)
+       (and:SSEMODEF2P (match_dup 3)
+                       (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "")))
    (set (match_operand:SSEMODEF2P 0 "register_operand" "")
-       (ior:SSEMODEF2P (match_dup 5) (match_dup 6)))]
+       (ior:SSEMODEF2P (match_dup 4) (match_dup 5)))]
   "SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
 {
-  operands[3] = ix86_build_signbit_mask (<ssescalarmode>mode, 1, 1);
-  operands[4] = ix86_build_signbit_mask (<ssescalarmode>mode, 1, 0);
+  operands[3] = ix86_build_signbit_mask (<ssescalarmode>mode, 1, 0);
 
+  operands[4] = gen_reg_rtx (<MODE>mode);
   operands[5] = gen_reg_rtx (<MODE>mode);
-  operands[6] = gen_reg_rtx (<MODE>mode);
 })
 
 ;; Also define scalar versions.  These are used for abs, neg, and