mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-05 05:58:19 +01:00
IR: Implement VectorSetElement{8,16,32,64}
This commit is contained in:
parent
a5c4fbc783
commit
ebfc51c609
4 changed files with 120 additions and 0 deletions
|
|
@ -740,6 +740,23 @@ UAny IREmitter::VectorGetElement(size_t esize, const U128& a, size_t index) {
|
|||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorSetElement(size_t esize, const U128& a, size_t index, const IR::UAny& elem) {
|
||||
ASSERT_MSG(esize * index < 128, "Invalid index");
|
||||
switch (esize) {
|
||||
case 8:
|
||||
return Inst<U128>(Opcode::VectorSetElement8, a, Imm8(static_cast<u8>(index)), elem);
|
||||
case 16:
|
||||
return Inst<U128>(Opcode::VectorSetElement16, a, Imm8(static_cast<u8>(index)), elem);
|
||||
case 32:
|
||||
return Inst<U128>(Opcode::VectorSetElement32, a, Imm8(static_cast<u8>(index)), elem);
|
||||
case 64:
|
||||
return Inst<U128>(Opcode::VectorSetElement64, a, Imm8(static_cast<u8>(index)), elem);
|
||||
default:
|
||||
ASSERT_MSG(false, "Unreachable");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
U128 IREmitter::VectorAdd8(const U128& a, const U128& b) {
|
||||
return Inst<U128>(Opcode::VectorAdd8, a, b);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ public:
|
|||
U128 AESMixColumns(const U128& a);
|
||||
|
||||
UAny VectorGetElement(size_t esize, const U128& a, size_t index);
|
||||
U128 VectorSetElement(size_t esize, const U128& a, size_t index, const UAny& elem);
|
||||
U128 VectorAdd8(const U128& a, const U128& b);
|
||||
U128 VectorAdd16(const U128& a, const U128& b);
|
||||
U128 VectorAdd32(const U128& a, const U128& b);
|
||||
|
|
|
|||
|
|
@ -187,6 +187,10 @@ OPCODE(VectorGetElement8, T::U8, T::U128, T::U8
|
|||
OPCODE(VectorGetElement16, T::U16, T::U128, T::U8 )
|
||||
OPCODE(VectorGetElement32, T::U32, T::U128, T::U8 )
|
||||
OPCODE(VectorGetElement64, T::U64, T::U128, T::U8 )
|
||||
OPCODE(VectorSetElement8, T::U128, T::U128, T::U8, T::U8 )
|
||||
OPCODE(VectorSetElement16, T::U128, T::U128, T::U8, T::U16 )
|
||||
OPCODE(VectorSetElement32, T::U128, T::U128, T::U8, T::U32 )
|
||||
OPCODE(VectorSetElement64, T::U128, T::U128, T::U8, T::U64 )
|
||||
OPCODE(VectorAdd8, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorAdd16, T::U128, T::U128, T::U128 )
|
||||
OPCODE(VectorAdd32, T::U128, T::U128, T::U128 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue