mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-10 00:55:55 +00:00
X86Tables: add Literal() helper
Any time we get the value of Literal, we want to assert that it's actually a literal. We've been open coding this pattern sporadically throughout the opcodedispatcher. Let's add an ergonomic helper to fetch the value of literal, asserting that the value is indeed literal. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
fac9972bad
commit
edf1a7970d
@ -137,6 +137,10 @@ struct DecodedOperand {
|
||||
bool IsSIB() const {
|
||||
return Type == OpType::SIB;
|
||||
}
|
||||
uint64_t Literal() const {
|
||||
LOGMAN_THROW_A_FMT(IsLiteral(), "Precondition: must be a literal");
|
||||
return Data.Literal.Value;
|
||||
}
|
||||
|
||||
union TypeUnion {
|
||||
struct GPRType {
|
||||
|
Loading…
x
Reference in New Issue
Block a user