Add missing exception messages.

Reintroduce slow path for Fmov_Vi.
Implement slow path for Fmov_Si.
This commit is contained in:
LDj3SNuD 2020-01-11 02:42:00 +01:00
parent fd4a05fe5a
commit f9f21401df
4 changed files with 43 additions and 12 deletions

View file

@ -284,13 +284,26 @@ namespace ARMeilleure.Instructions
{
OpCodeSimdFmov op = (OpCodeSimdFmov)context.CurrOp;
if (op.Size == 0)
if (Optimizations.UseSse2)
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, (int)op.Immediate));
if (op.Size == 0)
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, (int)op.Immediate));
}
else
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, op.Immediate));
}
}
else
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, op.Immediate));
Operand e = Const(op.Immediate);
Operand res = context.VectorZero();
res = EmitVectorInsert(context, res, e, 0, op.Size + 2);
context.Copy(GetVec(op.Rd), res);
}
}
@ -298,13 +311,31 @@ namespace ARMeilleure.Instructions
{
OpCodeSimdImm op = (OpCodeSimdImm)context.CurrOp;
if (op.RegisterSize == RegisterSize.Simd128)
if (Optimizations.UseSse2)
{
context.Copy(GetVec(op.Rd), X86GetAllElements(context, op.Immediate));
if (op.RegisterSize == RegisterSize.Simd128)
{
context.Copy(GetVec(op.Rd), X86GetAllElements(context, op.Immediate));
}
else
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, op.Immediate));
}
}
else
{
context.Copy(GetVec(op.Rd), X86GetScalar(context, op.Immediate));
Operand e = Const(op.Immediate);
Operand res = context.VectorZero();
int elems = op.RegisterSize == RegisterSize.Simd128 ? 2 : 1;
for (int index = 0; index < elems; index++)
{
res = EmitVectorInsert(context, res, e, index, 3);
}
context.Copy(GetVec(op.Rd), res);
}
}

View file

@ -13,7 +13,7 @@ namespace ARMeilleure.Translation.AOT
public override string ToString()
{
return $"(Position = {Position}, Name = {Name})";
return $"({nameof(Position)} = {Position}, {nameof(Name)} = {Name})";
}
}
}

View file

@ -27,7 +27,7 @@ namespace ARMeilleure.Translation
{
if (info == null)
{
throw new ArgumentNullException();
throw new ArgumentNullException(nameof(info));
}
Type[] parameters = info.GetParameters().Select(pI => pI.ParameterType).ToArray();

View file

@ -11,7 +11,7 @@ namespace ARMeilleure.Translation
{
if (key == null)
{
throw new ArgumentNullException();
throw new ArgumentNullException(nameof(key));
}
if (_delegates.TryGetValue(key, out DelegateInfo dlgInfo))
@ -32,12 +32,12 @@ namespace ARMeilleure.Translation
{
if (key == null)
{
throw new ArgumentNullException();
throw new ArgumentNullException(nameof(key));
}
if (!_delegates.TryGetValue(key, out DelegateInfo dlgInfo))
{
throw new Exception();
throw new ArgumentException($"({nameof(key)} = {key})");
}
return dlgInfo;
@ -51,7 +51,7 @@ namespace ARMeilleure.Translation
if (!_delegates.TryAdd(key, new DelegateInfo(dlg)))
{
throw new Exception();
throw new ArgumentException($"({nameof(key)} = {key})");
}
}