https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127055

--- Comment #29 from Hongyu Wang <hongyuw at gcc dot gnu.org> ---
(In reply to Matthias Kretz (Vir) from comment #25)
> On my bit-manipulation solution: I fixed a bug and subsequently simplified
> the __jsatur derivation. However, benchmarks on my Laptop show no speed-up
> compared to the #c19 implementation. And without SSE4.1 it's also slower -
> but then again at least the existing trunc implementation without SSE4.1
> appears to allow spurious fp exceptions.
> 
> I'd say we should focus this PR on ceil, floor, and trunc. Further
> optimization for round can go to a new PR. Agreed? That means I'll post my
> patch from #c8.

Agreed, the round optimization needs to consider the supurious FE_INEXACT,
which your conforming implementation in #c19 would resolve, so we don't need
the -fno-trapping-math/-fno-rounding-math to do the vectorization, the old
ix86_expand_round_sse4 can be gated under !(flag_trapping_math &&
flag_rounding_math) to keep inexact but shorter copysign + add + trunc
implementation.

Currently with -fno-trapping-math/-fno-rounding-math, the HFmode vectorization
we meet the enforced extend to double and truncate back, so the sequence looks
bad, which would be another topic. See 
https://compiler-explorer.com/z/jE3oGsjbb

Reply via email to