sparc: One more use for util::sext; fix probable copy-and-paste error in disassembly of branch displacements

This commit is contained in:
AJR 2023-08-31 21:13:31 -04:00
parent 2c8ff802b2
commit 5bb96d67f8
2 changed files with 3 additions and 3 deletions

View File

@ -13,9 +13,9 @@
namespace { namespace {
int32_t get_disp16(uint32_t op) { return DISP19; } int32_t get_disp16(uint32_t op) { return DISP16; }
int32_t get_disp19(uint32_t op) { return DISP19; } int32_t get_disp19(uint32_t op) { return DISP19; }
int32_t get_disp22(uint32_t op) { return DISP19; } int32_t get_disp22(uint32_t op) { return DISP22; }
const char *bicc_comment(const sparc_disassembler::config *conf, bool use_cc, offs_t pc, uint32_t op) const char *bicc_comment(const sparc_disassembler::config *conf, bool use_cc, offs_t pc, uint32_t op)
{ {

View File

@ -99,7 +99,7 @@
#define DISP30 (int32_t(op << 2)) #define DISP30 (int32_t(op << 2))
#define DISP22 util::sext(op << 2, 24) #define DISP22 util::sext(op << 2, 24)
#define DISP19 util::sext(op << 2, 21) #define DISP19 util::sext(op << 2, 21)
#define DISP16 (int32_t(((op << 10) & 0xc0000000) | ((op << 16) & 0x3fff0000)) >> 14) #define DISP16 util::sext((op & 0x300000) >> 4 | (op & 0x3fff) << 2, 18)
#define IMM22 (op << 10) #define IMM22 (op << 10)
#define CONST22 (op & 0x3fffff) #define CONST22 (op & 0x3fffff)
#define SIMM13 util::sext(op, 13) #define SIMM13 util::sext(op, 13)