diff options
author | bunnei <bunneidev@gmail.com> | 2017-10-10 05:56:20 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2017-10-10 05:56:20 +0200 |
commit | b1d5db1cf60344b6b081c9d03cb6ccc3264326cd (patch) | |
tree | fde377c4ba3c0f92c032e6f5ec8627aae37270ef /src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp | |
parent | loader: Various improvements for NSO/NRO loaders. (diff) | |
parent | Merge pull request #2996 from MerryMage/split-travis (diff) | |
download | yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.gz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.bz2 yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.lz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.xz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.zst yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.zip |
Diffstat (limited to 'src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp')
-rw-r--r-- | src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp b/src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp new file mode 100644 index 000000000..83719a58e --- /dev/null +++ b/src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp @@ -0,0 +1,50 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <catch.hpp> + +#include "core/arm/dyncom/arm_dyncom.h" +#include "core/core_timing.h" +#include "tests/core/arm/arm_test_common.h" + +namespace ArmTests { + +struct VfpTestCase { + u32 initial_fpscr; + u32 a; + u32 b; + u32 result; + u32 final_fpscr; +}; + +TEST_CASE("ARM_DynCom (vfp): vadd", "[arm_dyncom]") { + TestEnvironment test_env(false); + test_env.SetMemory32(0, 0xEE321A03); // vadd.f32 s2, s4, s6 + test_env.SetMemory32(4, 0xEAFFFFFE); // b +#0 + + ARM_DynCom dyncom(USER32MODE); + + std::vector<VfpTestCase> test_cases{{ +#include "vfp_vadd_f32.inc" + }}; + + for (const auto& test_case : test_cases) { + dyncom.SetPC(0); + dyncom.SetVFPSystemReg(VFP_FPSCR, test_case.initial_fpscr); + dyncom.SetVFPReg(4, test_case.a); + dyncom.SetVFPReg(6, test_case.b); + dyncom.ExecuteInstructions(1); + if (dyncom.GetVFPReg(2) != test_case.result || + dyncom.GetVFPSystemReg(VFP_FPSCR) != test_case.final_fpscr) { + printf("f: %x\n", test_case.initial_fpscr); + printf("a: %x\n", test_case.a); + printf("b: %x\n", test_case.b); + printf("c: %x (%x)\n", dyncom.GetVFPReg(2), test_case.result); + printf("f: %x (%x)\n", dyncom.GetVFPSystemReg(VFP_FPSCR), test_case.final_fpscr); + FAIL(); + } + } +} + +} // namespace ArmTests
\ No newline at end of file |