From 720d6bbcd87a8aecf628ab26a55ac7b17f7325df Mon Sep 17 00:00:00 2001 From: Merry Date: Thu, 27 Apr 2023 22:20:30 +0100 Subject: [PATCH] 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 --- CMakeLists.txt | 2 +- include/oaknut/code_block.hpp | 13 + .../oaknut/impl/arm64_encode_helpers.inc.hpp | 8 +- include/oaknut/impl/enum.hpp | 10 +- include/oaknut/impl/imm.hpp | 26 +- include/oaknut/impl/list.hpp | 4 +- .../oaknut/impl/mnemonics_fpsimd_v8.0.inc.hpp | 406 +++++++++--------- .../oaknut/impl/mnemonics_fpsimd_v8.1.inc.hpp | 12 +- .../oaknut/impl/mnemonics_fpsimd_v8.2.inc.hpp | 40 +- .../impl/mnemonics_generic_v8.0.inc.hpp | 44 +- .../impl/mnemonics_generic_v8.1.inc.hpp | 64 +-- .../impl/mnemonics_generic_v8.2.inc.hpp | 4 +- include/oaknut/impl/oaknut_exception.inc.hpp | 42 ++ include/oaknut/impl/offset.hpp | 16 +- include/oaknut/impl/reg.hpp | 14 +- include/oaknut/oaknut.hpp | 10 +- include/oaknut/oaknut_exception.hpp | 44 ++ tests/basic.cpp | 5 +- 18 files changed, 436 insertions(+), 328 deletions(-) create mode 100644 include/oaknut/impl/oaknut_exception.inc.hpp create mode 100644 include/oaknut/oaknut_exception.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d764fb6..8c825a2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(oaknut LANGUAGES CXX VERSION 1.1.4) +project(oaknut LANGUAGES CXX VERSION 1.1.6) # Determine if we're built as a subproject (using add_subdirectory) # or if this is the master project. diff --git a/include/oaknut/code_block.hpp b/include/oaknut/code_block.hpp index e700d6ca..1c29ad09 100644 --- a/include/oaknut/code_block.hpp +++ b/include/oaknut/code_block.hpp @@ -12,6 +12,7 @@ # define NOMINMAX # include #elif defined(__APPLE__) +# include # include # include # include @@ -30,7 +31,11 @@ public: #if defined(_WIN32) m_memory = (std::uint32_t*)VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); #elif defined(__APPLE__) +# if TARGET_OS_IPHONE + m_memory = (std::uint32_t*)mmap(nullptr, size, PROT_READ | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0); +# else m_memory = (std::uint32_t*)mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE | MAP_JIT, -1, 0); +# endif #else m_memory = (std::uint32_t*)mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0); #endif @@ -64,14 +69,22 @@ public: void protect() { #if defined(__APPLE__) +# if TARGET_OS_IPHONE + mprotect(m_memory, m_size, PROT_READ | PROT_EXEC); +# else pthread_jit_write_protect_np(1); +# endif #endif } void unprotect() { #if defined(__APPLE__) +# if TARGET_OS_IPHONE + mprotect(m_memory, m_size, PROT_READ | PROT_WRITE); +# else pthread_jit_write_protect_np(0); +# endif #endif } diff --git a/include/oaknut/impl/arm64_encode_helpers.inc.hpp b/include/oaknut/impl/arm64_encode_helpers.inc.hpp index 5886e62e..3081d943 100644 --- a/include/oaknut/impl/arm64_encode_helpers.inc.hpp +++ b/include/oaknut/impl/arm64_encode_helpers.inc.hpp @@ -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(v.m_encoded); } @@ -136,7 +136,7 @@ void addsubext_verify_reg_size(AddSubExt ext, RReg rm) return; if (rm.bitsize() == 64 && (static_cast(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(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}; } diff --git a/include/oaknut/impl/enum.hpp b/include/oaknut/impl/enum.hpp index 154f0999..89dc9356 100644 --- a/include/oaknut/impl/enum.hpp +++ b/include/oaknut/impl/enum.hpp @@ -199,7 +199,7 @@ enum class TlbiOp { VALE1 = 0b000'0111'101, VAALE1 = 0b000'0111'111, IPAS2E1IS = 0b100'0000'001, - RIPAS2E1IS = 0b100'0000'010, // ARMv8.4-TLBI + RIPAS2E1IS = 0b100'0000'010, // ARMv8.4-TLBI IPAS2LE1IS = 0b100'0000'101, RIPAS2LE1IS = 0b100'0000'110, // ARMv8.4-TLBI ALLE2OS = 0b100'0001'000, // ARMv8.4-TLBI @@ -214,11 +214,11 @@ enum class TlbiOp { ALLE1IS = 0b100'0011'100, VALE2IS = 0b100'0011'101, VMALLS12E1IS = 0b100'0011'110, - IPAS2E1OS = 0b100'0100'000, // ARMv8.4-TLBI + IPAS2E1OS = 0b100'0100'000, // ARMv8.4-TLBI IPAS2E1 = 0b100'0100'001, - RIPAS2E1 = 0b100'0100'010, // ARMv8.4-TLBI - RIPAS2E1OS = 0b100'0100'011, // ARMv8.4-TLBI - IPAS2LE1OS = 0b100'0100'100, // ARMv8.4-TLBI + RIPAS2E1 = 0b100'0100'010, // ARMv8.4-TLBI + RIPAS2E1OS = 0b100'0100'011, // ARMv8.4-TLBI + IPAS2LE1OS = 0b100'0100'100, // ARMv8.4-TLBI IPAS2LE1 = 0b100'0100'101, RIPAS2LE1 = 0b100'0100'110, // ARMv8.4-TLBI RIPAS2LE1OS = 0b100'0100'111, // ARMv8.4-TLBI diff --git a/include/oaknut/impl/imm.hpp b/include/oaknut/impl/imm.hpp index 927ebcf9..cc90832c 100644 --- a/include/oaknut/impl/imm.hpp +++ b/include/oaknut/impl/imm.hpp @@ -9,6 +9,8 @@ #include #include +#include "oaknut/oaknut_exception.hpp" + namespace oaknut { template @@ -22,7 +24,7 @@ public: : m_value(value_) { if (!is_valid(value_)) - throw "outsized Imm value"; + throw OaknutException{ExceptionType::ImmOutOfRange}; } constexpr auto operator<=>(const Imm& other) const { return m_value <=> other.m_value; } @@ -52,7 +54,7 @@ public: : m_encoded(value_ | ((shift_ == AddSubImmShift::SHL_12) ? 1 << 12 : 0)) { if ((value_ & 0xFFF) != value_) - throw "invalid AddSubImm"; + throw OaknutException{ExceptionType::InvalidAddSubImm}; } constexpr /* implicit */ AddSubImm(std::uint64_t value_) @@ -62,7 +64,7 @@ public: } else if ((value_ & 0xFFF000) == value_) { m_encoded = (value_ >> 12) | (1 << 12); } else { - throw "invalid AddSubImm"; + throw OaknutException{ExceptionType::InvalidAddSubImm}; } } @@ -99,7 +101,7 @@ public: m_encoded = lsw | (shift << 16); return; } else if (lsw != 0) { - throw "invalid MovImm16"; + throw OaknutException{ExceptionType::InvalidMovImm16}; } value_ >>= 16; shift++; @@ -161,7 +163,7 @@ public: { const auto encoded = detail::encode_bit_imm(value); if (!encoded || (*encoded & 0x1000) != 0) - throw "invalid BitImm32"; + throw OaknutException{ExceptionType::InvalidBitImm32}; m_encoded = *encoded; } @@ -181,7 +183,7 @@ public: { const auto encoded = detail::encode_bit_imm(value); if (!encoded) - throw "invalid BitImm64"; + throw OaknutException{ExceptionType::InvalidBitImm64}; m_encoded = *encoded; } @@ -224,7 +226,7 @@ struct ImmConst { constexpr /* implicit */ ImmConst(int value) { if (value != A) { - throw "invalid ImmConst"; + throw OaknutException{ExceptionType::InvalidImmConst}; } } }; @@ -233,7 +235,7 @@ struct ImmConstFZero { constexpr /* implicit */ ImmConstFZero(double value) { if (value != 0) { - throw "invalid ImmConstFZero"; + throw OaknutException{ExceptionType::InvalidImmConstFZero}; } } }; @@ -250,7 +252,7 @@ struct ImmChoice { } else if (value == B) { m_encoded = 1; } else { - throw "invalid ImmChoice"; + throw OaknutException{ExceptionType::InvalidImmChoice}; } } @@ -273,7 +275,7 @@ struct ImmChoice { } else if (value == D) { m_encoded = 3; } else { - throw "invalid ImmChoice"; + throw OaknutException{ExceptionType::InvalidImmChoice}; } } @@ -289,7 +291,7 @@ struct ImmRange { : m_value(value_) { if (value_ < Start || value_ > End) { - throw "invalid ImmRange"; + throw OaknutException{ExceptionType::InvalidImmRange}; } } @@ -305,7 +307,7 @@ struct LslShift { : m_encoded((((-amount) & (max_value - 1)) << 6) | (max_value - amount - 1)) { if (amount >= max_value) - throw "LslShift out of range"; + throw OaknutException{ExceptionType::LslShiftOutOfRange}; } private: diff --git a/include/oaknut/impl/list.hpp b/include/oaknut/impl/list.hpp index 9ad4bd9b..dcdcdf72 100644 --- a/include/oaknut/impl/list.hpp +++ b/include/oaknut/impl/list.hpp @@ -7,6 +7,8 @@ #include #include +#include "oaknut/oaknut_exception.hpp" + namespace oaknut { struct Elem; @@ -40,7 +42,7 @@ struct List { static_assert(std::is_base_of_v || std::is_base_of_v || detail::is_instance_of_ElemSelector_v); if (!verify(std::index_sequence_for{}, args...)) - throw "invalid List"; + throw OaknutException{ExceptionType::InvalidList}; } constexpr auto operator[](unsigned elem_index) const diff --git a/include/oaknut/impl/mnemonics_fpsimd_v8.0.inc.hpp b/include/oaknut/impl/mnemonics_fpsimd_v8.0.inc.hpp index 2c77ee7b..2ced5994 100644 --- a/include/oaknut/impl/mnemonics_fpsimd_v8.0.inc.hpp +++ b/include/oaknut/impl/mnemonics_fpsimd_v8.0.inc.hpp @@ -2484,49 +2484,49 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011100nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011100nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011101nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011101nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011110nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011110nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011111nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011111nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -2564,49 +2564,49 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm101000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm101000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm101001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm101001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm101010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm101010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm101011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm101011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) @@ -2644,49 +2644,49 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<48>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm011011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm011011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) @@ -2724,49 +2724,49 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<64>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm001000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm001000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm001001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm001001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm001010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm001010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm001011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm001011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1(List tlist, XRegSp addr_n) @@ -2792,7 +2792,7 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<1>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm000Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) @@ -2802,7 +2802,7 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm010Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) @@ -2812,7 +2812,7 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm100S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -2822,7 +2822,7 @@ void LD1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void LD1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm100001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD1R(List tlist, XRegSp addr_n) @@ -2892,49 +2892,49 @@ void LD1R(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm110000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm110000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm110001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm110001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm110010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm110010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm110011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD1R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm110011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n) @@ -2996,43 +2996,43 @@ void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm100000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm100000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm100001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm100001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm100010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm100010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm100011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2(List tlist, XRegSp addr_n) @@ -3058,7 +3058,7 @@ void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm000Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) @@ -3068,7 +3068,7 @@ void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm010Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -3078,7 +3078,7 @@ void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm100S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -3088,7 +3088,7 @@ void LD2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void LD2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm100001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD2R(List tlist, XRegSp addr_n) @@ -3158,49 +3158,49 @@ void LD2R(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm110000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm110000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm110001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm110001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm110010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm110010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm110011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD2R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm110011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n) @@ -3262,43 +3262,43 @@ void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<48>) void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm010000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm010000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm010001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm010001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm010010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm010010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm010011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3(List tlist, XRegSp addr_n) @@ -3324,7 +3324,7 @@ void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<3>) void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm001Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<6>) @@ -3334,7 +3334,7 @@ void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<6>) void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm011Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<12>) @@ -3344,7 +3344,7 @@ void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<12>) void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm101S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) @@ -3354,7 +3354,7 @@ void LD3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) void LD3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101110mmmmm101001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD3R(List tlist, XRegSp addr_n) @@ -3424,49 +3424,49 @@ void LD3R(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm111000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm111000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm111001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm111001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm111010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm111010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101110mmmmm111011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD3R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101110mmmmm111011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n) @@ -3528,43 +3528,43 @@ void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<64>) void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm000000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm000000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm000001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm000001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100110mmmmm000010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm000010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100110mmmmm000011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4(List tlist, XRegSp addr_n) @@ -3590,7 +3590,7 @@ void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm001Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -3600,7 +3600,7 @@ void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm011Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -3610,7 +3610,7 @@ void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm101S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) @@ -3620,7 +3620,7 @@ void LD4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void LD4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101111mmmmm101001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void LD4R(List tlist, XRegSp addr_n) @@ -3690,49 +3690,49 @@ void LD4R(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm111000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm111000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm111001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm111001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm111010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm111010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001101111mmmmm111011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LD4R(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001101111mmmmm111011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void LDNP(SReg rt1, SReg rt2, XRegSp addr_n, SOffset<9, 2> offset = 0) @@ -3903,13 +3903,13 @@ void LDUR(QReg rt, XRegSp addr_n, SOffset<9, 0> offset = 0) void MLA(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm0000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MLA(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm0000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MLA(VReg_2S rd, VReg_2S rn, SElem em) @@ -3947,13 +3947,13 @@ void MLA(VReg_4S rd, VReg_4S rn, VReg_4S rm) void MLS(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm0100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MLS(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm0100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MLS(VReg_2S rd, VReg_2S rn, SElem em) @@ -4095,13 +4095,13 @@ void MOVI(VReg_2D rd, RepImm imm) void MUL(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm1000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MUL(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm1000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void MUL(VReg_2S rd, VReg_2S rn, SElem em) @@ -5027,13 +5027,13 @@ void SMINV(SReg rd, VReg_4S rn) void SMLAL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm0010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMLAL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm0010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMLAL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5071,13 +5071,13 @@ void SMLAL2(VReg_2D rd, VReg_4S rn, VReg_4S rm) void SMLSL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm0110H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMLSL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm0110H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMLSL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5135,13 +5135,13 @@ void SMOV(XReg xd, SElem en) void SMULL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm1010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMULL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm1010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SMULL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5267,7 +5267,7 @@ void SQADD(VReg_2D rd, VReg_2D rn, VReg_2D rm) void SQDMLAL(SReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111101LMmmmm0011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLAL(DReg rd, SReg rn, SElem em) @@ -5277,13 +5277,13 @@ void SQDMLAL(DReg rd, SReg rn, SElem em) void SQDMLAL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm0011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLAL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm0011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLAL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5321,7 +5321,7 @@ void SQDMLAL2(VReg_2D rd, VReg_4S rn, VReg_4S rm) void SQDMLSL(SReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111101LMmmmm0111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLSL(DReg rd, SReg rn, SElem em) @@ -5331,13 +5331,13 @@ void SQDMLSL(DReg rd, SReg rn, SElem em) void SQDMLSL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm0111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLSL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm0111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMLSL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5375,7 +5375,7 @@ void SQDMLSL2(VReg_2D rd, VReg_4S rn, VReg_4S rm) void SQDMULH(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111101LMmmmm1100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULH(SReg rd, SReg rn, SElem em) @@ -5385,13 +5385,13 @@ void SQDMULH(SReg rd, SReg rn, SElem em) void SQDMULH(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm1100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULH(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm1100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULH(VReg_2S rd, VReg_2S rn, SElem em) @@ -5429,7 +5429,7 @@ void SQDMULH(VReg_4S rd, VReg_4S rn, VReg_4S rm) void SQDMULL(SReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111101LMmmmm1011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULL(DReg rd, SReg rn, SElem em) @@ -5439,13 +5439,13 @@ void SQDMULL(DReg rd, SReg rn, SElem em) void SQDMULL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm1011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm1011H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQDMULL(VReg_2D rd, VReg_2S rn, SElem em) @@ -5527,7 +5527,7 @@ void SQNEG(VReg_2D rd, VReg_2D rn) void SQRDMULH(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMULH(SReg rd, SReg rn, SElem em) @@ -5537,13 +5537,13 @@ void SQRDMULH(SReg rd, SReg rn, SElem em) void SQRDMULH(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMULH(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMULH(VReg_2S rd, VReg_2S rn, SElem em) @@ -6497,49 +6497,49 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011100nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011100nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011101nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011101nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011110nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011110nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011111nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011111nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -6577,49 +6577,49 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm101000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm101000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm101001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm101001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm101010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm101010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm101011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm101011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) @@ -6657,49 +6657,49 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<48>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm011011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm011011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) @@ -6737,49 +6737,49 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<64>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm001000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm001000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm001001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm001001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm001010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm001010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm001011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm001011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST1(List tlist, XRegSp addr_n) @@ -6805,7 +6805,7 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<1>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm000Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) @@ -6815,7 +6815,7 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm010Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) @@ -6825,7 +6825,7 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm100S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -6835,7 +6835,7 @@ void ST1(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void ST1(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm100001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST2(List tlist, XRegSp addr_n) @@ -6897,43 +6897,43 @@ void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm100000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm100000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm100001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm100001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm100010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm100010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm100011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST2(List tlist, XRegSp addr_n) @@ -6959,7 +6959,7 @@ void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<2>) void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm000Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) @@ -6969,7 +6969,7 @@ void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm010Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -6979,7 +6979,7 @@ void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm100S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -6989,7 +6989,7 @@ void ST2(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void ST2(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm100001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST3(List tlist, XRegSp addr_n) @@ -7051,43 +7051,43 @@ void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<48>) void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm010000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm010000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm010001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm010001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm010010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm010010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm010011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST3(List tlist, XRegSp addr_n) @@ -7113,7 +7113,7 @@ void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<3>) void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm001Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<6>) @@ -7123,7 +7123,7 @@ void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<6>) void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm011Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<12>) @@ -7133,7 +7133,7 @@ void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<12>) void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm101S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) @@ -7143,7 +7143,7 @@ void ST3(List tlist, XRegSp addr_n, PostIndexed, ImmConst<24>) void ST3(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101100mmmmm101001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST4(List tlist, XRegSp addr_n) @@ -7205,43 +7205,43 @@ void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<64>) void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm000000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm000000nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm000001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm000001nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"00001100100mmmmm000010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm000010nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"01001100100mmmmm000011nnnnnttttt", "t", "n", "m">(tlist, addr_n, xm); } void ST4(List tlist, XRegSp addr_n) @@ -7267,7 +7267,7 @@ void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<4>) void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm001Szznnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) @@ -7277,7 +7277,7 @@ void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<8>) void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm011Sz0nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) @@ -7287,7 +7287,7 @@ void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<16>) void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm101S00nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) @@ -7297,7 +7297,7 @@ void ST4(List tlist, XRegSp addr_n, PostIndexed, ImmConst<32>) void ST4(List tlist, XRegSp addr_n, PostIndexed, XReg xm) { if (xm.index() == 31) - throw "xzr invalid here"; + throw OaknutException{ExceptionType::InvalidOperandXZR}; emit<"0Q001101101mmmmm101001nnnnnttttt", "t", "QSz", "n", "m">(tlist.m_base.reg_index(), tlist.m_base.elem_index(), addr_n, xm); } void STNP(SReg rt1, SReg rt2, XRegSp addr_n, SOffset<9, 2> offset = 0) @@ -8180,13 +8180,13 @@ void UMINV(SReg rd, VReg_4S rn) void UMLAL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm0010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMLAL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm0010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMLAL(VReg_2D rd, VReg_2S rn, SElem em) @@ -8224,13 +8224,13 @@ void UMLAL2(VReg_2D rd, VReg_4S rn, VReg_4S rm) void UMLSL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm0110H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMLSL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm0110H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMLSL(VReg_2D rd, VReg_2S rn, SElem em) @@ -8284,13 +8284,13 @@ void UMOV(XReg xd, DElem en) void UMULL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm1010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMULL2(VReg_4S rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm1010H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void UMULL(VReg_2D rd, VReg_2S rn, SElem em) diff --git a/include/oaknut/impl/mnemonics_fpsimd_v8.1.inc.hpp b/include/oaknut/impl/mnemonics_fpsimd_v8.1.inc.hpp index 71f45692..769c6adb 100644 --- a/include/oaknut/impl/mnemonics_fpsimd_v8.1.inc.hpp +++ b/include/oaknut/impl/mnemonics_fpsimd_v8.1.inc.hpp @@ -4,7 +4,7 @@ void SQRDMLAH(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0111111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLAH(SReg rd, SReg rn, SElem em) @@ -14,13 +14,13 @@ void SQRDMLAH(SReg rd, SReg rn, SElem em) void SQRDMLAH(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLAH(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm1101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLAH(VReg_2S rd, VReg_2S rn, SElem em) @@ -58,7 +58,7 @@ void SQRDMLAH(VReg_4S rd, VReg_4S rn, VReg_4S rm) void SQRDMLSH(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0111111101LMmmmm1111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLSH(SReg rd, SReg rn, SElem em) @@ -68,13 +68,13 @@ void SQRDMLSH(SReg rd, SReg rn, SElem em) void SQRDMLSH(VReg_4H rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111101LMmmmm1111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLSH(VReg_8H rd, VReg_8H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111101LMmmmm1111H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void SQRDMLSH(VReg_2S rd, VReg_2S rn, SElem em) diff --git a/include/oaknut/impl/mnemonics_fpsimd_v8.2.inc.hpp b/include/oaknut/impl/mnemonics_fpsimd_v8.2.inc.hpp index 61f6ecd7..f1a64495 100644 --- a/include/oaknut/impl/mnemonics_fpsimd_v8.2.inc.hpp +++ b/include/oaknut/impl/mnemonics_fpsimd_v8.2.inc.hpp @@ -412,19 +412,19 @@ void FMINV(HReg rd, VReg_8H rn) void FMLA(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111100LMmmmm0001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLA(VReg_8B rd, VReg_8B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111100LMmmmm0001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLA(VReg_16B rd, VReg_16B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111100LMmmmm0001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLA(VReg_4H rd, VReg_4H rn, VReg_4H rm) @@ -438,25 +438,25 @@ void FMLA(VReg_8H rd, VReg_8H rn, VReg_8H rm) void FMLAL(VReg_2S rd, VReg_2H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111110LMmmmm0000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLAL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111110LMmmmm0000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLAL2(VReg_2S rd, VReg_2H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111110LMmmmm1000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLAL2(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111110LMmmmm1000H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLAL(VReg_2S rd, VReg_2H rn, VReg_2H rm) @@ -478,19 +478,19 @@ void FMLAL2(VReg_4S rd, VReg_4H rn, VReg_4H rm) void FMLS(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111100LMmmmm0101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLS(VReg_8B rd, VReg_8B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111100LMmmmm0101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLS(VReg_16B rd, VReg_16B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111100LMmmmm0101H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLS(VReg_4H rd, VReg_4H rn, VReg_4H rm) @@ -504,25 +504,25 @@ void FMLS(VReg_8H rd, VReg_8H rn, VReg_8H rm) void FMLSL(VReg_2S rd, VReg_2H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111110LMmmmm0100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLSL(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111110LMmmmm0100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLSL2(VReg_2S rd, VReg_2H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111110LMmmmm1100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLSL2(VReg_4S rd, VReg_4H rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111110LMmmmm1100H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMLSL(VReg_2S rd, VReg_2H rn, VReg_2H rm) @@ -552,19 +552,19 @@ void FMOV(VReg_8H rd, FImm8 imm) void FMUL(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0101111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMUL(VReg_8B rd, VReg_8B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0000111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMUL(VReg_16B rd, VReg_16B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0100111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMUL(VReg_4H rd, VReg_4H rn, VReg_4H rm) @@ -590,19 +590,19 @@ void FMULX(VReg_8H rd, VReg_8H rn, VReg_8H rm) void FMULX(HReg rd, HReg rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0111111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMULX(VReg_8B rd, VReg_8B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0010111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FMULX(VReg_16B rd, VReg_16B rn, HElem em) { if (em.reg_index() >= 16) - throw "InvalidCombination"; + throw OaknutException{ExceptionType::InvalidCombination}; emit<"0110111100LMmmmm1001H0nnnnnddddd", "d", "n", "m", "H", "L", "M">(rd, rn, em.reg_index(), em.elem_index() >> 2, (em.elem_index() >> 1) & 1, em.elem_index() & 1); } void FNEG(VReg_4H rd, VReg_4H rn) diff --git a/include/oaknut/impl/mnemonics_generic_v8.0.inc.hpp b/include/oaknut/impl/mnemonics_generic_v8.0.inc.hpp index 160dd8f9..4f5ca8f0 100644 --- a/include/oaknut/impl/mnemonics_generic_v8.0.inc.hpp +++ b/include/oaknut/impl/mnemonics_generic_v8.0.inc.hpp @@ -166,13 +166,13 @@ void B(Cond cond, AddrOffset<21, 2> label) void BFI(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0011001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, (-lsb.value()) & 31, width.value() - 1); } void BFI(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1011001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, (-lsb.value()) & 63, width.value() - 1); } void BFM(WReg wd, WReg wn, Imm<5> immr, Imm<5> imms) @@ -186,13 +186,13 @@ void BFM(XReg xd, XReg xn, Imm<6> immr, Imm<6> imms) void BFXIL(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0011001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, lsb.value(), lsb.value() + width.value() - 1); } void BFXIL(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1011001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, lsb.value(), lsb.value() + width.value() - 1); } void BIC(WReg wd, WReg wn, WReg wm, LogShift shift = LogShift::LSL, Imm<5> shift_amount = 0) @@ -278,25 +278,25 @@ void CCMP(XReg xn, XReg xm, Imm<4> nzcv, Cond cond) void CINC(WReg wd, WReg wn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"00011010100mmmmmcccc01nnnnnddddd", "d", "n", "m", "c">(wd, wn, wn, invert(cond)); } void CINC(XReg xd, XReg xn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"10011010100mmmmmcccc01nnnnnddddd", "d", "n", "m", "c">(xd, xn, xn, invert(cond)); } void CINV(WReg wd, WReg wn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"01011010100mmmmmcccc00nnnnnddddd", "d", "n", "m", "c">(wd, wn, wn, invert(cond)); } void CINV(XReg xd, XReg xn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"11011010100mmmmmcccc00nnnnnddddd", "d", "n", "m", "c">(xd, xn, xn, invert(cond)); } void CLREX(Imm<4> imm = 15) @@ -392,13 +392,13 @@ void CMP(XReg xn, XReg xm, AddSubShift shift = AddSubShift::LSL, Imm<6> shift_am void CNEG(WReg wd, WReg wn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"01011010100mmmmmcccc01nnnnnddddd", "d", "n", "m", "c">(wd, wn, wn, invert(cond)); } void CNEG(XReg xd, XReg xn, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"11011010100mmmmmcccc01nnnnnddddd", "d", "n", "m", "c">(xd, xn, xn, invert(cond)); } void CRC32B(WReg wd, WReg wn, WReg wm) @@ -448,25 +448,25 @@ void CSEL(XReg xd, XReg xn, XReg xm, Cond cond) void CSET(WReg wd, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"0001101010011111cccc0111111ddddd", "d", "c">(wd, invert(cond)); } void CSET(XReg xd, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"1001101010011111cccc0111111ddddd", "d", "c">(xd, invert(cond)); } void CSETM(WReg wd, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"0101101010011111cccc0011111ddddd", "d", "c">(wd, invert(cond)); } void CSETM(XReg xd, Cond cond) { if (cond == Cond::AL || cond == Cond::NV) - throw "invalid Cond"; + throw OaknutException{ExceptionType::InvalidCond}; emit<"1101101010011111cccc0011111ddddd", "d", "c">(xd, invert(cond)); } void CSINC(WReg wd, WReg wn, WReg wm, Cond cond) @@ -1230,13 +1230,13 @@ void SBCS(XReg xd, XReg xn, XReg xm) void SBFIZ(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0001001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, (-lsb.value()) & 31, width.value() - 1); } void SBFIZ(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1001001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, (-lsb.value()) & 63, width.value() - 1); } void SBFM(WReg wd, WReg wn, Imm<5> immr, Imm<5> imms) @@ -1250,13 +1250,13 @@ void SBFM(XReg xd, XReg xn, Imm<6> immr, Imm<6> imms) void SBFX(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0001001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, lsb.value(), lsb.value() + width.value() - 1); } void SBFX(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1001001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, lsb.value(), lsb.value() + width.value() - 1); } void SDIV(WReg wd, WReg wn, WReg wm) @@ -1626,13 +1626,13 @@ void TST(XReg xn, XReg xm, LogShift shift = LogShift::LSL, Imm<6> shift_amount = void UBFIZ(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0101001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, (-lsb.value()) & 31, width.value() - 1); } void UBFIZ(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1101001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, (-lsb.value()) & 63, width.value() - 1); } void UBFM(WReg wd, WReg wn, Imm<5> immr, Imm<5> imms) @@ -1646,13 +1646,13 @@ void UBFM(XReg xd, XReg xn, Imm<6> immr, Imm<6> imms) void UBFX(WReg wd, WReg wn, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0101001100rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(wd, wn, lsb.value(), lsb.value() + width.value() - 1); } void UBFX(XReg xd, XReg xn, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1101001101rrrrrrssssssnnnnnddddd", "d", "n", "r", "s">(xd, xn, lsb.value(), lsb.value() + width.value() - 1); } void UDF(Imm<16> imm) diff --git a/include/oaknut/impl/mnemonics_generic_v8.1.inc.hpp b/include/oaknut/impl/mnemonics_generic_v8.1.inc.hpp index 66ddd7c5..07934977 100644 --- a/include/oaknut/impl/mnemonics_generic_v8.1.inc.hpp +++ b/include/oaknut/impl/mnemonics_generic_v8.1.inc.hpp @@ -68,97 +68,97 @@ void CASLH(WReg ws, WReg wt, XRegSp xn) void CASP(WReg ws, WReg ws2, WReg wt, WReg wt2, XRegSp xn) { if (wt.index() + 1 != wt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (wt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (ws.index() + 1 != ws2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (ws.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"00001000001sssss011111nnnnnttttt", "s", "t", "n">(ws, wt, xn); } void CASPA(WReg ws, WReg ws2, WReg wt, WReg wt2, XRegSp xn) { if (wt.index() + 1 != wt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (wt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (ws.index() + 1 != ws2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (ws.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"00001000011sssss011111nnnnnttttt", "s", "t", "n">(ws, wt, xn); } void CASPAL(WReg ws, WReg ws2, WReg wt, WReg wt2, XRegSp xn) { if (wt.index() + 1 != wt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (wt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (ws.index() + 1 != ws2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (ws.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"00001000011sssss111111nnnnnttttt", "s", "t", "n">(ws, wt, xn); } void CASPL(WReg ws, WReg ws2, WReg wt, WReg wt2, XRegSp xn) { if (wt.index() + 1 != wt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (wt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (ws.index() + 1 != ws2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (ws.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"00001000001sssss111111nnnnnttttt", "s", "t", "n">(ws, wt, xn); } void CASP(XReg xs, XReg xs2, XReg xt, XReg xt2, XRegSp xn) { if (xt.index() + 1 != xt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (xs.index() + 1 != xs2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xs.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"01001000001sssss011111nnnnnttttt", "s", "t", "n">(xs, xt, xn); } void CASPA(XReg xs, XReg xs2, XReg xt, XReg xt2, XRegSp xn) { if (xt.index() + 1 != xt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (xs.index() + 1 != xs2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xs.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"01001000011sssss011111nnnnnttttt", "s", "t", "n">(xs, xt, xn); } void CASPAL(XReg xs, XReg xs2, XReg xt, XReg xt2, XRegSp xn) { if (xt.index() + 1 != xt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (xs.index() + 1 != xs2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xs.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"01001000011sssss111111nnnnnttttt", "s", "t", "n">(xs, xt, xn); } void CASPL(XReg xs, XReg xs2, XReg xt, XReg xt2, XRegSp xn) { if (xt.index() + 1 != xt2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xt.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; if (xs.index() + 1 != xs2.index()) - throw "Invalid second register in pair"; + throw OaknutException{ExceptionType::InvalidPairSecond}; if (xs.index() & 1) - throw "Requires even register"; + throw OaknutException{ExceptionType::InvalidPairFirst}; emit<"01001000001sssss111111nnnnnttttt", "s", "t", "n">(xs, xt, xn); } void LDADD(WReg ws, WReg wt, XRegSp xn) diff --git a/include/oaknut/impl/mnemonics_generic_v8.2.inc.hpp b/include/oaknut/impl/mnemonics_generic_v8.2.inc.hpp index a9222bbd..a5bc5b82 100644 --- a/include/oaknut/impl/mnemonics_generic_v8.2.inc.hpp +++ b/include/oaknut/impl/mnemonics_generic_v8.2.inc.hpp @@ -4,13 +4,13 @@ void BFC(WReg wd, Imm<5> lsb, Imm<5> width) { if (width.value() == 0 || width.value() > (32 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"0011001100rrrrrrssssss11111ddddd", "d", "r", "s">(wd, (-lsb.value()) & 31, width.value() - 1); } void BFC(XReg xd, Imm<6> lsb, Imm<6> width) { if (width.value() == 0 || width.value() > (64 - lsb.value())) - throw "invalid width"; + throw OaknutException{ExceptionType::InvalidBitWidth}; emit<"1011001101rrrrrrssssss11111ddddd", "d", "r", "s">(xd, (-lsb.value()) & 63, width.value() - 1); } void ESB() diff --git a/include/oaknut/impl/oaknut_exception.inc.hpp b/include/oaknut/impl/oaknut_exception.inc.hpp new file mode 100644 index 00000000..07402362 --- /dev/null +++ b/include/oaknut/impl/oaknut_exception.inc.hpp @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 merryhime +// SPDX-License-Identifier: MIT + +// reg.hpp +OAKNUT_EXCEPTION(InvalidWSPConversion, "toW: cannot convert WSP to WReg") +OAKNUT_EXCEPTION(InvalidXSPConversion, "toX: cannot convert XSP to XReg") +OAKNUT_EXCEPTION(InvalidWZRConversion, "unexpected WZR passed into an WRegWsp") +OAKNUT_EXCEPTION(InvalidXZRConversion, "unexpected XZR passed into an XRegSp") +OAKNUT_EXCEPTION(InvalidDElem_1, "invalid DElem_1") +OAKNUT_EXCEPTION(InvalidElementIndex, "elem_index is out of range") + +// imm.hpp / offset.hpp / list.hpp +OAKNUT_EXCEPTION(InvalidAddSubImm, "invalid AddSubImm") +OAKNUT_EXCEPTION(InvalidBitImm32, "invalid BitImm32") +OAKNUT_EXCEPTION(InvalidBitImm64, "invalid BitImm64") +OAKNUT_EXCEPTION(InvalidImmChoice, "invalid ImmChoice") +OAKNUT_EXCEPTION(InvalidImmConst, "invalid ImmConst") +OAKNUT_EXCEPTION(InvalidImmConstFZero, "invalid ImmConstFZero") +OAKNUT_EXCEPTION(InvalidImmRange, "invalid ImmRange") +OAKNUT_EXCEPTION(InvalidList, "invalid List") +OAKNUT_EXCEPTION(InvalidMovImm16, "invalid MovImm16") +OAKNUT_EXCEPTION(InvalidBitWidth, "invalid width") +OAKNUT_EXCEPTION(LslShiftOutOfRange, "LslShift out of range") +OAKNUT_EXCEPTION(OffsetMisaligned, "misalignment") +OAKNUT_EXCEPTION(OffsetOutOfRange, "out of range") +OAKNUT_EXCEPTION(ImmOutOfRange, "outsized Imm value") + +// arm64_encode_helpers.inc.hpp +OAKNUT_EXCEPTION(InvalidAddSubExt, "invalid AddSubExt choice for rm size") +OAKNUT_EXCEPTION(InvalidIndexExt, "invalid IndexExt choice for rm size") +OAKNUT_EXCEPTION(BitPositionOutOfRange, "bit position exceeds size of rt") + +// mnemonics_*.inc.hpp +OAKNUT_EXCEPTION(InvalidCombination, "InvalidCombination") +OAKNUT_EXCEPTION(InvalidCond, "Cond cannot be AL or NV here") +OAKNUT_EXCEPTION(InvalidPairFirst, "Requires even register") +OAKNUT_EXCEPTION(InvalidPairSecond, "Invalid second register in pair") +OAKNUT_EXCEPTION(InvalidOperandXZR, "xzr invalid here") + +// oaknut.hpp +OAKNUT_EXCEPTION(InvalidAlignment, "invalid alignment") +OAKNUT_EXCEPTION(LabelRedefinition, "label already resolved") diff --git a/include/oaknut/impl/offset.hpp b/include/oaknut/impl/offset.hpp index db65fe37..47859c78 100644 --- a/include/oaknut/impl/offset.hpp +++ b/include/oaknut/impl/offset.hpp @@ -7,6 +7,8 @@ #include #include +#include "oaknut/oaknut_exception.hpp" + namespace oaknut { struct Label; @@ -51,9 +53,9 @@ struct AddrOffset { { const std::uint64_t diff_u64 = static_cast(diff); if (detail::sign_extend(diff_u64) != diff_u64) - throw "out of range"; + throw OaknutException{ExceptionType::OffsetOutOfRange}; if (diff_u64 != (diff_u64 & detail::inverse_mask_from_size(alignment))) - throw "misalignment"; + throw OaknutException{ExceptionType::OffsetMisaligned}; return static_cast((diff_u64 & detail::mask_from_size(bitsize)) >> alignment); } @@ -78,7 +80,7 @@ struct PageOffset { { std::uint64_t diff = (static_cast(target) >> shift_amount) - (static_cast(current_addr) >> shift_amount); if (detail::sign_extend(diff) != diff) - throw "out of range"; + throw OaknutException{ExceptionType::OffsetOutOfRange}; diff &= detail::mask_from_size(bitsize); return static_cast(((diff & 3) << (bitsize - 2)) | (diff >> 2)); } @@ -95,9 +97,9 @@ struct SOffset { { const std::uint64_t diff_u64 = static_cast(offset); if (detail::sign_extend(diff_u64) != diff_u64) - throw "out of range"; + throw OaknutException{ExceptionType::OffsetOutOfRange}; if (diff_u64 != (diff_u64 & detail::inverse_mask_from_size(alignment))) - throw "misalignment"; + throw OaknutException{ExceptionType::OffsetMisaligned}; m_encoded = static_cast((diff_u64 & detail::mask_from_size(bitsize)) >> alignment); } @@ -114,9 +116,9 @@ struct POffset { { const std::uint64_t diff_u64 = static_cast(offset); if (diff_u64 > detail::mask_from_size(bitsize)) - throw "out of range"; + throw OaknutException{ExceptionType::OffsetOutOfRange}; if (diff_u64 != (diff_u64 & detail::inverse_mask_from_size(alignment))) - throw "misalignment"; + throw OaknutException{ExceptionType::OffsetMisaligned}; m_encoded = static_cast((diff_u64 & detail::mask_from_size(bitsize)) >> alignment); } diff --git a/include/oaknut/impl/reg.hpp b/include/oaknut/impl/reg.hpp index 787bc25b..eab02d84 100644 --- a/include/oaknut/impl/reg.hpp +++ b/include/oaknut/impl/reg.hpp @@ -7,6 +7,8 @@ #include #include +#include "oaknut/oaknut_exception.hpp" + namespace oaknut { struct Reg; @@ -117,14 +119,14 @@ struct WReg : public RReg { inline XReg RReg::toX() const { if (index() == -1) - throw "cannot convert SP/WSP to XReg"; + throw OaknutException{ExceptionType::InvalidXSPConversion}; return XReg{index()}; } inline WReg RReg::toW() const { if (index() == -1) - throw "cannot convert SP/WSP to WReg"; + throw OaknutException{ExceptionType::InvalidWSPConversion}; return WReg{index()}; } @@ -146,7 +148,7 @@ struct XRegSp : public RReg { : RReg(64, xr.index()) { if (xr.index() == 31) - throw "unexpected ZR passed into an XRegSp"; + throw OaknutException{ExceptionType::InvalidXZRConversion}; } template @@ -161,7 +163,7 @@ struct WRegWsp : public RReg { : RReg(32, wr.index()) { if (wr.index() == 31) - throw "unexpected WZR passed into an WRegWsp"; + throw OaknutException{ExceptionType::InvalidWZRConversion}; } template @@ -296,7 +298,7 @@ struct Elem { : m_esize(esize_), m_reg(reg_), m_elem_index(elem_index_) { if (elem_index_ >= 128 / esize_) - throw "invalid elem_index"; + throw OaknutException{ExceptionType::InvalidElementIndex}; } constexpr unsigned esize() const { return m_esize; } @@ -338,7 +340,7 @@ struct DElem_1 : public DElem { : DElem(inner) { if (inner.elem_index() != 1) - throw "invalid DElem_1"; + throw OaknutException{ExceptionType::InvalidDElem_1}; } }; diff --git a/include/oaknut/oaknut.hpp b/include/oaknut/oaknut.hpp index e512afc1..b67f7fdd 100644 --- a/include/oaknut/oaknut.hpp +++ b/include/oaknut/oaknut.hpp @@ -19,6 +19,7 @@ #include "oaknut/impl/offset.hpp" #include "oaknut/impl/reg.hpp" #include "oaknut/impl/string_literal.hpp" +#include "oaknut/oaknut_exception.hpp" namespace oaknut { @@ -87,7 +88,7 @@ public: void l(Label& label) { if (label.m_addr) - throw "label already resolved"; + throw OaknutException{ExceptionType::LabelRedefinition}; const auto target_addr = Policy::current_address(); label.m_addr = target_addr; @@ -169,8 +170,9 @@ public: } } - // Convenience function for moving pointers to registers - void MOVP2R(XReg xd, const void* addr) { + // Convenience function for moving pointers to registers + void MOVP2R(XReg xd, const void* addr) + { int64_t diff = reinterpret_cast(addr) - Policy::current_address(); if (diff >= -0xF'FFFF && diff <= 0xF'FFFF) { ADR(xd, addr); @@ -184,7 +186,7 @@ public: void align(std::size_t alignment) { if (alignment < 4 || (alignment & (alignment - 1)) != 0) - throw "invalid alignment"; + throw OaknutException{ExceptionType::InvalidAlignment}; while (Policy::template ptr() & (alignment - 1)) { NOP(); diff --git a/include/oaknut/oaknut_exception.hpp b/include/oaknut/oaknut_exception.hpp new file mode 100644 index 00000000..b4d7dcde --- /dev/null +++ b/include/oaknut/oaknut_exception.hpp @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 merryhime +// SPDX-License-Identifier: MIT + +#pragma once + +#include + +namespace oaknut { + +enum class ExceptionType { +#define OAKNUT_EXCEPTION(tag, str) tag, +#include "oaknut/impl/oaknut_exception.inc.hpp" +#undef OAKNUT_EXCEPTION +}; + +inline const char* to_string(ExceptionType et) +{ + switch (et) { +#define OAKNUT_EXCEPTION(tag, str) \ + case ExceptionType::tag: \ + return str; +#include "oaknut/impl/oaknut_exception.inc.hpp" +#undef OAKNUT_EXCEPTION + default: + return "unknown ExceptionType"; + } +} + +class OaknutException : public std::exception { +public: + explicit OaknutException(ExceptionType et) + : type{et} + {} + + const char* what() const noexcept override + { + return to_string(type); + } + +private: + ExceptionType type; +}; + +} // namespace oaknut diff --git a/tests/basic.cpp b/tests/basic.cpp index e1d3c5e1..7b401f60 100644 --- a/tests/basic.cpp +++ b/tests/basic.cpp @@ -187,9 +187,8 @@ TEST_CASE("MOVP2R") { CodeBlock mem{4096}; - for (int i = 0; i < 0x200'0000; i++) - { - const std::int64_t diff = RandInt(std::numeric_limits::min(), + for (int i = 0; i < 0x200'0000; i++) { + const std::int64_t diff = RandInt(std::numeric_limits::min(), std::numeric_limits::max()); const std::intptr_t value = reinterpret_cast(mem.ptr()) + diff;