]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
spu.md (divdf3): Removed.
authorVictor Kaplansky <victork@il.ibm.com>
Tue, 2 Sep 2008 12:38:32 +0000 (12:38 +0000)
committerVictor Kaplansky <victork@gcc.gnu.org>
Tue, 2 Sep 2008 12:38:32 +0000 (12:38 +0000)
2008-09-02  Victor Kaplansky  <victork@il.ibm.com>

  * gcc/config/spu/spu.md (divdf3): Removed.

Testsuite Changelog:

  * gcc.dg/fastmath-2.c: New.

From-SVN: r139888

gcc/ChangeLog
gcc/config/spu/spu.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fastmath-2.c [new file with mode: 0644]

index f873898368a616b238e02530a19282e0895bb794..039edb6d5a5e474588143af4f3ef25987d8c1ef0 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-02  Victor Kaplansky  <victork@il.ibm.com>
+
+       * gcc/config/spu/spu.md (divdf3): Removed.
+  
+
 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/37095
index 89f2109ceb3816aa6e71d6c6ca495eb91c7b96a6..7b4b743fc8dcfbbb505011cf6161ce31126211c8 100644 (file)
     DONE;
   })
 
-;; Taken from STI's gcc
-;; Does not correctly handle INF or NAN.
-(define_expand "divdf3"
-  [(set (match_operand:DF 0 "register_operand" "=r")
-        (div:DF (match_operand:DF 1 "register_operand" "r")
-                (match_operand:DF 2 "register_operand" "r")))]
-  "flag_finite_math_only"
-  "{    
-    /*
-    double
-    divdf3 (double x, double y)
-    {
-        float x0;
-        float y_f = (float) y;
-        double x1, x2;
-
-        x0 = spu_extract(spu_re(spu_promote(y_f, 0)), 0);
-        x1 = (double)(x0 * (2.0f - y_f * x0)); 
-        x2 = x1 * (2.0 - y * x1);
-        return (x * x2 * (2.0 - y * x2));
-    }
-    */
-
-    rtx dst = operands[0];
-    rtx x   = operands[1];
-    rtx y   = operands[2];
-    rtx y_f = gen_reg_rtx(SFmode);
-    rtx x0_f = gen_reg_rtx(SFmode);
-    rtx x1_f = gen_reg_rtx(SFmode);
-    rtx x1 = gen_reg_rtx(DFmode);
-    rtx x2 = gen_reg_rtx(DFmode);
-    rtx t1_f = gen_reg_rtx(SFmode);
-    rtx t1 = gen_reg_rtx(DFmode);
-    rtx two = gen_reg_rtx(DFmode);
-    rtx two_f = gen_reg_rtx(SFmode);
-
-    emit_insn (gen_truncdfsf2 (y_f, y));
-    emit_insn (gen_frest_sf (x0_f, y_f));
-    emit_insn (gen_fi_sf (x0_f, y_f, x0_f));
-    emit_insn (gen_movsf (two_f, spu_float_const(\"2.0\",SFmode)));
-    emit_insn (gen_fnms_sf (t1_f, y_f, x0_f, two_f));
-    emit_insn (gen_mulsf3 (x1_f, t1_f, x0_f));
-    emit_insn (gen_extendsfdf2 (x1, x1_f));
-    emit_insn (gen_extendsfdf2 (two, two_f));
-    emit_insn (gen_movdf (t1, two));
-    emit_insn (gen_fnms_df (t1, y, x1, t1));
-    emit_insn (gen_muldf3 (x2, x1, t1));
-    emit_insn (gen_fnms_df (two, y, x2, two));
-    emit_insn (gen_muldf3 (dst, x2, two));
-    emit_insn (gen_muldf3 (dst, dst, x));
-    DONE;
-}")
 \f
 ;; sqrt
 
index 2b4495cdc4e29f0ab9f5a2df2a8649a7c80211f5..304e76c0cca24cb00e80acd44f726c5c1276a0ba 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-02  Victor Kaplansky  <victork@il.ibm.com>
+
+       * gcc.dg/fastmath-2.c: New.
+    
 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/37095
diff --git a/gcc/testsuite/gcc.dg/fastmath-2.c b/gcc/testsuite/gcc.dg/fastmath-2.c
new file mode 100644 (file)
index 0000000..2003cf9
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+
+volatile double a = 2.002083e-146;
+double b;
+
+int
+main()
+{
+  b = 1. / a;
+
+  if (b != (1. / 2.002083e-146))
+    abort ();
+  return 0;
+}
+