qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 21/26] target/s390x: implement PACK UNICODE


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 21/26] target/s390x: implement PACK UNICODE
Date: Tue, 30 May 2017 09:46:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/29/2017 04:22 AM, Aurelien Jarno wrote:
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.


Quite right.  I didn't consider the processing order.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]