This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: x86: Optimize signed 32bit displacements


My last patch to optimize_disp didn't optimize signed 32bit
displacements. I will check in this patch to fix it.


H.J.
----
gas/

2005-07-10  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (optimize_disp): Optimize signed 32bit
	displacements.

testsuite/gas/

2005-07-10  H.J. Lu  <hongjiu.lu@intel.com>

	* i386/x86_64.s: Add absolute siged 32bit addressing tests for
	mov.
	* i386/x86_64.d: Updated.

--- gas/config/tc-i386.c.signed	2005-07-08 10:19:55.000000000 -0700
+++ gas/config/tc-i386.c	2005-07-10 09:38:20.112392622 -0700
@@ -2106,7 +2106,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;
 	      }
--- gas/testsuite/ChangeLog.signed	2005-07-08 08:42:25.000000000 -0700
+++ gas/testsuite/ChangeLog	2005-07-10 09:43:59.372529909 -0700
@@ -103,7 +103,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  <jbeulich@novell.com>
 
--- gas/testsuite/gas/i386/x86_64.d.signed	2005-06-20 17:18:45.000000000 -0700
+++ gas/testsuite/gas/i386/x86_64.d	2005-07-10 09:38:20.199378299 -0700
@@ -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
--- gas/testsuite/gas/i386/x86_64.s.signed	2005-06-20 17:18:45.000000000 -0700
+++ gas/testsuite/gas/i386/x86_64.s	2005-07-10 09:45:38.559197792 -0700
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]