[Bug target/106060] Inefficient constant broadcast on x86_64
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 23 15:46:36 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106060
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 53196
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53196&action=edit
A patch
This generates:
0000000000000000 <shouldnt_have_movabs>:
0: b8 7b 00 00 00 mov $0x7b,%eax
5: c5 f9 6e c0 vmovd %eax,%xmm0
9: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0
e: c3 ret
f: 90 nop
0000000000000010 <should_be_cmpeq_abs>:
10: b8 01 00 00 00 mov $0x1,%eax
15: c5 f9 6e c0 vmovd %eax,%xmm0
19: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0
1e: c3 ret
1f: 90 nop
0000000000000020 <should_be_cmpeq_add>:
20: b8 fe ff ff ff mov $0xfffffffe,%eax
25: c5 f9 6e c0 vmovd %eax,%xmm0
29: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0
2e: c3 ret
More information about the Gcc-bugs
mailing list