IR: Implement Vector{Less,Greater}{,Equal}{Signed,Unsigned}

This commit is contained in:
MerryMage 2018-02-13 18:20:00 +00:00
parent 0df6725f73
commit e2b9b7c5b0
2 changed files with 35 additions and 0 deletions

View file

@ -887,6 +887,18 @@ U128 IREmitter::VectorGreaterSigned(size_t esize, const U128& a, const U128& b)
return {};
}
U128 IREmitter::VectorGreaterEqualSigned(size_t esize, const U128& a, const U128& b) {
return VectorOr(VectorGreaterSigned(esize, a, b), VectorEqual(esize, a, b));
}
U128 IREmitter::VectorGreaterEqualUnsigned(size_t esize, const U128& a, const U128& b) {
return VectorEqual(esize, VectorMaxUnsigned(esize, a, b), a);
}
U128 IREmitter::VectorGreaterUnsigned(size_t esize, const U128& a, const U128& b) {
return VectorNot(VectorEqual(esize, VectorMinUnsigned(esize, a, b), a));
}
U128 IREmitter::VectorInterleaveLower(size_t esize, const U128& a, const U128& b) {
switch (esize) {
case 8:
@ -902,6 +914,22 @@ U128 IREmitter::VectorInterleaveLower(size_t esize, const U128& a, const U128& b
return {};
}
U128 IREmitter::VectorLessEqualSigned(size_t esize, const U128& a, const U128& b) {
return VectorNot(VectorGreaterSigned(esize, a, b));
}
U128 IREmitter::VectorLessEqualUnsigned(size_t esize, const U128& a, const U128& b) {
return VectorEqual(esize, VectorMinUnsigned(esize, a, b), a);
}
U128 IREmitter::VectorLessSigned(size_t esize, const U128& a, const U128& b) {
return VectorNot(VectorOr(VectorGreaterSigned(esize, a, b), VectorEqual(esize, a, b)));
}
U128 IREmitter::VectorLessUnsigned(size_t esize, const U128& a, const U128& b) {
return VectorNot(VectorEqual(esize, VectorMaxUnsigned(esize, a, b), a));
}
U128 IREmitter::VectorLogicalShiftLeft(size_t esize, const U128& a, u8 shift_amount) {
switch (esize) {
case 8:

View file

@ -215,8 +215,15 @@ 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 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);
U128 VectorGreaterUnsigned(size_t esize, const U128& a, const U128& b);
U128 VectorInterleaveLower(size_t esize, const U128& a, const U128& b);
U128 VectorLessEqualSigned(size_t esize, const U128& a, const U128& b);
U128 VectorLessEqualUnsigned(size_t esize, const U128& a, const U128& b);
U128 VectorLessSigned(size_t esize, const U128& a, const U128& b);
U128 VectorLessUnsigned(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 VectorMaxSigned(size_t esize, const U128& a, const U128& b);