mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-05 22:18:16 +01:00
ir: Add opcodes for vector paired maximum and minimums
For the time being, we can just do a naive implementation which avoids falling back to the interpreter a bit. Horizontal operations aren't necessarily x86 SIMD's forte anyways.
This commit is contained in:
parent
43344c5400
commit
463b9a3d02
4 changed files with 167 additions and 0 deletions
|
|
@ -1226,6 +1226,62 @@ U128 IREmitter::VectorPairedAddUnsignedWiden(size_t original_esize, const U128&
|
|||
return {};
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorPairedMaxSigned(size_t esize, const U128& a, const U128& b) {
|
||||
switch (esize) {
|
||||
case 8:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxS8, a, b);
|
||||
case 16:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxS16, a, b);
|
||||
case 32:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxS32, a, b);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorPairedMaxUnsigned(size_t esize, const U128& a, const U128& b) {
|
||||
switch (esize) {
|
||||
case 8:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxU8, a, b);
|
||||
case 16:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxU16, a, b);
|
||||
case 32:
|
||||
return Inst<U128>(Opcode::VectorPairedMaxU32, a, b);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorPairedMinSigned(size_t esize, const U128& a, const U128& b) {
|
||||
switch (esize) {
|
||||
case 8:
|
||||
return Inst<U128>(Opcode::VectorPairedMinS8, a, b);
|
||||
case 16:
|
||||
return Inst<U128>(Opcode::VectorPairedMinS16, a, b);
|
||||
case 32:
|
||||
return Inst<U128>(Opcode::VectorPairedMinS32, a, b);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorPairedMinUnsigned(size_t esize, const U128& a, const U128& b) {
|
||||
switch (esize) {
|
||||
case 8:
|
||||
return Inst<U128>(Opcode::VectorPairedMinU8, a, b);
|
||||
case 16:
|
||||
return Inst<U128>(Opcode::VectorPairedMinU16, a, b);
|
||||
case 32:
|
||||
return Inst<U128>(Opcode::VectorPairedMinU32, a, b);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorPolynomialMultiply(const U128& a, const U128& b) {
|
||||
return Inst<U128>(Opcode::VectorPolynomialMultiply8, a, b);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,10 @@ public:
|
|||
U128 VectorPairedAddLower(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPairedAddSignedWiden(size_t original_esize, const U128& a);
|
||||
U128 VectorPairedAddUnsignedWiden(size_t original_esize, const U128& a);
|
||||
U128 VectorPairedMaxSigned(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPairedMaxUnsigned(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPairedMinSigned(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPairedMinUnsigned(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPolynomialMultiply(const U128& a, const U128& b);
|
||||
U128 VectorPolynomialMultiplyLong(size_t esize, const U128& a, const U128& b);
|
||||
U128 VectorPopulationCount(const U128& a);
|
||||
|
|
|
|||
|
|
@ -338,6 +338,18 @@ OPCODE(VectorPairedAdd8, T::U128, T::U128,
|
|||
OPCODE(VectorPairedAdd16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedAdd32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedAdd64, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxS8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxS16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxS32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxU8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxU16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMaxU32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinS8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinS16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinS32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinU8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinU16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPairedMinU32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPolynomialMultiply8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPolynomialMultiplyLong8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorPolynomialMultiplyLong64, T::U128, T::U128, T::U128 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue