[Bug middle-end/88097] Missing optimization of endian conversion
bugzilla@poradnik-webmastera.com
gcc-bugzilla@gcc.gnu.org
Mon Nov 19 16:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097
--- Comment #1 from Daniel Fruzynski <bugzilla@poradnik-webmastera.com> ---
I also tried to swap Word1 and Word2 fields in structure to see what will
happen. It turned out that gcc with -O3 -mmovbe generates code without movbe:
[asm]
test(Test*):
movzx eax, WORD PTR [rdi+2]
movzx edx, WORD PTR [rdi]
rorw $8, ax
rorw $8, dx
sal eax, 16
movzx edx, dx
or eax, edx
ret
[/asm]
clang generates code with movbe:
[asm]
test(Test*): # @test(Test*)
movbe cx, word ptr [rdi + 2]
shl ecx, 16
movbe ax, word ptr [rdi]
movzx eax, ax
or eax, ecx
ret
[/asm]
More information about the Gcc-bugs
mailing list