diff --git a/src/backend_x64/emit_x64_vector_floating_point.cpp b/src/backend_x64/emit_x64_vector_floating_point.cpp index 3f845e19..de24a168 100644 --- a/src/backend_x64/emit_x64_vector_floating_point.cpp +++ b/src/backend_x64/emit_x64_vector_floating_point.cpp @@ -43,12 +43,19 @@ static T ChooseOnFsize([[maybe_unused]] T f32, [[maybe_unused]] T f64) { template class Indexer, size_t narg> struct NaNHandler { +public: + using FPT = mp::unsigned_integer_of_size; + + using function_type = void(*)(std::array, narg>&); + + static function_type GetDefault() { + return GetDefaultImpl(std::make_index_sequence{}); + } + private: template - static auto GetDefaultImpl(std::index_sequence) { - using FPT = mp::unsigned_integer_of_size; - - auto result = [](std::array, sizeof...(argi) + 1>& values) { + static function_type GetDefaultImpl(std::index_sequence) { + const auto result = [](std::array, narg>& values) { VectorArray& result = values[0]; for (size_t elementi = 0; elementi < result.size(); ++elementi) { const auto current_values = Indexer{}(elementi, values[argi + 1]...); @@ -60,15 +67,8 @@ private: } }; - return static_cast*>(result); + return static_cast(result); } - -public: - static auto GetDefault() { - return GetDefaultImpl(std::make_index_sequence{}); - } - - using function_type = mp::return_type_t; }; template @@ -515,7 +515,7 @@ void EmitFPVectorMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { using FPT = mp::unsigned_integer_of_size; if (code.DoesCpuSupport(Xbyak::util::Cpu::tFMA)) { - auto x64_instruction = fsize == 32 ? &Xbyak::CodeGenerator::vfmadd231ps : &Xbyak::CodeGenerator::vfmadd231pd; + const auto x64_instruction = fsize == 32 ? &Xbyak::CodeGenerator::vfmadd231ps : &Xbyak::CodeGenerator::vfmadd231pd; EmitFourOpVectorOperation(code, ctx, inst, x64_instruction, static_cast, 4>& values)>( [](std::array, 4>& values) {