This is the mail archive of the gcc-bugs@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]

[Bug target/19974] incorrect complex division on ia-64 with flag_complex_method = 2


------- Additional Comments From rth at gcc dot gnu dot org  2005-02-17 02:47 -------
The "problem" is the use of the fused multiply-and-add instructions.  

1672          y = (b - (a * ratio)) / denom;
  d6:   70 70 24 0c 54 00                   fms.s.s0 f7=f9,f6,f14

This computes the intermediate results of the entire numerator with 82 bits of
precision.  One can argue that this is inappropriate, since it's not what the
source wrote.

HOWEVER, if I rewrite __divsc3 to explicitly use "long double" to compute
intermediate results -- which as far as I can see should be legitimate -- I 
also get 18059 for the imaginary part of the result.  As best I can figure,
that result is more mathematically correct than 0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19974


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