On Wed, Jan 12, 2011 at 08:13:45PM -0500, Mike Frysinger wrote: > are there any rules with the tcg sar/shl/shr ops and their magnitudes > ? such as "magnitudes cannot be larger than the register size" ?
Yes, the result is undefined in those cases. > i have a 32bit register with the value of 0x1230002 and when i attempt > to do a sari with a value >=32, it gives me 0x918001 (a single shift > right has been done). i would have expected the value to be 0 (as > that is what my architecture does). You need to handle it in the translator. CRIS has similar semantics as your arch. See target-cris/translate.c:t_gen_lsl() for one way of doing it. There might be better ways though. Cheers