mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-25 00:12:58 +00:00
ir/value: Support U16 immediates
This commit is contained in:
@@ -31,6 +31,10 @@ Value::Value(u8 value) : type(Type::U8) {
|
||||
inner.imm_u8 = value;
|
||||
}
|
||||
|
||||
Value::Value(u16 value) : type(Type::U16) {
|
||||
inner.imm_u16 = value;
|
||||
}
|
||||
|
||||
Value::Value(u32 value) : type(Type::U32) {
|
||||
inner.imm_u32 = value;
|
||||
}
|
||||
@@ -93,6 +97,13 @@ u8 Value::GetU8() const {
|
||||
return inner.imm_u8;
|
||||
}
|
||||
|
||||
u16 Value::GetU16() const {
|
||||
if (type == Type::Opaque && inner.inst->GetOpcode() == Opcode::Identity)
|
||||
return inner.inst->GetArg(0).GetU16();
|
||||
DEBUG_ASSERT(type == Type::U16);
|
||||
return inner.imm_u16;
|
||||
}
|
||||
|
||||
u32 Value::GetU32() const {
|
||||
if (type == Type::Opaque && inner.inst->GetOpcode() == Opcode::Identity)
|
||||
return inner.inst->GetArg(0).GetU32();
|
||||
|
||||
Reference in New Issue
Block a user