[Bug target/73350] AVX512: GCC optimizes away rounding flags
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 11 11:16:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=73350
--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> The "simplest" way would be to have separate UNSPECs for all ops (but that
> explodes the number of unspecs I guess).
Would that be so bad? As far as gcc understands addition, this is not an
addition, representing it with 'plus' is a lie.
> So another way would be sth like
>
> (insn (set (reg:V16SF 110)
> (vec_merge:V16SF (plus:V16SF (reg:V16SF 111)
> (reg:V16SF 112))
> (reg:V16SF 113)
> (reg:HI 114))))
>
> (insn (set (reg:V16SF 110) (unspec [ (reg:V16SF 110) (const_int 9) ]
> UNSPEC_EMBEDDED_ROUNDING) ])
>
> or merging this "rounding operation" into the operation (around the
> plus, one of its operands or around the merge).
I guess the unspec alone wouldn't match anything, which prevents constant
propagation, but I would still fear combine merging a regular addition with a
rounded one (when they simplify), producing a single rounded operation. If you
want to wrap plus with unspecs, you may have to put them on both operands and
the result to be safe...
More information about the Gcc-bugs
mailing list