IR: Implement VectorZeroExtend

This commit is contained in:
MerryMage 2018-02-10 10:28:38 +00:00
parent d3a4e1efe2
commit 59ace60b03
4 changed files with 61 additions and 0 deletions

View file

@ -919,6 +919,21 @@ U128 IREmitter::VectorPairedAdd(size_t esize, const U128& a, const U128& b) {
return {};
}
U128 IREmitter::VectorZeroExtend(size_t original_esize, const U128& a) {
switch (original_esize) {
case 8:
return Inst<U128>(Opcode::VectorZeroExtend8, a);
case 16:
return Inst<U128>(Opcode::VectorZeroExtend16, a);
case 32:
return Inst<U128>(Opcode::VectorZeroExtend32, a);
case 64:
return Inst<U128>(Opcode::VectorZeroExtend64, a);
}
UNREACHABLE();
return {};
}
U128 IREmitter::VectorZeroUpper(const U128& a) {
return Inst<U128>(Opcode::VectorZeroUpper, a);
}

View file

@ -219,6 +219,7 @@ public:
U128 VectorOr(const U128& a, const U128& b);
U128 VectorPairedAdd(size_t esize, const U128& a, const U128& b);
U128 VectorPairedAddLower(size_t esize, const U128& a, const U128& b);
U128 VectorZeroExtend(size_t original_esize, const U128& a);
U128 VectorZeroUpper(const U128& a);
U32U64 FPAbs(const U32U64& a);

View file

@ -233,6 +233,10 @@ OPCODE(VectorPairedAdd8, T::U128, T::U128, T::U128
OPCODE(VectorPairedAdd16, T::U128, T::U128, T::U128 )
OPCODE(VectorPairedAdd32, T::U128, T::U128, T::U128 )
OPCODE(VectorPairedAdd64, T::U128, T::U128, T::U128 )
OPCODE(VectorZeroExtend8, T::U128, T::U128 )
OPCODE(VectorZeroExtend16, T::U128, T::U128 )
OPCODE(VectorZeroExtend32, T::U128, T::U128 )
OPCODE(VectorZeroExtend64, T::U128, T::U128 )
OPCODE(VectorZeroUpper, T::U128, T::U128 )
// Floating-point operations