[Bug target/7285] [ia64] unsigned-to-floating conversion not spec conformant

jbeulich at novell dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 18 08:08:00 GMT 2004


------- Additional Comments From jbeulich at novell dot com  2004-03-18 08:08 -------
Just to clarify: I saw the problem on an OS project that is no longer alive
(hence the cross compiler), and I don't have access to an IA64 box that would
permit me installing Linux on it. Thus I can't at present redo the full analysis
(but of course, you should almost always see a denormal exception, since
setf.sig's output, unless having full 64 significant bits, is always denormal).
Nevertheless, the current way of generating code is not in line with fcvt.xf,
and is not in line with the Intel (on Windows - again, I don't have a suitable
Linux system at hand) compiler (I'm not sure why the HP compiler would serve as
a [better] reference, or why it not behaving consistently would be a reason for
gcc to also fail to do so).

Actually, looking at this again, I believe the behavior should even further be
corrected (even in Intel's compiler): When the result is not 'long double', it
should first normalize the setf.sig output to full precision using sf1, then
normalize it to target precision using sf0:

     setf.sig f6 = r32;;
     fcvt.xuf.sf1 f7 = f6;;
     fnorm.[sd] f8 = f7

thus hiding the denormal exception, but raising a potential inexcat one. I'll
contact Intel on that, too. The normalizing-to-target-precision appears to be
done correctly in both (.xf and .xuf) cases in gcc, so it is really the
intermediate normalize-to-full-precision step that is missing for other than
'long double' results, and only for 'long double' results the entire
normalization would need to be replaced by the one using sf1.

-- 


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



More information about the Gcc-bugs mailing list