Arm64Emitter: Expand the MOVI2R unit test a little

This tests for a bug with ADRP which was present in an
earlier version of this pull request.

Also adding the MOVI2R unit test to the VS build.
This commit is contained in:
JosJuice 2021-02-13 11:54:46 +01:00
parent 9ad4f724e4
commit eff66c2adc
2 changed files with 27 additions and 0 deletions

View File

@ -78,20 +78,44 @@ TEST(JitArm64, MovI2R_ADP)
{
TestMovI2R test;
const u64 base = Common::BitCast<u64>(test.GetCodePtr());
// Test offsets around 0
for (s64 i = -0x20000; i < 0x20000; i++)
{
const u64 offset = static_cast<u64>(i);
test.Check64(base + offset);
}
// Test offsets around the maximum
for (const s64 i : {-0x200000ll, 0x200000ll})
{
for (s64 j = -4; j < 4; j++)
{
const u64 offset = static_cast<u64>(i + j);
test.Check64(base + offset);
}
}
}
TEST(JitArm64, MovI2R_ADRP)
{
TestMovI2R test;
const u64 base = Common::BitCast<u64>(test.GetCodePtr()) & ~0xFFF;
// Test offsets around 0
for (s64 i = -0x20000; i < 0x20000; i++)
{
const u64 offset = static_cast<u64>(i) << 12;
test.Check64(base + offset);
}
// Test offsets around the maximum
for (const s64 i : {-0x100000000ll, -0x80000000ll, 0x80000000ll, 0x100000000ll})
{
for (s64 j = -4; j < 4; j++)
{
const u64 offset = static_cast<u64>(i + (j << 12));
test.Check64(base + offset);
}
}
}

View File

@ -78,6 +78,9 @@
<ClCompile Include="Core\PowerPC\Jit64Common\ConvertDoubleToSingle.cpp" />
<ClCompile Include="Core\PowerPC\Jit64Common\Frsqrte.cpp" />
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='ARM64'">
<ClCompile Include="Core\PowerPC\JitArm64\MovI2R.cpp" />
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>