[Bug target/82853] Optimize x % 3 == 0 without modulo
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 5 20:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82853
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Target| |x86_64-*-*
Component|tree-optimization |target
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Works for me on aarch64:
f:
mov w1, 21846
movk w1, 0x5555, lsl 16
smull x1, w0, w1
lsr x1, x1, 32
sub w1, w1, w0, asr 31
add w1, w1, w1, lsl 1
sub w0, w0, w1
ret
Most likely a target cost issue.
More information about the Gcc-bugs
mailing list