]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/i386/i386.md (fixuns_trunc<mode>hi2): Implement from
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2007 11:32:13 +0000 (11:32 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2007 11:32:13 +0000 (11:32 +0000)
fixuns_truncsfhi2 and fixuns_truncdfhi2 using SSEMODEF
mode macro.
(fix_trunc<mode>di_sse): Implement from fix_truncsfdi_sse and
fix_truncdfdi_sse using SSEMODEF mode macro.
(fix_trunc<mode>si_sse): Implement from fix_truncsfsi_sse and
fix_truncdfsi_sse using SSEMODEF mode macro.
(fix_trunc?f?i_sse peephole2): Implement using SSEMODEF mode macro.
(fix_trunc?f?i_sse K8 peephole2): Fix register constraint.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122839 138bc75d-0d04-0410-961f-82ee72b054a4

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

index a94b344a40152ece3e98d6dd26556994ed261d5b..9113d5d4b9a65fb0560c226558a5f8cc67ca67bb 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-12  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (fixuns_trunc<mode>hi2): Implement from
+       fixuns_truncsfhi2 and fixuns_truncdfhi2 using SSEMODEF
+       mode macro.
+       (fix_trunc<mode>di_sse): Implement from fix_truncsfdi_sse and
+       fix_truncdfdi_sse using SSEMODEF mode macro.
+       (fix_trunc<mode>si_sse): Implement from fix_truncsfsi_sse and
+       fix_truncdfsi_sse using SSEMODEF mode macro.
+       (fix_trunc?f?i_sse peephole2): Implement using SSEMODEF mode macro.
+       (fix_trunc?f?i_sse K8 peephole2): Fix register constraint.
+
 2007-03-12  Richard Sandiford  <richard@codesourcery.com>
 
        * config.gcc (i[4567]86-wrs-vxworks, i[4567]86-wrs-vxworksae): Add
index 6bbb7520128523d522fb947eafe4809bd60e02e5..f3fb8487590bc5d7cebec1c42be4009788a14ee2 100644 (file)
 ;; Without these patterns, we'll try the unsigned SI conversion which
 ;; is complex for SSE, rather than the signed SI conversion, which isn't.
 
-(define_expand "fixuns_truncsfhi2"
+(define_expand "fixuns_trunc<mode>hi2"
   [(set (match_dup 2)
-       (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))
+       (fix:SI (match_operand:SSEMODEF 1 "nonimmediate_operand" "")))
    (set (match_operand:HI 0 "nonimmediate_operand" "")
        (subreg:HI (match_dup 2) 0))]
-  "TARGET_SSE_MATH"
-  "operands[2] = gen_reg_rtx (SImode);")
-
-(define_expand "fixuns_truncdfhi2"
-  [(set (match_dup 2)
-       (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))
-   (set (match_operand:HI 0 "nonimmediate_operand" "")
-       (subreg:HI (match_dup 2) 0))]
-  "TARGET_SSE_MATH && TARGET_SSE2"
+  "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
   "operands[2] = gen_reg_rtx (SImode);")
 
 ;; When SSE is available, it is always faster to use it!
-(define_insn "fix_truncsfdi_sse"
+(define_insn "fix_trunc<mode>di_sse"
   [(set (match_operand:DI 0 "register_operand" "=r,r")
-       (fix:DI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
-  "TARGET_64BIT && TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
-  "cvttss2si{q}\t{%1, %0|%0, %1}"
-  [(set_attr "type" "sseicvt")
-   (set_attr "mode" "SF")
-   (set_attr "athlon_decode" "double,vector")
-   (set_attr "amdfam10_decode" "double,double")])
-
-(define_insn "fix_truncdfdi_sse"
-  [(set (match_operand:DI 0 "register_operand" "=r,r")
-       (fix:DI (match_operand:DF 1 "nonimmediate_operand" "x,xm")))]
-  "TARGET_64BIT && TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
-  "cvttsd2si{q}\t{%1, %0|%0, %1}"
-  [(set_attr "type" "sseicvt")
-   (set_attr "mode" "DF")
-   (set_attr "athlon_decode" "double,vector")
-   (set_attr "amdfam10_decode" "double,double")])
-
-(define_insn "fix_truncsfsi_sse"
-  [(set (match_operand:SI 0 "register_operand" "=r,r")
-       (fix:SI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
-  "TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
-  "cvttss2si\t{%1, %0|%0, %1}"
+       (fix:DI (match_operand:SSEMODEF 1 "nonimmediate_operand" "x,xm")))]
+  "TARGET_64BIT && SSE_FLOAT_MODE_P (<MODE>mode)
+   && (!TARGET_FISTTP || TARGET_SSE_MATH)"
+  "cvtts<ssemodefsuffix>2si{q}\t{%1, %0|%0, %1}"
   [(set_attr "type" "sseicvt")
-   (set_attr "mode" "DF")
+   (set_attr "mode" "<MODE>")
    (set_attr "athlon_decode" "double,vector")
    (set_attr "amdfam10_decode" "double,double")])
 
-(define_insn "fix_truncdfsi_sse"
+(define_insn "fix_trunc<mode>si_sse"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
-       (fix:SI (match_operand:DF 1 "nonimmediate_operand" "x,xm")))]
-  "TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
-  "cvttsd2si\t{%1, %0|%0, %1}"
+       (fix:SI (match_operand:SSEMODEF 1 "nonimmediate_operand" "x,xm")))]
+  "SSE_FLOAT_MODE_P (<MODE>mode)
+   && (!TARGET_FISTTP || TARGET_SSE_MATH)"
+  "cvtts<ssemodefsuffix>2si\t{%1, %0|%0, %1}"
   [(set_attr "type" "sseicvt")
-   (set_attr "mode" "DF")
+   (set_attr "mode" "<MODE>")
    (set_attr "athlon_decode" "double,vector")
    (set_attr "amdfam10_decode" "double,double")])
 
 ;; Shorten x87->SSE reload sequences of fix_trunc?f?i_sse patterns.
 (define_peephole2
-  [(set (match_operand:DF 0 "register_operand" "")
-       (match_operand:DF 1 "memory_operand" ""))
-   (set (match_operand:SSEMODEI24 2 "register_operand" "")
-       (fix:SSEMODEI24 (match_dup 0)))]
-  "!TARGET_K8
-   && peep2_reg_dead_p (2, operands[0])"
-  [(set (match_dup 2) (fix:SSEMODEI24 (match_dup 1)))]
-  "")
-
-(define_peephole2
-  [(set (match_operand:SF 0 "register_operand" "")
-       (match_operand:SF 1 "memory_operand" ""))
+  [(set (match_operand:SSEMODEF 0 "register_operand" "")
+       (match_operand:SSEMODEF 1 "memory_operand" ""))
    (set (match_operand:SSEMODEI24 2 "register_operand" "")
        (fix:SSEMODEI24 (match_dup 0)))]
   "!TARGET_K8
 
 ;; Avoid vector decoded forms of the instruction.
 (define_peephole2
-  [(match_scratch:DF 2 "Y")
+  [(match_scratch:DF 2 "Y2")
    (set (match_operand:SSEMODEI24 0 "register_operand" "")
        (fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))]
   "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size"