mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
PPU LLVM: Use VPERM2B to emulate VPERM (#8704)
- The VPERM2B instructions are a match of VPERM's behavior, besides operating in reverse byte order
This commit is contained in:
parent
0c85d4c0d0
commit
4ce2ad54a8
3 changed files with 47 additions and 0 deletions
|
|
@ -1295,6 +1295,14 @@ void PPUTranslator::VPERM(ppu_opcode_t op)
|
|||
const auto a = get_vr<u8[16]>(op.va);
|
||||
const auto b = get_vr<u8[16]>(op.vb);
|
||||
const auto c = get_vr<u8[16]>(op.vc);
|
||||
|
||||
if (m_use_avx512_icl && op.ra != op.rb)
|
||||
{
|
||||
const auto i = eval(~c);
|
||||
set_vr(op.vd, vperm2b(b, a, i));
|
||||
return;
|
||||
}
|
||||
|
||||
const auto i = eval(~c & 0x1f);
|
||||
set_vr(op.vd, select(noncast<s8[16]>(c << 3) >= 0, pshufb(a, i), pshufb(b, i)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue