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: help for arm avr bfin cris frv h8300 m68k mcore mmix pdp11 rs6000 sh vax


> Date: Fri, 13 Mar 2009 12:34:49 +0100
> From: Paolo Bonzini <bonzini@gnu.org>

> 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 answer to the question is "no", but I'd guess the more
useful answer is "yes", for different definitions of "truncate".

For CRIS, shift counts (variable; literate ones are 5 bits) are
truncated to 6 (six) bits, regardless of the mode of the shift
result (NB, all standard-named shifts are define_expanded to
SImode, though anon strict_low_part-matching patterns for other
modes exist).  See also
<http://www.axis.com/files/manuals/etrax_fs_des_ref-070821.pdf>,
<http://www.axis.com/files/tech_notes/etrax_100lx_prog_man-050519.pdf>
and src/cpu/cris.cpu.

So, if the result of the truncation has bit 5 set for SImode,
the results is 0.  For smaller modes, a size larger than the
number of bits of the mode yields the extended result in those
bits (i.e. all 1 or 0, depending on the operation).

brgds, H-P


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