Squashed 'externals/oaknut/' changes from 816481f10..c24f918e5

c24f918e5 oaknut: 1.1.6
3a70cd40a oaknut: Run clang-format
dc54784b8 oaknut: Add support for iOS memory protection.
14207278a oaknut: 1.1.5
841f9b693 oaknut: throw OaknutException instead of plain C string

git-subtree-dir: externals/oaknut
git-subtree-split: c24f918e52e629fc315c6e4bca4ea62def8b55e8
This commit is contained in:
Merry 2023-04-27 22:20:30 +01:00
parent b65b07d566
commit 720d6bbcd8
18 changed files with 436 additions and 328 deletions

View file

@ -55,7 +55,7 @@ std::uint32_t encode(MovImm16 v)
if constexpr (std::popcount(splat) == 17) {
constexpr std::uint32_t mask = (1 << std::popcount(splat)) - 1;
if ((v.m_encoded & mask) != v.m_encoded)
throw "invalid MovImm16";
throw OaknutException{ExceptionType::InvalidMovImm16};
}
return pdep<splat>(v.m_encoded);
}
@ -136,7 +136,7 @@ void addsubext_verify_reg_size(AddSubExt ext, RReg rm)
return;
if (rm.bitsize() == 64 && (static_cast<int>(ext) & 0b011) == 0b011)
return;
throw "invalid AddSubExt choice for rm size";
throw OaknutException{ExceptionType::InvalidAddSubExt};
}
void indexext_verify_reg_size(IndexExt ext, RReg rm)
@ -145,11 +145,11 @@ void indexext_verify_reg_size(IndexExt ext, RReg rm)
return;
if (rm.bitsize() == 64 && (static_cast<int>(ext) & 1) == 1)
return;
throw "invalid IndexExt choice for rm size";
throw OaknutException{ExceptionType::InvalidIndexExt};
}
void tbz_verify_reg_size(RReg rt, Imm<6> imm)
{
if (rt.bitsize() == 32 && imm.value() >= 32)
throw "invalid imm choice for rt size";
throw OaknutException{ExceptionType::BitPositionOutOfRange};
}