Small opts. for Fmov_Ftoi/1 & Fmov_Itof/1 Insts.
Small simpl. for Smov_S Inst. Remove unnecessary method EmitIntZeroUpperIfNeeded.
This commit is contained in:
parent
adcd10fdb4
commit
64ac17dc2e
1 changed files with 11 additions and 25 deletions
|
@ -220,45 +220,37 @@ namespace ChocolArm64.Instructions
|
||||||
|
|
||||||
public static void Fmov_Ftoi(ILEmitterCtx context)
|
public static void Fmov_Ftoi(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
OpCodeSimdCvt64 op = (OpCodeSimdCvt64)context.CurrOp;
|
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;
|
||||||
|
|
||||||
EmitVectorExtractZx(context, op.Rn, 0, 3);
|
EmitVectorExtractZx(context, op.Rn, 0, op.Size + 2);
|
||||||
|
|
||||||
EmitIntZeroUpperIfNeeded(context);
|
|
||||||
|
|
||||||
context.EmitStintzr(op.Rd);
|
context.EmitStintzr(op.Rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Fmov_Ftoi1(ILEmitterCtx context)
|
public static void Fmov_Ftoi1(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
OpCodeSimdCvt64 op = (OpCodeSimdCvt64)context.CurrOp;
|
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;
|
||||||
|
|
||||||
EmitVectorExtractZx(context, op.Rn, 1, 3);
|
EmitVectorExtractZx(context, op.Rn, 1, 3);
|
||||||
|
|
||||||
EmitIntZeroUpperIfNeeded(context);
|
|
||||||
|
|
||||||
context.EmitStintzr(op.Rd);
|
context.EmitStintzr(op.Rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Fmov_Itof(ILEmitterCtx context)
|
public static void Fmov_Itof(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
OpCodeSimdCvt64 op = (OpCodeSimdCvt64)context.CurrOp;
|
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;
|
||||||
|
|
||||||
context.EmitLdintzr(op.Rn);
|
context.EmitLdintzr(op.Rn);
|
||||||
|
|
||||||
EmitIntZeroUpperIfNeeded(context);
|
EmitScalarSet(context, op.Rd, op.Size + 2);
|
||||||
|
|
||||||
EmitScalarSet(context, op.Rd, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Fmov_Itof1(ILEmitterCtx context)
|
public static void Fmov_Itof1(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
OpCodeSimdCvt64 op = (OpCodeSimdCvt64)context.CurrOp;
|
OpCodeSimd64 op = (OpCodeSimd64)context.CurrOp;
|
||||||
|
|
||||||
context.EmitLdintzr(op.Rn);
|
context.EmitLdintzr(op.Rn);
|
||||||
|
|
||||||
EmitIntZeroUpperIfNeeded(context);
|
|
||||||
|
|
||||||
EmitVectorInsert(context, op.Rd, 1, 3);
|
EmitVectorInsert(context, op.Rd, 1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +339,11 @@ namespace ChocolArm64.Instructions
|
||||||
|
|
||||||
EmitVectorExtractSx(context, op.Rn, op.DstIndex, op.Size);
|
EmitVectorExtractSx(context, op.Rn, op.DstIndex, op.Size);
|
||||||
|
|
||||||
EmitIntZeroUpperIfNeeded(context);
|
if (op.RegisterSize == RegisterSize.Simd64)
|
||||||
|
{
|
||||||
|
context.Emit(OpCodes.Conv_U4);
|
||||||
|
context.Emit(OpCodes.Conv_U8);
|
||||||
|
}
|
||||||
|
|
||||||
context.EmitStintzr(op.Rd);
|
context.EmitStintzr(op.Rd);
|
||||||
}
|
}
|
||||||
|
@ -544,16 +540,6 @@ namespace ChocolArm64.Instructions
|
||||||
EmitVectorZip(context, part: 1);
|
EmitVectorZip(context, part: 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EmitIntZeroUpperIfNeeded(ILEmitterCtx context)
|
|
||||||
{
|
|
||||||
if (context.CurrOp.RegisterSize == RegisterSize.Int32 ||
|
|
||||||
context.CurrOp.RegisterSize == RegisterSize.Simd64)
|
|
||||||
{
|
|
||||||
context.Emit(OpCodes.Conv_U4);
|
|
||||||
context.Emit(OpCodes.Conv_U8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void EmitMoviMvni(ILEmitterCtx context, bool not)
|
private static void EmitMoviMvni(ILEmitterCtx context, bool not)
|
||||||
{
|
{
|
||||||
OpCodeSimdImm64 op = (OpCodeSimdImm64)context.CurrOp;
|
OpCodeSimdImm64 op = (OpCodeSimdImm64)context.CurrOp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue