Update InstEmitSimdCvt.cs

This commit is contained in:
LDj3SNuD 2018-11-15 13:28:47 +01:00 committed by GitHub
parent 6a3508c580
commit 893f5454f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,7 +308,29 @@ namespace ChocolArm64.Instructions
public static void Scvtf_V(ILEmitterCtx context)
{
EmitVectorCvtf(context, signed: true);
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;
int sizeF = op.Size & 1;
if (Optimizations.UseSse2 && sizeF == 0)
{
Type[] typesCvt = new Type[] { typeof(Vector128<int>) };
EmitLdvecWithSignedCast(context, op.Rn, 2);
context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.ConvertToVector128Single), typesCvt));
context.EmitStvec(op.Rd);
if (op.RegisterSize == RegisterSize.Simd64)
{
EmitVectorZeroUpper(context, op.Rd);
}
}
else
{
EmitVectorCvtf(context, signed: true);
}
}
public static void Ucvtf_Gp(ILEmitterCtx context)
@ -489,16 +511,6 @@ namespace ChocolArm64.Instructions
context.EmitStintzr(op.Rd);
}
private static void EmitVectorScvtf(ILEmitterCtx context)
{
EmitVectorCvtf(context, true);
}
private static void EmitVectorUcvtf(ILEmitterCtx context)
{
EmitVectorCvtf(context, false);
}
private static void EmitVectorCvtf(ILEmitterCtx context, bool signed)
{
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;