[PATCH 1/2] ppc: extend opindex to 16 bits

Alan Modra amodra@gmail.com
Thu May 12 00:13:54 GMT 2022


On Wed, May 11, 2022 at 08:59:19PM +0300, Dmitry Selyutin wrote:
> +         Also, this field is signed due to historical reasons.  */

Huh?  What makes you say that?

Also, your patch misses changing the following.  The existing 0xff
mask was from a time when fx_pcrel_adjust was a signed char.

      int opindex = fixP->fx_pcrel_adjust & 0xff;

This could be any of
      int opindex = fixP->fx_pcrel_adjust & 0xffff;
      int opindex = (uint16_t) fixP->fx_pcrel_adjust;
      uint16_t opindex = fixP->fx_pcrel_adjust;
Which you choose is a matter of style.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list