This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

IA64 bootstrap patch (inline division)


There was a bug in the maximum-throughput inline divide algorithm for
double precision numbers on IA64.  This was causing a bootstrap failure
with stage1 and stage2 objects not being identical.  This patch fixes
the divide algorithm and allows the bootstrap to work.

I tested it on IA64 linux and HP-UX.  The bootstrap worked on both
platforms and there were no test regressions.

OK to check in?


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.


*** gcc.orig/gcc/gcc/config/ia64/ia64.md	Wed Mar  3 16:07:25 2004
--- gcc/gcc/gcc/config/ia64/ia64.md	Wed Mar  3 16:07:37 2004
***************
*** 3177,3183 ****
     (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))))
  		(use (const_int 1))]))
     (cond_exec (ne (match_dup 5) (const_int 0))
       (parallel [(set (match_dup 4)
--- 3177,3183 ----
     (cond_exec (ne (match_dup 5) (const_int 0))
       (parallel [(set (match_dup 9)
  		     (float_truncate:DF
! 		       (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)
*** gcc.orig/gcc/gcc/testsuite/gcc.dg/20040303-1.c	Thu Mar  4 07:55:56 2004
--- gcc/gcc/gcc/testsuite/gcc.dg/20040303-1.c	Thu Mar  4 08:01:45 2004
***************
*** 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;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]