1b8021494Sopenharmony_ci// Copyright 2019, 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 <cstdio>
29b8021494Sopenharmony_ci#include <cstring>
30b8021494Sopenharmony_ci#include <string>
31b8021494Sopenharmony_ci
32b8021494Sopenharmony_ci#include "test-runner.h"
33b8021494Sopenharmony_ci
34b8021494Sopenharmony_ci#include "aarch64/disasm-aarch64.h"
35b8021494Sopenharmony_ci#include "aarch64/macro-assembler-aarch64.h"
36b8021494Sopenharmony_ci#include "test-disasm-aarch64.h"
37b8021494Sopenharmony_ci
38b8021494Sopenharmony_cinamespace vixl {
39b8021494Sopenharmony_cinamespace aarch64 {
40b8021494Sopenharmony_ci
41b8021494Sopenharmony_ciTEST(fmov_imm) {
42b8021494Sopenharmony_ci  SETUP();
43b8021494Sopenharmony_ci
44b8021494Sopenharmony_ci  COMPARE(fmov(h2, Float16(-5.0)), "fmov h2, #0x94 (-5.0000)");
45b8021494Sopenharmony_ci  COMPARE(fmov(h30, Float16(29.0)), "fmov h30, #0x3d (29.0000)");
46b8021494Sopenharmony_ci  COMPARE(fmov(s0, 1.0f), "fmov s0, #0x70 (1.0000)");
47b8021494Sopenharmony_ci  COMPARE(fmov(s31, -13.0f), "fmov s31, #0xaa (-13.0000)");
48b8021494Sopenharmony_ci  COMPARE(fmov(d1, 1.0), "fmov d1, #0x70 (1.0000)");
49b8021494Sopenharmony_ci  COMPARE(fmov(d29, -13.0), "fmov d29, #0xaa (-13.0000)");
50b8021494Sopenharmony_ci
51b8021494Sopenharmony_ci  CLEANUP();
52b8021494Sopenharmony_ci}
53b8021494Sopenharmony_ci
54b8021494Sopenharmony_ciTEST(fmov_reg) {
55b8021494Sopenharmony_ci  SETUP();
56b8021494Sopenharmony_ci
57b8021494Sopenharmony_ci  COMPARE(fmov(w3, s13), "fmov w3, s13");
58b8021494Sopenharmony_ci  COMPARE(fmov(x6, d26), "fmov x6, d26");
59b8021494Sopenharmony_ci  COMPARE(fmov(s11, w30), "fmov s11, w30");
60b8021494Sopenharmony_ci  COMPARE(fmov(d31, x2), "fmov d31, x2");
61b8021494Sopenharmony_ci  COMPARE(fmov(s12, s13), "fmov s12, s13");
62b8021494Sopenharmony_ci  COMPARE(fmov(d22, d23), "fmov d22, d23");
63b8021494Sopenharmony_ci  COMPARE(fmov(v0.D(), 1, x13), "fmov v0.D[1], x13");
64b8021494Sopenharmony_ci  COMPARE(fmov(x13, v0.D(), 1), "fmov x13, v0.D[1]");
65b8021494Sopenharmony_ci
66b8021494Sopenharmony_ci  CLEANUP();
67b8021494Sopenharmony_ci}
68b8021494Sopenharmony_ci
69b8021494Sopenharmony_ciTEST(fp_dp1) {
70b8021494Sopenharmony_ci  SETUP();
71b8021494Sopenharmony_ci
72b8021494Sopenharmony_ci  COMPARE(fabs(s0, s1), "fabs s0, s1");
73b8021494Sopenharmony_ci  COMPARE(fabs(s31, s30), "fabs s31, s30");
74b8021494Sopenharmony_ci  COMPARE(fabs(d2, d3), "fabs d2, d3");
75b8021494Sopenharmony_ci  COMPARE(fabs(d31, d30), "fabs d31, d30");
76b8021494Sopenharmony_ci  COMPARE(fneg(s4, s5), "fneg s4, s5");
77b8021494Sopenharmony_ci  COMPARE(fneg(s31, s30), "fneg s31, s30");
78b8021494Sopenharmony_ci  COMPARE(fneg(d6, d7), "fneg d6, d7");
79b8021494Sopenharmony_ci  COMPARE(fneg(d31, d30), "fneg d31, d30");
80b8021494Sopenharmony_ci  COMPARE(fsqrt(s8, s9), "fsqrt s8, s9");
81b8021494Sopenharmony_ci  COMPARE(fsqrt(s31, s30), "fsqrt s31, s30");
82b8021494Sopenharmony_ci  COMPARE(fsqrt(d10, d11), "fsqrt d10, d11");
83b8021494Sopenharmony_ci  COMPARE(fsqrt(d31, d30), "fsqrt d31, d30");
84b8021494Sopenharmony_ci  COMPARE(frint32x(s10, s11), "frint32x s10, s11");
85b8021494Sopenharmony_ci  COMPARE(frint32x(s31, s30), "frint32x s31, s30");
86b8021494Sopenharmony_ci  COMPARE(frint32x(d12, d13), "frint32x d12, d13");
87b8021494Sopenharmony_ci  COMPARE(frint32x(d31, d30), "frint32x d31, d30");
88b8021494Sopenharmony_ci  COMPARE(frint32z(s10, s11), "frint32z s10, s11");
89b8021494Sopenharmony_ci  COMPARE(frint32z(s31, s30), "frint32z s31, s30");
90b8021494Sopenharmony_ci  COMPARE(frint32z(d12, d13), "frint32z d12, d13");
91b8021494Sopenharmony_ci  COMPARE(frint32z(d31, d30), "frint32z d31, d30");
92b8021494Sopenharmony_ci  COMPARE(frint64x(s10, s11), "frint64x s10, s11");
93b8021494Sopenharmony_ci  COMPARE(frint64x(s31, s30), "frint64x s31, s30");
94b8021494Sopenharmony_ci  COMPARE(frint64x(d12, d13), "frint64x d12, d13");
95b8021494Sopenharmony_ci  COMPARE(frint64x(d31, d30), "frint64x d31, d30");
96b8021494Sopenharmony_ci  COMPARE(frint64z(s10, s11), "frint64z s10, s11");
97b8021494Sopenharmony_ci  COMPARE(frint64z(s31, s30), "frint64z s31, s30");
98b8021494Sopenharmony_ci  COMPARE(frint64z(d12, d13), "frint64z d12, d13");
99b8021494Sopenharmony_ci  COMPARE(frint64z(d31, d30), "frint64z d31, d30");
100b8021494Sopenharmony_ci  COMPARE(frinta(s10, s11), "frinta s10, s11");
101b8021494Sopenharmony_ci  COMPARE(frinta(s31, s30), "frinta s31, s30");
102b8021494Sopenharmony_ci  COMPARE(frinta(d12, d13), "frinta d12, d13");
103b8021494Sopenharmony_ci  COMPARE(frinta(d31, d30), "frinta d31, d30");
104b8021494Sopenharmony_ci  COMPARE(frinti(s10, s11), "frinti s10, s11");
105b8021494Sopenharmony_ci  COMPARE(frinti(s31, s30), "frinti s31, s30");
106b8021494Sopenharmony_ci  COMPARE(frinti(d12, d13), "frinti d12, d13");
107b8021494Sopenharmony_ci  COMPARE(frinti(d31, d30), "frinti d31, d30");
108b8021494Sopenharmony_ci  COMPARE(frintm(s10, s11), "frintm s10, s11");
109b8021494Sopenharmony_ci  COMPARE(frintm(s31, s30), "frintm s31, s30");
110b8021494Sopenharmony_ci  COMPARE(frintm(d12, d13), "frintm d12, d13");
111b8021494Sopenharmony_ci  COMPARE(frintm(d31, d30), "frintm d31, d30");
112b8021494Sopenharmony_ci  COMPARE(frintn(s10, s11), "frintn s10, s11");
113b8021494Sopenharmony_ci  COMPARE(frintn(s31, s30), "frintn s31, s30");
114b8021494Sopenharmony_ci  COMPARE(frintn(d12, d13), "frintn d12, d13");
115b8021494Sopenharmony_ci  COMPARE(frintn(d31, d30), "frintn d31, d30");
116b8021494Sopenharmony_ci  COMPARE(frintx(s10, s11), "frintx s10, s11");
117b8021494Sopenharmony_ci  COMPARE(frintx(s31, s30), "frintx s31, s30");
118b8021494Sopenharmony_ci  COMPARE(frintx(d12, d13), "frintx d12, d13");
119b8021494Sopenharmony_ci  COMPARE(frintx(d31, d30), "frintx d31, d30");
120b8021494Sopenharmony_ci  COMPARE(frintz(s10, s11), "frintz s10, s11");
121b8021494Sopenharmony_ci  COMPARE(frintz(s31, s30), "frintz s31, s30");
122b8021494Sopenharmony_ci  COMPARE(frintz(d12, d13), "frintz d12, d13");
123b8021494Sopenharmony_ci  COMPARE(frintz(d31, d30), "frintz d31, d30");
124b8021494Sopenharmony_ci  COMPARE(fcvt(d14, s15), "fcvt d14, s15");
125b8021494Sopenharmony_ci  COMPARE(fcvt(d31, s31), "fcvt d31, s31");
126b8021494Sopenharmony_ci  COMPARE(fcvt(s0, d1), "fcvt s0, d1");
127b8021494Sopenharmony_ci  COMPARE(fcvt(s2, h3), "fcvt s2, h3");
128b8021494Sopenharmony_ci  COMPARE(fcvt(d4, h5), "fcvt d4, h5");
129b8021494Sopenharmony_ci  COMPARE(fcvt(h6, s7), "fcvt h6, s7");
130b8021494Sopenharmony_ci  COMPARE(fcvt(h8, d9), "fcvt h8, d9");
131b8021494Sopenharmony_ci
132b8021494Sopenharmony_ci  CLEANUP();
133b8021494Sopenharmony_ci}
134b8021494Sopenharmony_ci
135b8021494Sopenharmony_ciTEST(fp_dp2) {
136b8021494Sopenharmony_ci  SETUP();
137b8021494Sopenharmony_ci
138b8021494Sopenharmony_ci  COMPARE(fadd(h8, h9, h10), "fadd h8, h9, h10");
139b8021494Sopenharmony_ci  COMPARE(fadd(s0, s1, s2), "fadd s0, s1, s2");
140b8021494Sopenharmony_ci  COMPARE(fadd(d3, d4, d5), "fadd d3, d4, d5");
141b8021494Sopenharmony_ci  COMPARE(fsub(h14, h17, h21), "fsub h14, h17, h21");
142b8021494Sopenharmony_ci  COMPARE(fsub(s31, s30, s29), "fsub s31, s30, s29");
143b8021494Sopenharmony_ci  COMPARE(fsub(d31, d30, d29), "fsub d31, d30, d29");
144b8021494Sopenharmony_ci  COMPARE(fmul(h13, h14, h15), "fmul h13, h14, h15");
145b8021494Sopenharmony_ci  COMPARE(fmul(s7, s8, s9), "fmul s7, s8, s9");
146b8021494Sopenharmony_ci  COMPARE(fmul(d10, d11, d12), "fmul d10, d11, d12");
147b8021494Sopenharmony_ci  COMPARE(fnmul(h4, h5, h6), "fnmul h4, h5, h6");
148b8021494Sopenharmony_ci  COMPARE(fnmul(s7, s8, s9), "fnmul s7, s8, s9");
149b8021494Sopenharmony_ci  COMPARE(fnmul(d10, d11, d12), "fnmul d10, d11, d12");
150b8021494Sopenharmony_ci  COMPARE(fdiv(h0, h1, h2), "fdiv h0, h1, h2");
151b8021494Sopenharmony_ci  COMPARE(fdiv(s13, s14, s15), "fdiv s13, s14, s15");
152b8021494Sopenharmony_ci  COMPARE(fdiv(d16, d17, d18), "fdiv d16, d17, d18");
153b8021494Sopenharmony_ci  COMPARE(fmax(h9, h10, h11), "fmax h9, h10, h11");
154b8021494Sopenharmony_ci  COMPARE(fmax(s19, s20, s21), "fmax s19, s20, s21");
155b8021494Sopenharmony_ci  COMPARE(fmax(d22, d23, d24), "fmax d22, d23, d24");
156b8021494Sopenharmony_ci  COMPARE(fmin(h13, h15, h17), "fmin h13, h15, h17");
157b8021494Sopenharmony_ci  COMPARE(fmin(s25, s26, s27), "fmin s25, s26, s27");
158b8021494Sopenharmony_ci  COMPARE(fmin(d28, d29, d30), "fmin d28, d29, d30");
159b8021494Sopenharmony_ci  COMPARE(fmaxnm(h4, h5, h6), "fmaxnm h4, h5, h6");
160b8021494Sopenharmony_ci  COMPARE(fmaxnm(s31, s0, s1), "fmaxnm s31, s0, s1");
161b8021494Sopenharmony_ci  COMPARE(fmaxnm(d2, d3, d4), "fmaxnm d2, d3, d4");
162b8021494Sopenharmony_ci  COMPARE(fminnm(h22, h23, h24), "fminnm h22, h23, h24");
163b8021494Sopenharmony_ci  COMPARE(fminnm(s5, s6, s7), "fminnm s5, s6, s7");
164b8021494Sopenharmony_ci  COMPARE(fminnm(d8, d9, d10), "fminnm d8, d9, d10");
165b8021494Sopenharmony_ci
166b8021494Sopenharmony_ci  CLEANUP();
167b8021494Sopenharmony_ci}
168b8021494Sopenharmony_ci
169b8021494Sopenharmony_ciTEST(fp_dp3) {
170b8021494Sopenharmony_ci  SETUP();
171b8021494Sopenharmony_ci
172b8021494Sopenharmony_ci  COMPARE(fmadd(h4, h5, h6, h10), "fmadd h4, h5, h6, h10");
173b8021494Sopenharmony_ci  COMPARE(fmadd(s7, s8, s9, s10), "fmadd s7, s8, s9, s10");
174b8021494Sopenharmony_ci  COMPARE(fmadd(d10, d11, d12, d10), "fmadd d10, d11, d12, d10");
175b8021494Sopenharmony_ci  COMPARE(fmsub(h4, h5, h6, h10), "fmsub h4, h5, h6, h10");
176b8021494Sopenharmony_ci  COMPARE(fmsub(s7, s8, s9, s10), "fmsub s7, s8, s9, s10");
177b8021494Sopenharmony_ci  COMPARE(fmsub(d10, d11, d12, d10), "fmsub d10, d11, d12, d10");
178b8021494Sopenharmony_ci
179b8021494Sopenharmony_ci  COMPARE(fnmadd(h4, h5, h6, h10), "fnmadd h4, h5, h6, h10");
180b8021494Sopenharmony_ci  COMPARE(fnmadd(s7, s8, s9, s10), "fnmadd s7, s8, s9, s10");
181b8021494Sopenharmony_ci  COMPARE(fnmadd(d10, d11, d12, d10), "fnmadd d10, d11, d12, d10");
182b8021494Sopenharmony_ci  COMPARE(fnmsub(h4, h5, h6, h10), "fnmsub h4, h5, h6, h10");
183b8021494Sopenharmony_ci  COMPARE(fnmsub(s7, s8, s9, s10), "fnmsub s7, s8, s9, s10");
184b8021494Sopenharmony_ci  COMPARE(fnmsub(d10, d11, d12, d10), "fnmsub d10, d11, d12, d10");
185b8021494Sopenharmony_ci
186b8021494Sopenharmony_ci  CLEANUP();
187b8021494Sopenharmony_ci}
188b8021494Sopenharmony_ci
189b8021494Sopenharmony_ciTEST(fp_compare) {
190b8021494Sopenharmony_ci  SETUP();
191b8021494Sopenharmony_ci
192b8021494Sopenharmony_ci  COMPARE(fcmp(h0, h1), "fcmp h0, h1");
193b8021494Sopenharmony_ci  COMPARE(fcmp(h31, h30), "fcmp h31, h30");
194b8021494Sopenharmony_ci  COMPARE(fcmp(s0, s1), "fcmp s0, s1");
195b8021494Sopenharmony_ci  COMPARE(fcmp(s31, s30), "fcmp s31, s30");
196b8021494Sopenharmony_ci  COMPARE(fcmp(d0, d1), "fcmp d0, d1");
197b8021494Sopenharmony_ci  COMPARE(fcmp(d31, d30), "fcmp d31, d30");
198b8021494Sopenharmony_ci  COMPARE(fcmp(h12, 0), "fcmp h12, #0.0");
199b8021494Sopenharmony_ci  COMPARE(fcmp(s12, 0), "fcmp s12, #0.0");
200b8021494Sopenharmony_ci  COMPARE(fcmp(d12, 0), "fcmp d12, #0.0");
201b8021494Sopenharmony_ci
202b8021494Sopenharmony_ci  COMPARE(fcmpe(h0, h1), "fcmpe h0, h1");
203b8021494Sopenharmony_ci  COMPARE(fcmpe(h31, h30), "fcmpe h31, h30");
204b8021494Sopenharmony_ci  COMPARE(fcmpe(s0, s1), "fcmpe s0, s1");
205b8021494Sopenharmony_ci  COMPARE(fcmpe(s31, s30), "fcmpe s31, s30");
206b8021494Sopenharmony_ci  COMPARE(fcmpe(d0, d1), "fcmpe d0, d1");
207b8021494Sopenharmony_ci  COMPARE(fcmpe(d31, d30), "fcmpe d31, d30");
208b8021494Sopenharmony_ci  COMPARE(fcmpe(h12, 0), "fcmpe h12, #0.0");
209b8021494Sopenharmony_ci  COMPARE(fcmpe(s12, 0), "fcmpe s12, #0.0");
210b8021494Sopenharmony_ci  COMPARE(fcmpe(d12, 0), "fcmpe d12, #0.0");
211b8021494Sopenharmony_ci
212b8021494Sopenharmony_ci  CLEANUP();
213b8021494Sopenharmony_ci}
214b8021494Sopenharmony_ci
215b8021494Sopenharmony_ciTEST(fp_cond_compare) {
216b8021494Sopenharmony_ci  SETUP();
217b8021494Sopenharmony_ci
218b8021494Sopenharmony_ci  COMPARE(fccmp(h8, h9, NoFlag, eq), "fccmp h8, h9, #nzcv, eq");
219b8021494Sopenharmony_ci  COMPARE(fccmp(h10, h11, ZVFlag, ne), "fccmp h10, h11, #nZcV, ne");
220b8021494Sopenharmony_ci  COMPARE(fccmp(h30, h16, NCFlag, pl), "fccmp h30, h16, #NzCv, pl");
221b8021494Sopenharmony_ci  COMPARE(fccmp(h31, h31, NZCVFlag, le), "fccmp h31, h31, #NZCV, le");
222b8021494Sopenharmony_ci  COMPARE(fccmp(s0, s1, NoFlag, eq), "fccmp s0, s1, #nzcv, eq");
223b8021494Sopenharmony_ci  COMPARE(fccmp(s2, s3, ZVFlag, ne), "fccmp s2, s3, #nZcV, ne");
224b8021494Sopenharmony_ci  COMPARE(fccmp(s30, s16, NCFlag, pl), "fccmp s30, s16, #NzCv, pl");
225b8021494Sopenharmony_ci  COMPARE(fccmp(s31, s31, NZCVFlag, le), "fccmp s31, s31, #NZCV, le");
226b8021494Sopenharmony_ci  COMPARE(fccmp(d4, d5, VFlag, gt), "fccmp d4, d5, #nzcV, gt");
227b8021494Sopenharmony_ci  COMPARE(fccmp(d6, d7, NFlag, vs), "fccmp d6, d7, #Nzcv, vs");
228b8021494Sopenharmony_ci  COMPARE(fccmp(d30, d0, NZFlag, vc), "fccmp d30, d0, #NZcv, vc");
229b8021494Sopenharmony_ci  COMPARE(fccmp(d31, d31, ZFlag, hs), "fccmp d31, d31, #nZcv, hs");
230b8021494Sopenharmony_ci  COMPARE(fccmp(h12, h13, CVFlag, al), "fccmp h12, h13, #nzCV, al");
231b8021494Sopenharmony_ci  COMPARE(fccmp(s14, s15, CVFlag, al), "fccmp s14, s15, #nzCV, al");
232b8021494Sopenharmony_ci  COMPARE(fccmp(d16, d17, CFlag, nv), "fccmp d16, d17, #nzCv, nv");
233b8021494Sopenharmony_ci
234b8021494Sopenharmony_ci  COMPARE(fccmpe(h8, h9, NoFlag, eq), "fccmpe h8, h9, #nzcv, eq");
235b8021494Sopenharmony_ci  COMPARE(fccmpe(h10, h11, ZVFlag, ne), "fccmpe h10, h11, #nZcV, ne");
236b8021494Sopenharmony_ci  COMPARE(fccmpe(h30, h16, NCFlag, pl), "fccmpe h30, h16, #NzCv, pl");
237b8021494Sopenharmony_ci  COMPARE(fccmpe(h31, h31, NZCVFlag, le), "fccmpe h31, h31, #NZCV, le");
238b8021494Sopenharmony_ci  COMPARE(fccmpe(s0, s1, NoFlag, eq), "fccmpe s0, s1, #nzcv, eq");
239b8021494Sopenharmony_ci  COMPARE(fccmpe(s2, s3, ZVFlag, ne), "fccmpe s2, s3, #nZcV, ne");
240b8021494Sopenharmony_ci  COMPARE(fccmpe(s30, s16, NCFlag, pl), "fccmpe s30, s16, #NzCv, pl");
241b8021494Sopenharmony_ci  COMPARE(fccmpe(s31, s31, NZCVFlag, le), "fccmpe s31, s31, #NZCV, le");
242b8021494Sopenharmony_ci  COMPARE(fccmpe(d4, d5, VFlag, gt), "fccmpe d4, d5, #nzcV, gt");
243b8021494Sopenharmony_ci  COMPARE(fccmpe(d6, d7, NFlag, vs), "fccmpe d6, d7, #Nzcv, vs");
244b8021494Sopenharmony_ci  COMPARE(fccmpe(d30, d0, NZFlag, vc), "fccmpe d30, d0, #NZcv, vc");
245b8021494Sopenharmony_ci  COMPARE(fccmpe(d31, d31, ZFlag, hs), "fccmpe d31, d31, #nZcv, hs");
246b8021494Sopenharmony_ci  COMPARE(fccmpe(h12, h13, CVFlag, al), "fccmpe h12, h13, #nzCV, al");
247b8021494Sopenharmony_ci  COMPARE(fccmpe(s14, s15, CVFlag, al), "fccmpe s14, s15, #nzCV, al");
248b8021494Sopenharmony_ci  COMPARE(fccmpe(d16, d17, CFlag, nv), "fccmpe d16, d17, #nzCv, nv");
249b8021494Sopenharmony_ci
250b8021494Sopenharmony_ci  CLEANUP();
251b8021494Sopenharmony_ci}
252b8021494Sopenharmony_ci
253b8021494Sopenharmony_ciTEST(fp_select) {
254b8021494Sopenharmony_ci  SETUP();
255b8021494Sopenharmony_ci
256b8021494Sopenharmony_ci  COMPARE(fcsel(h0, h1, h2, eq), "fcsel h0, h1, h2, eq");
257b8021494Sopenharmony_ci  COMPARE(fcsel(h31, h31, h30, ne), "fcsel h31, h31, h30, ne");
258b8021494Sopenharmony_ci  COMPARE(fcsel(s0, s1, s2, eq), "fcsel s0, s1, s2, eq");
259b8021494Sopenharmony_ci  COMPARE(fcsel(s31, s31, s30, ne), "fcsel s31, s31, s30, ne");
260b8021494Sopenharmony_ci  COMPARE(fcsel(d0, d1, d2, mi), "fcsel d0, d1, d2, mi");
261b8021494Sopenharmony_ci  COMPARE(fcsel(d31, d30, d31, pl), "fcsel d31, d30, d31, pl");
262b8021494Sopenharmony_ci  COMPARE(fcsel(h11, h12, h13, al), "fcsel h11, h12, h13, al");
263b8021494Sopenharmony_ci  COMPARE(fcsel(s14, s15, s16, al), "fcsel s14, s15, s16, al");
264b8021494Sopenharmony_ci  COMPARE(fcsel(d17, d18, d19, nv), "fcsel d17, d18, d19, nv");
265b8021494Sopenharmony_ci
266b8021494Sopenharmony_ci  CLEANUP();
267b8021494Sopenharmony_ci}
268b8021494Sopenharmony_ci
269b8021494Sopenharmony_ciTEST(fcvt_scvtf_ucvtf) {
270b8021494Sopenharmony_ci  SETUP();
271b8021494Sopenharmony_ci
272b8021494Sopenharmony_ci  COMPARE(fcvtas(w0, s1), "fcvtas w0, s1");
273b8021494Sopenharmony_ci  COMPARE(fcvtas(x2, s3), "fcvtas x2, s3");
274b8021494Sopenharmony_ci  COMPARE(fcvtas(w4, d5), "fcvtas w4, d5");
275b8021494Sopenharmony_ci  COMPARE(fcvtas(x6, d7), "fcvtas x6, d7");
276b8021494Sopenharmony_ci  COMPARE(fcvtau(w8, s9), "fcvtau w8, s9");
277b8021494Sopenharmony_ci  COMPARE(fcvtau(x10, s11), "fcvtau x10, s11");
278b8021494Sopenharmony_ci  COMPARE(fcvtau(w12, d13), "fcvtau w12, d13");
279b8021494Sopenharmony_ci  COMPARE(fcvtau(x14, d15), "fcvtau x14, d15");
280b8021494Sopenharmony_ci  COMPARE(fcvtns(w0, s1), "fcvtns w0, s1");
281b8021494Sopenharmony_ci  COMPARE(fcvtns(x2, s3), "fcvtns x2, s3");
282b8021494Sopenharmony_ci  COMPARE(fcvtns(w4, d5), "fcvtns w4, d5");
283b8021494Sopenharmony_ci  COMPARE(fcvtns(x6, d7), "fcvtns x6, d7");
284b8021494Sopenharmony_ci  COMPARE(fcvtnu(w8, s9), "fcvtnu w8, s9");
285b8021494Sopenharmony_ci  COMPARE(fcvtnu(x10, s11), "fcvtnu x10, s11");
286b8021494Sopenharmony_ci  COMPARE(fcvtnu(w12, d13), "fcvtnu w12, d13");
287b8021494Sopenharmony_ci  COMPARE(fcvtnu(x14, d15), "fcvtnu x14, d15");
288b8021494Sopenharmony_ci  COMPARE(fcvtzu(x16, d17), "fcvtzu x16, d17");
289b8021494Sopenharmony_ci  COMPARE(fcvtzu(w18, d19), "fcvtzu w18, d19");
290b8021494Sopenharmony_ci  COMPARE(fcvtzs(x20, d21), "fcvtzs x20, d21");
291b8021494Sopenharmony_ci  COMPARE(fcvtzs(w22, d23), "fcvtzs w22, d23");
292b8021494Sopenharmony_ci  COMPARE(fcvtzu(x16, s17), "fcvtzu x16, s17");
293b8021494Sopenharmony_ci  COMPARE(fcvtzu(w18, s19), "fcvtzu w18, s19");
294b8021494Sopenharmony_ci  COMPARE(fcvtzs(x20, s21), "fcvtzs x20, s21");
295b8021494Sopenharmony_ci  COMPARE(fcvtzs(w22, s23), "fcvtzs w22, s23");
296b8021494Sopenharmony_ci  COMPARE(fcvtzs(w2, d1, 1), "fcvtzs w2, d1, #1");
297b8021494Sopenharmony_ci  COMPARE(fcvtzs(w2, s1, 1), "fcvtzs w2, s1, #1");
298b8021494Sopenharmony_ci  COMPARE(fcvtzs(x4, d3, 15), "fcvtzs x4, d3, #15");
299b8021494Sopenharmony_ci  COMPARE(fcvtzs(x4, s3, 15), "fcvtzs x4, s3, #15");
300b8021494Sopenharmony_ci  COMPARE(fcvtzs(w6, d5, 32), "fcvtzs w6, d5, #32");
301b8021494Sopenharmony_ci  COMPARE(fcvtzs(w6, s5, 32), "fcvtzs w6, s5, #32");
302b8021494Sopenharmony_ci  COMPARE(fjcvtzs(w0, d1), "fjcvtzs w0, d1");
303b8021494Sopenharmony_ci  COMPARE(fcvtzu(w2, d1, 1), "fcvtzu w2, d1, #1");
304b8021494Sopenharmony_ci  COMPARE(fcvtzu(w2, s1, 1), "fcvtzu w2, s1, #1");
305b8021494Sopenharmony_ci  COMPARE(fcvtzu(x4, d3, 15), "fcvtzu x4, d3, #15");
306b8021494Sopenharmony_ci  COMPARE(fcvtzu(x4, s3, 15), "fcvtzu x4, s3, #15");
307b8021494Sopenharmony_ci  COMPARE(fcvtzu(w6, d5, 32), "fcvtzu w6, d5, #32");
308b8021494Sopenharmony_ci  COMPARE(fcvtzu(w6, s5, 32), "fcvtzu w6, s5, #32");
309b8021494Sopenharmony_ci  COMPARE(fcvtpu(x24, d25), "fcvtpu x24, d25");
310b8021494Sopenharmony_ci  COMPARE(fcvtpu(w26, d27), "fcvtpu w26, d27");
311b8021494Sopenharmony_ci  COMPARE(fcvtps(x28, d29), "fcvtps x28, d29");
312b8021494Sopenharmony_ci  COMPARE(fcvtps(w30, d31), "fcvtps w30, d31");
313b8021494Sopenharmony_ci  COMPARE(fcvtpu(x0, s1), "fcvtpu x0, s1");
314b8021494Sopenharmony_ci  COMPARE(fcvtpu(w2, s3), "fcvtpu w2, s3");
315b8021494Sopenharmony_ci  COMPARE(fcvtps(x4, s5), "fcvtps x4, s5");
316b8021494Sopenharmony_ci  COMPARE(fcvtps(w6, s7), "fcvtps w6, s7");
317b8021494Sopenharmony_ci  COMPARE(scvtf(d24, w25), "scvtf d24, w25");
318b8021494Sopenharmony_ci  COMPARE(scvtf(s24, w25), "scvtf s24, w25");
319b8021494Sopenharmony_ci  COMPARE(scvtf(d26, x0), "scvtf d26, x0");
320b8021494Sopenharmony_ci  COMPARE(scvtf(s26, x0), "scvtf s26, x0");
321b8021494Sopenharmony_ci  COMPARE(ucvtf(d28, w29), "ucvtf d28, w29");
322b8021494Sopenharmony_ci  COMPARE(ucvtf(s28, w29), "ucvtf s28, w29");
323b8021494Sopenharmony_ci  COMPARE(ucvtf(d0, x1), "ucvtf d0, x1");
324b8021494Sopenharmony_ci  COMPARE(ucvtf(s0, x1), "ucvtf s0, x1");
325b8021494Sopenharmony_ci  COMPARE(ucvtf(d0, x1, 0), "ucvtf d0, x1");
326b8021494Sopenharmony_ci  COMPARE(ucvtf(s0, x1, 0), "ucvtf s0, x1");
327b8021494Sopenharmony_ci  COMPARE(scvtf(d1, x2, 1), "scvtf d1, x2, #1");
328b8021494Sopenharmony_ci  COMPARE(scvtf(s1, x2, 1), "scvtf s1, x2, #1");
329b8021494Sopenharmony_ci  COMPARE(scvtf(d3, x4, 15), "scvtf d3, x4, #15");
330b8021494Sopenharmony_ci  COMPARE(scvtf(s3, x4, 15), "scvtf s3, x4, #15");
331b8021494Sopenharmony_ci  COMPARE(scvtf(d5, x6, 32), "scvtf d5, x6, #32");
332b8021494Sopenharmony_ci  COMPARE(scvtf(s5, x6, 32), "scvtf s5, x6, #32");
333b8021494Sopenharmony_ci  COMPARE(ucvtf(d7, x8, 2), "ucvtf d7, x8, #2");
334b8021494Sopenharmony_ci  COMPARE(ucvtf(s7, x8, 2), "ucvtf s7, x8, #2");
335b8021494Sopenharmony_ci  COMPARE(ucvtf(d9, x10, 16), "ucvtf d9, x10, #16");
336b8021494Sopenharmony_ci  COMPARE(ucvtf(s9, x10, 16), "ucvtf s9, x10, #16");
337b8021494Sopenharmony_ci  COMPARE(ucvtf(d11, x12, 33), "ucvtf d11, x12, #33");
338b8021494Sopenharmony_ci  COMPARE(ucvtf(s11, x12, 33), "ucvtf s11, x12, #33");
339b8021494Sopenharmony_ci  COMPARE(fcvtms(w0, s1), "fcvtms w0, s1");
340b8021494Sopenharmony_ci  COMPARE(fcvtms(x2, s3), "fcvtms x2, s3");
341b8021494Sopenharmony_ci  COMPARE(fcvtms(w4, d5), "fcvtms w4, d5");
342b8021494Sopenharmony_ci  COMPARE(fcvtms(x6, d7), "fcvtms x6, d7");
343b8021494Sopenharmony_ci  COMPARE(fcvtmu(w8, s9), "fcvtmu w8, s9");
344b8021494Sopenharmony_ci  COMPARE(fcvtmu(x10, s11), "fcvtmu x10, s11");
345b8021494Sopenharmony_ci  COMPARE(fcvtmu(w12, d13), "fcvtmu w12, d13");
346b8021494Sopenharmony_ci  COMPARE(fcvtmu(x14, d15), "fcvtmu x14, d15");
347b8021494Sopenharmony_ci
348b8021494Sopenharmony_ci  COMPARE(fcvtas(w0, h1), "fcvtas w0, h1");
349b8021494Sopenharmony_ci  COMPARE(fcvtas(x2, h3), "fcvtas x2, h3");
350b8021494Sopenharmony_ci  COMPARE(fcvtau(w8, h9), "fcvtau w8, h9");
351b8021494Sopenharmony_ci  COMPARE(fcvtau(x10, h11), "fcvtau x10, h11");
352b8021494Sopenharmony_ci  COMPARE(fcvtns(w0, h1), "fcvtns w0, h1");
353b8021494Sopenharmony_ci  COMPARE(fcvtns(x2, h3), "fcvtns x2, h3");
354b8021494Sopenharmony_ci  COMPARE(fcvtnu(w8, h9), "fcvtnu w8, h9");
355b8021494Sopenharmony_ci  COMPARE(fcvtnu(x10, h11), "fcvtnu x10, h11");
356b8021494Sopenharmony_ci  COMPARE(fcvtzu(x16, h17), "fcvtzu x16, h17");
357b8021494Sopenharmony_ci  COMPARE(fcvtzu(w18, h19), "fcvtzu w18, h19");
358b8021494Sopenharmony_ci  COMPARE(fcvtzs(x20, h21), "fcvtzs x20, h21");
359b8021494Sopenharmony_ci  COMPARE(fcvtzs(w22, h23), "fcvtzs w22, h23");
360b8021494Sopenharmony_ci  COMPARE(fcvtzs(w2, h1, 1), "fcvtzs w2, h1, #1");
361b8021494Sopenharmony_ci  COMPARE(fcvtzs(x4, h3, 15), "fcvtzs x4, h3, #15");
362b8021494Sopenharmony_ci  COMPARE(fcvtzs(w6, h5, 32), "fcvtzs w6, h5, #32");
363b8021494Sopenharmony_ci  COMPARE(fcvtzu(w2, h1, 1), "fcvtzu w2, h1, #1");
364b8021494Sopenharmony_ci  COMPARE(fcvtzu(x4, h3, 15), "fcvtzu x4, h3, #15");
365b8021494Sopenharmony_ci  COMPARE(fcvtzu(w6, h5, 32), "fcvtzu w6, h5, #32");
366b8021494Sopenharmony_ci  COMPARE(fcvtpu(x0, h1), "fcvtpu x0, h1");
367b8021494Sopenharmony_ci  COMPARE(fcvtpu(w2, h3), "fcvtpu w2, h3");
368b8021494Sopenharmony_ci  COMPARE(fcvtps(x4, h5), "fcvtps x4, h5");
369b8021494Sopenharmony_ci  COMPARE(fcvtps(w6, h7), "fcvtps w6, h7");
370b8021494Sopenharmony_ci  COMPARE(scvtf(h24, w25), "scvtf h24, w25");
371b8021494Sopenharmony_ci  COMPARE(scvtf(h26, x0), "scvtf h26, x0");
372b8021494Sopenharmony_ci  COMPARE(ucvtf(h28, w29), "ucvtf h28, w29");
373b8021494Sopenharmony_ci  COMPARE(ucvtf(h0, x1), "ucvtf h0, x1");
374b8021494Sopenharmony_ci  COMPARE(ucvtf(h0, x1, 0), "ucvtf h0, x1");
375b8021494Sopenharmony_ci  COMPARE(scvtf(h1, x2, 1), "scvtf h1, x2, #1");
376b8021494Sopenharmony_ci  COMPARE(scvtf(h3, x4, 15), "scvtf h3, x4, #15");
377b8021494Sopenharmony_ci  COMPARE(scvtf(h5, x6, 32), "scvtf h5, x6, #32");
378b8021494Sopenharmony_ci  COMPARE(ucvtf(h7, x8, 2), "ucvtf h7, x8, #2");
379b8021494Sopenharmony_ci  COMPARE(ucvtf(h9, x10, 16), "ucvtf h9, x10, #16");
380b8021494Sopenharmony_ci  COMPARE(ucvtf(h11, x12, 33), "ucvtf h11, x12, #33");
381b8021494Sopenharmony_ci  COMPARE(fcvtms(w0, h1), "fcvtms w0, h1");
382b8021494Sopenharmony_ci  COMPARE(fcvtms(x2, h3), "fcvtms x2, h3");
383b8021494Sopenharmony_ci  COMPARE(fcvtmu(w8, h9), "fcvtmu w8, h9");
384b8021494Sopenharmony_ci  COMPARE(fcvtmu(x10, h11), "fcvtmu x10, h11");
385b8021494Sopenharmony_ci
386b8021494Sopenharmony_ci  CLEANUP();
387b8021494Sopenharmony_ci}
388b8021494Sopenharmony_ci
389b8021494Sopenharmony_ci}  // namespace aarch64
390b8021494Sopenharmony_ci}  // namespace vixl
391