[Bug target/93985] Sub-optimal assembly for %st(0) constant loading with SSE enabled (x86_64)
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Mar 1 20:07:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93985
Uroš Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |WONTFIX
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
To prevent unwanted use of x87 registers, register allocator is prohibited from
freely allocating x87 registers without -mfpmath=387 for SFmode and DFmode. You
should use long double and 1.0L to get what you want, e.g:
--cut here--
double
atan (double x)
{
long double _x = x;
long double _res;
__asm__("fpatan"
: "=t" (_res)
: "0" (1.0L) , "u" (_x)
: "st(1)");
return _res;
}
--cut here--
Alternatively, you could use -mfpmath=387,sse to enable x87 regs and x87
instructions also for x86_64.
More information about the Gcc-bugs
mailing list