From 8c4df465808ec4ab1809f3359b0ded31918c8ab9 Mon Sep 17 00:00:00 2001 From: Mat M Date: Sat, 3 Sep 2016 07:48:31 -0400 Subject: [PATCH] FPSCR: Make value constructor explicit (#13) Maintains consistency between the PSR helper. --- src/backend_x64/interface_x64.cpp | 2 +- src/frontend/arm/FPSCR.h | 2 +- src/frontend/arm_types.h | 2 +- tests/arm/fuzz_arm.cpp | 2 +- tests/arm/fuzz_thumb.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend_x64/interface_x64.cpp b/src/backend_x64/interface_x64.cpp index e94b1cea..2fa41fe7 100644 --- a/src/backend_x64/interface_x64.cpp +++ b/src/backend_x64/interface_x64.cpp @@ -47,7 +47,7 @@ struct Jit::Impl { size_t Execute(size_t cycle_count) { u32 pc = jit_state.Reg[15]; - Arm::LocationDescriptor descriptor{pc, Arm::PSR{jit_state.Cpsr}, jit_state.guest_FPSCR_mode}; + Arm::LocationDescriptor descriptor{pc, Arm::PSR{jit_state.Cpsr}, Arm::FPSCR{jit_state.guest_FPSCR_mode}}; CodePtr code_ptr = GetBasicBlock(descriptor).code_ptr; return block_of_code.RunCode(&jit_state, code_ptr, cycle_count); diff --git a/src/frontend/arm/FPSCR.h b/src/frontend/arm/FPSCR.h index 0468bb25..825394c8 100644 --- a/src/frontend/arm/FPSCR.h +++ b/src/frontend/arm/FPSCR.h @@ -28,7 +28,7 @@ public: FPSCR() = default; FPSCR(const FPSCR&) = default; FPSCR(FPSCR&&) = default; - /* implicit */ FPSCR(u32 data) : value{data} {} + explicit FPSCR(u32 data) : value{data} {} FPSCR& operator=(const FPSCR&) = default; FPSCR& operator=(FPSCR&&) = default; diff --git a/src/frontend/arm_types.h b/src/frontend/arm_types.h index c9582121..054de093 100644 --- a/src/frontend/arm_types.h +++ b/src/frontend/arm_types.h @@ -118,7 +118,7 @@ struct LocationDescriptor { } LocationDescriptor SetFPSCR(u32 new_fpscr) const { - return LocationDescriptor(arm_pc, cpsr, new_fpscr & FPSCR_MODE_MASK); + return LocationDescriptor(arm_pc, cpsr, Arm::FPSCR{new_fpscr & FPSCR_MODE_MASK}); } u64 UniqueHash() const { diff --git a/tests/arm/fuzz_arm.cpp b/tests/arm/fuzz_arm.cpp index 218dbc1e..0e5cb001 100644 --- a/tests/arm/fuzz_arm.cpp +++ b/tests/arm/fuzz_arm.cpp @@ -291,7 +291,7 @@ void FuzzJitArm(const size_t instruction_count, const size_t instructions_to_exe size_t num_insts = 0; while (num_insts < instructions_to_execute_count) { - Dynarmic::Arm::LocationDescriptor descriptor = {u32(num_insts * 4), Dynarmic::Arm::PSR{}, 0}; + Dynarmic::Arm::LocationDescriptor descriptor = {u32(num_insts * 4), Dynarmic::Arm::PSR{}, Dynarmic::Arm::FPSCR{}}; Dynarmic::IR::Block ir_block = Dynarmic::Arm::Translate(descriptor, &MemoryRead32); Dynarmic::Optimization::GetSetElimination(ir_block); Dynarmic::Optimization::DeadCodeElimination(ir_block); diff --git a/tests/arm/fuzz_thumb.cpp b/tests/arm/fuzz_thumb.cpp index deace638..b729db11 100644 --- a/tests/arm/fuzz_thumb.cpp +++ b/tests/arm/fuzz_thumb.cpp @@ -247,7 +247,7 @@ void FuzzJitThumb(const size_t instruction_count, const size_t instructions_to_e Dynarmic::Arm::PSR cpsr; cpsr.T(true); - Dynarmic::IR::Block ir_block = Dynarmic::Arm::Translate({0, cpsr, 0}, MemoryRead32); + Dynarmic::IR::Block ir_block = Dynarmic::Arm::Translate({0, cpsr, Dynarmic::Arm::FPSCR{}}, MemoryRead32); Dynarmic::Optimization::GetSetElimination(ir_block); Dynarmic::Optimization::DeadCodeElimination(ir_block); Dynarmic::Optimization::VerificationPass(ir_block);