On Fri, Mar 13, 2009 at 2:14 PM, Bernd Schmidt <bernds_...@t-online.de> wrote:
> Paolo Bonzini wrote:
>> These are all the !SHIFT_COUNT_TRUNCATED targets.
>>
>> For 4.5 I would like to improve our RTL canonicalization so that no
>> out-of-range shifts are ever in the RTL representation.
>>
>> This in turn means that the description given by SHIFT_COUNT_TRUNCATED
>> must be exact.  Right now !SHIFT_COUNT_TRUNCATED means "I don't know",
>> I want it to mean "it is never truncated".
>>
>> I would like to know whether for avr,bfin,cris,frv,h8300,pdp11,rs6000
>> (which define SHIFT_COUNT_TRUNCATED as 0) and for mcore,sh,vax (which
>> do not define it at all) it is right that shift counts are never
>> truncated.
>
> The Blackfin does not truncate shift counts.  The documentation
> specifies that e.g. for "Dx >>= Dy" instructions, shift counts greater
> than 31 produce a result of zero.  Other shift instructions use a sign
> extended part of the shift count to shift either left or right.  "I
> don't know" is probably the best answer we can give the compiler.

Hm.  In fold-const.c we try to make sure to produce the same result
as the target would for constant-folding shifts.  Thus, Paolo, I think
what fold-const.c does is what we should assume for
!SHIFT_COUNT_TRUNCATED.  No?

Richard.

Reply via email to