]> git.ipfire.org Git - thirdparty/valgrind.git/commit
nanomips specific changes for BZ 507033
authorFlorian Krohm <flo2030@eich-krohm.de>
Thu, 31 Jul 2025 21:28:39 +0000 (21:28 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Thu, 31 Jul 2025 21:28:39 +0000 (21:28 +0000)
commita5c48217e94a0fb7bac909a2ff13813ac10f5c37
tree029a0df90f9d2b3952fa3b0c547428879518f5e2
parent42bff04db954b8a214334ad67256c32e88ddc7cf
nanomips specific changes for BZ 507033

Rework code to use Iop_ClzNat32 instead of the deprecated Iop_Clz32.

Iop_Clz32 is used to implement the CLZ insn which behaves naturally
when the input is 0:  CLZ(0) == 32
So it seems as if using Iop_Clz32 is wrong because it has undefined
behaviour when the input value is 0. However, the VEX pipeline
does this:

CLZ insn --ir--> Iop_Clz32 --isel--> NMun_CLZ --emit--> CLZ

So it all works out. Essentially the semantics of Iop_Clz32 were
redefined to be like Iop_ClzNat32.

In IR generation we can drop the special handling for CLO(0) because
Iop_ClzNat32 takes care of that.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=507033
VEX/priv/guest_nanomips_toIR.c
VEX/priv/host_nanomips_isel.c