diff options
| author | Galen Williamson <galen@vector35.com> | 2024-12-16 13:40:25 -0500 |
|---|---|---|
| committer | Galen Williamson <galen@vector35.com> | 2024-12-16 13:40:25 -0500 |
| commit | 8ea98cab89afb0c14073141f30203486d1333b07 (patch) | |
| tree | a749ae52d4c590c06876b0e02656ad811883b082 /arch/powerpc/util.cpp | |
| parent | b34ddd03f71c8637a80a264a3ea757b8295d482b (diff) | |
[ppc] merges PR Vector35/binaryninja-api#5176 (adds support for "psq" Quantized Floating Point instructions, fixes/completes 64-bit instruction/register support)
Diffstat (limited to 'arch/powerpc/util.cpp')
| -rw-r--r-- | arch/powerpc/util.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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; +} |
