From 8ea98cab89afb0c14073141f30203486d1333b07 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Mon, 16 Dec 2024 13:40:25 -0500 Subject: [ppc] merges PR Vector35/binaryninja-api#5176 (adds support for "psq" Quantized Floating Point instructions, fixes/completes 64-bit instruction/register support) --- arch/powerpc/util.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch/powerpc/util.cpp') diff --git a/arch/powerpc/util.cpp b/arch/powerpc/util.cpp index 50c3eb5b..5e37f735 100644 --- a/arch/powerpc/util.cpp +++ b/arch/powerpc/util.cpp @@ -85,4 +85,17 @@ void printInstructionVerbose(decomp_result *res) } } +uint64_t sign_extend(size_t addressSize_local, uint64_t target, int signBit) +{ + if ((target >> signBit) & 1) + { + target = target | (~((1 << signBit) - 1)); + } + + if (addressSize_local == 4) + { + target = target & 0xffffffff; + } + return target; +} -- cgit v1.3.1