IR: Implement VectorLogicalShiftRight

This commit is contained in:
MerryMage 2018-02-10 11:05:22 +00:00
parent 7ff280827b
commit b22c5961f9
4 changed files with 73 additions and 0 deletions

View file

@ -883,6 +883,21 @@ U128 IREmitter::VectorLogicalShiftLeft(size_t esize, const U128& a, u8 shift_amo
return {};
}
U128 IREmitter::VectorLogicalShiftRight(size_t esize, const U128& a, u8 shift_amount) {
switch (esize) {
case 8:
return Inst<U128>(Opcode::VectorLogicalShiftRight8, a, Imm8(shift_amount));
case 16:
return Inst<U128>(Opcode::VectorLogicalShiftRight16, a, Imm8(shift_amount));
case 32:
return Inst<U128>(Opcode::VectorLogicalShiftRight32, a, Imm8(shift_amount));
case 64:
return Inst<U128>(Opcode::VectorLogicalShiftRight64, a, Imm8(shift_amount));
}
UNREACHABLE();
return {};
}
U128 IREmitter::VectorNot(const U128& a) {
return Inst<U128>(Opcode::VectorNot, a);
}

View file

@ -215,6 +215,7 @@ public:
U128 VectorEqual(size_t esize, const U128& a, const U128& b);
U128 VectorInterleaveLower(size_t esize, const U128& a, const U128& b);
U128 VectorLogicalShiftLeft(size_t esize, const U128& a, u8 shift_amount);
U128 VectorLogicalShiftRight(size_t esize, const U128& a, u8 shift_amount);
U128 VectorNot(const U128& a);
U128 VectorOr(const U128& a, const U128& b);
U128 VectorPairedAdd(size_t esize, const U128& a, const U128& b);

View file

@ -224,6 +224,10 @@ OPCODE(VectorLogicalShiftLeft8, T::U128, T::U128, T::U8
OPCODE(VectorLogicalShiftLeft16, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftLeft32, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftLeft64, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftRight8, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftRight16, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftRight32, T::U128, T::U128, T::U8 )
OPCODE(VectorLogicalShiftRight64, T::U128, T::U128, T::U8 )
OPCODE(VectorNot, T::U128, T::U128 )
OPCODE(VectorOr, T::U128, T::U128, T::U128 )
OPCODE(VectorPairedAddLower8, T::U128, T::U128, T::U128 )