frontend/ir_emitter: Add half-precision opcode variant of FPRSqrtStepFused

This commit is contained in:
Lioncash
2019-04-14 20:55:25 -04:00
committed by MerryMage
parent e3b2eb57b5
commit 824c551ba2
5 changed files with 57 additions and 40 deletions

View File

@@ -1997,11 +1997,20 @@ U16U32U64 IREmitter::FPRSqrtEstimate(const U16U32U64& a) {
}
}
U32U64 IREmitter::FPRSqrtStepFused(const U32U64& a, const U32U64& b) {
if (a.GetType() == Type::U32) {
U16U32U64 IREmitter::FPRSqrtStepFused(const U16U32U64& a, const U16U32U64& b) {
ASSERT(a.GetType() == b.GetType());
switch (a.GetType()) {
case Type::U16:
return Inst<U16>(Opcode::FPRSqrtStepFused16, a, b);
case Type::U32:
return Inst<U32>(Opcode::FPRSqrtStepFused32, a, b);
case Type::U64:
return Inst<U64>(Opcode::FPRSqrtStepFused64, a, b);
default:
UNREACHABLE();
return U16U32U64{};
}
return Inst<U64>(Opcode::FPRSqrtStepFused64, a, b);
}
U32U64 IREmitter::FPSqrt(const U32U64& a) {