[Bug tree-optimization/85694] Generation of vectorized AVG (Average) instruction

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 8 16:18:00 GMT 2018


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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #2)
> Hmm, but if you have 255 + 255 + 1 then you need to use pavgw at least,
> otherwise the vectorization isn't semantically equivalent?  Or do the
> instructions compute
> the intermediate results in greater precision than 8 bits?  The specification
> doesn't seem to tell.
> 
> Can you clarify?

According to [1], intermediate result has 9 bit precision for pavgb and 17bit
precision for pavgw.

[1] http://www.felixcloutier.com/x86/PAVGB:PAVGW.html


More information about the Gcc-bugs mailing list