aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-07-13 10:18:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-07-13 10:32:15 -0700
commit7a705315596cf5effe01de8c3ac2535687c5663d (patch)
treee9ccee47ad781005714d1f1a444380d47a2d4be6 /gas
parentf413dd7439e295849018caa01efa8d783e43f532 (diff)
downloadgdb-7a705315596cf5effe01de8c3ac2535687c5663d.zip
gdb-7a705315596cf5effe01de8c3ac2535687c5663d.tar.gz
gdb-7a705315596cf5effe01de8c3ac2535687c5663d.tar.bz2
x86: Remove 32-bit sign extension in offset_in_range
When encoding a 32-bit offset, there is no need to sign-extend it to 64 bits since only the lower 32 bits are used. * config/tc-i386.c (offset_in_range): Remove 32-bit sign extension.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c8
2 files changed, 5 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 01862e0..aa49a90 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/tc-i386.c (offset_in_range): Remove 32-bit sign
+ extension.
+
2020-07-13 Nick Clifton <nickc@redhat.com>
* po/fr.po: Updated French translation.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 18f685c..192c5e1 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2539,14 +2539,6 @@ offset_in_range (offsetT val, int size)
default: abort ();
}
-#ifdef BFD64
- /* If BFD64, sign extend val for 32bit address mode. */
- if (flag_code != CODE_64BIT
- || i.prefix[ADDR_PREFIX])
- if ((val & ~(((addressT) 2 << 31) - 1)) == 0)
- val = (val ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31);
-#endif
-
if ((val & ~mask) != 0 && (val & ~mask) != ~mask)
{
char buf1[40], buf2[40];