[Bug target/85950] Unsafe-math-optimizations regresses optimization using SSE4.1 roundss

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 29 10:25:00 GMT 2018


--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Allan Jensen from comment #4)
> Btw, I found this while trying to figure out why std::round() wasn't also
> optimized to a single roundss instruction, is that just a missing
> optimization or is there a quirk about that that makes them not fit?
> I noticed the definition of the ROUND enum in i386.md is even missing the
> entry to for normal rounding (0 AFAIK)

round() rounds half away from zero, while roundss/roundsd (using normal
rounding) rounds half to even.

More information about the Gcc-bugs mailing list