mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-06 10:32:58 +00:00
ir: Add opcodes for scalar signed saturated doubling multiplies
This commit is contained in:
@@ -501,6 +501,24 @@ ResultAndOverflow<UAny> IREmitter::SignedSaturatedAdd(const UAny& a, const UAny&
|
||||
return {result, overflow};
|
||||
}
|
||||
|
||||
ResultAndOverflow<UAny> IREmitter::SignedSaturatedDoublingMultiplyReturnHigh(const UAny& a, const UAny& b) {
|
||||
ASSERT(a.GetType() == b.GetType());
|
||||
const auto result = [&]() -> IR::UAny {
|
||||
switch (a.GetType()) {
|
||||
case IR::Type::U16:
|
||||
return Inst<U16>(Opcode::SignedSaturatedDoublingMultiplyReturnHigh16, a, b);
|
||||
case IR::Type::U32:
|
||||
return Inst<U32>(Opcode::SignedSaturatedDoublingMultiplyReturnHigh32, a, b);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return IR::UAny{};
|
||||
}
|
||||
}();
|
||||
|
||||
const auto overflow = Inst<U1>(Opcode::GetOverflowFromOp, result);
|
||||
return {result, overflow};
|
||||
}
|
||||
|
||||
ResultAndOverflow<UAny> IREmitter::SignedSaturatedSub(const UAny& a, const UAny& b) {
|
||||
ASSERT(a.GetType() == b.GetType());
|
||||
const auto result = [&]() -> IR::UAny {
|
||||
|
||||
Reference in New Issue
Block a user