mirror of
https://github.com/yuzu-mirror/dynarmic.git
synced 2026-04-18 12:43:45 +00:00
ir/value: Support U16 immediates
This commit is contained in:
parent
5f7ffe0d0b
commit
642ccb0f66
2 changed files with 14 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue