emit_x64_vector_floating_point: Use arrays for retrieving size instead of hardcoding the size

Similar changes were done in emit_x64_vector, but these were missed.
This commit is contained in:
Lioncash 2018-04-28 19:36:22 -04:00 committed by MerryMage
parent af28e89a13
commit 9fc89f0a0e

View file

@ -78,7 +78,7 @@ static void EmitVectorOperation32(BlockOfCode& code, EmitContext& ctx, IR::Inst*
code.movaps(xword[code.ABI_PARAM3], xmm_b); code.movaps(xword[code.ABI_PARAM3], xmm_b);
code.CallFunction(static_cast<void(*)(std::array<u32, 4>&, const std::array<u32, 4>&, const std::array<u32, 4>&)>( code.CallFunction(static_cast<void(*)(std::array<u32, 4>&, const std::array<u32, 4>&, const std::array<u32, 4>&)>(
[](std::array<u32, 4>& result, const std::array<u32, 4>& a, const std::array<u32, 4>& b) { [](std::array<u32, 4>& result, const std::array<u32, 4>& a, const std::array<u32, 4>& b) {
for (size_t i = 0; i < 4; ++i) { for (size_t i = 0; i < result.size(); ++i) {
if (auto r = Common::ProcessNaNs(a[i], b[i])) { if (auto r = Common::ProcessNaNs(a[i], b[i])) {
result[i] = *r; result[i] = *r;
} else if (Common::IsNaN(result[i])) { } else if (Common::IsNaN(result[i])) {
@ -160,7 +160,7 @@ static void EmitVectorOperation64(BlockOfCode& code, EmitContext& ctx, IR::Inst*
code.movaps(xword[code.ABI_PARAM3], xmm_b); code.movaps(xword[code.ABI_PARAM3], xmm_b);
code.CallFunction(static_cast<void(*)(std::array<u64, 2>&, const std::array<u64, 2>&, const std::array<u64, 2>&)>( code.CallFunction(static_cast<void(*)(std::array<u64, 2>&, const std::array<u64, 2>&, const std::array<u64, 2>&)>(
[](std::array<u64, 2>& result, const std::array<u64, 2>& a, const std::array<u64, 2>& b) { [](std::array<u64, 2>& result, const std::array<u64, 2>& a, const std::array<u64, 2>& b) {
for (size_t i = 0; i < 2; ++i) { for (size_t i = 0; i < result.size(); ++i) {
if (auto r = Common::ProcessNaNs(a[i], b[i])) { if (auto r = Common::ProcessNaNs(a[i], b[i])) {
result[i] = *r; result[i] = *r;
} else if (Common::IsNaN(result[i])) { } else if (Common::IsNaN(result[i])) {