This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Discard P - (P + CST) optimization in pointer_diff (PR c/61240)

On Aug 6, 2014, at 12:45 PM, DJ Delorie <> wrote:
>> What’s PSImode?
> PSImode is a mode with more precision than HImode, but less than SImode.

:-) I phrase it this way, there is no PSImode anymore in gcc.  It is gone, the concept is gone.  Some ports can choose to create a mode for the port with that name, and attach any semantics they want to it, below are some examples:

config/avr/avr-modes.def:FRACTIONAL_INT_MODE (PSI, 24, 3);
config/m32c/m32c-modes.def:PARTIAL_INT_MODE (SI, 24, PSI);
config/msp430/msp430-modes.def:PARTIAL_INT_MODE (SI, 20, PSI);
config/sh/sh-modes.def:PARTIAL_INT_MODE (SI, 22, PSI);

On such systems, the name refers to exactly what ever mode is defined.  By convention, it is usually no larger than SImode, however, the note about more precision than HImode, well, that’s wrong for my port.  I have a P1DI mode with a width of 64 bits, and a precision of 1.

> There's still lots of places in gcc that use SIZE where they should

Yes, and in time, they’ll all get cleaned up.

> I also added a step that looks for target-defined
> conversions between, for example, HImode and PSImode (rather than go
> HI->SI->PSI).

I hope they always fall back to the usual conversions.  On my port, I can move them into gprs and do all the usual gpr instructions on them.  The register allocator allocates the mode specific registers and moves them around as appropriate.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]