IR: Implement VectorExtract, VectorExtractLower IR instructions

This commit is contained in:
MerryMage
2018-04-02 21:52:46 +01:00
parent 8bba37089e
commit 3472f371df
4 changed files with 46 additions and 0 deletions

View File

@@ -872,6 +872,16 @@ U128 IREmitter::VectorEqual(size_t esize, const U128& a, const U128& b) {
return {};
}
U128 IREmitter::VectorExtract(const U128& a, const U128& b, size_t position) {
ASSERT(position <= 128);
return Inst<U128>(Opcode::VectorExtract, a, b, Imm8(static_cast<u8>(position)));
}
U128 IREmitter::VectorExtractLower(const U128& a, const U128& b, size_t position) {
ASSERT(position <= 64);
return Inst<U128>(Opcode::VectorExtractLower, a, b, Imm8(static_cast<u8>(position)));
}
U128 IREmitter::VectorGreaterSigned(size_t esize, const U128& a, const U128& b) {
switch (esize) {
case 8:

View File

@@ -215,6 +215,8 @@ public:
U128 VectorBroadcastLower(size_t esize, const UAny& a);
U128 VectorEor(const U128& a, const U128& b);
U128 VectorEqual(size_t esize, const U128& a, const U128& b);
U128 VectorExtract(const U128& a, const U128& b, size_t position);
U128 VectorExtractLower(const U128& a, const U128& b, size_t position);
U128 VectorGreaterEqualSigned(size_t esize, const U128& a, const U128& b);
U128 VectorGreaterEqualUnsigned(size_t esize, const U128& a, const U128& b);
U128 VectorGreaterSigned(size_t esize, const U128& a, const U128& b);

View File

@@ -233,6 +233,8 @@ OPCODE(VectorEqual16, T::U128, T::U128, T::U
OPCODE(VectorEqual32, T::U128, T::U128, T::U128 )
OPCODE(VectorEqual64, T::U128, T::U128, T::U128 )
OPCODE(VectorEqual128, T::U128, T::U128, T::U128 )
OPCODE(VectorExtract, T::U128, T::U128, T::U128, T::U8 )
OPCODE(VectorExtractLower, T::U128, T::U128, T::U128, T::U8 )
OPCODE(VectorGreaterS8, T::U128, T::U128, T::U128 )
OPCODE(VectorGreaterS16, T::U128, T::U128, T::U128 )
OPCODE(VectorGreaterS32, T::U128, T::U128, T::U128 )