1b8021494Sopenharmony_ci// Copyright 2016, 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// Test description for instructions of the following form:
28b8021494Sopenharmony_ci//   MNEMONIC{<c>}.W <Rd>, <Rn>, <Rm>
29b8021494Sopenharmony_ci//
30b8021494Sopenharmony_ci// The instructions covered in this test do not write to the `Q` and `GE` flags,
31b8021494Sopenharmony_ci// these are covered in other description files.
32b8021494Sopenharmony_ci
33b8021494Sopenharmony_ci{
34b8021494Sopenharmony_ci  "mnemonics": [
35b8021494Sopenharmony_ci    "Mul",     // MUL{<c>}{<q>} <Rd>, <Rn>, {<Rm>} ; T2
36b8021494Sopenharmony_ci    "Qadd16",  // QADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
37b8021494Sopenharmony_ci    "Qadd8",   // QADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
38b8021494Sopenharmony_ci    "Qasx",    // QASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
39b8021494Sopenharmony_ci    "Qsax",    // QSAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
40b8021494Sopenharmony_ci    "Qsub16",  // QSUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
41b8021494Sopenharmony_ci    "Qsub8",   // QSUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
42b8021494Sopenharmony_ci    "Sdiv",    // SDIV{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
43b8021494Sopenharmony_ci    "Shadd16", // SHADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
44b8021494Sopenharmony_ci    "Shadd8",  // SHADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
45b8021494Sopenharmony_ci    "Shasx",   // SHASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
46b8021494Sopenharmony_ci    "Shsax",   // SHSAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
47b8021494Sopenharmony_ci    "Shsub16", // SHSUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
48b8021494Sopenharmony_ci    "Shsub8",  // SHSUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
49b8021494Sopenharmony_ci    "Smmul",   // SMMUL{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
50b8021494Sopenharmony_ci    "Smmulr",  // SMMULR{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
51b8021494Sopenharmony_ci    "Smuad",   // SMUAD{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
52b8021494Sopenharmony_ci    "Smuadx",  // SMUADX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
53b8021494Sopenharmony_ci    "Smulbb",  // SMULBB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
54b8021494Sopenharmony_ci    "Smulbt",  // SMULBT{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
55b8021494Sopenharmony_ci    "Smultb",  // SMULTB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
56b8021494Sopenharmony_ci    "Smultt",  // SMULTT{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
57b8021494Sopenharmony_ci    "Smulwb",  // SMULWB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
58b8021494Sopenharmony_ci    "Smulwt",  // SMULWT{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
59b8021494Sopenharmony_ci    "Smusd",   // SMUSD{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
60b8021494Sopenharmony_ci    "Smusdx",  // SMUSDX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
61b8021494Sopenharmony_ci    "Udiv",    // UDIV{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
62b8021494Sopenharmony_ci    "Uhadd16", // UHADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
63b8021494Sopenharmony_ci    "Uhadd8",  // UHADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
64b8021494Sopenharmony_ci    "Uhasx",   // UHASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
65b8021494Sopenharmony_ci    "Uhsax",   // UHSAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
66b8021494Sopenharmony_ci    "Uhsub16", // UHSUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
67b8021494Sopenharmony_ci    "Uhsub8",  // UHSUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
68b8021494Sopenharmony_ci    "Uqadd16", // UQADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
69b8021494Sopenharmony_ci    "Uqadd8",  // UQADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
70b8021494Sopenharmony_ci    "Uqasx",   // UQASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
71b8021494Sopenharmony_ci    "Uqsax",   // UQSAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
72b8021494Sopenharmony_ci    "Uqsub16", // UQSUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
73b8021494Sopenharmony_ci    "Uqsub8",  // UQSUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
74b8021494Sopenharmony_ci    "Usad8",   // USAD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
75b8021494Sopenharmony_ci
76b8021494Sopenharmony_ci    // Instructions affecting the GE bits.
77b8021494Sopenharmony_ci    "Sadd16", // SADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
78b8021494Sopenharmony_ci    "Sadd8",  // SADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
79b8021494Sopenharmony_ci    "Sasx",   // SASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
80b8021494Sopenharmony_ci    "Sel",    // SEL{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
81b8021494Sopenharmony_ci    "Ssax",   // SSAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
82b8021494Sopenharmony_ci    "Ssub16", // SSUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
83b8021494Sopenharmony_ci    "Ssub8",  // SSUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
84b8021494Sopenharmony_ci    "Uadd16", // UADD16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
85b8021494Sopenharmony_ci    "Uadd8",  // UADD8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
86b8021494Sopenharmony_ci    "Uasx",   // UASX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
87b8021494Sopenharmony_ci    "Usax",   // USAX{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
88b8021494Sopenharmony_ci    "Usub16", // USUB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
89b8021494Sopenharmony_ci    "Usub8",  // USUB8{<c>}{<q>} {<Rd>}, <Rn>, <Rm> ; T1
90b8021494Sopenharmony_ci
91b8021494Sopenharmony_ci    // Instructions affecting the Q bit.
92b8021494Sopenharmony_ci    "Qadd",  // QADD{<c>}{<q>} {<Rd>}, <Rm>, <Rn> ; T1
93b8021494Sopenharmony_ci    "Qdadd", // QDADD{<c>}{<q>} {<Rd>}, <Rm>, <Rn> ; T1
94b8021494Sopenharmony_ci    "Qdsub", // QDSUB{<c>}{<q>} {<Rd>}, <Rm>, <Rn> ; T1
95b8021494Sopenharmony_ci    "Qsub"   // QSUB{<c>}{<q>} {<Rd>}, <Rm>, <Rn> ; T1
96b8021494Sopenharmony_ci  ],
97b8021494Sopenharmony_ci  "description": {
98b8021494Sopenharmony_ci    "operands": [
99b8021494Sopenharmony_ci      {
100b8021494Sopenharmony_ci        "name": "cond",
101b8021494Sopenharmony_ci        "type": "Condition"
102b8021494Sopenharmony_ci      },
103b8021494Sopenharmony_ci      {
104b8021494Sopenharmony_ci        "name": "rd",
105b8021494Sopenharmony_ci        "type": "AllRegistersButPC"
106b8021494Sopenharmony_ci      },
107b8021494Sopenharmony_ci      {
108b8021494Sopenharmony_ci        "name": "rn",
109b8021494Sopenharmony_ci        "type": "AllRegistersButPC"
110b8021494Sopenharmony_ci      },
111b8021494Sopenharmony_ci      {
112b8021494Sopenharmony_ci        "name": "rm",
113b8021494Sopenharmony_ci        "type": "AllRegistersButPC"
114b8021494Sopenharmony_ci      }
115b8021494Sopenharmony_ci    ],
116b8021494Sopenharmony_ci    "inputs": [
117b8021494Sopenharmony_ci      {
118b8021494Sopenharmony_ci        "name": "apsr",
119b8021494Sopenharmony_ci        "type": "NZCV"
120b8021494Sopenharmony_ci      },
121b8021494Sopenharmony_ci      {
122b8021494Sopenharmony_ci        "name": "qbit",
123b8021494Sopenharmony_ci        "type": "Q"
124b8021494Sopenharmony_ci      },
125b8021494Sopenharmony_ci      {
126b8021494Sopenharmony_ci        "name": "ge",
127b8021494Sopenharmony_ci        "type": "GE"
128b8021494Sopenharmony_ci      },
129b8021494Sopenharmony_ci      {
130b8021494Sopenharmony_ci        "name": "rd",
131b8021494Sopenharmony_ci        "type": "Register"
132b8021494Sopenharmony_ci      },
133b8021494Sopenharmony_ci      {
134b8021494Sopenharmony_ci        "name": "rn",
135b8021494Sopenharmony_ci        "type": "Register"
136b8021494Sopenharmony_ci      },
137b8021494Sopenharmony_ci      {
138b8021494Sopenharmony_ci        "name": "rm",
139b8021494Sopenharmony_ci        "type": "Register"
140b8021494Sopenharmony_ci      }
141b8021494Sopenharmony_ci    ]
142b8021494Sopenharmony_ci  },
143b8021494Sopenharmony_ci  "test-files": [
144b8021494Sopenharmony_ci    {
145b8021494Sopenharmony_ci      "type": "assembler",
146b8021494Sopenharmony_ci      "test-cases": [
147b8021494Sopenharmony_ci        {
148b8021494Sopenharmony_ci          "name": "Unconditional",
149b8021494Sopenharmony_ci          "operands": [
150b8021494Sopenharmony_ci            "cond", "rd", "rn", "rm"
151b8021494Sopenharmony_ci          ],
152b8021494Sopenharmony_ci          "operand-filter": "cond == 'al'",
153b8021494Sopenharmony_ci          "operand-limit": 300
154b8021494Sopenharmony_ci        }
155b8021494Sopenharmony_ci      ]
156b8021494Sopenharmony_ci    },
157b8021494Sopenharmony_ci    {
158b8021494Sopenharmony_ci      "type": "simulator",
159b8021494Sopenharmony_ci      "test-cases": [
160b8021494Sopenharmony_ci        {
161b8021494Sopenharmony_ci          "name": "Condition",
162b8021494Sopenharmony_ci          "operands": [
163b8021494Sopenharmony_ci            "cond"
164b8021494Sopenharmony_ci          ],
165b8021494Sopenharmony_ci          "inputs": [
166b8021494Sopenharmony_ci            "apsr"
167b8021494Sopenharmony_ci          ]
168b8021494Sopenharmony_ci        },
169b8021494Sopenharmony_ci        {
170b8021494Sopenharmony_ci          "name": "RdIsRnIsRm",
171b8021494Sopenharmony_ci          "operands": [
172b8021494Sopenharmony_ci            "rd", "rn", "rm"
173b8021494Sopenharmony_ci          ],
174b8021494Sopenharmony_ci          "inputs": [
175b8021494Sopenharmony_ci            "rd", "rn", "rm"
176b8021494Sopenharmony_ci          ],
177b8021494Sopenharmony_ci          "operand-filter": "(rd == rn) and (rd == rm)",
178b8021494Sopenharmony_ci          "input-filter": "(rd == rn) and (rd == rm)"
179b8021494Sopenharmony_ci        },
180b8021494Sopenharmony_ci        {
181b8021494Sopenharmony_ci          "name": "RdIsRn",
182b8021494Sopenharmony_ci          "operands": [
183b8021494Sopenharmony_ci            "rd", "rn", "rm"
184b8021494Sopenharmony_ci          ],
185b8021494Sopenharmony_ci          "inputs": [
186b8021494Sopenharmony_ci            "rd", "rn", "rm"
187b8021494Sopenharmony_ci          ],
188b8021494Sopenharmony_ci          "operand-filter": "(rd == rn) and (rn != rm)",
189b8021494Sopenharmony_ci          "operand-limit": 10,
190b8021494Sopenharmony_ci          "input-filter": "rd == rn",
191b8021494Sopenharmony_ci          "input-limit": 200
192b8021494Sopenharmony_ci        },
193b8021494Sopenharmony_ci        {
194b8021494Sopenharmony_ci          "name": "RdIsRm",
195b8021494Sopenharmony_ci          "operands": [
196b8021494Sopenharmony_ci            "rd", "rn", "rm"
197b8021494Sopenharmony_ci          ],
198b8021494Sopenharmony_ci          "inputs": [
199b8021494Sopenharmony_ci            "rd", "rn", "rm"
200b8021494Sopenharmony_ci          ],
201b8021494Sopenharmony_ci          "operand-filter": "(rd == rm) and (rn != rm)",
202b8021494Sopenharmony_ci          "operand-limit": 10,
203b8021494Sopenharmony_ci          "input-filter": "rd == rm",
204b8021494Sopenharmony_ci          "input-limit": 200
205b8021494Sopenharmony_ci        },
206b8021494Sopenharmony_ci        {
207b8021494Sopenharmony_ci          "name": "RnIsRm",
208b8021494Sopenharmony_ci          "operands": [
209b8021494Sopenharmony_ci            "rd", "rn", "rm"
210b8021494Sopenharmony_ci          ],
211b8021494Sopenharmony_ci          "inputs": [
212b8021494Sopenharmony_ci            "rd", "rn", "rm"
213b8021494Sopenharmony_ci          ],
214b8021494Sopenharmony_ci          "operand-filter": "(rn == rm) and (rm != rd)",
215b8021494Sopenharmony_ci          "operand-limit": 10,
216b8021494Sopenharmony_ci          "input-filter": "rn == rm",
217b8021494Sopenharmony_ci          "input-limit": 200
218b8021494Sopenharmony_ci        },
219b8021494Sopenharmony_ci        {
220b8021494Sopenharmony_ci          "name": "RdIsNotRnIsNotRm",
221b8021494Sopenharmony_ci          "operands": [
222b8021494Sopenharmony_ci            "rd", "rn", "rm"
223b8021494Sopenharmony_ci          ],
224b8021494Sopenharmony_ci          "inputs": [
225b8021494Sopenharmony_ci            "rd", "rn", "rm"
226b8021494Sopenharmony_ci          ],
227b8021494Sopenharmony_ci          "operand-filter": "(rd != rn) and (rd != rm)",
228b8021494Sopenharmony_ci          "operand-limit": 10,
229b8021494Sopenharmony_ci          "input-limit": 200
230b8021494Sopenharmony_ci        }
231b8021494Sopenharmony_ci      ]
232b8021494Sopenharmony_ci    },
233b8021494Sopenharmony_ci    {
234b8021494Sopenharmony_ci      "name": "ge",
235b8021494Sopenharmony_ci      "type": "simulator",
236b8021494Sopenharmony_ci      "mnemonics": [
237b8021494Sopenharmony_ci        "Sadd16",
238b8021494Sopenharmony_ci        "Sadd8",
239b8021494Sopenharmony_ci        "Sasx",
240b8021494Sopenharmony_ci        "Ssax",
241b8021494Sopenharmony_ci        "Ssub16",
242b8021494Sopenharmony_ci        "Ssub8",
243b8021494Sopenharmony_ci        "Uadd16",
244b8021494Sopenharmony_ci        "Uadd8",
245b8021494Sopenharmony_ci        "Uasx",
246b8021494Sopenharmony_ci        "Usax",
247b8021494Sopenharmony_ci        "Usub16",
248b8021494Sopenharmony_ci        "Usub8"
249b8021494Sopenharmony_ci      ],
250b8021494Sopenharmony_ci      "test-cases": [
251b8021494Sopenharmony_ci        {
252b8021494Sopenharmony_ci          "name": "GE",
253b8021494Sopenharmony_ci          "operands": [
254b8021494Sopenharmony_ci            "rd", "rn", "rm"
255b8021494Sopenharmony_ci          ],
256b8021494Sopenharmony_ci          "inputs": [
257b8021494Sopenharmony_ci            "ge", "rn", "rm"
258b8021494Sopenharmony_ci          ],
259b8021494Sopenharmony_ci          "operand-filter": "(rd != rn) and (rn != rm)",
260b8021494Sopenharmony_ci          "operand-limit": 1,
261b8021494Sopenharmony_ci          // Only use "all set" and "all cleared" as inputs.
262b8021494Sopenharmony_ci          "input-filter": "ge == 'NoFlag' or ge == 'GE0123Flag'",
263b8021494Sopenharmony_ci          "input-limit": 200
264b8021494Sopenharmony_ci        }
265b8021494Sopenharmony_ci      ]
266b8021494Sopenharmony_ci    },
267b8021494Sopenharmony_ci    {
268b8021494Sopenharmony_ci      "name": "sel",
269b8021494Sopenharmony_ci      "type": "simulator",
270b8021494Sopenharmony_ci      "mnemonics": [
271b8021494Sopenharmony_ci        "Sel"
272b8021494Sopenharmony_ci      ],
273b8021494Sopenharmony_ci      "test-cases": [
274b8021494Sopenharmony_ci        {
275b8021494Sopenharmony_ci          "name": "GE",
276b8021494Sopenharmony_ci          "operands": [
277b8021494Sopenharmony_ci            "rd", "rn", "rm"
278b8021494Sopenharmony_ci          ],
279b8021494Sopenharmony_ci          "inputs": [
280b8021494Sopenharmony_ci            "ge", "rn", "rm"
281b8021494Sopenharmony_ci          ],
282b8021494Sopenharmony_ci          "operand-filter": "(rd != rn) and (rn != rm)",
283b8021494Sopenharmony_ci          "operand-limit": 1,
284b8021494Sopenharmony_ci          "input-limit": 200
285b8021494Sopenharmony_ci        }
286b8021494Sopenharmony_ci      ]
287b8021494Sopenharmony_ci    },
288b8021494Sopenharmony_ci    {
289b8021494Sopenharmony_ci      "name": "q",
290b8021494Sopenharmony_ci      "type": "simulator",
291b8021494Sopenharmony_ci      "mnemonics": [
292b8021494Sopenharmony_ci        "Qadd",
293b8021494Sopenharmony_ci        "Qdadd",
294b8021494Sopenharmony_ci        "Qdsub",
295b8021494Sopenharmony_ci        "Qsub"
296b8021494Sopenharmony_ci      ],
297b8021494Sopenharmony_ci      "test-cases": [
298b8021494Sopenharmony_ci        {
299b8021494Sopenharmony_ci          "name": "QOutput",
300b8021494Sopenharmony_ci          "operands": [
301b8021494Sopenharmony_ci            "rn", "rm"
302b8021494Sopenharmony_ci          ],
303b8021494Sopenharmony_ci          "inputs": [
304b8021494Sopenharmony_ci            "qbit", "rn", "rm"
305b8021494Sopenharmony_ci          ],
306b8021494Sopenharmony_ci          "operand-limit": 1,
307b8021494Sopenharmony_ci          "operand-filter": "rn != rm",
308b8021494Sopenharmony_ci          "input-limit": 200
309b8021494Sopenharmony_ci        }
310b8021494Sopenharmony_ci      ]
311b8021494Sopenharmony_ci    }
312b8021494Sopenharmony_ci  ]
313b8021494Sopenharmony_ci}
314