[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] tricore: fix RRPW_INSERT instruction
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] tricore: fix RRPW_INSERT instruction |
Date: |
Fri, 7 Jun 2019 07:48:11 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/6/19 2:26 AM, Brenken, David (EFS-GH2) wrote:
>>> case OPC2_32_RRPW_INSERT:
>>> - if (pos + width <= 31) {
>>> - tcg_gen_deposit_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2],
>>> - width, pos);
>> Can you explain the problem causing the bug? Deposit looks fine to me.
>> After reading the specs again, I agree that the check needs to be <= 32.
> The bug was recognized because of different behavior between actual hardware
> and QEMU.
> Just from looking at it I would say that deposit masks and then shifts the
> arg2 (D[b]) while the
> manual states to first shift D[b] and then mask it. I remember that it was a
> corner case (e.g.
> width + pos = 31 or 32).
The final two arguments to tcg_gen_deposit_tl are swapped.
It should be pos, width.
r~
[Qemu-devel] [PATCH 1/5] tricore: add FTOIZ instruction, David Brenken, 2019/06/05
Re: [Qemu-devel] [PATCH 0/5] tricore: adding new instructions and fixing issues, Bastian Koppelmann, 2019/06/05