| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408 |
- // https://github.com/intel/ARM_NEON_2_x86_SSE/blob/master/NEON_2_SSE.h
- using ARMeilleure.Decoders;
- using ARMeilleure.IntermediateRepresentation;
- using ARMeilleure.Translation;
- using System;
- using System.Diagnostics;
- using System.Reflection;
- using static ARMeilleure.Instructions.InstEmitHelper;
- using static ARMeilleure.Instructions.InstEmitSimdHelper;
- using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
- namespace ARMeilleure.Instructions
- {
- using Func2I = Func<Operand, Operand, Operand>;
- static partial class InstEmit
- {
- #region "Masks"
- private static readonly long[] _masks_SliSri = new long[] // Replication masks.
- {
- 0x0101010101010101L, 0x0001000100010001L, 0x0000000100000001L, 0x0000000000000001L
- };
- #endregion
- public static void Rshrn_V(ArmEmitterContext context)
- {
- if (Optimizations.UseSsse3)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShr(op);
- long roundConst = 1L << (shift - 1);
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Operand dLow = context.VectorZeroUpper64(d);
- Operand mask = default;
- switch (op.Size + 1)
- {
- case 1: mask = X86GetAllElements(context, (int)roundConst * 0x00010001); break;
- case 2: mask = X86GetAllElements(context, (int)roundConst); break;
- case 3: mask = X86GetAllElements(context, roundConst); break;
- }
- Intrinsic addInst = X86PaddInstruction[op.Size + 1];
- Operand res = context.AddIntrinsic(addInst, n, mask);
- Intrinsic srlInst = X86PsrlInstruction[op.Size + 1];
- res = context.AddIntrinsic(srlInst, res, Const(shift));
- Operand mask2 = X86GetAllElements(context, EvenMasks[op.Size]);
- res = context.AddIntrinsic(Intrinsic.X86Pshufb, res, mask2);
- Intrinsic movInst = op.RegisterSize == RegisterSize.Simd128
- ? Intrinsic.X86Movlhps
- : Intrinsic.X86Movhlps;
- res = context.AddIntrinsic(movInst, dLow, res);
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmNarrowOpZx(context, round: true);
- }
- }
- public static void Shl_S(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShl(op);
- EmitScalarUnaryOpZx(context, (op1) => context.ShiftLeft(op1, Const(shift)));
- }
- public static void Shl_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShl(op);
- int eSize = 8 << op.Size;
- if (shift >= eSize)
- {
- if ((op.RegisterSize == RegisterSize.Simd64))
- {
- Operand res = context.VectorZeroUpper64(GetVec(op.Rd));
- context.Copy(GetVec(op.Rd), res);
- }
- }
- else if (Optimizations.UseGfni && op.Size == 0)
- {
- Operand n = GetVec(op.Rn);
- ulong bitMatrix = X86GetGf2p8LogicalShiftLeft(shift);
- Operand vBitMatrix = X86GetElements(context, bitMatrix, bitMatrix);
- Operand res = context.AddIntrinsic(Intrinsic.X86Gf2p8affineqb, n, vBitMatrix, Const(0));
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else if (Optimizations.UseSse2 && op.Size > 0)
- {
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand res = context.AddIntrinsic(sllInst, n, Const(shift));
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorUnaryOpZx(context, (op1) => context.ShiftLeft(op1, Const(shift)));
- }
- }
- public static void Shll_V(ArmEmitterContext context)
- {
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
- int shift = 8 << op.Size;
- if (Optimizations.UseSse41)
- {
- Operand n = GetVec(op.Rn);
- if (op.RegisterSize == RegisterSize.Simd128)
- {
- n = context.AddIntrinsic(Intrinsic.X86Psrldq, n, Const(8));
- }
- Intrinsic movsxInst = X86PmovsxInstruction[op.Size];
- Operand res = context.AddIntrinsic(movsxInst, n);
- Intrinsic sllInst = X86PsllInstruction[op.Size + 1];
- res = context.AddIntrinsic(sllInst, res, Const(shift));
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorShImmWidenBinaryZx(context, (op1, op2) => context.ShiftLeft(op1, op2), shift);
- }
- }
- public static void Shrn_V(ArmEmitterContext context)
- {
- if (Optimizations.UseSsse3)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShr(op);
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Operand dLow = context.VectorZeroUpper64(d);
- Intrinsic srlInst = X86PsrlInstruction[op.Size + 1];
- Operand nShifted = context.AddIntrinsic(srlInst, n, Const(shift));
- Operand mask = X86GetAllElements(context, EvenMasks[op.Size]);
- Operand res = context.AddIntrinsic(Intrinsic.X86Pshufb, nShifted, mask);
- Intrinsic movInst = op.RegisterSize == RegisterSize.Simd128
- ? Intrinsic.X86Movlhps
- : Intrinsic.X86Movhlps;
- res = context.AddIntrinsic(movInst, dLow, res);
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmNarrowOpZx(context, round: false);
- }
- }
- public static void Sli_S(ArmEmitterContext context)
- {
- EmitSli(context, scalar: true);
- }
- public static void Sli_V(ArmEmitterContext context)
- {
- EmitSli(context, scalar: false);
- }
- public static void Sqrshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Signed | ShlRegFlags.Round | ShlRegFlags.Saturating);
- }
- public static void Sqrshrn_S(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarSxSx);
- }
- public static void Sqrshrn_V(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorSxSx);
- }
- public static void Sqrshrun_S(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarSxZx);
- }
- public static void Sqrshrun_V(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorSxZx);
- }
- public static void Sqshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Signed | ShlRegFlags.Saturating);
- }
- public static void Sqshrn_S(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarSxSx);
- }
- public static void Sqshrn_V(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorSxSx);
- }
- public static void Sqshrun_S(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarSxZx);
- }
- public static void Sqshrun_V(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorSxZx);
- }
- public static void Sri_S(ArmEmitterContext context)
- {
- EmitSri(context, scalar: true);
- }
- public static void Sri_V(ArmEmitterContext context)
- {
- EmitSri(context, scalar: false);
- }
- public static void Srshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Signed | ShlRegFlags.Round);
- }
- public static void Srshr_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpSx(context, ShrImmFlags.Round);
- }
- public static void Srshr_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0 && op.Size < 3)
- {
- int shift = GetImmShr(op);
- int eSize = 8 << op.Size;
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand res = context.AddIntrinsic(sllInst, n, Const(eSize - shift));
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- res = context.AddIntrinsic(srlInst, res, Const(eSize - 1));
- Intrinsic sraInst = X86PsraInstruction[op.Size];
- Operand nSra = context.AddIntrinsic(sraInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, nSra);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorShrImmOpSx(context, ShrImmFlags.Round);
- }
- }
- public static void Srsra_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpSx(context, ShrImmFlags.Round | ShrImmFlags.Accumulate);
- }
- public static void Srsra_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0 && op.Size < 3)
- {
- int shift = GetImmShr(op);
- int eSize = 8 << op.Size;
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand res = context.AddIntrinsic(sllInst, n, Const(eSize - shift));
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- res = context.AddIntrinsic(srlInst, res, Const(eSize - 1));
- Intrinsic sraInst = X86PsraInstruction[op.Size];
- Operand nSra = context.AddIntrinsic(sraInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, nSra);
- res = context.AddIntrinsic(addInst, res, d);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmOpSx(context, ShrImmFlags.Round | ShrImmFlags.Accumulate);
- }
- }
- public static void Sshl_S(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Scalar | ShlRegFlags.Signed);
- }
- public static void Sshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Signed);
- }
- public static void Sshll_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShl(op);
- if (Optimizations.UseSse41)
- {
- Operand n = GetVec(op.Rn);
- if (op.RegisterSize == RegisterSize.Simd128)
- {
- n = context.AddIntrinsic(Intrinsic.X86Psrldq, n, Const(8));
- }
- Intrinsic movsxInst = X86PmovsxInstruction[op.Size];
- Operand res = context.AddIntrinsic(movsxInst, n);
- if (shift != 0)
- {
- Intrinsic sllInst = X86PsllInstruction[op.Size + 1];
- res = context.AddIntrinsic(sllInst, res, Const(shift));
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorShImmWidenBinarySx(context, (op1, op2) => context.ShiftLeft(op1, op2), shift);
- }
- }
- public static void Sshr_S(ArmEmitterContext context)
- {
- EmitShrImmOp(context, ShrImmFlags.ScalarSx);
- }
- public static void Sshr_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShr(op);
- if (Optimizations.UseGfni && op.Size == 0)
- {
- Operand n = GetVec(op.Rn);
- ulong bitMatrix;
- if (shift < 8)
- {
- bitMatrix = X86GetGf2p8LogicalShiftLeft(-shift);
- // Extend sign-bit
- bitMatrix |= 0x8080808080808080UL >> (64 - shift * 8);
- }
- else
- {
- // Replicate sign-bit into all bits
- bitMatrix = 0x8080808080808080UL;
- }
- Operand vBitMatrix = X86GetElements(context, bitMatrix, bitMatrix);
- Operand res = context.AddIntrinsic(Intrinsic.X86Gf2p8affineqb, n, vBitMatrix, Const(0));
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else if (Optimizations.UseSse2 && op.Size > 0 && op.Size < 3)
- {
- Operand n = GetVec(op.Rn);
- Intrinsic sraInst = X86PsraInstruction[op.Size];
- Operand res = context.AddIntrinsic(sraInst, n, Const(shift));
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitShrImmOp(context, ShrImmFlags.VectorSx);
- }
- }
- public static void Ssra_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpSx(context, ShrImmFlags.Accumulate);
- }
- public static void Ssra_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0 && op.Size < 3)
- {
- int shift = GetImmShr(op);
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic sraInst = X86PsraInstruction[op.Size];
- Operand res = context.AddIntrinsic(sraInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, d);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmOpSx(context, ShrImmFlags.Accumulate);
- }
- }
- public static void Uqrshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Round | ShlRegFlags.Saturating);
- }
- public static void Uqrshrn_S(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarZxZx);
- }
- public static void Uqrshrn_V(ArmEmitterContext context)
- {
- EmitRoundShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorZxZx);
- }
- public static void Uqshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Saturating);
- }
- public static void Uqshrn_S(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.ScalarZxZx);
- }
- public static void Uqshrn_V(ArmEmitterContext context)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.VectorZxZx);
- }
- public static void Urshl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Round);
- }
- public static void Urshr_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpZx(context, ShrImmFlags.Round);
- }
- public static void Urshr_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0)
- {
- int shift = GetImmShr(op);
- int eSize = 8 << op.Size;
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand res = context.AddIntrinsic(sllInst, n, Const(eSize - shift));
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- res = context.AddIntrinsic(srlInst, res, Const(eSize - 1));
- Operand nSrl = context.AddIntrinsic(srlInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, nSrl);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorShrImmOpZx(context, ShrImmFlags.Round);
- }
- }
- public static void Ursra_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpZx(context, ShrImmFlags.Round | ShrImmFlags.Accumulate);
- }
- public static void Ursra_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0)
- {
- int shift = GetImmShr(op);
- int eSize = 8 << op.Size;
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand res = context.AddIntrinsic(sllInst, n, Const(eSize - shift));
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- res = context.AddIntrinsic(srlInst, res, Const(eSize - 1));
- Operand nSrl = context.AddIntrinsic(srlInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, nSrl);
- res = context.AddIntrinsic(addInst, res, d);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmOpZx(context, ShrImmFlags.Round | ShrImmFlags.Accumulate);
- }
- }
- public static void Ushl_S(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.Scalar);
- }
- public static void Ushl_V(ArmEmitterContext context)
- {
- EmitShlRegOp(context, ShlRegFlags.None);
- }
- public static void Ushll_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShl(op);
- if (Optimizations.UseSse41)
- {
- Operand n = GetVec(op.Rn);
- if (op.RegisterSize == RegisterSize.Simd128)
- {
- n = context.AddIntrinsic(Intrinsic.X86Psrldq, n, Const(8));
- }
- Intrinsic movzxInst = X86PmovzxInstruction[op.Size];
- Operand res = context.AddIntrinsic(movzxInst, n);
- if (shift != 0)
- {
- Intrinsic sllInst = X86PsllInstruction[op.Size + 1];
- res = context.AddIntrinsic(sllInst, res, Const(shift));
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitVectorShImmWidenBinaryZx(context, (op1, op2) => context.ShiftLeft(op1, op2), shift);
- }
- }
- public static void Ushr_S(ArmEmitterContext context)
- {
- EmitShrImmOp(context, ShrImmFlags.ScalarZx);
- }
- public static void Ushr_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0)
- {
- int shift = GetImmShr(op);
- Operand n = GetVec(op.Rn);
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- Operand res = context.AddIntrinsic(srlInst, n, Const(shift));
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- else
- {
- EmitShrImmOp(context, ShrImmFlags.VectorZx);
- }
- }
- public static void Usra_S(ArmEmitterContext context)
- {
- EmitScalarShrImmOpZx(context, ShrImmFlags.Accumulate);
- }
- public static void Usra_V(ArmEmitterContext context)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- if (Optimizations.UseSse2 && op.Size > 0)
- {
- int shift = GetImmShr(op);
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- Operand res = context.AddIntrinsic(srlInst, n, Const(shift));
- Intrinsic addInst = X86PaddInstruction[op.Size];
- res = context.AddIntrinsic(addInst, res, d);
- if (op.RegisterSize == RegisterSize.Simd64)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- EmitVectorShrImmOpZx(context, ShrImmFlags.Accumulate);
- }
- }
- [Flags]
- private enum ShrImmFlags
- {
- Scalar = 1 << 0,
- Signed = 1 << 1,
- Round = 1 << 2,
- Accumulate = 1 << 3,
- ScalarSx = Scalar | Signed,
- ScalarZx = Scalar,
- VectorSx = Signed,
- VectorZx = 0
- }
- private static void EmitScalarShrImmOpSx(ArmEmitterContext context, ShrImmFlags flags)
- {
- EmitShrImmOp(context, ShrImmFlags.ScalarSx | flags);
- }
- private static void EmitScalarShrImmOpZx(ArmEmitterContext context, ShrImmFlags flags)
- {
- EmitShrImmOp(context, ShrImmFlags.ScalarZx | flags);
- }
- private static void EmitVectorShrImmOpSx(ArmEmitterContext context, ShrImmFlags flags)
- {
- EmitShrImmOp(context, ShrImmFlags.VectorSx | flags);
- }
- private static void EmitVectorShrImmOpZx(ArmEmitterContext context, ShrImmFlags flags)
- {
- EmitShrImmOp(context, ShrImmFlags.VectorZx | flags);
- }
- private static void EmitShrImmOp(ArmEmitterContext context, ShrImmFlags flags)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- Operand res = context.VectorZero();
- bool scalar = (flags & ShrImmFlags.Scalar) != 0;
- bool signed = (flags & ShrImmFlags.Signed) != 0;
- bool round = (flags & ShrImmFlags.Round) != 0;
- bool accumulate = (flags & ShrImmFlags.Accumulate) != 0;
- int shift = GetImmShr(op);
- long roundConst = 1L << (shift - 1);
- int elems = !scalar ? op.GetBytesCount() >> op.Size : 1;
- for (int index = 0; index < elems; index++)
- {
- Operand e = EmitVectorExtract(context, op.Rn, index, op.Size, signed);
- if (op.Size <= 2)
- {
- if (round)
- {
- e = context.Add(e, Const(roundConst));
- }
- e = signed ? context.ShiftRightSI(e, Const(shift)) : context.ShiftRightUI(e, Const(shift));
- }
- else /* if (op.Size == 3) */
- {
- e = EmitShrImm64(context, e, signed, round ? roundConst : 0L, shift);
- }
- if (accumulate)
- {
- Operand de = EmitVectorExtract(context, op.Rd, index, op.Size, signed);
- e = context.Add(e, de);
- }
- res = EmitVectorInsert(context, res, e, index, op.Size);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- private static void EmitVectorShrImmNarrowOpZx(ArmEmitterContext context, bool round)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShr(op);
- long roundConst = 1L << (shift - 1);
- int elems = 8 >> op.Size;
- int part = op.RegisterSize == RegisterSize.Simd128 ? elems : 0;
- Operand d = GetVec(op.Rd);
- Operand res = part == 0 ? context.VectorZero() : context.Copy(d);
- for (int index = 0; index < elems; index++)
- {
- Operand e = EmitVectorExtractZx(context, op.Rn, index, op.Size + 1);
- if (round)
- {
- e = context.Add(e, Const(roundConst));
- }
- e = context.ShiftRightUI(e, Const(shift));
- res = EmitVectorInsert(context, res, e, part + index, op.Size);
- }
- context.Copy(d, res);
- }
- [Flags]
- private enum ShrImmSaturatingNarrowFlags
- {
- Scalar = 1 << 0,
- SignedSrc = 1 << 1,
- SignedDst = 1 << 2,
- Round = 1 << 3,
- ScalarSxSx = Scalar | SignedSrc | SignedDst,
- ScalarSxZx = Scalar | SignedSrc,
- ScalarZxZx = Scalar,
- VectorSxSx = SignedSrc | SignedDst,
- VectorSxZx = SignedSrc,
- VectorZxZx = 0
- }
- private static void EmitRoundShrImmSaturatingNarrowOp(ArmEmitterContext context, ShrImmSaturatingNarrowFlags flags)
- {
- EmitShrImmSaturatingNarrowOp(context, ShrImmSaturatingNarrowFlags.Round | flags);
- }
- private static void EmitShrImmSaturatingNarrowOp(ArmEmitterContext context, ShrImmSaturatingNarrowFlags flags)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- bool scalar = (flags & ShrImmSaturatingNarrowFlags.Scalar) != 0;
- bool signedSrc = (flags & ShrImmSaturatingNarrowFlags.SignedSrc) != 0;
- bool signedDst = (flags & ShrImmSaturatingNarrowFlags.SignedDst) != 0;
- bool round = (flags & ShrImmSaturatingNarrowFlags.Round) != 0;
- int shift = GetImmShr(op);
- long roundConst = 1L << (shift - 1);
- int elems = !scalar ? 8 >> op.Size : 1;
- int part = !scalar && (op.RegisterSize == RegisterSize.Simd128) ? elems : 0;
- Operand d = GetVec(op.Rd);
- Operand res = part == 0 ? context.VectorZero() : context.Copy(d);
- for (int index = 0; index < elems; index++)
- {
- Operand e = EmitVectorExtract(context, op.Rn, index, op.Size + 1, signedSrc);
- if (op.Size <= 1 || !round)
- {
- if (round)
- {
- e = context.Add(e, Const(roundConst));
- }
- e = signedSrc ? context.ShiftRightSI(e, Const(shift)) : context.ShiftRightUI(e, Const(shift));
- }
- else /* if (op.Size == 2 && round) */
- {
- e = EmitShrImm64(context, e, signedSrc, roundConst, shift); // shift <= 32
- }
- e = signedSrc ? EmitSignedSrcSatQ(context, e, op.Size, signedDst) : EmitUnsignedSrcSatQ(context, e, op.Size, signedDst);
- res = EmitVectorInsert(context, res, e, part + index, op.Size);
- }
- context.Copy(d, res);
- }
- // dst64 = (Int(src64, signed) + roundConst) >> shift;
- private static Operand EmitShrImm64(
- ArmEmitterContext context,
- Operand value,
- bool signed,
- long roundConst,
- int shift)
- {
- MethodInfo info = signed
- ? typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedShrImm64))
- : typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedShrImm64));
- return context.Call(info, value, Const(roundConst), Const(shift));
- }
- private static void EmitVectorShImmWidenBinarySx(ArmEmitterContext context, Func2I emit, int imm)
- {
- EmitVectorShImmWidenBinaryOp(context, emit, imm, signed: true);
- }
- private static void EmitVectorShImmWidenBinaryZx(ArmEmitterContext context, Func2I emit, int imm)
- {
- EmitVectorShImmWidenBinaryOp(context, emit, imm, signed: false);
- }
- private static void EmitVectorShImmWidenBinaryOp(ArmEmitterContext context, Func2I emit, int imm, bool signed)
- {
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
- Operand res = context.VectorZero();
- int elems = 8 >> op.Size;
- int part = op.RegisterSize == RegisterSize.Simd128 ? elems : 0;
- for (int index = 0; index < elems; index++)
- {
- Operand ne = EmitVectorExtract(context, op.Rn, part + index, op.Size, signed);
- res = EmitVectorInsert(context, res, emit(ne, Const(imm)), index, op.Size + 1);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- private static void EmitSli(ArmEmitterContext context, bool scalar)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShl(op);
- int eSize = 8 << op.Size;
- ulong mask = shift != 0 ? ulong.MaxValue >> (64 - shift) : 0UL;
- if (shift >= eSize)
- {
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- Operand res = context.VectorZeroUpper64(GetVec(op.Rd));
- context.Copy(GetVec(op.Rd), res);
- }
- }
- else if (Optimizations.UseGfni && op.Size == 0)
- {
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- ulong bitMatrix = X86GetGf2p8LogicalShiftLeft(shift);
- Operand vBitMatrix = X86GetElements(context, bitMatrix, bitMatrix);
- Operand nShifted = context.AddIntrinsic(Intrinsic.X86Gf2p8affineqb, n, vBitMatrix, Const(0));
- Operand dMask = X86GetAllElements(context, (long)mask * _masks_SliSri[op.Size]);
- Operand dMasked = context.AddIntrinsic(Intrinsic.X86Pand, d, dMask);
- Operand res = context.AddIntrinsic(Intrinsic.X86Por, nShifted, dMasked);
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else if (Optimizations.UseSse2 && op.Size > 0)
- {
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic sllInst = X86PsllInstruction[op.Size];
- Operand nShifted = context.AddIntrinsic(sllInst, n, Const(shift));
- Operand dMask = X86GetAllElements(context, (long)mask * _masks_SliSri[op.Size]);
- Operand dMasked = context.AddIntrinsic(Intrinsic.X86Pand, d, dMask);
- Operand res = context.AddIntrinsic(Intrinsic.X86Por, nShifted, dMasked);
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- Operand res = context.VectorZero();
- int elems = !scalar ? op.GetBytesCount() >> op.Size : 1;
- for (int index = 0; index < elems; index++)
- {
- Operand ne = EmitVectorExtractZx(context, op.Rn, index, op.Size);
- Operand neShifted = context.ShiftLeft(ne, Const(shift));
- Operand de = EmitVectorExtractZx(context, op.Rd, index, op.Size);
- Operand deMasked = context.BitwiseAnd(de, Const(mask));
- Operand e = context.BitwiseOr(neShifted, deMasked);
- res = EmitVectorInsert(context, res, e, index, op.Size);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- }
- private static void EmitSri(ArmEmitterContext context, bool scalar)
- {
- OpCodeSimdShImm op = (OpCodeSimdShImm)context.CurrOp;
- int shift = GetImmShr(op);
- int eSize = 8 << op.Size;
- ulong mask = (ulong.MaxValue << (eSize - shift)) & (ulong.MaxValue >> (64 - eSize));
- if (shift >= eSize)
- {
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- Operand res = context.VectorZeroUpper64(GetVec(op.Rd));
- context.Copy(GetVec(op.Rd), res);
- }
- }
- else if (Optimizations.UseGfni && op.Size == 0)
- {
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- ulong bitMatrix = X86GetGf2p8LogicalShiftLeft(-shift);
- Operand vBitMatrix = X86GetElements(context, bitMatrix, bitMatrix);
- Operand nShifted = context.AddIntrinsic(Intrinsic.X86Gf2p8affineqb, n, vBitMatrix, Const(0));
- Operand dMask = X86GetAllElements(context, (long)mask * _masks_SliSri[op.Size]);
- Operand dMasked = context.AddIntrinsic(Intrinsic.X86Pand, d, dMask);
- Operand res = context.AddIntrinsic(Intrinsic.X86Por, nShifted, dMasked);
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else if (Optimizations.UseSse2 && op.Size > 0)
- {
- Operand d = GetVec(op.Rd);
- Operand n = GetVec(op.Rn);
- Intrinsic srlInst = X86PsrlInstruction[op.Size];
- Operand nShifted = context.AddIntrinsic(srlInst, n, Const(shift));
- Operand dMask = X86GetAllElements(context, (long)mask * _masks_SliSri[op.Size]);
- Operand dMasked = context.AddIntrinsic(Intrinsic.X86Pand, d, dMask);
- Operand res = context.AddIntrinsic(Intrinsic.X86Por, nShifted, dMasked);
- if ((op.RegisterSize == RegisterSize.Simd64) || scalar)
- {
- res = context.VectorZeroUpper64(res);
- }
- context.Copy(d, res);
- }
- else
- {
- Operand res = context.VectorZero();
- int elems = !scalar ? op.GetBytesCount() >> op.Size : 1;
- for (int index = 0; index < elems; index++)
- {
- Operand ne = EmitVectorExtractZx(context, op.Rn, index, op.Size);
- Operand neShifted = shift != 64 ? context.ShiftRightUI(ne, Const(shift)) : Const(0UL);
- Operand de = EmitVectorExtractZx(context, op.Rd, index, op.Size);
- Operand deMasked = context.BitwiseAnd(de, Const(mask));
- Operand e = context.BitwiseOr(neShifted, deMasked);
- res = EmitVectorInsert(context, res, e, index, op.Size);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- }
- [Flags]
- private enum ShlRegFlags
- {
- None = 0,
- Scalar = 1 << 0,
- Signed = 1 << 1,
- Round = 1 << 2,
- Saturating = 1 << 3
- }
- private static void EmitShlRegOp(ArmEmitterContext context, ShlRegFlags flags = ShlRegFlags.None)
- {
- bool scalar = flags.HasFlag(ShlRegFlags.Scalar);
- bool signed = flags.HasFlag(ShlRegFlags.Signed);
- bool round = flags.HasFlag(ShlRegFlags.Round);
- bool saturating = flags.HasFlag(ShlRegFlags.Saturating);
- OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp;
- Operand res = context.VectorZero();
- int elems = !scalar ? op.GetBytesCount() >> op.Size : 1;
- for (int index = 0; index < elems; index++)
- {
- Operand ne = EmitVectorExtract(context, op.Rn, index, op.Size, signed);
- Operand me = EmitVectorExtractSx(context, op.Rm, index << op.Size, size: 0);
- Operand e = !saturating
- ? EmitShlReg(context, ne, context.ConvertI64ToI32(me), round, op.Size, signed)
- : EmitShlRegSatQ(context, ne, context.ConvertI64ToI32(me), round, op.Size, signed);
- res = EmitVectorInsert(context, res, e, index, op.Size);
- }
- context.Copy(GetVec(op.Rd), res);
- }
- // long SignedShlReg(long op, int shiftLsB, bool round, int size);
- // ulong UnsignedShlReg(ulong op, int shiftLsB, bool round, int size);
- private static Operand EmitShlReg(ArmEmitterContext context, Operand op, Operand shiftLsB, bool round, int size, bool signed)
- {
- int eSize = 8 << size;
- Debug.Assert(op.Type == OperandType.I64);
- Debug.Assert(shiftLsB.Type == OperandType.I32);
- Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
- Operand lbl1 = Label();
- Operand lblEnd = Label();
- Operand eSizeOp = Const(eSize);
- Operand zero = Const(0);
- Operand zeroL = Const(0L);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), op);
- context.BranchIf(lbl1, shiftLsB, zero, Comparison.GreaterOrEqual);
- context.Copy(res, signed
- ? EmitSignedShrReg(context, op, context.Negate(shiftLsB), round, eSize)
- : EmitUnsignedShrReg(context, op, context.Negate(shiftLsB), round, eSize));
- context.Branch(lblEnd);
- context.MarkLabel(lbl1);
- context.BranchIf(lblEnd, shiftLsB, zero, Comparison.LessOrEqual);
- Operand shl = context.ShiftLeft(op, shiftLsB);
- Operand isGreaterOrEqual = context.ICompareGreaterOrEqual(shiftLsB, eSizeOp);
- context.Copy(res, context.ConditionalSelect(isGreaterOrEqual, zeroL, shl));
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- // long SignedShlRegSatQ(long op, int shiftLsB, bool round, int size);
- // ulong UnsignedShlRegSatQ(ulong op, int shiftLsB, bool round, int size);
- private static Operand EmitShlRegSatQ(ArmEmitterContext context, Operand op, Operand shiftLsB, bool round, int size, bool signed)
- {
- int eSize = 8 << size;
- Debug.Assert(op.Type == OperandType.I64);
- Debug.Assert(shiftLsB.Type == OperandType.I32);
- Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
- Operand lbl1 = Label();
- Operand lbl2 = Label();
- Operand lblEnd = Label();
- Operand eSizeOp = Const(eSize);
- Operand zero = Const(0);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), op);
- context.BranchIf(lbl1, shiftLsB, zero, Comparison.GreaterOrEqual);
- context.Copy(res, signed
- ? EmitSignedShrReg(context, op, context.Negate(shiftLsB), round, eSize)
- : EmitUnsignedShrReg(context, op, context.Negate(shiftLsB), round, eSize));
- context.Branch(lblEnd);
- context.MarkLabel(lbl1);
- context.BranchIf(lblEnd, shiftLsB, zero, Comparison.LessOrEqual);
- context.BranchIf(lbl2, shiftLsB, eSizeOp, Comparison.Less);
- context.Copy(res, signed
- ? EmitSignedSignSatQ(context, op, size)
- : EmitUnsignedSignSatQ(context, op, size));
- context.Branch(lblEnd);
- context.MarkLabel(lbl2);
- Operand shl = context.ShiftLeft(op, shiftLsB);
- if (eSize == 64)
- {
- Operand sarOrShr = signed
- ? context.ShiftRightSI(shl, shiftLsB)
- : context.ShiftRightUI(shl, shiftLsB);
- context.Copy(res, shl);
- context.BranchIf(lblEnd, sarOrShr, op, Comparison.Equal);
- context.Copy(res, signed
- ? EmitSignedSignSatQ(context, op, size)
- : EmitUnsignedSignSatQ(context, op, size));
- }
- else
- {
- context.Copy(res, signed
- ? EmitSignedSrcSatQ(context, shl, size, signedDst: true)
- : EmitUnsignedSrcSatQ(context, shl, size, signedDst: false));
- }
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- // shift := [1, 128]; eSize := {8, 16, 32, 64}.
- // long SignedShrReg(long op, int shift, bool round, int eSize);
- private static Operand EmitSignedShrReg(ArmEmitterContext context, Operand op, Operand shift, bool round, int eSize)
- {
- if (round)
- {
- Operand lblEnd = Label();
- Operand eSizeOp = Const(eSize);
- Operand zeroL = Const(0L);
- Operand one = Const(1);
- Operand oneL = Const(1L);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), zeroL);
- context.BranchIf(lblEnd, shift, eSizeOp, Comparison.GreaterOrEqual);
- Operand roundConst = context.ShiftLeft(oneL, context.Subtract(shift, one));
- Operand add = context.Add(op, roundConst);
- Operand sar = context.ShiftRightSI(add, shift);
- if (eSize == 64)
- {
- Operand shr = context.ShiftRightUI(add, shift);
- Operand left = context.BitwiseAnd(context.Negate(op), context.BitwiseExclusiveOr(op, add));
- Operand isLess = context.ICompareLess(left, zeroL);
- context.Copy(res, context.ConditionalSelect(isLess, shr, sar));
- }
- else
- {
- context.Copy(res, sar);
- }
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- else
- {
- Operand lblEnd = Label();
- Operand eSizeOp = Const(eSize);
- Operand zeroL = Const(0L);
- Operand negOneL = Const(-1L);
- Operand sar = context.ShiftRightSI(op, shift);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), sar);
- context.BranchIf(lblEnd, shift, eSizeOp, Comparison.Less);
- Operand isLess = context.ICompareLess(op, zeroL);
- context.Copy(res, context.ConditionalSelect(isLess, negOneL, zeroL));
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- }
- // shift := [1, 128]; eSize := {8, 16, 32, 64}.
- // ulong UnsignedShrReg(ulong op, int shift, bool round, int eSize);
- private static Operand EmitUnsignedShrReg(ArmEmitterContext context, Operand op, Operand shift, bool round, int eSize)
- {
- if (round)
- {
- Operand lblEnd = Label();
- Operand zeroUL = Const(0UL);
- Operand one = Const(1);
- Operand oneUL = Const(1UL);
- Operand eSizeMaxOp = Const(64);
- Operand oneShl63UL = Const(1UL << 63);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), zeroUL);
- context.BranchIf(lblEnd, shift, eSizeMaxOp, Comparison.Greater);
- Operand roundConst = context.ShiftLeft(oneUL, context.Subtract(shift, one));
- Operand add = context.Add(op, roundConst);
- Operand shr = context.ShiftRightUI(add, shift);
- Operand isEqual = context.ICompareEqual(shift, eSizeMaxOp);
- context.Copy(res, context.ConditionalSelect(isEqual, zeroUL, shr));
- if (eSize == 64)
- {
- context.BranchIf(lblEnd, add, op, Comparison.GreaterOrEqualUI);
- Operand right = context.BitwiseOr(shr, context.ShiftRightUI(oneShl63UL, context.Subtract(shift, one)));
- context.Copy(res, context.ConditionalSelect(isEqual, oneUL, right));
- }
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- else
- {
- Operand lblEnd = Label();
- Operand eSizeOp = Const(eSize);
- Operand zeroUL = Const(0UL);
- Operand shr = context.ShiftRightUI(op, shift);
- Operand res = context.Copy(context.AllocateLocal(OperandType.I64), shr);
- context.BranchIf(lblEnd, shift, eSizeOp, Comparison.Less);
- context.Copy(res, zeroUL);
- context.Branch(lblEnd);
- context.MarkLabel(lblEnd);
- return res;
- }
- }
- }
- }
|