From f6af7d391ec72a818a0f10bfbd275b0fe1a145f0 Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Wed, 18 Jul 2018 03:04:40 +0200 Subject: [PATCH] optimize functions --- ChocolArm64/Instruction/AInstEmitSimdShift.cs | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/ChocolArm64/Instruction/AInstEmitSimdShift.cs b/ChocolArm64/Instruction/AInstEmitSimdShift.cs index 28cf8c2e7..9a20f69a4 100644 --- a/ChocolArm64/Instruction/AInstEmitSimdShift.cs +++ b/ChocolArm64/Instruction/AInstEmitSimdShift.cs @@ -85,32 +85,24 @@ namespace ChocolArm64.Instruction { AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp; - int Shift = GetImmShr(Op); - - Action Emit = () => + EmitScalarSaturatingNarrowOpSxZx(Context, () => { - Context.EmitLdc_I4(Shift); + Context.EmitLdc_I4(GetImmShr(Op)); Context.Emit(OpCodes.Shr); - }; - - EmitScalarSaturatingNarrowOpSxZx(Context, Emit); + }); } public static void Sqshrun_V(AILEmitterCtx Context) { AOpCodeSimdShImm Op = (AOpCodeSimdShImm)Context.CurrOp; - int Shift = GetImmShr(Op); - - Action Emit = () => + EmitVectorSaturatingNarrowOpSxZx(Context, () => { - Context.EmitLdc_I4(Shift); + Context.EmitLdc_I4(GetImmShr(Op)); Context.Emit(OpCodes.Shr); - }; - - EmitVectorSaturatingNarrowOpSxZx(Context, Emit); + }); } public static void Sqrshrn_V(AILEmitterCtx Context)