qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instructio


From: Richard Henderson
Subject: Re: [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction
Date: Sun, 24 Mar 2024 07:13:18 -1000
User-agent: Mozilla Thunderbird

On 3/23/24 11:15, Helge Deller wrote:
The uaddcmt (UNIT ADD COMPLEMENT AND TRAP ON CONDITION) instruction
triggers a trap if the condition is true, and stores the result of the
addition in the target register otherwise.
It does not use the condition to nullify the following instruction, so
drop the calculated condition and do not install it as null_cond.

That's not what the manual says:

if (trapc == TC && cond_satisfied)
    conditional_trap;
else {
    GR[t] ← res;
    if (cond_satisfied) PSW[N] ← 1;
}

We have implemented this like so:

if (trapc == TC)
    conditional_trap(cond_satisfied);
GR[t] ← res;
if (cond_satisfied) PSW[N] ← 1;

because the conditional trap step does not return if it traps.


This patch is not tested and as such sent as RFC.
I just stumbled over the apparently wrong behaviour while debugging the
uaddcm instruction.

Under separate cover you said the condition might be computed incorrectly. I think that is more likely the root cause of the wrong behaviour.


r~



reply via email to

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