mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2026-04-26 11:41:47 +00:00
Implement vpkshss and vpkswus
This commit is contained in:
parent
541631f055
commit
0f42cc4d68
1 changed files with 20 additions and 0 deletions
|
|
@ -2339,11 +2339,31 @@ bool Recompiler::Recompile(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PPC_INST_VPKSHSS:
|
||||||
|
case PPC_INST_VPKSHSS128:
|
||||||
|
println("\t_mm_store_si128((__m128i*){}.s8, _mm_packs_epi16(_mm_load_si128((__m128i*){}.s16), _mm_load_si128((__m128i*){}.s16)));",
|
||||||
|
v(insn.operands[0]), v(insn.operands[2]), v(insn.operands[1]));
|
||||||
|
break;
|
||||||
|
|
||||||
case PPC_INST_VPKSHUS:
|
case PPC_INST_VPKSHUS:
|
||||||
case PPC_INST_VPKSHUS128:
|
case PPC_INST_VPKSHUS128:
|
||||||
println("\t_mm_store_si128((__m128i*){}.u8, _mm_packus_epi16(_mm_load_si128((__m128i*){}.s16), _mm_load_si128((__m128i*){}.s16)));", v(insn.operands[0]), v(insn.operands[2]), v(insn.operands[1]));
|
println("\t_mm_store_si128((__m128i*){}.u8, _mm_packus_epi16(_mm_load_si128((__m128i*){}.s16), _mm_load_si128((__m128i*){}.s16)));", v(insn.operands[0]), v(insn.operands[2]), v(insn.operands[1]));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PPC_INST_VPKSWUS:
|
||||||
|
case PPC_INST_VPKSWUS128:
|
||||||
|
println("\t_mm_store_si128((__m128i*){}.s32, _mm_load_si128((__m128i*){}.s32));", vTemp(), v(insn.operands[2]));
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
println("\t{}.u16[{}] = {}.s32[{}] < 0 ? 0 : ({}.s32[{}] > 0xFFFF ? 0xFFFF : {}.s32[{}]);",
|
||||||
|
v(insn.operands[0]), i, vTemp(), i, vTemp(), i, vTemp(), i);
|
||||||
|
}
|
||||||
|
println("\t_mm_store_si128((__m128i*){}.s32, _mm_load_si128((__m128i*){}.s32));", vTemp(), v(insn.operands[1]));
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
println("\t{}.u16[{}] = {}.s32[{}] < 0 ? 0 : ({}.s32[{}] > 0xFFFF ? 0xFFFF : {}.s32[{}]);",
|
||||||
|
v(insn.operands[0]), i + 4, vTemp(), i, vTemp(), i, vTemp(), i);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PPC_INST_VREFP:
|
case PPC_INST_VREFP:
|
||||||
case PPC_INST_VREFP128:
|
case PPC_INST_VREFP128:
|
||||||
// TODO: see if we can use rcp safely
|
// TODO: see if we can use rcp safely
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue