diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-06-08 14:57:18 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-06-08 14:57:18 +0200 |
commit | 7e96fb68712d07f3a2c0d3e1b0b1a4faaa240f39 (patch) | |
tree | a15dfd817602d42207a8bb4b1c289464d1579c1c | |
parent | cd613c1fccd8c3b7872bea76da6a048c41884d41 (diff) | |
download | gdb-7e96fb68712d07f3a2c0d3e1b0b1a4faaa240f39.zip gdb-7e96fb68712d07f3a2c0d3e1b0b1a4faaa240f39.tar.gz gdb-7e96fb68712d07f3a2c0d3e1b0b1a4faaa240f39.tar.bz2 |
x86: minor improvements to optimize_imm() (part II)
Don't kind-of-open-code fits_in_unsigned_{word,long}().
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5f19f85..935efaa 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2021-06-08 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (optimize_imm): Use fits_in_unsigned_word + and fits_in_unsigned_long. + +2021-06-08 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (optimize_disp): Use fits_in_unsigned_word and fits_in_unsigned_long. Combine if()s. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 17398ee..80b7098 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -5793,7 +5793,7 @@ optimize_imm (void) This allows a 16-bit operand such as $0xffe0 to be recognised as within Imm8S range. */ if ((i.types[op].bitfield.imm16) - && (i.op[op].imms->X_add_number & ~(offsetT) 0xffff) == 0) + && fits_in_unsigned_word (i.op[op].imms->X_add_number)) { i.op[op].imms->X_add_number = ((i.op[op].imms->X_add_number ^ 0x8000) - 0x8000); @@ -5801,8 +5801,7 @@ optimize_imm (void) #ifdef BFD64 /* Store 32-bit immediate in 64-bit for 64-bit BFD. */ if ((i.types[op].bitfield.imm32) - && ((i.op[op].imms->X_add_number & ~(((offsetT) 2 << 31) - 1)) - == 0)) + && fits_in_unsigned_long (i.op[op].imms->X_add_number)) { i.op[op].imms->X_add_number = ((i.op[op].imms->X_add_number ^ ((offsetT) 1 << 31)) |