Skip to content

Commit

Permalink
fix vaddsws implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
DeaTh-G committed Nov 24, 2024
1 parent 9f1062c commit 5443c08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PowerRecomp/recompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,12 @@ bool Recompiler::Recompile(
break;

case PPC_INST_VADDSWS:
println("\t_mm_store_si128((__m128i*){}.s32, _mm_adds_epi32(_mm_load_si128((__m128i*){}.s32), _mm_load_si128((__m128i*){}.s32)));", v(insn.operands[0]), v(insn.operands[1]), v(insn.operands[2]));
// TODO: vectorize
for (size_t i = 0; i < 4; i++)
{
println("\t{}.s64 = int64_t({}.s32[{}]) + int64_t({}.s32[{}]);", temp(), v(insn.operands[1]), i, v(insn.operands[2]), i);
println("\t{}.s32[{}] = {}.s64 > INT_MAX ? INT_MAX : {}.s64 < INT_MIN ? INT_MIN : {}.s64;", v(insn.operands[0]), i, temp(), temp(), temp());
}
break;

case PPC_INST_VADDUBM:
Expand Down

0 comments on commit 5443c08

Please sign in to comment.