1b8021494Sopenharmony_ci// Copyright 2015, VIXL authors
2b8021494Sopenharmony_ci// All rights reserved.
3b8021494Sopenharmony_ci//
4b8021494Sopenharmony_ci// Redistribution and use in source and binary forms, with or without
5b8021494Sopenharmony_ci// modification, are permitted provided that the following conditions are met:
6b8021494Sopenharmony_ci//
7b8021494Sopenharmony_ci//   * Redistributions of source code must retain the above copyright notice,
8b8021494Sopenharmony_ci//     this list of conditions and the following disclaimer.
9b8021494Sopenharmony_ci//   * Redistributions in binary form must reproduce the above copyright notice,
10b8021494Sopenharmony_ci//     this list of conditions and the following disclaimer in the documentation
11b8021494Sopenharmony_ci//     and/or other materials provided with the distribution.
12b8021494Sopenharmony_ci//   * Neither the name of ARM Limited nor the names of its contributors may be
13b8021494Sopenharmony_ci//     used to endorse or promote products derived from this software without
14b8021494Sopenharmony_ci//     specific prior written permission.
15b8021494Sopenharmony_ci//
16b8021494Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND
17b8021494Sopenharmony_ci// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18b8021494Sopenharmony_ci// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19b8021494Sopenharmony_ci// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20b8021494Sopenharmony_ci// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21b8021494Sopenharmony_ci// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22b8021494Sopenharmony_ci// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23b8021494Sopenharmony_ci// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24b8021494Sopenharmony_ci// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25b8021494Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26b8021494Sopenharmony_ci
27b8021494Sopenharmony_ci
28b8021494Sopenharmony_ci#include "test-disasm-aarch64.h"
29b8021494Sopenharmony_ci
30b8021494Sopenharmony_ci#include <cstdio>
31b8021494Sopenharmony_ci#include <cstring>
32b8021494Sopenharmony_ci#include <string>
33b8021494Sopenharmony_ci
34b8021494Sopenharmony_ci#include "test-runner.h"
35b8021494Sopenharmony_ci
36b8021494Sopenharmony_ci#include "aarch64/disasm-aarch64.h"
37b8021494Sopenharmony_ci#include "aarch64/macro-assembler-aarch64.h"
38b8021494Sopenharmony_ci
39b8021494Sopenharmony_cinamespace vixl {
40b8021494Sopenharmony_cinamespace aarch64 {
41b8021494Sopenharmony_ci
42b8021494Sopenharmony_ciTEST(bootstrap) {
43b8021494Sopenharmony_ci  SETUP();
44b8021494Sopenharmony_ci
45b8021494Sopenharmony_ci  // Instructions generated by C compiler, disassembled by objdump, and
46b8021494Sopenharmony_ci  // reformatted to suit our disassembly style.
47b8021494Sopenharmony_ci  COMPARE(dci(0xa9ba7bfd), "stp x29, x30, [sp, #-96]!");
48b8021494Sopenharmony_ci  COMPARE(dci(0x910003fd), "mov x29, sp");
49b8021494Sopenharmony_ci  COMPARE(dci(0x9100e3a0), "add x0, x29, #0x38 (56)");
50b8021494Sopenharmony_ci  COMPARE(dci(0xb900001f), "str wzr, [x0]");
51b8021494Sopenharmony_ci  COMPARE(dci(0x528000e1), "mov w1, #0x7");
52b8021494Sopenharmony_ci  COMPARE(dci(0xb9001c01), "str w1, [x0, #28]");
53b8021494Sopenharmony_ci  COMPARE(dci(0x390043a0), "strb w0, [x29, #16]");
54b8021494Sopenharmony_ci  COMPARE(dci(0x790027a0), "strh w0, [x29, #18]");
55b8021494Sopenharmony_ci  COMPARE(dci(0xb9400400), "ldr w0, [x0, #4]");
56b8021494Sopenharmony_ci  COMPARE(dci(0x0b000021), "add w1, w1, w0");
57b8021494Sopenharmony_ci  COMPARE(dci(0x531b6800), "lsl w0, w0, #5");
58b8021494Sopenharmony_ci  COMPARE(dci(0x521e0400), "eor w0, w0, #0xc");
59b8021494Sopenharmony_ci  COMPARE(dci(0x72af0f00), "movk w0, #0x7878, lsl #16");
60b8021494Sopenharmony_ci  COMPARE(dci(0xd360fc00), "lsr x0, x0, #32");
61b8021494Sopenharmony_ci  COMPARE(dci(0x13037c01), "asr w1, w0, #3");
62b8021494Sopenharmony_ci  COMPARE(dci(0x4b000021), "sub w1, w1, w0");
63b8021494Sopenharmony_ci  COMPARE(dci(0x2a0103e0), "mov w0, w1");
64b8021494Sopenharmony_ci  COMPARE(dci(0x93407c00), "sxtw x0, w0");
65b8021494Sopenharmony_ci  COMPARE(dci(0x2a000020), "orr w0, w1, w0");
66b8021494Sopenharmony_ci  COMPARE(dci(0xa8c67bfd), "ldp x29, x30, [sp], #96");
67b8021494Sopenharmony_ci
68b8021494Sopenharmony_ci  CLEANUP();
69b8021494Sopenharmony_ci}
70b8021494Sopenharmony_ci
71b8021494Sopenharmony_ci
72b8021494Sopenharmony_ciTEST(mov_mvn) {
73b8021494Sopenharmony_ci  SETUP();
74b8021494Sopenharmony_ci
75b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, Operand(0x1234)), "mov w0, #0x1234");
76b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x1, Operand(0x1234)), "mov x1, #0x1234");
77b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w2, Operand(w3)), "mov w2, w3");
78b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x4, Operand(x5)), "mov x4, x5");
79b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w6, Operand(w7, LSL, 5)), "lsl w6, w7, #5");
80b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x8, Operand(x9, ASR, 42)), "asr x8, x9, #42");
81b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w10, Operand(w11, UXTB)), "uxtb w10, w11");
82b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x12, Operand(x13, UXTB, 1)), "ubfiz x12, x13, #1, #8");
83b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w14, Operand(w15, SXTH, 2)), "sbfiz w14, w15, #2, #16");
84b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x16, Operand(x17, SXTW, 3)), "sbfiz x16, x17, #3, #32");
85b8021494Sopenharmony_ci
86b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(w0, Operand(0x101)), "mov w0, #0xfffffefe");
87b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(x1, Operand(0xfff1)), "mov x1, #0xffffffffffff000e");
88b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(w2, Operand(w3)), "mvn w2, w3");
89b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(x4, Operand(x5)), "mvn x4, x5");
90b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(w6, Operand(w7, LSL, 12)), "mvn w6, w7, lsl #12");
91b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(x8, Operand(x9, ASR, 63)), "mvn x8, x9, asr #63");
92b8021494Sopenharmony_ci
93b8021494Sopenharmony_ci  CLEANUP();
94b8021494Sopenharmony_ci}
95b8021494Sopenharmony_ci
96b8021494Sopenharmony_ciTEST(mvn_macro) {
97b8021494Sopenharmony_ci  SETUP();
98b8021494Sopenharmony_ci
99b8021494Sopenharmony_ci  // Mvn uses the destination register as a scratch if it can. This only occurs
100b8021494Sopenharmony_ci  // when `operand.IsExtendedRegister()`.
101b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(x0, Operand(w1, SXTW)),
102b8021494Sopenharmony_ci                "sxtw x0, w1\n"
103b8021494Sopenharmony_ci                "mvn x0, x0");
104b8021494Sopenharmony_ci  COMPARE_MACRO(Mvn(x0, Operand(x0, SXTW)),
105b8021494Sopenharmony_ci                "sxtw x0, w0\n"
106b8021494Sopenharmony_ci                "mvn x0, x0");
107b8021494Sopenharmony_ci}
108b8021494Sopenharmony_ci
109b8021494Sopenharmony_ci
110b8021494Sopenharmony_ciTEST(move_immediate) {
111b8021494Sopenharmony_ci  SETUP();
112b8021494Sopenharmony_ci
113b8021494Sopenharmony_ci  COMPARE(movz(w0, 0x1234), "mov w0, #0x1234");
114b8021494Sopenharmony_ci  COMPARE(movz(x1, 0xabcd0000), "mov x1, #0xabcd0000");
115b8021494Sopenharmony_ci  COMPARE(movz(x2, 0x555500000000), "mov x2, #0x555500000000");
116b8021494Sopenharmony_ci  COMPARE(movz(x3, 0xaaaa000000000000), "mov x3, #0xaaaa000000000000");
117b8021494Sopenharmony_ci  COMPARE(movz(x4, 0xabcd, 16), "mov x4, #0xabcd0000");
118b8021494Sopenharmony_ci  COMPARE(movz(x5, 0x5555, 32), "mov x5, #0x555500000000");
119b8021494Sopenharmony_ci  COMPARE(movz(x6, 0xaaaa, 48), "mov x6, #0xaaaa000000000000");
120b8021494Sopenharmony_ci
121b8021494Sopenharmony_ci  COMPARE(movk(w7, 0x1234), "movk w7, #0x1234");
122b8021494Sopenharmony_ci  COMPARE(movk(x8, 0xabcd0000), "movk x8, #0xabcd, lsl #16");
123b8021494Sopenharmony_ci  COMPARE(movk(x9, 0x555500000000), "movk x9, #0x5555, lsl #32");
124b8021494Sopenharmony_ci  COMPARE(movk(x10, 0xaaaa000000000000), "movk x10, #0xaaaa, lsl #48");
125b8021494Sopenharmony_ci  COMPARE(movk(w11, 0xabcd, 16), "movk w11, #0xabcd, lsl #16");
126b8021494Sopenharmony_ci  COMPARE(movk(x12, 0x5555, 32), "movk x12, #0x5555, lsl #32");
127b8021494Sopenharmony_ci  COMPARE(movk(x13, 0xaaaa, 48), "movk x13, #0xaaaa, lsl #48");
128b8021494Sopenharmony_ci
129b8021494Sopenharmony_ci  COMPARE(movn(w14, 0x1234), "mov w14, #0xffffedcb");
130b8021494Sopenharmony_ci  COMPARE(movn(x15, 0xabcd0000), "mov x15, #0xffffffff5432ffff");
131b8021494Sopenharmony_ci  COMPARE(movn(x16, 0x555500000000), "mov x16, #0xffffaaaaffffffff");
132b8021494Sopenharmony_ci  COMPARE(movn(x17, 0xaaaa000000000000), "mov x17, #0x5555ffffffffffff");
133b8021494Sopenharmony_ci  COMPARE(movn(w18, 0xabcd, 16), "mov w18, #0x5432ffff");
134b8021494Sopenharmony_ci  COMPARE(movn(x19, 0x5555, 32), "mov x19, #0xffffaaaaffffffff");
135b8021494Sopenharmony_ci  COMPARE(movn(x20, 0xaaaa, 48), "mov x20, #0x5555ffffffffffff");
136b8021494Sopenharmony_ci
137b8021494Sopenharmony_ci  COMPARE(mov(w14, 0x1234), "mov w14, #0x1234");
138b8021494Sopenharmony_ci  COMPARE(mov(x15, 0xabcd0000), "mov x15, #0xabcd0000");
139b8021494Sopenharmony_ci  COMPARE(mov(x16, 0xaaaa000000000000), "mov x16, #0xaaaa000000000000");
140b8021494Sopenharmony_ci  COMPARE(mov(w17, 0xaaaaffff), "mov w17, #0xaaaaffff");
141b8021494Sopenharmony_ci  COMPARE(mov(x18, 0xffffaaaaffffffff), "mov x18, #0xffffaaaaffffffff");
142b8021494Sopenharmony_ci  COMPARE(mov(x19, 0xffffffffffffffff), "mov x19, #0xffffffffffffffff");
143b8021494Sopenharmony_ci  COMPARE(mov(x20, 0xc001c001c001c001), "mov x20, #0xc001c001c001c001");
144b8021494Sopenharmony_ci  COMPARE(mov(sp, 0xfefefefefefefefe), "mov sp, #0xfefefefefefefefe");
145b8021494Sopenharmony_ci
146b8021494Sopenharmony_ci  COMPARE(movk(w21, 0), "movk w21, #0x0");
147b8021494Sopenharmony_ci  COMPARE(movk(x22, 0, 0), "movk x22, #0x0");
148b8021494Sopenharmony_ci  COMPARE(movk(w23, 0, 16), "movk w23, #0x0, lsl #16");
149b8021494Sopenharmony_ci  COMPARE(movk(x24, 0, 32), "movk x24, #0x0, lsl #32");
150b8021494Sopenharmony_ci  COMPARE(movk(x25, 0, 48), "movk x25, #0x0, lsl #48");
151b8021494Sopenharmony_ci
152b8021494Sopenharmony_ci  COMPARE(movz(x26, 0, 48), "movz x26, #0x0");
153b8021494Sopenharmony_ci  COMPARE(movn(x27, 0, 48), "movn x27, #0x0");
154b8021494Sopenharmony_ci  COMPARE(movn(w28, 0xffff), "movn w28, #0xffff");
155b8021494Sopenharmony_ci
156b8021494Sopenharmony_ci  CLEANUP();
157b8021494Sopenharmony_ci}
158b8021494Sopenharmony_ci
159b8021494Sopenharmony_ci
160b8021494Sopenharmony_ciTEST(move_immediate_2) {
161b8021494Sopenharmony_ci  SETUP();
162b8021494Sopenharmony_ci
163b8021494Sopenharmony_ci  // Move instructions expected for certain immediates. This is really a macro
164b8021494Sopenharmony_ci  // assembler test, to ensure it generates immediates efficiently.
165b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0), "mov w0, #0x0");
166b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0x0000ffff), "mov w0, #0xffff");
167b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0x00010000), "mov w0, #0x10000");
168b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xffff0000), "mov w0, #0xffff0000");
169b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0x0001ffff), "mov w0, #0x1ffff");
170b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xffff8000), "mov w0, #0xffff8000");
171b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xfffffffe), "mov w0, #0xfffffffe");
172b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xffffffff), "mov w0, #0xffffffff");
173b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0x00ffff00), "mov w0, #0xffff00");
174b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xfffe7fff), "mov w0, #0xfffe7fff");
175b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xfffeffff), "mov w0, #0xfffeffff");
176b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(w0, 0xffff7fff), "mov w0, #0xffff7fff");
177b8021494Sopenharmony_ci
178b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0), "mov x0, #0x0");
179b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x0000ffff), "mov x0, #0xffff");
180b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x00010000), "mov x0, #0x10000");
181b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffff0000), "mov x0, #0xffff0000");
182b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x0001ffff), "mov x0, #0x1ffff");
183b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffff8000), "mov x0, #0xffff8000");
184b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffffffe), "mov x0, #0xfffffffe");
185b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffff), "mov x0, #0xffffffff");
186b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x00ffff00), "mov x0, #0xffff00");
187b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffff000000000000), "mov x0, #0xffff000000000000");
188b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x0000ffff00000000), "mov x0, #0xffff00000000");
189b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x00000000ffff0000), "mov x0, #0xffff0000");
190b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffffffff0000), "mov x0, #0xffffffffffff0000");
191b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffff0000ffff), "mov x0, #0xffffffff0000ffff");
192b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffff0000ffffffff), "mov x0, #0xffff0000ffffffff");
193b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0x0000ffffffffffff), "mov x0, #0xffffffffffff");
194b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffe7fffffffffff), "mov x0, #0xfffe7fffffffffff");
195b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffeffffffffffff), "mov x0, #0xfffeffffffffffff");
196b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffff7fffffffffff), "mov x0, #0xffff7fffffffffff");
197b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffffffe7fffffff), "mov x0, #0xfffffffe7fffffff");
198b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffffffeffffffff), "mov x0, #0xfffffffeffffffff");
199b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffff7fffffff), "mov x0, #0xffffffff7fffffff");
200b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffffffffffe7fff), "mov x0, #0xfffffffffffe7fff");
201b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xfffffffffffeffff), "mov x0, #0xfffffffffffeffff");
202b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffffffff7fff), "mov x0, #0xffffffffffff7fff");
203b8021494Sopenharmony_ci  COMPARE_MACRO(Mov(x0, 0xffffffffffffffff), "mov x0, #0xffffffffffffffff");
204b8021494Sopenharmony_ci
205b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(w0, 0x1234, 0), "movk w0, #0x1234");
206b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(x1, 0x2345, 0), "movk x1, #0x2345");
207b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(w2, 0x3456, 16), "movk w2, #0x3456, lsl #16");
208b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(x3, 0x4567, 16), "movk x3, #0x4567, lsl #16");
209b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(x4, 0x5678, 32), "movk x4, #0x5678, lsl #32");
210b8021494Sopenharmony_ci  COMPARE_MACRO(Movk(x5, 0x6789, 48), "movk x5, #0x6789, lsl #48");
211b8021494Sopenharmony_ci
212b8021494Sopenharmony_ci  CLEANUP();
213b8021494Sopenharmony_ci}
214b8021494Sopenharmony_ci
215b8021494Sopenharmony_ci
216b8021494Sopenharmony_ciTEST(add_immediate) {
217b8021494Sopenharmony_ci  SETUP();
218b8021494Sopenharmony_ci
219b8021494Sopenharmony_ci  COMPARE(add(w0, w1, Operand(0xff)), "add w0, w1, #0xff (255)");
220b8021494Sopenharmony_ci  COMPARE(add(x2, x3, Operand(0x3ff)), "add x2, x3, #0x3ff (1023)");
221b8021494Sopenharmony_ci  COMPARE(add(w4, w5, Operand(0xfff)), "add w4, w5, #0xfff (4095)");
222b8021494Sopenharmony_ci  COMPARE(add(x6, x7, Operand(0x1000)), "add x6, x7, #0x1000 (4096)");
223b8021494Sopenharmony_ci  COMPARE(add(w8, w9, Operand(0xff000)), "add w8, w9, #0xff000 (1044480)");
224b8021494Sopenharmony_ci  COMPARE(add(x10, x11, Operand(0x3ff000)),
225b8021494Sopenharmony_ci          "add x10, x11, #0x3ff000 (4190208)");
226b8021494Sopenharmony_ci  COMPARE(add(w12, w13, Operand(0xfff000)),
227b8021494Sopenharmony_ci          "add w12, w13, #0xfff000 (16773120)");
228b8021494Sopenharmony_ci  COMPARE(adds(w14, w15, Operand(0xff)), "adds w14, w15, #0xff (255)");
229b8021494Sopenharmony_ci  COMPARE(adds(x16, x17, Operand(0xaa000)), "adds x16, x17, #0xaa000 (696320)");
230b8021494Sopenharmony_ci
231b8021494Sopenharmony_ci  COMPARE(cmn(w18, Operand(0xff)), "cmn w18, #0xff (255)");
232b8021494Sopenharmony_ci  COMPARE(cmn(x19, Operand(0xff000)), "cmn x19, #0xff000 (1044480)");
233b8021494Sopenharmony_ci  COMPARE(add(w0, wsp, Operand(0)), "mov w0, wsp");
234b8021494Sopenharmony_ci  COMPARE(add(sp, x0, Operand(0)), "mov sp, x0");
235b8021494Sopenharmony_ci
236b8021494Sopenharmony_ci  COMPARE(add(w1, wsp, Operand(8)), "add w1, wsp, #0x8 (8)");
237b8021494Sopenharmony_ci  COMPARE(add(x2, sp, Operand(16)), "add x2, sp, #0x10 (16)");
238b8021494Sopenharmony_ci  COMPARE(add(wsp, wsp, Operand(42)), "add wsp, wsp, #0x2a (42)");
239b8021494Sopenharmony_ci  COMPARE(cmn(sp, Operand(24)), "cmn sp, #0x18 (24)");
240b8021494Sopenharmony_ci  COMPARE(adds(wzr, wsp, Operand(9)), "cmn wsp, #0x9 (9)");
241b8021494Sopenharmony_ci
242b8021494Sopenharmony_ci  CLEANUP();
243b8021494Sopenharmony_ci}
244b8021494Sopenharmony_ci
245b8021494Sopenharmony_ci
246b8021494Sopenharmony_ciTEST(sub_immediate) {
247b8021494Sopenharmony_ci  SETUP();
248b8021494Sopenharmony_ci
249b8021494Sopenharmony_ci  COMPARE(sub(w0, w1, Operand(0xff)), "sub w0, w1, #0xff (255)");
250b8021494Sopenharmony_ci  COMPARE(sub(x2, x3, Operand(0x3ff)), "sub x2, x3, #0x3ff (1023)");
251b8021494Sopenharmony_ci  COMPARE(sub(w4, w5, Operand(0xfff)), "sub w4, w5, #0xfff (4095)");
252b8021494Sopenharmony_ci  COMPARE(sub(x6, x7, Operand(0x1000)), "sub x6, x7, #0x1000 (4096)");
253b8021494Sopenharmony_ci  COMPARE(sub(w8, w9, Operand(0xff000)), "sub w8, w9, #0xff000 (1044480)");
254b8021494Sopenharmony_ci  COMPARE(sub(x10, x11, Operand(0x3ff000)),
255b8021494Sopenharmony_ci          "sub x10, x11, #0x3ff000 (4190208)");
256b8021494Sopenharmony_ci  COMPARE(sub(w12, w13, Operand(0xfff000)),
257b8021494Sopenharmony_ci          "sub w12, w13, #0xfff000 (16773120)");
258b8021494Sopenharmony_ci  COMPARE(subs(w14, w15, Operand(0xff)), "subs w14, w15, #0xff (255)");
259b8021494Sopenharmony_ci  COMPARE(subs(x16, x17, Operand(0xaa000)), "subs x16, x17, #0xaa000 (696320)");
260b8021494Sopenharmony_ci  COMPARE(cmp(w18, Operand(0xff)), "cmp w18, #0xff (255)");
261b8021494Sopenharmony_ci  COMPARE(cmp(x19, Operand(0xff000)), "cmp x19, #0xff000 (1044480)");
262b8021494Sopenharmony_ci
263b8021494Sopenharmony_ci  COMPARE(sub(w1, wsp, Operand(8)), "sub w1, wsp, #0x8 (8)");
264b8021494Sopenharmony_ci  COMPARE(sub(x2, sp, Operand(16)), "sub x2, sp, #0x10 (16)");
265b8021494Sopenharmony_ci  COMPARE(sub(wsp, wsp, Operand(42)), "sub wsp, wsp, #0x2a (42)");
266b8021494Sopenharmony_ci  COMPARE(cmp(sp, Operand(24)), "cmp sp, #0x18 (24)");
267b8021494Sopenharmony_ci  COMPARE(subs(wzr, wsp, Operand(9)), "cmp wsp, #0x9 (9)");
268b8021494Sopenharmony_ci
269b8021494Sopenharmony_ci  CLEANUP();
270b8021494Sopenharmony_ci}
271b8021494Sopenharmony_ci
272b8021494Sopenharmony_ci
273b8021494Sopenharmony_ciTEST(add_shifted) {
274b8021494Sopenharmony_ci  SETUP();
275b8021494Sopenharmony_ci
276b8021494Sopenharmony_ci  COMPARE(add(w0, w1, Operand(w2)), "add w0, w1, w2");
277b8021494Sopenharmony_ci  COMPARE(add(x3, x4, Operand(x5)), "add x3, x4, x5");
278b8021494Sopenharmony_ci  COMPARE(add(w6, w7, Operand(w8, LSL, 1)), "add w6, w7, w8, lsl #1");
279b8021494Sopenharmony_ci  COMPARE(add(x9, x10, Operand(x11, LSL, 2)), "add x9, x10, x11, lsl #2");
280b8021494Sopenharmony_ci  COMPARE(add(w12, w13, Operand(w14, LSR, 3)), "add w12, w13, w14, lsr #3");
281b8021494Sopenharmony_ci  COMPARE(add(x15, x16, Operand(x17, LSR, 4)), "add x15, x16, x17, lsr #4");
282b8021494Sopenharmony_ci  COMPARE(add(w18, w19, Operand(w20, ASR, 5)), "add w18, w19, w20, asr #5");
283b8021494Sopenharmony_ci  COMPARE(add(x21, x22, Operand(x23, ASR, 6)), "add x21, x22, x23, asr #6");
284b8021494Sopenharmony_ci  COMPARE(cmn(w24, Operand(w25)), "cmn w24, w25");
285b8021494Sopenharmony_ci  COMPARE(cmn(x26, Operand(x27, LSL, 63)), "cmn x26, x27, lsl #63");
286b8021494Sopenharmony_ci
287b8021494Sopenharmony_ci  COMPARE(add(x0, sp, Operand(x1)), "add x0, sp, x1");
288b8021494Sopenharmony_ci  COMPARE(add(w2, wsp, Operand(w3)), "add w2, wsp, w3");
289b8021494Sopenharmony_ci  COMPARE(add(x4, sp, Operand(x5, LSL, 1)), "add x4, sp, x5, lsl #1");
290b8021494Sopenharmony_ci  COMPARE(add(x4, xzr, Operand(x5, LSL, 1)), "add x4, xzr, x5, lsl #1");
291b8021494Sopenharmony_ci  COMPARE(add(w6, wsp, Operand(w7, LSL, 3)), "add w6, wsp, w7, lsl #3");
292b8021494Sopenharmony_ci  COMPARE(adds(xzr, sp, Operand(x8, LSL, 4)), "cmn sp, x8, lsl #4");
293b8021494Sopenharmony_ci  COMPARE(adds(xzr, xzr, Operand(x8, LSL, 5)), "cmn xzr, x8, lsl #5");
294b8021494Sopenharmony_ci
295b8021494Sopenharmony_ci  CLEANUP();
296b8021494Sopenharmony_ci}
297b8021494Sopenharmony_ci
298b8021494Sopenharmony_ci
299b8021494Sopenharmony_ciTEST(sub_shifted) {
300b8021494Sopenharmony_ci  SETUP();
301b8021494Sopenharmony_ci
302b8021494Sopenharmony_ci  COMPARE(sub(w0, w1, Operand(w2)), "sub w0, w1, w2");
303b8021494Sopenharmony_ci  COMPARE(sub(x3, x4, Operand(x5)), "sub x3, x4, x5");
304b8021494Sopenharmony_ci  COMPARE(sub(w6, w7, Operand(w8, LSL, 1)), "sub w6, w7, w8, lsl #1");
305b8021494Sopenharmony_ci  COMPARE(sub(x9, x10, Operand(x11, LSL, 2)), "sub x9, x10, x11, lsl #2");
306b8021494Sopenharmony_ci  COMPARE(sub(w12, w13, Operand(w14, LSR, 3)), "sub w12, w13, w14, lsr #3");
307b8021494Sopenharmony_ci  COMPARE(sub(x15, x16, Operand(x17, LSR, 4)), "sub x15, x16, x17, lsr #4");
308b8021494Sopenharmony_ci  COMPARE(sub(w18, w19, Operand(w20, ASR, 5)), "sub w18, w19, w20, asr #5");
309b8021494Sopenharmony_ci  COMPARE(sub(x21, x22, Operand(x23, ASR, 6)), "sub x21, x22, x23, asr #6");
310b8021494Sopenharmony_ci  COMPARE(cmp(w24, Operand(w25)), "cmp w24, w25");
311b8021494Sopenharmony_ci  COMPARE(cmp(x26, Operand(x27, LSL, 63)), "cmp x26, x27, lsl #63");
312b8021494Sopenharmony_ci  COMPARE(neg(w28, Operand(w29)), "neg w28, w29");
313b8021494Sopenharmony_ci  COMPARE(neg(x30, Operand(x0, LSR, 62)), "neg x30, x0, lsr #62");
314b8021494Sopenharmony_ci  COMPARE(negs(w1, Operand(w2)), "negs w1, w2");
315b8021494Sopenharmony_ci  COMPARE(negs(x3, Operand(x4, ASR, 61)), "negs x3, x4, asr #61");
316b8021494Sopenharmony_ci
317b8021494Sopenharmony_ci  COMPARE(sub(x0, sp, Operand(x1)), "sub x0, sp, x1");
318b8021494Sopenharmony_ci  COMPARE(sub(w2, wsp, Operand(w3)), "sub w2, wsp, w3");
319b8021494Sopenharmony_ci  COMPARE(sub(x4, sp, Operand(x5, LSL, 1)), "sub x4, sp, x5, lsl #1");
320b8021494Sopenharmony_ci  COMPARE(sub(x4, xzr, Operand(x5, LSL, 1)), "neg x4, x5, lsl #1");
321b8021494Sopenharmony_ci  COMPARE(sub(w6, wsp, Operand(w7, LSL, 3)), "sub w6, wsp, w7, lsl #3");
322b8021494Sopenharmony_ci  COMPARE(subs(xzr, sp, Operand(x8, LSL, 4)), "cmp sp, x8, lsl #4");
323b8021494Sopenharmony_ci  COMPARE(subs(xzr, xzr, Operand(x8, LSL, 5)), "cmp xzr, x8, lsl #5");
324b8021494Sopenharmony_ci
325b8021494Sopenharmony_ci  CLEANUP();
326b8021494Sopenharmony_ci}
327b8021494Sopenharmony_ci
328b8021494Sopenharmony_ci
329b8021494Sopenharmony_ciTEST(add_extended) {
330b8021494Sopenharmony_ci  SETUP();
331b8021494Sopenharmony_ci
332b8021494Sopenharmony_ci  COMPARE(add(w0, w1, Operand(w2, UXTB)), "add w0, w1, w2, uxtb");
333b8021494Sopenharmony_ci  COMPARE(adds(x3, x4, Operand(w5, UXTB, 1)), "adds x3, x4, w5, uxtb #1");
334b8021494Sopenharmony_ci  COMPARE(add(w6, w7, Operand(w8, UXTH, 2)), "add w6, w7, w8, uxth #2");
335b8021494Sopenharmony_ci  COMPARE(adds(x9, x10, Operand(x11, UXTW, 3)), "adds x9, x10, w11, uxtw #3");
336b8021494Sopenharmony_ci  COMPARE(add(x12, x13, Operand(x14, UXTX, 4)), "add x12, x13, x14, uxtx #4");
337b8021494Sopenharmony_ci  COMPARE(adds(w15, w16, Operand(w17, SXTB, 4)), "adds w15, w16, w17, sxtb #4");
338b8021494Sopenharmony_ci  COMPARE(add(x18, x19, Operand(x20, SXTB, 3)), "add x18, x19, w20, sxtb #3");
339b8021494Sopenharmony_ci  COMPARE(adds(w21, w22, Operand(w23, SXTH, 2)), "adds w21, w22, w23, sxth #2");
340b8021494Sopenharmony_ci  COMPARE(add(x24, x25, Operand(x26, SXTW, 1)), "add x24, x25, w26, sxtw #1");
341b8021494Sopenharmony_ci  COMPARE(adds(x27, x28, Operand(x29, SXTX)), "adds x27, x28, x29, sxtx");
342b8021494Sopenharmony_ci  COMPARE(cmn(w0, Operand(w1, UXTB, 2)), "cmn w0, w1, uxtb #2");
343b8021494Sopenharmony_ci  COMPARE(cmn(x2, Operand(x3, SXTH, 4)), "cmn x2, w3, sxth #4");
344b8021494Sopenharmony_ci
345b8021494Sopenharmony_ci  COMPARE(add(w0, wsp, Operand(w1, UXTB)), "add w0, wsp, w1, uxtb");
346b8021494Sopenharmony_ci  COMPARE(add(x2, sp, Operand(x3, UXTH, 1)), "add x2, sp, w3, uxth #1");
347b8021494Sopenharmony_ci  COMPARE(add(wsp, wsp, Operand(w4, UXTW, 2)), "add wsp, wsp, w4, lsl #2");
348b8021494Sopenharmony_ci  COMPARE(cmn(sp, Operand(xzr, UXTX, 3)), "cmn sp, xzr, lsl #3");
349b8021494Sopenharmony_ci  COMPARE(cmn(sp, Operand(xzr, LSL, 4)), "cmn sp, xzr, lsl #4");
350b8021494Sopenharmony_ci
351b8021494Sopenharmony_ci  CLEANUP();
352b8021494Sopenharmony_ci}
353b8021494Sopenharmony_ci
354b8021494Sopenharmony_ci
355b8021494Sopenharmony_ciTEST(sub_extended) {
356b8021494Sopenharmony_ci  SETUP();
357b8021494Sopenharmony_ci
358b8021494Sopenharmony_ci  COMPARE(sub(w0, w1, Operand(w2, UXTB)), "sub w0, w1, w2, uxtb");
359b8021494Sopenharmony_ci  COMPARE(subs(x3, x4, Operand(w5, UXTB, 1)), "subs x3, x4, w5, uxtb #1");
360b8021494Sopenharmony_ci  COMPARE(sub(w6, w7, Operand(w8, UXTH, 2)), "sub w6, w7, w8, uxth #2");
361b8021494Sopenharmony_ci  COMPARE(subs(x9, x10, Operand(x11, UXTW, 3)), "subs x9, x10, w11, uxtw #3");
362b8021494Sopenharmony_ci  COMPARE(sub(x12, x13, Operand(x14, UXTX, 4)), "sub x12, x13, x14, uxtx #4");
363b8021494Sopenharmony_ci  COMPARE(subs(w15, w16, Operand(w17, SXTB, 4)), "subs w15, w16, w17, sxtb #4");
364b8021494Sopenharmony_ci  COMPARE(sub(x18, x19, Operand(x20, SXTB, 3)), "sub x18, x19, w20, sxtb #3");
365b8021494Sopenharmony_ci  COMPARE(subs(w21, w22, Operand(w23, SXTH, 2)), "subs w21, w22, w23, sxth #2");
366b8021494Sopenharmony_ci  COMPARE(sub(x24, x25, Operand(x26, SXTW, 1)), "sub x24, x25, w26, sxtw #1");
367b8021494Sopenharmony_ci  COMPARE(subs(x27, x28, Operand(x29, SXTX)), "subs x27, x28, x29, sxtx");
368b8021494Sopenharmony_ci  COMPARE(cmp(w0, Operand(w1, SXTB, 1)), "cmp w0, w1, sxtb #1");
369b8021494Sopenharmony_ci  COMPARE(cmp(x2, Operand(x3, UXTH, 3)), "cmp x2, w3, uxth #3");
370b8021494Sopenharmony_ci
371b8021494Sopenharmony_ci  COMPARE(sub(w0, wsp, Operand(w1, UXTB)), "sub w0, wsp, w1, uxtb");
372b8021494Sopenharmony_ci  COMPARE(sub(x2, sp, Operand(x3, UXTH, 1)), "sub x2, sp, w3, uxth #1");
373b8021494Sopenharmony_ci  COMPARE(sub(wsp, wsp, Operand(w4, UXTW, 2)), "sub wsp, wsp, w4, lsl #2");
374b8021494Sopenharmony_ci  COMPARE(cmp(sp, Operand(xzr, UXTX, 3)), "cmp sp, xzr, lsl #3");
375b8021494Sopenharmony_ci  COMPARE(cmp(sp, Operand(xzr, LSL, 4)), "cmp sp, xzr, lsl #4");
376b8021494Sopenharmony_ci
377b8021494Sopenharmony_ci  CLEANUP();
378b8021494Sopenharmony_ci}
379b8021494Sopenharmony_ci
380b8021494Sopenharmony_ci
381b8021494Sopenharmony_ciTEST(adc_subc_ngc) {
382b8021494Sopenharmony_ci  SETUP();
383b8021494Sopenharmony_ci
384b8021494Sopenharmony_ci  COMPARE(adc(w0, w1, Operand(w2)), "adc w0, w1, w2");
385b8021494Sopenharmony_ci  COMPARE(adc(x3, x4, Operand(x5)), "adc x3, x4, x5");
386b8021494Sopenharmony_ci  COMPARE(adcs(w6, w7, Operand(w8)), "adcs w6, w7, w8");
387b8021494Sopenharmony_ci  COMPARE(adcs(x9, x10, Operand(x11)), "adcs x9, x10, x11");
388b8021494Sopenharmony_ci  COMPARE(sbc(w12, w13, Operand(w14)), "sbc w12, w13, w14");
389b8021494Sopenharmony_ci  COMPARE(sbc(x15, x16, Operand(x17)), "sbc x15, x16, x17");
390b8021494Sopenharmony_ci  COMPARE(sbcs(w18, w19, Operand(w20)), "sbcs w18, w19, w20");
391b8021494Sopenharmony_ci  COMPARE(sbcs(x21, x22, Operand(x23)), "sbcs x21, x22, x23");
392b8021494Sopenharmony_ci  COMPARE(ngc(w24, Operand(w25)), "ngc w24, w25");
393b8021494Sopenharmony_ci  COMPARE(ngc(x26, Operand(x27)), "ngc x26, x27");
394b8021494Sopenharmony_ci  COMPARE(ngcs(w28, Operand(w29)), "ngcs w28, w29");
395b8021494Sopenharmony_ci  COMPARE(ngcs(x30, Operand(x0)), "ngcs x30, x0");
396b8021494Sopenharmony_ci
397b8021494Sopenharmony_ci  CLEANUP();
398b8021494Sopenharmony_ci}
399b8021494Sopenharmony_ci
400b8021494Sopenharmony_ci
401b8021494Sopenharmony_ciTEST(rmif) {
402b8021494Sopenharmony_ci  SETUP();
403b8021494Sopenharmony_ci
404b8021494Sopenharmony_ci  COMPARE(rmif(x0, 3, ZCVFlag), "rmif x0, #3, #nZCV");
405b8021494Sopenharmony_ci  COMPARE(rmif(x1, 63, NCFlag), "rmif x1, #63, #NzCv");
406b8021494Sopenharmony_ci
407b8021494Sopenharmony_ci  CLEANUP();
408b8021494Sopenharmony_ci}
409b8021494Sopenharmony_ci
410b8021494Sopenharmony_ci
411b8021494Sopenharmony_ciTEST(setf8_setf16) {
412b8021494Sopenharmony_ci  SETUP();
413b8021494Sopenharmony_ci
414b8021494Sopenharmony_ci  COMPARE(setf8(w0), "setf8 w0");
415b8021494Sopenharmony_ci  COMPARE(setf16(w1), "setf16 w1");
416b8021494Sopenharmony_ci
417b8021494Sopenharmony_ci  CLEANUP();
418b8021494Sopenharmony_ci}
419b8021494Sopenharmony_ci
420b8021494Sopenharmony_ci
421b8021494Sopenharmony_ciTEST(mul_and_div) {
422b8021494Sopenharmony_ci  SETUP();
423b8021494Sopenharmony_ci
424b8021494Sopenharmony_ci  COMPARE(mul(w0, w1, w2), "mul w0, w1, w2");
425b8021494Sopenharmony_ci  COMPARE(mul(x3, x4, x5), "mul x3, x4, x5");
426b8021494Sopenharmony_ci  COMPARE(mul(w30, w0, w1), "mul w30, w0, w1");
427b8021494Sopenharmony_ci  COMPARE(mul(x30, x0, x1), "mul x30, x0, x1");
428b8021494Sopenharmony_ci  COMPARE(mneg(w0, w1, w2), "mneg w0, w1, w2");
429b8021494Sopenharmony_ci  COMPARE(mneg(x3, x4, x5), "mneg x3, x4, x5");
430b8021494Sopenharmony_ci  COMPARE(mneg(w30, w0, w1), "mneg w30, w0, w1");
431b8021494Sopenharmony_ci  COMPARE(mneg(x30, x0, x1), "mneg x30, x0, x1");
432b8021494Sopenharmony_ci  COMPARE(smull(x0, w0, w1), "smull x0, w0, w1");
433b8021494Sopenharmony_ci  COMPARE(smull(x30, w30, w0), "smull x30, w30, w0");
434b8021494Sopenharmony_ci  COMPARE(smulh(x0, x1, x2), "smulh x0, x1, x2");
435b8021494Sopenharmony_ci  COMPARE(umulh(x0, x2, x1), "umulh x0, x2, x1");
436b8021494Sopenharmony_ci
437b8021494Sopenharmony_ci  COMPARE(sdiv(w0, w1, w2), "sdiv w0, w1, w2");
438b8021494Sopenharmony_ci  COMPARE(sdiv(x3, x4, x5), "sdiv x3, x4, x5");
439b8021494Sopenharmony_ci  COMPARE(udiv(w6, w7, w8), "udiv w6, w7, w8");
440b8021494Sopenharmony_ci  COMPARE(udiv(x9, x10, x11), "udiv x9, x10, x11");
441b8021494Sopenharmony_ci
442b8021494Sopenharmony_ci  CLEANUP();
443b8021494Sopenharmony_ci}
444b8021494Sopenharmony_ci
445b8021494Sopenharmony_ci
446b8021494Sopenharmony_ciTEST(madd) {
447b8021494Sopenharmony_ci  SETUP();
448b8021494Sopenharmony_ci
449b8021494Sopenharmony_ci  COMPARE(madd(w0, w1, w2, w3), "madd w0, w1, w2, w3");
450b8021494Sopenharmony_ci  COMPARE(madd(w30, w21, w22, w16), "madd w30, w21, w22, w16");
451b8021494Sopenharmony_ci  COMPARE(madd(x0, x1, x2, x3), "madd x0, x1, x2, x3");
452b8021494Sopenharmony_ci  COMPARE(madd(x30, x21, x22, x16), "madd x30, x21, x22, x16");
453b8021494Sopenharmony_ci
454b8021494Sopenharmony_ci  COMPARE(smaddl(x0, w1, w2, x3), "smaddl x0, w1, w2, x3");
455b8021494Sopenharmony_ci  COMPARE(smaddl(x30, w21, w22, x16), "smaddl x30, w21, w22, x16");
456b8021494Sopenharmony_ci  COMPARE(umaddl(x0, w1, w2, x3), "umaddl x0, w1, w2, x3");
457b8021494Sopenharmony_ci  COMPARE(umaddl(x30, w21, w22, x16), "umaddl x30, w21, w22, x16");
458b8021494Sopenharmony_ci  COMPARE(umull(x0, w1, w2), "umull x0, w1, w2");
459b8021494Sopenharmony_ci  COMPARE(umull(x30, w21, w22), "umull x30, w21, w22");
460b8021494Sopenharmony_ci
461b8021494Sopenharmony_ci  CLEANUP();
462b8021494Sopenharmony_ci}
463b8021494Sopenharmony_ci
464b8021494Sopenharmony_ci
465b8021494Sopenharmony_ciTEST(msub) {
466b8021494Sopenharmony_ci  SETUP();
467b8021494Sopenharmony_ci
468b8021494Sopenharmony_ci  COMPARE(msub(w0, w1, w2, w3), "msub w0, w1, w2, w3");
469b8021494Sopenharmony_ci  COMPARE(msub(w30, w21, w22, w16), "msub w30, w21, w22, w16");
470b8021494Sopenharmony_ci  COMPARE(msub(x0, x1, x2, x3), "msub x0, x1, x2, x3");
471b8021494Sopenharmony_ci  COMPARE(msub(x30, x21, x22, x16), "msub x30, x21, x22, x16");
472b8021494Sopenharmony_ci
473b8021494Sopenharmony_ci  COMPARE(smsubl(x0, w1, w2, x3), "smsubl x0, w1, w2, x3");
474b8021494Sopenharmony_ci  COMPARE(smsubl(x30, w21, w22, x16), "smsubl x30, w21, w22, x16");
475b8021494Sopenharmony_ci  COMPARE(umsubl(x0, w1, w2, x3), "umsubl x0, w1, w2, x3");
476b8021494Sopenharmony_ci  COMPARE(umsubl(x30, w21, w22, x16), "umsubl x30, w21, w22, x16");
477b8021494Sopenharmony_ci
478b8021494Sopenharmony_ci  CLEANUP();
479b8021494Sopenharmony_ci}
480b8021494Sopenharmony_ci
481b8021494Sopenharmony_ci
482b8021494Sopenharmony_ciTEST(dp_1_source) {
483b8021494Sopenharmony_ci  SETUP();
484b8021494Sopenharmony_ci
485b8021494Sopenharmony_ci  COMPARE(rbit(w0, w1), "rbit w0, w1");
486b8021494Sopenharmony_ci  COMPARE(rbit(x2, x3), "rbit x2, x3");
487b8021494Sopenharmony_ci  COMPARE(rev16(w4, w5), "rev16 w4, w5");
488b8021494Sopenharmony_ci  COMPARE(rev16(x6, x7), "rev16 x6, x7");
489b8021494Sopenharmony_ci  COMPARE(rev32(x8, x9), "rev32 x8, x9");
490b8021494Sopenharmony_ci  COMPARE(rev64(x10, x11), "rev x10, x11");
491b8021494Sopenharmony_ci  COMPARE(rev(w12, w13), "rev w12, w13");
492b8021494Sopenharmony_ci  COMPARE(rev(x14, x15), "rev x14, x15");
493b8021494Sopenharmony_ci  COMPARE(clz(w16, w17), "clz w16, w17");
494b8021494Sopenharmony_ci  COMPARE(clz(x18, x19), "clz x18, x19");
495b8021494Sopenharmony_ci  COMPARE(cls(w20, w21), "cls w20, w21");
496b8021494Sopenharmony_ci  COMPARE(cls(x22, x23), "cls x22, x23");
497b8021494Sopenharmony_ci  COMPARE(pacia(x24, x25), "pacia x24, x25");
498b8021494Sopenharmony_ci  COMPARE(pacia(x26, sp), "pacia x26, sp");
499b8021494Sopenharmony_ci  COMPARE(pacib(x27, x28), "pacib x27, x28");
500b8021494Sopenharmony_ci  COMPARE(pacib(x29, sp), "pacib x29, sp");
501b8021494Sopenharmony_ci  COMPARE(pacda(x30, x0), "pacda x30, x0");
502b8021494Sopenharmony_ci  COMPARE(pacda(x1, sp), "pacda x1, sp");
503b8021494Sopenharmony_ci  COMPARE(pacdb(x2, x3), "pacdb x2, x3");
504b8021494Sopenharmony_ci  COMPARE(pacdb(x4, sp), "pacdb x4, sp");
505b8021494Sopenharmony_ci  COMPARE(paciza(x5), "paciza x5");
506b8021494Sopenharmony_ci  COMPARE(pacizb(x6), "pacizb x6");
507b8021494Sopenharmony_ci  COMPARE(pacdza(x7), "pacdza x7");
508b8021494Sopenharmony_ci  COMPARE(pacdzb(x8), "pacdzb x8");
509b8021494Sopenharmony_ci  COMPARE(autia(x9, x10), "autia x9, x10");
510b8021494Sopenharmony_ci  COMPARE(autia(x11, sp), "autia x11, sp");
511b8021494Sopenharmony_ci  COMPARE(autib(x12, x13), "autib x12, x13");
512b8021494Sopenharmony_ci  COMPARE(autib(x14, sp), "autib x14, sp");
513b8021494Sopenharmony_ci  COMPARE(autda(x15, x16), "autda x15, x16");
514b8021494Sopenharmony_ci  COMPARE(autda(x17, sp), "autda x17, sp");
515b8021494Sopenharmony_ci  COMPARE(autdb(x18, x19), "autdb x18, x19");
516b8021494Sopenharmony_ci  COMPARE(autdb(x20, sp), "autdb x20, sp");
517b8021494Sopenharmony_ci  COMPARE(autiza(x21), "autiza x21");
518b8021494Sopenharmony_ci  COMPARE(autizb(x22), "autizb x22");
519b8021494Sopenharmony_ci  COMPARE(autdza(x23), "autdza x23");
520b8021494Sopenharmony_ci
521b8021494Sopenharmony_ci  CLEANUP();
522b8021494Sopenharmony_ci}
523b8021494Sopenharmony_ci
524b8021494Sopenharmony_ci
525b8021494Sopenharmony_ciTEST(bitfield) {
526b8021494Sopenharmony_ci  SETUP();
527b8021494Sopenharmony_ci
528b8021494Sopenharmony_ci  COMPARE(sxtb(w0, w1), "sxtb w0, w1");
529b8021494Sopenharmony_ci  COMPARE(sxtb(x2, x3), "sxtb x2, w3");
530b8021494Sopenharmony_ci  COMPARE(sxth(w4, w5), "sxth w4, w5");
531b8021494Sopenharmony_ci  COMPARE(sxth(x6, x7), "sxth x6, w7");
532b8021494Sopenharmony_ci  COMPARE(sxtw(x8, x9), "sxtw x8, w9");
533b8021494Sopenharmony_ci  COMPARE(sxtb(x0, w1), "sxtb x0, w1");
534b8021494Sopenharmony_ci  COMPARE(sxth(x2, w3), "sxth x2, w3");
535b8021494Sopenharmony_ci  COMPARE(sxtw(x4, w5), "sxtw x4, w5");
536b8021494Sopenharmony_ci
537b8021494Sopenharmony_ci  COMPARE(uxtb(w10, w11), "uxtb w10, w11");
538b8021494Sopenharmony_ci  COMPARE(uxtb(x12, x13), "uxtb x12, w13");
539b8021494Sopenharmony_ci  COMPARE(uxth(w14, w15), "uxth w14, w15");
540b8021494Sopenharmony_ci  COMPARE(uxth(x16, x17), "uxth x16, w17");
541b8021494Sopenharmony_ci  COMPARE(uxtw(x18, x19), "ubfx x18, x19, #0, #32");
542b8021494Sopenharmony_ci
543b8021494Sopenharmony_ci  COMPARE(asr(w20, w21, 10), "asr w20, w21, #10");
544b8021494Sopenharmony_ci  COMPARE(asr(x22, x23, 20), "asr x22, x23, #20");
545b8021494Sopenharmony_ci  COMPARE(lsr(w24, w25, 10), "lsr w24, w25, #10");
546b8021494Sopenharmony_ci  COMPARE(lsr(x26, x27, 20), "lsr x26, x27, #20");
547b8021494Sopenharmony_ci  COMPARE(lsl(w28, w29, 10), "lsl w28, w29, #10");
548b8021494Sopenharmony_ci  COMPARE(lsl(x30, x0, 20), "lsl x30, x0, #20");
549b8021494Sopenharmony_ci
550b8021494Sopenharmony_ci  COMPARE(sbfiz(w1, w2, 1, 20), "sbfiz w1, w2, #1, #20");
551b8021494Sopenharmony_ci  COMPARE(sbfiz(x3, x4, 2, 19), "sbfiz x3, x4, #2, #19");
552b8021494Sopenharmony_ci  COMPARE(sbfx(w5, w6, 3, 18), "sbfx w5, w6, #3, #18");
553b8021494Sopenharmony_ci  COMPARE(sbfx(x7, x8, 4, 17), "sbfx x7, x8, #4, #17");
554b8021494Sopenharmony_ci  COMPARE(bfi(w9, w10, 5, 16), "bfi w9, w10, #5, #16");
555b8021494Sopenharmony_ci  COMPARE(bfi(x11, x12, 6, 15), "bfi x11, x12, #6, #15");
556b8021494Sopenharmony_ci  COMPARE(bfxil(w13, w14, 7, 14), "bfxil w13, w14, #7, #14");
557b8021494Sopenharmony_ci  COMPARE(bfxil(x15, x16, 8, 13), "bfxil x15, x16, #8, #13");
558b8021494Sopenharmony_ci  COMPARE(ubfiz(w17, w18, 9, 12), "ubfiz w17, w18, #9, #12");
559b8021494Sopenharmony_ci  COMPARE(ubfiz(x19, x20, 10, 11), "ubfiz x19, x20, #10, #11");
560b8021494Sopenharmony_ci  COMPARE(ubfx(w21, w22, 11, 10), "ubfx w21, w22, #11, #10");
561b8021494Sopenharmony_ci  COMPARE(ubfx(x23, x24, 12, 9), "ubfx x23, x24, #12, #9");
562b8021494Sopenharmony_ci  COMPARE(bfc(w25, 13, 8), "bfc w25, #13, #8");
563b8021494Sopenharmony_ci  COMPARE(bfc(x26, 14, 7), "bfc x26, #14, #7");
564b8021494Sopenharmony_ci
565b8021494Sopenharmony_ci  CLEANUP();
566b8021494Sopenharmony_ci}
567b8021494Sopenharmony_ci
568b8021494Sopenharmony_ciTEST(bitfield_regression_test) {
569b8021494Sopenharmony_ci  SETUP();
570b8021494Sopenharmony_ci
571b8021494Sopenharmony_ci  COMPARE(dci(0x533ae450), "unallocated (Unallocated)");
572b8021494Sopenharmony_ci  COMPARE(dci(0x133c464c), "unallocated (Unallocated)");
573b8021494Sopenharmony_ci  COMPARE(dci(0x133c4e6d), "unallocated (Unallocated)");
574b8021494Sopenharmony_ci  COMPARE(dci(0x133c5e45), "unallocated (Unallocated)");
575b8021494Sopenharmony_ci  COMPARE(dci(0x1335853c), "unallocated (Unallocated)");
576b8021494Sopenharmony_ci  COMPARE(dci(0x1335a73d), "unallocated (Unallocated)");
577b8021494Sopenharmony_ci
578b8021494Sopenharmony_ci  CLEANUP();
579b8021494Sopenharmony_ci}
580b8021494Sopenharmony_ci
581b8021494Sopenharmony_ci
582b8021494Sopenharmony_ciTEST(crc32b) {
583b8021494Sopenharmony_ci  SETUP();
584b8021494Sopenharmony_ci
585b8021494Sopenharmony_ci  COMPARE(crc32b(w0, w1, w2), "crc32b w0, w1, w2");
586b8021494Sopenharmony_ci  COMPARE(crc32b(w0, w11, w22), "crc32b w0, w11, w22");
587b8021494Sopenharmony_ci  COMPARE(crc32b(w10, w20, w30), "crc32b w10, w20, w30");
588b8021494Sopenharmony_ci
589b8021494Sopenharmony_ci  CLEANUP();
590b8021494Sopenharmony_ci}
591b8021494Sopenharmony_ci
592b8021494Sopenharmony_ci
593b8021494Sopenharmony_ciTEST(crc32h) {
594b8021494Sopenharmony_ci  SETUP();
595b8021494Sopenharmony_ci
596b8021494Sopenharmony_ci  COMPARE(crc32h(w1, w2, w3), "crc32h w1, w2, w3");
597b8021494Sopenharmony_ci  COMPARE(crc32h(w2, w13, w23), "crc32h w2, w13, w23");
598b8021494Sopenharmony_ci  COMPARE(crc32h(w11, w12, w15), "crc32h w11, w12, w15");
599b8021494Sopenharmony_ci
600b8021494Sopenharmony_ci  CLEANUP();
601b8021494Sopenharmony_ci}
602b8021494Sopenharmony_ci
603b8021494Sopenharmony_ci
604b8021494Sopenharmony_ciTEST(crc32w) {
605b8021494Sopenharmony_ci  SETUP();
606b8021494Sopenharmony_ci
607b8021494Sopenharmony_ci  COMPARE(crc32w(w2, w3, w4), "crc32w w2, w3, w4");
608b8021494Sopenharmony_ci  COMPARE(crc32w(w3, w14, w24), "crc32w w3, w14, w24");
609b8021494Sopenharmony_ci  COMPARE(crc32w(w13, w13, w16), "crc32w w13, w13, w16");
610b8021494Sopenharmony_ci
611b8021494Sopenharmony_ci  CLEANUP();
612b8021494Sopenharmony_ci}
613b8021494Sopenharmony_ci
614b8021494Sopenharmony_ci
615b8021494Sopenharmony_ciTEST(crc32x) {
616b8021494Sopenharmony_ci  SETUP();
617b8021494Sopenharmony_ci
618b8021494Sopenharmony_ci  COMPARE(crc32x(w3, w4, x5), "crc32x w3, w4, x5");
619b8021494Sopenharmony_ci  COMPARE(crc32x(w4, w15, x25), "crc32x w4, w15, x25");
620b8021494Sopenharmony_ci  COMPARE(crc32x(w14, w14, x30), "crc32x w14, w14, x30");
621b8021494Sopenharmony_ci
622b8021494Sopenharmony_ci  CLEANUP();
623b8021494Sopenharmony_ci}
624b8021494Sopenharmony_ci
625b8021494Sopenharmony_ci
626b8021494Sopenharmony_ciTEST(crc32cb) {
627b8021494Sopenharmony_ci  SETUP();
628b8021494Sopenharmony_ci
629b8021494Sopenharmony_ci  COMPARE(crc32cb(w4, w5, w6), "crc32cb w4, w5, w6");
630b8021494Sopenharmony_ci  COMPARE(crc32cb(w5, w16, w26), "crc32cb w5, w16, w26");
631b8021494Sopenharmony_ci  COMPARE(crc32cb(w15, w15, w5), "crc32cb w15, w15, w5");
632b8021494Sopenharmony_ci
633b8021494Sopenharmony_ci  CLEANUP();
634b8021494Sopenharmony_ci}
635b8021494Sopenharmony_ci
636b8021494Sopenharmony_ci
637b8021494Sopenharmony_ciTEST(crc32ch) {
638b8021494Sopenharmony_ci  SETUP();
639b8021494Sopenharmony_ci
640b8021494Sopenharmony_ci  COMPARE(crc32ch(w5, w6, w7), "crc32ch w5, w6, w7");
641b8021494Sopenharmony_ci  COMPARE(crc32ch(w6, w17, w27), "crc32ch w6, w17, w27");
642b8021494Sopenharmony_ci  COMPARE(crc32ch(w16, w16, w2), "crc32ch w16, w16, w2");
643b8021494Sopenharmony_ci
644b8021494Sopenharmony_ci  CLEANUP();
645b8021494Sopenharmony_ci}
646b8021494Sopenharmony_ci
647b8021494Sopenharmony_ci
648b8021494Sopenharmony_ciTEST(crc32cw) {
649b8021494Sopenharmony_ci  SETUP();
650b8021494Sopenharmony_ci
651b8021494Sopenharmony_ci  COMPARE(crc32cw(w6, w7, w8), "crc32cw w6, w7, w8");
652b8021494Sopenharmony_ci  COMPARE(crc32cw(w7, w18, w28), "crc32cw w7, w18, w28");
653b8021494Sopenharmony_ci  COMPARE(crc32cw(w17, w17, w3), "crc32cw w17, w17, w3");
654b8021494Sopenharmony_ci
655b8021494Sopenharmony_ci  CLEANUP();
656b8021494Sopenharmony_ci}
657b8021494Sopenharmony_ci
658b8021494Sopenharmony_ci
659b8021494Sopenharmony_ciTEST(crc32cx) {
660b8021494Sopenharmony_ci  SETUP();
661b8021494Sopenharmony_ci
662b8021494Sopenharmony_ci  COMPARE(crc32cx(w7, w8, x9), "crc32cx w7, w8, x9");
663b8021494Sopenharmony_ci  COMPARE(crc32cx(w8, w19, x29), "crc32cx w8, w19, x29");
664b8021494Sopenharmony_ci  COMPARE(crc32cx(w18, w18, x4), "crc32cx w18, w18, x4");
665b8021494Sopenharmony_ci
666b8021494Sopenharmony_ci  CLEANUP();
667b8021494Sopenharmony_ci}
668b8021494Sopenharmony_ci
669b8021494Sopenharmony_ci
670b8021494Sopenharmony_ciTEST(extract) {
671b8021494Sopenharmony_ci  SETUP();
672b8021494Sopenharmony_ci
673b8021494Sopenharmony_ci  COMPARE(extr(w0, w1, w2, 0), "extr w0, w1, w2, #0");
674b8021494Sopenharmony_ci  COMPARE(extr(x3, x4, x5, 1), "extr x3, x4, x5, #1");
675b8021494Sopenharmony_ci  COMPARE(extr(w6, w7, w8, 31), "extr w6, w7, w8, #31");
676b8021494Sopenharmony_ci  COMPARE(extr(x9, x10, x11, 63), "extr x9, x10, x11, #63");
677b8021494Sopenharmony_ci  COMPARE(extr(w12, w13, w13, 10), "ror w12, w13, #10");
678b8021494Sopenharmony_ci  COMPARE(extr(x14, x15, x15, 42), "ror x14, x15, #42");
679b8021494Sopenharmony_ci
680b8021494Sopenharmony_ci  CLEANUP();
681b8021494Sopenharmony_ci}
682b8021494Sopenharmony_ci
683b8021494Sopenharmony_ci
684b8021494Sopenharmony_ciTEST(logical_immediate) {
685b8021494Sopenharmony_ci  SETUP();
686b8021494Sopenharmony_ci#define RESULT_SIZE (256)
687b8021494Sopenharmony_ci
688b8021494Sopenharmony_ci  char result[RESULT_SIZE];
689b8021494Sopenharmony_ci
690b8021494Sopenharmony_ci  // Test immediate encoding - 64-bit destination.
691b8021494Sopenharmony_ci  // 64-bit patterns.
692b8021494Sopenharmony_ci  uint64_t value = 0x7fffffff;
693b8021494Sopenharmony_ci  for (int i = 0; i < 64; i++) {
694b8021494Sopenharmony_ci    snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value);
695b8021494Sopenharmony_ci    COMPARE(and_(x0, x0, Operand(value)), result);
696b8021494Sopenharmony_ci    value = ((value & 1) << 63) | (value >> 1);  // Rotate right 1 bit.
697b8021494Sopenharmony_ci  }
698b8021494Sopenharmony_ci
699b8021494Sopenharmony_ci  // 32-bit patterns.
700b8021494Sopenharmony_ci  value = 0x00003fff00003fff;
701b8021494Sopenharmony_ci  for (int i = 0; i < 32; i++) {
702b8021494Sopenharmony_ci    snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value);
703b8021494Sopenharmony_ci    COMPARE(and_(x0, x0, Operand(value)), result);
704b8021494Sopenharmony_ci    value = ((value & 1) << 63) | (value >> 1);  // Rotate right 1 bit.
705b8021494Sopenharmony_ci  }
706b8021494Sopenharmony_ci
707b8021494Sopenharmony_ci  // 16-bit patterns.
708b8021494Sopenharmony_ci  value = 0x001f001f001f001f;
709b8021494Sopenharmony_ci  for (int i = 0; i < 16; i++) {
710b8021494Sopenharmony_ci    snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value);
711b8021494Sopenharmony_ci    COMPARE(and_(x0, x0, Operand(value)), result);
712b8021494Sopenharmony_ci    value = ((value & 1) << 63) | (value >> 1);  // Rotate right 1 bit.
713b8021494Sopenharmony_ci  }
714b8021494Sopenharmony_ci
715b8021494Sopenharmony_ci  // 8-bit patterns.
716b8021494Sopenharmony_ci  value = 0x0e0e0e0e0e0e0e0e;
717b8021494Sopenharmony_ci  for (int i = 0; i < 8; i++) {
718b8021494Sopenharmony_ci    snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value);
719b8021494Sopenharmony_ci    COMPARE(and_(x0, x0, Operand(value)), result);
720b8021494Sopenharmony_ci    value = ((value & 1) << 63) | (value >> 1);  // Rotate right 1 bit.
721b8021494Sopenharmony_ci  }
722b8021494Sopenharmony_ci
723b8021494Sopenharmony_ci  // 4-bit patterns.
724b8021494Sopenharmony_ci  value = 0x6666666666666666;
725b8021494Sopenharmony_ci  for (int i = 0; i < 4; i++) {
726b8021494Sopenharmony_ci    snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value);
727b8021494Sopenharmony_ci    COMPARE(and_(x0, x0, Operand(value)), result);
728b8021494Sopenharmony_ci    value = ((value & 1) << 63) | (value >> 1);  // Rotate right 1 bit.
729b8021494Sopenharmony_ci  }
730b8021494Sopenharmony_ci
731b8021494Sopenharmony_ci  // 2-bit patterns.
732b8021494Sopenharmony_ci  COMPARE(and_(x0, x0, Operand(0x5555555555555555)),
733b8021494Sopenharmony_ci          "and x0, x0, #0x5555555555555555");
734b8021494Sopenharmony_ci  COMPARE(and_(x0, x0, Operand(0xaaaaaaaaaaaaaaaa)),
735b8021494Sopenharmony_ci          "and x0, x0, #0xaaaaaaaaaaaaaaaa");
736b8021494Sopenharmony_ci
737b8021494Sopenharmony_ci  // Test immediate encoding - 32-bit destination.
738b8021494Sopenharmony_ci  COMPARE(and_(w0, w0, Operand(0xff8007ff)),
739b8021494Sopenharmony_ci          "and w0, w0, #0xff8007ff");  // 32-bit pattern.
740b8021494Sopenharmony_ci  COMPARE(and_(w0, w0, Operand(0xf87ff87f)),
741b8021494Sopenharmony_ci          "and w0, w0, #0xf87ff87f");  // 16-bit pattern.
742b8021494Sopenharmony_ci  COMPARE(and_(w0, w0, Operand(0x87878787)),
743b8021494Sopenharmony_ci          "and w0, w0, #0x87878787");  // 8-bit pattern.
744b8021494Sopenharmony_ci  COMPARE(and_(w0, w0, Operand(0x66666666)),
745b8021494Sopenharmony_ci          "and w0, w0, #0x66666666");  // 4-bit pattern.
746b8021494Sopenharmony_ci  COMPARE(and_(w0, w0, Operand(0x55555555)),
747b8021494Sopenharmony_ci          "and w0, w0, #0x55555555");  // 2-bit pattern.
748b8021494Sopenharmony_ci
749b8021494Sopenharmony_ci  // Test other instructions.
750b8021494Sopenharmony_ci  COMPARE(tst(w1, Operand(0x11111111)), "tst w1, #0x11111111");
751b8021494Sopenharmony_ci  COMPARE(tst(x2, Operand(0x8888888888888888)), "tst x2, #0x8888888888888888");
752b8021494Sopenharmony_ci  COMPARE(orr(w7, w8, Operand(0xaaaaaaaa)), "orr w7, w8, #0xaaaaaaaa");
753b8021494Sopenharmony_ci  COMPARE(orr(x9, x10, Operand(0x5555555555555555)),
754b8021494Sopenharmony_ci          "orr x9, x10, #0x5555555555555555");
755b8021494Sopenharmony_ci  COMPARE(eor(w15, w16, Operand(0x00000001)), "eor w15, w16, #0x1");
756b8021494Sopenharmony_ci  COMPARE(eor(x17, x18, Operand(0x0000000000000003)), "eor x17, x18, #0x3");
757b8021494Sopenharmony_ci  COMPARE(ands(w23, w24, Operand(0x0000000f)), "ands w23, w24, #0xf");
758b8021494Sopenharmony_ci  COMPARE(ands(x25, x26, Operand(0x800000000000000f)),
759b8021494Sopenharmony_ci          "ands x25, x26, #0x800000000000000f");
760b8021494Sopenharmony_ci
761b8021494Sopenharmony_ci  // Test inverse.
762b8021494Sopenharmony_ci  COMPARE(bic(w3, w4, Operand(0x20202020)), "and w3, w4, #0xdfdfdfdf");
763b8021494Sopenharmony_ci  COMPARE(bic(x5, x6, Operand(0x4040404040404040)),
764b8021494Sopenharmony_ci          "and x5, x6, #0xbfbfbfbfbfbfbfbf");
765b8021494Sopenharmony_ci  COMPARE(orn(w11, w12, Operand(0x40004000)), "orr w11, w12, #0xbfffbfff");
766b8021494Sopenharmony_ci  COMPARE(orn(x13, x14, Operand(0x8181818181818181)),
767b8021494Sopenharmony_ci          "orr x13, x14, #0x7e7e7e7e7e7e7e7e");
768b8021494Sopenharmony_ci  COMPARE(eon(w19, w20, Operand(0x80000001)), "eor w19, w20, #0x7ffffffe");
769b8021494Sopenharmony_ci  COMPARE(eon(x21, x22, Operand(0xc000000000000003)),
770b8021494Sopenharmony_ci          "eor x21, x22, #0x3ffffffffffffffc");
771b8021494Sopenharmony_ci  COMPARE(bics(w27, w28, Operand(0xfffffff7)), "ands w27, w28, #0x8");
772b8021494Sopenharmony_ci  COMPARE(bics(x29, x0, Operand(0xfffffffeffffffff)),
773b8021494Sopenharmony_ci          "ands x29, x0, #0x100000000");
774b8021494Sopenharmony_ci
775b8021494Sopenharmony_ci  // Test stack pointer.
776b8021494Sopenharmony_ci  COMPARE(and_(wsp, wzr, Operand(7)), "and wsp, wzr, #0x7");
777b8021494Sopenharmony_ci  COMPARE(ands(xzr, xzr, Operand(7)), "tst xzr, #0x7");
778b8021494Sopenharmony_ci  COMPARE(orr(sp, xzr, Operand(15)), "orr sp, xzr, #0xf");
779b8021494Sopenharmony_ci  COMPARE(eor(wsp, w0, Operand(31)), "eor wsp, w0, #0x1f");
780b8021494Sopenharmony_ci
781b8021494Sopenharmony_ci  // Test move aliases.
782b8021494Sopenharmony_ci  COMPARE(orr(w0, wzr, Operand(0x00000780)), "orr w0, wzr, #0x780");
783b8021494Sopenharmony_ci  COMPARE(orr(w1, wzr, Operand(0x00007800)), "orr w1, wzr, #0x7800");
784b8021494Sopenharmony_ci  COMPARE(orr(w2, wzr, Operand(0x00078000)), "mov w2, #0x78000");
785b8021494Sopenharmony_ci  COMPARE(orr(w3, wzr, Operand(0x00780000)), "orr w3, wzr, #0x780000");
786b8021494Sopenharmony_ci  COMPARE(orr(w4, wzr, Operand(0x07800000)), "orr w4, wzr, #0x7800000");
787b8021494Sopenharmony_ci  COMPARE(orr(x5, xzr, Operand(0xffffffffffffc001)),
788b8021494Sopenharmony_ci          "orr x5, xzr, #0xffffffffffffc001");
789b8021494Sopenharmony_ci  COMPARE(orr(x6, xzr, Operand(0xfffffffffffc001f)),
790b8021494Sopenharmony_ci          "mov x6, #0xfffffffffffc001f");
791b8021494Sopenharmony_ci  COMPARE(orr(x7, xzr, Operand(0xffffffffffc001ff)),
792b8021494Sopenharmony_ci          "mov x7, #0xffffffffffc001ff");
793b8021494Sopenharmony_ci  COMPARE(orr(x8, xzr, Operand(0xfffffffffc001fff)),
794b8021494Sopenharmony_ci          "mov x8, #0xfffffffffc001fff");
795b8021494Sopenharmony_ci  COMPARE(orr(x9, xzr, Operand(0xffffffffc001ffff)),
796b8021494Sopenharmony_ci          "orr x9, xzr, #0xffffffffc001ffff");
797b8021494Sopenharmony_ci
798b8021494Sopenharmony_ci  CLEANUP();
799b8021494Sopenharmony_ci}
800b8021494Sopenharmony_ci
801b8021494Sopenharmony_ci
802b8021494Sopenharmony_ciTEST(logical_shifted) {
803b8021494Sopenharmony_ci  SETUP();
804b8021494Sopenharmony_ci
805b8021494Sopenharmony_ci  COMPARE(and_(w0, w1, Operand(w2)), "and w0, w1, w2");
806b8021494Sopenharmony_ci  COMPARE(and_(x3, x4, Operand(x5, LSL, 1)), "and x3, x4, x5, lsl #1");
807b8021494Sopenharmony_ci  COMPARE(and_(w6, w7, Operand(w8, LSR, 2)), "and w6, w7, w8, lsr #2");
808b8021494Sopenharmony_ci  COMPARE(and_(x9, x10, Operand(x11, ASR, 3)), "and x9, x10, x11, asr #3");
809b8021494Sopenharmony_ci  COMPARE(and_(w12, w13, Operand(w14, ROR, 4)), "and w12, w13, w14, ror #4");
810b8021494Sopenharmony_ci
811b8021494Sopenharmony_ci  COMPARE(bic(w15, w16, Operand(w17)), "bic w15, w16, w17");
812b8021494Sopenharmony_ci  COMPARE(bic(x18, x19, Operand(x20, LSL, 5)), "bic x18, x19, x20, lsl #5");
813b8021494Sopenharmony_ci  COMPARE(bic(w21, w22, Operand(w23, LSR, 6)), "bic w21, w22, w23, lsr #6");
814b8021494Sopenharmony_ci  COMPARE(bic(x24, x25, Operand(x26, ASR, 7)), "bic x24, x25, x26, asr #7");
815b8021494Sopenharmony_ci  COMPARE(bic(w27, w28, Operand(w29, ROR, 8)), "bic w27, w28, w29, ror #8");
816b8021494Sopenharmony_ci
817b8021494Sopenharmony_ci  COMPARE(orr(w0, w1, Operand(w2)), "orr w0, w1, w2");
818b8021494Sopenharmony_ci  COMPARE(orr(x3, x4, Operand(x5, LSL, 9)), "orr x3, x4, x5, lsl #9");
819b8021494Sopenharmony_ci  COMPARE(orr(w6, w7, Operand(w8, LSR, 10)), "orr w6, w7, w8, lsr #10");
820b8021494Sopenharmony_ci  COMPARE(orr(x9, x10, Operand(x11, ASR, 11)), "orr x9, x10, x11, asr #11");
821b8021494Sopenharmony_ci  COMPARE(orr(w12, w13, Operand(w14, ROR, 12)), "orr w12, w13, w14, ror #12");
822b8021494Sopenharmony_ci
823b8021494Sopenharmony_ci  COMPARE(orn(w15, w16, Operand(w17)), "orn w15, w16, w17");
824b8021494Sopenharmony_ci  COMPARE(orn(x18, x19, Operand(x20, LSL, 13)), "orn x18, x19, x20, lsl #13");
825b8021494Sopenharmony_ci  COMPARE(orn(w21, w22, Operand(w23, LSR, 14)), "orn w21, w22, w23, lsr #14");
826b8021494Sopenharmony_ci  COMPARE(orn(x24, x25, Operand(x26, ASR, 15)), "orn x24, x25, x26, asr #15");
827b8021494Sopenharmony_ci  COMPARE(orn(w27, w28, Operand(w29, ROR, 16)), "orn w27, w28, w29, ror #16");
828b8021494Sopenharmony_ci
829b8021494Sopenharmony_ci  COMPARE(eor(w0, w1, Operand(w2)), "eor w0, w1, w2");
830b8021494Sopenharmony_ci  COMPARE(eor(x3, x4, Operand(x5, LSL, 17)), "eor x3, x4, x5, lsl #17");
831b8021494Sopenharmony_ci  COMPARE(eor(w6, w7, Operand(w8, LSR, 18)), "eor w6, w7, w8, lsr #18");
832b8021494Sopenharmony_ci  COMPARE(eor(x9, x10, Operand(x11, ASR, 19)), "eor x9, x10, x11, asr #19");
833b8021494Sopenharmony_ci  COMPARE(eor(w12, w13, Operand(w14, ROR, 20)), "eor w12, w13, w14, ror #20");
834b8021494Sopenharmony_ci
835b8021494Sopenharmony_ci  COMPARE(eon(w15, w16, Operand(w17)), "eon w15, w16, w17");
836b8021494Sopenharmony_ci  COMPARE(eon(x18, x19, Operand(x20, LSL, 21)), "eon x18, x19, x20, lsl #21");
837b8021494Sopenharmony_ci  COMPARE(eon(w21, w22, Operand(w23, LSR, 22)), "eon w21, w22, w23, lsr #22");
838b8021494Sopenharmony_ci  COMPARE(eon(x24, x25, Operand(x26, ASR, 23)), "eon x24, x25, x26, asr #23");
839b8021494Sopenharmony_ci  COMPARE(eon(w27, w28, Operand(w29, ROR, 24)), "eon w27, w28, w29, ror #24");
840b8021494Sopenharmony_ci
841b8021494Sopenharmony_ci  COMPARE(ands(w0, w1, Operand(w2)), "ands w0, w1, w2");
842b8021494Sopenharmony_ci  COMPARE(ands(x3, x4, Operand(x5, LSL, 1)), "ands x3, x4, x5, lsl #1");
843b8021494Sopenharmony_ci  COMPARE(ands(w6, w7, Operand(w8, LSR, 2)), "ands w6, w7, w8, lsr #2");
844b8021494Sopenharmony_ci  COMPARE(ands(x9, x10, Operand(x11, ASR, 3)), "ands x9, x10, x11, asr #3");
845b8021494Sopenharmony_ci  COMPARE(ands(w12, w13, Operand(w14, ROR, 4)), "ands w12, w13, w14, ror #4");
846b8021494Sopenharmony_ci
847b8021494Sopenharmony_ci  COMPARE(bics(w15, w16, Operand(w17)), "bics w15, w16, w17");
848b8021494Sopenharmony_ci  COMPARE(bics(x18, x19, Operand(x20, LSL, 5)), "bics x18, x19, x20, lsl #5");
849b8021494Sopenharmony_ci  COMPARE(bics(w21, w22, Operand(w23, LSR, 6)), "bics w21, w22, w23, lsr #6");
850b8021494Sopenharmony_ci  COMPARE(bics(x24, x25, Operand(x26, ASR, 7)), "bics x24, x25, x26, asr #7");
851b8021494Sopenharmony_ci  COMPARE(bics(w27, w28, Operand(w29, ROR, 8)), "bics w27, w28, w29, ror #8");
852b8021494Sopenharmony_ci
853b8021494Sopenharmony_ci  COMPARE(tst(w0, Operand(w1)), "tst w0, w1");
854b8021494Sopenharmony_ci  COMPARE(tst(w2, Operand(w3, ROR, 10)), "tst w2, w3, ror #10");
855b8021494Sopenharmony_ci  COMPARE(tst(x0, Operand(x1)), "tst x0, x1");
856b8021494Sopenharmony_ci  COMPARE(tst(x2, Operand(x3, ROR, 42)), "tst x2, x3, ror #42");
857b8021494Sopenharmony_ci
858b8021494Sopenharmony_ci  COMPARE(orn(w0, wzr, Operand(w1)), "mvn w0, w1");
859b8021494Sopenharmony_ci  COMPARE(orn(w2, wzr, Operand(w3, ASR, 5)), "mvn w2, w3, asr #5");
860b8021494Sopenharmony_ci  COMPARE(orn(x0, xzr, Operand(x1)), "mvn x0, x1");
861b8021494Sopenharmony_ci  COMPARE(orn(x2, xzr, Operand(x3, ASR, 42)), "mvn x2, x3, asr #42");
862b8021494Sopenharmony_ci
863b8021494Sopenharmony_ci  COMPARE(orr(w0, wzr, Operand(w1)), "mov w0, w1");
864b8021494Sopenharmony_ci  COMPARE(orr(x0, xzr, Operand(x1)), "mov x0, x1");
865b8021494Sopenharmony_ci  COMPARE(orr(w16, wzr, Operand(w17, LSL, 1)), "orr w16, wzr, w17, lsl #1");
866b8021494Sopenharmony_ci  COMPARE(orr(x16, xzr, Operand(x17, ASR, 2)), "orr x16, xzr, x17, asr #2");
867b8021494Sopenharmony_ci
868b8021494Sopenharmony_ci  CLEANUP();
869b8021494Sopenharmony_ci}
870b8021494Sopenharmony_ci
871b8021494Sopenharmony_ci
872b8021494Sopenharmony_ciTEST(dp_2_source) {
873b8021494Sopenharmony_ci  SETUP();
874b8021494Sopenharmony_ci
875b8021494Sopenharmony_ci  COMPARE(lslv(w0, w1, w2), "lsl w0, w1, w2");
876b8021494Sopenharmony_ci  COMPARE(lslv(x3, x4, x5), "lsl x3, x4, x5");
877b8021494Sopenharmony_ci  COMPARE(lsrv(w6, w7, w8), "lsr w6, w7, w8");
878b8021494Sopenharmony_ci  COMPARE(lsrv(x9, x10, x11), "lsr x9, x10, x11");
879b8021494Sopenharmony_ci  COMPARE(asrv(w12, w13, w14), "asr w12, w13, w14");
880b8021494Sopenharmony_ci  COMPARE(asrv(x15, x16, x17), "asr x15, x16, x17");
881b8021494Sopenharmony_ci  COMPARE(rorv(w18, w19, w20), "ror w18, w19, w20");
882b8021494Sopenharmony_ci  COMPARE(rorv(x21, x22, x23), "ror x21, x22, x23");
883b8021494Sopenharmony_ci  COMPARE(pacga(x24, x25, x26), "pacga x24, x25, x26");
884b8021494Sopenharmony_ci  COMPARE(pacga(x27, x28, sp), "pacga x27, x28, sp");
885b8021494Sopenharmony_ci
886b8021494Sopenharmony_ci  CLEANUP();
887b8021494Sopenharmony_ci}
888b8021494Sopenharmony_ci
889b8021494Sopenharmony_ci
890b8021494Sopenharmony_ciTEST(adr) {
891b8021494Sopenharmony_ci  SETUP();
892b8021494Sopenharmony_ci
893b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x0, INT64_C(0)), "adr x0, #+0x0");
894b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x1, 1), "adr x1, #+0x1");
895b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x2, -1), "adr x2, #-0x1");
896b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x3, 4), "adr x3, #+0x4");
897b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x4, -4), "adr x4, #-0x4");
898b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x5, 0x000fffff), "adr x5, #+0xfffff");
899b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(x6, -0x00100000), "adr x6, #-0x100000");
900b8021494Sopenharmony_ci  COMPARE_PREFIX(adr(xzr, INT64_C(0)), "adr xzr, #+0x0");
901b8021494Sopenharmony_ci
902b8021494Sopenharmony_ci  CLEANUP();
903b8021494Sopenharmony_ci}
904b8021494Sopenharmony_ci
905b8021494Sopenharmony_ci
906b8021494Sopenharmony_ciTEST(adrp) {
907b8021494Sopenharmony_ci  SETUP();
908b8021494Sopenharmony_ci
909b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x0, INT64_C(0)), "adrp x0, #+0x0");
910b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x1, 1), "adrp x1, #+0x1000");
911b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x2, -1), "adrp x2, #-0x1000");
912b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x3, 4), "adrp x3, #+0x4000");
913b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x4, -4), "adrp x4, #-0x4000");
914b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x5, 0x000fffff), "adrp x5, #+0xfffff000");
915b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(x6, -0x00100000), "adrp x6, #-0x100000000");
916b8021494Sopenharmony_ci  COMPARE_PREFIX(adrp(xzr, INT64_C(0)), "adrp xzr, #+0x0");
917b8021494Sopenharmony_ci
918b8021494Sopenharmony_ci  CLEANUP();
919b8021494Sopenharmony_ci}
920b8021494Sopenharmony_ci
921b8021494Sopenharmony_ci
922b8021494Sopenharmony_ciTEST(branch) {
923b8021494Sopenharmony_ci  SETUP();
924b8021494Sopenharmony_ci
925b8021494Sopenharmony_ci#define INST_OFF(x) (INT64_C(x) >> kInstructionSizeLog2)
926b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(0x4)), "b #+0x4");
927b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(-0x4)), "b #-0x4");
928b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(0x7fffffc)), "b #+0x7fffffc");
929b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(-0x8000000)), "b #-0x8000000");
930b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(0xffffc), eq), "b.eq #+0xffffc");
931b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(-0x100000), mi), "b.mi #-0x100000");
932b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(0xffffc), al), "b.al #+0xffffc");
933b8021494Sopenharmony_ci  COMPARE_PREFIX(b(INST_OFF(-0x100000), nv), "b.nv #-0x100000");
934b8021494Sopenharmony_ci  COMPARE_PREFIX(bl(INST_OFF(0x4)), "bl #+0x4");
935b8021494Sopenharmony_ci  COMPARE_PREFIX(bl(INST_OFF(-0x4)), "bl #-0x4");
936b8021494Sopenharmony_ci  COMPARE_PREFIX(bl(INST_OFF(0xffffc)), "bl #+0xffffc");
937b8021494Sopenharmony_ci  COMPARE_PREFIX(bl(INST_OFF(-0x100000)), "bl #-0x100000");
938b8021494Sopenharmony_ci  COMPARE_PREFIX(cbz(w0, INST_OFF(0xffffc)), "cbz w0, #+0xffffc");
939b8021494Sopenharmony_ci  COMPARE_PREFIX(cbz(x1, INST_OFF(-0x100000)), "cbz x1, #-0x100000");
940b8021494Sopenharmony_ci  COMPARE_PREFIX(cbnz(w2, INST_OFF(0xffffc)), "cbnz w2, #+0xffffc");
941b8021494Sopenharmony_ci  COMPARE_PREFIX(cbnz(x3, INST_OFF(-0x100000)), "cbnz x3, #-0x100000");
942b8021494Sopenharmony_ci  COMPARE_PREFIX(tbz(w4, 0, INST_OFF(0x7ffc)), "tbz w4, #0, #+0x7ffc");
943b8021494Sopenharmony_ci  COMPARE_PREFIX(tbz(x5, 63, INST_OFF(-0x8000)), "tbz x5, #63, #-0x8000");
944b8021494Sopenharmony_ci  COMPARE_PREFIX(tbz(w6, 31, INST_OFF(0)), "tbz w6, #31, #+0x0");
945b8021494Sopenharmony_ci  COMPARE_PREFIX(tbz(x7, 31, INST_OFF(0x4)), "tbz w7, #31, #+0x4");
946b8021494Sopenharmony_ci  COMPARE_PREFIX(tbz(x8, 32, INST_OFF(0x8)), "tbz x8, #32, #+0x8");
947b8021494Sopenharmony_ci  COMPARE_PREFIX(tbnz(w8, 0, INST_OFF(0x7ffc)), "tbnz w8, #0, #+0x7ffc");
948b8021494Sopenharmony_ci  COMPARE_PREFIX(tbnz(x9, 63, INST_OFF(-0x8000)), "tbnz x9, #63, #-0x8000");
949b8021494Sopenharmony_ci  COMPARE_PREFIX(tbnz(w10, 31, INST_OFF(0)), "tbnz w10, #31, #+0x0");
950b8021494Sopenharmony_ci  COMPARE_PREFIX(tbnz(x11, 31, INST_OFF(0x4)), "tbnz w11, #31, #+0x4");
951b8021494Sopenharmony_ci  COMPARE_PREFIX(tbnz(x12, 32, INST_OFF(0x8)), "tbnz x12, #32, #+0x8");
952b8021494Sopenharmony_ci  COMPARE(br(x0), "br x0");
953b8021494Sopenharmony_ci  COMPARE(blr(x1), "blr x1");
954b8021494Sopenharmony_ci  COMPARE(ret(x2), "ret x2");
955b8021494Sopenharmony_ci  COMPARE(ret(lr), "ret");
956b8021494Sopenharmony_ci
957b8021494Sopenharmony_ci  COMPARE(braaz(x0), "braaz x0");
958b8021494Sopenharmony_ci  COMPARE(brabz(x1), "brabz x1");
959b8021494Sopenharmony_ci  COMPARE(blraaz(x2), "blraaz x2");
960b8021494Sopenharmony_ci  COMPARE(blrabz(x3), "blrabz x3");
961b8021494Sopenharmony_ci  COMPARE(retaa(), "retaa");
962b8021494Sopenharmony_ci  COMPARE(retab(), "retab");
963b8021494Sopenharmony_ci  COMPARE(braa(x4, x5), "braa x4, x5");
964b8021494Sopenharmony_ci  COMPARE(braa(x6, sp), "braa x6, sp");
965b8021494Sopenharmony_ci  COMPARE(brab(x7, x8), "brab x7, x8");
966b8021494Sopenharmony_ci  COMPARE(brab(x9, sp), "brab x9, sp");
967b8021494Sopenharmony_ci  COMPARE(blraa(x10, x11), "blraa x10, x11");
968b8021494Sopenharmony_ci  COMPARE(blraa(x12, sp), "blraa x12, sp");
969b8021494Sopenharmony_ci  COMPARE(blrab(x13, x14), "blrab x13, x14");
970b8021494Sopenharmony_ci  COMPARE(blrab(x15, sp), "blrab x15, sp");
971b8021494Sopenharmony_ci
972b8021494Sopenharmony_ci  CLEANUP();
973b8021494Sopenharmony_ci}
974b8021494Sopenharmony_ci
975b8021494Sopenharmony_ciTEST(mte_load_store) {
976b8021494Sopenharmony_ci  SETUP();
977b8021494Sopenharmony_ci
978b8021494Sopenharmony_ci  COMPARE(ldg(x0, MemOperand(sp)), "ldg x0, [sp]");
979b8021494Sopenharmony_ci  COMPARE(ldg(x22, MemOperand(x3, 32)), "ldg x22, [x3, #32]");
980b8021494Sopenharmony_ci  COMPARE(st2g(x3, MemOperand(sp)), "st2g x3, [sp]");
981b8021494Sopenharmony_ci  COMPARE(st2g(sp, MemOperand(sp, -320)), "st2g sp, [sp, #-320]");
982b8021494Sopenharmony_ci  COMPARE(st2g(x30, MemOperand(x4, 160, PreIndex)), "st2g x30, [x4, #160]!");
983b8021494Sopenharmony_ci  COMPARE(st2g(x22, MemOperand(x24, 1600, PostIndex)),
984b8021494Sopenharmony_ci          "st2g x22, [x24], #1600");
985b8021494Sopenharmony_ci  COMPARE(stg(x0, MemOperand(x1)), "stg x0, [x1]");
986b8021494Sopenharmony_ci  COMPARE(stg(x2, MemOperand(x3, 16)), "stg x2, [x3, #16]");
987b8021494Sopenharmony_ci  COMPARE(stg(sp, MemOperand(x1, -16, PreIndex)), "stg sp, [x1, #-16]!");
988b8021494Sopenharmony_ci  COMPARE(stg(x4, MemOperand(sp, -256, PostIndex)), "stg x4, [sp], #-256");
989b8021494Sopenharmony_ci  COMPARE(stgp(x29, x14, MemOperand(sp)), "stgp x29, x14, [sp]");
990b8021494Sopenharmony_ci  COMPARE(stgp(x3, x4, MemOperand(x3, -1024)), "stgp x3, x4, [x3, #-1024]");
991b8021494Sopenharmony_ci  COMPARE(stgp(x17, x7, MemOperand(x18, -64, PreIndex)),
992b8021494Sopenharmony_ci          "stgp x17, x7, [x18, #-64]!");
993b8021494Sopenharmony_ci  COMPARE(stgp(x5, x21, MemOperand(sp, 1008, PostIndex)),
994b8021494Sopenharmony_ci          "stgp x5, x21, [sp], #1008");
995b8021494Sopenharmony_ci  COMPARE(stzg(x20, MemOperand(x1)), "stzg x20, [x1]");
996b8021494Sopenharmony_ci  COMPARE(stzg(x22, MemOperand(x3, -32)), "stzg x22, [x3, #-32]");
997b8021494Sopenharmony_ci  COMPARE(stzg(sp, MemOperand(x1, 32, PreIndex)), "stzg sp, [x1, #32]!");
998b8021494Sopenharmony_ci  COMPARE(stzg(x5, MemOperand(sp, -2560, PostIndex)), "stzg x5, [sp], #-2560");
999b8021494Sopenharmony_ci  COMPARE(stz2g(x6, MemOperand(x21)), "stz2g x6, [x21]");
1000b8021494Sopenharmony_ci  COMPARE(stz2g(x18, MemOperand(x13, 16)), "stz2g x18, [x13, #16]");
1001b8021494Sopenharmony_ci  COMPARE(stz2g(sp, MemOperand(sp, -384, PreIndex)), "stz2g sp, [sp, #-384]!");
1002b8021494Sopenharmony_ci  COMPARE(stz2g(sp, MemOperand(x7, -256, PostIndex)), "stz2g sp, [x7], #-256");
1003b8021494Sopenharmony_ci
1004b8021494Sopenharmony_ci  COMPARE_MACRO(Ldg(x10, MemOperand(x17)), "ldg x10, [x17]");
1005b8021494Sopenharmony_ci  COMPARE_MACRO(Ldg(x15, MemOperand(sp, -4096)), "ldg x15, [sp, #-4096]");
1006b8021494Sopenharmony_ci  COMPARE_MACRO(St2g(x3, MemOperand(x15)), "st2g x3, [x15]");
1007b8021494Sopenharmony_ci  COMPARE_MACRO(St2g(sp, MemOperand(sp, -1600)), "st2g sp, [sp, #-1600]");
1008b8021494Sopenharmony_ci  COMPARE_MACRO(St2g(x30, MemOperand(x4, 3216, PreIndex)),
1009b8021494Sopenharmony_ci                "st2g x30, [x4, #3216]!");
1010b8021494Sopenharmony_ci  COMPARE_MACRO(St2g(x18, MemOperand(x2, 352, PostIndex)),
1011b8021494Sopenharmony_ci                "st2g x18, [x2], #352");
1012b8021494Sopenharmony_ci  COMPARE_MACRO(Stg(x10, MemOperand(x17)), "stg x10, [x17]");
1013b8021494Sopenharmony_ci  COMPARE_MACRO(Stg(sp, MemOperand(x3, -4096)), "stg sp, [x3, #-4096]");
1014b8021494Sopenharmony_ci  COMPARE_MACRO(Stg(sp, MemOperand(sp, 4080, PreIndex)),
1015b8021494Sopenharmony_ci                "stg sp, [sp, #4080]!");
1016b8021494Sopenharmony_ci  COMPARE_MACRO(Stg(x14, MemOperand(x20, 1024, PostIndex)),
1017b8021494Sopenharmony_ci                "stg x14, [x20], #1024");
1018b8021494Sopenharmony_ci  COMPARE_MACRO(Stgp(x3, x5, MemOperand(x7)), "stgp x3, x5, [x7]");
1019b8021494Sopenharmony_ci  COMPARE_MACRO(Stgp(x8, x4, MemOperand(x2, -496)), "stgp x8, x4, [x2, #-496]");
1020b8021494Sopenharmony_ci  COMPARE_MACRO(Stgp(x27, x7, MemOperand(sp, -672, PreIndex)),
1021b8021494Sopenharmony_ci                "stgp x27, x7, [sp, #-672]!");
1022b8021494Sopenharmony_ci  COMPARE_MACRO(Stgp(x14, x16, MemOperand(x0, 576, PostIndex)),
1023b8021494Sopenharmony_ci                "stgp x14, x16, [x0], #576");
1024b8021494Sopenharmony_ci  COMPARE_MACRO(Stz2g(x22, MemOperand(x12)), "stz2g x22, [x12]");
1025b8021494Sopenharmony_ci  COMPARE_MACRO(Stz2g(sp, MemOperand(sp, -704)), "stz2g sp, [sp, #-704]");
1026b8021494Sopenharmony_ci  COMPARE_MACRO(Stz2g(x3, MemOperand(x4, 272, PreIndex)),
1027b8021494Sopenharmony_ci                "stz2g x3, [x4, #272]!");
1028b8021494Sopenharmony_ci  COMPARE_MACRO(Stz2g(sp, MemOperand(sp, 1024, PostIndex)),
1029b8021494Sopenharmony_ci                "stz2g sp, [sp], #1024");
1030b8021494Sopenharmony_ci  COMPARE_MACRO(Stzg(x17, MemOperand(x11)), "stzg x17, [x11]");
1031b8021494Sopenharmony_ci  COMPARE_MACRO(Stzg(x29, MemOperand(x3, -3552)), "stzg x29, [x3, #-3552]");
1032b8021494Sopenharmony_ci  COMPARE_MACRO(Stzg(x2, MemOperand(x15, 784, PreIndex)),
1033b8021494Sopenharmony_ci                "stzg x2, [x15, #784]!");
1034b8021494Sopenharmony_ci  COMPARE_MACRO(Stzg(x8, MemOperand(x3, 1488, PostIndex)),
1035b8021494Sopenharmony_ci                "stzg x8, [x3], #1488");
1036b8021494Sopenharmony_ci  CLEANUP();
1037b8021494Sopenharmony_ci}
1038b8021494Sopenharmony_ci
1039b8021494Sopenharmony_ciTEST(load_store) {
1040b8021494Sopenharmony_ci  SETUP();
1041b8021494Sopenharmony_ci
1042b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1)), "ldr w0, [x1]");
1043b8021494Sopenharmony_ci  COMPARE(ldr(w2, MemOperand(x3, 4)), "ldr w2, [x3, #4]");
1044b8021494Sopenharmony_ci  COMPARE(ldr(w4, MemOperand(x5, 16380)), "ldr w4, [x5, #16380]");
1045b8021494Sopenharmony_ci  COMPARE(ldr(x6, MemOperand(x7)), "ldr x6, [x7]");
1046b8021494Sopenharmony_ci  COMPARE(ldr(x8, MemOperand(x9, 8)), "ldr x8, [x9, #8]");
1047b8021494Sopenharmony_ci  COMPARE(ldr(x10, MemOperand(x11, 32760)), "ldr x10, [x11, #32760]");
1048b8021494Sopenharmony_ci  COMPARE(str(w12, MemOperand(x13)), "str w12, [x13]");
1049b8021494Sopenharmony_ci  COMPARE(str(w14, MemOperand(x15, 4)), "str w14, [x15, #4]");
1050b8021494Sopenharmony_ci  COMPARE(str(w16, MemOperand(x17, 16380)), "str w16, [x17, #16380]");
1051b8021494Sopenharmony_ci  COMPARE(str(x18, MemOperand(x19)), "str x18, [x19]");
1052b8021494Sopenharmony_ci  COMPARE(str(x20, MemOperand(x21, 8)), "str x20, [x21, #8]");
1053b8021494Sopenharmony_ci  COMPARE(str(x22, MemOperand(x23, 32760)), "str x22, [x23, #32760]");
1054b8021494Sopenharmony_ci
1055b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1, 4, PreIndex)), "ldr w0, [x1, #4]!");
1056b8021494Sopenharmony_ci  COMPARE(ldr(w2, MemOperand(x3, 255, PreIndex)), "ldr w2, [x3, #255]!");
1057b8021494Sopenharmony_ci  COMPARE(ldr(w4, MemOperand(x5, -256, PreIndex)), "ldr w4, [x5, #-256]!");
1058b8021494Sopenharmony_ci  COMPARE(ldr(x6, MemOperand(x7, 8, PreIndex)), "ldr x6, [x7, #8]!");
1059b8021494Sopenharmony_ci  COMPARE(ldr(x8, MemOperand(x9, 255, PreIndex)), "ldr x8, [x9, #255]!");
1060b8021494Sopenharmony_ci  COMPARE(ldr(x10, MemOperand(x11, -256, PreIndex)), "ldr x10, [x11, #-256]!");
1061b8021494Sopenharmony_ci  COMPARE(str(w12, MemOperand(x13, 4, PreIndex)), "str w12, [x13, #4]!");
1062b8021494Sopenharmony_ci  COMPARE(str(w14, MemOperand(x15, 255, PreIndex)), "str w14, [x15, #255]!");
1063b8021494Sopenharmony_ci  COMPARE(str(w16, MemOperand(x17, -256, PreIndex)), "str w16, [x17, #-256]!");
1064b8021494Sopenharmony_ci  COMPARE(str(x18, MemOperand(x19, 8, PreIndex)), "str x18, [x19, #8]!");
1065b8021494Sopenharmony_ci  COMPARE(str(x20, MemOperand(x21, 255, PreIndex)), "str x20, [x21, #255]!");
1066b8021494Sopenharmony_ci  COMPARE(str(x22, MemOperand(x23, -256, PreIndex)), "str x22, [x23, #-256]!");
1067b8021494Sopenharmony_ci  COMPARE(str(x24, MemOperand(x25, 0, PreIndex)), "str x24, [x25, #0]!");
1068b8021494Sopenharmony_ci  COMPARE(str(w26, MemOperand(x27, 0, PreIndex)), "str w26, [x27, #0]!");
1069b8021494Sopenharmony_ci
1070b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1, 4, PostIndex)), "ldr w0, [x1], #4");
1071b8021494Sopenharmony_ci  COMPARE(ldr(w2, MemOperand(x3, 255, PostIndex)), "ldr w2, [x3], #255");
1072b8021494Sopenharmony_ci  COMPARE(ldr(w4, MemOperand(x5, -256, PostIndex)), "ldr w4, [x5], #-256");
1073b8021494Sopenharmony_ci  COMPARE(ldr(x6, MemOperand(x7, 8, PostIndex)), "ldr x6, [x7], #8");
1074b8021494Sopenharmony_ci  COMPARE(ldr(x8, MemOperand(x9, 255, PostIndex)), "ldr x8, [x9], #255");
1075b8021494Sopenharmony_ci  COMPARE(ldr(x10, MemOperand(x11, -256, PostIndex)), "ldr x10, [x11], #-256");
1076b8021494Sopenharmony_ci  COMPARE(str(w12, MemOperand(x13, 4, PostIndex)), "str w12, [x13], #4");
1077b8021494Sopenharmony_ci  COMPARE(str(w14, MemOperand(x15, 255, PostIndex)), "str w14, [x15], #255");
1078b8021494Sopenharmony_ci  COMPARE(str(w16, MemOperand(x17, -256, PostIndex)), "str w16, [x17], #-256");
1079b8021494Sopenharmony_ci  COMPARE(str(x18, MemOperand(x19, 8, PostIndex)), "str x18, [x19], #8");
1080b8021494Sopenharmony_ci  COMPARE(str(x20, MemOperand(x21, 255, PostIndex)), "str x20, [x21], #255");
1081b8021494Sopenharmony_ci  COMPARE(str(x22, MemOperand(x23, -256, PostIndex)), "str x22, [x23], #-256");
1082b8021494Sopenharmony_ci  COMPARE(str(x24, MemOperand(x25, 0, PostIndex)), "str x24, [x25], #0");
1083b8021494Sopenharmony_ci  COMPARE(str(w26, MemOperand(x27, 0, PostIndex)), "str w26, [x27], #0");
1084b8021494Sopenharmony_ci
1085b8021494Sopenharmony_ci  COMPARE(ldr(w24, MemOperand(sp)), "ldr w24, [sp]");
1086b8021494Sopenharmony_ci  COMPARE(ldr(x25, MemOperand(sp, 8)), "ldr x25, [sp, #8]");
1087b8021494Sopenharmony_ci  COMPARE(str(w26, MemOperand(sp, 4, PreIndex)), "str w26, [sp, #4]!");
1088b8021494Sopenharmony_ci  COMPARE(str(x27, MemOperand(sp, -8, PostIndex)), "str x27, [sp], #-8");
1089b8021494Sopenharmony_ci
1090b8021494Sopenharmony_ci  COMPARE(ldrsw(x0, MemOperand(x1)), "ldrsw x0, [x1]");
1091b8021494Sopenharmony_ci  COMPARE(ldrsw(x2, MemOperand(x3, 8)), "ldrsw x2, [x3, #8]");
1092b8021494Sopenharmony_ci  COMPARE(ldrsw(x4, MemOperand(x5, 42, PreIndex)), "ldrsw x4, [x5, #42]!");
1093b8021494Sopenharmony_ci  COMPARE(ldrsw(x6, MemOperand(x7, -11, PostIndex)), "ldrsw x6, [x7], #-11");
1094b8021494Sopenharmony_ci
1095b8021494Sopenharmony_ci  CLEANUP();
1096b8021494Sopenharmony_ci}
1097b8021494Sopenharmony_ci
1098b8021494Sopenharmony_ci
1099b8021494Sopenharmony_ciTEST(load_store_regoffset) {
1100b8021494Sopenharmony_ci  SETUP();
1101b8021494Sopenharmony_ci
1102b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1, w2, UXTW)), "ldr w0, [x1, w2, uxtw]");
1103b8021494Sopenharmony_ci  COMPARE(ldr(w3, MemOperand(x4, w5, UXTW, 2)), "ldr w3, [x4, w5, uxtw #2]");
1104b8021494Sopenharmony_ci  COMPARE(ldr(w6, MemOperand(x7, x8)), "ldr w6, [x7, x8]");
1105b8021494Sopenharmony_ci  COMPARE(ldr(w9, MemOperand(x10, x11, LSL, 2)), "ldr w9, [x10, x11, lsl #2]");
1106b8021494Sopenharmony_ci  COMPARE(ldr(w12, MemOperand(x13, w14, SXTW)), "ldr w12, [x13, w14, sxtw]");
1107b8021494Sopenharmony_ci  COMPARE(ldr(w15, MemOperand(x16, w17, SXTW, 2)),
1108b8021494Sopenharmony_ci          "ldr w15, [x16, w17, sxtw #2]");
1109b8021494Sopenharmony_ci  COMPARE(ldr(w18, MemOperand(x19, x20, SXTX)), "ldr w18, [x19, x20, sxtx]");
1110b8021494Sopenharmony_ci  COMPARE(ldr(w21, MemOperand(x22, x23, SXTX, 2)),
1111b8021494Sopenharmony_ci          "ldr w21, [x22, x23, sxtx #2]");
1112b8021494Sopenharmony_ci  COMPARE(ldr(x0, MemOperand(x1, w2, UXTW)), "ldr x0, [x1, w2, uxtw]");
1113b8021494Sopenharmony_ci  COMPARE(ldr(x3, MemOperand(x4, w5, UXTW, 3)), "ldr x3, [x4, w5, uxtw #3]");
1114b8021494Sopenharmony_ci  COMPARE(ldr(x6, MemOperand(x7, x8)), "ldr x6, [x7, x8]");
1115b8021494Sopenharmony_ci  COMPARE(ldr(x9, MemOperand(x10, x11, LSL, 3)), "ldr x9, [x10, x11, lsl #3]");
1116b8021494Sopenharmony_ci  COMPARE(ldr(x12, MemOperand(x13, w14, SXTW)), "ldr x12, [x13, w14, sxtw]");
1117b8021494Sopenharmony_ci  COMPARE(ldr(x15, MemOperand(x16, w17, SXTW, 3)),
1118b8021494Sopenharmony_ci          "ldr x15, [x16, w17, sxtw #3]");
1119b8021494Sopenharmony_ci  COMPARE(ldr(x18, MemOperand(x19, x20, SXTX)), "ldr x18, [x19, x20, sxtx]");
1120b8021494Sopenharmony_ci  COMPARE(ldr(x21, MemOperand(x22, x23, SXTX, 3)),
1121b8021494Sopenharmony_ci          "ldr x21, [x22, x23, sxtx #3]");
1122b8021494Sopenharmony_ci
1123b8021494Sopenharmony_ci  COMPARE(str(w0, MemOperand(x1, w2, UXTW)), "str w0, [x1, w2, uxtw]");
1124b8021494Sopenharmony_ci  COMPARE(str(w3, MemOperand(x4, w5, UXTW, 2)), "str w3, [x4, w5, uxtw #2]");
1125b8021494Sopenharmony_ci  COMPARE(str(w6, MemOperand(x7, x8)), "str w6, [x7, x8]");
1126b8021494Sopenharmony_ci  COMPARE(str(w9, MemOperand(x10, x11, LSL, 2)), "str w9, [x10, x11, lsl #2]");
1127b8021494Sopenharmony_ci  COMPARE(str(w12, MemOperand(x13, w14, SXTW)), "str w12, [x13, w14, sxtw]");
1128b8021494Sopenharmony_ci  COMPARE(str(w15, MemOperand(x16, w17, SXTW, 2)),
1129b8021494Sopenharmony_ci          "str w15, [x16, w17, sxtw #2]");
1130b8021494Sopenharmony_ci  COMPARE(str(w18, MemOperand(x19, x20, SXTX)), "str w18, [x19, x20, sxtx]");
1131b8021494Sopenharmony_ci  COMPARE(str(w21, MemOperand(x22, x23, SXTX, 2)),
1132b8021494Sopenharmony_ci          "str w21, [x22, x23, sxtx #2]");
1133b8021494Sopenharmony_ci  COMPARE(str(x0, MemOperand(x1, w2, UXTW)), "str x0, [x1, w2, uxtw]");
1134b8021494Sopenharmony_ci  COMPARE(str(x3, MemOperand(x4, w5, UXTW, 3)), "str x3, [x4, w5, uxtw #3]");
1135b8021494Sopenharmony_ci  COMPARE(str(x6, MemOperand(x7, x8)), "str x6, [x7, x8]");
1136b8021494Sopenharmony_ci  COMPARE(str(x9, MemOperand(x10, x11, LSL, 3)), "str x9, [x10, x11, lsl #3]");
1137b8021494Sopenharmony_ci  COMPARE(str(x12, MemOperand(x13, w14, SXTW)), "str x12, [x13, w14, sxtw]");
1138b8021494Sopenharmony_ci  COMPARE(str(x15, MemOperand(x16, w17, SXTW, 3)),
1139b8021494Sopenharmony_ci          "str x15, [x16, w17, sxtw #3]");
1140b8021494Sopenharmony_ci  COMPARE(str(x18, MemOperand(x19, x20, SXTX)), "str x18, [x19, x20, sxtx]");
1141b8021494Sopenharmony_ci  COMPARE(str(x21, MemOperand(x22, x23, SXTX, 3)),
1142b8021494Sopenharmony_ci          "str x21, [x22, x23, sxtx #3]");
1143b8021494Sopenharmony_ci
1144b8021494Sopenharmony_ci  COMPARE(ldrb(w0, MemOperand(x1, w2, UXTW)), "ldrb w0, [x1, w2, uxtw]");
1145b8021494Sopenharmony_ci  COMPARE(ldrb(w6, MemOperand(x7, x8)), "ldrb w6, [x7, x8]");
1146b8021494Sopenharmony_ci  COMPARE(ldrb(w12, MemOperand(x13, w14, SXTW)), "ldrb w12, [x13, w14, sxtw]");
1147b8021494Sopenharmony_ci  COMPARE(ldrb(w18, MemOperand(x19, x20, SXTX)), "ldrb w18, [x19, x20, sxtx]");
1148b8021494Sopenharmony_ci  COMPARE(strb(w0, MemOperand(x1, w2, UXTW)), "strb w0, [x1, w2, uxtw]");
1149b8021494Sopenharmony_ci  COMPARE(strb(w6, MemOperand(x7, x8)), "strb w6, [x7, x8]");
1150b8021494Sopenharmony_ci  COMPARE(strb(w12, MemOperand(x13, w14, SXTW)), "strb w12, [x13, w14, sxtw]");
1151b8021494Sopenharmony_ci  COMPARE(strb(w18, MemOperand(x19, x20, SXTX)), "strb w18, [x19, x20, sxtx]");
1152b8021494Sopenharmony_ci
1153b8021494Sopenharmony_ci  COMPARE(ldrh(w0, MemOperand(x1, w2, UXTW)), "ldrh w0, [x1, w2, uxtw]");
1154b8021494Sopenharmony_ci  COMPARE(ldrh(w3, MemOperand(x4, w5, UXTW, 1)), "ldrh w3, [x4, w5, uxtw #1]");
1155b8021494Sopenharmony_ci  COMPARE(ldrh(w6, MemOperand(x7, x8)), "ldrh w6, [x7, x8]");
1156b8021494Sopenharmony_ci  COMPARE(ldrh(w9, MemOperand(x10, x11, LSL, 1)),
1157b8021494Sopenharmony_ci          "ldrh w9, [x10, x11, lsl #1]");
1158b8021494Sopenharmony_ci  COMPARE(ldrh(w12, MemOperand(x13, w14, SXTW)), "ldrh w12, [x13, w14, sxtw]");
1159b8021494Sopenharmony_ci  COMPARE(ldrh(w15, MemOperand(x16, w17, SXTW, 1)),
1160b8021494Sopenharmony_ci          "ldrh w15, [x16, w17, sxtw #1]");
1161b8021494Sopenharmony_ci  COMPARE(ldrh(w18, MemOperand(x19, x20, SXTX)), "ldrh w18, [x19, x20, sxtx]");
1162b8021494Sopenharmony_ci  COMPARE(ldrh(w21, MemOperand(x22, x23, SXTX, 1)),
1163b8021494Sopenharmony_ci          "ldrh w21, [x22, x23, sxtx #1]");
1164b8021494Sopenharmony_ci  COMPARE(strh(w0, MemOperand(x1, w2, UXTW)), "strh w0, [x1, w2, uxtw]");
1165b8021494Sopenharmony_ci  COMPARE(strh(w3, MemOperand(x4, w5, UXTW, 1)), "strh w3, [x4, w5, uxtw #1]");
1166b8021494Sopenharmony_ci  COMPARE(strh(w6, MemOperand(x7, x8)), "strh w6, [x7, x8]");
1167b8021494Sopenharmony_ci  COMPARE(strh(w9, MemOperand(x10, x11, LSL, 1)),
1168b8021494Sopenharmony_ci          "strh w9, [x10, x11, lsl #1]");
1169b8021494Sopenharmony_ci  COMPARE(strh(w12, MemOperand(x13, w14, SXTW)), "strh w12, [x13, w14, sxtw]");
1170b8021494Sopenharmony_ci  COMPARE(strh(w15, MemOperand(x16, w17, SXTW, 1)),
1171b8021494Sopenharmony_ci          "strh w15, [x16, w17, sxtw #1]");
1172b8021494Sopenharmony_ci  COMPARE(strh(w18, MemOperand(x19, x20, SXTX)), "strh w18, [x19, x20, sxtx]");
1173b8021494Sopenharmony_ci  COMPARE(strh(w21, MemOperand(x22, x23, SXTX, 1)),
1174b8021494Sopenharmony_ci          "strh w21, [x22, x23, sxtx #1]");
1175b8021494Sopenharmony_ci
1176b8021494Sopenharmony_ci  COMPARE(ldr(x0, MemOperand(sp, wzr, SXTW)), "ldr x0, [sp, wzr, sxtw]");
1177b8021494Sopenharmony_ci  COMPARE(str(x1, MemOperand(sp, xzr)), "str x1, [sp, xzr]");
1178b8021494Sopenharmony_ci
1179b8021494Sopenharmony_ci  CLEANUP();
1180b8021494Sopenharmony_ci}
1181b8021494Sopenharmony_ci
1182b8021494Sopenharmony_ci
1183b8021494Sopenharmony_ciTEST(load_store_byte) {
1184b8021494Sopenharmony_ci  SETUP();
1185b8021494Sopenharmony_ci
1186b8021494Sopenharmony_ci  COMPARE(ldrb(w0, MemOperand(x1)), "ldrb w0, [x1]");
1187b8021494Sopenharmony_ci  COMPARE(ldrb(x2, MemOperand(x3)), "ldrb w2, [x3]");
1188b8021494Sopenharmony_ci  COMPARE(ldrb(w4, MemOperand(x5, 4095)), "ldrb w4, [x5, #4095]");
1189b8021494Sopenharmony_ci  COMPARE(ldrb(w6, MemOperand(x7, 255, PreIndex)), "ldrb w6, [x7, #255]!");
1190b8021494Sopenharmony_ci  COMPARE(ldrb(w8, MemOperand(x9, -256, PreIndex)), "ldrb w8, [x9, #-256]!");
1191b8021494Sopenharmony_ci  COMPARE(ldrb(w10, MemOperand(x11, 255, PostIndex)), "ldrb w10, [x11], #255");
1192b8021494Sopenharmony_ci  COMPARE(ldrb(w12, MemOperand(x13, -256, PostIndex)),
1193b8021494Sopenharmony_ci          "ldrb w12, [x13], #-256");
1194b8021494Sopenharmony_ci  COMPARE(ldrb(w14, MemOperand(x15, 0, PreIndex)), "ldrb w14, [x15, #0]!");
1195b8021494Sopenharmony_ci  COMPARE(ldrb(w16, MemOperand(x17, 0, PostIndex)), "ldrb w16, [x17], #0");
1196b8021494Sopenharmony_ci  COMPARE(strb(w14, MemOperand(x15)), "strb w14, [x15]");
1197b8021494Sopenharmony_ci  COMPARE(strb(x16, MemOperand(x17)), "strb w16, [x17]");
1198b8021494Sopenharmony_ci  COMPARE(strb(w18, MemOperand(x19, 4095)), "strb w18, [x19, #4095]");
1199b8021494Sopenharmony_ci  COMPARE(strb(w20, MemOperand(x21, 255, PreIndex)), "strb w20, [x21, #255]!");
1200b8021494Sopenharmony_ci  COMPARE(strb(w22, MemOperand(x23, -256, PreIndex)),
1201b8021494Sopenharmony_ci          "strb w22, [x23, #-256]!");
1202b8021494Sopenharmony_ci  COMPARE(strb(w24, MemOperand(x25, 255, PostIndex)), "strb w24, [x25], #255");
1203b8021494Sopenharmony_ci  COMPARE(strb(w26, MemOperand(x27, -256, PostIndex)),
1204b8021494Sopenharmony_ci          "strb w26, [x27], #-256");
1205b8021494Sopenharmony_ci  COMPARE(strb(w27, MemOperand(x28, 0, PreIndex)), "strb w27, [x28, #0]!");
1206b8021494Sopenharmony_ci  COMPARE(strb(w29, MemOperand(x30, 0, PostIndex)), "strb w29, [x30], #0");
1207b8021494Sopenharmony_ci  COMPARE(ldrb(w28, MemOperand(sp, 3, PostIndex)), "ldrb w28, [sp], #3");
1208b8021494Sopenharmony_ci  COMPARE(strb(x29, MemOperand(sp, -42, PreIndex)), "strb w29, [sp, #-42]!");
1209b8021494Sopenharmony_ci  COMPARE(ldrsb(w0, MemOperand(x1)), "ldrsb w0, [x1]");
1210b8021494Sopenharmony_ci  COMPARE(ldrsb(x2, MemOperand(x3, 8)), "ldrsb x2, [x3, #8]");
1211b8021494Sopenharmony_ci  COMPARE(ldrsb(w4, MemOperand(x5, 42, PreIndex)), "ldrsb w4, [x5, #42]!");
1212b8021494Sopenharmony_ci  COMPARE(ldrsb(x6, MemOperand(x7, -11, PostIndex)), "ldrsb x6, [x7], #-11");
1213b8021494Sopenharmony_ci  COMPARE(ldrsb(w8, MemOperand(x9, 0, PreIndex)), "ldrsb w8, [x9, #0]!");
1214b8021494Sopenharmony_ci  COMPARE(ldrsb(x10, MemOperand(x11, 0, PostIndex)), "ldrsb x10, [x11], #0");
1215b8021494Sopenharmony_ci
1216b8021494Sopenharmony_ci  CLEANUP();
1217b8021494Sopenharmony_ci}
1218b8021494Sopenharmony_ci
1219b8021494Sopenharmony_ci
1220b8021494Sopenharmony_ciTEST(load_store_half) {
1221b8021494Sopenharmony_ci  SETUP();
1222b8021494Sopenharmony_ci
1223b8021494Sopenharmony_ci  COMPARE(ldrh(w0, MemOperand(x1)), "ldrh w0, [x1]");
1224b8021494Sopenharmony_ci  COMPARE(ldrh(x2, MemOperand(x3)), "ldrh w2, [x3]");
1225b8021494Sopenharmony_ci  COMPARE(ldrh(w4, MemOperand(x5, 8190)), "ldrh w4, [x5, #8190]");
1226b8021494Sopenharmony_ci  COMPARE(ldrh(w6, MemOperand(x7, 255, PreIndex)), "ldrh w6, [x7, #255]!");
1227b8021494Sopenharmony_ci  COMPARE(ldrh(w8, MemOperand(x9, -256, PreIndex)), "ldrh w8, [x9, #-256]!");
1228b8021494Sopenharmony_ci  COMPARE(ldrh(w10, MemOperand(x11, 255, PostIndex)), "ldrh w10, [x11], #255");
1229b8021494Sopenharmony_ci  COMPARE(ldrh(w12, MemOperand(x13, -256, PostIndex)),
1230b8021494Sopenharmony_ci          "ldrh w12, [x13], #-256");
1231b8021494Sopenharmony_ci  COMPARE(ldrh(w14, MemOperand(x15, 0, PreIndex)), "ldrh w14, [x15, #0]!");
1232b8021494Sopenharmony_ci  COMPARE(ldrh(w16, MemOperand(x17, 0, PostIndex)), "ldrh w16, [x17], #0");
1233b8021494Sopenharmony_ci  COMPARE(strh(w14, MemOperand(x15)), "strh w14, [x15]");
1234b8021494Sopenharmony_ci  COMPARE(strh(x16, MemOperand(x17)), "strh w16, [x17]");
1235b8021494Sopenharmony_ci  COMPARE(strh(w18, MemOperand(x19, 8190)), "strh w18, [x19, #8190]");
1236b8021494Sopenharmony_ci  COMPARE(strh(w20, MemOperand(x21, 255, PreIndex)), "strh w20, [x21, #255]!");
1237b8021494Sopenharmony_ci  COMPARE(strh(w22, MemOperand(x23, -256, PreIndex)),
1238b8021494Sopenharmony_ci          "strh w22, [x23, #-256]!");
1239b8021494Sopenharmony_ci  COMPARE(strh(w24, MemOperand(x25, 255, PostIndex)), "strh w24, [x25], #255");
1240b8021494Sopenharmony_ci  COMPARE(strh(w26, MemOperand(x27, -256, PostIndex)),
1241b8021494Sopenharmony_ci          "strh w26, [x27], #-256");
1242b8021494Sopenharmony_ci  COMPARE(strh(w27, MemOperand(x28, 0, PreIndex)), "strh w27, [x28, #0]!");
1243b8021494Sopenharmony_ci  COMPARE(strh(w29, MemOperand(x30, 0, PostIndex)), "strh w29, [x30], #0");
1244b8021494Sopenharmony_ci  COMPARE(ldrh(w28, MemOperand(sp, 3, PostIndex)), "ldrh w28, [sp], #3");
1245b8021494Sopenharmony_ci  COMPARE(strh(x29, MemOperand(sp, -42, PreIndex)), "strh w29, [sp, #-42]!");
1246b8021494Sopenharmony_ci  COMPARE(ldrh(w30, MemOperand(x0, 255)), "ldurh w30, [x0, #255]");
1247b8021494Sopenharmony_ci  COMPARE(ldrh(x1, MemOperand(x2, -256)), "ldurh w1, [x2, #-256]");
1248b8021494Sopenharmony_ci  COMPARE(strh(w3, MemOperand(x4, 255)), "sturh w3, [x4, #255]");
1249b8021494Sopenharmony_ci  COMPARE(strh(x5, MemOperand(x6, -256)), "sturh w5, [x6, #-256]");
1250b8021494Sopenharmony_ci  COMPARE(ldrsh(w0, MemOperand(x1)), "ldrsh w0, [x1]");
1251b8021494Sopenharmony_ci  COMPARE(ldrsh(w2, MemOperand(x3, 8)), "ldrsh w2, [x3, #8]");
1252b8021494Sopenharmony_ci  COMPARE(ldrsh(w4, MemOperand(x5, 42, PreIndex)), "ldrsh w4, [x5, #42]!");
1253b8021494Sopenharmony_ci  COMPARE(ldrsh(x6, MemOperand(x7, -11, PostIndex)), "ldrsh x6, [x7], #-11");
1254b8021494Sopenharmony_ci  COMPARE(ldrsh(w8, MemOperand(x9, 0, PreIndex)), "ldrsh w8, [x9, #0]!");
1255b8021494Sopenharmony_ci  COMPARE(ldrsh(x10, MemOperand(x11, 0, PostIndex)), "ldrsh x10, [x11], #0");
1256b8021494Sopenharmony_ci
1257b8021494Sopenharmony_ci  CLEANUP();
1258b8021494Sopenharmony_ci}
1259b8021494Sopenharmony_ci
1260b8021494Sopenharmony_ciTEST(load_store_unscaled) {
1261b8021494Sopenharmony_ci  SETUP();
1262b8021494Sopenharmony_ci
1263b8021494Sopenharmony_ci  // If an unscaled-offset instruction is requested, it is used, even if the
1264b8021494Sopenharmony_ci  // offset could be encoded in a scaled-offset instruction.
1265b8021494Sopenharmony_ci  COMPARE(ldurb(w0, MemOperand(x1)), "ldurb w0, [x1]");
1266b8021494Sopenharmony_ci  COMPARE(ldurb(x2, MemOperand(x3, 1)), "ldurb w2, [x3, #1]");
1267b8021494Sopenharmony_ci  COMPARE(ldurb(w4, MemOperand(x5, 255)), "ldurb w4, [x5, #255]");
1268b8021494Sopenharmony_ci  COMPARE(sturb(w14, MemOperand(x15)), "sturb w14, [x15]");
1269b8021494Sopenharmony_ci  COMPARE(sturb(x16, MemOperand(x17, 1)), "sturb w16, [x17, #1]");
1270b8021494Sopenharmony_ci  COMPARE(sturb(w18, MemOperand(x19, 255)), "sturb w18, [x19, #255]");
1271b8021494Sopenharmony_ci  COMPARE(ldursb(w0, MemOperand(x1)), "ldursb w0, [x1]");
1272b8021494Sopenharmony_ci  COMPARE(ldursb(w2, MemOperand(x3, 1)), "ldursb w2, [x3, #1]");
1273b8021494Sopenharmony_ci  COMPARE(ldursb(x2, MemOperand(x3, 255)), "ldursb x2, [x3, #255]");
1274b8021494Sopenharmony_ci
1275b8021494Sopenharmony_ci  COMPARE(ldurh(w0, MemOperand(x1)), "ldurh w0, [x1]");
1276b8021494Sopenharmony_ci  COMPARE(ldurh(x2, MemOperand(x3, 2)), "ldurh w2, [x3, #2]");
1277b8021494Sopenharmony_ci  COMPARE(ldurh(w4, MemOperand(x5, 254)), "ldurh w4, [x5, #254]");
1278b8021494Sopenharmony_ci  COMPARE(sturh(w14, MemOperand(x15)), "sturh w14, [x15]");
1279b8021494Sopenharmony_ci  COMPARE(sturh(x16, MemOperand(x17, 2)), "sturh w16, [x17, #2]");
1280b8021494Sopenharmony_ci  COMPARE(sturh(w18, MemOperand(x19, 254)), "sturh w18, [x19, #254]");
1281b8021494Sopenharmony_ci  COMPARE(ldursh(w0, MemOperand(x1)), "ldursh w0, [x1]");
1282b8021494Sopenharmony_ci  COMPARE(ldursh(w2, MemOperand(x3, 2)), "ldursh w2, [x3, #2]");
1283b8021494Sopenharmony_ci  COMPARE(ldursh(x4, MemOperand(x5, 254)), "ldursh x4, [x5, #254]");
1284b8021494Sopenharmony_ci
1285b8021494Sopenharmony_ci  COMPARE(ldur(w0, MemOperand(x1)), "ldur w0, [x1]");
1286b8021494Sopenharmony_ci  COMPARE(ldur(w2, MemOperand(x3, 4)), "ldur w2, [x3, #4]");
1287b8021494Sopenharmony_ci  COMPARE(ldur(w4, MemOperand(x5, 248)), "ldur w4, [x5, #248]");
1288b8021494Sopenharmony_ci  COMPARE(stur(w12, MemOperand(x13)), "stur w12, [x13]");
1289b8021494Sopenharmony_ci  COMPARE(stur(w14, MemOperand(x15, 4)), "stur w14, [x15, #4]");
1290b8021494Sopenharmony_ci  COMPARE(stur(w16, MemOperand(x17, 248)), "stur w16, [x17, #248]");
1291b8021494Sopenharmony_ci  COMPARE(ldursw(x0, MemOperand(x1)), "ldursw x0, [x1]");
1292b8021494Sopenharmony_ci  COMPARE(ldursw(x2, MemOperand(x3, 4)), "ldursw x2, [x3, #4]");
1293b8021494Sopenharmony_ci  COMPARE(ldursw(x4, MemOperand(x5, 248)), "ldursw x4, [x5, #248]");
1294b8021494Sopenharmony_ci
1295b8021494Sopenharmony_ci  COMPARE(ldur(x6, MemOperand(x7)), "ldur x6, [x7]");
1296b8021494Sopenharmony_ci  COMPARE(ldur(x8, MemOperand(x9, 8)), "ldur x8, [x9, #8]");
1297b8021494Sopenharmony_ci  COMPARE(ldur(x10, MemOperand(x11, 248)), "ldur x10, [x11, #248]");
1298b8021494Sopenharmony_ci  COMPARE(stur(x18, MemOperand(x19)), "stur x18, [x19]");
1299b8021494Sopenharmony_ci  COMPARE(stur(x20, MemOperand(x21, 8)), "stur x20, [x21, #8]");
1300b8021494Sopenharmony_ci  COMPARE(stur(x22, MemOperand(x23, 248)), "stur x22, [x23, #248]");
1301b8021494Sopenharmony_ci
1302b8021494Sopenharmony_ci  COMPARE(ldur(b0, MemOperand(x1)), "ldur b0, [x1]");
1303b8021494Sopenharmony_ci  COMPARE(ldur(h2, MemOperand(x3, -1)), "ldur h2, [x3, #-1]");
1304b8021494Sopenharmony_ci  COMPARE(ldur(s4, MemOperand(x5, 2)), "ldur s4, [x5, #2]");
1305b8021494Sopenharmony_ci  COMPARE(ldur(d6, MemOperand(x7, -3)), "ldur d6, [x7, #-3]");
1306b8021494Sopenharmony_ci  COMPARE(ldur(q8, MemOperand(x9, 4)), "ldur q8, [x9, #4]");
1307b8021494Sopenharmony_ci  COMPARE(stur(b10, MemOperand(x11)), "stur b10, [x11]");
1308b8021494Sopenharmony_ci  COMPARE(stur(h12, MemOperand(x13, -1)), "stur h12, [x13, #-1]");
1309b8021494Sopenharmony_ci  COMPARE(stur(s14, MemOperand(x15, 2)), "stur s14, [x15, #2]");
1310b8021494Sopenharmony_ci  COMPARE(stur(d16, MemOperand(x17, -3)), "stur d16, [x17, #-3]");
1311b8021494Sopenharmony_ci  COMPARE(stur(q18, MemOperand(x19, 4)), "stur q18, [x19, #4]");
1312b8021494Sopenharmony_ci
1313b8021494Sopenharmony_ci  // Normal loads and stores are converted to unscaled loads and stores if the
1314b8021494Sopenharmony_ci  // offset requires it.
1315b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1, 1)), "ldur w0, [x1, #1]");
1316b8021494Sopenharmony_ci  COMPARE(ldr(w2, MemOperand(x3, -1)), "ldur w2, [x3, #-1]");
1317b8021494Sopenharmony_ci  COMPARE(ldr(w4, MemOperand(x5, 255)), "ldur w4, [x5, #255]");
1318b8021494Sopenharmony_ci  COMPARE(ldr(w6, MemOperand(x7, -256)), "ldur w6, [x7, #-256]");
1319b8021494Sopenharmony_ci  COMPARE(ldr(x8, MemOperand(x9, 1)), "ldur x8, [x9, #1]");
1320b8021494Sopenharmony_ci  COMPARE(ldr(x10, MemOperand(x11, -1)), "ldur x10, [x11, #-1]");
1321b8021494Sopenharmony_ci  COMPARE(ldr(x12, MemOperand(x13, 255)), "ldur x12, [x13, #255]");
1322b8021494Sopenharmony_ci  COMPARE(ldr(x14, MemOperand(x15, -256)), "ldur x14, [x15, #-256]");
1323b8021494Sopenharmony_ci  COMPARE(str(w16, MemOperand(x17, 1)), "stur w16, [x17, #1]");
1324b8021494Sopenharmony_ci  COMPARE(str(w18, MemOperand(x19, -1)), "stur w18, [x19, #-1]");
1325b8021494Sopenharmony_ci  COMPARE(str(w20, MemOperand(x21, 255)), "stur w20, [x21, #255]");
1326b8021494Sopenharmony_ci  COMPARE(str(w22, MemOperand(x23, -256)), "stur w22, [x23, #-256]");
1327b8021494Sopenharmony_ci  COMPARE(str(x24, MemOperand(x25, 1)), "stur x24, [x25, #1]");
1328b8021494Sopenharmony_ci  COMPARE(str(x26, MemOperand(x27, -1)), "stur x26, [x27, #-1]");
1329b8021494Sopenharmony_ci  COMPARE(str(x28, MemOperand(x29, 255)), "stur x28, [x29, #255]");
1330b8021494Sopenharmony_ci  COMPARE(str(x30, MemOperand(x0, -256)), "stur x30, [x0, #-256]");
1331b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(sp, 1)), "ldur w0, [sp, #1]");
1332b8021494Sopenharmony_ci  COMPARE(str(x1, MemOperand(sp, -1)), "stur x1, [sp, #-1]");
1333b8021494Sopenharmony_ci  COMPARE(ldrb(w2, MemOperand(x3, -2)), "ldurb w2, [x3, #-2]");
1334b8021494Sopenharmony_ci  COMPARE(ldrsb(w4, MemOperand(x5, -3)), "ldursb w4, [x5, #-3]");
1335b8021494Sopenharmony_ci  COMPARE(ldrsb(x6, MemOperand(x7, -4)), "ldursb x6, [x7, #-4]");
1336b8021494Sopenharmony_ci  COMPARE(ldrh(w8, MemOperand(x9, -5)), "ldurh w8, [x9, #-5]");
1337b8021494Sopenharmony_ci  COMPARE(ldrsh(w10, MemOperand(x11, -6)), "ldursh w10, [x11, #-6]");
1338b8021494Sopenharmony_ci  COMPARE(ldrsh(x12, MemOperand(x13, -7)), "ldursh x12, [x13, #-7]");
1339b8021494Sopenharmony_ci  COMPARE(ldrsw(x14, MemOperand(x15, -8)), "ldursw x14, [x15, #-8]");
1340b8021494Sopenharmony_ci
1341b8021494Sopenharmony_ci  CLEANUP();
1342b8021494Sopenharmony_ci}
1343b8021494Sopenharmony_ci
1344b8021494Sopenharmony_ci
1345b8021494Sopenharmony_ciTEST(load_store_unscaled_option) {
1346b8021494Sopenharmony_ci  SETUP();
1347b8021494Sopenharmony_ci
1348b8021494Sopenharmony_ci  // Just like load_store_unscaled, but specify the scaling option explicitly.
1349b8021494Sopenharmony_ci  LoadStoreScalingOption options[] = {PreferUnscaledOffset,
1350b8021494Sopenharmony_ci                                      RequireUnscaledOffset};
1351b8021494Sopenharmony_ci
1352b8021494Sopenharmony_ci  for (size_t i = 0; i < sizeof(options) / sizeof(options[0]); i++) {
1353b8021494Sopenharmony_ci    LoadStoreScalingOption option = options[i];
1354b8021494Sopenharmony_ci
1355b8021494Sopenharmony_ci    // If an unscaled-offset instruction is requested, it is used, even if the
1356b8021494Sopenharmony_ci    // offset could be encoded in a scaled-offset instruction.
1357b8021494Sopenharmony_ci    COMPARE(ldurb(w0, MemOperand(x1), option), "ldurb w0, [x1]");
1358b8021494Sopenharmony_ci    COMPARE(ldurb(x2, MemOperand(x3, 1), option), "ldurb w2, [x3, #1]");
1359b8021494Sopenharmony_ci    COMPARE(ldurb(w4, MemOperand(x5, 255), option), "ldurb w4, [x5, #255]");
1360b8021494Sopenharmony_ci    COMPARE(sturb(w14, MemOperand(x15), option), "sturb w14, [x15]");
1361b8021494Sopenharmony_ci    COMPARE(sturb(x16, MemOperand(x17, 1), option), "sturb w16, [x17, #1]");
1362b8021494Sopenharmony_ci    COMPARE(sturb(w18, MemOperand(x19, 255), option), "sturb w18, [x19, #255]");
1363b8021494Sopenharmony_ci    COMPARE(ldursb(w0, MemOperand(x1), option), "ldursb w0, [x1]");
1364b8021494Sopenharmony_ci    COMPARE(ldursb(w2, MemOperand(x3, 1), option), "ldursb w2, [x3, #1]");
1365b8021494Sopenharmony_ci    COMPARE(ldursb(x2, MemOperand(x3, 255), option), "ldursb x2, [x3, #255]");
1366b8021494Sopenharmony_ci
1367b8021494Sopenharmony_ci    COMPARE(ldurh(w0, MemOperand(x1), option), "ldurh w0, [x1]");
1368b8021494Sopenharmony_ci    COMPARE(ldurh(x2, MemOperand(x3, 2), option), "ldurh w2, [x3, #2]");
1369b8021494Sopenharmony_ci    COMPARE(ldurh(w4, MemOperand(x5, 254), option), "ldurh w4, [x5, #254]");
1370b8021494Sopenharmony_ci    COMPARE(sturh(w14, MemOperand(x15), option), "sturh w14, [x15]");
1371b8021494Sopenharmony_ci    COMPARE(sturh(x16, MemOperand(x17, 2), option), "sturh w16, [x17, #2]");
1372b8021494Sopenharmony_ci    COMPARE(sturh(w18, MemOperand(x19, 254), option), "sturh w18, [x19, #254]");
1373b8021494Sopenharmony_ci    COMPARE(ldursh(w0, MemOperand(x1), option), "ldursh w0, [x1]");
1374b8021494Sopenharmony_ci    COMPARE(ldursh(w2, MemOperand(x3, 2), option), "ldursh w2, [x3, #2]");
1375b8021494Sopenharmony_ci    COMPARE(ldursh(x4, MemOperand(x5, 254), option), "ldursh x4, [x5, #254]");
1376b8021494Sopenharmony_ci
1377b8021494Sopenharmony_ci    COMPARE(ldur(w0, MemOperand(x1), option), "ldur w0, [x1]");
1378b8021494Sopenharmony_ci    COMPARE(ldur(w2, MemOperand(x3, 4), option), "ldur w2, [x3, #4]");
1379b8021494Sopenharmony_ci    COMPARE(ldur(w4, MemOperand(x5, 248), option), "ldur w4, [x5, #248]");
1380b8021494Sopenharmony_ci    COMPARE(stur(w12, MemOperand(x13), option), "stur w12, [x13]");
1381b8021494Sopenharmony_ci    COMPARE(stur(w14, MemOperand(x15, 4), option), "stur w14, [x15, #4]");
1382b8021494Sopenharmony_ci    COMPARE(stur(w16, MemOperand(x17, 248), option), "stur w16, [x17, #248]");
1383b8021494Sopenharmony_ci    COMPARE(ldursw(x0, MemOperand(x1), option), "ldursw x0, [x1]");
1384b8021494Sopenharmony_ci    COMPARE(ldursw(x2, MemOperand(x3, 4), option), "ldursw x2, [x3, #4]");
1385b8021494Sopenharmony_ci    COMPARE(ldursw(x4, MemOperand(x5, 248), option), "ldursw x4, [x5, #248]");
1386b8021494Sopenharmony_ci
1387b8021494Sopenharmony_ci    COMPARE(ldur(x6, MemOperand(x7), option), "ldur x6, [x7]");
1388b8021494Sopenharmony_ci    COMPARE(ldur(x8, MemOperand(x9, 8), option), "ldur x8, [x9, #8]");
1389b8021494Sopenharmony_ci    COMPARE(ldur(x10, MemOperand(x11, 248), option), "ldur x10, [x11, #248]");
1390b8021494Sopenharmony_ci    COMPARE(stur(x18, MemOperand(x19), option), "stur x18, [x19]");
1391b8021494Sopenharmony_ci    COMPARE(stur(x20, MemOperand(x21, 8), option), "stur x20, [x21, #8]");
1392b8021494Sopenharmony_ci    COMPARE(stur(x22, MemOperand(x23, 248), option), "stur x22, [x23, #248]");
1393b8021494Sopenharmony_ci
1394b8021494Sopenharmony_ci    COMPARE(ldur(b0, MemOperand(x1), option), "ldur b0, [x1]");
1395b8021494Sopenharmony_ci    COMPARE(ldur(h2, MemOperand(x3, 2), option), "ldur h2, [x3, #2]");
1396b8021494Sopenharmony_ci    COMPARE(ldur(s4, MemOperand(x5, 4), option), "ldur s4, [x5, #4]");
1397b8021494Sopenharmony_ci    COMPARE(ldur(d6, MemOperand(x7, 8), option), "ldur d6, [x7, #8]");
1398b8021494Sopenharmony_ci    COMPARE(ldur(q8, MemOperand(x9, 16), option), "ldur q8, [x9, #16]");
1399b8021494Sopenharmony_ci    COMPARE(stur(b10, MemOperand(x11), option), "stur b10, [x11]");
1400b8021494Sopenharmony_ci    COMPARE(stur(h12, MemOperand(x13, 2), option), "stur h12, [x13, #2]");
1401b8021494Sopenharmony_ci    COMPARE(stur(s14, MemOperand(x15, 4), option), "stur s14, [x15, #4]");
1402b8021494Sopenharmony_ci    COMPARE(stur(d16, MemOperand(x17, 8), option), "stur d16, [x17, #8]");
1403b8021494Sopenharmony_ci    COMPARE(stur(q18, MemOperand(x19, 16), option), "stur q18, [x19, #16]");
1404b8021494Sopenharmony_ci  }
1405b8021494Sopenharmony_ci
1406b8021494Sopenharmony_ci  // Normal loads and stores are converted to unscaled loads and stores if the
1407b8021494Sopenharmony_ci  // offset requires it. PreferScaledOffset is the default for these cases, so
1408b8021494Sopenharmony_ci  // the behaviour here is the same when no option is specified.
1409b8021494Sopenharmony_ci  LoadStoreScalingOption option = PreferScaledOffset;
1410b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(x1, 1), option), "ldur w0, [x1, #1]");
1411b8021494Sopenharmony_ci  COMPARE(ldr(w2, MemOperand(x3, -1), option), "ldur w2, [x3, #-1]");
1412b8021494Sopenharmony_ci  COMPARE(ldr(w4, MemOperand(x5, 255), option), "ldur w4, [x5, #255]");
1413b8021494Sopenharmony_ci  COMPARE(ldr(w6, MemOperand(x7, -256), option), "ldur w6, [x7, #-256]");
1414b8021494Sopenharmony_ci  COMPARE(ldr(x8, MemOperand(x9, 1), option), "ldur x8, [x9, #1]");
1415b8021494Sopenharmony_ci  COMPARE(ldr(x10, MemOperand(x11, -1), option), "ldur x10, [x11, #-1]");
1416b8021494Sopenharmony_ci  COMPARE(ldr(x12, MemOperand(x13, 255), option), "ldur x12, [x13, #255]");
1417b8021494Sopenharmony_ci  COMPARE(ldr(x14, MemOperand(x15, -256), option), "ldur x14, [x15, #-256]");
1418b8021494Sopenharmony_ci  COMPARE(str(w16, MemOperand(x17, 1), option), "stur w16, [x17, #1]");
1419b8021494Sopenharmony_ci  COMPARE(str(w18, MemOperand(x19, -1), option), "stur w18, [x19, #-1]");
1420b8021494Sopenharmony_ci  COMPARE(str(w20, MemOperand(x21, 255), option), "stur w20, [x21, #255]");
1421b8021494Sopenharmony_ci  COMPARE(str(w22, MemOperand(x23, -256), option), "stur w22, [x23, #-256]");
1422b8021494Sopenharmony_ci  COMPARE(str(x24, MemOperand(x25, 1), option), "stur x24, [x25, #1]");
1423b8021494Sopenharmony_ci  COMPARE(str(x26, MemOperand(x27, -1), option), "stur x26, [x27, #-1]");
1424b8021494Sopenharmony_ci  COMPARE(str(x28, MemOperand(x29, 255), option), "stur x28, [x29, #255]");
1425b8021494Sopenharmony_ci  COMPARE(str(x30, MemOperand(x0, -256), option), "stur x30, [x0, #-256]");
1426b8021494Sopenharmony_ci  COMPARE(ldr(w0, MemOperand(sp, 1), option), "ldur w0, [sp, #1]");
1427b8021494Sopenharmony_ci  COMPARE(str(x1, MemOperand(sp, -1), option), "stur x1, [sp, #-1]");
1428b8021494Sopenharmony_ci  COMPARE(ldrb(w2, MemOperand(x3, -2), option), "ldurb w2, [x3, #-2]");
1429b8021494Sopenharmony_ci  COMPARE(ldrsb(w4, MemOperand(x5, -3), option), "ldursb w4, [x5, #-3]");
1430b8021494Sopenharmony_ci  COMPARE(ldrsb(x6, MemOperand(x7, -4), option), "ldursb x6, [x7, #-4]");
1431b8021494Sopenharmony_ci  COMPARE(ldrh(w8, MemOperand(x9, -5), option), "ldurh w8, [x9, #-5]");
1432b8021494Sopenharmony_ci  COMPARE(ldrsh(w10, MemOperand(x11, -6), option), "ldursh w10, [x11, #-6]");
1433b8021494Sopenharmony_ci  COMPARE(ldrsh(x12, MemOperand(x13, -7), option), "ldursh x12, [x13, #-7]");
1434b8021494Sopenharmony_ci  COMPARE(ldrsw(x14, MemOperand(x15, -8), option), "ldursw x14, [x15, #-8]");
1435b8021494Sopenharmony_ci  COMPARE(ldr(b0, MemOperand(x1, 1), option), "ldr b0, [x1, #1]");
1436b8021494Sopenharmony_ci  COMPARE(ldr(h2, MemOperand(x3, 1), option), "ldur h2, [x3, #1]");
1437b8021494Sopenharmony_ci  COMPARE(ldr(s4, MemOperand(x5, 3), option), "ldur s4, [x5, #3]");
1438b8021494Sopenharmony_ci  COMPARE(ldr(d6, MemOperand(x7, 7), option), "ldur d6, [x7, #7]");
1439b8021494Sopenharmony_ci  COMPARE(ldr(q8, MemOperand(x9, 15), option), "ldur q8, [x9, #15]");
1440b8021494Sopenharmony_ci  COMPARE(str(b10, MemOperand(x11, 1), option), "str b10, [x11, #1]");
1441b8021494Sopenharmony_ci  COMPARE(str(h12, MemOperand(x13, 1), option), "stur h12, [x13, #1]");
1442b8021494Sopenharmony_ci  COMPARE(str(s14, MemOperand(x15, 3), option), "stur s14, [x15, #3]");
1443b8021494Sopenharmony_ci  COMPARE(str(d16, MemOperand(x17, 7), option), "stur d16, [x17, #7]");
1444b8021494Sopenharmony_ci  COMPARE(str(q18, MemOperand(x19, 15), option), "stur q18, [x19, #15]");
1445b8021494Sopenharmony_ci
1446b8021494Sopenharmony_ci  CLEANUP();
1447b8021494Sopenharmony_ci}
1448b8021494Sopenharmony_ci
1449b8021494Sopenharmony_ci
1450b8021494Sopenharmony_ciTEST(load_store_pair) {
1451b8021494Sopenharmony_ci  SETUP();
1452b8021494Sopenharmony_ci
1453b8021494Sopenharmony_ci  COMPARE(ldp(w0, w1, MemOperand(x2)), "ldp w0, w1, [x2]");
1454b8021494Sopenharmony_ci  COMPARE(ldp(x3, x4, MemOperand(x5)), "ldp x3, x4, [x5]");
1455b8021494Sopenharmony_ci  COMPARE(ldp(w6, w7, MemOperand(x8, 4)), "ldp w6, w7, [x8, #4]");
1456b8021494Sopenharmony_ci  COMPARE(ldp(x9, x10, MemOperand(x11, 8)), "ldp x9, x10, [x11, #8]");
1457b8021494Sopenharmony_ci  COMPARE(ldp(w12, w13, MemOperand(x14, 252)), "ldp w12, w13, [x14, #252]");
1458b8021494Sopenharmony_ci  COMPARE(ldp(x15, x16, MemOperand(x17, 504)), "ldp x15, x16, [x17, #504]");
1459b8021494Sopenharmony_ci  COMPARE(ldp(w18, w19, MemOperand(x20, -256)), "ldp w18, w19, [x20, #-256]");
1460b8021494Sopenharmony_ci  COMPARE(ldp(x21, x22, MemOperand(x23, -512)), "ldp x21, x22, [x23, #-512]");
1461b8021494Sopenharmony_ci  COMPARE(ldp(w24, w25, MemOperand(x26, 252, PreIndex)),
1462b8021494Sopenharmony_ci          "ldp w24, w25, [x26, #252]!");
1463b8021494Sopenharmony_ci  COMPARE(ldp(x27, x28, MemOperand(x29, 504, PreIndex)),
1464b8021494Sopenharmony_ci          "ldp x27, x28, [x29, #504]!");
1465b8021494Sopenharmony_ci  COMPARE(ldp(w30, w0, MemOperand(x1, -256, PreIndex)),
1466b8021494Sopenharmony_ci          "ldp w30, w0, [x1, #-256]!");
1467b8021494Sopenharmony_ci  COMPARE(ldp(x2, x3, MemOperand(x4, -512, PreIndex)),
1468b8021494Sopenharmony_ci          "ldp x2, x3, [x4, #-512]!");
1469b8021494Sopenharmony_ci  COMPARE(ldp(w5, w6, MemOperand(x7, 252, PostIndex)),
1470b8021494Sopenharmony_ci          "ldp w5, w6, [x7], #252");
1471b8021494Sopenharmony_ci  COMPARE(ldp(x8, x9, MemOperand(x10, 504, PostIndex)),
1472b8021494Sopenharmony_ci          "ldp x8, x9, [x10], #504");
1473b8021494Sopenharmony_ci  COMPARE(ldp(w11, w12, MemOperand(x13, -256, PostIndex)),
1474b8021494Sopenharmony_ci          "ldp w11, w12, [x13], #-256");
1475b8021494Sopenharmony_ci  COMPARE(ldp(x14, x15, MemOperand(x16, -512, PostIndex)),
1476b8021494Sopenharmony_ci          "ldp x14, x15, [x16], #-512");
1477b8021494Sopenharmony_ci  COMPARE(ldp(x0, x1, MemOperand(x2, 0, PostIndex)), "ldp x0, x1, [x2], #0");
1478b8021494Sopenharmony_ci  COMPARE(ldp(w3, w4, MemOperand(x5, 0, PreIndex)), "ldp w3, w4, [x5, #0]!");
1479b8021494Sopenharmony_ci
1480b8021494Sopenharmony_ci  COMPARE(ldp(s17, s18, MemOperand(x19)), "ldp s17, s18, [x19]");
1481b8021494Sopenharmony_ci  COMPARE(ldp(s20, s21, MemOperand(x22, 252)), "ldp s20, s21, [x22, #252]");
1482b8021494Sopenharmony_ci  COMPARE(ldp(s23, s24, MemOperand(x25, -256)), "ldp s23, s24, [x25, #-256]");
1483b8021494Sopenharmony_ci  COMPARE(ldp(s26, s27, MemOperand(x28, 252, PreIndex)),
1484b8021494Sopenharmony_ci          "ldp s26, s27, [x28, #252]!");
1485b8021494Sopenharmony_ci  COMPARE(ldp(s29, s30, MemOperand(x29, -256, PreIndex)),
1486b8021494Sopenharmony_ci          "ldp s29, s30, [x29, #-256]!");
1487b8021494Sopenharmony_ci  COMPARE(ldp(s31, s0, MemOperand(x1, 252, PostIndex)),
1488b8021494Sopenharmony_ci          "ldp s31, s0, [x1], #252");
1489b8021494Sopenharmony_ci  COMPARE(ldp(s2, s3, MemOperand(x4, -256, PostIndex)),
1490b8021494Sopenharmony_ci          "ldp s2, s3, [x4], #-256");
1491b8021494Sopenharmony_ci  COMPARE(ldp(d17, d18, MemOperand(x19)), "ldp d17, d18, [x19]");
1492b8021494Sopenharmony_ci  COMPARE(ldp(d20, d21, MemOperand(x22, 504)), "ldp d20, d21, [x22, #504]");
1493b8021494Sopenharmony_ci  COMPARE(ldp(d23, d24, MemOperand(x25, -512)), "ldp d23, d24, [x25, #-512]");
1494b8021494Sopenharmony_ci  COMPARE(ldp(d26, d27, MemOperand(x28, 504, PreIndex)),
1495b8021494Sopenharmony_ci          "ldp d26, d27, [x28, #504]!");
1496b8021494Sopenharmony_ci  COMPARE(ldp(d29, d30, MemOperand(x29, -512, PreIndex)),
1497b8021494Sopenharmony_ci          "ldp d29, d30, [x29, #-512]!");
1498b8021494Sopenharmony_ci  COMPARE(ldp(d31, d0, MemOperand(x1, 504, PostIndex)),
1499b8021494Sopenharmony_ci          "ldp d31, d0, [x1], #504");
1500b8021494Sopenharmony_ci  COMPARE(ldp(d2, d3, MemOperand(x4, -512, PostIndex)),
1501b8021494Sopenharmony_ci          "ldp d2, d3, [x4], #-512");
1502b8021494Sopenharmony_ci  COMPARE(ldp(s0, s1, MemOperand(x2, 0, PostIndex)), "ldp s0, s1, [x2], #0");
1503b8021494Sopenharmony_ci  COMPARE(ldp(d3, d4, MemOperand(x5, 0, PreIndex)), "ldp d3, d4, [x5, #0]!");
1504b8021494Sopenharmony_ci
1505b8021494Sopenharmony_ci  COMPARE(ldp(q5, q6, MemOperand(x7)), "ldp q5, q6, [x7]");
1506b8021494Sopenharmony_ci  COMPARE(ldp(q8, q9, MemOperand(x10, 1008)), "ldp q8, q9, [x10, #1008]");
1507b8021494Sopenharmony_ci  COMPARE(ldp(q11, q12, MemOperand(x13, -1024)), "ldp q11, q12, [x13, #-1024]");
1508b8021494Sopenharmony_ci  COMPARE(ldp(q14, q15, MemOperand(x16, 1008, PreIndex)),
1509b8021494Sopenharmony_ci          "ldp q14, q15, [x16, #1008]!");
1510b8021494Sopenharmony_ci  COMPARE(ldp(q17, q18, MemOperand(x19, -1024, PreIndex)),
1511b8021494Sopenharmony_ci          "ldp q17, q18, [x19, #-1024]!");
1512b8021494Sopenharmony_ci  COMPARE(ldp(q20, q21, MemOperand(x22, 1008, PostIndex)),
1513b8021494Sopenharmony_ci          "ldp q20, q21, [x22], #1008");
1514b8021494Sopenharmony_ci  COMPARE(ldp(q23, q24, MemOperand(x25, -1024, PostIndex)),
1515b8021494Sopenharmony_ci          "ldp q23, q24, [x25], #-1024");
1516b8021494Sopenharmony_ci  COMPARE(ldp(q6, q7, MemOperand(x8, 0, PreIndex)), "ldp q6, q7, [x8, #0]!");
1517b8021494Sopenharmony_ci
1518b8021494Sopenharmony_ci  COMPARE(stp(w0, w1, MemOperand(x2)), "stp w0, w1, [x2]");
1519b8021494Sopenharmony_ci  COMPARE(stp(x3, x4, MemOperand(x5)), "stp x3, x4, [x5]");
1520b8021494Sopenharmony_ci  COMPARE(stp(w6, w7, MemOperand(x8, 4)), "stp w6, w7, [x8, #4]");
1521b8021494Sopenharmony_ci  COMPARE(stp(x9, x10, MemOperand(x11, 8)), "stp x9, x10, [x11, #8]");
1522b8021494Sopenharmony_ci  COMPARE(stp(w12, w13, MemOperand(x14, 252)), "stp w12, w13, [x14, #252]");
1523b8021494Sopenharmony_ci  COMPARE(stp(x15, x16, MemOperand(x17, 504)), "stp x15, x16, [x17, #504]");
1524b8021494Sopenharmony_ci  COMPARE(stp(w18, w19, MemOperand(x20, -256)), "stp w18, w19, [x20, #-256]");
1525b8021494Sopenharmony_ci  COMPARE(stp(x21, x22, MemOperand(x23, -512)), "stp x21, x22, [x23, #-512]");
1526b8021494Sopenharmony_ci  COMPARE(stp(w24, w25, MemOperand(x26, 252, PreIndex)),
1527b8021494Sopenharmony_ci          "stp w24, w25, [x26, #252]!");
1528b8021494Sopenharmony_ci  COMPARE(stp(x27, x28, MemOperand(x29, 504, PreIndex)),
1529b8021494Sopenharmony_ci          "stp x27, x28, [x29, #504]!");
1530b8021494Sopenharmony_ci  COMPARE(stp(w30, w0, MemOperand(x1, -256, PreIndex)),
1531b8021494Sopenharmony_ci          "stp w30, w0, [x1, #-256]!");
1532b8021494Sopenharmony_ci  COMPARE(stp(x2, x3, MemOperand(x4, -512, PreIndex)),
1533b8021494Sopenharmony_ci          "stp x2, x3, [x4, #-512]!");
1534b8021494Sopenharmony_ci  COMPARE(stp(w5, w6, MemOperand(x7, 252, PostIndex)),
1535b8021494Sopenharmony_ci          "stp w5, w6, [x7], #252");
1536b8021494Sopenharmony_ci  COMPARE(stp(x8, x9, MemOperand(x10, 504, PostIndex)),
1537b8021494Sopenharmony_ci          "stp x8, x9, [x10], #504");
1538b8021494Sopenharmony_ci  COMPARE(stp(w11, w12, MemOperand(x13, -256, PostIndex)),
1539b8021494Sopenharmony_ci          "stp w11, w12, [x13], #-256");
1540b8021494Sopenharmony_ci  COMPARE(stp(x14, x15, MemOperand(x16, -512, PostIndex)),
1541b8021494Sopenharmony_ci          "stp x14, x15, [x16], #-512");
1542b8021494Sopenharmony_ci  COMPARE(stp(x0, x1, MemOperand(x2, 0, PostIndex)), "stp x0, x1, [x2], #0");
1543b8021494Sopenharmony_ci  COMPARE(stp(w3, w4, MemOperand(x5, 0, PreIndex)), "stp w3, w4, [x5, #0]!");
1544b8021494Sopenharmony_ci
1545b8021494Sopenharmony_ci  COMPARE(stp(s17, s18, MemOperand(x19)), "stp s17, s18, [x19]");
1546b8021494Sopenharmony_ci  COMPARE(stp(s20, s21, MemOperand(x22, 252)), "stp s20, s21, [x22, #252]");
1547b8021494Sopenharmony_ci  COMPARE(stp(s23, s24, MemOperand(x25, -256)), "stp s23, s24, [x25, #-256]");
1548b8021494Sopenharmony_ci  COMPARE(stp(s26, s27, MemOperand(x28, 252, PreIndex)),
1549b8021494Sopenharmony_ci          "stp s26, s27, [x28, #252]!");
1550b8021494Sopenharmony_ci  COMPARE(stp(s29, s30, MemOperand(x29, -256, PreIndex)),
1551b8021494Sopenharmony_ci          "stp s29, s30, [x29, #-256]!");
1552b8021494Sopenharmony_ci  COMPARE(stp(s31, s0, MemOperand(x1, 252, PostIndex)),
1553b8021494Sopenharmony_ci          "stp s31, s0, [x1], #252");
1554b8021494Sopenharmony_ci  COMPARE(stp(s2, s3, MemOperand(x4, -256, PostIndex)),
1555b8021494Sopenharmony_ci          "stp s2, s3, [x4], #-256");
1556b8021494Sopenharmony_ci  COMPARE(stp(d17, d18, MemOperand(x19)), "stp d17, d18, [x19]");
1557b8021494Sopenharmony_ci  COMPARE(stp(d20, d21, MemOperand(x22, 504)), "stp d20, d21, [x22, #504]");
1558b8021494Sopenharmony_ci  COMPARE(stp(d23, d24, MemOperand(x25, -512)), "stp d23, d24, [x25, #-512]");
1559b8021494Sopenharmony_ci  COMPARE(stp(d26, d27, MemOperand(x28, 504, PreIndex)),
1560b8021494Sopenharmony_ci          "stp d26, d27, [x28, #504]!");
1561b8021494Sopenharmony_ci  COMPARE(stp(d29, d30, MemOperand(x29, -512, PreIndex)),
1562b8021494Sopenharmony_ci          "stp d29, d30, [x29, #-512]!");
1563b8021494Sopenharmony_ci  COMPARE(stp(d31, d0, MemOperand(x1, 504, PostIndex)),
1564b8021494Sopenharmony_ci          "stp d31, d0, [x1], #504");
1565b8021494Sopenharmony_ci  COMPARE(stp(d2, d3, MemOperand(x4, -512, PostIndex)),
1566b8021494Sopenharmony_ci          "stp d2, d3, [x4], #-512");
1567b8021494Sopenharmony_ci  COMPARE(stp(s0, s1, MemOperand(x2, 0, PostIndex)), "stp s0, s1, [x2], #0");
1568b8021494Sopenharmony_ci  COMPARE(stp(d3, d4, MemOperand(x5, 0, PreIndex)), "stp d3, d4, [x5, #0]!");
1569b8021494Sopenharmony_ci
1570b8021494Sopenharmony_ci  COMPARE(stp(q5, q6, MemOperand(x7)), "stp q5, q6, [x7]");
1571b8021494Sopenharmony_ci  COMPARE(stp(q8, q9, MemOperand(x10, 1008)), "stp q8, q9, [x10, #1008]");
1572b8021494Sopenharmony_ci  COMPARE(stp(q11, q12, MemOperand(x13, -1024)), "stp q11, q12, [x13, #-1024]");
1573b8021494Sopenharmony_ci  COMPARE(stp(q14, q15, MemOperand(x16, 1008, PreIndex)),
1574b8021494Sopenharmony_ci          "stp q14, q15, [x16, #1008]!");
1575b8021494Sopenharmony_ci  COMPARE(stp(q17, q18, MemOperand(x19, -1024, PreIndex)),
1576b8021494Sopenharmony_ci          "stp q17, q18, [x19, #-1024]!");
1577b8021494Sopenharmony_ci  COMPARE(stp(q20, q21, MemOperand(x22, 1008, PostIndex)),
1578b8021494Sopenharmony_ci          "stp q20, q21, [x22], #1008");
1579b8021494Sopenharmony_ci  COMPARE(stp(q23, q24, MemOperand(x25, -1024, PostIndex)),
1580b8021494Sopenharmony_ci          "stp q23, q24, [x25], #-1024");
1581b8021494Sopenharmony_ci  COMPARE(stp(q6, q7, MemOperand(x8, 0, PreIndex)), "stp q6, q7, [x8, #0]!");
1582b8021494Sopenharmony_ci
1583b8021494Sopenharmony_ci  COMPARE(ldp(w16, w17, MemOperand(sp, 4, PostIndex)),
1584b8021494Sopenharmony_ci          "ldp w16, w17, [sp], #4");
1585b8021494Sopenharmony_ci  COMPARE(stp(x18, x19, MemOperand(sp, -8, PreIndex)),
1586b8021494Sopenharmony_ci          "stp x18, x19, [sp, #-8]!");
1587b8021494Sopenharmony_ci  COMPARE(ldp(s30, s31, MemOperand(sp, 12, PostIndex)),
1588b8021494Sopenharmony_ci          "ldp s30, s31, [sp], #12");
1589b8021494Sopenharmony_ci  COMPARE(stp(d30, d31, MemOperand(sp, -16)), "stp d30, d31, [sp, #-16]");
1590b8021494Sopenharmony_ci  COMPARE(ldp(q30, q31, MemOperand(sp, 32, PostIndex)),
1591b8021494Sopenharmony_ci          "ldp q30, q31, [sp], #32");
1592b8021494Sopenharmony_ci
1593b8021494Sopenharmony_ci  COMPARE(ldpsw(x0, x1, MemOperand(x2)), "ldpsw x0, x1, [x2]");
1594b8021494Sopenharmony_ci  COMPARE(ldpsw(x3, x4, MemOperand(x5, 16)), "ldpsw x3, x4, [x5, #16]");
1595b8021494Sopenharmony_ci  COMPARE(ldpsw(x6, x7, MemOperand(x8, -32, PreIndex)),
1596b8021494Sopenharmony_ci          "ldpsw x6, x7, [x8, #-32]!");
1597b8021494Sopenharmony_ci  COMPARE(ldpsw(x9, x10, MemOperand(x11, 128, PostIndex)),
1598b8021494Sopenharmony_ci          "ldpsw x9, x10, [x11], #128");
1599b8021494Sopenharmony_ci  COMPARE(ldpsw(x0, x1, MemOperand(x10, 0, PreIndex)),
1600b8021494Sopenharmony_ci          "ldpsw x0, x1, [x10, #0]!");
1601b8021494Sopenharmony_ci  COMPARE(ldpsw(x2, x3, MemOperand(x10, 0, PostIndex)),
1602b8021494Sopenharmony_ci          "ldpsw x2, x3, [x10], #0");
1603b8021494Sopenharmony_ci
1604b8021494Sopenharmony_ci  CLEANUP();
1605b8021494Sopenharmony_ci}
1606b8021494Sopenharmony_ci
1607b8021494Sopenharmony_ci
1608b8021494Sopenharmony_ciTEST(load_pauth) {
1609b8021494Sopenharmony_ci  SETUP();
1610b8021494Sopenharmony_ci
1611b8021494Sopenharmony_ci  COMPARE(ldraa(x0, MemOperand(x1)), "ldraa x0, [x1]");
1612b8021494Sopenharmony_ci  COMPARE(ldraa(x2, MemOperand(sp)), "ldraa x2, [sp]");
1613b8021494Sopenharmony_ci  COMPARE(ldraa(x3, MemOperand(x4, 64)), "ldraa x3, [x4, #64]");
1614b8021494Sopenharmony_ci  COMPARE(ldraa(x5, MemOperand(sp, 512)), "ldraa x5, [sp, #512]");
1615b8021494Sopenharmony_ci  COMPARE(ldraa(x6, MemOperand(x7, -256)), "ldraa x6, [x7, #-256]");
1616b8021494Sopenharmony_ci  COMPARE(ldraa(x8, MemOperand(sp, -1024)), "ldraa x8, [sp, #-1024]");
1617b8021494Sopenharmony_ci  COMPARE(ldraa(x9, MemOperand(x10, 2048, PreIndex)),
1618b8021494Sopenharmony_ci          "ldraa x9, [x10, #2048]!");
1619b8021494Sopenharmony_ci
1620b8021494Sopenharmony_ci  COMPARE(ldrab(x9, MemOperand(x10)), "ldrab x9, [x10]");
1621b8021494Sopenharmony_ci  COMPARE(ldrab(x11, MemOperand(sp)), "ldrab x11, [sp]");
1622b8021494Sopenharmony_ci  COMPARE(ldrab(x12, MemOperand(x13, 64)), "ldrab x12, [x13, #64]");
1623b8021494Sopenharmony_ci  COMPARE(ldrab(x14, MemOperand(sp, 512)), "ldrab x14, [sp, #512]");
1624b8021494Sopenharmony_ci  COMPARE(ldrab(x15, MemOperand(x16, -256)), "ldrab x15, [x16, #-256]");
1625b8021494Sopenharmony_ci  COMPARE(ldrab(x17, MemOperand(sp, -1024)), "ldrab x17, [sp, #-1024]");
1626b8021494Sopenharmony_ci  COMPARE(ldrab(x18, MemOperand(x19, 2048, PreIndex)),
1627b8021494Sopenharmony_ci          "ldrab x18, [x19, #2048]!");
1628b8021494Sopenharmony_ci
1629b8021494Sopenharmony_ci  CLEANUP();
1630b8021494Sopenharmony_ci}
1631b8021494Sopenharmony_ci
1632b8021494Sopenharmony_ci
1633b8021494Sopenharmony_ciTEST(load_store_exclusive) {
1634b8021494Sopenharmony_ci  SETUP();
1635b8021494Sopenharmony_ci
1636b8021494Sopenharmony_ci  COMPARE(stxrb(w0, w1, MemOperand(x2)), "stxrb w0, w1, [x2]");
1637b8021494Sopenharmony_ci  COMPARE(stxrb(x3, w4, MemOperand(sp)), "stxrb w3, w4, [sp]");
1638b8021494Sopenharmony_ci  COMPARE(stxrb(w5, x6, MemOperand(x7)), "stxrb w5, w6, [x7]");
1639b8021494Sopenharmony_ci  COMPARE(stxrb(x8, x9, MemOperand(sp)), "stxrb w8, w9, [sp]");
1640b8021494Sopenharmony_ci  COMPARE(stxrh(w10, w11, MemOperand(x12)), "stxrh w10, w11, [x12]");
1641b8021494Sopenharmony_ci  COMPARE(stxrh(x13, w14, MemOperand(sp)), "stxrh w13, w14, [sp]");
1642b8021494Sopenharmony_ci  COMPARE(stxrh(w15, x16, MemOperand(x17)), "stxrh w15, w16, [x17]");
1643b8021494Sopenharmony_ci  COMPARE(stxrh(x18, x19, MemOperand(sp)), "stxrh w18, w19, [sp]");
1644b8021494Sopenharmony_ci  COMPARE(stxr(w20, w21, MemOperand(x22)), "stxr w20, w21, [x22]");
1645b8021494Sopenharmony_ci  COMPARE(stxr(x23, w24, MemOperand(sp)), "stxr w23, w24, [sp]");
1646b8021494Sopenharmony_ci  COMPARE(stxr(w25, x26, MemOperand(x27)), "stxr w25, x26, [x27]");
1647b8021494Sopenharmony_ci  COMPARE(stxr(x28, x29, MemOperand(sp)), "stxr w28, x29, [sp]");
1648b8021494Sopenharmony_ci  COMPARE(ldxrb(w30, MemOperand(x0)), "ldxrb w30, [x0]");
1649b8021494Sopenharmony_ci  COMPARE(ldxrb(w1, MemOperand(sp)), "ldxrb w1, [sp]");
1650b8021494Sopenharmony_ci  COMPARE(ldxrb(x2, MemOperand(x3)), "ldxrb w2, [x3]");
1651b8021494Sopenharmony_ci  COMPARE(ldxrb(x4, MemOperand(sp)), "ldxrb w4, [sp]");
1652b8021494Sopenharmony_ci  COMPARE(ldxrh(w5, MemOperand(x6)), "ldxrh w5, [x6]");
1653b8021494Sopenharmony_ci  COMPARE(ldxrh(w7, MemOperand(sp)), "ldxrh w7, [sp]");
1654b8021494Sopenharmony_ci  COMPARE(ldxrh(x8, MemOperand(x9)), "ldxrh w8, [x9]");
1655b8021494Sopenharmony_ci  COMPARE(ldxrh(x10, MemOperand(sp)), "ldxrh w10, [sp]");
1656b8021494Sopenharmony_ci  COMPARE(ldxr(w11, MemOperand(x12)), "ldxr w11, [x12]");
1657b8021494Sopenharmony_ci  COMPARE(ldxr(w13, MemOperand(sp)), "ldxr w13, [sp]");
1658b8021494Sopenharmony_ci  COMPARE(ldxr(x14, MemOperand(x15)), "ldxr x14, [x15]");
1659b8021494Sopenharmony_ci  COMPARE(ldxr(x16, MemOperand(sp)), "ldxr x16, [sp]");
1660b8021494Sopenharmony_ci  COMPARE(stxp(w17, w18, w19, MemOperand(x20)), "stxp w17, w18, w19, [x20]");
1661b8021494Sopenharmony_ci  COMPARE(stxp(x21, w22, w23, MemOperand(sp)), "stxp w21, w22, w23, [sp]");
1662b8021494Sopenharmony_ci  COMPARE(stxp(w24, x25, x26, MemOperand(x27)), "stxp w24, x25, x26, [x27]");
1663b8021494Sopenharmony_ci  COMPARE(stxp(x28, x29, x30, MemOperand(sp)), "stxp w28, x29, x30, [sp]");
1664b8021494Sopenharmony_ci  COMPARE(ldxp(w0, w1, MemOperand(x2)), "ldxp w0, w1, [x2]");
1665b8021494Sopenharmony_ci  COMPARE(ldxp(w3, w4, MemOperand(sp)), "ldxp w3, w4, [sp]");
1666b8021494Sopenharmony_ci  COMPARE(ldxp(x5, x6, MemOperand(x7)), "ldxp x5, x6, [x7]");
1667b8021494Sopenharmony_ci  COMPARE(ldxp(x8, x9, MemOperand(sp)), "ldxp x8, x9, [sp]");
1668b8021494Sopenharmony_ci  COMPARE(stlxrb(w10, w11, MemOperand(x12)), "stlxrb w10, w11, [x12]");
1669b8021494Sopenharmony_ci  COMPARE(stlxrb(x13, w14, MemOperand(sp)), "stlxrb w13, w14, [sp]");
1670b8021494Sopenharmony_ci  COMPARE(stlxrb(w15, x16, MemOperand(x17)), "stlxrb w15, w16, [x17]");
1671b8021494Sopenharmony_ci  COMPARE(stlxrb(x18, x19, MemOperand(sp)), "stlxrb w18, w19, [sp]");
1672b8021494Sopenharmony_ci  COMPARE(stlxrh(w20, w21, MemOperand(x22)), "stlxrh w20, w21, [x22]");
1673b8021494Sopenharmony_ci  COMPARE(stlxrh(x23, w24, MemOperand(sp)), "stlxrh w23, w24, [sp]");
1674b8021494Sopenharmony_ci  COMPARE(stlxrh(w25, x26, MemOperand(x27)), "stlxrh w25, w26, [x27]");
1675b8021494Sopenharmony_ci  COMPARE(stlxrh(x28, x29, MemOperand(sp)), "stlxrh w28, w29, [sp]");
1676b8021494Sopenharmony_ci  COMPARE(stlxr(w30, w0, MemOperand(x1)), "stlxr w30, w0, [x1]");
1677b8021494Sopenharmony_ci  COMPARE(stlxr(x2, w3, MemOperand(sp)), "stlxr w2, w3, [sp]");
1678b8021494Sopenharmony_ci  COMPARE(stlxr(w4, x5, MemOperand(x6)), "stlxr w4, x5, [x6]");
1679b8021494Sopenharmony_ci  COMPARE(stlxr(x7, x8, MemOperand(sp)), "stlxr w7, x8, [sp]");
1680b8021494Sopenharmony_ci  COMPARE(ldaxrb(w9, MemOperand(x10)), "ldaxrb w9, [x10]");
1681b8021494Sopenharmony_ci  COMPARE(ldaxrb(w11, MemOperand(sp)), "ldaxrb w11, [sp]");
1682b8021494Sopenharmony_ci  COMPARE(ldaxrb(x12, MemOperand(x13)), "ldaxrb w12, [x13]");
1683b8021494Sopenharmony_ci  COMPARE(ldaxrb(x14, MemOperand(sp)), "ldaxrb w14, [sp]");
1684b8021494Sopenharmony_ci  COMPARE(ldaxrh(w15, MemOperand(x16)), "ldaxrh w15, [x16]");
1685b8021494Sopenharmony_ci  COMPARE(ldaxrh(w17, MemOperand(sp)), "ldaxrh w17, [sp]");
1686b8021494Sopenharmony_ci  COMPARE(ldaxrh(x18, MemOperand(x19)), "ldaxrh w18, [x19]");
1687b8021494Sopenharmony_ci  COMPARE(ldaxrh(x20, MemOperand(sp)), "ldaxrh w20, [sp]");
1688b8021494Sopenharmony_ci  COMPARE(ldaxr(w21, MemOperand(x22)), "ldaxr w21, [x22]");
1689b8021494Sopenharmony_ci  COMPARE(ldaxr(w23, MemOperand(sp)), "ldaxr w23, [sp]");
1690b8021494Sopenharmony_ci  COMPARE(ldaxr(x24, MemOperand(x25)), "ldaxr x24, [x25]");
1691b8021494Sopenharmony_ci  COMPARE(ldaxr(x26, MemOperand(sp)), "ldaxr x26, [sp]");
1692b8021494Sopenharmony_ci  COMPARE(stlxp(w27, w28, w29, MemOperand(x30)), "stlxp w27, w28, w29, [x30]");
1693b8021494Sopenharmony_ci  COMPARE(stlxp(x0, w1, w2, MemOperand(sp)), "stlxp w0, w1, w2, [sp]");
1694b8021494Sopenharmony_ci  COMPARE(stlxp(w3, x4, x5, MemOperand(x6)), "stlxp w3, x4, x5, [x6]");
1695b8021494Sopenharmony_ci  COMPARE(stlxp(x7, x8, x9, MemOperand(sp)), "stlxp w7, x8, x9, [sp]");
1696b8021494Sopenharmony_ci  COMPARE(ldaxp(w10, w11, MemOperand(x12)), "ldaxp w10, w11, [x12]");
1697b8021494Sopenharmony_ci  COMPARE(ldaxp(w13, w14, MemOperand(sp)), "ldaxp w13, w14, [sp]");
1698b8021494Sopenharmony_ci  COMPARE(ldaxp(x15, x16, MemOperand(x17)), "ldaxp x15, x16, [x17]");
1699b8021494Sopenharmony_ci  COMPARE(ldaxp(x18, x19, MemOperand(sp)), "ldaxp x18, x19, [sp]");
1700b8021494Sopenharmony_ci  COMPARE(stlrb(w20, MemOperand(x21)), "stlrb w20, [x21]");
1701b8021494Sopenharmony_ci  COMPARE(stlrb(w22, MemOperand(sp)), "stlrb w22, [sp]");
1702b8021494Sopenharmony_ci  COMPARE(stlrb(x23, MemOperand(x24)), "stlrb w23, [x24]");
1703b8021494Sopenharmony_ci  COMPARE(stlrb(x25, MemOperand(sp)), "stlrb w25, [sp]");
1704b8021494Sopenharmony_ci  COMPARE(stlrh(w26, MemOperand(x27)), "stlrh w26, [x27]");
1705b8021494Sopenharmony_ci  COMPARE(stlrh(w28, MemOperand(sp)), "stlrh w28, [sp]");
1706b8021494Sopenharmony_ci  COMPARE(stlrh(x29, MemOperand(x30)), "stlrh w29, [x30]");
1707b8021494Sopenharmony_ci  COMPARE(stlrh(x0, MemOperand(sp)), "stlrh w0, [sp]");
1708b8021494Sopenharmony_ci  COMPARE(stlr(w1, MemOperand(x2)), "stlr w1, [x2]");
1709b8021494Sopenharmony_ci  COMPARE(stlr(w3, MemOperand(sp)), "stlr w3, [sp]");
1710b8021494Sopenharmony_ci  COMPARE(stlr(x4, MemOperand(x5)), "stlr x4, [x5]");
1711b8021494Sopenharmony_ci  COMPARE(stlr(x6, MemOperand(sp)), "stlr x6, [sp]");
1712b8021494Sopenharmony_ci  COMPARE(stllrb(w7, MemOperand(x8)), "stllrb w7, [x8]");
1713b8021494Sopenharmony_ci  COMPARE(stllrb(w9, MemOperand(sp)), "stllrb w9, [sp]");
1714b8021494Sopenharmony_ci  COMPARE(stllrb(x10, MemOperand(x11)), "stllrb w10, [x11]");
1715b8021494Sopenharmony_ci  COMPARE(stllrb(x12, MemOperand(sp)), "stllrb w12, [sp]");
1716b8021494Sopenharmony_ci  COMPARE(stllrh(w13, MemOperand(x14)), "stllrh w13, [x14]");
1717b8021494Sopenharmony_ci  COMPARE(stllrh(w15, MemOperand(sp)), "stllrh w15, [sp]");
1718b8021494Sopenharmony_ci  COMPARE(stllrh(x16, MemOperand(x17)), "stllrh w16, [x17]");
1719b8021494Sopenharmony_ci  COMPARE(stllrh(x18, MemOperand(sp)), "stllrh w18, [sp]");
1720b8021494Sopenharmony_ci  COMPARE(stllr(w19, MemOperand(x20)), "stllr w19, [x20]");
1721b8021494Sopenharmony_ci  COMPARE(stllr(w21, MemOperand(sp)), "stllr w21, [sp]");
1722b8021494Sopenharmony_ci  COMPARE(stllr(x22, MemOperand(x23)), "stllr x22, [x23]");
1723b8021494Sopenharmony_ci  COMPARE(stllr(x24, MemOperand(sp)), "stllr x24, [sp]");
1724b8021494Sopenharmony_ci  COMPARE(ldarb(w25, MemOperand(x26)), "ldarb w25, [x26]");
1725b8021494Sopenharmony_ci  COMPARE(ldarb(w27, MemOperand(sp)), "ldarb w27, [sp]");
1726b8021494Sopenharmony_ci  COMPARE(ldarb(x28, MemOperand(x29)), "ldarb w28, [x29]");
1727b8021494Sopenharmony_ci  COMPARE(ldarb(x30, MemOperand(sp)), "ldarb w30, [sp]");
1728b8021494Sopenharmony_ci  COMPARE(ldarh(w0, MemOperand(x1)), "ldarh w0, [x1]");
1729b8021494Sopenharmony_ci  COMPARE(ldarh(w2, MemOperand(sp)), "ldarh w2, [sp]");
1730b8021494Sopenharmony_ci  COMPARE(ldarh(x3, MemOperand(x4)), "ldarh w3, [x4]");
1731b8021494Sopenharmony_ci  COMPARE(ldarh(x5, MemOperand(sp)), "ldarh w5, [sp]");
1732b8021494Sopenharmony_ci  COMPARE(ldar(w6, MemOperand(x7)), "ldar w6, [x7]");
1733b8021494Sopenharmony_ci  COMPARE(ldar(w8, MemOperand(sp)), "ldar w8, [sp]");
1734b8021494Sopenharmony_ci  COMPARE(ldar(x9, MemOperand(x10)), "ldar x9, [x10]");
1735b8021494Sopenharmony_ci  COMPARE(ldar(x11, MemOperand(sp)), "ldar x11, [sp]");
1736b8021494Sopenharmony_ci  COMPARE(ldlarb(w12, MemOperand(x13)), "ldlarb w12, [x13]");
1737b8021494Sopenharmony_ci  COMPARE(ldlarb(w14, MemOperand(sp)), "ldlarb w14, [sp]");
1738b8021494Sopenharmony_ci  COMPARE(ldlarb(x15, MemOperand(x16)), "ldlarb w15, [x16]");
1739b8021494Sopenharmony_ci  COMPARE(ldlarb(x17, MemOperand(sp)), "ldlarb w17, [sp]");
1740b8021494Sopenharmony_ci  COMPARE(ldlarh(w18, MemOperand(x19)), "ldlarh w18, [x19]");
1741b8021494Sopenharmony_ci  COMPARE(ldlarh(w20, MemOperand(sp)), "ldlarh w20, [sp]");
1742b8021494Sopenharmony_ci  COMPARE(ldlarh(x21, MemOperand(x22)), "ldlarh w21, [x22]");
1743b8021494Sopenharmony_ci  COMPARE(ldlarh(x23, MemOperand(sp)), "ldlarh w23, [sp]");
1744b8021494Sopenharmony_ci  COMPARE(ldlar(w24, MemOperand(x25)), "ldlar w24, [x25]");
1745b8021494Sopenharmony_ci  COMPARE(ldlar(w26, MemOperand(sp)), "ldlar w26, [sp]");
1746b8021494Sopenharmony_ci  COMPARE(ldlar(x27, MemOperand(x28)), "ldlar x27, [x28]");
1747b8021494Sopenharmony_ci  COMPARE(ldlar(x29, MemOperand(sp)), "ldlar x29, [sp]");
1748b8021494Sopenharmony_ci
1749b8021494Sopenharmony_ci  COMPARE(cas(w30, w0, MemOperand(x1)), "cas w30, w0, [x1]");
1750b8021494Sopenharmony_ci  COMPARE(cas(w2, w3, MemOperand(sp)), "cas w2, w3, [sp]");
1751b8021494Sopenharmony_ci  COMPARE(cas(x4, x5, MemOperand(x6)), "cas x4, x5, [x6]");
1752b8021494Sopenharmony_ci  COMPARE(cas(x7, x8, MemOperand(sp)), "cas x7, x8, [sp]");
1753b8021494Sopenharmony_ci  COMPARE(casa(w9, w10, MemOperand(x11)), "casa w9, w10, [x11]");
1754b8021494Sopenharmony_ci  COMPARE(casa(w12, w13, MemOperand(sp)), "casa w12, w13, [sp]");
1755b8021494Sopenharmony_ci  COMPARE(casa(x14, x15, MemOperand(x16)), "casa x14, x15, [x16]");
1756b8021494Sopenharmony_ci  COMPARE(casa(x17, x18, MemOperand(sp)), "casa x17, x18, [sp]");
1757b8021494Sopenharmony_ci  COMPARE(casl(w19, w20, MemOperand(x21)), "casl w19, w20, [x21]");
1758b8021494Sopenharmony_ci  COMPARE(casl(w22, w23, MemOperand(sp)), "casl w22, w23, [sp]");
1759b8021494Sopenharmony_ci  COMPARE(casl(x24, x25, MemOperand(x26)), "casl x24, x25, [x26]");
1760b8021494Sopenharmony_ci  COMPARE(casl(x27, x28, MemOperand(sp)), "casl x27, x28, [sp]");
1761b8021494Sopenharmony_ci  COMPARE(casal(w29, w30, MemOperand(x0)), "casal w29, w30, [x0]");
1762b8021494Sopenharmony_ci  COMPARE(casal(w1, w2, MemOperand(sp)), "casal w1, w2, [sp]");
1763b8021494Sopenharmony_ci  COMPARE(casal(x3, x4, MemOperand(x5)), "casal x3, x4, [x5]");
1764b8021494Sopenharmony_ci  COMPARE(casal(x6, x7, MemOperand(sp)), "casal x6, x7, [sp]");
1765b8021494Sopenharmony_ci  COMPARE(casb(w8, w9, MemOperand(x10)), "casb w8, w9, [x10]");
1766b8021494Sopenharmony_ci  COMPARE(casb(w11, w12, MemOperand(sp)), "casb w11, w12, [sp]");
1767b8021494Sopenharmony_ci  COMPARE(casab(w13, w14, MemOperand(x15)), "casab w13, w14, [x15]");
1768b8021494Sopenharmony_ci  COMPARE(casab(w16, w17, MemOperand(sp)), "casab w16, w17, [sp]");
1769b8021494Sopenharmony_ci  COMPARE(caslb(w18, w19, MemOperand(x20)), "caslb w18, w19, [x20]");
1770b8021494Sopenharmony_ci  COMPARE(caslb(w21, w22, MemOperand(sp)), "caslb w21, w22, [sp]");
1771b8021494Sopenharmony_ci  COMPARE(casalb(w23, w24, MemOperand(x25)), "casalb w23, w24, [x25]");
1772b8021494Sopenharmony_ci  COMPARE(casalb(w26, w27, MemOperand(sp)), "casalb w26, w27, [sp]");
1773b8021494Sopenharmony_ci  COMPARE(cash(w28, w29, MemOperand(x30)), "cash w28, w29, [x30]");
1774b8021494Sopenharmony_ci  COMPARE(cash(w0, w1, MemOperand(sp)), "cash w0, w1, [sp]");
1775b8021494Sopenharmony_ci  COMPARE(casah(w2, w3, MemOperand(x4)), "casah w2, w3, [x4]");
1776b8021494Sopenharmony_ci  COMPARE(casah(w5, w6, MemOperand(sp)), "casah w5, w6, [sp]");
1777b8021494Sopenharmony_ci  COMPARE(caslh(w7, w8, MemOperand(x9)), "caslh w7, w8, [x9]");
1778b8021494Sopenharmony_ci  COMPARE(caslh(w10, w11, MemOperand(sp)), "caslh w10, w11, [sp]");
1779b8021494Sopenharmony_ci  COMPARE(casalh(w12, w13, MemOperand(x14)), "casalh w12, w13, [x14]");
1780b8021494Sopenharmony_ci  COMPARE(casalh(w15, w16, MemOperand(sp)), "casalh w15, w16, [sp]");
1781b8021494Sopenharmony_ci  COMPARE(casp(w18, w19, w20, w21, MemOperand(x22)),
1782b8021494Sopenharmony_ci          "casp w18, w19, w20, w21, [x22]");
1783b8021494Sopenharmony_ci  COMPARE(casp(w24, w25, w26, w27, MemOperand(sp)),
1784b8021494Sopenharmony_ci          "casp w24, w25, w26, w27, [sp]");
1785b8021494Sopenharmony_ci  COMPARE(casp(x28, x29, x0, x1, MemOperand(x2)),
1786b8021494Sopenharmony_ci          "casp x28, x29, x0, x1, [x2]");
1787b8021494Sopenharmony_ci  COMPARE(casp(x4, x5, x6, x7, MemOperand(sp)), "casp x4, x5, x6, x7, [sp]");
1788b8021494Sopenharmony_ci  COMPARE(caspa(w8, w9, w10, w11, MemOperand(x12)),
1789b8021494Sopenharmony_ci          "caspa w8, w9, w10, w11, [x12]");
1790b8021494Sopenharmony_ci  COMPARE(caspa(w14, w15, w16, w17, MemOperand(sp)),
1791b8021494Sopenharmony_ci          "caspa w14, w15, w16, w17, [sp]");
1792b8021494Sopenharmony_ci  COMPARE(caspa(x18, x19, x20, x21, MemOperand(x22)),
1793b8021494Sopenharmony_ci          "caspa x18, x19, x20, x21, [x22]");
1794b8021494Sopenharmony_ci  COMPARE(caspa(x24, x25, x26, x27, MemOperand(sp)),
1795b8021494Sopenharmony_ci          "caspa x24, x25, x26, x27, [sp]");
1796b8021494Sopenharmony_ci  COMPARE(caspl(w28, w29, w0, w1, MemOperand(x2)),
1797b8021494Sopenharmony_ci          "caspl w28, w29, w0, w1, [x2]");
1798b8021494Sopenharmony_ci  COMPARE(caspl(w4, w5, w6, w7, MemOperand(sp)), "caspl w4, w5, w6, w7, [sp]");
1799b8021494Sopenharmony_ci  COMPARE(caspl(x8, x9, x10, x11, MemOperand(x12)),
1800b8021494Sopenharmony_ci          "caspl x8, x9, x10, x11, [x12]");
1801b8021494Sopenharmony_ci  COMPARE(caspl(x14, x15, x16, x17, MemOperand(sp)),
1802b8021494Sopenharmony_ci          "caspl x14, x15, x16, x17, [sp]");
1803b8021494Sopenharmony_ci  COMPARE(caspal(w18, w19, w20, w21, MemOperand(x22)),
1804b8021494Sopenharmony_ci          "caspal w18, w19, w20, w21, [x22]");
1805b8021494Sopenharmony_ci  COMPARE(caspal(w24, w25, w26, w27, MemOperand(sp)),
1806b8021494Sopenharmony_ci          "caspal w24, w25, w26, w27, [sp]");
1807b8021494Sopenharmony_ci  COMPARE(caspal(x28, x29, x0, x1, MemOperand(x2)),
1808b8021494Sopenharmony_ci          "caspal x28, x29, x0, x1, [x2]");
1809b8021494Sopenharmony_ci  COMPARE(caspal(x4, x5, x6, x7, MemOperand(sp)),
1810b8021494Sopenharmony_ci          "caspal x4, x5, x6, x7, [sp]");
1811b8021494Sopenharmony_ci
1812b8021494Sopenharmony_ci
1813b8021494Sopenharmony_ci  CLEANUP();
1814b8021494Sopenharmony_ci}
1815b8021494Sopenharmony_ci
1816b8021494Sopenharmony_ci// clang-format off
1817b8021494Sopenharmony_ci#define ATOMIC_MEMORY_DISASM_LIST(V, DEF) \
1818b8021494Sopenharmony_ci  V(DEF, add,  "add")                     \
1819b8021494Sopenharmony_ci  V(DEF, clr,  "clr")                     \
1820b8021494Sopenharmony_ci  V(DEF, eor,  "eor")                     \
1821b8021494Sopenharmony_ci  V(DEF, set,  "set")                     \
1822b8021494Sopenharmony_ci  V(DEF, smax, "smax")                    \
1823b8021494Sopenharmony_ci  V(DEF, smin, "smin")                    \
1824b8021494Sopenharmony_ci  V(DEF, umax, "umax")                    \
1825b8021494Sopenharmony_ci  V(DEF, umin, "umin")
1826b8021494Sopenharmony_ci
1827b8021494Sopenharmony_ci#define ATOMIC_MEMORY_DISASM_STORE_X_MODES(V, NAME, STR) \
1828b8021494Sopenharmony_ci  V(NAME,    STR)                                        \
1829b8021494Sopenharmony_ci  V(NAME##l, STR "l")
1830b8021494Sopenharmony_ci
1831b8021494Sopenharmony_ci
1832b8021494Sopenharmony_ci#define ATOMIC_MEMORY_DISASM_STORE_W_MODES(V, NAME, STR) \
1833b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_STORE_X_MODES(V, NAME, STR)       \
1834b8021494Sopenharmony_ci  V(NAME##b,  STR "b")                                   \
1835b8021494Sopenharmony_ci  V(NAME##lb, STR "lb")                                  \
1836b8021494Sopenharmony_ci  V(NAME##h,  STR "h")                                   \
1837b8021494Sopenharmony_ci  V(NAME##lh, STR "lh")
1838b8021494Sopenharmony_ci
1839b8021494Sopenharmony_ci#define ATOMIC_MEMORY_DISASM_LOAD_X_MODES(V, NAME, STR) \
1840b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_STORE_X_MODES(V, NAME, STR)      \
1841b8021494Sopenharmony_ci  V(NAME##a,  STR "a")                                  \
1842b8021494Sopenharmony_ci  V(NAME##al, STR "al")
1843b8021494Sopenharmony_ci
1844b8021494Sopenharmony_ci#define ATOMIC_MEMORY_DISASM_LOAD_W_MODES(V, NAME, STR) \
1845b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LOAD_X_MODES(V, NAME, STR)       \
1846b8021494Sopenharmony_ci  V(NAME##ab,  STR "ab")                                \
1847b8021494Sopenharmony_ci  V(NAME##alb, STR "alb")                               \
1848b8021494Sopenharmony_ci  V(NAME##ah,  STR "ah")                                \
1849b8021494Sopenharmony_ci  V(NAME##alh, STR "alh")
1850b8021494Sopenharmony_ci// clang-format on
1851b8021494Sopenharmony_ci
1852b8021494Sopenharmony_ciTEST(atomic_memory) {
1853b8021494Sopenharmony_ci  SETUP();
1854b8021494Sopenharmony_ci
1855b8021494Sopenharmony_ci  // These macros generate tests for all the variations of the atomic memory
1856b8021494Sopenharmony_ci  // operations, e.g. ldadd, ldadda, ldaddb, staddl, etc.
1857b8021494Sopenharmony_ci
1858b8021494Sopenharmony_ci#define AM_LOAD_X_TESTS(N, MN)                                     \
1859b8021494Sopenharmony_ci  COMPARE(ld##N(x0, x1, MemOperand(x2)), "ld" MN " x0, x1, [x2]"); \
1860b8021494Sopenharmony_ci  COMPARE(ld##N(x3, x4, MemOperand(sp)), "ld" MN " x3, x4, [sp]");
1861b8021494Sopenharmony_ci#define AM_LOAD_W_TESTS(N, MN)                                     \
1862b8021494Sopenharmony_ci  COMPARE(ld##N(w0, w1, MemOperand(x2)), "ld" MN " w0, w1, [x2]"); \
1863b8021494Sopenharmony_ci  COMPARE(ld##N(w3, w4, MemOperand(sp)), "ld" MN " w3, w4, [sp]");
1864b8021494Sopenharmony_ci#define AM_STORE_X_TESTS(N, MN)                            \
1865b8021494Sopenharmony_ci  COMPARE(st##N(x0, MemOperand(x1)), "st" MN " x0, [x1]"); \
1866b8021494Sopenharmony_ci  COMPARE(st##N(x2, MemOperand(sp)), "st" MN " x2, [sp]");
1867b8021494Sopenharmony_ci#define AM_STORE_W_TESTS(N, MN)                            \
1868b8021494Sopenharmony_ci  COMPARE(st##N(w0, MemOperand(x1)), "st" MN " w0, [x1]"); \
1869b8021494Sopenharmony_ci  COMPARE(st##N(w2, MemOperand(sp)), "st" MN " w2, [sp]");
1870b8021494Sopenharmony_ci
1871b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LIST(ATOMIC_MEMORY_DISASM_LOAD_X_MODES, AM_LOAD_X_TESTS)
1872b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LIST(ATOMIC_MEMORY_DISASM_LOAD_W_MODES, AM_LOAD_W_TESTS)
1873b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LIST(ATOMIC_MEMORY_DISASM_STORE_X_MODES,
1874b8021494Sopenharmony_ci                            AM_STORE_X_TESTS)
1875b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LIST(ATOMIC_MEMORY_DISASM_STORE_W_MODES,
1876b8021494Sopenharmony_ci                            AM_STORE_W_TESTS)
1877b8021494Sopenharmony_ci
1878b8021494Sopenharmony_ci#define AM_SWP_X_TESTS(N, MN)                             \
1879b8021494Sopenharmony_ci  COMPARE(N(x0, x1, MemOperand(x2)), MN " x0, x1, [x2]"); \
1880b8021494Sopenharmony_ci  COMPARE(N(x3, x4, MemOperand(sp)), MN " x3, x4, [sp]");
1881b8021494Sopenharmony_ci#define AM_SWP_W_TESTS(N, MN)                             \
1882b8021494Sopenharmony_ci  COMPARE(N(w0, w1, MemOperand(x2)), MN " w0, w1, [x2]"); \
1883b8021494Sopenharmony_ci  COMPARE(N(w3, w4, MemOperand(sp)), MN " w3, w4, [sp]");
1884b8021494Sopenharmony_ci
1885b8021494Sopenharmony_ci
1886b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LOAD_X_MODES(AM_SWP_X_TESTS, swp, "swp")
1887b8021494Sopenharmony_ci  ATOMIC_MEMORY_DISASM_LOAD_W_MODES(AM_SWP_W_TESTS, swp, "swp")
1888b8021494Sopenharmony_ci
1889b8021494Sopenharmony_ci#undef AM_LOAD_X_TESTS
1890b8021494Sopenharmony_ci#undef AM_LOAD_W_TESTS
1891b8021494Sopenharmony_ci#undef AM_STORE_X_TESTS
1892b8021494Sopenharmony_ci#undef AM_STORE_W_TESTS
1893b8021494Sopenharmony_ci#undef AM_SWP_X_TESTS
1894b8021494Sopenharmony_ci#undef AM_SWP_W_TESTS
1895b8021494Sopenharmony_ci
1896b8021494Sopenharmony_ci  COMPARE(ldaprb(w0, MemOperand(x1)), "ldaprb w0, [x1]");
1897b8021494Sopenharmony_ci  COMPARE(ldaprb(w2, MemOperand(sp)), "ldaprb w2, [sp]");
1898b8021494Sopenharmony_ci  COMPARE(ldaprh(w3, MemOperand(x4)), "ldaprh w3, [x4]");
1899b8021494Sopenharmony_ci  COMPARE(ldaprh(w5, MemOperand(sp)), "ldaprh w5, [sp]");
1900b8021494Sopenharmony_ci  COMPARE(ldapr(w6, MemOperand(x7)), "ldapr w6, [x7]");
1901b8021494Sopenharmony_ci  COMPARE(ldapr(w8, MemOperand(sp)), "ldapr w8, [sp]");
1902b8021494Sopenharmony_ci  COMPARE(ldapr(x9, MemOperand(x10)), "ldapr x9, [x10]");
1903b8021494Sopenharmony_ci  COMPARE(ldapr(x11, MemOperand(sp)), "ldapr x11, [sp]");
1904b8021494Sopenharmony_ci
1905b8021494Sopenharmony_ci  CLEANUP();
1906b8021494Sopenharmony_ci}
1907b8021494Sopenharmony_ci
1908b8021494Sopenharmony_ciTEST(load_store_rcpc_unscaled_offset) {
1909b8021494Sopenharmony_ci  SETUP();
1910b8021494Sopenharmony_ci
1911b8021494Sopenharmony_ci  COMPARE(ldapurb(w0, MemOperand(x1)), "ldapurb w0, [x1]");
1912b8021494Sopenharmony_ci  COMPARE(ldapurb(w2, MemOperand(x3, 13)), "ldapurb w2, [x3, #13]");
1913b8021494Sopenharmony_ci  COMPARE(ldapursb(w4, MemOperand(x5, 129)), "ldapursb w4, [x5, #129]");
1914b8021494Sopenharmony_ci  COMPARE(ldapursb(x6, MemOperand(sp, 64)), "ldapursb x6, [sp, #64]");
1915b8021494Sopenharmony_ci  COMPARE(ldapurh(w7, MemOperand(x8)), "ldapurh w7, [x8]");
1916b8021494Sopenharmony_ci  COMPARE(ldapurh(w9, MemOperand(x10, 13)), "ldapurh w9, [x10, #13]");
1917b8021494Sopenharmony_ci  COMPARE(ldapursh(w11, MemOperand(x12, 129)), "ldapursh w11, [x12, #129]");
1918b8021494Sopenharmony_ci  COMPARE(ldapursh(x13, MemOperand(sp, 64)), "ldapursh x13, [sp, #64]");
1919b8021494Sopenharmony_ci  COMPARE(ldapur(w14, MemOperand(x15)), "ldapur w14, [x15]");
1920b8021494Sopenharmony_ci  COMPARE(ldapur(w16, MemOperand(x17, 13)), "ldapur w16, [x17, #13]");
1921b8021494Sopenharmony_ci  COMPARE(ldapursw(x18, MemOperand(sp, 64)), "ldapursw x18, [sp, #64]");
1922b8021494Sopenharmony_ci  COMPARE(ldapur(x19, MemOperand(x20)), "ldapur x19, [x20]");
1923b8021494Sopenharmony_ci  COMPARE(ldapur(x21, MemOperand(sp, 64)), "ldapur x21, [sp, #64]");
1924b8021494Sopenharmony_ci
1925b8021494Sopenharmony_ci  COMPARE(stlurb(w22, MemOperand(x23)), "stlurb w22, [x23]");
1926b8021494Sopenharmony_ci  COMPARE(stlurb(w24, MemOperand(sp, 64)), "stlurb w24, [sp, #64]");
1927b8021494Sopenharmony_ci  COMPARE(stlurh(w25, MemOperand(x26)), "stlurh w25, [x26]");
1928b8021494Sopenharmony_ci  COMPARE(stlurh(w27, MemOperand(sp, 64)), "stlurh w27, [sp, #64]");
1929b8021494Sopenharmony_ci  COMPARE(stlur(w28, MemOperand(x29)), "stlur w28, [x29]");
1930b8021494Sopenharmony_ci  COMPARE(stlur(w0, MemOperand(sp, 64)), "stlur w0, [sp, #64]");
1931b8021494Sopenharmony_ci  COMPARE(stlur(x1, MemOperand(x2)), "stlur x1, [x2]");
1932b8021494Sopenharmony_ci  COMPARE(stlur(x3, MemOperand(sp, 64)), "stlur x3, [sp, #64]");
1933b8021494Sopenharmony_ci
1934b8021494Sopenharmony_ci
1935b8021494Sopenharmony_ci  COMPARE_MACRO(Ldaprb(w0, MemOperand(x1)), "ldaprb w0, [x1]");
1936b8021494Sopenharmony_ci  COMPARE_MACRO(Ldaprb(w2, MemOperand(x3, 13)), "ldapurb w2, [x3, #13]");
1937b8021494Sopenharmony_ci  COMPARE_MACRO(Ldaprh(w4, MemOperand(x5)), "ldaprh w4, [x5]");
1938b8021494Sopenharmony_ci  COMPARE_MACRO(Ldaprh(w6, MemOperand(x7, 13)), "ldapurh w6, [x7, #13]");
1939b8021494Sopenharmony_ci  COMPARE_MACRO(Ldapr(w8, MemOperand(x9)), "ldapr w8, [x9]");
1940b8021494Sopenharmony_ci  COMPARE_MACRO(Ldapr(w10, MemOperand(x11, 13)), "ldapur w10, [x11, #13]");
1941b8021494Sopenharmony_ci  COMPARE_MACRO(Ldapr(x12, MemOperand(x13)), "ldapr x12, [x13]");
1942b8021494Sopenharmony_ci  COMPARE_MACRO(Ldapr(x14, MemOperand(sp, 64)), "ldapur x14, [sp, #64]");
1943b8021494Sopenharmony_ci
1944b8021494Sopenharmony_ci  COMPARE_MACRO(Stlrb(w15, MemOperand(x16)), "stlrb w15, [x16]");
1945b8021494Sopenharmony_ci  COMPARE_MACRO(Stlrb(w17, MemOperand(sp, 64)), "stlurb w17, [sp, #64]");
1946b8021494Sopenharmony_ci  COMPARE_MACRO(Stlrh(w18, MemOperand(x19)), "stlrh w18, [x19]");
1947b8021494Sopenharmony_ci  COMPARE_MACRO(Stlrh(w20, MemOperand(sp, 64)), "stlurh w20, [sp, #64]");
1948b8021494Sopenharmony_ci  COMPARE_MACRO(Stlr(w21, MemOperand(x22)), "stlr w21, [x22]");
1949b8021494Sopenharmony_ci  COMPARE_MACRO(Stlr(w23, MemOperand(sp, 64)), "stlur w23, [sp, #64]");
1950b8021494Sopenharmony_ci  COMPARE_MACRO(Stlr(x24, MemOperand(x25)), "stlr x24, [x25]");
1951b8021494Sopenharmony_ci  COMPARE_MACRO(Stlr(x26, MemOperand(sp, 64)), "stlur x26, [sp, #64]");
1952b8021494Sopenharmony_ci
1953b8021494Sopenharmony_ci  CLEANUP();
1954b8021494Sopenharmony_ci}
1955b8021494Sopenharmony_ci
1956b8021494Sopenharmony_ci
1957b8021494Sopenharmony_ciTEST(load_store_pair_nontemp) {
1958b8021494Sopenharmony_ci  SETUP();
1959b8021494Sopenharmony_ci
1960b8021494Sopenharmony_ci  COMPARE(ldnp(w0, w1, MemOperand(x2)), "ldnp w0, w1, [x2]");
1961b8021494Sopenharmony_ci  COMPARE(stnp(w3, w4, MemOperand(x5, 252)), "stnp w3, w4, [x5, #252]");
1962b8021494Sopenharmony_ci  COMPARE(ldnp(w6, w7, MemOperand(x8, -256)), "ldnp w6, w7, [x8, #-256]");
1963b8021494Sopenharmony_ci  COMPARE(stnp(x9, x10, MemOperand(x11)), "stnp x9, x10, [x11]");
1964b8021494Sopenharmony_ci  COMPARE(ldnp(x12, x13, MemOperand(x14, 504)), "ldnp x12, x13, [x14, #504]");
1965b8021494Sopenharmony_ci  COMPARE(stnp(x15, x16, MemOperand(x17, -512)), "stnp x15, x16, [x17, #-512]");
1966b8021494Sopenharmony_ci  COMPARE(ldnp(s18, s19, MemOperand(x20)), "ldnp s18, s19, [x20]");
1967b8021494Sopenharmony_ci  COMPARE(stnp(s21, s22, MemOperand(x23, 252)), "stnp s21, s22, [x23, #252]");
1968b8021494Sopenharmony_ci  COMPARE(ldnp(s24, s25, MemOperand(x26, -256)), "ldnp s24, s25, [x26, #-256]");
1969b8021494Sopenharmony_ci  COMPARE(stnp(d27, d28, MemOperand(x29)), "stnp d27, d28, [x29]");
1970b8021494Sopenharmony_ci  COMPARE(ldnp(d30, d31, MemOperand(x0, 504)), "ldnp d30, d31, [x0, #504]");
1971b8021494Sopenharmony_ci  COMPARE(stnp(d1, d2, MemOperand(x3, -512)), "stnp d1, d2, [x3, #-512]");
1972b8021494Sopenharmony_ci  COMPARE(ldnp(q4, q5, MemOperand(x6)), "ldnp q4, q5, [x6]");
1973b8021494Sopenharmony_ci  COMPARE(stnp(q7, q8, MemOperand(x9, 1008)), "stnp q7, q8, [x9, #1008]");
1974b8021494Sopenharmony_ci  COMPARE(ldnp(q10, q11, MemOperand(x12, -1024)),
1975b8021494Sopenharmony_ci          "ldnp q10, q11, [x12, #-1024]");
1976b8021494Sopenharmony_ci
1977b8021494Sopenharmony_ci  CLEANUP();
1978b8021494Sopenharmony_ci}
1979b8021494Sopenharmony_ci
1980b8021494Sopenharmony_ci
1981b8021494Sopenharmony_ciTEST(load_literal_macro) {
1982b8021494Sopenharmony_ci  SETUP();
1983b8021494Sopenharmony_ci
1984b8021494Sopenharmony_ci  // In each case, the literal will be placed at PC+8:
1985b8021494Sopenharmony_ci  //    ldr   x10, pc+8               // Test instruction.
1986b8021494Sopenharmony_ci  //    ldr   xzr, pc+12              // Pool marker.
1987b8021494Sopenharmony_ci  //    .word64 #0x1234567890abcdef   // Test literal.
1988b8021494Sopenharmony_ci
1989b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Ldr(x10, 0x1234567890abcdef), "ldr x10, pc+8");
1990b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Ldr(w20, 0xfedcba09), "ldr w20, pc+8");
1991b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Ldr(d11, 1.234), "ldr d11, pc+8");
1992b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Ldr(s22, 2.5f), "ldr s22, pc+8");
1993b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Ldrsw(x21, 0x80000000), "ldrsw x21, pc+8");
1994b8021494Sopenharmony_ci
1995b8021494Sopenharmony_ci  CLEANUP();
1996b8021494Sopenharmony_ci}
1997b8021494Sopenharmony_ci
1998b8021494Sopenharmony_ci
1999b8021494Sopenharmony_ciTEST(load_literal) {
2000b8021494Sopenharmony_ci  SETUP();
2001b8021494Sopenharmony_ci
2002b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(x20, INT64_C(0)), "ldr x20, pc+0");
2003b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(x20, 1), "ldr x20, pc+4");
2004b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(x20, -1), "ldr x20, pc-4");
2005b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(x20, 0x3ffff), "ldr x20, pc+1048572");
2006b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(x20, -0x40000), "ldr x20, pc-1048576");
2007b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(w21, INT64_C(0)), "ldr w21, pc+0");
2008b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(w21, 1), "ldr w21, pc+4");
2009b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(w21, -1), "ldr w21, pc-4");
2010b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(w21, 0x3ffff), "ldr w21, pc+1048572");
2011b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(w21, -0x40000), "ldr w21, pc-1048576");
2012b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(d22, INT64_C(0)), "ldr d22, pc+0");
2013b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(d22, 1), "ldr d22, pc+4");
2014b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(d22, -1), "ldr d22, pc-4");
2015b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(d22, 0x3ffff), "ldr d22, pc+1048572");
2016b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(d22, -0x40000), "ldr d22, pc-1048576");
2017b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(s23, INT64_C(0)), "ldr s23, pc+0");
2018b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(s23, 1), "ldr s23, pc+4");
2019b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(s23, -1), "ldr s23, pc-4");
2020b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(s23, 0x3ffff), "ldr s23, pc+1048572");
2021b8021494Sopenharmony_ci  COMPARE_PREFIX(ldr(s23, -0x40000), "ldr s23, pc-1048576");
2022b8021494Sopenharmony_ci  COMPARE_PREFIX(ldrsw(x24, INT64_C(0)), "ldrsw x24, pc+0");
2023b8021494Sopenharmony_ci  COMPARE_PREFIX(ldrsw(x24, 1), "ldrsw x24, pc+4");
2024b8021494Sopenharmony_ci  COMPARE_PREFIX(ldrsw(x24, -1), "ldrsw x24, pc-4");
2025b8021494Sopenharmony_ci  COMPARE_PREFIX(ldrsw(x24, 0x3ffff), "ldrsw x24, pc+1048572");
2026b8021494Sopenharmony_ci  COMPARE_PREFIX(ldrsw(x24, -0x40000), "ldrsw x24, pc-1048576");
2027b8021494Sopenharmony_ci
2028b8021494Sopenharmony_ci  CLEANUP();
2029b8021494Sopenharmony_ci}
2030b8021494Sopenharmony_ci
2031b8021494Sopenharmony_ci
2032b8021494Sopenharmony_ciTEST(prfm_operations) {
2033b8021494Sopenharmony_ci  SETUP();
2034b8021494Sopenharmony_ci
2035b8021494Sopenharmony_ci  // Test every encodable prefetch operation.
2036b8021494Sopenharmony_ci  const char* expected[] = {"prfm pldl1keep, ", "prfm pldl1strm, ",
2037b8021494Sopenharmony_ci                            "prfm pldl2keep, ", "prfm pldl2strm, ",
2038b8021494Sopenharmony_ci                            "prfm pldl3keep, ", "prfm pldl3strm, ",
2039b8021494Sopenharmony_ci                            "prfm #0b00110, ",  "prfm #0b00111, ",
2040b8021494Sopenharmony_ci                            "prfm plil1keep, ", "prfm plil1strm, ",
2041b8021494Sopenharmony_ci                            "prfm plil2keep, ", "prfm plil2strm, ",
2042b8021494Sopenharmony_ci                            "prfm plil3keep, ", "prfm plil3strm, ",
2043b8021494Sopenharmony_ci                            "prfm #0b01110, ",  "prfm #0b01111, ",
2044b8021494Sopenharmony_ci                            "prfm pstl1keep, ", "prfm pstl1strm, ",
2045b8021494Sopenharmony_ci                            "prfm pstl2keep, ", "prfm pstl2strm, ",
2046b8021494Sopenharmony_ci                            "prfm pstl3keep, ", "prfm pstl3strm, ",
2047b8021494Sopenharmony_ci                            "prfm #0b10110, ",  "prfm #0b10111, "};
2048b8021494Sopenharmony_ci
2049b8021494Sopenharmony_ci  for (int op = 0; op < (1 << ImmPrefetchOperation_width); op++) {
2050b8021494Sopenharmony_ci    // Prefetch operations of the form 0b11xxx are allocated to another
2051b8021494Sopenharmony_ci    // instruction.
2052b8021494Sopenharmony_ci    if (op >= 0b11000) continue;
2053b8021494Sopenharmony_ci
2054b8021494Sopenharmony_ci    COMPARE_PREFIX(prfm(op, INT64_C(0)), expected[op]);
2055b8021494Sopenharmony_ci    COMPARE_PREFIX(prfm(op, MemOperand(x0, 0)), expected[op]);
2056b8021494Sopenharmony_ci    COMPARE_PREFIX(prfm(op, MemOperand(x0, x1)), expected[op]);
2057b8021494Sopenharmony_ci  }
2058b8021494Sopenharmony_ci
2059b8021494Sopenharmony_ci  CLEANUP();
2060b8021494Sopenharmony_ci}
2061b8021494Sopenharmony_ci
2062b8021494Sopenharmony_ci
2063b8021494Sopenharmony_ciTEST(prfum_operations) {
2064b8021494Sopenharmony_ci  SETUP();
2065b8021494Sopenharmony_ci
2066b8021494Sopenharmony_ci  // Test every encodable prefetch operation.
2067b8021494Sopenharmony_ci  const char* expected[] = {
2068b8021494Sopenharmony_ci      "prfum pldl1keep, ", "prfum pldl1strm, ", "prfum pldl2keep, ",
2069b8021494Sopenharmony_ci      "prfum pldl2strm, ", "prfum pldl3keep, ", "prfum pldl3strm, ",
2070b8021494Sopenharmony_ci      "prfum #0b00110, ",  "prfum #0b00111, ",  "prfum plil1keep, ",
2071b8021494Sopenharmony_ci      "prfum plil1strm, ", "prfum plil2keep, ", "prfum plil2strm, ",
2072b8021494Sopenharmony_ci      "prfum plil3keep, ", "prfum plil3strm, ", "prfum #0b01110, ",
2073b8021494Sopenharmony_ci      "prfum #0b01111, ",  "prfum pstl1keep, ", "prfum pstl1strm, ",
2074b8021494Sopenharmony_ci      "prfum pstl2keep, ", "prfum pstl2strm, ", "prfum pstl3keep, ",
2075b8021494Sopenharmony_ci      "prfum pstl3strm, ", "prfum #0b10110, ",  "prfum #0b10111, ",
2076b8021494Sopenharmony_ci      "prfum #0b11000, ",  "prfum #0b11001, ",  "prfum #0b11010, ",
2077b8021494Sopenharmony_ci      "prfum #0b11011, ",  "prfum #0b11100, ",  "prfum #0b11101, ",
2078b8021494Sopenharmony_ci      "prfum #0b11110, ",  "prfum #0b11111, ",
2079b8021494Sopenharmony_ci  };
2080b8021494Sopenharmony_ci  const int expected_count = sizeof(expected) / sizeof(expected[0]);
2081b8021494Sopenharmony_ci  VIXL_STATIC_ASSERT((1 << ImmPrefetchOperation_width) == expected_count);
2082b8021494Sopenharmony_ci
2083b8021494Sopenharmony_ci  for (int op = 0; op < (1 << ImmPrefetchOperation_width); op++) {
2084b8021494Sopenharmony_ci    COMPARE_PREFIX(prfum(op, MemOperand(x0, 0)), expected[op]);
2085b8021494Sopenharmony_ci  }
2086b8021494Sopenharmony_ci
2087b8021494Sopenharmony_ci  CLEANUP();
2088b8021494Sopenharmony_ci}
2089b8021494Sopenharmony_ci
2090b8021494Sopenharmony_ci
2091b8021494Sopenharmony_ciTEST(prfm_offset) {
2092b8021494Sopenharmony_ci  SETUP();
2093b8021494Sopenharmony_ci
2094b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1KEEP, MemOperand(x1)), "prfm pldl1keep, [x1]");
2095b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1STRM, MemOperand(x3, 8)), "prfm pldl1strm, [x3, #8]");
2096b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2KEEP, MemOperand(x5, 32760)),
2097b8021494Sopenharmony_ci          "prfm pldl2keep, [x5, #32760]");
2098b8021494Sopenharmony_ci
2099b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2STRM, MemOperand(sp)), "prfm pldl2strm, [sp]");
2100b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3KEEP, MemOperand(sp, 8)), "prfm pldl3keep, [sp, #8]");
2101b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3STRM, MemOperand(sp, 32760)),
2102b8021494Sopenharmony_ci          "prfm pldl3strm, [sp, #32760]");
2103b8021494Sopenharmony_ci
2104b8021494Sopenharmony_ci  CLEANUP();
2105b8021494Sopenharmony_ci}
2106b8021494Sopenharmony_ci
2107b8021494Sopenharmony_ci
2108b8021494Sopenharmony_ciTEST(prfm_regoffset) {
2109b8021494Sopenharmony_ci  SETUP();
2110b8021494Sopenharmony_ci
2111b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, MemOperand(x1, x2)), "prfm plil1keep, [x1, x2]");
2112b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1STRM, MemOperand(x3, w4, SXTW)),
2113b8021494Sopenharmony_ci          "prfm plil1strm, [x3, w4, sxtw]");
2114b8021494Sopenharmony_ci  COMPARE(prfm(PLIL2KEEP, MemOperand(x5, x6, LSL, 3)),
2115b8021494Sopenharmony_ci          "prfm plil2keep, [x5, x6, lsl #3]");
2116b8021494Sopenharmony_ci
2117b8021494Sopenharmony_ci  COMPARE(prfm(PLIL2STRM, MemOperand(sp, xzr)), "prfm plil2strm, [sp, xzr]");
2118b8021494Sopenharmony_ci  COMPARE(prfm(PLIL3KEEP, MemOperand(sp, wzr, SXTW)),
2119b8021494Sopenharmony_ci          "prfm plil3keep, [sp, wzr, sxtw]");
2120b8021494Sopenharmony_ci  COMPARE(prfm(PLIL3STRM, MemOperand(sp, xzr, LSL, 3)),
2121b8021494Sopenharmony_ci          "prfm plil3strm, [sp, xzr, lsl #3]");
2122b8021494Sopenharmony_ci
2123b8021494Sopenharmony_ci  CLEANUP();
2124b8021494Sopenharmony_ci}
2125b8021494Sopenharmony_ci
2126b8021494Sopenharmony_ci
2127b8021494Sopenharmony_ciTEST(prfm_literal) {
2128b8021494Sopenharmony_ci  SETUP();
2129b8021494Sopenharmony_ci
2130b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL1KEEP, INT64_C(0)), "prfm pstl1keep, pc+0");
2131b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL1STRM, 1), "prfm pstl1strm, pc+4");
2132b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL2KEEP, -1), "prfm pstl2keep, pc-4");
2133b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL2STRM, 0x3ffff), "prfm pstl2strm, pc+1048572");
2134b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL3KEEP, -0x3ffff), "prfm pstl3keep, pc-1048572");
2135b8021494Sopenharmony_ci  COMPARE_PREFIX(prfm(PSTL3STRM, -0x40000), "prfm pstl3strm, pc-1048576");
2136b8021494Sopenharmony_ci
2137b8021494Sopenharmony_ci  CLEANUP();
2138b8021494Sopenharmony_ci}
2139b8021494Sopenharmony_ci
2140b8021494Sopenharmony_ci
2141b8021494Sopenharmony_ciTEST(prfm_unscaled) {
2142b8021494Sopenharmony_ci  SETUP();
2143b8021494Sopenharmony_ci
2144b8021494Sopenharmony_ci  // If an unscaled-offset instruction is requested, it is used, even if the
2145b8021494Sopenharmony_ci  // offset could be encoded in a scaled-offset instruction.
2146b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1KEEP, MemOperand(x1)), "prfum pldl1keep, [x1]");
2147b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1STRM, MemOperand(x1, 8)), "prfum pldl1strm, [x1, #8]");
2148b8021494Sopenharmony_ci  COMPARE(prfum(PLDL2KEEP, MemOperand(x1, 248)), "prfum pldl2keep, [x1, #248]");
2149b8021494Sopenharmony_ci
2150b8021494Sopenharmony_ci  // Normal offsets are converted to unscaled offsets if necssary.
2151b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2STRM, MemOperand(x1, 1)), "prfum pldl2strm, [x1, #1]");
2152b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3KEEP, MemOperand(x1, -1)), "prfum pldl3keep, [x1, #-1]");
2153b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3STRM, MemOperand(x1, 255)), "prfum pldl3strm, [x1, #255]");
2154b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3STRM, MemOperand(x1, -256)),
2155b8021494Sopenharmony_ci          "prfum pldl3strm, [x1, #-256]");
2156b8021494Sopenharmony_ci
2157b8021494Sopenharmony_ci  CLEANUP();
2158b8021494Sopenharmony_ci}
2159b8021494Sopenharmony_ci
2160b8021494Sopenharmony_ci
2161b8021494Sopenharmony_ciTEST(prfm_unscaled_option) {
2162b8021494Sopenharmony_ci  SETUP();
2163b8021494Sopenharmony_ci
2164b8021494Sopenharmony_ci  // Just like prfm_unscaled, but specify the scaling option explicitly.
2165b8021494Sopenharmony_ci
2166b8021494Sopenharmony_ci  // Require unscaled-offset forms.
2167b8021494Sopenharmony_ci  LoadStoreScalingOption option = RequireUnscaledOffset;
2168b8021494Sopenharmony_ci
2169b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1KEEP, MemOperand(x1), option), "prfum pldl1keep, [x1]");
2170b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1STRM, MemOperand(x1, 8), option),
2171b8021494Sopenharmony_ci          "prfum pldl1strm, [x1, #8]");
2172b8021494Sopenharmony_ci  COMPARE(prfum(PLDL2KEEP, MemOperand(x1, 248), option),
2173b8021494Sopenharmony_ci          "prfum pldl2keep, [x1, #248]");
2174b8021494Sopenharmony_ci  COMPARE(prfum(PLDL2STRM, MemOperand(x1, 1), option),
2175b8021494Sopenharmony_ci          "prfum pldl2strm, [x1, #1]");
2176b8021494Sopenharmony_ci  COMPARE(prfum(PLDL3KEEP, MemOperand(x1, -1), option),
2177b8021494Sopenharmony_ci          "prfum pldl3keep, [x1, #-1]");
2178b8021494Sopenharmony_ci  COMPARE(prfum(PLDL3STRM, MemOperand(x1, 255), option),
2179b8021494Sopenharmony_ci          "prfum pldl3strm, [x1, #255]");
2180b8021494Sopenharmony_ci  COMPARE(prfum(PLIL1KEEP, MemOperand(x1, -256), option),
2181b8021494Sopenharmony_ci          "prfum plil1keep, [x1, #-256]");
2182b8021494Sopenharmony_ci
2183b8021494Sopenharmony_ci  // Require scaled-offset forms..
2184b8021494Sopenharmony_ci  option = RequireScaledOffset;
2185b8021494Sopenharmony_ci
2186b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1KEEP, MemOperand(x1), option), "prfm pldl1keep, [x1]");
2187b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1STRM, MemOperand(x1, 8), option),
2188b8021494Sopenharmony_ci          "prfm pldl1strm, [x1, #8]");
2189b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2KEEP, MemOperand(x1, 248), option),
2190b8021494Sopenharmony_ci          "prfm pldl2keep, [x1, #248]");
2191b8021494Sopenharmony_ci  COMPARE(prfm(PLIL2STRM, MemOperand(x1, 256), option),
2192b8021494Sopenharmony_ci          "prfm plil2strm, [x1, #256]");
2193b8021494Sopenharmony_ci  COMPARE(prfm(PLIL3KEEP, MemOperand(x1, 32760), option),
2194b8021494Sopenharmony_ci          "prfm plil3keep, [x1, #32760]");
2195b8021494Sopenharmony_ci
2196b8021494Sopenharmony_ci  // Prefer unscaled-offset forms, but allow scaled-offset forms if necessary.
2197b8021494Sopenharmony_ci  option = PreferUnscaledOffset;
2198b8021494Sopenharmony_ci
2199b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1KEEP, MemOperand(x1), option), "prfum pldl1keep, [x1]");
2200b8021494Sopenharmony_ci  COMPARE(prfum(PLDL1STRM, MemOperand(x1, 8), option),
2201b8021494Sopenharmony_ci          "prfum pldl1strm, [x1, #8]");
2202b8021494Sopenharmony_ci  COMPARE(prfum(PLDL2KEEP, MemOperand(x1, 248), option),
2203b8021494Sopenharmony_ci          "prfum pldl2keep, [x1, #248]");
2204b8021494Sopenharmony_ci  COMPARE(prfum(PLDL2STRM, MemOperand(x1, 1), option),
2205b8021494Sopenharmony_ci          "prfum pldl2strm, [x1, #1]");
2206b8021494Sopenharmony_ci  COMPARE(prfum(PLDL3KEEP, MemOperand(x1, -1), option),
2207b8021494Sopenharmony_ci          "prfum pldl3keep, [x1, #-1]");
2208b8021494Sopenharmony_ci  COMPARE(prfum(PLDL3STRM, MemOperand(x1, 255), option),
2209b8021494Sopenharmony_ci          "prfum pldl3strm, [x1, #255]");
2210b8021494Sopenharmony_ci  COMPARE(prfum(PLIL1KEEP, MemOperand(x1, -256), option),
2211b8021494Sopenharmony_ci          "prfum plil1keep, [x1, #-256]");
2212b8021494Sopenharmony_ci  COMPARE(prfum(PLIL1STRM, MemOperand(x1, 256), option),
2213b8021494Sopenharmony_ci          "prfm plil1strm, [x1, #256]");
2214b8021494Sopenharmony_ci  COMPARE(prfum(PLIL2KEEP, MemOperand(x1, 32760), option),
2215b8021494Sopenharmony_ci          "prfm plil2keep, [x1, #32760]");
2216b8021494Sopenharmony_ci
2217b8021494Sopenharmony_ci  // Prefer scaled-offset forms, but allow unscaled-offset forms if necessary.
2218b8021494Sopenharmony_ci  option = PreferScaledOffset;
2219b8021494Sopenharmony_ci
2220b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1KEEP, MemOperand(x1), option), "prfm pldl1keep, [x1]");
2221b8021494Sopenharmony_ci  COMPARE(prfm(PLDL1STRM, MemOperand(x1, 8), option),
2222b8021494Sopenharmony_ci          "prfm pldl1strm, [x1, #8]");
2223b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2KEEP, MemOperand(x1, 248), option),
2224b8021494Sopenharmony_ci          "prfm pldl2keep, [x1, #248]");
2225b8021494Sopenharmony_ci  COMPARE(prfm(PLDL2STRM, MemOperand(x1, 1), option),
2226b8021494Sopenharmony_ci          "prfum pldl2strm, [x1, #1]");
2227b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3KEEP, MemOperand(x1, -1), option),
2228b8021494Sopenharmony_ci          "prfum pldl3keep, [x1, #-1]");
2229b8021494Sopenharmony_ci  COMPARE(prfm(PLDL3STRM, MemOperand(x1, 255), option),
2230b8021494Sopenharmony_ci          "prfum pldl3strm, [x1, #255]");
2231b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, MemOperand(x1, -256), option),
2232b8021494Sopenharmony_ci          "prfum plil1keep, [x1, #-256]");
2233b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1STRM, MemOperand(x1, 256), option),
2234b8021494Sopenharmony_ci          "prfm plil1strm, [x1, #256]");
2235b8021494Sopenharmony_ci  COMPARE(prfm(PLIL2KEEP, MemOperand(x1, 32760), option),
2236b8021494Sopenharmony_ci          "prfm plil2keep, [x1, #32760]");
2237b8021494Sopenharmony_ci
2238b8021494Sopenharmony_ci  CLEANUP();
2239b8021494Sopenharmony_ci}
2240b8021494Sopenharmony_ci
2241b8021494Sopenharmony_ci
2242b8021494Sopenharmony_ciTEST(cond_select) {
2243b8021494Sopenharmony_ci  SETUP();
2244b8021494Sopenharmony_ci
2245b8021494Sopenharmony_ci  COMPARE(csel(w0, w1, w2, eq), "csel w0, w1, w2, eq");
2246b8021494Sopenharmony_ci  COMPARE(csel(x3, x4, x5, ne), "csel x3, x4, x5, ne");
2247b8021494Sopenharmony_ci  COMPARE(csinc(w6, w7, w8, hs), "csinc w6, w7, w8, hs");
2248b8021494Sopenharmony_ci  COMPARE(csinc(x9, x10, x11, lo), "csinc x9, x10, x11, lo");
2249b8021494Sopenharmony_ci  COMPARE(csinv(w12, w13, w14, mi), "csinv w12, w13, w14, mi");
2250b8021494Sopenharmony_ci  COMPARE(csinv(x15, x16, x17, pl), "csinv x15, x16, x17, pl");
2251b8021494Sopenharmony_ci  COMPARE(csneg(w18, w19, w20, vs), "csneg w18, w19, w20, vs");
2252b8021494Sopenharmony_ci  COMPARE(csneg(x21, x22, x23, vc), "csneg x21, x22, x23, vc");
2253b8021494Sopenharmony_ci  COMPARE(cset(w24, hi), "cset w24, hi");
2254b8021494Sopenharmony_ci  COMPARE(cset(x25, ls), "cset x25, ls");
2255b8021494Sopenharmony_ci  COMPARE(csetm(w26, ge), "csetm w26, ge");
2256b8021494Sopenharmony_ci  COMPARE(csetm(x27, lt), "csetm x27, lt");
2257b8021494Sopenharmony_ci  COMPARE(cinc(w28, w29, gt), "cinc w28, w29, gt");
2258b8021494Sopenharmony_ci  COMPARE(cinc(x30, x0, le), "cinc x30, x0, le");
2259b8021494Sopenharmony_ci  COMPARE(cinv(w1, w2, eq), "cinv w1, w2, eq");
2260b8021494Sopenharmony_ci  COMPARE(cinv(x3, x4, ne), "cinv x3, x4, ne");
2261b8021494Sopenharmony_ci  COMPARE(cneg(w5, w6, hs), "cneg w5, w6, hs");
2262b8021494Sopenharmony_ci  COMPARE(cneg(x7, x8, lo), "cneg x7, x8, lo");
2263b8021494Sopenharmony_ci
2264b8021494Sopenharmony_ci  COMPARE(csel(x0, x1, x2, al), "csel x0, x1, x2, al");
2265b8021494Sopenharmony_ci  COMPARE(csel(x1, x2, x3, nv), "csel x1, x2, x3, nv");
2266b8021494Sopenharmony_ci  COMPARE(csinc(x2, x3, x4, al), "csinc x2, x3, x4, al");
2267b8021494Sopenharmony_ci  COMPARE(csinc(x3, x4, x5, nv), "csinc x3, x4, x5, nv");
2268b8021494Sopenharmony_ci  COMPARE(csinv(x4, x5, x6, al), "csinv x4, x5, x6, al");
2269b8021494Sopenharmony_ci  COMPARE(csinv(x5, x6, x7, nv), "csinv x5, x6, x7, nv");
2270b8021494Sopenharmony_ci  COMPARE(csneg(x6, x7, x8, al), "csneg x6, x7, x8, al");
2271b8021494Sopenharmony_ci  COMPARE(csneg(x7, x8, x9, nv), "csneg x7, x8, x9, nv");
2272b8021494Sopenharmony_ci
2273b8021494Sopenharmony_ci  CLEANUP();
2274b8021494Sopenharmony_ci}
2275b8021494Sopenharmony_ci
2276b8021494Sopenharmony_ci
2277b8021494Sopenharmony_ciTEST(cond_select_macro) {
2278b8021494Sopenharmony_ci  SETUP();
2279b8021494Sopenharmony_ci
2280b8021494Sopenharmony_ci  // In the tests below we also test the `GetCselSynthesisInformation()` helper.
2281b8021494Sopenharmony_ci  // These tests are here (rather than in test-assembler-aarch64.cc) because the
2282b8021494Sopenharmony_ci  // disassembly makes it easy to see whether or not the inputs are synthesised.
2283b8021494Sopenharmony_ci  bool synthesises_left = false;
2284b8021494Sopenharmony_ci  bool synthesises_right = false;
2285b8021494Sopenharmony_ci
2286b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w0, w1, -1, eq), "csinv w0, w1, wzr, eq");
2287b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w0,
2288b8021494Sopenharmony_ci                                              w1,
2289b8021494Sopenharmony_ci                                              -1,
2290b8021494Sopenharmony_ci                                              &synthesises_left,
2291b8021494Sopenharmony_ci                                              &synthesises_right);
2292b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2293b8021494Sopenharmony_ci
2294b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w2, w3, 0, ne), "csel w2, w3, wzr, ne");
2295b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w2,
2296b8021494Sopenharmony_ci                                              w3,
2297b8021494Sopenharmony_ci                                              wzr,
2298b8021494Sopenharmony_ci                                              &synthesises_left,
2299b8021494Sopenharmony_ci                                              &synthesises_right);
2300b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2301b8021494Sopenharmony_ci
2302b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w4, w5, 1, hs), "csinc w4, w5, wzr, hs");
2303b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w4,
2304b8021494Sopenharmony_ci                                              w5,
2305b8021494Sopenharmony_ci                                              1,
2306b8021494Sopenharmony_ci                                              &synthesises_left,
2307b8021494Sopenharmony_ci                                              &synthesises_right);
2308b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2309b8021494Sopenharmony_ci
2310b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x6, x7, -1, lo), "csinv x6, x7, xzr, lo");
2311b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x6,
2312b8021494Sopenharmony_ci                                              x7,
2313b8021494Sopenharmony_ci                                              xzr,
2314b8021494Sopenharmony_ci                                              &synthesises_left,
2315b8021494Sopenharmony_ci                                              &synthesises_right);
2316b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2317b8021494Sopenharmony_ci
2318b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x8, x9, 0, mi), "csel x8, x9, xzr, mi");
2319b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x8,
2320b8021494Sopenharmony_ci                                              x9,
2321b8021494Sopenharmony_ci                                              xzr,
2322b8021494Sopenharmony_ci                                              &synthesises_left,
2323b8021494Sopenharmony_ci                                              &synthesises_right);
2324b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2325b8021494Sopenharmony_ci
2326b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x10, x11, 1, pl), "csinc x10, x11, xzr, pl");
2327b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x10,
2328b8021494Sopenharmony_ci                                              x11,
2329b8021494Sopenharmony_ci                                              xzr,
2330b8021494Sopenharmony_ci                                              &synthesises_left,
2331b8021494Sopenharmony_ci                                              &synthesises_right);
2332b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2333b8021494Sopenharmony_ci
2334b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x12, 0, 0, eq), "mov x12, #0x0");
2335b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x12,
2336b8021494Sopenharmony_ci                                              0,
2337b8021494Sopenharmony_ci                                              0,
2338b8021494Sopenharmony_ci                                              &synthesises_left,
2339b8021494Sopenharmony_ci                                              &synthesises_right);
2340b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2341b8021494Sopenharmony_ci
2342b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w13, 0, 1, eq), "cset w13, ne");
2343b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w13,
2344b8021494Sopenharmony_ci                                              0,
2345b8021494Sopenharmony_ci                                              1,
2346b8021494Sopenharmony_ci                                              &synthesises_left,
2347b8021494Sopenharmony_ci                                              &synthesises_right);
2348b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2349b8021494Sopenharmony_ci
2350b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x14, 1, 0, eq), "cset x14, eq");
2351b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x14,
2352b8021494Sopenharmony_ci                                              1,
2353b8021494Sopenharmony_ci                                              0,
2354b8021494Sopenharmony_ci                                              &synthesises_left,
2355b8021494Sopenharmony_ci                                              &synthesises_right);
2356b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2357b8021494Sopenharmony_ci
2358b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w15, 0, -1, eq), "csetm w15, ne");
2359b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w15,
2360b8021494Sopenharmony_ci                                              0,
2361b8021494Sopenharmony_ci                                              -1,
2362b8021494Sopenharmony_ci                                              &synthesises_left,
2363b8021494Sopenharmony_ci                                              &synthesises_right);
2364b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2365b8021494Sopenharmony_ci
2366b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x18, -1, 0, eq), "csetm x18, eq");
2367b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x18,
2368b8021494Sopenharmony_ci                                              -1,
2369b8021494Sopenharmony_ci                                              0,
2370b8021494Sopenharmony_ci                                              &synthesises_left,
2371b8021494Sopenharmony_ci                                              &synthesises_right);
2372b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2373b8021494Sopenharmony_ci
2374b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w19, -1, 1, eq),
2375b8021494Sopenharmony_ci                "mov w19, #0x1\n"
2376b8021494Sopenharmony_ci                "cneg w19, w19, eq");
2377b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w19,
2378b8021494Sopenharmony_ci                                              -1,
2379b8021494Sopenharmony_ci                                              1,
2380b8021494Sopenharmony_ci                                              &synthesises_left,
2381b8021494Sopenharmony_ci                                              &synthesises_right);
2382b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2383b8021494Sopenharmony_ci
2384b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x20, 1, -1, eq),
2385b8021494Sopenharmony_ci                "mov x20, #0xffffffffffffffff\n"
2386b8021494Sopenharmony_ci                "cneg x20, x20, eq");
2387b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x20,
2388b8021494Sopenharmony_ci                                              1,
2389b8021494Sopenharmony_ci                                              -1,
2390b8021494Sopenharmony_ci                                              &synthesises_left,
2391b8021494Sopenharmony_ci                                              &synthesises_right);
2392b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2393b8021494Sopenharmony_ci
2394b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w21, 0xaa, 0xbb, eq),
2395b8021494Sopenharmony_ci                "mov w16, #0xaa\n"
2396b8021494Sopenharmony_ci                "mov w17, #0xbb\n"
2397b8021494Sopenharmony_ci                "csel w21, w16, w17, eq");
2398b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w21,
2399b8021494Sopenharmony_ci                                              0xaa,
2400b8021494Sopenharmony_ci                                              0xbb,
2401b8021494Sopenharmony_ci                                              &synthesises_left,
2402b8021494Sopenharmony_ci                                              &synthesises_right);
2403b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && synthesises_right);
2404b8021494Sopenharmony_ci
2405b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x22, 0xaa, -0xbb, eq),
2406b8021494Sopenharmony_ci                "mov x16, #0xaa\n"
2407b8021494Sopenharmony_ci                "mov x17, #0xffffffffffffff45\n"
2408b8021494Sopenharmony_ci                "csel x22, x16, x17, eq");
2409b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x22,
2410b8021494Sopenharmony_ci                                              0xaa,
2411b8021494Sopenharmony_ci                                              -0xbb,
2412b8021494Sopenharmony_ci                                              &synthesises_left,
2413b8021494Sopenharmony_ci                                              &synthesises_right);
2414b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && synthesises_right);
2415b8021494Sopenharmony_ci
2416b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w23, 0, 0xaa, eq),
2417b8021494Sopenharmony_ci                "mov w16, #0xaa\n"
2418b8021494Sopenharmony_ci                "csel w23, w16, wzr, ne");
2419b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w23,
2420b8021494Sopenharmony_ci                                              0,
2421b8021494Sopenharmony_ci                                              0xaa,
2422b8021494Sopenharmony_ci                                              &synthesises_left,
2423b8021494Sopenharmony_ci                                              &synthesises_right);
2424b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2425b8021494Sopenharmony_ci
2426b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x24, -0xaa, 0, eq),
2427b8021494Sopenharmony_ci                "mov x16, #0xffffffffffffff56\n"
2428b8021494Sopenharmony_ci                "csel x24, x16, xzr, eq");
2429b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x24,
2430b8021494Sopenharmony_ci                                              -0xaa,
2431b8021494Sopenharmony_ci                                              0,
2432b8021494Sopenharmony_ci                                              &synthesises_left,
2433b8021494Sopenharmony_ci                                              &synthesises_right);
2434b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && !synthesises_right);
2435b8021494Sopenharmony_ci
2436b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w25, 0xcc, -0xcc, eq),
2437b8021494Sopenharmony_ci                "mov w25, #0xffffff34\n"
2438b8021494Sopenharmony_ci                "cneg w25, w25, eq");
2439b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w25,
2440b8021494Sopenharmony_ci                                              0xcc,
2441b8021494Sopenharmony_ci                                              -0xcc,
2442b8021494Sopenharmony_ci                                              &synthesises_left,
2443b8021494Sopenharmony_ci                                              &synthesises_right);
2444b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2445b8021494Sopenharmony_ci
2446b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x26, -0xcc, 0xcc, eq),
2447b8021494Sopenharmony_ci                "mov x26, #0xcc\n"
2448b8021494Sopenharmony_ci                "cneg x26, x26, eq");
2449b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w25,
2450b8021494Sopenharmony_ci                                              -0xcc,
2451b8021494Sopenharmony_ci                                              0xcc,
2452b8021494Sopenharmony_ci                                              &synthesises_left,
2453b8021494Sopenharmony_ci                                              &synthesises_right);
2454b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2455b8021494Sopenharmony_ci
2456b8021494Sopenharmony_ci  // Test with `Operand` inputs.
2457b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x0, x1, Operand(x2, LSL, 3), eq),
2458b8021494Sopenharmony_ci                "lsl x16, x2, #3\n"
2459b8021494Sopenharmony_ci                "csel x0, x1, x16, eq");
2460b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x0,
2461b8021494Sopenharmony_ci                                              x1,
2462b8021494Sopenharmony_ci                                              Operand(x2, LSL, 3),
2463b8021494Sopenharmony_ci                                              &synthesises_left,
2464b8021494Sopenharmony_ci                                              &synthesises_right);
2465b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2466b8021494Sopenharmony_ci
2467b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x3, x4, Operand(x5, SXTH), eq),
2468b8021494Sopenharmony_ci                "sxth x16, w5\n"
2469b8021494Sopenharmony_ci                "csel x3, x4, x16, eq");
2470b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x3,
2471b8021494Sopenharmony_ci                                              x4,
2472b8021494Sopenharmony_ci                                              Operand(x5, SXTH),
2473b8021494Sopenharmony_ci                                              &synthesises_left,
2474b8021494Sopenharmony_ci                                              &synthesises_right);
2475b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2476b8021494Sopenharmony_ci
2477b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x6, Operand(x7, LSL, 7), x8, eq),
2478b8021494Sopenharmony_ci                "lsl x16, x7, #7\n"
2479b8021494Sopenharmony_ci                "csel x6, x16, x8, eq");
2480b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x6,
2481b8021494Sopenharmony_ci                                              Operand(x7, LSL, 7),
2482b8021494Sopenharmony_ci                                              x8,
2483b8021494Sopenharmony_ci                                              &synthesises_left,
2484b8021494Sopenharmony_ci                                              &synthesises_right);
2485b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && !synthesises_right);
2486b8021494Sopenharmony_ci
2487b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x9, Operand(x10, SXTH), x11, eq),
2488b8021494Sopenharmony_ci                "sxth x16, w10\n"
2489b8021494Sopenharmony_ci                "csel x9, x16, x11, eq");
2490b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x9,
2491b8021494Sopenharmony_ci                                              Operand(x10, SXTH),
2492b8021494Sopenharmony_ci                                              x11,
2493b8021494Sopenharmony_ci                                              &synthesises_left,
2494b8021494Sopenharmony_ci                                              &synthesises_right);
2495b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && !synthesises_right);
2496b8021494Sopenharmony_ci
2497b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x12, Operand(x13, LSL, 13), Operand(x14, SXTB), eq),
2498b8021494Sopenharmony_ci                "lsl x16, x13, #13\n"
2499b8021494Sopenharmony_ci                "sxtb x17, w14\n"
2500b8021494Sopenharmony_ci                "csel x12, x16, x17, eq");
2501b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x12,
2502b8021494Sopenharmony_ci                                              Operand(x13, LSL, 13),
2503b8021494Sopenharmony_ci                                              Operand(x14, SXTB),
2504b8021494Sopenharmony_ci                                              &synthesises_left,
2505b8021494Sopenharmony_ci                                              &synthesises_right);
2506b8021494Sopenharmony_ci  VIXL_CHECK(synthesises_left && synthesises_right);
2507b8021494Sopenharmony_ci
2508b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x15, 0, Operand(x18, LSR, 18), eq),
2509b8021494Sopenharmony_ci                "lsr x16, x18, #18\n"
2510b8021494Sopenharmony_ci                "csel x15, x16, xzr, ne");
2511b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x15,
2512b8021494Sopenharmony_ci                                              0,
2513b8021494Sopenharmony_ci                                              Operand(x18, LSR, 18),
2514b8021494Sopenharmony_ci                                              &synthesises_left,
2515b8021494Sopenharmony_ci                                              &synthesises_right);
2516b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && synthesises_right);
2517b8021494Sopenharmony_ci
2518b8021494Sopenharmony_ci  // Test with the zero register.
2519b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w19, wzr, wzr, eq), "mov w19, #0x0");
2520b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w19,
2521b8021494Sopenharmony_ci                                              wzr,
2522b8021494Sopenharmony_ci                                              wzr,
2523b8021494Sopenharmony_ci                                              &synthesises_left,
2524b8021494Sopenharmony_ci                                              &synthesises_right);
2525b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2526b8021494Sopenharmony_ci
2527b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x20, x21, xzr, eq), "csel x20, x21, xzr, eq");
2528b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x20,
2529b8021494Sopenharmony_ci                                              x21,
2530b8021494Sopenharmony_ci                                              xzr,
2531b8021494Sopenharmony_ci                                              &synthesises_left,
2532b8021494Sopenharmony_ci                                              &synthesises_right);
2533b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2534b8021494Sopenharmony_ci
2535b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w22, wzr, w23, eq), "csel w22, w23, wzr, ne");
2536b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w22,
2537b8021494Sopenharmony_ci                                              wzr,
2538b8021494Sopenharmony_ci                                              w23,
2539b8021494Sopenharmony_ci                                              &synthesises_left,
2540b8021494Sopenharmony_ci                                              &synthesises_right);
2541b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2542b8021494Sopenharmony_ci
2543b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(x24, xzr, 0, eq), "mov x24, #0x0");
2544b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(x24,
2545b8021494Sopenharmony_ci                                              xzr,
2546b8021494Sopenharmony_ci                                              0,
2547b8021494Sopenharmony_ci                                              &synthesises_left,
2548b8021494Sopenharmony_ci                                              &synthesises_right);
2549b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2550b8021494Sopenharmony_ci
2551b8021494Sopenharmony_ci  COMPARE_MACRO(Csel(w25, wzr, 1, eq), "cset w25, ne");
2552b8021494Sopenharmony_ci  MacroAssembler::GetCselSynthesisInformation(w25,
2553b8021494Sopenharmony_ci                                              wzr,
2554b8021494Sopenharmony_ci                                              1,
2555b8021494Sopenharmony_ci                                              &synthesises_left,
2556b8021494Sopenharmony_ci                                              &synthesises_right);
2557b8021494Sopenharmony_ci  VIXL_CHECK(!synthesises_left && !synthesises_right);
2558b8021494Sopenharmony_ci
2559b8021494Sopenharmony_ci
2560b8021494Sopenharmony_ci  CLEANUP();
2561b8021494Sopenharmony_ci}
2562b8021494Sopenharmony_ci
2563b8021494Sopenharmony_ci
2564b8021494Sopenharmony_ciTEST(cond_cmp) {
2565b8021494Sopenharmony_ci  SETUP();
2566b8021494Sopenharmony_ci
2567b8021494Sopenharmony_ci  COMPARE(ccmn(w0, w1, NZCVFlag, eq), "ccmn w0, w1, #NZCV, eq");
2568b8021494Sopenharmony_ci  COMPARE(ccmn(x2, x3, NZCFlag, ne), "ccmn x2, x3, #NZCv, ne");
2569b8021494Sopenharmony_ci  COMPARE(ccmp(w4, w5, NZVFlag, hs), "ccmp w4, w5, #NZcV, hs");
2570b8021494Sopenharmony_ci  COMPARE(ccmp(x6, x7, NZFlag, lo), "ccmp x6, x7, #NZcv, lo");
2571b8021494Sopenharmony_ci  COMPARE(ccmn(w8, 31, NFlag, mi), "ccmn w8, #31, #Nzcv, mi");
2572b8021494Sopenharmony_ci  COMPARE(ccmn(x9, 30, NCFlag, pl), "ccmn x9, #30, #NzCv, pl");
2573b8021494Sopenharmony_ci  COMPARE(ccmp(w10, 29, NVFlag, vs), "ccmp w10, #29, #NzcV, vs");
2574b8021494Sopenharmony_ci  COMPARE(ccmp(x11, 28, NFlag, vc), "ccmp x11, #28, #Nzcv, vc");
2575b8021494Sopenharmony_ci  COMPARE(ccmn(w12, w13, NoFlag, al), "ccmn w12, w13, #nzcv, al");
2576b8021494Sopenharmony_ci  COMPARE(ccmp(x14, 27, ZVFlag, nv), "ccmp x14, #27, #nZcV, nv");
2577b8021494Sopenharmony_ci
2578b8021494Sopenharmony_ci  CLEANUP();
2579b8021494Sopenharmony_ci}
2580b8021494Sopenharmony_ci
2581b8021494Sopenharmony_ci
2582b8021494Sopenharmony_ciTEST(cond_cmp_macro) {
2583b8021494Sopenharmony_ci  SETUP();
2584b8021494Sopenharmony_ci
2585b8021494Sopenharmony_ci  COMPARE_MACRO(Ccmp(w0, -1, VFlag, hi), "ccmn w0, #1, #nzcV, hi");
2586b8021494Sopenharmony_ci  COMPARE_MACRO(Ccmp(x1, -31, CFlag, ge), "ccmn x1, #31, #nzCv, ge");
2587b8021494Sopenharmony_ci  COMPARE_MACRO(Ccmn(w2, -1, CVFlag, gt), "ccmp w2, #1, #nzCV, gt");
2588b8021494Sopenharmony_ci  COMPARE_MACRO(Ccmn(x3, -31, ZCVFlag, ls), "ccmp x3, #31, #nZCV, ls");
2589b8021494Sopenharmony_ci
2590b8021494Sopenharmony_ci  CLEANUP();
2591b8021494Sopenharmony_ci}
2592b8021494Sopenharmony_ci
2593b8021494Sopenharmony_ci
2594b8021494Sopenharmony_ciTEST(system_clrex) {
2595b8021494Sopenharmony_ci  SETUP();
2596b8021494Sopenharmony_ci
2597b8021494Sopenharmony_ci  COMPARE(clrex(0), "clrex #0x0");
2598b8021494Sopenharmony_ci  COMPARE(clrex(14), "clrex #0xe");
2599b8021494Sopenharmony_ci  COMPARE(clrex(15), "clrex");
2600b8021494Sopenharmony_ci  COMPARE(clrex(), "clrex");
2601b8021494Sopenharmony_ci
2602b8021494Sopenharmony_ci  CLEANUP();
2603b8021494Sopenharmony_ci}
2604b8021494Sopenharmony_ci
2605b8021494Sopenharmony_ci
2606b8021494Sopenharmony_ciTEST(system_mrs) {
2607b8021494Sopenharmony_ci  SETUP();
2608b8021494Sopenharmony_ci
2609b8021494Sopenharmony_ci  COMPARE(mrs(x0, NZCV), "mrs x0, nzcv");
2610b8021494Sopenharmony_ci  COMPARE(mrs(x30, NZCV), "mrs x30, nzcv");
2611b8021494Sopenharmony_ci  COMPARE(mrs(x15, FPCR), "mrs x15, fpcr");
2612b8021494Sopenharmony_ci  COMPARE(mrs(x20, RNDR), "mrs x20, rndr");
2613b8021494Sopenharmony_ci  COMPARE(mrs(x5, RNDRRS), "mrs x5, rndrrs");
2614b8021494Sopenharmony_ci
2615b8021494Sopenharmony_ci  // Test mrs that use system registers we haven't named.
2616b8021494Sopenharmony_ci  COMPARE(dci(MRS | (0x5555 << 5)), "mrs x0, S3_2_c10_c10_5");
2617b8021494Sopenharmony_ci  COMPARE(dci(0xd53e1000), "mrs x0, S3_6_c1_c0_0");
2618b8021494Sopenharmony_ci
2619b8021494Sopenharmony_ci  CLEANUP();
2620b8021494Sopenharmony_ci}
2621b8021494Sopenharmony_ci
2622b8021494Sopenharmony_ci
2623b8021494Sopenharmony_ciTEST(system_msr) {
2624b8021494Sopenharmony_ci  SETUP();
2625b8021494Sopenharmony_ci
2626b8021494Sopenharmony_ci  COMPARE(msr(NZCV, x0), "msr nzcv, x0");
2627b8021494Sopenharmony_ci  COMPARE(msr(NZCV, x30), "msr nzcv, x30");
2628b8021494Sopenharmony_ci  COMPARE(msr(FPCR, x15), "msr fpcr, x15");
2629b8021494Sopenharmony_ci
2630b8021494Sopenharmony_ci  // Test msr that use system registers we haven't named.
2631b8021494Sopenharmony_ci  COMPARE(dci(MSR | (0x1234 << 5)), "msr S2_2_c4_c6_4, x0");
2632b8021494Sopenharmony_ci  COMPARE(dci(0xd51e1000), "msr S3_6_c1_c0_0, x0");
2633b8021494Sopenharmony_ci
2634b8021494Sopenharmony_ci  CLEANUP();
2635b8021494Sopenharmony_ci}
2636b8021494Sopenharmony_ci
2637b8021494Sopenharmony_ci
2638b8021494Sopenharmony_ciTEST(system_pstate) {
2639b8021494Sopenharmony_ci  SETUP();
2640b8021494Sopenharmony_ci
2641b8021494Sopenharmony_ci  COMPARE(cfinv(), "cfinv");
2642b8021494Sopenharmony_ci  COMPARE(axflag(), "axflag");
2643b8021494Sopenharmony_ci  COMPARE(xaflag(), "xaflag");
2644b8021494Sopenharmony_ci
2645b8021494Sopenharmony_ci  CLEANUP();
2646b8021494Sopenharmony_ci}
2647b8021494Sopenharmony_ci
2648b8021494Sopenharmony_ci
2649b8021494Sopenharmony_ciTEST(system_sys) {
2650b8021494Sopenharmony_ci  SETUP();
2651b8021494Sopenharmony_ci
2652b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0x5, 0x1, x1), "ic ivau, x1");
2653b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0xa, 0x1, x2), "dc cvac, x2");
2654b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0xb, 0x1, x3), "dc cvau, x3");
2655b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0xe, 0x1, x4), "dc civac, x4");
2656b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0xc, 0x1, x5), "dc cvap, x5");
2657b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0xd, 0x1, x6), "dc cvadp, x6");
2658b8021494Sopenharmony_ci  COMPARE(sys(0x3, 0x7, 0x4, 0x1, x0), "dc zva, x0");
2659b8021494Sopenharmony_ci  COMPARE(sys(0x0, 0x0, 0x0, 0x0, x0), "sys #0, C0, C0, #0, x0");
2660b8021494Sopenharmony_ci  COMPARE(sys(0x1, 0x2, 0x5, 0x2, x5), "sys #1, C2, C5, #2, x5");
2661b8021494Sopenharmony_ci  COMPARE(sys(0x2, 0x8, 0xa, 0x3, x6), "sys #2, C8, C10, #3, x6");
2662b8021494Sopenharmony_ci  COMPARE(sys(0x2, 0xf, 0xf, 0x1, xzr), "sys #2, C15, C15, #1");
2663b8021494Sopenharmony_ci  COMPARE(sys(0x2, 0xf, 0xf, 0x1), "sys #2, C15, C15, #1");
2664b8021494Sopenharmony_ci
2665b8021494Sopenharmony_ci  CLEANUP();
2666b8021494Sopenharmony_ci}
2667b8021494Sopenharmony_ci
2668b8021494Sopenharmony_ci
2669b8021494Sopenharmony_ciTEST(system_ic) {
2670b8021494Sopenharmony_ci  SETUP();
2671b8021494Sopenharmony_ci
2672b8021494Sopenharmony_ci  COMPARE(ic(IVAU, x0), "ic ivau, x0");
2673b8021494Sopenharmony_ci  COMPARE(ic(IVAU, x1), "ic ivau, x1");
2674b8021494Sopenharmony_ci  COMPARE(ic(IVAU, xzr), "ic ivau, xzr");
2675b8021494Sopenharmony_ci
2676b8021494Sopenharmony_ci  CLEANUP();
2677b8021494Sopenharmony_ci}
2678b8021494Sopenharmony_ci
2679b8021494Sopenharmony_ci
2680b8021494Sopenharmony_ciTEST(system_dc) {
2681b8021494Sopenharmony_ci  SETUP();
2682b8021494Sopenharmony_ci
2683b8021494Sopenharmony_ci  COMPARE(dc(CVAC, x2), "dc cvac, x2");
2684b8021494Sopenharmony_ci  COMPARE(dc(CVAU, x3), "dc cvau, x3");
2685b8021494Sopenharmony_ci  COMPARE(dc(CVAP, x4), "dc cvap, x4");
2686b8021494Sopenharmony_ci  COMPARE(dc(CIVAC, x5), "dc civac, x5");
2687b8021494Sopenharmony_ci  COMPARE(dc(CVADP, x6), "dc cvadp, x6");
2688b8021494Sopenharmony_ci  COMPARE(dc(ZVA, x0), "dc zva, x0");
2689b8021494Sopenharmony_ci  COMPARE(dc(ZVA, xzr), "dc zva, xzr");
2690b8021494Sopenharmony_ci
2691b8021494Sopenharmony_ci  CLEANUP();
2692b8021494Sopenharmony_ci}
2693b8021494Sopenharmony_ci
2694b8021494Sopenharmony_ciTEST(system_dc_mte) {
2695b8021494Sopenharmony_ci  SETUP();
2696b8021494Sopenharmony_ci
2697b8021494Sopenharmony_ci  COMPARE(dc(GVA, x0), "dc gva, x0");
2698b8021494Sopenharmony_ci  COMPARE(dc(GZVA, x1), "dc gzva, x1");
2699b8021494Sopenharmony_ci  COMPARE(dc(CGVAC, x2), "dc cgvac, x2");
2700b8021494Sopenharmony_ci  COMPARE(dc(CGDVAC, x3), "dc cgdvac, x3");
2701b8021494Sopenharmony_ci  COMPARE(dc(CGVAP, x3), "dc cgvap, x3");
2702b8021494Sopenharmony_ci  COMPARE(dc(CGDVAP, x3), "dc cgdvap, x3");
2703b8021494Sopenharmony_ci  COMPARE(dc(CIGVAC, x4), "dc cigvac, x4");
2704b8021494Sopenharmony_ci  COMPARE(dc(CIGDVAC, x4), "dc cigdvac, x4");
2705b8021494Sopenharmony_ci
2706b8021494Sopenharmony_ci  CLEANUP();
2707b8021494Sopenharmony_ci}
2708b8021494Sopenharmony_ci
2709b8021494Sopenharmony_ciTEST(system_nop) {
2710b8021494Sopenharmony_ci  SETUP();
2711b8021494Sopenharmony_ci
2712b8021494Sopenharmony_ci  COMPARE(nop(), "nop");
2713b8021494Sopenharmony_ci  COMPARE_MACRO(Nop(), "nop");
2714b8021494Sopenharmony_ci
2715b8021494Sopenharmony_ci  CLEANUP();
2716b8021494Sopenharmony_ci}
2717b8021494Sopenharmony_ci
2718b8021494Sopenharmony_ci
2719b8021494Sopenharmony_ciTEST(system_pauth) {
2720b8021494Sopenharmony_ci  SETUP();
2721b8021494Sopenharmony_ci
2722b8021494Sopenharmony_ci  COMPARE(pacia1716(), "pacia1716");
2723b8021494Sopenharmony_ci  COMPARE(pacib1716(), "pacib1716");
2724b8021494Sopenharmony_ci  COMPARE(paciaz(), "paciaz");
2725b8021494Sopenharmony_ci  COMPARE(pacibz(), "pacibz");
2726b8021494Sopenharmony_ci  COMPARE(paciasp(), "paciasp");
2727b8021494Sopenharmony_ci  COMPARE(pacibsp(), "pacibsp");
2728b8021494Sopenharmony_ci  COMPARE(autia1716(), "autia1716");
2729b8021494Sopenharmony_ci  COMPARE(autib1716(), "autib1716");
2730b8021494Sopenharmony_ci  COMPARE(autiaz(), "autiaz");
2731b8021494Sopenharmony_ci  COMPARE(autibz(), "autibz");
2732b8021494Sopenharmony_ci  COMPARE(autiasp(), "autiasp");
2733b8021494Sopenharmony_ci  COMPARE(autibsp(), "autibsp");
2734b8021494Sopenharmony_ci  COMPARE(xpaclri(), "xpaclri");
2735b8021494Sopenharmony_ci
2736b8021494Sopenharmony_ci  CLEANUP();
2737b8021494Sopenharmony_ci}
2738b8021494Sopenharmony_ci
2739b8021494Sopenharmony_ci
2740b8021494Sopenharmony_ciTEST(unreachable) {
2741b8021494Sopenharmony_ci  SETUP();
2742b8021494Sopenharmony_ci
2743b8021494Sopenharmony_ci  VIXL_ASSERT(kUnreachableOpcode == 0xdeb0);
2744b8021494Sopenharmony_ci#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
2745b8021494Sopenharmony_ci  COMPARE_MACRO(Unreachable(), "hlt #0xdeb0");
2746b8021494Sopenharmony_ci#else
2747b8021494Sopenharmony_ci  COMPARE_MACRO(Unreachable(), "udf #0xdeb0");
2748b8021494Sopenharmony_ci#endif
2749b8021494Sopenharmony_ci
2750b8021494Sopenharmony_ci  CLEANUP();
2751b8021494Sopenharmony_ci}
2752b8021494Sopenharmony_ci
2753b8021494Sopenharmony_ci
2754b8021494Sopenharmony_ci#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
2755b8021494Sopenharmony_ciTEST(trace) {
2756b8021494Sopenharmony_ci  SETUP();
2757b8021494Sopenharmony_ci
2758b8021494Sopenharmony_ci  VIXL_ASSERT(kTraceOpcode == 0xdeb2);
2759b8021494Sopenharmony_ci
2760b8021494Sopenharmony_ci  // All Trace calls should produce the same instruction.
2761b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Trace(LOG_ALL, TRACE_ENABLE), "hlt #0xdeb2");
2762b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Trace(LOG_REGS, TRACE_DISABLE), "hlt #0xdeb2");
2763b8021494Sopenharmony_ci
2764b8021494Sopenharmony_ci  CLEANUP();
2765b8021494Sopenharmony_ci}
2766b8021494Sopenharmony_ci#endif
2767b8021494Sopenharmony_ci
2768b8021494Sopenharmony_ci
2769b8021494Sopenharmony_ci#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
2770b8021494Sopenharmony_ciTEST(log) {
2771b8021494Sopenharmony_ci  SETUP();
2772b8021494Sopenharmony_ci
2773b8021494Sopenharmony_ci  VIXL_ASSERT(kLogOpcode == 0xdeb3);
2774b8021494Sopenharmony_ci
2775b8021494Sopenharmony_ci  // All Log calls should produce the same instruction.
2776b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Log(LOG_ALL), "hlt #0xdeb3");
2777b8021494Sopenharmony_ci  COMPARE_MACRO_PREFIX(Log(LOG_SYSREGS), "hlt #0xdeb3");
2778b8021494Sopenharmony_ci
2779b8021494Sopenharmony_ci  CLEANUP();
2780b8021494Sopenharmony_ci}
2781b8021494Sopenharmony_ci#endif
2782b8021494Sopenharmony_ci
2783b8021494Sopenharmony_ci
2784b8021494Sopenharmony_ciTEST(hlt) {
2785b8021494Sopenharmony_ci  SETUP();
2786b8021494Sopenharmony_ci
2787b8021494Sopenharmony_ci  COMPARE(hlt(0), "hlt #0x0");
2788b8021494Sopenharmony_ci  COMPARE(hlt(1), "hlt #0x1");
2789b8021494Sopenharmony_ci  COMPARE(hlt(65535), "hlt #0xffff");
2790b8021494Sopenharmony_ci
2791b8021494Sopenharmony_ci  CLEANUP();
2792b8021494Sopenharmony_ci}
2793b8021494Sopenharmony_ci
2794b8021494Sopenharmony_ci
2795b8021494Sopenharmony_ciTEST(brk) {
2796b8021494Sopenharmony_ci  SETUP();
2797b8021494Sopenharmony_ci
2798b8021494Sopenharmony_ci  COMPARE(brk(0), "brk #0x0");
2799b8021494Sopenharmony_ci  COMPARE(brk(1), "brk #0x1");
2800b8021494Sopenharmony_ci  COMPARE(brk(65535), "brk #0xffff");
2801b8021494Sopenharmony_ci
2802b8021494Sopenharmony_ci  CLEANUP();
2803b8021494Sopenharmony_ci}
2804b8021494Sopenharmony_ci
2805b8021494Sopenharmony_ci
2806b8021494Sopenharmony_ciTEST(svc) {
2807b8021494Sopenharmony_ci  SETUP();
2808b8021494Sopenharmony_ci
2809b8021494Sopenharmony_ci  COMPARE(svc(0), "svc #0x0");
2810b8021494Sopenharmony_ci  COMPARE(svc(1), "svc #0x1");
2811b8021494Sopenharmony_ci  COMPARE(svc(65535), "svc #0xffff");
2812b8021494Sopenharmony_ci
2813b8021494Sopenharmony_ci  CLEANUP();
2814b8021494Sopenharmony_ci}
2815b8021494Sopenharmony_ci
2816b8021494Sopenharmony_ci
2817b8021494Sopenharmony_ciTEST(add_sub_negative) {
2818b8021494Sopenharmony_ci  SETUP();
2819b8021494Sopenharmony_ci
2820b8021494Sopenharmony_ci  COMPARE_MACRO(Add(x10, x0, -42), "sub x10, x0, #0x2a (42)");
2821b8021494Sopenharmony_ci  COMPARE_MACRO(Add(x11, x1, -687), "sub x11, x1, #0x2af (687)");
2822b8021494Sopenharmony_ci  COMPARE_MACRO(Add(x12, x2, -0x88), "sub x12, x2, #0x88 (136)");
2823b8021494Sopenharmony_ci
2824b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(x13, x0, -600), "add x13, x0, #0x258 (600)");
2825b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(x14, x1, -313), "add x14, x1, #0x139 (313)");
2826b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(x15, x2, -0x555), "add x15, x2, #0x555 (1365)");
2827b8021494Sopenharmony_ci
2828b8021494Sopenharmony_ci  COMPARE_MACRO(Add(w19, w3, -0x344), "sub w19, w3, #0x344 (836)");
2829b8021494Sopenharmony_ci  COMPARE_MACRO(Add(w20, w4, -2000), "sub w20, w4, #0x7d0 (2000)");
2830b8021494Sopenharmony_ci
2831b8021494Sopenharmony_ci  COMPARE_MACRO(Add(w0, w1, 5, LeaveFlags), "add w0, w1, #0x5 (5)");
2832b8021494Sopenharmony_ci  COMPARE_MACRO(Add(w1, w2, 15, SetFlags), "adds w1, w2, #0xf (15)");
2833b8021494Sopenharmony_ci
2834b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(w0, w1, 5, LeaveFlags), "sub w0, w1, #0x5 (5)");
2835b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(w1, w2, 15, SetFlags), "subs w1, w2, #0xf (15)");
2836b8021494Sopenharmony_ci
2837b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(w21, w3, -0xbc), "add w21, w3, #0xbc (188)");
2838b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(w22, w4, -2000), "add w22, w4, #0x7d0 (2000)");
2839b8021494Sopenharmony_ci
2840b8021494Sopenharmony_ci  COMPARE_MACRO(Cmp(w0, -1), "cmn w0, #0x1 (1)");
2841b8021494Sopenharmony_ci  COMPARE_MACRO(Cmp(x1, -1), "cmn x1, #0x1 (1)");
2842b8021494Sopenharmony_ci  COMPARE_MACRO(Cmp(w2, -4095), "cmn w2, #0xfff (4095)");
2843b8021494Sopenharmony_ci  COMPARE_MACRO(Cmp(x3, -4095), "cmn x3, #0xfff (4095)");
2844b8021494Sopenharmony_ci
2845b8021494Sopenharmony_ci  COMPARE_MACRO(Cmn(w0, -1), "cmp w0, #0x1 (1)");
2846b8021494Sopenharmony_ci  COMPARE_MACRO(Cmn(x1, -1), "cmp x1, #0x1 (1)");
2847b8021494Sopenharmony_ci  COMPARE_MACRO(Cmn(w2, -4095), "cmp w2, #0xfff (4095)");
2848b8021494Sopenharmony_ci  COMPARE_MACRO(Cmn(x3, -4095), "cmp x3, #0xfff (4095)");
2849b8021494Sopenharmony_ci
2850b8021494Sopenharmony_ci  CLEANUP();
2851b8021494Sopenharmony_ci}
2852b8021494Sopenharmony_ci
2853b8021494Sopenharmony_ciTEST(add_sub_macro) {
2854b8021494Sopenharmony_ci  SETUP();
2855b8021494Sopenharmony_ci
2856b8021494Sopenharmony_ci  // Add and Sub use their destination register as a scratch if they can.
2857b8021494Sopenharmony_ci  COMPARE_MACRO(Add(x0, x1, 0x4242),
2858b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2859b8021494Sopenharmony_ci                "add x0, x1, x0");
2860b8021494Sopenharmony_ci  COMPARE_MACRO(Add(x0, x0, 0x4242),
2861b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
2862b8021494Sopenharmony_ci                "add x0, x0, x16");
2863b8021494Sopenharmony_ci  COMPARE_MACRO(Adds(x0, xzr, Operand(w1, SXTW)),
2864b8021494Sopenharmony_ci                "sxtw x0, w1\n"
2865b8021494Sopenharmony_ci                "adds x0, xzr, x0");
2866b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(x0, x1, 0x4242),
2867b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2868b8021494Sopenharmony_ci                "sub x0, x1, x0");
2869b8021494Sopenharmony_ci  COMPARE_MACRO(Sub(x0, x0, 0x4242),
2870b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
2871b8021494Sopenharmony_ci                "sub x0, x0, x16");
2872b8021494Sopenharmony_ci  COMPARE_MACRO(Subs(x0, xzr, Operand(w1, SXTW)),
2873b8021494Sopenharmony_ci                "sxtw x0, w1\n"
2874b8021494Sopenharmony_ci                "negs x0, x0");
2875b8021494Sopenharmony_ci}
2876b8021494Sopenharmony_ci
2877b8021494Sopenharmony_ciTEST(adc_sbc_macro) {
2878b8021494Sopenharmony_ci  SETUP();
2879b8021494Sopenharmony_ci
2880b8021494Sopenharmony_ci  // Adc and Sbc use their destination register as a scratch if they can.
2881b8021494Sopenharmony_ci  COMPARE_MACRO(Adc(x0, x1, 0x4242),
2882b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2883b8021494Sopenharmony_ci                "adc x0, x1, x0");
2884b8021494Sopenharmony_ci  COMPARE_MACRO(Adc(x0, x0, 0x4242),
2885b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
2886b8021494Sopenharmony_ci                "adc x0, x0, x16");
2887b8021494Sopenharmony_ci  COMPARE_MACRO(Adcs(x0, xzr, Operand(w1, SXTW)),
2888b8021494Sopenharmony_ci                "sxtw x0, w1\n"
2889b8021494Sopenharmony_ci                "adcs x0, xzr, x0");
2890b8021494Sopenharmony_ci  COMPARE_MACRO(Sbc(x0, x1, 0x4242),
2891b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2892b8021494Sopenharmony_ci                "sbc x0, x1, x0");
2893b8021494Sopenharmony_ci  COMPARE_MACRO(Sbc(x0, x0, 0x4242),
2894b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
2895b8021494Sopenharmony_ci                "sbc x0, x0, x16");
2896b8021494Sopenharmony_ci  COMPARE_MACRO(Sbcs(x0, xzr, Operand(w1, SXTW)),
2897b8021494Sopenharmony_ci                "sxtw x0, w1\n"
2898b8021494Sopenharmony_ci                "ngcs x0, x0");
2899b8021494Sopenharmony_ci}
2900b8021494Sopenharmony_ci
2901b8021494Sopenharmony_ciTEST(logical_immediate_move) {
2902b8021494Sopenharmony_ci  SETUP();
2903b8021494Sopenharmony_ci
2904b8021494Sopenharmony_ci  COMPARE_MACRO(And(w0, w1, 0), "mov w0, #0x0");
2905b8021494Sopenharmony_ci  COMPARE_MACRO(And(x0, x1, 0), "mov x0, #0x0");
2906b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(w2, w3, 0), "mov w2, w3");
2907b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(x2, x3, 0), "mov x2, x3");
2908b8021494Sopenharmony_ci  COMPARE_MACRO(Eor(w4, w5, 0), "mov w4, w5");
2909b8021494Sopenharmony_ci  COMPARE_MACRO(Eor(x4, x5, 0), "mov x4, x5");
2910b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(w6, w7, 0), "mov w6, w7");
2911b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(x6, x7, 0), "mov x6, x7");
2912b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(w8, w9, 0), "mov w8, #0xffffffff");
2913b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(x8, x9, 0), "mov x8, #0xffffffffffffffff");
2914b8021494Sopenharmony_ci  COMPARE_MACRO(Eon(w10, w11, 0), "mvn w10, w11");
2915b8021494Sopenharmony_ci  COMPARE_MACRO(Eon(x10, x11, 0), "mvn x10, x11");
2916b8021494Sopenharmony_ci
2917b8021494Sopenharmony_ci  COMPARE_MACRO(And(w12, w13, 0xffffffff), "mov w12, w13");
2918b8021494Sopenharmony_ci  COMPARE_MACRO(And(x12, x13, 0xffffffff), "and x12, x13, #0xffffffff");
2919b8021494Sopenharmony_ci  COMPARE_MACRO(And(x12, x13, 0xffffffffffffffff), "mov x12, x13");
2920b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(w14, w15, 0xffffffff), "mov w14, #0xffffffff");
2921b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(x14, x15, 0xffffffff), "orr x14, x15, #0xffffffff");
2922b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(x14, x15, 0xffffffffffffffff),
2923b8021494Sopenharmony_ci                "mov x14, #0xffffffffffffffff");
2924b8021494Sopenharmony_ci  COMPARE_MACRO(Eor(w16, w17, 0xffffffff), "mvn w16, w17");
2925b8021494Sopenharmony_ci  COMPARE_MACRO(Eor(x16, x17, 0xffffffff), "eor x16, x17, #0xffffffff");
2926b8021494Sopenharmony_ci  COMPARE_MACRO(Eor(x16, x17, 0xffffffffffffffff), "mvn x16, x17");
2927b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(w18, w19, 0xffffffff), "mov w18, #0x0");
2928b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(x18, x19, 0xffffffff), "and x18, x19, #0xffffffff00000000");
2929b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(x18, x19, 0xffffffffffffffff), "mov x18, #0x0");
2930b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(w20, w21, 0xffffffff), "mov w20, w21");
2931b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(x20, x21, 0xffffffff), "orr x20, x21, #0xffffffff00000000");
2932b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(x20, x21, 0xffffffffffffffff), "mov x20, x21");
2933b8021494Sopenharmony_ci  COMPARE_MACRO(Eon(w22, w23, 0xffffffff), "mov w22, w23");
2934b8021494Sopenharmony_ci  COMPARE_MACRO(Eon(x22, x23, 0xffffffff), "eor x22, x23, #0xffffffff00000000");
2935b8021494Sopenharmony_ci  COMPARE_MACRO(Eon(x22, x23, 0xffffffffffffffff), "mov x22, x23");
2936b8021494Sopenharmony_ci
2937b8021494Sopenharmony_ci  // Test stack pointer with non encodable immediate.
2938b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(wsp, w5, 0x1234),
2939b8021494Sopenharmony_ci                "mov w16, #0x1234\n"
2940b8021494Sopenharmony_ci                "orr w16, w5, w16\n"
2941b8021494Sopenharmony_ci                "mov wsp, w16");
2942b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(sp, x15, 0x123),
2943b8021494Sopenharmony_ci                "mov x16, #0x123\n"
2944b8021494Sopenharmony_ci                "orr x16, x15, x16\n"
2945b8021494Sopenharmony_ci                "mov sp, x16");
2946b8021494Sopenharmony_ci
2947b8021494Sopenharmony_ci  CLEANUP();
2948b8021494Sopenharmony_ci}
2949b8021494Sopenharmony_ci
2950b8021494Sopenharmony_ciTEST(logical_macro) {
2951b8021494Sopenharmony_ci  SETUP();
2952b8021494Sopenharmony_ci
2953b8021494Sopenharmony_ci  // LogicalMacro uses the destination register as a scratch if it can.
2954b8021494Sopenharmony_ci  COMPARE_MACRO(And(x0, x1, 0x4242),
2955b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2956b8021494Sopenharmony_ci                "and x0, x1, x0");
2957b8021494Sopenharmony_ci  COMPARE_MACRO(Bic(x0, x0, 0x4242),
2958b8021494Sopenharmony_ci                "mov x16, #0xffffffffffffbdbd\n"
2959b8021494Sopenharmony_ci                "and x0, x0, x16");
2960b8021494Sopenharmony_ci  COMPARE_MACRO(Orn(x0, xzr, Operand(w1, SXTW)),
2961b8021494Sopenharmony_ci                "sxtw x0, w1\n"
2962b8021494Sopenharmony_ci                "mvn x0, x0");
2963b8021494Sopenharmony_ci  COMPARE_MACRO(Orr(x0, x1, 0x4242),
2964b8021494Sopenharmony_ci                "mov x0, #0x4242\n"
2965b8021494Sopenharmony_ci                "orr x0, x1, x0");
2966b8021494Sopenharmony_ci  COMPARE_MACRO(Ands(x0, x0, 0x4242),
2967b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
2968b8021494Sopenharmony_ci                "ands x0, x0, x16");
2969b8021494Sopenharmony_ci  COMPARE_MACRO(Tst(xzr, Operand(w1, SXTW)),
2970b8021494Sopenharmony_ci                "sxtw x16, w1\n"
2971b8021494Sopenharmony_ci                "tst xzr, x16");
2972b8021494Sopenharmony_ci}
2973b8021494Sopenharmony_ci
2974b8021494Sopenharmony_ciTEST(barriers) {
2975b8021494Sopenharmony_ci  SETUP();
2976b8021494Sopenharmony_ci
2977b8021494Sopenharmony_ci  // DMB
2978b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(FullSystem, BarrierAll), "dmb sy");
2979b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(FullSystem, BarrierReads), "dmb ld");
2980b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(FullSystem, BarrierWrites), "dmb st");
2981b8021494Sopenharmony_ci
2982b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(InnerShareable, BarrierAll), "dmb ish");
2983b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(InnerShareable, BarrierReads), "dmb ishld");
2984b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(InnerShareable, BarrierWrites), "dmb ishst");
2985b8021494Sopenharmony_ci
2986b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(NonShareable, BarrierAll), "dmb nsh");
2987b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(NonShareable, BarrierReads), "dmb nshld");
2988b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(NonShareable, BarrierWrites), "dmb nshst");
2989b8021494Sopenharmony_ci
2990b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(OuterShareable, BarrierAll), "dmb osh");
2991b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(OuterShareable, BarrierReads), "dmb oshld");
2992b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(OuterShareable, BarrierWrites), "dmb oshst");
2993b8021494Sopenharmony_ci
2994b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(FullSystem, BarrierOther), "dmb sy (0b1100)");
2995b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(InnerShareable, BarrierOther), "dmb sy (0b1000)");
2996b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(NonShareable, BarrierOther), "dmb sy (0b0100)");
2997b8021494Sopenharmony_ci  COMPARE_MACRO(Dmb(OuterShareable, BarrierOther), "dmb sy (0b0000)");
2998b8021494Sopenharmony_ci
2999b8021494Sopenharmony_ci  // DSB
3000b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(FullSystem, BarrierAll), "dsb sy");
3001b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(FullSystem, BarrierReads), "dsb ld");
3002b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(FullSystem, BarrierWrites), "dsb st");
3003b8021494Sopenharmony_ci
3004b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(InnerShareable, BarrierAll), "dsb ish");
3005b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(InnerShareable, BarrierReads), "dsb ishld");
3006b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(InnerShareable, BarrierWrites), "dsb ishst");
3007b8021494Sopenharmony_ci
3008b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(NonShareable, BarrierAll), "dsb nsh");
3009b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(NonShareable, BarrierReads), "dsb nshld");
3010b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(NonShareable, BarrierWrites), "dsb nshst");
3011b8021494Sopenharmony_ci
3012b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(OuterShareable, BarrierAll), "dsb osh");
3013b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(OuterShareable, BarrierReads), "dsb oshld");
3014b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(OuterShareable, BarrierWrites), "dsb oshst");
3015b8021494Sopenharmony_ci
3016b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)");
3017b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)");
3018b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(NonShareable, BarrierOther), "pssbb");
3019b8021494Sopenharmony_ci  COMPARE_MACRO(Dsb(OuterShareable, BarrierOther), "ssbb");
3020b8021494Sopenharmony_ci
3021b8021494Sopenharmony_ci  // ISB
3022b8021494Sopenharmony_ci  COMPARE_MACRO(Isb(), "isb");
3023b8021494Sopenharmony_ci
3024b8021494Sopenharmony_ci  // ESB
3025b8021494Sopenharmony_ci  COMPARE_MACRO(Esb(), "esb");
3026b8021494Sopenharmony_ci
3027b8021494Sopenharmony_ci  // CSDB
3028b8021494Sopenharmony_ci  COMPARE_MACRO(Csdb(), "csdb");
3029b8021494Sopenharmony_ci
3030b8021494Sopenharmony_ci  CLEANUP();
3031b8021494Sopenharmony_ci}
3032b8021494Sopenharmony_ci
3033b8021494Sopenharmony_ciTEST(address_map) {
3034b8021494Sopenharmony_ci  // Check that we can disassemble from a fake base address.
3035b8021494Sopenharmony_ci  SETUP();
3036b8021494Sopenharmony_ci
3037b8021494Sopenharmony_ci  disasm.MapCodeAddress(0, masm.GetBuffer()->GetStartAddress<Instruction*>());
3038b8021494Sopenharmony_ci  COMPARE(ldr(x0, INT64_C(0)), "ldr x0, pc+0 (addr 0x0)");
3039b8021494Sopenharmony_ci  COMPARE(ldr(x0, -1), "ldr x0, pc-4 (addr -0x4)");
3040b8021494Sopenharmony_ci  COMPARE(ldr(x0, 1), "ldr x0, pc+4 (addr 0x4)");
3041b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, INT64_C(0)), "prfm plil1keep, pc+0 (addr 0x0)");
3042b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, -1), "prfm plil1keep, pc-4 (addr -0x4)");
3043b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, 1), "prfm plil1keep, pc+4 (addr 0x4)");
3044b8021494Sopenharmony_ci  COMPARE(adr(x0, INT64_C(0)), "adr x0, #+0x0 (addr 0x0)");
3045b8021494Sopenharmony_ci  COMPARE(adr(x0, -1), "adr x0, #-0x1 (addr -0x1)");
3046b8021494Sopenharmony_ci  COMPARE(adr(x0, 1), "adr x0, #+0x1 (addr 0x1)");
3047b8021494Sopenharmony_ci  COMPARE(adrp(x0, INT64_C(0)), "adrp x0, #+0x0 (addr 0x0)");
3048b8021494Sopenharmony_ci  COMPARE(adrp(x0, -1), "adrp x0, #-0x1000 (addr -0x1000)");
3049b8021494Sopenharmony_ci  COMPARE(adrp(x0, 1), "adrp x0, #+0x1000 (addr 0x1000)");
3050b8021494Sopenharmony_ci  COMPARE(b(INT64_C(0)), "b #+0x0 (addr 0x0)");
3051b8021494Sopenharmony_ci  COMPARE(b(-1), "b #-0x4 (addr -0x4)");
3052b8021494Sopenharmony_ci  COMPARE(b(1), "b #+0x4 (addr 0x4)");
3053b8021494Sopenharmony_ci
3054b8021494Sopenharmony_ci  disasm.MapCodeAddress(0x1234,
3055b8021494Sopenharmony_ci                        masm.GetBuffer()->GetStartAddress<Instruction*>());
3056b8021494Sopenharmony_ci  COMPARE(ldr(x0, INT64_C(0)), "ldr x0, pc+0 (addr 0x1234)");
3057b8021494Sopenharmony_ci  COMPARE(ldr(x0, -1), "ldr x0, pc-4 (addr 0x1230)");
3058b8021494Sopenharmony_ci  COMPARE(ldr(x0, 1), "ldr x0, pc+4 (addr 0x1238)");
3059b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, INT64_C(0)), "prfm plil1keep, pc+0 (addr 0x1234)");
3060b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, -1), "prfm plil1keep, pc-4 (addr 0x1230)");
3061b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, 1), "prfm plil1keep, pc+4 (addr 0x1238)");
3062b8021494Sopenharmony_ci  COMPARE(adr(x0, INT64_C(0)), "adr x0, #+0x0 (addr 0x1234)");
3063b8021494Sopenharmony_ci  COMPARE(adr(x0, -1), "adr x0, #-0x1 (addr 0x1233)");
3064b8021494Sopenharmony_ci  COMPARE(adr(x0, 1), "adr x0, #+0x1 (addr 0x1235)");
3065b8021494Sopenharmony_ci  COMPARE(adrp(x0, INT64_C(0)), "adrp x0, #+0x0 (addr 0x1000)");
3066b8021494Sopenharmony_ci  COMPARE(adrp(x0, -1), "adrp x0, #-0x1000 (addr 0x0)");
3067b8021494Sopenharmony_ci  COMPARE(adrp(x0, 1), "adrp x0, #+0x1000 (addr 0x2000)");
3068b8021494Sopenharmony_ci  COMPARE(b(INT64_C(0)), "b #+0x0 (addr 0x1234)");
3069b8021494Sopenharmony_ci  COMPARE(b(-1), "b #-0x4 (addr 0x1230)");
3070b8021494Sopenharmony_ci  COMPARE(b(1), "b #+0x4 (addr 0x1238)");
3071b8021494Sopenharmony_ci
3072b8021494Sopenharmony_ci  // Check that 64-bit addresses work.
3073b8021494Sopenharmony_ci  disasm.MapCodeAddress(UINT64_C(0x100000000),
3074b8021494Sopenharmony_ci                        masm.GetBuffer()->GetStartAddress<Instruction*>());
3075b8021494Sopenharmony_ci  COMPARE(ldr(x0, INT64_C(0)), "ldr x0, pc+0 (addr 0x100000000)");
3076b8021494Sopenharmony_ci  COMPARE(ldr(x0, -1), "ldr x0, pc-4 (addr 0xfffffffc)");
3077b8021494Sopenharmony_ci  COMPARE(ldr(x0, 1), "ldr x0, pc+4 (addr 0x100000004)");
3078b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, INT64_C(0)),
3079b8021494Sopenharmony_ci          "prfm plil1keep, pc+0 (addr 0x100000000)");
3080b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, -1), "prfm plil1keep, pc-4 (addr 0xfffffffc)");
3081b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, 1), "prfm plil1keep, pc+4 (addr 0x100000004)");
3082b8021494Sopenharmony_ci  COMPARE(adr(x0, INT64_C(0)), "adr x0, #+0x0 (addr 0x100000000)");
3083b8021494Sopenharmony_ci  COMPARE(adr(x0, -1), "adr x0, #-0x1 (addr 0xffffffff)");
3084b8021494Sopenharmony_ci  COMPARE(adr(x0, 1), "adr x0, #+0x1 (addr 0x100000001)");
3085b8021494Sopenharmony_ci  COMPARE(adrp(x0, INT64_C(0)), "adrp x0, #+0x0 (addr 0x100000000)");
3086b8021494Sopenharmony_ci  COMPARE(adrp(x0, -1), "adrp x0, #-0x1000 (addr 0xfffff000)");
3087b8021494Sopenharmony_ci  COMPARE(adrp(x0, 1), "adrp x0, #+0x1000 (addr 0x100001000)");
3088b8021494Sopenharmony_ci  COMPARE(b(INT64_C(0)), "b #+0x0 (addr 0x100000000)");
3089b8021494Sopenharmony_ci  COMPARE(b(-1), "b #-0x4 (addr 0xfffffffc)");
3090b8021494Sopenharmony_ci  COMPARE(b(1), "b #+0x4 (addr 0x100000004)");
3091b8021494Sopenharmony_ci
3092b8021494Sopenharmony_ci  disasm.MapCodeAddress(0xfffffffc,
3093b8021494Sopenharmony_ci                        masm.GetBuffer()->GetStartAddress<Instruction*>());
3094b8021494Sopenharmony_ci  COMPARE(ldr(x0, 1), "ldr x0, pc+4 (addr 0x100000000)");
3095b8021494Sopenharmony_ci  COMPARE(prfm(PLIL1KEEP, 1), "prfm plil1keep, pc+4 (addr 0x100000000)");
3096b8021494Sopenharmony_ci  COMPARE(b(1), "b #+0x4 (addr 0x100000000)");
3097b8021494Sopenharmony_ci  COMPARE(adr(x0, 4), "adr x0, #+0x4 (addr 0x100000000)");
3098b8021494Sopenharmony_ci  COMPARE(adrp(x0, 1), "adrp x0, #+0x1000 (addr 0x100000000)");
3099b8021494Sopenharmony_ci
3100b8021494Sopenharmony_ci  // Check that very large offsets are handled properly. This detects misuse of
3101b8021494Sopenharmony_ci  // the host's ptrdiff_t type when run on a 32-bit host. Only adrp is capable
3102b8021494Sopenharmony_ci  // of encoding such offsets.
3103b8021494Sopenharmony_ci  disasm.MapCodeAddress(0, masm.GetBuffer()->GetStartAddress<Instruction*>());
3104b8021494Sopenharmony_ci  COMPARE(adrp(x0, 0x000fffff), "adrp x0, #+0xfffff000 (addr 0xfffff000)");
3105b8021494Sopenharmony_ci  COMPARE(adrp(x0, -0x00100000), "adrp x0, #-0x100000000 (addr -0x100000000)");
3106b8021494Sopenharmony_ci
3107b8021494Sopenharmony_ci  CLEANUP();
3108b8021494Sopenharmony_ci}
3109b8021494Sopenharmony_ci
3110b8021494Sopenharmony_ciTEST(hint) {
3111b8021494Sopenharmony_ci  SETUP();
3112b8021494Sopenharmony_ci
3113b8021494Sopenharmony_ci  // Test that we properly disassemble named and unnamed hints.
3114b8021494Sopenharmony_ci  COMPARE(hint(NOP), "nop");
3115b8021494Sopenharmony_ci  COMPARE(hint(YIELD), "yield");
3116b8021494Sopenharmony_ci  COMPARE(hint(WFE), "wfe");
3117b8021494Sopenharmony_ci  COMPARE(hint(WFI), "wfi");
3118b8021494Sopenharmony_ci  COMPARE(hint(SEV), "sev");
3119b8021494Sopenharmony_ci  COMPARE(hint(SEVL), "sevl");
3120b8021494Sopenharmony_ci  COMPARE(hint(6), "dgh");
3121b8021494Sopenharmony_ci  COMPARE(hint(ESB), "esb");
3122b8021494Sopenharmony_ci  COMPARE(hint(CSDB), "csdb");
3123b8021494Sopenharmony_ci  COMPARE(hint(42), "hint #42");
3124b8021494Sopenharmony_ci  COMPARE(hint(127), "hint #127");
3125b8021494Sopenharmony_ci
3126b8021494Sopenharmony_ci  // The MacroAssembler should simply pass through to the Assembler.
3127b8021494Sopenharmony_ci  COMPARE_MACRO(Hint(NOP), "nop");
3128b8021494Sopenharmony_ci  COMPARE_MACRO(Hint(CSDB), "csdb");
3129b8021494Sopenharmony_ci  COMPARE_MACRO(Hint(42), "hint #42");
3130b8021494Sopenharmony_ci  COMPARE_MACRO(Hint(127), "hint #127");
3131b8021494Sopenharmony_ci
3132b8021494Sopenharmony_ci  CLEANUP();
3133b8021494Sopenharmony_ci}
3134b8021494Sopenharmony_ci
3135b8021494Sopenharmony_ciTEST(bti) {
3136b8021494Sopenharmony_ci  SETUP();
3137b8021494Sopenharmony_ci
3138b8021494Sopenharmony_ci  COMPARE(bti(EmitBTI), "bti");
3139b8021494Sopenharmony_ci  COMPARE(bti(EmitBTI_c), "bti c");
3140b8021494Sopenharmony_ci  COMPARE(bti(EmitBTI_j), "bti j");
3141b8021494Sopenharmony_ci  COMPARE(bti(EmitBTI_jc), "bti jc");
3142b8021494Sopenharmony_ci  COMPARE(hint(BTI), "bti");
3143b8021494Sopenharmony_ci  COMPARE(hint(BTI_c), "bti c");
3144b8021494Sopenharmony_ci  COMPARE(hint(BTI_j), "bti j");
3145b8021494Sopenharmony_ci  COMPARE(hint(BTI_jc), "bti jc");
3146b8021494Sopenharmony_ci
3147b8021494Sopenharmony_ci  Label placeholder1, placeholder2, placeholder3, placeholder4;
3148b8021494Sopenharmony_ci  COMPARE_MACRO(Bind(&placeholder1, EmitBTI), "bti");
3149b8021494Sopenharmony_ci  COMPARE_MACRO(Bind(&placeholder2, EmitBTI_c), "bti c");
3150b8021494Sopenharmony_ci  COMPARE_MACRO(Bind(&placeholder3, EmitBTI_j), "bti j");
3151b8021494Sopenharmony_ci  COMPARE_MACRO(Bind(&placeholder4, EmitBTI_jc), "bti jc");
3152b8021494Sopenharmony_ci
3153b8021494Sopenharmony_ci  CLEANUP();
3154b8021494Sopenharmony_ci}
3155b8021494Sopenharmony_ci
3156b8021494Sopenharmony_ciTEST(udf) {
3157b8021494Sopenharmony_ci  SETUP();
3158b8021494Sopenharmony_ci
3159b8021494Sopenharmony_ci  COMPARE(udf(0), "udf #0x0");
3160b8021494Sopenharmony_ci  COMPARE(udf(0x1234), "udf #0x1234");
3161b8021494Sopenharmony_ci  COMPARE(udf(0xffff), "udf #0xffff");
3162b8021494Sopenharmony_ci
3163b8021494Sopenharmony_ci  // UDF gives the useful property that zero-initialised memory is guaranteed to
3164b8021494Sopenharmony_ci  // generate undefined instruction exceptions.
3165b8021494Sopenharmony_ci  COMPARE(dc(0), "udf #0x0");
3166b8021494Sopenharmony_ci
3167b8021494Sopenharmony_ci  // Check related unallocated bit patterns from the reserved block.
3168b8021494Sopenharmony_ci  COMPARE(dc(0x00010000), "unallocated (Unallocated)");
3169b8021494Sopenharmony_ci  COMPARE(dc(0x01000000), "unallocated (Unallocated)");
3170b8021494Sopenharmony_ci  COMPARE(dc(0x20000000), "unallocated (Unallocated)");
3171b8021494Sopenharmony_ci  COMPARE(dc(0x80000000), "unallocated (Unallocated)");
3172b8021494Sopenharmony_ci
3173b8021494Sopenharmony_ci  CLEANUP();
3174b8021494Sopenharmony_ci}
3175b8021494Sopenharmony_ci
3176b8021494Sopenharmony_ciTEST(mte) {
3177b8021494Sopenharmony_ci  SETUP();
3178b8021494Sopenharmony_ci
3179b8021494Sopenharmony_ci#if 0
3180b8021494Sopenharmony_ci  COMPARE(ldg(x2, x2, int imm9), "ldg <Xt>, [<Xn|SP>{, #<simm>}]");
3181b8021494Sopenharmony_ci  COMPARE(st2g(x3, int imm9), "st2g <Xt|SP>, [<Xn|SP>{, #<simm>}]");
3182b8021494Sopenharmony_ci  COMPARE(st2g(x31, int imm9), "st2g <Xt|SP>, [<Xn|SP>], #<simm>");
3183b8021494Sopenharmony_ci  COMPARE(st2g(x30, int imm9), "st2g <Xt|SP>, [<Xn|SP>, #<simm>]!");
3184b8021494Sopenharmony_ci  COMPARE(stgp(x301, x302, x30, int imm7), "stgp <Xt1>, <Xt2>, [<Xn|SP>{, #<imm>}]");
3185b8021494Sopenharmony_ci  COMPARE(stgp(x201, x202, x20, int imm7), "stgp <Xt1>, <Xt2>, [<Xn|SP>], #<imm>");
3186b8021494Sopenharmony_ci  COMPARE(stgp(x161, x162, x16, int imm7), "stgp <Xt1>, <Xt2>, [<Xn|SP>, #<imm>]!");
3187b8021494Sopenharmony_ci  COMPARE(stg(x9, int imm9), "stg <Xt|SP>, [<Xn|SP>{, #<simm>}]");
3188b8021494Sopenharmony_ci  COMPARE(stg(x20, int imm9), "stg <Xt|SP>, [<Xn|SP>], #<simm>");
3189b8021494Sopenharmony_ci  COMPARE(stg(x29, int imm9), "stg <Xt|SP>, [<Xn|SP>, #<simm>]!");
3190b8021494Sopenharmony_ci  COMPARE(stz2g(x9, int imm9), "stz2g <Xt|SP>, [<Xn|SP>{, #<simm>}]");
3191b8021494Sopenharmony_ci  COMPARE(stz2g(x28, int imm9), "stz2g <Xt|SP>, [<Xn|SP>], #<simm>");
3192b8021494Sopenharmony_ci  COMPARE(stz2g(x7, int imm9), "stz2g <Xt|SP>, [<Xn|SP>, #<simm>]!");
3193b8021494Sopenharmony_ci  COMPARE(stzg(x20, int imm9), "stzg <Xt|SP>, [<Xn|SP>{, #<simm>}]");
3194b8021494Sopenharmony_ci  COMPARE(stzg(x6, int imm9), "stzg <Xt|SP>, [<Xn|SP>], #<simm>");
3195b8021494Sopenharmony_ci  COMPARE(stzg(x28, int imm9), "stzg <Xt|SP>, [<Xn|SP>, #<simm>]!");
3196b8021494Sopenharmony_ci#endif
3197b8021494Sopenharmony_ci
3198b8021494Sopenharmony_ci  CLEANUP();
3199b8021494Sopenharmony_ci}
3200b8021494Sopenharmony_ci
3201b8021494Sopenharmony_ciTEST(mte_dp) {
3202b8021494Sopenharmony_ci  SETUP();
3203b8021494Sopenharmony_ci
3204b8021494Sopenharmony_ci  COMPARE(addg(x26, x27, 0, 0), "addg x26, x27, #0, #0");
3205b8021494Sopenharmony_ci  COMPARE(addg(x26, x27, 512, 2), "addg x26, x27, #512, #2");
3206b8021494Sopenharmony_ci  COMPARE(addg(x26, x27, 1008, 15), "addg x26, x27, #1008, #15");
3207b8021494Sopenharmony_ci  COMPARE(addg(sp, x27, 1008, 15), "addg sp, x27, #1008, #15");
3208b8021494Sopenharmony_ci  COMPARE(addg(x26, sp, 1008, 15), "addg x26, sp, #1008, #15");
3209b8021494Sopenharmony_ci  COMPARE(addg(sp, sp, 1008, 15), "addg sp, sp, #1008, #15");
3210b8021494Sopenharmony_ci  COMPARE(subg(x6, x7, 0, 0), "subg x6, x7, #0, #0");
3211b8021494Sopenharmony_ci  COMPARE(subg(x6, x7, 640, 9), "subg x6, x7, #640, #9");
3212b8021494Sopenharmony_ci  COMPARE(subg(x6, x7, 1008, 15), "subg x6, x7, #1008, #15");
3213b8021494Sopenharmony_ci  COMPARE(subg(sp, x7, 1008, 15), "subg sp, x7, #1008, #15");
3214b8021494Sopenharmony_ci  COMPARE(subg(x6, sp, 1008, 15), "subg x6, sp, #1008, #15");
3215b8021494Sopenharmony_ci  COMPARE(subg(sp, sp, 1008, 15), "subg sp, sp, #1008, #15");
3216b8021494Sopenharmony_ci  COMPARE(gmi(x3, x5, x4), "gmi x3, x5, x4");
3217b8021494Sopenharmony_ci  COMPARE(gmi(x3, sp, x4), "gmi x3, sp, x4");
3218b8021494Sopenharmony_ci  COMPARE(gmi(xzr, sp, xzr), "gmi xzr, sp, xzr");
3219b8021494Sopenharmony_ci  COMPARE(irg(x24, x23, x22), "irg x24, x23, x22");
3220b8021494Sopenharmony_ci  COMPARE(irg(sp, x23, x22), "irg sp, x23, x22");
3221b8021494Sopenharmony_ci  COMPARE(irg(x24, sp, x22), "irg x24, sp, x22");
3222b8021494Sopenharmony_ci  COMPARE(irg(sp, sp, x22), "irg sp, sp, x22");
3223b8021494Sopenharmony_ci  COMPARE(irg(x24, x23, xzr), "irg x24, x23");
3224b8021494Sopenharmony_ci  COMPARE(irg(x24, x23), "irg x24, x23");
3225b8021494Sopenharmony_ci  COMPARE(subp(x28, x29, x30), "subp x28, x29, x30");
3226b8021494Sopenharmony_ci  COMPARE(subp(x28, sp, x30), "subp x28, sp, x30");
3227b8021494Sopenharmony_ci  COMPARE(subp(x28, x29, sp), "subp x28, x29, sp");
3228b8021494Sopenharmony_ci  COMPARE(subp(x28, sp, sp), "subp x28, sp, sp");
3229b8021494Sopenharmony_ci  COMPARE(subp(xzr, sp, sp), "subp xzr, sp, sp");
3230b8021494Sopenharmony_ci  COMPARE(subps(x2, x10, x0), "subps x2, x10, x0");
3231b8021494Sopenharmony_ci  COMPARE(subps(x2, sp, x0), "subps x2, sp, x0");
3232b8021494Sopenharmony_ci  COMPARE(subps(x2, x10, sp), "subps x2, x10, sp");
3233b8021494Sopenharmony_ci  COMPARE(subps(x2, sp, sp), "subps x2, sp, sp");
3234b8021494Sopenharmony_ci  COMPARE(subps(xzr, sp, sp), "cmpp sp, sp");
3235b8021494Sopenharmony_ci  COMPARE(subps(xzr, x2, sp), "cmpp x2, sp");
3236b8021494Sopenharmony_ci  COMPARE(cmpp(x6, x30), "cmpp x6, x30");
3237b8021494Sopenharmony_ci
3238b8021494Sopenharmony_ci  CLEANUP();
3239b8021494Sopenharmony_ci}
3240b8021494Sopenharmony_ci
3241b8021494Sopenharmony_ciTEST(mops) {
3242b8021494Sopenharmony_ci  SETUP();
3243b8021494Sopenharmony_ci
3244b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyen(x4, x5, x6), "cpyen [x4]!, [x5]!, x6!");
3245b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyern(x7, x6, x1), "cpyern [x7]!, [x6]!, x1!");
3246b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyewn(x26, x27, x28), "cpyewn [x26]!, [x27]!, x28!");
3247b8021494Sopenharmony_ci  COMPARE_MACRO(Cpye(x14, x15, x19), "cpye [x14]!, [x15]!, x19!");
3248b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfen(x13, x1, x9), "cpyfen [x13]!, [x1]!, x9!");
3249b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfern(x24, x2, x10), "cpyfern [x24]!, [x2]!, x10!");
3250b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfewn(x12, x2, x11), "cpyfewn [x12]!, [x2]!, x11!");
3251b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfe(x3, x9, x12), "cpyfe [x3]!, [x9]!, x12!");
3252b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfmn(x7, x27, x13), "cpyfmn [x7]!, [x27]!, x13!");
3253b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfmrn(x19, x9, x14), "cpyfmrn [x19]!, [x9]!, x14!");
3254b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfmwn(x1, x11, x15), "cpyfmwn [x1]!, [x11]!, x15!");
3255b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfm(x1, x13, x16), "cpyfm [x1]!, [x13]!, x16!");
3256b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfpn(x3, x13, x17), "cpyfpn [x3]!, [x13]!, x17!");
3257b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfprn(x18, x8, x17), "cpyfprn [x18]!, [x8]!, x17!");
3258b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfpwn(x9, x29, x18), "cpyfpwn [x9]!, [x29]!, x18!");
3259b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyfp(x4, x3, x19), "cpyfp [x4]!, [x3]!, x19!");
3260b8021494Sopenharmony_ci  COMPARE_MACRO(Cpymn(x5, x15, x20), "cpymn [x5]!, [x15]!, x20!");
3261b8021494Sopenharmony_ci  COMPARE_MACRO(Cpymrn(x12, x22, x21), "cpymrn [x12]!, [x22]!, x21!");
3262b8021494Sopenharmony_ci  COMPARE_MACRO(Cpymwn(x12, x1, x22), "cpymwn [x12]!, [x1]!, x22!");
3263b8021494Sopenharmony_ci  COMPARE_MACRO(Cpym(x1, x10, x23), "cpym [x1]!, [x10]!, x23!");
3264b8021494Sopenharmony_ci  COMPARE_MACRO(Cpypn(x3, x26, x25), "cpypn [x3]!, [x26]!, x25!");
3265b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyprn(x4, x14, x24), "cpyprn [x4]!, [x14]!, x24!");
3266b8021494Sopenharmony_ci  COMPARE_MACRO(Cpypwn(x9, x29, x26), "cpypwn [x9]!, [x29]!, x26!");
3267b8021494Sopenharmony_ci  COMPARE_MACRO(Cpyp(x0, x30, x28), "cpyp [x0]!, [x30]!, x28!");
3268b8021494Sopenharmony_ci
3269b8021494Sopenharmony_ci  COMPARE_MACRO(Seten(x6, x26, x27), "seten [x6]!, x26!, x27");
3270b8021494Sopenharmony_ci  COMPARE_MACRO(Sete(x3, x23, x1), "sete [x3]!, x23!, x1");
3271b8021494Sopenharmony_ci  COMPARE_MACRO(Setgen(x6, x16, x2), "setgen [x6]!, x16!, x2");
3272b8021494Sopenharmony_ci  COMPARE_MACRO(Setge(x4, x24, x3), "setge [x4]!, x24!, x3");
3273b8021494Sopenharmony_ci  COMPARE_MACRO(Setgmn(x9, x29, x4), "setgmn [x9]!, x29!, x4");
3274b8021494Sopenharmony_ci  COMPARE_MACRO(Setgm(x30, x3, x5), "setgm [x30]!, x3!, x5");
3275b8021494Sopenharmony_ci  COMPARE_MACRO(Setgpn(x11, x1, x6), "setgpn [x11]!, x1!, x6");
3276b8021494Sopenharmony_ci  COMPARE_MACRO(Setgp(x1, x16, x7), "setgp [x1]!, x16!, x7");
3277b8021494Sopenharmony_ci  COMPARE_MACRO(Setmn(x4, x14, x8), "setmn [x4]!, x14!, x8");
3278b8021494Sopenharmony_ci  COMPARE_MACRO(Setm(x8, x7, x9), "setm [x8]!, x7!, x9");
3279b8021494Sopenharmony_ci  COMPARE_MACRO(Setpn(x2, x22, x10), "setpn [x2]!, x22!, x10");
3280b8021494Sopenharmony_ci  COMPARE_MACRO(Setp(x7, x17, x11), "setp [x7]!, x17!, x11");
3281b8021494Sopenharmony_ci
3282b8021494Sopenharmony_ci  // Check unallocated bit patterns.
3283b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d000422), "cpyp [x2]!, [x0]!, x1!");
3284b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdd000422), "unallocated");  // sz != 0
3285b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d000442), "unallocated");  // Xd == Xn
3286b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d020422), "unallocated");  // Xd == Xs
3287b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d000402), "unallocated");  // Xn == Xs
3288b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d00043f), "unallocated");  // Xd == 31
3289b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d0007e2), "unallocated");  // Xn == 31
3290b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1d1f0422), "unallocated");  // Xs == 31
3291b8021494Sopenharmony_ci
3292b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c02424), "setpn [x4]!, x1!, x0");
3293b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd9c02424), "unallocated");  // sz != 0
3294b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c0e424), "unallocated");  // op2 == 0xe
3295b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c02400), "unallocated");  // Xd == Xn
3296b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c02420), "unallocated");  // Xd == Xs
3297b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c02404), "unallocated");  // Xn == Xs
3298b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c0243f), "unallocated");  // Xd == 31
3299b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c027e4), "unallocated");  // Xn == 31
3300b8021494Sopenharmony_ci
3301b8021494Sopenharmony_ci  CLEANUP();
3302b8021494Sopenharmony_ci}
3303b8021494Sopenharmony_ci
3304b8021494Sopenharmony_ciTEST(cssc) {
3305b8021494Sopenharmony_ci  SETUP();
3306b8021494Sopenharmony_ci
3307b8021494Sopenharmony_ci  COMPARE_MACRO(Abs(w0, w22), "abs w0, w22");
3308b8021494Sopenharmony_ci  COMPARE_MACRO(Abs(x0, x23), "abs x0, x23");
3309b8021494Sopenharmony_ci  COMPARE_MACRO(Abs(wzr, wzr), "abs wzr, wzr");
3310b8021494Sopenharmony_ci  COMPARE_MACRO(Cnt(w21, w30), "cnt w21, w30");
3311b8021494Sopenharmony_ci  COMPARE_MACRO(Cnt(x19, x9), "cnt x19, x9");
3312b8021494Sopenharmony_ci  COMPARE_MACRO(Cnt(xzr, x30), "cnt xzr, x30");
3313b8021494Sopenharmony_ci  COMPARE_MACRO(Ctz(w3, w5), "ctz w3, w5");
3314b8021494Sopenharmony_ci  COMPARE_MACRO(Ctz(x3, x28), "ctz x3, x28");
3315b8021494Sopenharmony_ci  COMPARE_MACRO(Ctz(w0, wzr), "ctz w0, wzr");
3316b8021494Sopenharmony_ci
3317b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(w5, w9, w10), "smax w5, w9, w10");
3318b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(x6, x8, x9), "smax x6, x8, x9");
3319b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(w11, w8, w17), "smin w11, w8, w17");
3320b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(x12, x10, x20), "smin x12, x10, x20");
3321b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(w5, w9, w10), "umax w5, w9, w10");
3322b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(x6, x8, x9), "umax x6, x8, x9");
3323b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(w11, w8, w17), "umin w11, w8, w17");
3324b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(x12, x10, x20), "umin x12, x10, x20");
3325b8021494Sopenharmony_ci
3326b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(w5, w9, 127), "smax w5, w9, #127");
3327b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(x6, x8, -128), "smax x6, x8, #-128");
3328b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(w19, w20, -1), "smin w19, w20, #-1");
3329b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(x30, xzr, 0), "smin x30, xzr, #0");
3330b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(w5, w9, 255), "umax w5, w9, #255");
3331b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(x6, x8, 128), "umax x6, x8, #128");
3332b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(wzr, w20, 1), "umin wzr, w20, #1");
3333b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(x30, xzr, 0), "umin x30, xzr, #0");
3334b8021494Sopenharmony_ci
3335b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(w5, w6, 128),
3336b8021494Sopenharmony_ci                "mov w16, #0x80\n"
3337b8021494Sopenharmony_ci                "smax w5, w6, w16");
3338b8021494Sopenharmony_ci  COMPARE_MACRO(Smax(x10, x11, -129),
3339b8021494Sopenharmony_ci                "mov x16, #0xffffffffffffff7f\n"
3340b8021494Sopenharmony_ci                "smax x10, x11, x16");
3341b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(w5, w6, 128),
3342b8021494Sopenharmony_ci                "mov w16, #0x80\n"
3343b8021494Sopenharmony_ci                "smin w5, w6, w16");
3344b8021494Sopenharmony_ci  COMPARE_MACRO(Smin(x10, x11, -129),
3345b8021494Sopenharmony_ci                "mov x16, #0xffffffffffffff7f\n"
3346b8021494Sopenharmony_ci                "smin x10, x11, x16");
3347b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(w5, w6, 256),
3348b8021494Sopenharmony_ci                "mov w16, #0x100\n"
3349b8021494Sopenharmony_ci                "umax w5, w6, w16");
3350b8021494Sopenharmony_ci  COMPARE_MACRO(Umax(x10, x11, 0x4242),
3351b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
3352b8021494Sopenharmony_ci                "umax x10, x11, x16");
3353b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(w5, w6, 256),
3354b8021494Sopenharmony_ci                "mov w16, #0x100\n"
3355b8021494Sopenharmony_ci                "umin w5, w6, w16");
3356b8021494Sopenharmony_ci  COMPARE_MACRO(Umin(x10, x11, 0x4242),
3357b8021494Sopenharmony_ci                "mov x16, #0x4242\n"
3358b8021494Sopenharmony_ci                "umin x10, x11, x16");
3359b8021494Sopenharmony_ci  CLEANUP();
3360b8021494Sopenharmony_ci}
3361b8021494Sopenharmony_ci
3362b8021494Sopenharmony_ciTEST(architecture_features) {
3363b8021494Sopenharmony_ci  SETUP();
3364b8021494Sopenharmony_ci
3365b8021494Sopenharmony_ci  // ARMv8.1 - LOR
3366b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x089f7c00), "stllrb");  // STLLRB_SL32_ldstexcl
3367b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08df7c00), "ldlarb");  // LDLARB_LR32_ldstexcl
3368b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x489f7c00), "stllrh");  // STLLRH_SL32_ldstexcl
3369b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48df7c00), "ldlarh");  // LDLARH_LR32_ldstexcl
3370b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x889f7c00), "stllr");   // STLLR_SL32_ldstexcl
3371b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x88df7c00), "ldlar");   // LDLAR_LR32_ldstexcl
3372b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc89f7c00), "stllr");   // STLLR_SL64_ldstexcl
3373b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc8df7c00), "ldlar");   // LDLAR_LR64_ldstexcl
3374b8021494Sopenharmony_ci
3375b8021494Sopenharmony_ci  // ARMv8.1 - LSE
3376b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08207c00), "casp");       // CASP_CP32_ldstexcl
3377b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0820fc00), "caspl");      // CASPL_CP32_ldstexcl
3378b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08607c00), "caspa");      // CASPA_CP32_ldstexcl
3379b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0860fc00), "caspal");     // CASPAL_CP32_ldstexcl
3380b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08a07c00), "casb");       // CASB_C32_ldstexcl
3381b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08a0fc00), "caslb");      // CASLB_C32_ldstexcl
3382b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08e07c00), "casab");      // CASAB_C32_ldstexcl
3383b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x08e0fc00), "casalb");     // CASALB_C32_ldstexcl
3384b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38200000), "ldaddb");     // LDADDB_32_memop
3385b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38201000), "ldclrb");     // LDCLRB_32_memop
3386b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38202000), "ldeorb");     // LDEORB_32_memop
3387b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38203000), "ldsetb");     // LDSETB_32_memop
3388b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38204000), "ldsmaxb");    // LDSMAXB_32_memop
3389b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38205000), "ldsminb");    // LDSMINB_32_memop
3390b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38206000), "ldumaxb");    // LDUMAXB_32_memop
3391b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38207000), "lduminb");    // LDUMINB_32_memop
3392b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38208000), "swpb");       // SWPB_32_memop
3393b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38600000), "ldaddlb");    // LDADDLB_32_memop
3394b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38601000), "ldclrlb");    // LDCLRLB_32_memop
3395b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38602000), "ldeorlb");    // LDEORLB_32_memop
3396b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38603000), "ldsetlb");    // LDSETLB_32_memop
3397b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38604000), "ldsmaxlb");   // LDSMAXLB_32_memop
3398b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38605000), "ldsminlb");   // LDSMINLB_32_memop
3399b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38606000), "ldumaxlb");   // LDUMAXLB_32_memop
3400b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38607000), "lduminlb");   // LDUMINLB_32_memop
3401b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38608000), "swplb");      // SWPLB_32_memop
3402b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a00000), "ldaddab");    // LDADDAB_32_memop
3403b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a01000), "ldclrab");    // LDCLRAB_32_memop
3404b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a02000), "ldeorab");    // LDEORAB_32_memop
3405b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a03000), "ldsetab");    // LDSETAB_32_memop
3406b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a04000), "ldsmaxab");   // LDSMAXAB_32_memop
3407b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a05000), "ldsminab");   // LDSMINAB_32_memop
3408b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a06000), "ldumaxab");   // LDUMAXAB_32_memop
3409b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a07000), "lduminab");   // LDUMINAB_32_memop
3410b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38a08000), "swpab");      // SWPAB_32_memop
3411b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e00000), "ldaddalb");   // LDADDALB_32_memop
3412b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e01000), "ldclralb");   // LDCLRALB_32_memop
3413b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e02000), "ldeoralb");   // LDEORALB_32_memop
3414b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e03000), "ldsetalb");   // LDSETALB_32_memop
3415b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e04000), "ldsmaxalb");  // LDSMAXALB_32_memop
3416b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e05000), "ldsminalb");  // LDSMINALB_32_memop
3417b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e06000), "ldumaxalb");  // LDUMAXALB_32_memop
3418b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e07000), "lduminalb");  // LDUMINALB_32_memop
3419b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38e08000), "swpalb");     // SWPALB_32_memop
3420b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48207c00), "casp");       // CASP_CP64_ldstexcl
3421b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x4820fc00), "caspl");      // CASPL_CP64_ldstexcl
3422b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48607c00), "caspa");      // CASPA_CP64_ldstexcl
3423b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x4860fc00), "caspal");     // CASPAL_CP64_ldstexcl
3424b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48a07c00), "cash");       // CASH_C32_ldstexcl
3425b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48a0fc00), "caslh");      // CASLH_C32_ldstexcl
3426b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48e07c00), "casah");      // CASAH_C32_ldstexcl
3427b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x48e0fc00), "casalh");     // CASALH_C32_ldstexcl
3428b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78200000), "ldaddh");     // LDADDH_32_memop
3429b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78201000), "ldclrh");     // LDCLRH_32_memop
3430b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78202000), "ldeorh");     // LDEORH_32_memop
3431b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78203000), "ldseth");     // LDSETH_32_memop
3432b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78204000), "ldsmaxh");    // LDSMAXH_32_memop
3433b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78205000), "ldsminh");    // LDSMINH_32_memop
3434b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78206000), "ldumaxh");    // LDUMAXH_32_memop
3435b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78207000), "lduminh");    // LDUMINH_32_memop
3436b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78208000), "swph");       // SWPH_32_memop
3437b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78600000), "ldaddlh");    // LDADDLH_32_memop
3438b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78601000), "ldclrlh");    // LDCLRLH_32_memop
3439b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78602000), "ldeorlh");    // LDEORLH_32_memop
3440b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78603000), "ldsetlh");    // LDSETLH_32_memop
3441b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78604000), "ldsmaxlh");   // LDSMAXLH_32_memop
3442b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78605000), "ldsminlh");   // LDSMINLH_32_memop
3443b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78606000), "ldumaxlh");   // LDUMAXLH_32_memop
3444b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78607000), "lduminlh");   // LDUMINLH_32_memop
3445b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78608000), "swplh");      // SWPLH_32_memop
3446b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a00000), "ldaddah");    // LDADDAH_32_memop
3447b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a01000), "ldclrah");    // LDCLRAH_32_memop
3448b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a02000), "ldeorah");    // LDEORAH_32_memop
3449b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a03000), "ldsetah");    // LDSETAH_32_memop
3450b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a04000), "ldsmaxah");   // LDSMAXAH_32_memop
3451b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a05000), "ldsminah");   // LDSMINAH_32_memop
3452b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a06000), "ldumaxah");   // LDUMAXAH_32_memop
3453b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a07000), "lduminah");   // LDUMINAH_32_memop
3454b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78a08000), "swpah");      // SWPAH_32_memop
3455b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e00000), "ldaddalh");   // LDADDALH_32_memop
3456b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e01000), "ldclralh");   // LDCLRALH_32_memop
3457b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e02000), "ldeoralh");   // LDEORALH_32_memop
3458b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e03000), "ldsetalh");   // LDSETALH_32_memop
3459b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e04000), "ldsmaxalh");  // LDSMAXALH_32_memop
3460b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e05000), "ldsminalh");  // LDSMINALH_32_memop
3461b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e06000), "ldumaxalh");  // LDUMAXALH_32_memop
3462b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e07000), "lduminalh");  // LDUMINALH_32_memop
3463b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78e08000), "swpalh");     // SWPALH_32_memop
3464b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x88a07c00), "cas");        // CAS_C32_ldstexcl
3465b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x88a0fc00), "casl");       // CASL_C32_ldstexcl
3466b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x88e07c00), "casa");       // CASA_C32_ldstexcl
3467b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x88e0fc00), "casal");      // CASAL_C32_ldstexcl
3468b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8200000), "ldadd");      // LDADD_32_memop
3469b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8201000), "ldclr");      // LDCLR_32_memop
3470b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8202000), "ldeor");      // LDEOR_32_memop
3471b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8203000), "ldset");      // LDSET_32_memop
3472b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8204000), "ldsmax");     // LDSMAX_32_memop
3473b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8205000), "ldsmin");     // LDSMIN_32_memop
3474b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8206000), "ldumax");     // LDUMAX_32_memop
3475b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8207000), "ldumin");     // LDUMIN_32_memop
3476b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8208000), "swp");        // SWP_32_memop
3477b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8600000), "ldaddl");     // LDADDL_32_memop
3478b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8601000), "ldclrl");     // LDCLRL_32_memop
3479b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8602000), "ldeorl");     // LDEORL_32_memop
3480b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8603000), "ldsetl");     // LDSETL_32_memop
3481b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8604000), "ldsmaxl");    // LDSMAXL_32_memop
3482b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8605000), "ldsminl");    // LDSMINL_32_memop
3483b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8606000), "ldumaxl");    // LDUMAXL_32_memop
3484b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8607000), "lduminl");    // LDUMINL_32_memop
3485b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8608000), "swpl");       // SWPL_32_memop
3486b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a00000), "ldadda");     // LDADDA_32_memop
3487b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a01000), "ldclra");     // LDCLRA_32_memop
3488b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a02000), "ldeora");     // LDEORA_32_memop
3489b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a03000), "ldseta");     // LDSETA_32_memop
3490b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a04000), "ldsmaxa");    // LDSMAXA_32_memop
3491b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a05000), "ldsmina");    // LDSMINA_32_memop
3492b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a06000), "ldumaxa");    // LDUMAXA_32_memop
3493b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a07000), "ldumina");    // LDUMINA_32_memop
3494b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8a08000), "swpa");       // SWPA_32_memop
3495b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e00000), "ldaddal");    // LDADDAL_32_memop
3496b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e01000), "ldclral");    // LDCLRAL_32_memop
3497b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e02000), "ldeoral");    // LDEORAL_32_memop
3498b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e03000), "ldsetal");    // LDSETAL_32_memop
3499b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e04000), "ldsmaxal");   // LDSMAXAL_32_memop
3500b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e05000), "ldsminal");   // LDSMINAL_32_memop
3501b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e06000), "ldumaxal");   // LDUMAXAL_32_memop
3502b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e07000), "lduminal");   // LDUMINAL_32_memop
3503b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8e08000), "swpal");      // SWPAL_32_memop
3504b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc8a07c00), "cas");        // CAS_C64_ldstexcl
3505b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc8a0fc00), "casl");       // CASL_C64_ldstexcl
3506b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc8e07c00), "casa");       // CASA_C64_ldstexcl
3507b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xc8e0fc00), "casal");      // CASAL_C64_ldstexcl
3508b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8200000), "ldadd");      // LDADD_64_memop
3509b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8201000), "ldclr");      // LDCLR_64_memop
3510b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8202000), "ldeor");      // LDEOR_64_memop
3511b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8203000), "ldset");      // LDSET_64_memop
3512b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8204000), "ldsmax");     // LDSMAX_64_memop
3513b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8205000), "ldsmin");     // LDSMIN_64_memop
3514b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8206000), "ldumax");     // LDUMAX_64_memop
3515b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8207000), "ldumin");     // LDUMIN_64_memop
3516b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8208000), "swp");        // SWP_64_memop
3517b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8600000), "ldaddl");     // LDADDL_64_memop
3518b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8601000), "ldclrl");     // LDCLRL_64_memop
3519b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8602000), "ldeorl");     // LDEORL_64_memop
3520b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8603000), "ldsetl");     // LDSETL_64_memop
3521b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8604000), "ldsmaxl");    // LDSMAXL_64_memop
3522b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8605000), "ldsminl");    // LDSMINL_64_memop
3523b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8606000), "ldumaxl");    // LDUMAXL_64_memop
3524b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8607000), "lduminl");    // LDUMINL_64_memop
3525b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8608000), "swpl");       // SWPL_64_memop
3526b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a00000), "ldadda");     // LDADDA_64_memop
3527b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a01000), "ldclra");     // LDCLRA_64_memop
3528b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a02000), "ldeora");     // LDEORA_64_memop
3529b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a03000), "ldseta");     // LDSETA_64_memop
3530b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a04000), "ldsmaxa");    // LDSMAXA_64_memop
3531b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a05000), "ldsmina");    // LDSMINA_64_memop
3532b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a06000), "ldumaxa");    // LDUMAXA_64_memop
3533b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a07000), "ldumina");    // LDUMINA_64_memop
3534b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a08000), "swpa");       // SWPA_64_memop
3535b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e00000), "ldaddal");    // LDADDAL_64_memop
3536b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e01000), "ldclral");    // LDCLRAL_64_memop
3537b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e02000), "ldeoral");    // LDEORAL_64_memop
3538b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e03000), "ldsetal");    // LDSETAL_64_memop
3539b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e04000), "ldsmaxal");   // LDSMAXAL_64_memop
3540b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e05000), "ldsminal");   // LDSMINAL_64_memop
3541b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e06000), "ldumaxal");   // LDUMAXAL_64_memop
3542b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e07000), "lduminal");   // LDUMINAL_64_memop
3543b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8e08000), "swpal");      // SWPAL_64_memop
3544b8021494Sopenharmony_ci
3545b8021494Sopenharmony_ci  // ARMv8.1 - RDM
3546b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e008400), "sqrdmlah");  // SQRDMLAH_asimdsame2_only
3547b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e008c00), "sqrdmlsh");  // SQRDMLSH_asimdsame2_only
3548b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f40d000), "sqrdmlah");  // SQRDMLAH_asimdelem_R
3549b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f40f000), "sqrdmlsh");  // SQRDMLSH_asimdelem_R
3550b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e008400), "sqrdmlah");  // SQRDMLAH_asisdsame2_only
3551b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e008c00), "sqrdmlsh");  // SQRDMLSH_asisdsame2_only
3552b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7f40d000), "sqrdmlah");  // SQRDMLAH_asisdelem_R
3553b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7f40f000), "sqrdmlsh");  // SQRDMLSH_asisdelem_R
3554b8021494Sopenharmony_ci
3555b8021494Sopenharmony_ci  // ARMv8.2 - DotProd
3556b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e009400), "sdot");  // SDOT_asimdsame2_D
3557b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f00e000), "sdot");  // SDOT_asimdelem_D
3558b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e009400), "udot");  // UDOT_asimdsame2_D
3559b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f00e000), "udot");  // UDOT_asimdelem_D
3560b8021494Sopenharmony_ci
3561b8021494Sopenharmony_ci  // ARMv8.2 - FHM
3562b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20ec00), "fmlal");   // FMLAL_asimdsame_F
3563b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0ec00), "fmlsl");   // FMLSL_asimdsame_F
3564b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f800000), "fmlal");   // FMLAL_asimdelem_LH
3565b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f804000), "fmlsl");   // FMLSL_asimdelem_LH
3566b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20cc00), "fmlal2");  // FMLAL2_asimdsame_F
3567b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0cc00), "fmlsl2");  // FMLSL2_asimdsame_F
3568b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f808000), "fmlal2");  // FMLAL2_asimdelem_LH
3569b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f80c000), "fmlsl2");  // FMLSL2_asimdelem_LH
3570b8021494Sopenharmony_ci
3571b8021494Sopenharmony_ci  // ARMv8.2 - FP16
3572b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20c400), "fmaxnm");   // FMAXNM_asimdsame_only
3573b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20cc00), "fmla");     // FMLA_asimdsame_only
3574b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20d400), "fadd");     // FADD_asimdsame_only
3575b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20dc00), "fmulx");    // FMULX_asimdsame_only
3576b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20e400), "fcmeq");    // FCMEQ_asimdsame_only
3577b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20f400), "fmax");     // FMAX_asimdsame_only
3578b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e20fc00), "frecps");   // FRECPS_asimdsame_only
3579b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e218800), "frintn");   // FRINTN_asimdmisc_R
3580b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e219800), "frintm");   // FRINTM_asimdmisc_R
3581b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21a800), "fcvtns");   // FCVTNS_asimdmisc_R
3582b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21b800), "fcvtms");   // FCVTMS_asimdmisc_R
3583b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21c800), "fcvtas");   // FCVTAS_asimdmisc_R
3584b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21d800), "scvtf");    // SCVTF_asimdmisc_R
3585b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e30c800), "fmaxnmv");  // FMAXNMV_asimdall_only_H
3586b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e30f800), "fmaxv");    // FMAXV_asimdall_only_H
3587b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e400400), "fmaxnm");   // FMAXNM_asimdsamefp16_only
3588b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e400c00), "fmla");     // FMLA_asimdsamefp16_only
3589b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e401400), "fadd");     // FADD_asimdsamefp16_only
3590b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e401c00), "fmulx");    // FMULX_asimdsamefp16_only
3591b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e402400), "fcmeq");    // FCMEQ_asimdsamefp16_only
3592b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e403400), "fmax");     // FMAX_asimdsamefp16_only
3593b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e403c00), "frecps");   // FRECPS_asimdsamefp16_only
3594b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e798800), "frintn");   // FRINTN_asimdmiscfp16_R
3595b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e799800), "frintm");   // FRINTM_asimdmiscfp16_R
3596b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e79a800), "fcvtns");   // FCVTNS_asimdmiscfp16_R
3597b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e79b800), "fcvtms");   // FCVTMS_asimdmiscfp16_R
3598b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e79c800), "fcvtas");   // FCVTAS_asimdmiscfp16_R
3599b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e79d800), "scvtf");    // SCVTF_asimdmiscfp16_R
3600b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0c400), "fminnm");   // FMINNM_asimdsame_only
3601b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0cc00), "fmls");     // FMLS_asimdsame_only
3602b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0d400), "fsub");     // FSUB_asimdsame_only
3603b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0f400), "fmin");     // FMIN_asimdsame_only
3604b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0fc00), "frsqrts");  // FRSQRTS_asimdsame_only
3605b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0c800), "fcmgt");    // FCMGT_asimdmisc_FZ
3606b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0d800), "fcmeq");    // FCMEQ_asimdmisc_FZ
3607b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0e800), "fcmlt");    // FCMLT_asimdmisc_FZ
3608b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea0f800), "fabs");     // FABS_asimdmisc_R
3609b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea18800), "frintp");   // FRINTP_asimdmisc_R
3610b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea19800), "frintz");   // FRINTZ_asimdmisc_R
3611b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea1a800), "fcvtps");   // FCVTPS_asimdmisc_R
3612b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea1b800), "fcvtzs");   // FCVTZS_asimdmisc_R
3613b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ea1d800), "frecpe");   // FRECPE_asimdmisc_R
3614b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0eb0c800), "fminnmv");  // FMINNMV_asimdall_only_H
3615b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0eb0f800), "fminv");    // FMINV_asimdall_only_H
3616b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ec00400), "fminnm");   // FMINNM_asimdsamefp16_only
3617b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ec00c00), "fmls");     // FMLS_asimdsamefp16_only
3618b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ec01400), "fsub");     // FSUB_asimdsamefp16_only
3619b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ec03400), "fmin");     // FMIN_asimdsamefp16_only
3620b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ec03c00), "frsqrts");  // FRSQRTS_asimdsamefp16_only
3621b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef8c800), "fcmgt");    // FCMGT_asimdmiscfp16_FZ
3622b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef8d800), "fcmeq");    // FCMEQ_asimdmiscfp16_FZ
3623b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef8e800), "fcmlt");    // FCMLT_asimdmiscfp16_FZ
3624b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef8f800), "fabs");     // FABS_asimdmiscfp16_R
3625b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef98800), "frintp");   // FRINTP_asimdmiscfp16_R
3626b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef99800), "frintz");   // FRINTZ_asimdmiscfp16_R
3627b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef9a800), "fcvtps");   // FCVTPS_asimdmiscfp16_R
3628b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef9b800), "fcvtzs");   // FCVTZS_asimdmiscfp16_R
3629b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0ef9d800), "frecpe");   // FRECPE_asimdmiscfp16_R
3630b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f001000), "fmla");     // FMLA_asimdelem_RH_H
3631b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f005000), "fmls");     // FMLS_asimdelem_RH_H
3632b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f009000), "fmul");     // FMUL_asimdelem_RH_H
3633b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f00f400), "fmov");     // FMOV_asimdimm_S_s
3634b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f00fc00), "fmov");     // FMOV_asimdimm_H_h
3635b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f801000), "fmla");     // FMLA_asimdelem_R_SD
3636b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f805000), "fmls");     // FMLS_asimdelem_R_SD
3637b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f809000), "fmul");     // FMUL_asimdelem_R_SD
3638b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20c400), "fmaxnmp");  // FMAXNMP_asimdsame_only
3639b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20d400), "faddp");    // FADDP_asimdsame_only
3640b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20dc00), "fmul");     // FMUL_asimdsame_only
3641b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20e400), "fcmge");    // FCMGE_asimdsame_only
3642b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20ec00), "facge");    // FACGE_asimdsame_only
3643b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20f400), "fmaxp");    // FMAXP_asimdsame_only
3644b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e20fc00), "fdiv");     // FDIV_asimdsame_only
3645b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e218800), "frinta");   // FRINTA_asimdmisc_R
3646b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e219800), "frintx");   // FRINTX_asimdmisc_R
3647b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21a800), "fcvtnu");   // FCVTNU_asimdmisc_R
3648b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21b800), "fcvtmu");   // FCVTMU_asimdmisc_R
3649b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21c800), "fcvtau");   // FCVTAU_asimdmisc_R
3650b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21d800), "ucvtf");    // UCVTF_asimdmisc_R
3651b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6e30c800), "fmaxnmv");  // FMAXNMV_asimdall_only_SD
3652b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6e30f800), "fmaxv");    // FMAXV_asimdall_only_SD
3653b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e400400), "fmaxnmp");  // FMAXNMP_asimdsamefp16_only
3654b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e401400), "faddp");    // FADDP_asimdsamefp16_only
3655b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e401c00), "fmul");     // FMUL_asimdsamefp16_only
3656b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e402400), "fcmge");    // FCMGE_asimdsamefp16_only
3657b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e402c00), "facge");    // FACGE_asimdsamefp16_only
3658b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e403400), "fmaxp");    // FMAXP_asimdsamefp16_only
3659b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e403c00), "fdiv");     // FDIV_asimdsamefp16_only
3660b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e798800), "frinta");   // FRINTA_asimdmiscfp16_R
3661b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e799800), "frintx");   // FRINTX_asimdmiscfp16_R
3662b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e79a800), "fcvtnu");   // FCVTNU_asimdmiscfp16_R
3663b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e79b800), "fcvtmu");   // FCVTMU_asimdmiscfp16_R
3664b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e79c800), "fcvtau");   // FCVTAU_asimdmiscfp16_R
3665b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e79d800), "ucvtf");    // UCVTF_asimdmiscfp16_R
3666b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0c400), "fminnmp");  // FMINNMP_asimdsame_only
3667b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0d400), "fabd");     // FABD_asimdsame_only
3668b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0e400), "fcmgt");    // FCMGT_asimdsame_only
3669b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0ec00), "facgt");    // FACGT_asimdsame_only
3670b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0f400), "fminp");    // FMINP_asimdsame_only
3671b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0c800), "fcmge");    // FCMGE_asimdmisc_FZ
3672b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0d800), "fcmle");    // FCMLE_asimdmisc_FZ
3673b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea0f800), "fneg");     // FNEG_asimdmisc_R
3674b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea19800), "frinti");   // FRINTI_asimdmisc_R
3675b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea1a800), "fcvtpu");   // FCVTPU_asimdmisc_R
3676b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea1b800), "fcvtzu");   // FCVTZU_asimdmisc_R
3677b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea1d800), "frsqrte");  // FRSQRTE_asimdmisc_R
3678b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ea1f800), "fsqrt");    // FSQRT_asimdmisc_R
3679b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6eb0c800), "fminnmv");  // FMINNMV_asimdall_only_SD
3680b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6eb0f800), "fminv");    // FMINV_asimdall_only_SD
3681b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ec00400), "fminnmp");  // FMINNMP_asimdsamefp16_only
3682b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ec01400), "fabd");     // FABD_asimdsamefp16_only
3683b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ec02400), "fcmgt");    // FCMGT_asimdsamefp16_only
3684b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ec02c00), "facgt");    // FACGT_asimdsamefp16_only
3685b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ec03400), "fminp");    // FMINP_asimdsamefp16_only
3686b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef8c800), "fcmge");    // FCMGE_asimdmiscfp16_FZ
3687b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef8d800), "fcmle");    // FCMLE_asimdmiscfp16_FZ
3688b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef8f800), "fneg");     // FNEG_asimdmiscfp16_R
3689b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef99800), "frinti");   // FRINTI_asimdmiscfp16_R
3690b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef9a800), "fcvtpu");   // FCVTPU_asimdmiscfp16_R
3691b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef9b800), "fcvtzu");   // FCVTZU_asimdmiscfp16_R
3692b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef9d800), "frsqrte");  // FRSQRTE_asimdmiscfp16_R
3693b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2ef9f800), "fsqrt");    // FSQRT_asimdmiscfp16_R
3694b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f009000), "fmulx");    // FMULX_asimdelem_RH_H
3695b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f809000), "fmulx");    // FMULX_asimdelem_R_SD
3696b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e20dc00), "fmulx");    // FMULX_asisdsame_only
3697b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e20e400), "fcmeq");    // FCMEQ_asisdsame_only
3698b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e20fc00), "frecps");   // FRECPS_asisdsame_only
3699b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e21a800), "fcvtns");   // FCVTNS_asisdmisc_R
3700b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e21b800), "fcvtms");   // FCVTMS_asisdmisc_R
3701b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e21c800), "fcvtas");   // FCVTAS_asisdmisc_R
3702b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e21d800), "scvtf");    // SCVTF_asisdmisc_R
3703b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e30c800), "fmaxnmp");  // FMAXNMP_asisdpair_only_H
3704b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e30d800), "faddp");    // FADDP_asisdpair_only_H
3705b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e30f800), "fmaxp");    // FMAXP_asisdpair_only_H
3706b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e401c00), "fmulx");    // FMULX_asisdsamefp16_only
3707b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e402400), "fcmeq");    // FCMEQ_asisdsamefp16_only
3708b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e403c00), "frecps");   // FRECPS_asisdsamefp16_only
3709b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e79a800), "fcvtns");   // FCVTNS_asisdmiscfp16_R
3710b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e79b800), "fcvtms");   // FCVTMS_asisdmiscfp16_R
3711b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e79c800), "fcvtas");   // FCVTAS_asisdmiscfp16_R
3712b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5e79d800), "scvtf");    // SCVTF_asisdmiscfp16_R
3713b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea0fc00), "frsqrts");  // FRSQRTS_asisdsame_only
3714b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea0c800), "fcmgt");    // FCMGT_asisdmisc_FZ
3715b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea0d800), "fcmeq");    // FCMEQ_asisdmisc_FZ
3716b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea0e800), "fcmlt");    // FCMLT_asisdmisc_FZ
3717b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea1a800), "fcvtps");   // FCVTPS_asisdmisc_R
3718b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea1b800), "fcvtzs");   // FCVTZS_asisdmisc_R
3719b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea1d800), "frecpe");   // FRECPE_asisdmisc_R
3720b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ea1f800), "frecpx");   // FRECPX_asisdmisc_R
3721b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5eb0c800), "fminnmp");  // FMINNMP_asisdpair_only_H
3722b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5eb0f800), "fminp");    // FMINP_asisdpair_only_H
3723b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ec03c00), "frsqrts");  // FRSQRTS_asisdsamefp16_only
3724b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef8c800), "fcmgt");    // FCMGT_asisdmiscfp16_FZ
3725b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef8d800), "fcmeq");    // FCMEQ_asisdmiscfp16_FZ
3726b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef8e800), "fcmlt");    // FCMLT_asisdmiscfp16_FZ
3727b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef9a800), "fcvtps");   // FCVTPS_asisdmiscfp16_R
3728b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef9b800), "fcvtzs");   // FCVTZS_asisdmiscfp16_R
3729b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef9d800), "frecpe");   // FRECPE_asisdmiscfp16_R
3730b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5ef9f800), "frecpx");   // FRECPX_asisdmiscfp16_R
3731b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f001000), "fmla");     // FMLA_asisdelem_RH_H
3732b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f005000), "fmls");     // FMLS_asisdelem_RH_H
3733b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f009000), "fmul");     // FMUL_asisdelem_RH_H
3734b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f801000), "fmla");     // FMLA_asisdelem_R_SD
3735b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f805000), "fmls");     // FMLS_asisdelem_R_SD
3736b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x5f809000), "fmul");     // FMUL_asisdelem_R_SD
3737b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6f00f400), "fmov");     // FMOV_asimdimm_D2_d
3738b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e20e400), "fcmge");    // FCMGE_asisdsame_only
3739b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e20ec00), "facge");    // FACGE_asisdsame_only
3740b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e21a800), "fcvtnu");   // FCVTNU_asisdmisc_R
3741b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e21b800), "fcvtmu");   // FCVTMU_asisdmisc_R
3742b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e21c800), "fcvtau");   // FCVTAU_asisdmisc_R
3743b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e21d800), "ucvtf");    // UCVTF_asisdmisc_R
3744b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e30c800), "fmaxnmp");  // FMAXNMP_asisdpair_only_SD
3745b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e30d800), "faddp");    // FADDP_asisdpair_only_SD
3746b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e30f800), "fmaxp");    // FMAXP_asisdpair_only_SD
3747b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e402400), "fcmge");    // FCMGE_asisdsamefp16_only
3748b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e402c00), "facge");    // FACGE_asisdsamefp16_only
3749b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e79a800), "fcvtnu");   // FCVTNU_asisdmiscfp16_R
3750b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e79b800), "fcvtmu");   // FCVTMU_asisdmiscfp16_R
3751b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e79c800), "fcvtau");   // FCVTAU_asisdmiscfp16_R
3752b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7e79d800), "ucvtf");    // UCVTF_asisdmiscfp16_R
3753b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea0d400), "fabd");     // FABD_asisdsame_only
3754b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea0e400), "fcmgt");    // FCMGT_asisdsame_only
3755b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea0ec00), "facgt");    // FACGT_asisdsame_only
3756b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea0c800), "fcmge");    // FCMGE_asisdmisc_FZ
3757b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea0d800), "fcmle");    // FCMLE_asisdmisc_FZ
3758b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea1a800), "fcvtpu");   // FCVTPU_asisdmisc_R
3759b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea1b800), "fcvtzu");   // FCVTZU_asisdmisc_R
3760b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ea1d800), "frsqrte");  // FRSQRTE_asisdmisc_R
3761b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7eb0c800), "fminnmp");  // FMINNMP_asisdpair_only_SD
3762b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7eb0f800), "fminp");    // FMINP_asisdpair_only_SD
3763b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ec01400), "fabd");     // FABD_asisdsamefp16_only
3764b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ec02400), "fcmgt");    // FCMGT_asisdsamefp16_only
3765b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ec02c00), "facgt");    // FACGT_asisdsamefp16_only
3766b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ef8c800), "fcmge");    // FCMGE_asisdmiscfp16_FZ
3767b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ef8d800), "fcmle");    // FCMLE_asisdmiscfp16_FZ
3768b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ef9a800), "fcvtpu");   // FCVTPU_asisdmiscfp16_R
3769b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ef9b800), "fcvtzu");   // FCVTZU_asisdmiscfp16_R
3770b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7ef9d800), "frsqrte");  // FRSQRTE_asisdmiscfp16_R
3771b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7f009000), "fmulx");    // FMULX_asisdelem_RH_H
3772b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x7f809000), "fmulx");    // FMULX_asisdelem_R_SD
3773b8021494Sopenharmony_ci
3774b8021494Sopenharmony_ci  // ARMv8.2 - RAS
3775b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503221f), "esb");  // ESB_HI_hints
3776b8021494Sopenharmony_ci
3777b8021494Sopenharmony_ci  // ARMv8.2 - SHA3
3778b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce000000), "eor3");   // EOR3_VVV16_crypto4
3779b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce200000), "bcax");   // BCAX_VVV16_crypto4
3780b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce608c00), "rax1");   // RAX1_VVV2_cryptosha512_3
3781b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce800000), "xar");   // XAR_VVV2_crypto3_imm6
3782b8021494Sopenharmony_ci
3783b8021494Sopenharmony_ci  // ARMv8.2 - SHA512
3784b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce608000), "sha512h");   // SHA512H_QQV_cryptosha512_3
3785b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce608400), "sha512h2");   //
3786b8021494Sopenharmony_ci  // SHA512H2_QQV_cryptosha512_3
3787b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce608800), "sha512su1");   //
3788b8021494Sopenharmony_ci  // SHA512SU1_VVV2_cryptosha512_3
3789b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xcec08000), "sha512su0");   //
3790b8021494Sopenharmony_ci  // SHA512SU0_VV2_cryptosha512_2
3791b8021494Sopenharmony_ci
3792b8021494Sopenharmony_ci  // ARMv8.2 - SM3
3793b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce400000), "sm3ss1");   // SM3SS1_VVV4_crypto4
3794b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce408000), "sm3tt1a");   // SM3TT1A_VVV4_crypto3_imm2
3795b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce408400), "sm3tt1b");   // SM3TT1B_VVV4_crypto3_imm2
3796b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce408800), "sm3tt2a");   // SM3TT2A_VVV4_crypto3_imm2
3797b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce408c00), "sm3tt2b");   // SM3TT2B_VVV_crypto3_imm2
3798b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce60c000), "sm3partw1");   //
3799b8021494Sopenharmony_ci  // SM3PARTW1_VVV4_cryptosha512_3
3800b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce60c400), "sm3partw2");   //
3801b8021494Sopenharmony_ci  // SM3PARTW2_VVV4_cryptosha512_3
3802b8021494Sopenharmony_ci
3803b8021494Sopenharmony_ci  // ARMv8.2 - SM4
3804b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xce60c800), "sm4ekey");   //
3805b8021494Sopenharmony_ci  // SM4EKEY_VVV4_cryptosha512_3
3806b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xcec08400), "sm4e");   // SM4E_VV4_cryptosha512_2
3807b8021494Sopenharmony_ci
3808b8021494Sopenharmony_ci  // ARMv8.2 - SPE
3809b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd503223f), "psb");   // PSB_HC_hints
3810b8021494Sopenharmony_ci
3811b8021494Sopenharmony_ci  // ARMv8.3 - FCMA
3812b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e40c400), "fcmla");  // FCMLA_asimdsame2_C
3813b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e00e400), "fcadd");  // FCADD_asimdsame2_C
3814b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2f401000), "fcmla");  // FCMLA_asimdelem_C_H
3815b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6f801000), "fcmla");  // FCMLA_asimdelem_C_S
3816b8021494Sopenharmony_ci
3817b8021494Sopenharmony_ci  // ARMv8.3 - JSCVT
3818b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e7e0000), "fjcvtzs");  // FJCVTZS_32D_float2int
3819b8021494Sopenharmony_ci
3820b8021494Sopenharmony_ci  // ARMv8.3 - LRCPC
3821b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x38bfc000), "ldaprb");  // LDAPRB_32L_memop
3822b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x78bfc000), "ldaprh");  // LDAPRH_32L_memop
3823b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xb8bfc000), "ldapr");   // LDAPR_32L_memop
3824b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8bfc000), "ldapr");   // LDAPR_64L_memop
3825b8021494Sopenharmony_ci
3826b8021494Sopenharmony_ci  // ARMv8.3 - PAuth
3827b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x9ac03000), "pacga");      // PACGA_64P_dp_2src
3828b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd50320ff), "xpaclri");    // XPACLRI_HI_hints
3829b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503211f), "pacia1716");  // PACIA1716_HI_hints
3830b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503215f), "pacib1716");  // PACIB1716_HI_hints
3831b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503219f), "autia1716");  // AUTIA1716_HI_hints
3832b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd50321df), "autib1716");  // AUTIB1716_HI_hints
3833b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503231f), "paciaz");     // PACIAZ_HI_hints
3834b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503233f), "paciasp");    // PACIASP_HI_hints
3835b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503235f), "pacibz");     // PACIBZ_HI_hints
3836b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503237f), "pacibsp");    // PACIBSP_HI_hints
3837b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503239f), "autiaz");     // AUTIAZ_HI_hints
3838b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd50323bf), "autiasp");    // AUTIASP_HI_hints
3839b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd50323df), "autibz");     // AUTIBZ_HI_hints
3840b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd50323ff), "autibsp");    // AUTIBSP_HI_hints
3841b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd61f081f), "braaz");      // BRAAZ_64_branch_reg
3842b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd61f0c1f), "brabz");      // BRABZ_64_branch_reg
3843b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd63f081f), "blraaz");     // BLRAAZ_64_branch_reg
3844b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd63f0c1f), "blrabz");     // BLRABZ_64_branch_reg
3845b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd65f0bff), "retaa");      // RETAA_64E_branch_reg
3846b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd65f0fff), "retab");      // RETAB_64E_branch_reg
3847b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd69f0bff), "eretaa");   // ERETAA_64E_branch_reg
3848b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd69f0fff), "eretab");   // ERETAB_64E_branch_reg
3849b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd71f0800), "braa");    // BRAA_64P_branch_reg
3850b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd71f0c00), "brab");    // BRAB_64P_branch_reg
3851b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd73f0800), "blraa");   // BLRAA_64P_branch_reg
3852b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd73f0c00), "blrab");   // BLRAB_64P_branch_reg
3853b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac10000), "pacia");   // PACIA_64P_dp_1src
3854b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac10400), "pacib");   // PACIB_64P_dp_1src
3855b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac10800), "pacda");   // PACDA_64P_dp_1src
3856b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac10c00), "pacdb");   // PACDB_64P_dp_1src
3857b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac11000), "autia");   // AUTIA_64P_dp_1src
3858b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac11400), "autib");   // AUTIB_64P_dp_1src
3859b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac11800), "autda");   // AUTDA_64P_dp_1src
3860b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac11c00), "autdb");   // AUTDB_64P_dp_1src
3861b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac123e0), "paciza");  // PACIZA_64Z_dp_1src
3862b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac127e0), "pacizb");  // PACIZB_64Z_dp_1src
3863b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac12be0), "pacdza");  // PACDZA_64Z_dp_1src
3864b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac12fe0), "pacdzb");  // PACDZB_64Z_dp_1src
3865b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac133e0), "autiza");  // AUTIZA_64Z_dp_1src
3866b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac137e0), "autizb");  // AUTIZB_64Z_dp_1src
3867b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac13be0), "autdza");  // AUTDZA_64Z_dp_1src
3868b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac13fe0), "autdzb");  // AUTDZB_64Z_dp_1src
3869b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac143e0), "xpaci");   // XPACI_64Z_dp_1src
3870b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xdac147e0), "xpacd");   // XPACD_64Z_dp_1src
3871b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8200400), "ldraa");   // LDRAA_64_ldst_pac
3872b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8200c00), "ldraa");   // LDRAA_64W_ldst_pac
3873b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a00400), "ldrab");   // LDRAB_64_ldst_pac
3874b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xf8a00c00), "ldrab");   // LDRAB_64W_ldst_pac
3875b8021494Sopenharmony_ci
3876b8021494Sopenharmony_ci  // ARMv8.4 - FlagM
3877b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x3a00080d), "setf8");   // SETF8_only_setf
3878b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x3a00480d), "setf16");  // SETF16_only_setf
3879b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xba000400), "rmif");    // RMIF_only_rmif
3880b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd500401f), "cfinv");   // CFINV_M_pstate
3881b8021494Sopenharmony_ci
3882b8021494Sopenharmony_ci  // ARMv8.4 - LRCPC2
3883b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19000000), "stlurb");    // STLURB_32_ldapstl_unscaled
3884b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19400000), "ldapurb");   // LDAPURB_32_ldapstl_unscaled
3885b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19800000), "ldapursb");  // LDAPURSB_64_ldapstl_unscaled
3886b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x19c00000), "ldapursb");  // LDAPURSB_32_ldapstl_unscaled
3887b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x59000000), "stlurh");    // STLURH_32_ldapstl_unscaled
3888b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x59400000), "ldapurh");   // LDAPURH_32_ldapstl_unscaled
3889b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x59800000), "ldapursh");  // LDAPURSH_64_ldapstl_unscaled
3890b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x59c00000), "ldapursh");  // LDAPURSH_32_ldapstl_unscaled
3891b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x99000000), "stlur");     // STLUR_32_ldapstl_unscaled
3892b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x99400000), "ldapur");    // LDAPUR_32_ldapstl_unscaled
3893b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x99800000), "ldapursw");  // LDAPURSW_64_ldapstl_unscaled
3894b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd9000000), "stlur");     // STLUR_64_ldapstl_unscaled
3895b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd9400000), "ldapur");    // LDAPUR_64_ldapstl_unscaled
3896b8021494Sopenharmony_ci
3897b8021494Sopenharmony_ci  // ARMv8.4 - TRF
3898b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd503225f), "tsb");   // TSB_HC_hints
3899b8021494Sopenharmony_ci
3900b8021494Sopenharmony_ci  // ARMv8.5 - BTI
3901b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd503241f), "bti");  // BTI_HB_hints
3902b8021494Sopenharmony_ci
3903b8021494Sopenharmony_ci  // ARMv8.5 - FRINTTS
3904b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21e800), "frint32z");  // FRINT32Z_asimdmisc_R
3905b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e21f800), "frint64z");  // FRINT64Z_asimdmisc_R
3906b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21e800), "frint32x");  // FRINT32X_asimdmisc_R
3907b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x2e21f800), "frint64x");  // FRINT64X_asimdmisc_R
3908b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e284000), "frint32z");  // FRINT32Z_S_floatdp1
3909b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e28c000), "frint32x");  // FRINT32X_S_floatdp1
3910b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e294000), "frint64z");  // FRINT64Z_S_floatdp1
3911b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e29c000), "frint64x");  // FRINT64X_S_floatdp1
3912b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e684000), "frint32z");  // FRINT32Z_D_floatdp1
3913b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e68c000), "frint32x");  // FRINT32X_D_floatdp1
3914b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e694000), "frint64z");  // FRINT64Z_D_floatdp1
3915b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x1e69c000), "frint64x");  // FRINT64X_D_floatdp1
3916b8021494Sopenharmony_ci
3917b8021494Sopenharmony_ci  // ARMv8.5 - FlagM2
3918b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd500403f), "xaflag");  // XAFLAG_M_pstate
3919b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0xd500405f), "axflag");  // AXFLAG_M_pstate
3920b8021494Sopenharmony_ci
3921b8021494Sopenharmony_ci  // ARMv8.5 - MTE
3922b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x68800000), "stgp");   // STGP_64_ldstpair_post
3923b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x69000000), "stgp");   // STGP_64_ldstpair_off
3924b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x69800000), "stgp");   // STGP_64_ldstpair_pre
3925b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x91800000), "addg");   // ADDG_64_addsub_immtags
3926b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x9ac00000), "subp");   // SUBP_64S_dp_2src
3927b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x9ac01000), "irg");   // IRG_64I_dp_2src
3928b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x9ac01400), "gmi");   // GMI_64G_dp_2src
3929b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xbac00000), "subps");   // SUBPS_64S_dp_2src
3930b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd1800000), "subg");   // SUBG_64_addsub_immtags
3931b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9200400), "stg");   // STG_64Spost_ldsttags
3932b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9200800), "stg");   // STG_64Soffset_ldsttags
3933b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9200c00), "stg");   // STG_64Spre_ldsttags
3934b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9600000), "ldg");   // LDG_64Loffset_ldsttags
3935b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9600400), "stzg");   // STZG_64Spost_ldsttags
3936b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9600800), "stzg");   // STZG_64Soffset_ldsttags
3937b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9600c00), "stzg");   // STZG_64Spre_ldsttags
3938b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9a00400), "st2g");   // ST2G_64Spost_ldsttags
3939b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9a00800), "st2g");   // ST2G_64Soffset_ldsttags
3940b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9a00c00), "st2g");   // ST2G_64Spre_ldsttags
3941b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9e00400), "stz2g");   // STZ2G_64Spost_ldsttags
3942b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9e00800), "stz2g");   // STZ2G_64Soffset_ldsttags
3943b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9e00c00), "stz2g");   // STZ2G_64Spre_ldsttags
3944b8021494Sopenharmony_ci
3945b8021494Sopenharmony_ci  // ARMv8.5 - MTE2
3946b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9200000), "stzgm");   // STZGM_64bulk_ldsttags
3947b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9a00000), "stgm");   // STGM_64bulk_ldsttags
3948b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd9e00000), "ldgm");   // LDGM_64bulk_ldsttags
3949b8021494Sopenharmony_ci
3950b8021494Sopenharmony_ci  // ARMv8.6 - BF16
3951b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x0ea16800), "bfcvtn");   // BFCVTN_asimdmisc_4S
3952b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x0f40f000), "bfdot");   // BFDOT_asimdelem_E
3953b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x0fc0f000), "bfmlal");   // BFMLAL_asimdelem_F
3954b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x2e40fc00), "bfdot");   // BFDOT_asimdsame2_D
3955b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x2ec0fc00), "bfmlal");   // BFMLAL_asimdsame2_F_
3956b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x1e634000), "bfcvt");   // BFCVT_BS_floatdp1
3957b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0x6e40ec00), "bfmmla");   // BFMMLA_asimdsame2_E
3958b8021494Sopenharmony_ci
3959b8021494Sopenharmony_ci  // ARMv8.6 - DGH
3960b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd50320df), "dgh");   // DGH_HI_hints
3961b8021494Sopenharmony_ci
3962b8021494Sopenharmony_ci  // ARMv8.6 - I8MM
3963b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0e809c00), "usdot");   // USDOT_asimdsame2_D
3964b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f00f000), "sudot");   // SUDOT_asimdelem_D
3965b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x0f80f000), "usdot");   // USDOT_asimdelem_D
3966b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x4e80a400), "smmla");   // SMMLA_asimdsame2_G
3967b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x4e80ac00), "usmmla");  // USMMLA_asimdsame2_G
3968b8021494Sopenharmony_ci  COMPARE_PREFIX(dci(0x6e80a400), "ummla");   // UMMLA_asimdsame2_G
3969b8021494Sopenharmony_ci
3970b8021494Sopenharmony_ci  // ARMv8.7 - LS64
3971b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xf83f9000), "st64b");   // ST64B_64L_memop
3972b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xf83fd000), "ld64b");   // LD64B_64L_memop
3973b8021494Sopenharmony_ci
3974b8021494Sopenharmony_ci  // ARMv8.7 - LS64_V
3975b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xf820a000), "st64bv0");   // ST64BV0_64_memop
3976b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xf820b000), "st64bv");   // ST64BV_64_memop
3977b8021494Sopenharmony_ci
3978b8021494Sopenharmony_ci  // ARMv8.7 - WFxT
3979b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd5031000), "wfet");   // WFET_only_systeminstrswithreg
3980b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd5031020), "wfit");   // WFIT_only_systeminstrswithreg
3981b8021494Sopenharmony_ci
3982b8021494Sopenharmony_ci  // TME
3983b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd4600000), "tcancel");   // TCANCEL_EX_exception
3984b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd503307f), "tcommit");   // TCOMMIT_only_barriers
3985b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd5233060), "tstart");   // TSTART_BR_systemresult
3986b8021494Sopenharmony_ci  // COMPARE_PREFIX(dci(0xd5233160), "ttest");   // TTEST_BR_systemresult
3987b8021494Sopenharmony_ci
3988b8021494Sopenharmony_ci  CLEANUP();
3989b8021494Sopenharmony_ci}
3990b8021494Sopenharmony_ci
3991b8021494Sopenharmony_ci}  // namespace aarch64
3992b8021494Sopenharmony_ci}  // namespace vixl
3993