Re: [PATCH v2 4/5] target/s390x: Fix shifting 32-bit values for more than 31 bits

2022-01-12 Thread David Hildenbrand
> > +static uint32_t cc_calc_sla_32(uint32_t src, int shift) > +{ > +return cc_calc_sla_64(((uint64_t)src) << 32, shift); > +} > + Nice trick. What about doing the shift in op_sla if s->insn->data == 31 and unifying to a single CC_OP_SLA ? > static uint32_t cc_calc_flogr(uint64_t dst) >

[PATCH v2 4/5] target/s390x: Fix shifting 32-bit values for more than 31 bits

2022-01-11 Thread Ilya Leoshkevich
According to PoP, both 32- and 64-bit shifts use lowest 6 address bits. The current code special-cases 32-bit shifts to use only 5 bits, which is not correct. For example, shifting by 32 bits currently preserves the initial value, however, it's supposed zero it out instead. Fix by merging sh32