opcodes: Add 64-bit CountLeadingZeroes opcode

This commit is contained in:
Lioncash
2018-01-22 10:51:40 -05:00
committed by MerryMage
parent 4c4efb2213
commit b612782445
4 changed files with 43 additions and 3 deletions

View File

@@ -427,7 +427,19 @@ U64 IREmitter::ByteReverseDual(const U64& a) {
}
U32 IREmitter::CountLeadingZeros(const U32& a) {
return Inst<U32>(Opcode::CountLeadingZeros, a);
return Inst<U32>(Opcode::CountLeadingZeros32, a);
}
U64 IREmitter::CountLeadingZeros(const U64& a) {
return Inst<U64>(Opcode::CountLeadingZeros64, a);
}
U32U64 IREmitter::CountLeadingZeros(const U32U64& a) {
if (a.GetType() == IR::Type::U32) {
return Inst<U32>(Opcode::CountLeadingZeros32, a);
}
return Inst<U64>(Opcode::CountLeadingZeros64, a);
}
ResultAndOverflow<U32> IREmitter::SignedSaturatedAdd(const U32& a, const U32& b) {