[PATCH] Add new target-hook truncated_to_mode
Joern RENNECKE
joern.rennecke@st.com
Wed Mar 15 14:58:00 GMT 2006
Richard Sandiford wrote:
>
>
>And you replied with what I thought to be examples of where that might
>not hold, and where defining the hook above would therefore be wrong.
>Did I misunderstand?
>
>In summary, could the hook be defined for SH too, in the way described above?
>
>
I really want to fix the endian-issue for floating point registers so
that vectors and
unions can be put into floating point registers where this makes the
most sense
for code generation. That means if a sign extension is a no-op will
depend on the
register class of the hard register that you are doing the operation on.
You have to perserve the operation anyway, if you spill the register to
memory.
So what the target could tell the middle-end is that the sign-extension
operation
for a particular mode pair is expected to be a no-op, but that this is
subject to register
allocation; and the register classs for which this is a no-op.
If we want to describe what operation a SUBREG is equivalent to, we
should include
an register class argument to be more specific. If the argument is
ALL_REGS, a
definite operation should only be returned if it is true universally,
otherwise UNKNOWN.
For a true noop conversion we could use the code SUBREG or CONST_INT (as
in NOP,
which is represented with the pattern (const_int 0)).
The optimizers will probably be most interested in the behaviour for
GENERAL_REGS
in particular.
More information about the Gcc-patches
mailing list