Skip to content

Commit

Permalink
Implement FCVTNS (Scalar GP) (#2953)
Browse files Browse the repository at this point in the history
* Implement FCVTNS (Scalar GP)

* Update Ptc Version
  • Loading branch information
saldabain authored Jan 20, 2022
1 parent b27183b commit 60f7cba
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions ARMeilleure/Decoders/OpCodeTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ static OpCodeTable()
SetA64("0>0011100<100001101110xxxxxxxxxx", InstName.Fcvtms_V, InstEmit.Fcvtms_V, OpCodeSimd.Create);
SetA64("x00111100x110001000000xxxxxxxxxx", InstName.Fcvtmu_Gp, InstEmit.Fcvtmu_Gp, OpCodeSimdCvt.Create);
SetA64("0x0011100x100001011010xxxxxxxxxx", InstName.Fcvtn_V, InstEmit.Fcvtn_V, OpCodeSimd.Create);
SetA64("x00111100x100000000000xxxxxxxxxx", InstName.Fcvtns_Gp, InstEmit.Fcvtns_Gp, OpCodeSimdCvt.Create);
SetA64("010111100x100001101010xxxxxxxxxx", InstName.Fcvtns_S, InstEmit.Fcvtns_S, OpCodeSimd.Create);
SetA64("0>0011100<100001101010xxxxxxxxxx", InstName.Fcvtns_V, InstEmit.Fcvtns_V, OpCodeSimd.Create);
SetA64("011111100x100001101010xxxxxxxxxx", InstName.Fcvtnu_S, InstEmit.Fcvtnu_S, OpCodeSimd.Create);
Expand Down
12 changes: 12 additions & 0 deletions ARMeilleure/Instructions/InstEmitSimdCvt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,18 @@ public static void Fcvtn_V(ArmEmitterContext context)
}
}

public static void Fcvtns_Gp(ArmEmitterContext context)
{
if (Optimizations.UseSse41)
{
EmitSse41Fcvts_Gp(context, FPRoundingMode.ToNearest, isFixed: false);
}
else
{
EmitFcvt_s_Gp(context, (op1) => EmitRoundMathCall(context, MidpointRounding.ToEven, op1));
}
}

public static void Fcvtns_S(ArmEmitterContext context)
{
if (Optimizations.UseSse41)
Expand Down
1 change: 1 addition & 0 deletions ARMeilleure/Instructions/InstName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ enum InstName
Fcvtms_V,
Fcvtmu_Gp,
Fcvtn_V,
Fcvtns_Gp,
Fcvtns_S,
Fcvtns_V,
Fcvtnu_S,
Expand Down
2 changes: 1 addition & 1 deletion ARMeilleure/Translation/PTC/Ptc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class Ptc
private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0";

private const uint InternalVersion = 2937; //! To be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 2953; //! To be incremented manually for each change to the ARMeilleure project.

private const string ActualDir = "0";
private const string BackupDir = "1";
Expand Down
4 changes: 4 additions & 0 deletions Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private static uint[] _F_Cvt_AMPZ_SU_Gp_SW_()
0x1E250000u, // FCVTAU W0, S0
0x1E300000u, // FCVTMS W0, S0
0x1E310000u, // FCVTMU W0, S0
0x1E200000u, // FCVTNS W0, S0
0x1E280000u, // FCVTPS W0, S0
0x1E290000u, // FCVTPU W0, S0
0x1E380000u, // FCVTZS W0, S0
Expand All @@ -216,6 +217,7 @@ private static uint[] _F_Cvt_AMPZ_SU_Gp_SX_()
0x9E250000u, // FCVTAU X0, S0
0x9E300000u, // FCVTMS X0, S0
0x9E310000u, // FCVTMU X0, S0
0x9E200000u, // FCVTNS X0, S0
0x9E280000u, // FCVTPS X0, S0
0x9E290000u, // FCVTPU X0, S0
0x9E380000u, // FCVTZS X0, S0
Expand All @@ -231,6 +233,7 @@ private static uint[] _F_Cvt_AMPZ_SU_Gp_DW_()
0x1E650000u, // FCVTAU W0, D0
0x1E700000u, // FCVTMS W0, D0
0x1E710000u, // FCVTMU W0, D0
0x1E600000u, // FCVTNS W0, D0
0x1E680000u, // FCVTPS W0, D0
0x1E690000u, // FCVTPU W0, D0
0x1E780000u, // FCVTZS W0, D0
Expand All @@ -246,6 +249,7 @@ private static uint[] _F_Cvt_AMPZ_SU_Gp_DX_()
0x9E650000u, // FCVTAU X0, D0
0x9E700000u, // FCVTMS X0, D0
0x9E710000u, // FCVTMU X0, D0
0x9E600000u, // FCVTNS X0, D0
0x9E680000u, // FCVTPS X0, D0
0x9E690000u, // FCVTPU X0, D0
0x9E780000u, // FCVTZS X0, D0
Expand Down

0 comments on commit 60f7cba

Please sign in to comment.