Add FRSQRTS and FCM* instructions

This commit is contained in:
gdkchan 2018-04-05 23:28:12 -03:00
parent 39f20d8d1a
commit f15b1c76a1
3 changed files with 208 additions and 18 deletions

View file

@ -492,6 +492,47 @@ namespace ChocolArm64.Instruction
});
}
public static void Frsqrts_S(AILEmitterCtx Context)
{
EmitScalarBinaryOpF(Context, () => EmitFrsqrts(Context));
}
public static void Frsqrts_V(AILEmitterCtx Context)
{
EmitVectorBinaryOpF(Context, () => EmitFrsqrts(Context));
}
private static void EmitFrsqrts(AILEmitterCtx Context)
{
IAOpCodeSimd Op = (IAOpCodeSimd)Context.CurrOp;
int SizeF = Op.Size & 1;
Context.Emit(OpCodes.Mul);
if (SizeF == 0)
{
Context.EmitLdc_R4(3);
}
else /* if (SizeF == 1) */
{
Context.EmitLdc_R8(3);
}
Context.Emit(OpCodes.Add);
if (SizeF == 0)
{
Context.EmitLdc_R4(0.5f);
}
else /* if (SizeF == 1) */
{
Context.EmitLdc_R8(0.5);
}
Context.Emit(OpCodes.Mul);
}
public static void Fsqrt_S(AILEmitterCtx Context)
{
EmitScalarUnaryOpF(Context, () =>