From: H.J. Lu Date: Sun, 10 Jul 2005 16:54:01 +0000 (+0000) Subject: gas/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28a9d8f5e472baeeffd915c1cb43be4dac1d979c;p=binutils-gdb.git gas/ 2005-07-10 H.J. Lu * config/tc-i386.c (optimize_disp): Optimize signed 32bit displacements. testsuite/gas/ 2005-07-10 H.J. Lu * i386/x86_64.s: Add absolute siged 32bit addressing tests for mov. * i386/x86_64.d: Updated. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 16f5072028f..70435ef8b26 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2005-07-10 H.J. Lu + + * config/tc-i386.c (optimize_disp): Optimize signed 32bit + displacements. + 2005-07-08 Ben Elliston * frags.h: Remove ANSI_PROTOTYPES conditional code. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 4b571942a09..f5c42dfcc35 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2108,7 +2108,10 @@ optimize_disp () else if (flag_code == CODE_64BIT) { if (fits_in_signed_long (disp)) - i.types[op] |= Disp32S; + { + i.types[op] &= ~Disp64; + i.types[op] |= Disp32S; + } if (fits_in_unsigned_long (disp)) i.types[op] |= Disp32; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 5e3a1f04256..052ea8368dc 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-07-10 H.J. Lu + + * i386/x86_64.s: Add absolute siged 32bit addressing tests for + mov. + * i386/x86_64.d: Updated. + 2005-07-08 Hans-Peter Nilsson PR gas/1049 @@ -103,7 +109,7 @@ PR 1013 * i386/x86_64.s: Add absolute 64bit addressing tests for mov. - * i386/x86_64.s: Updated. + * i386/x86_64.d: Updated. 2005-06-17 Jan Beulich diff --git a/gas/testsuite/gas/i386/x86_64.d b/gas/testsuite/gas/i386/x86_64.d index 43b91321389..2356570670c 100644 --- a/gas/testsuite/gas/i386/x86_64.d +++ b/gas/testsuite/gas/i386/x86_64.d @@ -140,4 +140,20 @@ Disassembly of section .text: 27e: 66 a3 11 22 33 44 55 66 77 88 mov[ ]+%ax,0x8877665544332211 288: a3 11 22 33 44 55 66 77 88 mov[ ]+%eax,0x8877665544332211 291: 48 a3 11 22 33 44 55 66 77 88 mov[ ]+%rax,0x8877665544332211 + 29b: 8a 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%al + 2a2: 66 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%ax + 2aa: 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%eax + 2b1: 48 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%rax + 2b9: 88 04 25 11 22 33 ff mov[ ]+%al,0xffffffffff332211 + 2c0: 66 89 04 25 11 22 33 ff mov[ ]+%ax,0xffffffffff332211 + 2c8: 89 04 25 11 22 33 ff mov[ ]+%eax,0xffffffffff332211 + 2cf: 48 89 04 25 11 22 33 ff mov[ ]+%rax,0xffffffffff332211 + 2d7: 8a 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%al + 2de: 66 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%ax + 2e6: 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%eax + 2ed: 48 8b 04 25 11 22 33 ff mov[ ]+0xffffffffff332211,%rax + 2f5: 88 04 25 11 22 33 ff mov[ ]+%al,0xffffffffff332211 + 2fc: 66 89 04 25 11 22 33 ff mov[ ]+%ax,0xffffffffff332211 + 304: 89 04 25 11 22 33 ff mov[ ]+%eax,0xffffffffff332211 + 30b: 48 89 04 25 11 22 33 ff mov[ ]+%rax,0xffffffffff332211 #pass diff --git a/gas/testsuite/gas/i386/x86_64.s b/gas/testsuite/gas/i386/x86_64.s index 812007ffae2..3e5532ab297 100644 --- a/gas/testsuite/gas/i386/x86_64.s +++ b/gas/testsuite/gas/i386/x86_64.s @@ -170,5 +170,23 @@ movw %ax,0x8877665544332211 movl %eax,0x8877665544332211 movq %rax,0x8877665544332211 +#absolute signed 32bit addressing +mov 0xffffffffff332211,%al +mov 0xffffffffff332211,%ax +mov 0xffffffffff332211,%eax +mov 0xffffffffff332211,%rax +mov %al,0xffffffffff332211 +mov %ax,0xffffffffff332211 +mov %eax,0xffffffffff332211 +mov %rax,0xffffffffff332211 +movb 0xffffffffff332211,%al +movw 0xffffffffff332211,%ax +movl 0xffffffffff332211,%eax +movq 0xffffffffff332211,%rax +movb %al,0xffffffffff332211 +movw %ax,0xffffffffff332211 +movl %eax,0xffffffffff332211 +movq %rax,0xffffffffff332211 + # Get a good alignment. .p2align 4,0