aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Instructions/InstEmitSimdHelper.cs
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2019-01-29 14:54:39 +0100
committergdkchan <gab.dark.100@gmail.com>2019-01-29 10:54:39 -0300
commit8f7fcede7fa98c605925dc7b9316940960543bf1 (patch)
treede8fa085c85ed8419abd25e04a707e007f180fe4 /ChocolArm64/Instructions/InstEmitSimdHelper.cs
parent36b9ab0e48b6893c057a954e1ef3181b452add1c (diff)
Add Smlal_Ve, Smlsl_Ve, Smull_Ve, Umlal_Ve, Umlsl_Ve, Umull_Ve Inst.; add Tests. Add Sse Opt. for Trn1/2_V and Uzp1/2_V Inst. Nits. (#566)
* Update OpCodeTable.cs * Update InstEmitSimdArithmetic.cs * Update InstEmitSimdHelper.cs * Update CpuTestSimdRegElem.cs * Update InstEmitSimdMove.cs * Update InstEmitSimdCvt.cs * Update SoftFallback.cs * Update InstEmitSimdHelper.cs * Update SoftFloat.cs * Update CryptoHelper.cs * Update InstEmitSimdArithmetic.cs * Update InstEmitSimdCmp.cs * Address PR feedback. * Address PR feedback.
Diffstat (limited to 'ChocolArm64/Instructions/InstEmitSimdHelper.cs')
-rw-r--r--ChocolArm64/Instructions/InstEmitSimdHelper.cs66
1 files changed, 62 insertions, 4 deletions
diff --git a/ChocolArm64/Instructions/InstEmitSimdHelper.cs b/ChocolArm64/Instructions/InstEmitSimdHelper.cs
index cea481a6..5a44e1a1 100644
--- a/ChocolArm64/Instructions/InstEmitSimdHelper.cs
+++ b/ChocolArm64/Instructions/InstEmitSimdHelper.cs
@@ -642,21 +642,21 @@ namespace ChocolArm64.Instructions
{
OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
- EmitVectorOpByElem(context, emit, op.Index, false, true);
+ EmitVectorOpByElem(context, emit, op.Index, ternary: false, signed: true);
}
public static void EmitVectorBinaryOpByElemZx(ILEmitterCtx context, Action emit)
{
OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
- EmitVectorOpByElem(context, emit, op.Index, false, false);
+ EmitVectorOpByElem(context, emit, op.Index, ternary: false, signed: false);
}
public static void EmitVectorTernaryOpByElemZx(ILEmitterCtx context, Action emit)
{
OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
- EmitVectorOpByElem(context, emit, op.Index, true, false);
+ EmitVectorOpByElem(context, emit, op.Index, ternary: true, signed: false);
}
public static void EmitVectorOpByElem(ILEmitterCtx context, Action emit, int elem, bool ternary, bool signed)
@@ -809,6 +809,64 @@ namespace ChocolArm64.Instructions
context.EmitStvec(op.Rd);
}
+ public static void EmitVectorWidenBinaryOpByElemSx(ILEmitterCtx context, Action emit)
+ {
+ OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
+
+ EmitVectorWidenOpByElem(context, emit, op.Index, ternary: false, signed: true);
+ }
+
+ public static void EmitVectorWidenBinaryOpByElemZx(ILEmitterCtx context, Action emit)
+ {
+ OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
+
+ EmitVectorWidenOpByElem(context, emit, op.Index, ternary: false, signed: false);
+ }
+
+ public static void EmitVectorWidenTernaryOpByElemSx(ILEmitterCtx context, Action emit)
+ {
+ OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
+
+ EmitVectorWidenOpByElem(context, emit, op.Index, ternary: true, signed: true);
+ }
+
+ public static void EmitVectorWidenTernaryOpByElemZx(ILEmitterCtx context, Action emit)
+ {
+ OpCodeSimdRegElem64 op = (OpCodeSimdRegElem64)context.CurrOp;
+
+ EmitVectorWidenOpByElem(context, emit, op.Index, ternary: true, signed: false);
+ }
+
+ public static void EmitVectorWidenOpByElem(ILEmitterCtx context, Action emit, int elem, bool ternary, bool signed)
+ {
+ OpCodeSimdReg64 op = (OpCodeSimdReg64)context.CurrOp;
+
+ int elems = 8 >> op.Size;
+
+ int part = op.RegisterSize == RegisterSize.Simd128 ? elems : 0;
+
+ EmitVectorExtract(context, op.Rm, elem, op.Size, signed);
+ context.EmitSttmp();
+
+ for (int index = 0; index < elems; index++)
+ {
+ if (ternary)
+ {
+ EmitVectorExtract(context, op.Rd, index, op.Size + 1, signed);
+ }
+
+ EmitVectorExtract(context, op.Rn, part + index, op.Size, signed);
+ context.EmitLdtmp();
+
+ emit();
+
+ EmitVectorInsertTmp(context, index, op.Size + 1);
+ }
+
+ context.EmitLdvectmp();
+ context.EmitStvec(op.Rd);
+ }
+
public static void EmitVectorPairwiseOpSx(ILEmitterCtx context, Action emit)
{
EmitVectorPairwiseOp(context, emit, true);
@@ -1416,7 +1474,7 @@ namespace ChocolArm64.Instructions
if (Optimizations.UseSse)
{
//TODO: Use Sse2.MoveScalar once it is fixed,
- //as of the time of writing it just crashes the JIT (SDK 2.1.500).
+ //as of the time of writing it just crashes the JIT (SDK 2.1.503).
/*Type[] typesMov = new Type[] { typeof(Vector128<ulong>) };