[PATCH 0/2][MSP430] Optimize zero_extend insns and PSImode pointer manipulation

Segher Boessenkool segher@kernel.crashing.org
Wed Oct 16 00:21:00 GMT 2019


On Tue, Oct 15, 2019 at 12:49:18PM -0600, Jeff Law wrote:
> There aren't many that use PSImode.  In general we don't handle partial
> modes well in the optimizers -- largely because they're just not that
> common and the exact size is unspecified.  PSImode for example can be
> anywhere between 16 and 32 bits.  We can't track the sign bit state,
> simplify extensions, etc etc.

For GCC, it has exactly 32 bits, just not all are necessarily significant:

  A @code{MODE_PARTIAL_INT} mode behaves as if it were as wide as the
  corresponding @code{MODE_INT} mode, except that it has an unknown
  number of undefined bits.

So sure, you could use only the low 16 bits of it, for example, if that
works out well for your port.

Such modes cannot (in the portable code) be used for any arithmetic, only
for data movement and the like.

> One of the problems I distinctly remember is the promotion of integer
> loop induction variables to ptrdiff_t then using them in pointer
> arithmetic generated *horrible* code.

Heh.


Segher



More information about the Gcc-patches mailing list