* i386.md (cvtts?2si peep2): New.
authorJan Hubicka <jh@suse.cz>
Tue, 18 Mar 2003 16:32:12 +0000 (17:32 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 18 Mar 2003 16:32:12 +0000 (16:32 +0000)
From-SVN: r64537

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/i386-cvt-1.c [new file with mode: 0644]

index dadb5d81475d76ce3fb7806f59f71cc974264908..46daf2702b625735bb05e29fbc119f2881c284bc 100644 (file)
@@ -1,3 +1,7 @@
+Tue Mar 18 13:15:08 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * i386.md (cvtts?2si peep2): New.
+
 2003-03-18  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (*iorsi3_two_qi_zext): New.
index 39b8f6ac12c139a656d6501647cb8772e468ac13..22b6a14a3b145edfa64eb88a814e91cbb69b7302 100644 (file)
    (set (match_dup 0) (fix:DI (match_dup 2)))]
   "")
 
+;; Avoid vector decoded form of the instruction.
+(define_peephole2
+  [(match_scratch:SF 2 "x")
+   (set (match_operand:DI 0 "register_operand" "")
+       (fix:DI (match_operand:SF 1 "memory_operand" "")))]
+  "TARGET_K8 && !optimize_size"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_dup 0) (fix:DI (match_dup 2)))]
+  "")
+
 (define_insn "fix_truncdfdi_sse"
   [(set (match_operand:DI 0 "register_operand" "=r,r")
        (fix:DI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
    (set (match_dup 0) (fix:DI (match_dup 2)))]
   "")
 
+;; Avoid vector decoded form of the instruction.
+(define_peephole2
+  [(match_scratch:DF 2 "Y")
+   (set (match_operand:DI 0 "register_operand" "")
+       (fix:DI (match_operand:DF 1 "memory_operand" "")))]
+  "TARGET_K8 && !optimize_size"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_dup 0) (fix:DI (match_dup 2)))]
+  "")
+
 ;; Signed conversion to SImode.
 
 (define_expand "fix_truncxfsi2"
    (set (match_dup 0) (fix:SI (match_dup 2)))]
   "")
 
+;; Avoid vector decoded form of the instruction.
+(define_peephole2
+  [(match_scratch:SF 2 "x")
+   (set (match_operand:SI 0 "register_operand" "")
+       (fix:SI (match_operand:SF 1 "memory_operand" "")))]
+  "TARGET_K8 && !optimize_size"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_dup 0) (fix:SI (match_dup 2)))]
+  "")
+
 (define_insn "fix_truncdfsi_sse"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
        (fix:SI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
   [(set_attr "type" "sseicvt")
    (set_attr "athlon_decode" "double,vector")])
 
+;; Avoid vector decoded form of the instruction.
+(define_peephole2
+  [(match_scratch:DF 2 "Y")
+   (set (match_operand:SI 0 "register_operand" "")
+       (fix:SI (match_operand:DF 1 "memory_operand" "")))]
+  "TARGET_K8 && !optimize_size"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_dup 0) (fix:SI (match_dup 2)))]
+  "")
+
 ;; Avoid vector decoded form of the instruction.
 (define_peephole2
   [(match_scratch:DF 2 "Y")
index 54ffa10c8b1cfda451c6d39556348bb1c39bfe3c..08fa15bb669660aa92f5145b841269524b25faf3 100644 (file)
@@ -1,3 +1,7 @@
+Tue Mar 18 13:14:05 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * gcc.dg/i386-cvt-1.c: New test.
+
 2003-03-17  Zack Weinberg  <zack@codesourcery.com>
 
         * objc.dg/naming-1.m: Use "(parse|syntax) error".
diff --git a/gcc/testsuite/gcc.dg/i386-cvt-1.c b/gcc/testsuite/gcc.dg/i386-cvt-1.c
new file mode 100644 (file)
index 0000000..c4558d7
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=k8 -mfpmath=sse" } */
+/* { dg-final { scan-assembler "cvttsd2si.*xmm" } } */
+/* { dg-final { scan-assembler "cvttss2si.*xmm" } } */
+int a,a1;
+double b;
+float b1;
+t()
+{
+       a=b;
+       a1=b1;
+}