This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed]: Peepholes to optimize fix_trunc?f?i_sse code for -mfpmath=387


Hello!

Patch was discussed at http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00519.html, approved at http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00040.html.

2006-10-21 Uros Bizjak <uros@kss-loka.si>

       PR target/19398
       * config/i386/i386.md (fix_trunc?f?i_sse): Add peephole2
       patterns to use memory input operand in x87->mem->XMM
       reload sequences.  Skip transformation for TARGET_K8.

Patch was bootstrapped on x86_64-pc-linux-gnu, regtested for c, c++ and fortran.

Uros.
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md	(revision 117934)
+++ config/i386/i386.md	(working copy)
@@ -4159,6 +4159,27 @@
    (set_attr "mode" "DF")
    (set_attr "athlon_decode" "double,vector")])
 
+;; 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: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)))]
+  "")
+
 ;; Avoid vector decoded forms of the instruction.
 (define_peephole2
   [(match_scratch:DF 2 "Y")

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]