diff --git a/External/FEXCore/Source/Interface/Core/Frontend.cpp b/External/FEXCore/Source/Interface/Core/Frontend.cpp index 4d9cddf87..8240a86fb 100644 --- a/External/FEXCore/Source/Interface/Core/Frontend.cpp +++ b/External/FEXCore/Source/Interface/Core/Frontend.cpp @@ -424,7 +424,7 @@ bool Decoder::NormalOp(FEXCore::X86Tables::X86InstInfo const *Info, uint16_t Op) Bytes -= 4; NonGPR.TypeRIPLiteral.Type = DecodedOperand::TYPE_RIP_RELATIVE; - NonGPR.TypeRIPLiteral.Literal = Literal; + NonGPR.TypeRIPLiteral.Literal.u = Literal; } else { // Register-direct addressing diff --git a/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index 767c08860..ee76bb6e2 100644 --- a/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -4505,11 +4505,11 @@ OrderedNode *OpDispatchBuilder::LoadSource_WithOpSize(FEXCore::IR::RegisterClass } else if (Operand.TypeNone.Type == FEXCore::X86Tables::DecodedOperand::TYPE_RIP_RELATIVE) { if (CTX->Config.Is64BitMode) { - Src = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal + Op->PC + Op->InstSize); + Src = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal.s + Op->PC + Op->InstSize); } else { // 32bit this isn't RIP relative but instead absolute - Src = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal); + Src = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal.u); } LoadableType = true; @@ -4637,11 +4637,11 @@ void OpDispatchBuilder::StoreResult_WithOpSize(FEXCore::IR::RegisterClassType Cl } else if (Operand.TypeNone.Type == FEXCore::X86Tables::DecodedOperand::TYPE_RIP_RELATIVE) { if (CTX->Config.Is64BitMode) { - MemStoreDst = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal + Op->PC + Op->InstSize); + MemStoreDst = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal.s + Op->PC + Op->InstSize); } else { // 32bit this isn't RIP relative but instead absolute - MemStoreDst = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal); + MemStoreDst = _Constant(GPRSize * 8, Operand.TypeRIPLiteral.Literal.u); } MemStore = true; } diff --git a/External/FEXCore/include/FEXCore/Debug/X86Tables.h b/External/FEXCore/include/FEXCore/Debug/X86Tables.h index 858b4d93b..c3245dd73 100644 --- a/External/FEXCore/include/FEXCore/Debug/X86Tables.h +++ b/External/FEXCore/include/FEXCore/Debug/X86Tables.h @@ -128,7 +128,10 @@ union DecodedOperand { struct { uint8_t Type; - int32_t Literal; + union { + int32_t s; + uint32_t u; + } Literal; } TypeRIPLiteral; struct {