ia64.md (divdf3_internal_thr): Fix algorithm.
authorSteve Ellcey <sje@cup.hp.com>
Thu, 4 Mar 2004 21:21:36 +0000 (21:21 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Thu, 4 Mar 2004 21:21:36 +0000 (21:21 +0000)
* config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm.
* testsuite/gcc.dg/20040303-1.c: New test.

From-SVN: r78934

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

index 85b7c0eba31b71c9843d22f9fc00261946aed425..16fa29c669b3a281e52beb5554c532a01ac5296e 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-04  Steve Ellcey  <sje@cup.hp.com>
+
+       * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm.
+       * testsuite/gcc.dg/20040303-1.c: New test.
+
 2004-03-04  Steven Bosscher  <stevenb@suse.de>
 
        * ppro.md: Rewrite as a DFA pipeline description.
index 39694b1baed10f971667a86f9b043dbeaff9ed0c..1c0cc1230e5daf666b158c948fee978b4d405bb7 100644 (file)
    (cond_exec (ne (match_dup 5) (const_int 0))
      (parallel [(set (match_dup 9)
                     (float_truncate:DF
-                      (mult:XF (match_dup 7) (match_dup 3))))
+                      (mult:XF (match_dup 7) (match_dup 6))))
                (use (const_int 1))]))
    (cond_exec (ne (match_dup 5) (const_int 0))
      (parallel [(set (match_dup 4)
diff --git a/gcc/testsuite/gcc.dg/20040303-1.c b/gcc/testsuite/gcc.dg/20040303-1.c
new file mode 100644 (file)
index 0000000..3258538
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test floating point division on ia64.  There was a bug in the
+   max-throughput version of the inline division code.  Expecting an
+   exact value from a floating point expression is unwise but GCC
+   depends on it in allocno_compare.  */
+
+/* { dg-do run { target ia64-*-* } } */
+/* { dg-options "-minline-float-divide-max-throughput" { target ia64-*-* } } */
+
+extern void abort (void);
+
+volatile int i = 24;
+volatile int j = 30;
+volatile int k = 1;
+
+int main()
+{
+        int pri2 = (((double) i / j) * (10000 / 1000) * k);
+        if (pri2 != 8) abort();
+       return 0;
+}