mirror of
https://github.com/azahar-emu/dynarmic.git
synced 2026-05-11 06:28:19 +02:00
ir/value: Add IsSignedImmediate() and IsUnsignedImmediate() functions to Value's interface
This allows testing against arbitrary values while also simultaneously eliminating the need to check IsImmediate() all the time in expressions.
This commit is contained in:
@@ -194,6 +194,14 @@ u64 Value::GetImmediateAsU64() const {
|
||||
}
|
||||
}
|
||||
|
||||
bool Value::IsSignedImmediate(s64 value) const {
|
||||
return IsImmediate() && GetImmediateAsS64() == value;
|
||||
}
|
||||
|
||||
bool Value::IsUnsignedImmediate(u64 value) const {
|
||||
return IsImmediate() && GetImmediateAsU64() == value;
|
||||
}
|
||||
|
||||
bool Value::HasAllBitsSet() const {
|
||||
ASSERT(IsImmediate());
|
||||
|
||||
@@ -215,7 +223,7 @@ bool Value::HasAllBitsSet() const {
|
||||
}
|
||||
|
||||
bool Value::IsZero() const {
|
||||
return IsImmediate() && GetImmediateAsU64() == 0;
|
||||
return IsUnsignedImmediate(0);
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::IR
|
||||
|
||||
Reference in New Issue
Block a user