A64: Implement SQXTN (vector)

This commit is contained in:
MerryMage 2018-07-24 17:59:14 +01:00
parent 8ef114d48f
commit 3874cb37e3
8 changed files with 139 additions and 38 deletions

View file

@ -1292,6 +1292,19 @@ U128 IREmitter::VectorSignedAbsoluteDifference(size_t esize, const U128& a, cons
return {};
}
U128 IREmitter::VectorSignedSaturatedNarrowToSigned(size_t original_esize, const U128& a) {
switch (original_esize) {
case 16:
return Inst<U128>(Opcode::VectorSignedSaturatedNarrowToSigned16, a);
case 32:
return Inst<U128>(Opcode::VectorSignedSaturatedNarrowToSigned32, a);
case 64:
return Inst<U128>(Opcode::VectorSignedSaturatedNarrowToSigned64, a);
}
UNREACHABLE();
return {};
}
U128 IREmitter::VectorSignedSaturatedNarrowToUnsigned(size_t original_esize, const U128& a) {
switch (original_esize) {
case 16:

View file

@ -249,6 +249,7 @@ public:
U128 VectorShuffleWords(const U128& a, u8 mask);
U128 VectorSignExtend(size_t original_esize, const U128& a);
U128 VectorSignedAbsoluteDifference(size_t esize, const U128& a, const U128& b);
U128 VectorSignedSaturatedNarrowToSigned(size_t original_esize, const U128& a);
U128 VectorSignedSaturatedNarrowToUnsigned(size_t original_esize, const U128& a);
U128 VectorSub(size_t esize, const U128& a, const U128& b);
U128 VectorUnsignedAbsoluteDifference(size_t esize, const U128& a, const U128& b);

View file

@ -341,6 +341,9 @@ bool Inst::ReadsFromFPSRCumulativeSaturationBit() const {
bool Inst::WritesToFPSRCumulativeSaturationBit() const {
switch (op) {
case Opcode::VectorSignedSaturatedNarrowToSigned16:
case Opcode::VectorSignedSaturatedNarrowToSigned32:
case Opcode::VectorSignedSaturatedNarrowToSigned64:
case Opcode::VectorSignedSaturatedNarrowToUnsigned16:
case Opcode::VectorSignedSaturatedNarrowToUnsigned32:
case Opcode::VectorSignedSaturatedNarrowToUnsigned64:

View file

@ -347,6 +347,9 @@ OPCODE(VectorSignExtend64, T::U128, T::U128
OPCODE(VectorSignedAbsoluteDifference8, T::U128, T::U128, T::U128 )
OPCODE(VectorSignedAbsoluteDifference16, T::U128, T::U128, T::U128 )
OPCODE(VectorSignedAbsoluteDifference32, T::U128, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToSigned16, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToSigned32, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToSigned64, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToUnsigned16, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToUnsigned32, T::U128, T::U128 )
OPCODE(VectorSignedSaturatedNarrowToUnsigned64, T::U128, T::U128 )