[Bug target/34653] unnecessary REX prefix
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added Severity|normal |enhancement http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
[Bug target/34653] unnecessary REX prefix
--- Comment #1 from dean at arctic dot org 2008-01-03 19:27 --- oops i should have used an "unsigned long" for the tag rather than unsigned long long, not that it matters much. here's an expanded example showing another unnecessary REX: extern unsigned long table[]; unsigned long foo(unsigned char *p) { unsigned long tag = *p; return table[tag >> 4] + table[tag & 0xf]; } which generates: 0: 0f b6 17movzbl (%rdi),%edx 3: 48 89 d0mov%rdx,%rax 6: 48 c1 ea 04 shr$0x4,%rdx a: 83 e0 0fand$0xf,%eax d: 48 8b 04 c5 00 00 00mov0x0(,%rax,8),%rax 14: 00 11: R_X86_64_32Stable 15: 48 03 04 d5 00 00 00add0x0(,%rdx,8),%rax 1c: 00 19: R_X86_64_32Stable 1d: c3 retq and in this case the "mov %rdx,%rax" could be "mov %edx,%eax" because of the dominating movzbl. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
[Bug target/34653] unnecessary REX prefix
--- Comment #2 from ubizjak at gmail dot com 2009-09-17 09:50 --- (In reply to comment #1) > and in this case the "mov %rdx,%rax" could be "mov %edx,%eax" because of the > dominating movzbl. 32bit moves and other instructions _SIGN_EXTEND_ results to 64bits on x86_64. -- ubizjak at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
[Bug target/34653] unnecessary REX prefix
--- Comment #3 from dean at arctic dot org 2009-09-17 10:23 --- (In reply to comment #2) > (In reply to comment #1) > > > and in this case the "mov %rdx,%rax" could be "mov %edx,%eax" because of the > > dominating movzbl. > > 32bit moves and other instructions _SIGN_EXTEND_ results to 64bits on x86_64. > every single data type in my example was unsigned. -- dean at arctic dot org changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
[Bug target/34653] unnecessary REX prefix
--- Comment #4 from dean at arctic dot org 2009-09-17 10:27 --- (In reply to comment #2) > 32bit moves and other instructions _SIGN_EXTEND_ results to 64bits on x86_64 wait i just reread your statement. the amd64 ISA zero-extends 32-bit register writes out to 64-bits. please go read the documentation. -dean -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653
[Bug target/34653] unnecessary REX prefix
--- Comment #5 from hjl dot tools at gmail dot com 2009-09-17 13:47 --- This is a dup for PR 17387. *** This bug has been marked as a duplicate of 17387 *** -- hjl dot tools at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653