This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/32803] -Os: shorter load immediates for x86_64
- From: "dean at arctic dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2009 10:51:03 -0000
- Subject: [Bug target/32803] -Os: shorter load immediates for x86_64
- References: <bug-32803-5748@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from dean at arctic dot org 2009-09-17 10:51 -------
(In reply to comment #3)
> For the push/pop you need to add 2 bytes to the CFI which makes it useless
> compared to mov $imm32,reg.
>
note that my push/pop example said -128..127 and "push $imm8"... not imm32.
GNU assembler version 2.18.0 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.18.0.20080103
% cat t.S
mov $0x7f,%eax
push $0x7f
pop %rax
% objdump -dr t.o
...
0000000000000000 <.text>:
0: b8 7f 00 00 00 mov $0x7f,%eax
5: 6a 7f pushq $0x7f
7: 58 pop %rax
i count 5 bytes vs. 3 bytes.
similarly:
0: b8 80 ff ff ff mov $0xffffff80,%eax
5: 6a 80 pushq $0xffffffffffffff80
7: 58 pop %rax
-dean
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32803