Add Cmhi_V & Cmhs_V Sse opt..
This commit is contained in:
parent
47074012fc
commit
93bd6ea8e1
1 changed files with 65 additions and 2 deletions
|
@ -86,7 +86,42 @@ namespace ChocolArm64.Instructions
|
||||||
|
|
||||||
public static void Cmhi_V(ILEmitterCtx context)
|
public static void Cmhi_V(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
EmitCmpOp(context, OpCodes.Bgt_Un_S, scalar: false);
|
OpCodeSimdReg64 op = (OpCodeSimdReg64)context.CurrOp;
|
||||||
|
|
||||||
|
if (Optimizations.UseSse41 && op.Size < 3)
|
||||||
|
{
|
||||||
|
Type[] typesMax = new Type[] { VectorUIntTypesPerSizeLog2[op.Size], VectorUIntTypesPerSizeLog2[op.Size] };
|
||||||
|
Type[] typesCmp = new Type[] { VectorIntTypesPerSizeLog2 [op.Size], VectorIntTypesPerSizeLog2 [op.Size] };
|
||||||
|
Type[] typesAnt = new Type[] { typeof(Vector128<byte>), typeof(Vector128<byte>) };
|
||||||
|
Type[] typesSav = new Type[] { typeof(byte) };
|
||||||
|
|
||||||
|
Type typeSse = op.Size == 0 ? typeof(Sse2) : typeof(Sse41);
|
||||||
|
|
||||||
|
context.EmitLdvec(op.Rm);
|
||||||
|
context.EmitLdvec(op.Rn);
|
||||||
|
|
||||||
|
context.EmitCall(typeSse.GetMethod(nameof(Sse2.Max), typesMax));
|
||||||
|
|
||||||
|
context.EmitLdvec(op.Rm);
|
||||||
|
|
||||||
|
context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.CompareEqual), typesCmp));
|
||||||
|
|
||||||
|
context.EmitLdc_I4(byte.MaxValue);
|
||||||
|
context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.SetAllVector128), typesSav));
|
||||||
|
|
||||||
|
context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.AndNot), typesAnt));
|
||||||
|
|
||||||
|
context.EmitStvec(op.Rd);
|
||||||
|
|
||||||
|
if (op.RegisterSize == RegisterSize.Simd64)
|
||||||
|
{
|
||||||
|
EmitVectorZeroUpper(context, op.Rd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmitCmpOp(context, OpCodes.Bgt_Un_S, scalar: false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Cmhs_S(ILEmitterCtx context)
|
public static void Cmhs_S(ILEmitterCtx context)
|
||||||
|
@ -96,7 +131,35 @@ namespace ChocolArm64.Instructions
|
||||||
|
|
||||||
public static void Cmhs_V(ILEmitterCtx context)
|
public static void Cmhs_V(ILEmitterCtx context)
|
||||||
{
|
{
|
||||||
EmitCmpOp(context, OpCodes.Bge_Un_S, scalar: false);
|
OpCodeSimdReg64 op = (OpCodeSimdReg64)context.CurrOp;
|
||||||
|
|
||||||
|
if (Optimizations.UseSse41 && op.Size < 3)
|
||||||
|
{
|
||||||
|
Type[] typesMax = new Type[] { VectorUIntTypesPerSizeLog2[op.Size], VectorUIntTypesPerSizeLog2[op.Size] };
|
||||||
|
Type[] typesCmp = new Type[] { VectorIntTypesPerSizeLog2 [op.Size], VectorIntTypesPerSizeLog2 [op.Size] };
|
||||||
|
|
||||||
|
Type typeSse = op.Size == 0 ? typeof(Sse2) : typeof(Sse41);
|
||||||
|
|
||||||
|
context.EmitLdvec(op.Rn);
|
||||||
|
context.EmitLdvec(op.Rm);
|
||||||
|
|
||||||
|
context.EmitCall(typeSse.GetMethod(nameof(Sse2.Max), typesMax));
|
||||||
|
|
||||||
|
context.EmitLdvec(op.Rn);
|
||||||
|
|
||||||
|
context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.CompareEqual), typesCmp));
|
||||||
|
|
||||||
|
context.EmitStvec(op.Rd);
|
||||||
|
|
||||||
|
if (op.RegisterSize == RegisterSize.Simd64)
|
||||||
|
{
|
||||||
|
EmitVectorZeroUpper(context, op.Rd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmitCmpOp(context, OpCodes.Bge_Un_S, scalar: false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Cmle_S(ILEmitterCtx context)
|
public static void Cmle_S(ILEmitterCtx context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue