New upstream version 0.0~git20221210.5b5b0b3
Andrius Merkys
1 year, 4 months ago
99 | 99 | - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } |
100 | 100 | - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } |
101 | 101 | |
102 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "gcc-10" , arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } | |
103 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "gcc-10" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } | |
104 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "clang" , arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } | |
105 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "clang" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } | |
102 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "gcc-10" , arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } | |
103 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "gcc-10" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } | |
104 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "clang" , arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } | |
105 | - { title: "macos-11.0" , os: "macos-11.0" , cc: "clang" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } | |
106 | 106 | |
107 | 107 | - { title: "windows" , os: "windows-2019" , cc: "vs2019" , arch: "x86", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } |
108 | 108 | - { title: "windows" , os: "windows-2019" , cc: "vs2019" , arch: "x86", build_type: "Release", defs: "ASMJIT_TEST=ON" } |
119 | 119 | |
120 | 120 | steps: |
121 | 121 | - name: "Checkout" |
122 | uses: actions/checkout@v2 | |
122 | uses: actions/checkout@v3 | |
123 | 123 | with: |
124 | 124 | path: "source" |
125 | 125 | |
126 | - name: "Checkout build-actions" | |
127 | run: git clone https://github.com/build-actions/build-actions.git build-actions --depth=1 | |
126 | - name: "Checkout Build Actions" | |
127 | uses: actions/checkout@v3 | |
128 | with: | |
129 | repository: build-actions/build-actions | |
130 | path: "build-actions" | |
128 | 131 | |
129 | 132 | - name: "Python" |
130 | uses: actions/setup-python@v2 | |
133 | uses: actions/setup-python@v4 | |
131 | 134 | with: |
132 | 135 | python-version: "3.x" |
133 | 136 |
299 | 299 | INST(Ldurh , BaseRM_SImm9 , (0b0111100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 9 , 2153), // #230 |
300 | 300 | INST(Ldursb , BaseRM_SImm9 , (0b0011100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 10 , 2159), // #231 |
301 | 301 | INST(Ldursh , BaseRM_SImm9 , (0b0111100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 11 , 2166), // #232 |
302 | INST(Ldursw , BaseRM_SImm9 , (0b1011100010000000000000, 0b0000000000000000000000, kWX, kZR, 0 , 0) , kRWI_W , 0 , 12 , 2173), // #233 | |
302 | INST(Ldursw , BaseRM_SImm9 , (0b1011100010000000000000, 0b0000000000000000000000, kX, kZR, 0 , 0) , kRWI_W , 0 , 12 , 2173), // #233 | |
303 | 303 | INST(Ldxp , BaseLdxp , (0b1000100001111111000000, kWX, 30) , kRWI_WW , 0 , 1 , 2180), // #234 |
304 | 304 | INST(Ldxr , BaseRM_NoImm , (0b1000100001011111011111, kWX, kZR, 30) , kRWI_W , 0 , 10 , 2185), // #235 |
305 | 305 | INST(Ldxrb , BaseRM_NoImm , (0b0000100001011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 11 , 2190), // #236 |
1274 | 1274 | { 0b0111100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0 }, // ldurh |
1275 | 1275 | { 0b0011100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0 }, // ldursb |
1276 | 1276 | { 0b0111100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0 }, // ldursh |
1277 | { 0b1011100010000000000000, 0b0000000000000000000000, kWX, kZR, 0 , 0 }, // ldursw | |
1277 | { 0b1011100010000000000000, 0b0000000000000000000000, kX, kZR, 0 , 0 }, // ldursw | |
1278 | 1278 | { 0b1101100110100000000010, 0b1101100110100000000001, kX, kSP, 0, 4 }, // st2g |
1279 | 1279 | { 0b1101100100100000000010, 0b1101100100100000000001, kX, kSP, 0, 4 }, // stg |
1280 | 1280 | { 0b1011100000000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0 }, // sttr |
485 | 485 | //! Clones the memory operand and makes it post-index. |
486 | 486 | inline Mem post() const noexcept { |
487 | 487 | Mem result(*this); |
488 | result.setPredicate(kOffsetPreIndex); | |
488 | result.setPredicate(kOffsetPostIndex); | |
489 | 489 | return result; |
490 | 490 | } |
491 | 491 |
1081 | 1081 | struct RegTraits<REG_TYPE> { \ |
1082 | 1082 | typedef REG RegT; \ |
1083 | 1083 | \ |
1084 | enum : uint32_t { \ | |
1085 | kValid = uint32_t(true), \ | |
1086 | kCount = uint32_t(COUNT), \ | |
1087 | kType = uint32_t(REG_TYPE), \ | |
1088 | kGroup = uint32_t(GROUP), \ | |
1089 | kSize = uint32_t(SIZE), \ | |
1090 | kTypeId = uint32_t(TYPE_ID), \ | |
1084 | static constexpr uint32_t kValid = 1; \ | |
1085 | static constexpr uint32_t kCount = COUNT; \ | |
1086 | static constexpr RegType kType = REG_TYPE; \ | |
1087 | static constexpr RegGroup kGroup = GROUP; \ | |
1088 | static constexpr uint32_t kSize = SIZE; \ | |
1089 | static constexpr TypeId kTypeId = TYPE_ID; \ | |
1091 | 1090 | \ |
1092 | kSignature = (OperandSignature::fromOpType(OperandType::kReg) | \ | |
1093 | OperandSignature::fromRegType(REG_TYPE) | \ | |
1094 | OperandSignature::fromRegGroup(GROUP) | \ | |
1095 | OperandSignature::fromSize(kSize)).bits(), \ | |
1096 | }; \ | |
1091 | static constexpr uint32_t kSignature = \ | |
1092 | (OperandSignature::fromOpType(OperandType::kReg) | \ | |
1093 | OperandSignature::fromRegType(kType) | \ | |
1094 | OperandSignature::fromRegGroup(kGroup) | \ | |
1095 | OperandSignature::fromSize(kSize)).bits(); \ | |
1096 | \ | |
1097 | 1097 | } |
1098 | 1098 | |
1099 | 1099 | //! Adds constructors and member functions to a class that implements abstract register. Abstract register is register |
1134 | 1134 | //! signature. |
1135 | 1135 | #define ASMJIT_DEFINE_FINAL_REG(REG, BASE, TRAITS) \ |
1136 | 1136 | public: \ |
1137 | enum : uint32_t { \ | |
1138 | kThisType = TRAITS::kType, \ | |
1139 | kThisGroup = TRAITS::kGroup, \ | |
1140 | kThisSize = TRAITS::kSize, \ | |
1141 | kSignature = TRAITS::kSignature \ | |
1142 | }; \ | |
1137 | static constexpr RegType kThisType = TRAITS::kType; \ | |
1138 | static constexpr RegGroup kThisGroup = TRAITS::kGroup; \ | |
1139 | static constexpr uint32_t kThisSize = TRAITS::kSize; \ | |
1140 | static constexpr uint32_t kSignature = TRAITS::kSignature; \ | |
1143 | 1141 | \ |
1144 | 1142 | ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \ |
1145 | 1143 | \ |
492 | 492 | static ASMJIT_FORCE_INLINE bool x86ShouldUseMovabs(Assembler* self, X86BufferWriter& writer, uint32_t regSize, InstOptions options, const Mem& rmRel) noexcept { |
493 | 493 | if (self->is32Bit()) { |
494 | 494 | // There is no relative addressing, just decide whether to use MOV encoded with MOD R/M or absolute. |
495 | return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModMR); | |
495 | return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM); | |
496 | 496 | } |
497 | 497 | else { |
498 | 498 | // If the addressing type is REL or MOD R/M was specified then absolute mov won't be used. |
499 | if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR)) | |
499 | if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM)) | |
500 | 500 | return false; |
501 | 501 | |
502 | 502 | int64_t addrValue = rmRel.offset(); |
745 | 745 | TEST_INSTRUCTION("411088B8", ldursw(x1, ptr(x2, 129))); |
746 | 746 | TEST_INSTRUCTION("E10380B8", ldursw(x1, ptr(sp))); |
747 | 747 | TEST_INSTRUCTION("E11388B8", ldursw(x1, ptr(sp, 129))); |
748 | TEST_INSTRUCTION("420080B8", ldursw(x2, ptr(x2))); | |
749 | TEST_INSTRUCTION("421088B8", ldursw(x2, ptr(x2, 129))); | |
750 | TEST_INSTRUCTION("E20380B8", ldursw(x2, ptr(sp))); | |
751 | TEST_INSTRUCTION("E21388B8", ldursw(x2, ptr(sp, 129))); | |
748 | 752 | TEST_INSTRUCTION("61087F88", ldxp(w1, w2, ptr(x3))); |
749 | 753 | TEST_INSTRUCTION("E10B7F88", ldxp(w1, w2, ptr(sp))); |
750 | 754 | TEST_INSTRUCTION("61087FC8", ldxp(x1, x2, ptr(x3))); |