A64: Add opcodes for signed saturating negations

This commit is contained in:
Lioncash 2018-09-06 15:50:25 -04:00 committed by MerryMage
parent f1ebbcd7bc
commit fca7eddb9e
5 changed files with 145 additions and 0 deletions

View file

@ -1566,6 +1566,21 @@ U128 IREmitter::VectorSignedSaturatedNarrowToUnsigned(size_t original_esize, con
return {};
}
U128 IREmitter::VectorSignedSaturatedNeg(size_t esize, const U128& a) {
switch (esize) {
case 8:
return Inst<U128>(Opcode::VectorSignedSaturatedNeg8, a);
case 16:
return Inst<U128>(Opcode::VectorSignedSaturatedNeg16, a);
case 32:
return Inst<U128>(Opcode::VectorSignedSaturatedNeg32, a);
case 64:
return Inst<U128>(Opcode::VectorSignedSaturatedNeg64, a);
}
UNREACHABLE();
return {};
}
U128 IREmitter::VectorSub(size_t esize, const U128& a, const U128& b) {
switch (esize) {
case 8:

View file

@ -268,6 +268,7 @@ public:
U128 VectorSignedSaturatedDoublingMultiplyReturnHigh(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 VectorSignedSaturatedNeg(size_t esize, const U128& a);
U128 VectorSub(size_t esize, const U128& a, const U128& b);
Table VectorTable(std::vector<U128> values);
U128 VectorTableLookup(const U128& defaults, const Table& table, const U128& indices);

View file

@ -359,6 +359,10 @@ bool Inst::WritesToFPSRCumulativeSaturationBit() const {
case Opcode::VectorSignedSaturatedNarrowToUnsigned64:
case Opcode::VectorSignedSaturatedDoublingMultiplyReturnHigh16:
case Opcode::VectorSignedSaturatedDoublingMultiplyReturnHigh32:
case Opcode::VectorSignedSaturatedNeg8:
case Opcode::VectorSignedSaturatedNeg16:
case Opcode::VectorSignedSaturatedNeg32:
case Opcode::VectorSignedSaturatedNeg64:
case Opcode::VectorUnsignedSaturatedNarrow16:
case Opcode::VectorUnsignedSaturatedNarrow32:
case Opcode::VectorUnsignedSaturatedNarrow64:

View file

@ -405,6 +405,10 @@ OPCODE(VectorSignedSaturatedNarrowToSigned64, U128, U128
OPCODE(VectorSignedSaturatedNarrowToUnsigned16, U128, U128 )
OPCODE(VectorSignedSaturatedNarrowToUnsigned32, U128, U128 )
OPCODE(VectorSignedSaturatedNarrowToUnsigned64, U128, U128 )
OPCODE(VectorSignedSaturatedNeg8, U128, U128 )
OPCODE(VectorSignedSaturatedNeg16, U128, U128 )
OPCODE(VectorSignedSaturatedNeg32, U128, U128 )
OPCODE(VectorSignedSaturatedNeg64, U128, U128 )
OPCODE(VectorSub8, U128, U128, U128 )
OPCODE(VectorSub16, U128, U128, U128 )
OPCODE(VectorSub32, U128, U128, U128 )