Implement SSHL instruction, fix exception on FMAX/FMIN, and use a better exception message for undefined/unimplemented instructions

This commit is contained in:
gdkchan 2018-02-07 09:38:43 -03:00
parent b99e808791
commit d77d691381
5 changed files with 27 additions and 6 deletions

View file

@ -498,7 +498,22 @@ namespace ChocolArm64.Instruction
Context.EmitLdvecsf(Op.Rn);
Context.EmitLdvecsf(Op.Rm);
EmitMathOpCall(Context, Name);
MethodInfo MthdInfo;
if (Op.Size == 0)
{
MthdInfo = typeof(MathF).GetMethod(Name, new Type[] { typeof(float), typeof(float) });
}
else if (Op.Size == 1)
{
MthdInfo = typeof(Math).GetMethod(Name, new Type[] { typeof(double), typeof(double) });
}
else
{
throw new InvalidOperationException();
}
Context.EmitCall(MthdInfo);
Context.EmitStvecsf(Op.Rd);
}