On 2017-05-26 09:35, Richard Henderson wrote:
> On 05/25/2017 02:05 PM, Aurelien Jarno wrote:
> > +        } else if (srclen > ssize) {
> >               b = cpu_ldub_data_ra(env, src, ra) & 0x0f;
> > -            src--;
> > -            srclen--;
> > +            src -= ssize;
> > +            srclen -= ssize;
> 
> Surely we need to use lduw in order to correctly read the big-endian 16-bit
> value, or bias src by +1 to read the low byte of same.

The operands are read from right to left, therefore src is adjusted to
point to the last byte before the for loop:

+    /* The operands are processed from right to left.  */
+    src += srclen - 1;
+    dest += destlen - 1;

Given s390 is big-endian, it means src initially always point to the
low byte independently to the size of the value.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                 http://www.aurel32.net

Reply via email to