* i386.md (cvtts?2si peep2): New.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Mar 2003 16:32:12 +0000 (16:32 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Mar 2003 16:32:12 +0000 (16:32 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64537 138bc75d-0d04-0410-961f-82ee72b054a4

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

index dadb5d8..46daf27 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 39b8f6a..22b6a14 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")))]
 (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")
+   (set (match_operand:SI 0 "register_operand" "")
        (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
   "TARGET_K8 && !optimize_size"
   [(set (match_dup 2) (match_dup 1))
index 54ffa10..08fa15b 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;
+}