aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2004-03-04 21:21:36 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2004-03-04 21:21:36 +0000
commitaa42f99db9e8d53813493550e4237db403cbedd2 (patch)
treeedecb1ac540effb999058b7890aead137e40f670
parent56bab4461e068180a6221184fc399adadc909035 (diff)
downloadgcc-aa42f99db9e8d53813493550e4237db403cbedd2.zip
gcc-aa42f99db9e8d53813493550e4237db403cbedd2.tar.gz
gcc-aa42f99db9e8d53813493550e4237db403cbedd2.tar.bz2
ia64.md (divdf3_internal_thr): Fix algorithm.
* config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm. * testsuite/gcc.dg/20040303-1.c: New test. From-SVN: r78934
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/ia64/ia64.md2
-rw-r--r--gcc/testsuite/gcc.dg/20040303-1.c20
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 85b7c0e..16fa29c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 39694b1..1c0cc12 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -3177,7 +3177,7 @@
(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
index 0000000..3258538
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20040303-1.c
@@ -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;
+}