This is the mail archive of the gcc@gcc.gnu.org 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: Rationale for an old TRUNCATE patch


Adam Nemet <anemet@caviumnetworks.com> writes:

> Ian Lance Taylor writes:
>> truncate has a machine independent meaning.
>
> Yes, I guess with your definition below it does.  It's interesting though that
> Jim had said the opposite in the excerpts posted by Jeff:
>
>   And a later message from Jim:
>   
>   Truncate converts a value from a larger to a smaller mode in a machine
>   dependent way.
>   
>   A subreg just chops off the high bits.  A truncate does not.  The name might
>   be a little confusing, but the whole point of truncate is to have something
>   that operates differently than a subreg.
>   
>   Combine is clearly making an invalid transformation.

I'm not entirely sure, but I don't think Jim said the opposite.  He said
that the way truncate works is machine dependent.  I said that the
output of truncate is machine independent.  Since truncate is only
defined for fixed-point modes, I think both statements are true.

Ian


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