From e2330746f0555abb001f660d310169325ab069d6 Mon Sep 17 00:00:00 2001 From: bmourad01 Date: Thu, 9 May 2024 17:31:22 -0400 Subject: [PATCH] Fix `ldu` The manual says that this immediate is also sign-extended --- plugins/powerpc/powerpc_load.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/powerpc/powerpc_load.ml b/plugins/powerpc/powerpc_load.ml index c127e2e6e..a93a34a00 100644 --- a/plugins/powerpc/powerpc_load.ml +++ b/plugins/powerpc/powerpc_load.ml @@ -228,7 +228,7 @@ let ldx cpu ops = let ldu cpu ops = let rt = unsigned cpu.reg ops.(0) in let ra = signed cpu.reg ops.(1) in - let im = unsigned imm16 ops.(2) in + let im = signed imm16 ops.(2) in RTL.[ rt := cpu.load (ra + im) doubleword; ra := ra + im;