Add EmitSse42Crc32()
This commit is contained in:
parent
1eba6aa860
commit
bf5a70ecd8
1 changed files with 17 additions and 33 deletions
|
@ -33,14 +33,7 @@ namespace ChocolArm64.Instruction
|
|||
{
|
||||
if (AOptimizations.UseSse42)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
||||
Context.EmitLdintzr(Op.Rn);
|
||||
Context.EmitLdintzr(Op.Rm);
|
||||
|
||||
Context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { typeof(uint), typeof(byte) }));
|
||||
|
||||
Context.EmitStintzr(Op.Rd);
|
||||
EmitSse42Crc32(Context, typeof(uint), typeof(byte));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -52,14 +45,7 @@ namespace ChocolArm64.Instruction
|
|||
{
|
||||
if (AOptimizations.UseSse42)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
||||
Context.EmitLdintzr(Op.Rn);
|
||||
Context.EmitLdintzr(Op.Rm);
|
||||
|
||||
Context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { typeof(uint), typeof(ushort) }));
|
||||
|
||||
Context.EmitStintzr(Op.Rd);
|
||||
EmitSse42Crc32(Context, typeof(uint), typeof(ushort));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -71,14 +57,7 @@ namespace ChocolArm64.Instruction
|
|||
{
|
||||
if (AOptimizations.UseSse42)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
||||
Context.EmitLdintzr(Op.Rn);
|
||||
Context.EmitLdintzr(Op.Rm);
|
||||
|
||||
Context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { typeof(uint), typeof(uint) }));
|
||||
|
||||
Context.EmitStintzr(Op.Rd);
|
||||
EmitSse42Crc32(Context, typeof(uint), typeof(uint));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -90,14 +69,7 @@ namespace ChocolArm64.Instruction
|
|||
{
|
||||
if (AOptimizations.UseSse42)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
||||
Context.EmitLdintzr(Op.Rn);
|
||||
Context.EmitLdintzr(Op.Rm);
|
||||
|
||||
Context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { typeof(ulong), typeof(ulong) }));
|
||||
|
||||
Context.EmitStintzr(Op.Rd);
|
||||
EmitSse42Crc32(Context, typeof(ulong), typeof(ulong));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -105,6 +77,18 @@ namespace ChocolArm64.Instruction
|
|||
}
|
||||
}
|
||||
|
||||
private static void EmitSse42Crc32(AILEmitterCtx Context, Type TCrc, Type TData)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
||||
Context.EmitLdintzr(Op.Rn);
|
||||
Context.EmitLdintzr(Op.Rm);
|
||||
|
||||
Context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { TCrc, TData }));
|
||||
|
||||
Context.EmitStintzr(Op.Rd);
|
||||
}
|
||||
|
||||
private static void EmitCrc32(AILEmitterCtx Context, string Name)
|
||||
{
|
||||
AOpCodeAluRs Op = (AOpCodeAluRs)Context.CurrOp;
|
||||
|
@ -128,4 +112,4 @@ namespace ChocolArm64.Instruction
|
|||
Context.EmitStintzr(Op.Rd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue