diff mbox

target-s390x: fix MOVE LONG instruction

Message ID 1434488267-32108-1-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno June 16, 2015, 8:57 p.m. UTC
The MOVE LONG instruction should pad the destination operand with the
byte from bit positions 32-39 of the source length (r2 + 1), not with
the same byte in the source address.

Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-s390x/mem_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Henderson June 18, 2015, 4:04 p.m. UTC | #1
On 06/16/2015 04:57 PM, Aurelien Jarno wrote:
> The MOVE LONG instruction should pad the destination operand with the
> byte from bit positions 32-39 of the source length (r2 + 1), not with
> the same byte in the source address.
>
> Cc: Alexander Graf<agraf@suse.de>
> Cc: Richard Henderson<rth@twiddle.net>
> Signed-off-by: Aurelien Jarno<aurelien@aurel32.net>
> ---
>   target-s390x/mem_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
Alexander Graf June 29, 2015, 11:45 a.m. UTC | #2
On 06/18/15 18:04, Richard Henderson wrote:
> On 06/16/2015 04:57 PM, Aurelien Jarno wrote:
>> The MOVE LONG instruction should pad the destination operand with the
>> byte from bit positions 32-39 of the source length (r2 + 1), not with
>> the same byte in the source address.
>>
>> Cc: Alexander Graf<agraf@suse.de>
>> Cc: Richard Henderson<rth@twiddle.net>
>> Signed-off-by: Aurelien Jarno<aurelien@aurel32.net>
>> ---
>>   target-s390x/mem_helper.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Richard Henderson <rth@twiddle.net>

Thanks, applied to s390-next.


Alex
diff mbox

Patch

diff --git a/target-s390x/mem_helper.c b/target-s390x/mem_helper.c
index 3ccbeb9..9f0eb1e 100644
--- a/target-s390x/mem_helper.c
+++ b/target-s390x/mem_helper.c
@@ -550,7 +550,7 @@  uint32_t HELPER(mvcl)(CPUS390XState *env, uint32_t r1, uint32_t r2)
     uint64_t dest = get_address_31fix(env, r1);
     uint64_t srclen = env->regs[r2 + 1] & 0xffffff;
     uint64_t src = get_address_31fix(env, r2);
-    uint8_t pad = src >> 24;
+    uint8_t pad = env->regs[r2 + 1] >> 24;
     uint8_t v;
     uint32_t cc;