optimize functions

This commit is contained in:
greggameplayer 2018-07-18 03:04:40 +02:00 committed by GitHub
parent a79db3a74d
commit f6af7d391e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,32 +85,24 @@ namespace ChocolArm64.Instruction
{ {
AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp; AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp;
int Shift = GetImmShr(Op); EmitScalarSaturatingNarrowOpSxZx(Context, () =>
Action Emit = () =>
{ {
Context.EmitLdc_I4(Shift); Context.EmitLdc_I4(GetImmShr(Op));
Context.Emit(OpCodes.Shr); Context.Emit(OpCodes.Shr);
}; });
EmitScalarSaturatingNarrowOpSxZx(Context, Emit);
} }
public static void Sqshrun_V(AILEmitterCtx Context) public static void Sqshrun_V(AILEmitterCtx Context)
{ {
AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp; AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp;
int Shift = GetImmShr(Op); EmitVectorSaturatingNarrowOpSxZx(Context, () =>
Action Emit = () =>
{ {
Context.EmitLdc_I4(Shift); Context.EmitLdc_I4(GetImmShr(Op));
Context.Emit(OpCodes.Shr); Context.Emit(OpCodes.Shr);
}; });
EmitVectorSaturatingNarrowOpSxZx(Context, Emit);
} }
public static void Sqrshrn_V(AILEmitterCtx Context) public static void Sqrshrn_V(AILEmitterCtx Context)