aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Instructions
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2020-09-01 01:48:21 +0200
committerGitHub <noreply@github.com>2020-08-31 20:48:21 -0300
commit2cb8bd7006e6e22798a6e44881f3e03d2fe637c5 (patch)
treea217364f9de7f1b9cb7b0904dc02c319c456f652 /ARMeilleure/Instructions
parent4f3ae6f62ca5858c2b74eba5a15bad5dff580349 (diff)
CPU (A64): Add Scvtf_S_Fixed & Ucvtf_S_Fixed with Tests. (#1492)
Diffstat (limited to 'ARMeilleure/Instructions')
-rw-r--r--ARMeilleure/Instructions/InstEmitSimdCvt.cs52
-rw-r--r--ARMeilleure/Instructions/InstName.cs2
2 files changed, 32 insertions, 22 deletions
diff --git a/ARMeilleure/Instructions/InstEmitSimdCvt.cs b/ARMeilleure/Instructions/InstEmitSimdCvt.cs
index 9696fa28..edcf35d5 100644
--- a/ARMeilleure/Instructions/InstEmitSimdCvt.cs
+++ b/ARMeilleure/Instructions/InstEmitSimdCvt.cs
@@ -494,15 +494,19 @@ namespace ARMeilleure.Instructions
}
else
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
- int sizeF = op.Size & 1;
-
- Operand res = EmitVectorLongExtract(context, op.Rn, 0, sizeF + 2);
-
- res = EmitFPConvert(context, res, op.Size, signed: true);
+ EmitCvtf(context, signed: true, scalar: true);
+ }
+ }
- context.Copy(GetVec(op.Rd), context.VectorInsert(context.VectorZero(), res, 0));
+ public static void Scvtf_S_Fixed(ArmEmitterContext context)
+ {
+ if (Optimizations.UseSse2)
+ {
+ EmitSse2ScvtfOp(context, scalar: true);
+ }
+ else
+ {
+ EmitCvtf(context, signed: true, scalar: true);
}
}
@@ -514,7 +518,7 @@ namespace ARMeilleure.Instructions
}
else
{
- EmitVectorCvtf(context, signed: true);
+ EmitCvtf(context, signed: true, scalar: false);
}
}
@@ -526,7 +530,7 @@ namespace ARMeilleure.Instructions
}
else
{
- EmitVectorCvtf(context, signed: true);
+ EmitCvtf(context, signed: true, scalar: false);
}
}
@@ -562,15 +566,19 @@ namespace ARMeilleure.Instructions
}
else
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
- int sizeF = op.Size & 1;
-
- Operand ne = EmitVectorLongExtract(context, op.Rn, 0, sizeF + 2);
-
- Operand res = EmitFPConvert(context, ne, sizeF, signed: false);
+ EmitCvtf(context, signed: false, scalar: true);
+ }
+ }
- context.Copy(GetVec(op.Rd), context.VectorInsert(context.VectorZero(), res, 0));
+ public static void Ucvtf_S_Fixed(ArmEmitterContext context)
+ {
+ if (Optimizations.UseSse2)
+ {
+ EmitSse2UcvtfOp(context, scalar: true);
+ }
+ else
+ {
+ EmitCvtf(context, signed: false, scalar: true);
}
}
@@ -582,7 +590,7 @@ namespace ARMeilleure.Instructions
}
else
{
- EmitVectorCvtf(context, signed: false);
+ EmitCvtf(context, signed: false, scalar: false);
}
}
@@ -594,7 +602,7 @@ namespace ARMeilleure.Instructions
}
else
{
- EmitVectorCvtf(context, signed: false);
+ EmitCvtf(context, signed: false, scalar: false);
}
}
@@ -742,7 +750,7 @@ namespace ARMeilleure.Instructions
SetIntOrZR(context, op.Rd, res);
}
- private static void EmitVectorCvtf(ArmEmitterContext context, bool signed)
+ private static void EmitCvtf(ArmEmitterContext context, bool signed, bool scalar)
{
OpCodeSimd op = (OpCodeSimd)context.CurrOp;
@@ -753,7 +761,7 @@ namespace ARMeilleure.Instructions
int fBits = GetFBits(context);
- int elems = op.GetBytesCount() >> sizeI;
+ int elems = !scalar ? op.GetBytesCount() >> sizeI : 1;
for (int index = 0; index < elems; index++)
{
diff --git a/ARMeilleure/Instructions/InstName.cs b/ARMeilleure/Instructions/InstName.cs
index 9e820f6b..0d0c1264 100644
--- a/ARMeilleure/Instructions/InstName.cs
+++ b/ARMeilleure/Instructions/InstName.cs
@@ -315,6 +315,7 @@ namespace ARMeilleure.Instructions
Scvtf_Gp,
Scvtf_Gp_Fixed,
Scvtf_S,
+ Scvtf_S_Fixed,
Scvtf_V,
Scvtf_V_Fixed,
Sha1c_V,
@@ -414,6 +415,7 @@ namespace ARMeilleure.Instructions
Ucvtf_Gp,
Ucvtf_Gp_Fixed,
Ucvtf_S,
+ Ucvtf_S_Fixed,
Ucvtf_V,
Ucvtf_V_Fixed,
Uhadd_V,