mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
x86: slightly simplify offset_in_range()
Applying a mask with all bits set (or its inverse, with hence all bits clear) won't alter the result (or won't trigger the warning). Re-arrange the code to eliminate two more of the somewhat odd (2 << width_minus_1) constructs.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2021-06-15 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
|
* config/tc-i386.c (offset_in_range): Bail early when mask would
|
||||||
|
cover all bits anyway.
|
||||||
|
|
||||||
2021-06-15 Jan Beulich <jbeulich@suse.com>
|
2021-06-15 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
* config/tc-i386.c (optimize_disp): Generalize disp32 part of
|
* config/tc-i386.c (optimize_disp): Generalize disp32 part of
|
||||||
|
@ -2556,10 +2556,10 @@ offset_in_range (offsetT val, int size)
|
|||||||
{
|
{
|
||||||
case 1: mask = ((addressT) 1 << 8) - 1; break;
|
case 1: mask = ((addressT) 1 << 8) - 1; break;
|
||||||
case 2: mask = ((addressT) 1 << 16) - 1; break;
|
case 2: mask = ((addressT) 1 << 16) - 1; break;
|
||||||
case 4: mask = ((addressT) 2 << 31) - 1; break;
|
|
||||||
#ifdef BFD64
|
#ifdef BFD64
|
||||||
case 8: mask = ((addressT) 2 << 63) - 1; break;
|
case 4: mask = ((addressT) 1 << 32) - 1; break;
|
||||||
#endif
|
#endif
|
||||||
|
case sizeof (val): return val;
|
||||||
default: abort ();
|
default: abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user