qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH for-7.1 v6 39/51] target/nios2: Implement Misaligned destinat


From: Richard Henderson
Subject: Re: [PATCH for-7.1 v6 39/51] target/nios2: Implement Misaligned destination exception
Date: Thu, 17 Mar 2022 10:41:07 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/17/22 09:37, Peter Maydell wrote:
The spec isn't clear about whether an unaligned-destination on
an eret is handled as "do the eret (ie restore status), then take
the exception when trying to set the new PC" or "take the exception
immediately" (ie whether it's always a nested exception, effectively).
I guess this is as good a guess as any.

The way I read the spec the first time is that the pc as reported to the exception points to the eret, and it's only badaddr that contains the misaligned address. I simply assumed that would mean that the status change hadn't happened either.

I also see that I've failed to update gen_bxx for this. Also unspecified is if the trap for e.g. beq happens *whenever* the low two bits of imm16 are set, or only if the equality holds. I'm tempted to do the former -- other architectures would treat that case as an illegal instruction.


r~



reply via email to

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