18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * arch/arm/probes/kprobes/test-thumb.c
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/kernel.h>
98c2ecf20Sopenharmony_ci#include <linux/module.h>
108c2ecf20Sopenharmony_ci#include <asm/opcodes.h>
118c2ecf20Sopenharmony_ci#include <asm/probes.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include "test-core.h"
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define TEST_ISA "16"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define DONT_TEST_IN_ITBLOCK(tests)			\
198c2ecf20Sopenharmony_ci	kprobe_test_flags |= TEST_FLAG_NO_ITBLOCK;	\
208c2ecf20Sopenharmony_ci	tests						\
218c2ecf20Sopenharmony_ci	kprobe_test_flags &= ~TEST_FLAG_NO_ITBLOCK;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define CONDITION_INSTRUCTIONS(cc_pos, tests)		\
248c2ecf20Sopenharmony_ci	kprobe_test_cc_position = cc_pos;		\
258c2ecf20Sopenharmony_ci	DONT_TEST_IN_ITBLOCK(tests)			\
268c2ecf20Sopenharmony_ci	kprobe_test_cc_position = 0;
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define TEST_ITBLOCK(code)				\
298c2ecf20Sopenharmony_ci	kprobe_test_flags |= TEST_FLAG_FULL_ITBLOCK;	\
308c2ecf20Sopenharmony_ci	TESTCASE_START(code)				\
318c2ecf20Sopenharmony_ci	TEST_ARG_END("")				\
328c2ecf20Sopenharmony_ci	"50:	nop			\n\t"		\
338c2ecf20Sopenharmony_ci	"1:	"code"			\n\t"		\
348c2ecf20Sopenharmony_ci	"	mov r1, #0x11		\n\t"		\
358c2ecf20Sopenharmony_ci	"	mov r2, #0x22		\n\t"		\
368c2ecf20Sopenharmony_ci	"	mov r3, #0x33		\n\t"		\
378c2ecf20Sopenharmony_ci	"2:	nop			\n\t"		\
388c2ecf20Sopenharmony_ci	TESTCASE_END					\
398c2ecf20Sopenharmony_ci	kprobe_test_flags &= ~TEST_FLAG_FULL_ITBLOCK;
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define TEST_THUMB_TO_ARM_INTERWORK_P(code1, reg, val, code2)	\
428c2ecf20Sopenharmony_ci	TESTCASE_START(code1 #reg code2)			\
438c2ecf20Sopenharmony_ci	TEST_ARG_PTR(reg, val)					\
448c2ecf20Sopenharmony_ci	TEST_ARG_REG(14, 99f+1)					\
458c2ecf20Sopenharmony_ci	TEST_ARG_MEM(15, 3f)					\
468c2ecf20Sopenharmony_ci	TEST_ARG_END("")					\
478c2ecf20Sopenharmony_ci	"	nop			\n\t" /* To align 1f */	\
488c2ecf20Sopenharmony_ci	"50:	nop			\n\t"			\
498c2ecf20Sopenharmony_ci	"1:	"code1 #reg code2"	\n\t"			\
508c2ecf20Sopenharmony_ci	"	bx	lr		\n\t"			\
518c2ecf20Sopenharmony_ci	".arm				\n\t"			\
528c2ecf20Sopenharmony_ci	"3:	adr	lr, 2f+1	\n\t"			\
538c2ecf20Sopenharmony_ci	"	bx	lr		\n\t"			\
548c2ecf20Sopenharmony_ci	".thumb				\n\t"			\
558c2ecf20Sopenharmony_ci	"2:	nop			\n\t"			\
568c2ecf20Sopenharmony_ci	TESTCASE_END
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_civoid kprobe_thumb16_test_cases(void)
608c2ecf20Sopenharmony_ci{
618c2ecf20Sopenharmony_ci	kprobe_test_flags = TEST_FLAG_NARROW_INSTR;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	TEST_GROUP("Shift (immediate), add, subtract, move, and compare")
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	TEST_R(    "lsls	r7, r",0,VAL1,", #5")
668c2ecf20Sopenharmony_ci	TEST_R(    "lsls	r0, r",7,VAL2,", #11")
678c2ecf20Sopenharmony_ci	TEST_R(    "lsrs	r7, r",0,VAL1,", #5")
688c2ecf20Sopenharmony_ci	TEST_R(    "lsrs	r0, r",7,VAL2,", #11")
698c2ecf20Sopenharmony_ci	TEST_R(    "asrs	r7, r",0,VAL1,", #5")
708c2ecf20Sopenharmony_ci	TEST_R(    "asrs	r0, r",7,VAL2,", #11")
718c2ecf20Sopenharmony_ci	TEST_RR(   "adds	r2, r",0,VAL1,", r",7,VAL2,"")
728c2ecf20Sopenharmony_ci	TEST_RR(   "adds	r5, r",7,VAL2,", r",0,VAL2,"")
738c2ecf20Sopenharmony_ci	TEST_RR(   "subs	r2, r",0,VAL1,", r",7,VAL2,"")
748c2ecf20Sopenharmony_ci	TEST_RR(   "subs	r5, r",7,VAL2,", r",0,VAL2,"")
758c2ecf20Sopenharmony_ci	TEST_R(    "adds	r7, r",0,VAL1,", #5")
768c2ecf20Sopenharmony_ci	TEST_R(    "adds	r0, r",7,VAL2,", #2")
778c2ecf20Sopenharmony_ci	TEST_R(    "subs	r7, r",0,VAL1,", #5")
788c2ecf20Sopenharmony_ci	TEST_R(    "subs	r0, r",7,VAL2,", #2")
798c2ecf20Sopenharmony_ci	TEST(      "movs.n	r0, #0x5f")
808c2ecf20Sopenharmony_ci	TEST(      "movs.n	r7, #0xa0")
818c2ecf20Sopenharmony_ci	TEST_R(    "cmp.n	r",0,0x5e, ", #0x5f")
828c2ecf20Sopenharmony_ci	TEST_R(    "cmp.n	r",5,0x15f,", #0x5f")
838c2ecf20Sopenharmony_ci	TEST_R(    "cmp.n	r",7,0xa0, ", #0xa0")
848c2ecf20Sopenharmony_ci	TEST_R(    "adds.n	r",0,VAL1,", #0x5f")
858c2ecf20Sopenharmony_ci	TEST_R(    "adds.n	r",7,VAL2,", #0xa0")
868c2ecf20Sopenharmony_ci	TEST_R(    "subs.n	r",0,VAL1,", #0x5f")
878c2ecf20Sopenharmony_ci	TEST_R(    "subs.n	r",7,VAL2,", #0xa0")
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci	TEST_GROUP("16-bit Thumb data-processing instructions")
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define DATA_PROCESSING16(op,val)			\
928c2ecf20Sopenharmony_ci	TEST_RR(   op"	r",0,VAL1,", r",7,val,"")	\
938c2ecf20Sopenharmony_ci	TEST_RR(   op"	r",7,VAL2,", r",0,val,"")
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci	DATA_PROCESSING16("ands",0xf00f00ff)
968c2ecf20Sopenharmony_ci	DATA_PROCESSING16("eors",0xf00f00ff)
978c2ecf20Sopenharmony_ci	DATA_PROCESSING16("lsls",11)
988c2ecf20Sopenharmony_ci	DATA_PROCESSING16("lsrs",11)
998c2ecf20Sopenharmony_ci	DATA_PROCESSING16("asrs",11)
1008c2ecf20Sopenharmony_ci	DATA_PROCESSING16("adcs",VAL2)
1018c2ecf20Sopenharmony_ci	DATA_PROCESSING16("sbcs",VAL2)
1028c2ecf20Sopenharmony_ci	DATA_PROCESSING16("rors",11)
1038c2ecf20Sopenharmony_ci	DATA_PROCESSING16("tst",0xf00f00ff)
1048c2ecf20Sopenharmony_ci	TEST_R("rsbs	r",0,VAL1,", #0")
1058c2ecf20Sopenharmony_ci	TEST_R("rsbs	r",7,VAL2,", #0")
1068c2ecf20Sopenharmony_ci	DATA_PROCESSING16("cmp",0xf00f00ff)
1078c2ecf20Sopenharmony_ci	DATA_PROCESSING16("cmn",0xf00f00ff)
1088c2ecf20Sopenharmony_ci	DATA_PROCESSING16("orrs",0xf00f00ff)
1098c2ecf20Sopenharmony_ci	DATA_PROCESSING16("muls",VAL2)
1108c2ecf20Sopenharmony_ci	DATA_PROCESSING16("bics",0xf00f00ff)
1118c2ecf20Sopenharmony_ci	DATA_PROCESSING16("mvns",VAL2)
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	TEST_GROUP("Special data instructions and branch and exchange")
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci	TEST_RR(  "add	r",0, VAL1,", r",7,VAL2,"")
1168c2ecf20Sopenharmony_ci	TEST_RR(  "add	r",3, VAL2,", r",8,VAL3,"")
1178c2ecf20Sopenharmony_ci	TEST_RR(  "add	r",8, VAL3,", r",0,VAL1,"")
1188c2ecf20Sopenharmony_ci	TEST_R(   "add	sp"        ", r",8,-8,  "")
1198c2ecf20Sopenharmony_ci	TEST_R(   "add	r",14,VAL1,", pc")
1208c2ecf20Sopenharmony_ci	TEST_BF_R("add	pc"        ", r",0,2f-1f-8,"")
1218c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0x44ff) "	@ add pc, pc")
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci	TEST_RR(  "cmp	r",3,VAL1,", r",8,VAL2,"")
1248c2ecf20Sopenharmony_ci	TEST_RR(  "cmp	r",8,VAL2,", r",0,VAL1,"")
1258c2ecf20Sopenharmony_ci	TEST_R(   "cmp	sp"       ", r",8,-8,  "")
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci	TEST_R(   "mov	r0, r",7,VAL2,"")
1288c2ecf20Sopenharmony_ci	TEST_R(   "mov	r3, r",8,VAL3,"")
1298c2ecf20Sopenharmony_ci	TEST_R(   "mov	r8, r",0,VAL1,"")
1308c2ecf20Sopenharmony_ci	TEST_P(   "mov	sp, r",8,-8,  "")
1318c2ecf20Sopenharmony_ci	TEST(     "mov	lr, pc")
1328c2ecf20Sopenharmony_ci	TEST_BF_R("mov	pc, r",0,2f,  "")
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci	TEST_BF_R("bx	r",0, 2f+1,"")
1358c2ecf20Sopenharmony_ci	TEST_BF_R("bx	r",14,2f+1,"")
1368c2ecf20Sopenharmony_ci	TESTCASE_START("bx	pc")
1378c2ecf20Sopenharmony_ci		TEST_ARG_REG(14, 99f+1)
1388c2ecf20Sopenharmony_ci		TEST_ARG_END("")
1398c2ecf20Sopenharmony_ci		"	nop			\n\t" /* To align the bx pc*/
1408c2ecf20Sopenharmony_ci		"50:	nop			\n\t"
1418c2ecf20Sopenharmony_ci		"1:	bx	pc		\n\t"
1428c2ecf20Sopenharmony_ci		"	bx	lr		\n\t"
1438c2ecf20Sopenharmony_ci		".arm				\n\t"
1448c2ecf20Sopenharmony_ci		"	adr	lr, 2f+1	\n\t"
1458c2ecf20Sopenharmony_ci		"	bx	lr		\n\t"
1468c2ecf20Sopenharmony_ci		".thumb				\n\t"
1478c2ecf20Sopenharmony_ci		"2:	nop			\n\t"
1488c2ecf20Sopenharmony_ci	TESTCASE_END
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci	TEST_BF_R("blx	r",0, 2f+1,"")
1518c2ecf20Sopenharmony_ci	TEST_BB_R("blx	r",14,2f+1,"")
1528c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0x47f8) "	@ blx pc")
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	TEST_GROUP("Load from Literal Pool")
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci	TEST_X( "ldr	r0, 3f",
1578c2ecf20Sopenharmony_ci		".align					\n\t"
1588c2ecf20Sopenharmony_ci		"3:	.word	"__stringify(VAL1))
1598c2ecf20Sopenharmony_ci	TEST_X( "ldr	r7, 3f",
1608c2ecf20Sopenharmony_ci		".space 128				\n\t"
1618c2ecf20Sopenharmony_ci		".align					\n\t"
1628c2ecf20Sopenharmony_ci		"3:	.word	"__stringify(VAL2))
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci	TEST_GROUP("16-bit Thumb Load/store instructions")
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	TEST_RPR("str	r",0, VAL1,", [r",1, 24,", r",2,  48,"]")
1678c2ecf20Sopenharmony_ci	TEST_RPR("str	r",7, VAL2,", [r",6, 24,", r",5,  48,"]")
1688c2ecf20Sopenharmony_ci	TEST_RPR("strh	r",0, VAL1,", [r",1, 24,", r",2,  48,"]")
1698c2ecf20Sopenharmony_ci	TEST_RPR("strh	r",7, VAL2,", [r",6, 24,", r",5,  48,"]")
1708c2ecf20Sopenharmony_ci	TEST_RPR("strb	r",0, VAL1,", [r",1, 24,", r",2,  48,"]")
1718c2ecf20Sopenharmony_ci	TEST_RPR("strb	r",7, VAL2,", [r",6, 24,", r",5,  48,"]")
1728c2ecf20Sopenharmony_ci	TEST_PR( "ldrsb	r0, [r",1, 24,", r",2,  48,"]")
1738c2ecf20Sopenharmony_ci	TEST_PR( "ldrsb	r7, [r",6, 24,", r",5,  50,"]")
1748c2ecf20Sopenharmony_ci	TEST_PR( "ldr	r0, [r",1, 24,", r",2,  48,"]")
1758c2ecf20Sopenharmony_ci	TEST_PR( "ldr	r7, [r",6, 24,", r",5,  48,"]")
1768c2ecf20Sopenharmony_ci	TEST_PR( "ldrh	r0, [r",1, 24,", r",2,  48,"]")
1778c2ecf20Sopenharmony_ci	TEST_PR( "ldrh	r7, [r",6, 24,", r",5,  50,"]")
1788c2ecf20Sopenharmony_ci	TEST_PR( "ldrb	r0, [r",1, 24,", r",2,  48,"]")
1798c2ecf20Sopenharmony_ci	TEST_PR( "ldrb	r7, [r",6, 24,", r",5,  50,"]")
1808c2ecf20Sopenharmony_ci	TEST_PR( "ldrsh	r0, [r",1, 24,", r",2,  48,"]")
1818c2ecf20Sopenharmony_ci	TEST_PR( "ldrsh	r7, [r",6, 24,", r",5,  50,"]")
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	TEST_RP("str	r",0, VAL1,", [r",1, 24,", #120]")
1848c2ecf20Sopenharmony_ci	TEST_RP("str	r",7, VAL2,", [r",6, 24,", #120]")
1858c2ecf20Sopenharmony_ci	TEST_P( "ldr	r0, [r",1, 24,", #120]")
1868c2ecf20Sopenharmony_ci	TEST_P( "ldr	r7, [r",6, 24,", #120]")
1878c2ecf20Sopenharmony_ci	TEST_RP("strb	r",0, VAL1,", [r",1, 24,", #30]")
1888c2ecf20Sopenharmony_ci	TEST_RP("strb	r",7, VAL2,", [r",6, 24,", #30]")
1898c2ecf20Sopenharmony_ci	TEST_P( "ldrb	r0, [r",1, 24,", #30]")
1908c2ecf20Sopenharmony_ci	TEST_P( "ldrb	r7, [r",6, 24,", #30]")
1918c2ecf20Sopenharmony_ci	TEST_RP("strh	r",0, VAL1,", [r",1, 24,", #60]")
1928c2ecf20Sopenharmony_ci	TEST_RP("strh	r",7, VAL2,", [r",6, 24,", #60]")
1938c2ecf20Sopenharmony_ci	TEST_P( "ldrh	r0, [r",1, 24,", #60]")
1948c2ecf20Sopenharmony_ci	TEST_P( "ldrh	r7, [r",6, 24,", #60]")
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci	TEST_R( "str	r",0, VAL1,", [sp, #0]")
1978c2ecf20Sopenharmony_ci	TEST_R( "str	r",7, VAL2,", [sp, #160]")
1988c2ecf20Sopenharmony_ci	TEST(   "ldr	r0, [sp, #0]")
1998c2ecf20Sopenharmony_ci	TEST(   "ldr	r7, [sp, #160]")
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci	TEST_RP("str	r",0, VAL1,", [r",0, 24,"]")
2028c2ecf20Sopenharmony_ci	TEST_P( "ldr	r0, [r",0, 24,"]")
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci	TEST_GROUP("Generate PC-/SP-relative address")
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci	TEST("add	r0, pc, #4")
2078c2ecf20Sopenharmony_ci	TEST("add	r7, pc, #1020")
2088c2ecf20Sopenharmony_ci	TEST("add	r0, sp, #4")
2098c2ecf20Sopenharmony_ci	TEST("add	r7, sp, #1020")
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci	TEST_GROUP("Miscellaneous 16-bit instructions")
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED( "cpsie	i")
2148c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED( "cpsid	i")
2158c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED( "setend	le")
2168c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED( "setend	be")
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	TEST("add	sp, #"__stringify(TEST_MEMORY_SIZE)) /* Assumes TEST_MEMORY_SIZE < 0x400 */
2198c2ecf20Sopenharmony_ci	TEST("sub	sp, #0x7f*4")
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ciDONT_TEST_IN_ITBLOCK(
2228c2ecf20Sopenharmony_ci	TEST_BF_R(  "cbnz	r",0,0, ", 2f")
2238c2ecf20Sopenharmony_ci	TEST_BF_R(  "cbz	r",2,-1,", 2f")
2248c2ecf20Sopenharmony_ci	TEST_BF_RX( "cbnz	r",4,1, ", 2f", SPACE_0x20)
2258c2ecf20Sopenharmony_ci	TEST_BF_RX( "cbz	r",7,0, ", 2f", SPACE_0x40)
2268c2ecf20Sopenharmony_ci)
2278c2ecf20Sopenharmony_ci	TEST_R("sxth	r0, r",7, HH1,"")
2288c2ecf20Sopenharmony_ci	TEST_R("sxth	r7, r",0, HH2,"")
2298c2ecf20Sopenharmony_ci	TEST_R("sxtb	r0, r",7, HH1,"")
2308c2ecf20Sopenharmony_ci	TEST_R("sxtb	r7, r",0, HH2,"")
2318c2ecf20Sopenharmony_ci	TEST_R("uxth	r0, r",7, HH1,"")
2328c2ecf20Sopenharmony_ci	TEST_R("uxth	r7, r",0, HH2,"")
2338c2ecf20Sopenharmony_ci	TEST_R("uxtb	r0, r",7, HH1,"")
2348c2ecf20Sopenharmony_ci	TEST_R("uxtb	r7, r",0, HH2,"")
2358c2ecf20Sopenharmony_ci	TEST_R("rev	r0, r",7, VAL1,"")
2368c2ecf20Sopenharmony_ci	TEST_R("rev	r7, r",0, VAL2,"")
2378c2ecf20Sopenharmony_ci	TEST_R("rev16	r0, r",7, VAL1,"")
2388c2ecf20Sopenharmony_ci	TEST_R("rev16	r7, r",0, VAL2,"")
2398c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xba80) "")
2408c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xbabf) "")
2418c2ecf20Sopenharmony_ci	TEST_R("revsh	r0, r",7, VAL1,"")
2428c2ecf20Sopenharmony_ci	TEST_R("revsh	r7, r",0, VAL2,"")
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci#define TEST_POPPC(code, offset)	\
2458c2ecf20Sopenharmony_ci	TESTCASE_START(code)		\
2468c2ecf20Sopenharmony_ci	TEST_ARG_PTR(13, offset)	\
2478c2ecf20Sopenharmony_ci	TEST_ARG_END("")		\
2488c2ecf20Sopenharmony_ci	TEST_BRANCH_F(code)		\
2498c2ecf20Sopenharmony_ci	TESTCASE_END
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci	TEST("push	{r0}")
2528c2ecf20Sopenharmony_ci	TEST("push	{r7}")
2538c2ecf20Sopenharmony_ci	TEST("push	{r14}")
2548c2ecf20Sopenharmony_ci	TEST("push	{r0-r7,r14}")
2558c2ecf20Sopenharmony_ci	TEST("push	{r0,r2,r4,r6,r14}")
2568c2ecf20Sopenharmony_ci	TEST("push	{r1,r3,r5,r7}")
2578c2ecf20Sopenharmony_ci	TEST("pop	{r0}")
2588c2ecf20Sopenharmony_ci	TEST("pop	{r7}")
2598c2ecf20Sopenharmony_ci	TEST("pop	{r0,r2,r4,r6}")
2608c2ecf20Sopenharmony_ci	TEST_POPPC("pop	{pc}",15*4)
2618c2ecf20Sopenharmony_ci	TEST_POPPC("pop	{r0-r7,pc}",7*4)
2628c2ecf20Sopenharmony_ci	TEST_POPPC("pop	{r1,r3,r5,r7,pc}",11*4)
2638c2ecf20Sopenharmony_ci	TEST_THUMB_TO_ARM_INTERWORK_P("pop	{pc}	@ ",13,15*4,"")
2648c2ecf20Sopenharmony_ci	TEST_THUMB_TO_ARM_INTERWORK_P("pop	{r0-r7,pc}	@ ",13,7*4,"")
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("bkpt.n	0")
2678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("bkpt.n	255")
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci	TEST_SUPPORTED("yield")
2708c2ecf20Sopenharmony_ci	TEST("sev")
2718c2ecf20Sopenharmony_ci	TEST("nop")
2728c2ecf20Sopenharmony_ci	TEST("wfi")
2738c2ecf20Sopenharmony_ci	TEST_SUPPORTED("wfe")
2748c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xbf50) "") /* Unassigned hints */
2758c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xbff0) "") /* Unassigned hints */
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci#define TEST_IT(code, code2)			\
2788c2ecf20Sopenharmony_ci	TESTCASE_START(code)			\
2798c2ecf20Sopenharmony_ci	TEST_ARG_END("")			\
2808c2ecf20Sopenharmony_ci	"50:	nop			\n\t"	\
2818c2ecf20Sopenharmony_ci	"1:	"code"			\n\t"	\
2828c2ecf20Sopenharmony_ci	"	"code2"			\n\t"	\
2838c2ecf20Sopenharmony_ci	"2:	nop			\n\t"	\
2848c2ecf20Sopenharmony_ci	TESTCASE_END
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ciDONT_TEST_IN_ITBLOCK(
2878c2ecf20Sopenharmony_ci	TEST_IT("it	eq","moveq r0,#0")
2888c2ecf20Sopenharmony_ci	TEST_IT("it	vc","movvc r0,#0")
2898c2ecf20Sopenharmony_ci	TEST_IT("it	le","movle r0,#0")
2908c2ecf20Sopenharmony_ci	TEST_IT("ite	eq","moveq r0,#0\n\t  movne r1,#1")
2918c2ecf20Sopenharmony_ci	TEST_IT("itet	vc","movvc r0,#0\n\t  movvs r1,#1\n\t  movvc r2,#2")
2928c2ecf20Sopenharmony_ci	TEST_IT("itete	le","movle r0,#0\n\t  movgt r1,#1\n\t  movle r2,#2\n\t  movgt r3,#3")
2938c2ecf20Sopenharmony_ci	TEST_IT("itttt	le","movle r0,#0\n\t  movle r1,#1\n\t  movle r2,#2\n\t  movle r3,#3")
2948c2ecf20Sopenharmony_ci	TEST_IT("iteee	le","movle r0,#0\n\t  movgt r1,#1\n\t  movgt r2,#2\n\t  movgt r3,#3")
2958c2ecf20Sopenharmony_ci)
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci	TEST_GROUP("Load and store multiple")
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci	TEST_P("ldmia	r",4, 16*4,"!, {r0,r7}")
3008c2ecf20Sopenharmony_ci	TEST_P("ldmia	r",7, 16*4,"!, {r0-r6}")
3018c2ecf20Sopenharmony_ci	TEST_P("stmia	r",4, 16*4,"!, {r0,r7}")
3028c2ecf20Sopenharmony_ci	TEST_P("stmia	r",0, 16*4,"!, {r0-r7}")
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci	TEST_GROUP("Conditional branch and Supervisor Call instructions")
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ciCONDITION_INSTRUCTIONS(8,
3078c2ecf20Sopenharmony_ci	TEST_BF("beq	2f")
3088c2ecf20Sopenharmony_ci	TEST_BB("bne	2b")
3098c2ecf20Sopenharmony_ci	TEST_BF("bgt	2f")
3108c2ecf20Sopenharmony_ci	TEST_BB("blt	2b")
3118c2ecf20Sopenharmony_ci)
3128c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xde00) "")
3138c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb16(0xdeff) "")
3148c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("svc	#0x00")
3158c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("svc	#0xff")
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci	TEST_GROUP("Unconditional branch")
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci	TEST_BF(  "b	2f")
3208c2ecf20Sopenharmony_ci	TEST_BB(  "b	2b")
3218c2ecf20Sopenharmony_ci	TEST_BF_X("b	2f", SPACE_0x400)
3228c2ecf20Sopenharmony_ci	TEST_BB_X("b	2b", SPACE_0x400)
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci	TEST_GROUP("Testing instructions in IT blocks")
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci	TEST_ITBLOCK("subs.n r0, r0")
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci	verbose("\n");
3298c2ecf20Sopenharmony_ci}
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_civoid kprobe_thumb32_test_cases(void)
3338c2ecf20Sopenharmony_ci{
3348c2ecf20Sopenharmony_ci	kprobe_test_flags = 0;
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci	TEST_GROUP("Load/store multiple")
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("rfedb	sp")
3398c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("rfeia	sp")
3408c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("rfedb	sp!")
3418c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("rfeia	sp!")
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci	TEST_P(   "stmia	r",0, 16*4,", {r0,r8}")
3448c2ecf20Sopenharmony_ci	TEST_P(   "stmia	r",4, 16*4,", {r0-r12,r14}")
3458c2ecf20Sopenharmony_ci	TEST_P(   "stmia	r",7, 16*4,"!, {r8-r12,r14}")
3468c2ecf20Sopenharmony_ci	TEST_P(   "stmia	r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci	TEST_P(   "ldmia	r",0, 16*4,", {r0,r8}")
3498c2ecf20Sopenharmony_ci	TEST_P(   "ldmia	r",4, 0,   ", {r0-r12,r14}")
3508c2ecf20Sopenharmony_ci	TEST_BF_P("ldmia	r",5, 8*4, "!, {r6-r12,r15}")
3518c2ecf20Sopenharmony_ci	TEST_P(   "ldmia	r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
3528c2ecf20Sopenharmony_ci	TEST_BF_P("ldmia	r",14,14*4,"!, {r4,pc}")
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",0, 16*4,", {r0,r8}")
3558c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",4, 16*4,", {r0-r12,r14}")
3568c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",5, 16*4,"!, {r8-r12,r14}")
3578c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci	TEST_P(   "ldmdb	r",0, 16*4,", {r0,r8}")
3608c2ecf20Sopenharmony_ci	TEST_P(   "ldmdb	r",4, 16*4,", {r0-r12,r14}")
3618c2ecf20Sopenharmony_ci	TEST_BF_P("ldmdb	r",5, 16*4,"!, {r6-r12,r15}")
3628c2ecf20Sopenharmony_ci	TEST_P(   "ldmdb	r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
3638c2ecf20Sopenharmony_ci	TEST_BF_P("ldmdb	r",14,16*4,"!, {r4,pc}")
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",13,16*4,"!, {r3-r12,lr}")
3668c2ecf20Sopenharmony_ci	TEST_P(	  "stmdb	r",13,16*4,"!, {r3-r12}")
3678c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",2, 16*4,", {r3-r12,lr}")
3688c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",13,16*4,"!, {r2-r12,lr}")
3698c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",0, 16*4,", {r0-r12}")
3708c2ecf20Sopenharmony_ci	TEST_P(   "stmdb	r",0, 16*4,", {r0-r12,lr}")
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_ci	TEST_BF_P("ldmia	r",13,5*4, "!, {r3-r12,pc}")
3738c2ecf20Sopenharmony_ci	TEST_P(	  "ldmia	r",13,5*4, "!, {r3-r12}")
3748c2ecf20Sopenharmony_ci	TEST_BF_P("ldmia	r",2, 5*4, "!, {r3-r12,pc}")
3758c2ecf20Sopenharmony_ci	TEST_BF_P("ldmia	r",13,4*4, "!, {r2-r12,pc}")
3768c2ecf20Sopenharmony_ci	TEST_P(   "ldmia	r",0, 16*4,", {r0-r12}")
3778c2ecf20Sopenharmony_ci	TEST_P(   "ldmia	r",0, 16*4,", {r0-r12,lr}")
3788c2ecf20Sopenharmony_ci
3798c2ecf20Sopenharmony_ci	TEST_THUMB_TO_ARM_INTERWORK_P("ldmia	r",0,14*4,", {r12,pc}")
3808c2ecf20Sopenharmony_ci	TEST_THUMB_TO_ARM_INTERWORK_P("ldmia	r",13,2*4,", {r0-r12,pc}")
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe88f0101) "	@ stmia	pc, {r0,r8}")
3838c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe92f5f00) "	@ stmdb	pc!, {r8-r12,r14}")
3848c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8bdc000) "	@ ldmia	r13!, {r14,pc}")
3858c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe93ec000) "	@ ldmdb	r14!, {r14,pc}")
3868c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8a73f00) "	@ stmia	r7!, {r8-r12,sp}")
3878c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8a79f00) "	@ stmia	r7!, {r8-r12,pc}")
3888c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe93e2010) "	@ ldmdb	r14!, {r4,sp}")
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci	TEST_GROUP("Load/store double or exclusive, table branch")
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci	TEST_P(  "ldrd	r0, r1, [r",1, 24,", #-16]")
3938c2ecf20Sopenharmony_ci	TEST(    "ldrd	r12, r14, [sp, #16]")
3948c2ecf20Sopenharmony_ci	TEST_P(  "ldrd	r1, r0, [r",7, 24,", #-16]!")
3958c2ecf20Sopenharmony_ci	TEST(    "ldrd	r14, r12, [sp, #16]!")
3968c2ecf20Sopenharmony_ci	TEST_P(  "ldrd	r1, r0, [r",7, 24,"], #16")
3978c2ecf20Sopenharmony_ci	TEST(    "ldrd	r7, r8, [sp], #-16")
3988c2ecf20Sopenharmony_ci
3998c2ecf20Sopenharmony_ci	TEST_X( "ldrd	r12, r14, 3f",
4008c2ecf20Sopenharmony_ci		".align 3				\n\t"
4018c2ecf20Sopenharmony_ci		"3:	.word	"__stringify(VAL1)"	\n\t"
4028c2ecf20Sopenharmony_ci		"	.word	"__stringify(VAL2))
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9ffec04) "	@ ldrd	r14, r12, [pc, #16]!")
4058c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8ffec04) "	@ ldrd	r14, r12, [pc], #16")
4068c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9d4d800) "	@ ldrd	sp, r8, [r4]")
4078c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9d4f800) "	@ ldrd	pc, r8, [r4]")
4088c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9d47d00) "	@ ldrd	r7, sp, [r4]")
4098c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9d47f00) "	@ ldrd	r7, pc, [r4]")
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_ci	TEST_RRP("strd	r",0, VAL1,", r",1, VAL2,", [r",1, 24,", #-16]")
4128c2ecf20Sopenharmony_ci	TEST_RR( "strd	r",12,VAL2,", r",14,VAL1,", [sp, #16]")
4138c2ecf20Sopenharmony_ci	TEST_RRP("strd	r",1, VAL1,", r",0, VAL2,", [r",7, 24,", #-16]!")
4148c2ecf20Sopenharmony_ci	TEST_RR( "strd	r",14,VAL2,", r",12,VAL1,", [sp, #16]!")
4158c2ecf20Sopenharmony_ci	TEST_RRP("strd	r",1, VAL1,", r",0, VAL2,", [r",7, 24,"], #16")
4168c2ecf20Sopenharmony_ci	TEST_RR( "strd	r",7, VAL2,", r",8, VAL1,", [sp], #-16")
4178c2ecf20Sopenharmony_ci	TEST_RRP("strd	r",6, VAL1,", r",7, VAL2,", [r",13, TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"]!")
4188c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("strd r6, r7, [r13, #-"__stringify(MAX_STACK_SIZE)"-8]!")
4198c2ecf20Sopenharmony_ci	TEST_RRP("strd	r",4, VAL1,", r",5, VAL2,", [r",14, TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"-8]!")
4208c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe9efec04) "	@ strd	r14, r12, [pc, #16]!")
4218c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8efec04) "	@ strd	r14, r12, [pc], #16")
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci	TEST_RX("tbb	[pc, r",0, (9f-(1f+4)),"]",
4248c2ecf20Sopenharmony_ci		"9:			\n\t"
4258c2ecf20Sopenharmony_ci		".byte	(2f-1b-4)>>1	\n\t"
4268c2ecf20Sopenharmony_ci		".byte	(3f-1b-4)>>1	\n\t"
4278c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4288c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4298c2ecf20Sopenharmony_ci
4308c2ecf20Sopenharmony_ci	TEST_RX("tbb	[pc, r",4, (9f-(1f+4)+1),"]",
4318c2ecf20Sopenharmony_ci		"9:			\n\t"
4328c2ecf20Sopenharmony_ci		".byte	(2f-1b-4)>>1	\n\t"
4338c2ecf20Sopenharmony_ci		".byte	(3f-1b-4)>>1	\n\t"
4348c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4358c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci	TEST_RRX("tbb	[r",1,9f,", r",2,0,"]",
4388c2ecf20Sopenharmony_ci		"9:			\n\t"
4398c2ecf20Sopenharmony_ci		".byte	(2f-1b-4)>>1	\n\t"
4408c2ecf20Sopenharmony_ci		".byte	(3f-1b-4)>>1	\n\t"
4418c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4428c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci	TEST_RX("tbh	[pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
4458c2ecf20Sopenharmony_ci		"9:			\n\t"
4468c2ecf20Sopenharmony_ci		".short	(2f-1b-4)>>1	\n\t"
4478c2ecf20Sopenharmony_ci		".short	(3f-1b-4)>>1	\n\t"
4488c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4498c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ci	TEST_RX("tbh	[pc, r",12, ((9f-(1f+4))>>1)+1,", lsl #1]",
4528c2ecf20Sopenharmony_ci		"9:			\n\t"
4538c2ecf20Sopenharmony_ci		".short	(2f-1b-4)>>1	\n\t"
4548c2ecf20Sopenharmony_ci		".short	(3f-1b-4)>>1	\n\t"
4558c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4568c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ci	TEST_RRX("tbh	[r",1,9f, ", r",14,1,", lsl #1]",
4598c2ecf20Sopenharmony_ci		"9:			\n\t"
4608c2ecf20Sopenharmony_ci		".short	(2f-1b-4)>>1	\n\t"
4618c2ecf20Sopenharmony_ci		".short	(3f-1b-4)>>1	\n\t"
4628c2ecf20Sopenharmony_ci		"3:	mvn	r0, r0	\n\t"
4638c2ecf20Sopenharmony_ci		"2:	nop		\n\t")
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8d1f01f) "	@ tbh [r1, pc]")
4668c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8d1f01d) "	@ tbh [r1, sp]")
4678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xe8ddf012) "	@ tbh [sp, r2]")
4688c2ecf20Sopenharmony_ci
4698c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("strexb	r0, r1, [r2]")
4708c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("strexh	r0, r1, [r2]")
4718c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("strexd	r0, r1, r2, [r2]")
4728c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("ldrexb	r0, [r1]")
4738c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("ldrexh	r0, [r1]")
4748c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("ldrexd	r0, r1, [r1]")
4758c2ecf20Sopenharmony_ci
4768c2ecf20Sopenharmony_ci	TEST_GROUP("Data-processing (shifted register) and (modified immediate)")
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ci#define _DATA_PROCESSING32_DNM(op,s,val)					\
4798c2ecf20Sopenharmony_ci	TEST_RR(op s".w	r0,  r",1, VAL1,", r",2, val, "")			\
4808c2ecf20Sopenharmony_ci	TEST_RR(op s"	r1,  r",1, VAL1,", r",2, val, ", lsl #3")		\
4818c2ecf20Sopenharmony_ci	TEST_RR(op s"	r2,  r",3, VAL1,", r",2, val, ", lsr #4")		\
4828c2ecf20Sopenharmony_ci	TEST_RR(op s"	r3,  r",3, VAL1,", r",2, val, ", asr #5")		\
4838c2ecf20Sopenharmony_ci	TEST_RR(op s"	r4,  r",5, VAL1,", r",2, N(val),", asr #6")		\
4848c2ecf20Sopenharmony_ci	TEST_RR(op s"	r5,  r",5, VAL1,", r",2, val, ", ror #7")		\
4858c2ecf20Sopenharmony_ci	TEST_RR(op s"	r8,  r",9, VAL1,", r",10,val, ", rrx")			\
4868c2ecf20Sopenharmony_ci	TEST_R( op s"	r0,  r",11,VAL1,", #0x00010001")			\
4878c2ecf20Sopenharmony_ci	TEST_R( op s"	r11, r",0, VAL1,", #0xf5000000")			\
4888c2ecf20Sopenharmony_ci	TEST_R( op s"	r7,  r",8, VAL2,", #0x000af000")
4898c2ecf20Sopenharmony_ci
4908c2ecf20Sopenharmony_ci#define DATA_PROCESSING32_DNM(op,val)		\
4918c2ecf20Sopenharmony_ci	_DATA_PROCESSING32_DNM(op,"",val)	\
4928c2ecf20Sopenharmony_ci	_DATA_PROCESSING32_DNM(op,"s",val)
4938c2ecf20Sopenharmony_ci
4948c2ecf20Sopenharmony_ci#define DATA_PROCESSING32_NM(op,val)					\
4958c2ecf20Sopenharmony_ci	TEST_RR(op".w	r",1, VAL1,", r",2, val, "")			\
4968c2ecf20Sopenharmony_ci	TEST_RR(op"	r",1, VAL1,", r",2, val, ", lsl #3")		\
4978c2ecf20Sopenharmony_ci	TEST_RR(op"	r",3, VAL1,", r",2, val, ", lsr #4")		\
4988c2ecf20Sopenharmony_ci	TEST_RR(op"	r",3, VAL1,", r",2, val, ", asr #5")		\
4998c2ecf20Sopenharmony_ci	TEST_RR(op"	r",5, VAL1,", r",2, N(val),", asr #6")		\
5008c2ecf20Sopenharmony_ci	TEST_RR(op"	r",5, VAL1,", r",2, val, ", ror #7")		\
5018c2ecf20Sopenharmony_ci	TEST_RR(op"	r",9, VAL1,", r",10,val, ", rrx")		\
5028c2ecf20Sopenharmony_ci	TEST_R( op"	r",11,VAL1,", #0x00010001")			\
5038c2ecf20Sopenharmony_ci	TEST_R( op"	r",0, VAL1,", #0xf5000000")			\
5048c2ecf20Sopenharmony_ci	TEST_R( op"	r",8, VAL2,", #0x000af000")
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci#define _DATA_PROCESSING32_DM(op,s,val)				\
5078c2ecf20Sopenharmony_ci	TEST_R( op s".w	r0,  r",14, val, "")			\
5088c2ecf20Sopenharmony_ci	TEST_R( op s"	r1,  r",12, val, ", lsl #3")		\
5098c2ecf20Sopenharmony_ci	TEST_R( op s"	r2,  r",11, val, ", lsr #4")		\
5108c2ecf20Sopenharmony_ci	TEST_R( op s"	r3,  r",10, val, ", asr #5")		\
5118c2ecf20Sopenharmony_ci	TEST_R( op s"	r4,  r",9, N(val),", asr #6")		\
5128c2ecf20Sopenharmony_ci	TEST_R( op s"	r5,  r",8, val, ", ror #7")		\
5138c2ecf20Sopenharmony_ci	TEST_R( op s"	r8,  r",7,val, ", rrx")			\
5148c2ecf20Sopenharmony_ci	TEST(   op s"	r0,  #0x00010001")			\
5158c2ecf20Sopenharmony_ci	TEST(   op s"	r11, #0xf5000000")			\
5168c2ecf20Sopenharmony_ci	TEST(   op s"	r7,  #0x000af000")			\
5178c2ecf20Sopenharmony_ci	TEST(   op s"	r4,  #0x00005a00")
5188c2ecf20Sopenharmony_ci
5198c2ecf20Sopenharmony_ci#define DATA_PROCESSING32_DM(op,val)		\
5208c2ecf20Sopenharmony_ci	_DATA_PROCESSING32_DM(op,"",val)	\
5218c2ecf20Sopenharmony_ci	_DATA_PROCESSING32_DM(op,"s",val)
5228c2ecf20Sopenharmony_ci
5238c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("and",0xf00f00ff)
5248c2ecf20Sopenharmony_ci	DATA_PROCESSING32_NM("tst",0xf00f00ff)
5258c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("bic",0xf00f00ff)
5268c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("orr",0xf00f00ff)
5278c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DM("mov",VAL2)
5288c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("orn",0xf00f00ff)
5298c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DM("mvn",VAL2)
5308c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("eor",0xf00f00ff)
5318c2ecf20Sopenharmony_ci	DATA_PROCESSING32_NM("teq",0xf00f00ff)
5328c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("add",VAL2)
5338c2ecf20Sopenharmony_ci	DATA_PROCESSING32_NM("cmn",VAL2)
5348c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("adc",VAL2)
5358c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("sbc",VAL2)
5368c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("sub",VAL2)
5378c2ecf20Sopenharmony_ci	DATA_PROCESSING32_NM("cmp",VAL2)
5388c2ecf20Sopenharmony_ci	DATA_PROCESSING32_DNM("rsb",VAL2)
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci	TEST_RR("pkhbt	r0, r",0,  HH1,", r",1, HH2,"")
5418c2ecf20Sopenharmony_ci	TEST_RR("pkhbt	r14,r",12, HH1,", r",10,HH2,", lsl #2")
5428c2ecf20Sopenharmony_ci	TEST_RR("pkhtb	r0, r",0,  HH1,", r",1, HH2,"")
5438c2ecf20Sopenharmony_ci	TEST_RR("pkhtb	r14,r",12, HH1,", r",10,HH2,", asr #2")
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea170f0d) "	@ tst.w r7, sp")
5468c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea170f0f) "	@ tst.w r7, pc")
5478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea1d0f07) "	@ tst.w sp, r7")
5488c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea1f0f07) "	@ tst.w pc, r7")
5498c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf01d1f08) "	@ tst sp, #0x00080008")
5508c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf01f1f08) "	@ tst pc, #0x00080008")
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea970f0d) "	@ teq.w r7, sp")
5538c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea970f0f) "	@ teq.w r7, pc")
5548c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea9d0f07) "	@ teq.w sp, r7")
5558c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea9f0f07) "	@ teq.w pc, r7")
5568c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf09d1f08) "	@ tst sp, #0x00080008")
5578c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf09f1f08) "	@ tst pc, #0x00080008")
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb170f0d) "	@ cmn.w r7, sp")
5608c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb170f0f) "	@ cmn.w r7, pc")
5618c2ecf20Sopenharmony_ci	TEST_P("cmn.w	sp, r",7,0,"")
5628c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb1f0f07) "	@ cmn.w pc, r7")
5638c2ecf20Sopenharmony_ci	TEST(  "cmn	sp, #0x00080008")
5648c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf11f1f08) "	@ cmn pc, #0x00080008")
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebb70f0d) "	@ cmp.w r7, sp")
5678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebb70f0f) "	@ cmp.w r7, pc")
5688c2ecf20Sopenharmony_ci	TEST_P("cmp.w	sp, r",7,0,"")
5698c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebbf0f07) "	@ cmp.w pc, r7")
5708c2ecf20Sopenharmony_ci	TEST(  "cmp	sp, #0x00080008")
5718c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1bf1f08) "	@ cmp pc, #0x00080008")
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea5f070d) "	@ movs.w r7, sp")
5748c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea5f070f) "	@ movs.w r7, pc")
5758c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea5f0d07) "	@ movs.w sp, r7")
5768c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea4f0f07) "	@ mov.w  pc, r7")
5778c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf04f1d08) "	@ mov sp, #0x00080008")
5788c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf04f1f08) "	@ mov pc, #0x00080008")
5798c2ecf20Sopenharmony_ci
5808c2ecf20Sopenharmony_ci	TEST_R("add.w	r0, sp, r",1, 4,"")
5818c2ecf20Sopenharmony_ci	TEST_R("adds	r0, sp, r",1, 4,", asl #3")
5828c2ecf20Sopenharmony_ci	TEST_R("add	r0, sp, r",1, 4,", asl #4")
5838c2ecf20Sopenharmony_ci	TEST_R("add	r0, sp, r",1, 16,", ror #1")
5848c2ecf20Sopenharmony_ci	TEST_R("add.w	sp, sp, r",1, 4,"")
5858c2ecf20Sopenharmony_ci	TEST_R("add	sp, sp, r",1, 4,", asl #3")
5868c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d1d01) "	@ add sp, sp, r1, asl #4")
5878c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d71) "	@ add sp, sp, r1, ror #1")
5888c2ecf20Sopenharmony_ci	TEST(  "add.w	r0, sp, #24")
5898c2ecf20Sopenharmony_ci	TEST(  "add.w	sp, sp, #24")
5908c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0f01) "	@ add pc, sp, r1")
5918c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d000f) "	@ add r0, sp, pc")
5928c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d000d) "	@ add r0, sp, sp")
5938c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d0f) "	@ add sp, sp, pc")
5948c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d0d) "	@ add sp, sp, sp")
5958c2ecf20Sopenharmony_ci
5968c2ecf20Sopenharmony_ci	TEST_R("sub.w	r0, sp, r",1, 4,"")
5978c2ecf20Sopenharmony_ci	TEST_R("subs	r0, sp, r",1, 4,", asl #3")
5988c2ecf20Sopenharmony_ci	TEST_R("sub	r0, sp, r",1, 4,", asl #4")
5998c2ecf20Sopenharmony_ci	TEST_R("sub	r0, sp, r",1, 16,", ror #1")
6008c2ecf20Sopenharmony_ci	TEST_R("sub.w	sp, sp, r",1, 4,"")
6018c2ecf20Sopenharmony_ci	TEST_R("sub	sp, sp, r",1, 4,", asl #3")
6028c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebad1d01) "	@ sub sp, sp, r1, asl #4")
6038c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebad0d71) "	@ sub sp, sp, r1, ror #1")
6048c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebad0f01) "	@ sub pc, sp, r1")
6058c2ecf20Sopenharmony_ci	TEST(  "sub.w	r0, sp, #24")
6068c2ecf20Sopenharmony_ci	TEST(  "sub.w	sp, sp, #24")
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea02010f) "	@ and r1, r2, pc")
6098c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea0f0103) "	@ and r1, pc, r3")
6108c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea020f03) "	@ and pc, r2, r3")
6118c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea02010d) "	@ and r1, r2, sp")
6128c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea0d0103) "	@ and r1, sp, r3")
6138c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xea020d03) "	@ and sp, r2, r3")
6148c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf00d1108) "	@ and r1, sp, #0x00080008")
6158c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf00f1108) "	@ and r1, pc, #0x00080008")
6168c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf0021d08) "	@ and sp, r8, #0x00080008")
6178c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf0021f08) "	@ and pc, r8, #0x00080008")
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb02010f) "	@ add r1, r2, pc")
6208c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb0f0103) "	@ add r1, pc, r3")
6218c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb020f03) "	@ add pc, r2, r3")
6228c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb02010d) "	@ add r1, r2, sp")
6238c2ecf20Sopenharmony_ci	TEST_SUPPORTED(  __inst_thumb32(0xeb0d0103) "	@ add r1, sp, r3")
6248c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb020d03) "	@ add sp, r2, r3")
6258c2ecf20Sopenharmony_ci	TEST_SUPPORTED(  __inst_thumb32(0xf10d1108) "	@ add r1, sp, #0x00080008")
6268c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf10d1f08) "	@ add pc, sp, #0x00080008")
6278c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf10f1108) "	@ add r1, pc, #0x00080008")
6288c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1021d08) "	@ add sp, r8, #0x00080008")
6298c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1021f08) "	@ add pc, r8, #0x00080008")
6308c2ecf20Sopenharmony_ci
6318c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeaa00000) "")
6328c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeaf00000) "")
6338c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb200000) "")
6348c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeb800000) "")
6358c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xebe00000) "")
6368c2ecf20Sopenharmony_ci
6378c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf0a00000) "")
6388c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf0c00000) "")
6398c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf0f00000) "")
6408c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1200000) "")
6418c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1800000) "")
6428c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf1e00000) "")
6438c2ecf20Sopenharmony_ci
6448c2ecf20Sopenharmony_ci	TEST_GROUP("Coprocessor instructions")
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xec000000) "")
6478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xeff00000) "")
6488c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfc000000) "")
6498c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfff00000) "")
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ci	TEST_GROUP("Data-processing (plain binary immediate)")
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_ci	TEST_R("addw	r0,  r",1, VAL1,", #0x123")
6548c2ecf20Sopenharmony_ci	TEST(  "addw	r14, sp, #0xf5a")
6558c2ecf20Sopenharmony_ci	TEST(  "addw	sp, sp, #0x20")
6568c2ecf20Sopenharmony_ci	TEST(  "addw	r7,  pc, #0x888")
6578c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf20f1f20) "	@ addw pc, pc, #0x120")
6588c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf20d1f20) "	@ addw pc, sp, #0x120")
6598c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf20f1d20) "	@ addw sp, pc, #0x120")
6608c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2001d20) "	@ addw sp, r0, #0x120")
6618c2ecf20Sopenharmony_ci
6628c2ecf20Sopenharmony_ci	TEST_R("subw	r0,  r",1, VAL1,", #0x123")
6638c2ecf20Sopenharmony_ci	TEST(  "subw	r14, sp, #0xf5a")
6648c2ecf20Sopenharmony_ci	TEST(  "subw	sp, sp, #0x20")
6658c2ecf20Sopenharmony_ci	TEST(  "subw	r7,  pc, #0x888")
6668c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2af1f20) "	@ subw pc, pc, #0x120")
6678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2ad1f20) "	@ subw pc, sp, #0x120")
6688c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2af1d20) "	@ subw sp, pc, #0x120")
6698c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2a01d20) "	@ subw sp, r0, #0x120")
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_ci	TEST("movw	r0, #0")
6728c2ecf20Sopenharmony_ci	TEST("movw	r0, #0xffff")
6738c2ecf20Sopenharmony_ci	TEST("movw	lr, #0xffff")
6748c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2400d00) "	@ movw sp, #0")
6758c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2400f00) "	@ movw pc, #0")
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_ci	TEST_R("movt	r",0, VAL1,", #0")
6788c2ecf20Sopenharmony_ci	TEST_R("movt	r",0, VAL2,", #0xffff")
6798c2ecf20Sopenharmony_ci	TEST_R("movt	r",14,VAL1,", #0xffff")
6808c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2c00d00) "	@ movt sp, #0")
6818c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf2c00f00) "	@ movt pc, #0")
6828c2ecf20Sopenharmony_ci
6838c2ecf20Sopenharmony_ci	TEST_R(     "ssat	r0, #24, r",0,   VAL1,"")
6848c2ecf20Sopenharmony_ci	TEST_R(     "ssat	r14, #24, r",12, VAL2,"")
6858c2ecf20Sopenharmony_ci	TEST_R(     "ssat	r0, #24, r",0,   VAL1,", lsl #8")
6868c2ecf20Sopenharmony_ci	TEST_R(     "ssat	r14, #24, r",12, VAL2,", asr #8")
6878c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf30c0d17) "	@ ssat	sp, #24, r12")
6888c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf30c0f17) "	@ ssat	pc, #24, r12")
6898c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf30d0c17) "	@ ssat	r12, #24, sp")
6908c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf30f0c17) "	@ ssat	r12, #24, pc")
6918c2ecf20Sopenharmony_ci
6928c2ecf20Sopenharmony_ci	TEST_R(     "usat	r0, #24, r",0,   VAL1,"")
6938c2ecf20Sopenharmony_ci	TEST_R(     "usat	r14, #24, r",12, VAL2,"")
6948c2ecf20Sopenharmony_ci	TEST_R(     "usat	r0, #24, r",0,   VAL1,", lsl #8")
6958c2ecf20Sopenharmony_ci	TEST_R(     "usat	r14, #24, r",12, VAL2,", asr #8")
6968c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf38c0d17) "	@ usat	sp, #24, r12")
6978c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf38c0f17) "	@ usat	pc, #24, r12")
6988c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf38d0c17) "	@ usat	r12, #24, sp")
6998c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf38f0c17) "	@ usat	r12, #24, pc")
7008c2ecf20Sopenharmony_ci
7018c2ecf20Sopenharmony_ci	TEST_R(     "ssat16	r0, #12, r",0,   HH1,"")
7028c2ecf20Sopenharmony_ci	TEST_R(     "ssat16	r14, #12, r",12, HH2,"")
7038c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf32c0d0b) "	@ ssat16	sp, #12, r12")
7048c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf32c0f0b) "	@ ssat16	pc, #12, r12")
7058c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf32d0c0b) "	@ ssat16	r12, #12, sp")
7068c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf32f0c0b) "	@ ssat16	r12, #12, pc")
7078c2ecf20Sopenharmony_ci
7088c2ecf20Sopenharmony_ci	TEST_R(     "usat16	r0, #12, r",0,   HH1,"")
7098c2ecf20Sopenharmony_ci	TEST_R(     "usat16	r14, #12, r",12, HH2,"")
7108c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3ac0d0b) "	@ usat16	sp, #12, r12")
7118c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3ac0f0b) "	@ usat16	pc, #12, r12")
7128c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3ad0c0b) "	@ usat16	r12, #12, sp")
7138c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3af0c0b) "	@ usat16	r12, #12, pc")
7148c2ecf20Sopenharmony_ci
7158c2ecf20Sopenharmony_ci	TEST_R(     "sbfx	r0, r",0  , VAL1,", #0, #31")
7168c2ecf20Sopenharmony_ci	TEST_R(     "sbfx	r14, r",12, VAL2,", #8, #16")
7178c2ecf20Sopenharmony_ci	TEST_R(     "sbfx	r4, r",10,  VAL1,", #16, #15")
7188c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf34c2d0f) "	@ sbfx	sp, r12, #8, #16")
7198c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf34c2f0f) "	@ sbfx	pc, r12, #8, #16")
7208c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf34d2c0f) "	@ sbfx	r12, sp, #8, #16")
7218c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf34f2c0f) "	@ sbfx	r12, pc, #8, #16")
7228c2ecf20Sopenharmony_ci
7238c2ecf20Sopenharmony_ci	TEST_R(     "ubfx	r0, r",0  , VAL1,", #0, #31")
7248c2ecf20Sopenharmony_ci	TEST_R(     "ubfx	r14, r",12, VAL2,", #8, #16")
7258c2ecf20Sopenharmony_ci	TEST_R(     "ubfx	r4, r",10,  VAL1,", #16, #15")
7268c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3cc2d0f) "	@ ubfx	sp, r12, #8, #16")
7278c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3cc2f0f) "	@ ubfx	pc, r12, #8, #16")
7288c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3cd2c0f) "	@ ubfx	r12, sp, #8, #16")
7298c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3cf2c0f) "	@ ubfx	r12, pc, #8, #16")
7308c2ecf20Sopenharmony_ci
7318c2ecf20Sopenharmony_ci	TEST_R(     "bfc	r",0, VAL1,", #4, #20")
7328c2ecf20Sopenharmony_ci	TEST_R(     "bfc	r",14,VAL2,", #4, #20")
7338c2ecf20Sopenharmony_ci	TEST_R(     "bfc	r",7, VAL1,", #0, #31")
7348c2ecf20Sopenharmony_ci	TEST_R(     "bfc	r",8, VAL2,", #0, #31")
7358c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf36f0d1e) "	@ bfc	sp, #0, #31")
7368c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf36f0f1e) "	@ bfc	pc, #0, #31")
7378c2ecf20Sopenharmony_ci
7388c2ecf20Sopenharmony_ci	TEST_RR(    "bfi	r",0, VAL1,", r",0  , VAL2,", #0, #31")
7398c2ecf20Sopenharmony_ci	TEST_RR(    "bfi	r",12,VAL1,", r",14 , VAL2,", #4, #20")
7408c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf36e1d17) "	@ bfi	sp, r14, #4, #20")
7418c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf36e1f17) "	@ bfi	pc, r14, #4, #20")
7428c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf36d1e17) "	@ bfi	r14, sp, #4, #20")
7438c2ecf20Sopenharmony_ci
7448c2ecf20Sopenharmony_ci	TEST_GROUP("Branches and miscellaneous control")
7458c2ecf20Sopenharmony_ci
7468c2ecf20Sopenharmony_ciCONDITION_INSTRUCTIONS(22,
7478c2ecf20Sopenharmony_ci	TEST_BF("beq.w	2f")
7488c2ecf20Sopenharmony_ci	TEST_BB("bne.w	2b")
7498c2ecf20Sopenharmony_ci	TEST_BF("bgt.w	2f")
7508c2ecf20Sopenharmony_ci	TEST_BB("blt.w	2b")
7518c2ecf20Sopenharmony_ci	TEST_BF_X("bpl.w	2f", SPACE_0x1000)
7528c2ecf20Sopenharmony_ci)
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("msr	cpsr, r0")
7558c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("msr	cpsr_f, r1")
7568c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("msr	spsr, r2")
7578c2ecf20Sopenharmony_ci
7588c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("cpsie.w	i")
7598c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("cpsid.w	i")
7608c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("cps	0x13")
7618c2ecf20Sopenharmony_ci
7628c2ecf20Sopenharmony_ci	TEST_SUPPORTED("yield.w")
7638c2ecf20Sopenharmony_ci	TEST("sev.w")
7648c2ecf20Sopenharmony_ci	TEST("nop.w")
7658c2ecf20Sopenharmony_ci	TEST("wfi.w")
7668c2ecf20Sopenharmony_ci	TEST_SUPPORTED("wfe.w")
7678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("dbg.w	#0")
7688c2ecf20Sopenharmony_ci
7698c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("clrex")
7708c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("dsb")
7718c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("dmb")
7728c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("isb")
7738c2ecf20Sopenharmony_ci
7748c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("bxj	r0")
7758c2ecf20Sopenharmony_ci
7768c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("subs	pc, lr, #4")
7778c2ecf20Sopenharmony_ci
7788c2ecf20Sopenharmony_ci	TEST_RMASKED("mrs	r",0,~PSR_IGNORE_BITS,", cpsr")
7798c2ecf20Sopenharmony_ci	TEST_RMASKED("mrs	r",14,~PSR_IGNORE_BITS,", cpsr")
7808c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3ef8d00) "	@ mrs	sp, spsr")
7818c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf3ef8f00) "	@ mrs	pc, spsr")
7828c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("mrs	r0, spsr")
7838c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("mrs	lr, spsr")
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf7f08000) " @ smc #0")
7868c2ecf20Sopenharmony_ci
7878c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf7f0a000) " @ undefeined")
7888c2ecf20Sopenharmony_ci
7898c2ecf20Sopenharmony_ci	TEST_BF(  "b.w	2f")
7908c2ecf20Sopenharmony_ci	TEST_BB(  "b.w	2b")
7918c2ecf20Sopenharmony_ci	TEST_BF_X("b.w	2f", SPACE_0x1000)
7928c2ecf20Sopenharmony_ci
7938c2ecf20Sopenharmony_ci	TEST_BF(  "bl.w	2f")
7948c2ecf20Sopenharmony_ci	TEST_BB(  "bl.w	2b")
7958c2ecf20Sopenharmony_ci	TEST_BB_X("bl.w	2b", SPACE_0x1000)
7968c2ecf20Sopenharmony_ci
7978c2ecf20Sopenharmony_ci	TEST_X(	"blx	__dummy_arm_subroutine",
7988c2ecf20Sopenharmony_ci		".arm				\n\t"
7998c2ecf20Sopenharmony_ci		".align				\n\t"
8008c2ecf20Sopenharmony_ci		".type __dummy_arm_subroutine, %%function \n\t"
8018c2ecf20Sopenharmony_ci		"__dummy_arm_subroutine:	\n\t"
8028c2ecf20Sopenharmony_ci		"mov	r0, pc			\n\t"
8038c2ecf20Sopenharmony_ci		"bx	lr			\n\t"
8048c2ecf20Sopenharmony_ci		".thumb				\n\t"
8058c2ecf20Sopenharmony_ci	)
8068c2ecf20Sopenharmony_ci	TEST(	"blx	__dummy_arm_subroutine")
8078c2ecf20Sopenharmony_ci
8088c2ecf20Sopenharmony_ci	TEST_GROUP("Store single data item")
8098c2ecf20Sopenharmony_ci
8108c2ecf20Sopenharmony_ci#define SINGLE_STORE(size)							\
8118c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,-1024,", #1024]")		\
8128c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, -1024,", #1080]")		\
8138c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,256,  ", #-120]")		\
8148c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, 256,  ", #-128]")		\
8158c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,24,  "], #120")		\
8168c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, 24,  "], #128")		\
8178c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,24,  "], #-120")		\
8188c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, 24,  "], #-128")		\
8198c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,24,   ", #120]!")		\
8208c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, 24,   ", #128]!")		\
8218c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",0, VAL1,", [r",11,256,  ", #-120]!")		\
8228c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",14,VAL2,", [r",1, 256,  ", #-128]!")		\
8238c2ecf20Sopenharmony_ci	TEST_RPR("str"size".w	r",0, VAL1,", [r",1, 0,", r",2, 4,"]")		\
8248c2ecf20Sopenharmony_ci	TEST_RPR("str"size"	r",14,VAL2,", [r",10,0,", r",11,4,", lsl #1]")	\
8258c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("str"size"	r0, [r13, r1]")				\
8268c2ecf20Sopenharmony_ci	TEST_R(  "str"size".w	r",7, VAL1,", [sp, #24]")			\
8278c2ecf20Sopenharmony_ci	TEST_RP( "str"size".w	r",0, VAL2,", [r",0,0, "]")			\
8288c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",6, VAL1,", [r",13, TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"]!") \
8298c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("str"size"	r6, [r13, #-"__stringify(MAX_STACK_SIZE)"-8]!")			\
8308c2ecf20Sopenharmony_ci	TEST_RP( "str"size"	r",4, VAL2,", [r",12, TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"-8]!") \
8318c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("str"size"t	r0, [r1, #4]")
8328c2ecf20Sopenharmony_ci
8338c2ecf20Sopenharmony_ci	SINGLE_STORE("b")
8348c2ecf20Sopenharmony_ci	SINGLE_STORE("h")
8358c2ecf20Sopenharmony_ci	SINGLE_STORE("")
8368c2ecf20Sopenharmony_ci
8378c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf801000d) "	@ strb	r0, [r1, r13]")
8388c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf821000d) "	@ strh	r0, [r1, r13]")
8398c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf841000d) "	@ str	r0, [r1, r13]")
8408c2ecf20Sopenharmony_ci
8418c2ecf20Sopenharmony_ci	TEST("str	sp, [sp]")
8428c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf8cfe000) "	@ str	r14, [pc]")
8438c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf8cef000) "	@ str	pc, [r14]")
8448c2ecf20Sopenharmony_ci
8458c2ecf20Sopenharmony_ci	TEST_GROUP("Advanced SIMD element or structure load/store instructions")
8468c2ecf20Sopenharmony_ci
8478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf9000000) "")
8488c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf92fffff) "")
8498c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf9800000) "")
8508c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf9efffff) "")
8518c2ecf20Sopenharmony_ci
8528c2ecf20Sopenharmony_ci	TEST_GROUP("Load single data item and memory hints")
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci#define SINGLE_LOAD(size)						\
8558c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,-1024, ", #1024]")		\
8568c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1, -1024,", #1080]")		\
8578c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,256,   ", #-120]")		\
8588c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1, 256,  ", #-128]")		\
8598c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,24,   "], #120")		\
8608c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1, 24,  "], #128")		\
8618c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,24,   "], #-120")		\
8628c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1,24,   "], #-128")		\
8638c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,24,    ", #120]!")		\
8648c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1, 24,   ", #128]!")		\
8658c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r0, [r",11,256,   ", #-120]!")		\
8668c2ecf20Sopenharmony_ci	TEST_P( "ldr"size"	r14, [r",1, 256,  ", #-128]!")		\
8678c2ecf20Sopenharmony_ci	TEST_PR("ldr"size".w	r0, [r",1, 0,", r",2, 4,"]")		\
8688c2ecf20Sopenharmony_ci	TEST_PR("ldr"size"	r14, [r",10,0,", r",11,4,", lsl #1]")	\
8698c2ecf20Sopenharmony_ci	TEST_X( "ldr"size".w	r0, 3f",				\
8708c2ecf20Sopenharmony_ci		".align 3				\n\t"		\
8718c2ecf20Sopenharmony_ci		"3:	.word	"__stringify(VAL1))			\
8728c2ecf20Sopenharmony_ci	TEST_X( "ldr"size".w	r14, 3f",				\
8738c2ecf20Sopenharmony_ci		".align 3				\n\t"		\
8748c2ecf20Sopenharmony_ci		"3:	.word	"__stringify(VAL2))			\
8758c2ecf20Sopenharmony_ci	TEST(   "ldr"size".w	r7, 3b")				\
8768c2ecf20Sopenharmony_ci	TEST(   "ldr"size".w	r7, [sp, #24]")				\
8778c2ecf20Sopenharmony_ci	TEST_P( "ldr"size".w	r0, [r",0,0, "]")			\
8788c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED("ldr"size"t	r0, [r1, #4]")
8798c2ecf20Sopenharmony_ci
8808c2ecf20Sopenharmony_ci	SINGLE_LOAD("b")
8818c2ecf20Sopenharmony_ci	SINGLE_LOAD("sb")
8828c2ecf20Sopenharmony_ci	SINGLE_LOAD("h")
8838c2ecf20Sopenharmony_ci	SINGLE_LOAD("sh")
8848c2ecf20Sopenharmony_ci	SINGLE_LOAD("")
8858c2ecf20Sopenharmony_ci
8868c2ecf20Sopenharmony_ci	TEST_BF_P("ldr	pc, [r",14, 15*4,"]")
8878c2ecf20Sopenharmony_ci	TEST_P(   "ldr	sp, [r",14, 13*4,"]")
8888c2ecf20Sopenharmony_ci	TEST_BF_R("ldr	pc, [sp, r",14, 15*4,"]")
8898c2ecf20Sopenharmony_ci	TEST_R(   "ldr	sp, [sp, r",14, 13*4,"]")
8908c2ecf20Sopenharmony_ci	TEST_THUMB_TO_ARM_INTERWORK_P("ldr	pc, [r",0,0,", #15*4]")
8918c2ecf20Sopenharmony_ci	TEST_SUPPORTED("ldr	sp, 99f")
8928c2ecf20Sopenharmony_ci	TEST_SUPPORTED("ldr	pc, 99f")
8938c2ecf20Sopenharmony_ci
8948c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf854700d) "	@ ldr	r7, [r4, sp]")
8958c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf854700f) "	@ ldr	r7, [r4, pc]")
8968c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf814700d) "	@ ldrb	r7, [r4, sp]")
8978c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf814700f) "	@ ldrb	r7, [r4, pc]")
8988c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf89fd004) "	@ ldrb	sp, 99f")
8998c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf814d008) "	@ ldrb	sp, [r4, r8]")
9008c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf894d000) "	@ ldrb	sp, [r4]")
9018c2ecf20Sopenharmony_ci
9028c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf8600000) "") /* Unallocated space */
9038c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf9ffffff) "") /* Unallocated space */
9048c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf9500000) "") /* Unallocated space */
9058c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf95fffff) "") /* Unallocated space */
9068c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf8000800) "") /* Unallocated space */
9078c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf97ffaff) "") /* Unallocated space */
9088c2ecf20Sopenharmony_ci
9098c2ecf20Sopenharmony_ci	TEST(   "pli	[pc, #4]")
9108c2ecf20Sopenharmony_ci	TEST(   "pli	[pc, #-4]")
9118c2ecf20Sopenharmony_ci	TEST(   "pld	[pc, #4]")
9128c2ecf20Sopenharmony_ci	TEST(   "pld	[pc, #-4]")
9138c2ecf20Sopenharmony_ci
9148c2ecf20Sopenharmony_ci	TEST_P( "pld	[r",0,-1024,", #1024]")
9158c2ecf20Sopenharmony_ci	TEST(   __inst_thumb32(0xf8b0f400) "	@ pldw	[r0, #1024]")
9168c2ecf20Sopenharmony_ci	TEST_P( "pli	[r",4, 0b,", #1024]")
9178c2ecf20Sopenharmony_ci	TEST_P( "pld	[r",7, 120,", #-120]")
9188c2ecf20Sopenharmony_ci	TEST(   __inst_thumb32(0xf837fc78) "	@ pldw	[r7, #-120]")
9198c2ecf20Sopenharmony_ci	TEST_P( "pli	[r",11,120,", #-120]")
9208c2ecf20Sopenharmony_ci	TEST(   "pld	[sp, #0]")
9218c2ecf20Sopenharmony_ci
9228c2ecf20Sopenharmony_ci	TEST_PR("pld	[r",7, 24, ", r",0, 16,"]")
9238c2ecf20Sopenharmony_ci	TEST_PR("pld	[r",8, 24, ", r",12,16,", lsl #3]")
9248c2ecf20Sopenharmony_ci	TEST_SUPPORTED(__inst_thumb32(0xf837f000) "	@ pldw	[r7, r0]")
9258c2ecf20Sopenharmony_ci	TEST_SUPPORTED(__inst_thumb32(0xf838f03c) "	@ pldw	[r8, r12, lsl #3]");
9268c2ecf20Sopenharmony_ci	TEST_RR("pli	[r",12,0b,", r",0, 16,"]")
9278c2ecf20Sopenharmony_ci	TEST_RR("pli	[r",0, 0b,", r",12,16,", lsl #3]")
9288c2ecf20Sopenharmony_ci	TEST_R( "pld	[sp, r",1, 16,"]")
9298c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf817f00d) "  @pld	[r7, sp]")
9308c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xf817f00f) "  @pld	[r7, pc]")
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci	TEST_GROUP("Data-processing (register)")
9338c2ecf20Sopenharmony_ci
9348c2ecf20Sopenharmony_ci#define SHIFTS32(op)					\
9358c2ecf20Sopenharmony_ci	TEST_RR(op"	r0,  r",1, VAL1,", r",2, 3, "")	\
9368c2ecf20Sopenharmony_ci	TEST_RR(op"	r14, r",12,VAL2,", r",11,10,"")
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ci	SHIFTS32("lsl")
9398c2ecf20Sopenharmony_ci	SHIFTS32("lsls")
9408c2ecf20Sopenharmony_ci	SHIFTS32("lsr")
9418c2ecf20Sopenharmony_ci	SHIFTS32("lsrs")
9428c2ecf20Sopenharmony_ci	SHIFTS32("asr")
9438c2ecf20Sopenharmony_ci	SHIFTS32("asrs")
9448c2ecf20Sopenharmony_ci	SHIFTS32("ror")
9458c2ecf20Sopenharmony_ci	SHIFTS32("rors")
9468c2ecf20Sopenharmony_ci
9478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa01ff02) "	@ lsl	pc, r1, r2")
9488c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa01fd02) "	@ lsl	sp, r1, r2")
9498c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff002) "	@ lsl	r0, pc, r2")
9508c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0df002) "	@ lsl	r0, sp, r2")
9518c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa01f00f) "	@ lsl	r0, r1, pc")
9528c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa01f00d) "	@ lsl	r0, r1, sp")
9538c2ecf20Sopenharmony_ci
9548c2ecf20Sopenharmony_ci	TEST_RR(    "sxtah	r0, r",0,  HH1,", r",1, HH2,"")
9558c2ecf20Sopenharmony_ci	TEST_RR(    "sxtah	r14,r",12, HH2,", r",10,HH1,", ror #8")
9568c2ecf20Sopenharmony_ci	TEST_R(     "sxth	r8, r",7,  HH1,"")
9578c2ecf20Sopenharmony_ci
9588c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0fff87) "	@ sxth	pc, r7");
9598c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0ffd87) "	@ sxth	sp, r7");
9608c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff88f) "	@ sxth	r8, pc");
9618c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff88d) "	@ sxth	r8, sp");
9628c2ecf20Sopenharmony_ci
9638c2ecf20Sopenharmony_ci	TEST_RR(    "uxtah	r0, r",0,  HH1,", r",1, HH2,"")
9648c2ecf20Sopenharmony_ci	TEST_RR(    "uxtah	r14,r",12, HH2,", r",10,HH1,", ror #8")
9658c2ecf20Sopenharmony_ci	TEST_R(     "uxth	r8, r",7,  HH1,"")
9668c2ecf20Sopenharmony_ci
9678c2ecf20Sopenharmony_ci	TEST_RR(    "sxtab16	r0, r",0,  HH1,", r",1, HH2,"")
9688c2ecf20Sopenharmony_ci	TEST_RR(    "sxtab16	r14,r",12, HH2,", r",10,HH1,", ror #8")
9698c2ecf20Sopenharmony_ci	TEST_R(     "sxtb16	r8, r",7,  HH1,"")
9708c2ecf20Sopenharmony_ci
9718c2ecf20Sopenharmony_ci	TEST_RR(    "uxtab16	r0, r",0,  HH1,", r",1, HH2,"")
9728c2ecf20Sopenharmony_ci	TEST_RR(    "uxtab16	r14,r",12, HH2,", r",10,HH1,", ror #8")
9738c2ecf20Sopenharmony_ci	TEST_R(     "uxtb16	r8, r",7,  HH1,"")
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_ci	TEST_RR(    "sxtab	r0, r",0,  HH1,", r",1, HH2,"")
9768c2ecf20Sopenharmony_ci	TEST_RR(    "sxtab	r14,r",12, HH2,", r",10,HH1,", ror #8")
9778c2ecf20Sopenharmony_ci	TEST_R(     "sxtb	r8, r",7,  HH1,"")
9788c2ecf20Sopenharmony_ci
9798c2ecf20Sopenharmony_ci	TEST_RR(    "uxtab	r0, r",0,  HH1,", r",1, HH2,"")
9808c2ecf20Sopenharmony_ci	TEST_RR(    "uxtab	r14,r",12, HH2,", r",10,HH1,", ror #8")
9818c2ecf20Sopenharmony_ci	TEST_R(     "uxtb	r8, r",7,  HH1,"")
9828c2ecf20Sopenharmony_ci
9838c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa6000f0) "")
9848c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa7fffff) "")
9858c2ecf20Sopenharmony_ci
9868c2ecf20Sopenharmony_ci#define PARALLEL_ADD_SUB(op)					\
9878c2ecf20Sopenharmony_ci	TEST_RR(  op"add16	r0, r",0,  HH1,", r",1, HH2,"")	\
9888c2ecf20Sopenharmony_ci	TEST_RR(  op"add16	r14, r",12,HH2,", r",10,HH1,"")	\
9898c2ecf20Sopenharmony_ci	TEST_RR(  op"asx	r0, r",0,  HH1,", r",1, HH2,"")	\
9908c2ecf20Sopenharmony_ci	TEST_RR(  op"asx	r14, r",12,HH2,", r",10,HH1,"")	\
9918c2ecf20Sopenharmony_ci	TEST_RR(  op"sax	r0, r",0,  HH1,", r",1, HH2,"")	\
9928c2ecf20Sopenharmony_ci	TEST_RR(  op"sax	r14, r",12,HH2,", r",10,HH1,"")	\
9938c2ecf20Sopenharmony_ci	TEST_RR(  op"sub16	r0, r",0,  HH1,", r",1, HH2,"")	\
9948c2ecf20Sopenharmony_ci	TEST_RR(  op"sub16	r14, r",12,HH2,", r",10,HH1,"")	\
9958c2ecf20Sopenharmony_ci	TEST_RR(  op"add8	r0, r",0,  HH1,", r",1, HH2,"")	\
9968c2ecf20Sopenharmony_ci	TEST_RR(  op"add8	r14, r",12,HH2,", r",10,HH1,"")	\
9978c2ecf20Sopenharmony_ci	TEST_RR(  op"sub8	r0, r",0,  HH1,", r",1, HH2,"")	\
9988c2ecf20Sopenharmony_ci	TEST_RR(  op"sub8	r14, r",12,HH2,", r",10,HH1,"")
9998c2ecf20Sopenharmony_ci
10008c2ecf20Sopenharmony_ci	TEST_GROUP("Parallel addition and subtraction, signed")
10018c2ecf20Sopenharmony_ci
10028c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("s")
10038c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("q")
10048c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("sh")
10058c2ecf20Sopenharmony_ci
10068c2ecf20Sopenharmony_ci	TEST_GROUP("Parallel addition and subtraction, unsigned")
10078c2ecf20Sopenharmony_ci
10088c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("u")
10098c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("uq")
10108c2ecf20Sopenharmony_ci	PARALLEL_ADD_SUB("uh")
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_ci	TEST_GROUP("Miscellaneous operations")
10138c2ecf20Sopenharmony_ci
10148c2ecf20Sopenharmony_ci	TEST_RR("qadd	r0, r",1, VAL1,", r",2, VAL2,"")
10158c2ecf20Sopenharmony_ci	TEST_RR("qadd	lr, r",9, VAL2,", r",8, VAL1,"")
10168c2ecf20Sopenharmony_ci	TEST_RR("qsub	r0, r",1, VAL1,", r",2, VAL2,"")
10178c2ecf20Sopenharmony_ci	TEST_RR("qsub	lr, r",9, VAL2,", r",8, VAL1,"")
10188c2ecf20Sopenharmony_ci	TEST_RR("qdadd	r0, r",1, VAL1,", r",2, VAL2,"")
10198c2ecf20Sopenharmony_ci	TEST_RR("qdadd	lr, r",9, VAL2,", r",8, VAL1,"")
10208c2ecf20Sopenharmony_ci	TEST_RR("qdsub	r0, r",1, VAL1,", r",2, VAL2,"")
10218c2ecf20Sopenharmony_ci	TEST_RR("qdsub	lr, r",9, VAL2,", r",8, VAL1,"")
10228c2ecf20Sopenharmony_ci
10238c2ecf20Sopenharmony_ci	TEST_R("rev.w	r0, r",0,   VAL1,"")
10248c2ecf20Sopenharmony_ci	TEST_R("rev	r14, r",12, VAL2,"")
10258c2ecf20Sopenharmony_ci	TEST_R("rev16.w	r0, r",0,   VAL1,"")
10268c2ecf20Sopenharmony_ci	TEST_R("rev16	r14, r",12, VAL2,"")
10278c2ecf20Sopenharmony_ci	TEST_R("rbit	r0, r",0,   VAL1,"")
10288c2ecf20Sopenharmony_ci	TEST_R("rbit	r14, r",12, VAL2,"")
10298c2ecf20Sopenharmony_ci	TEST_R("revsh.w	r0, r",0,   VAL1,"")
10308c2ecf20Sopenharmony_ci	TEST_R("revsh	r14, r",12, VAL2,"")
10318c2ecf20Sopenharmony_ci
10328c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa9cff8c) "	@ rev	pc, r12");
10338c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa9cfd8c) "	@ rev	sp, r12");
10348c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa9ffe8f) "	@ rev	r14, pc");
10358c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa9dfe8d) "	@ rev	r14, sp");
10368c2ecf20Sopenharmony_ci
10378c2ecf20Sopenharmony_ci	TEST_RR("sel	r0, r",0,  VAL1,", r",1, VAL2,"")
10388c2ecf20Sopenharmony_ci	TEST_RR("sel	r14, r",12,VAL1,", r",10, VAL2,"")
10398c2ecf20Sopenharmony_ci
10408c2ecf20Sopenharmony_ci	TEST_R("clz	r0, r",0, 0x0,"")
10418c2ecf20Sopenharmony_ci	TEST_R("clz	r7, r",14,0x1,"")
10428c2ecf20Sopenharmony_ci	TEST_R("clz	lr, r",7, 0xffffffff,"")
10438c2ecf20Sopenharmony_ci
10448c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfa80f030) "") /* Unallocated space */
10458c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfaffff7f) "") /* Unallocated space */
10468c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfab0f000) "") /* Unallocated space */
10478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfaffff7f) "") /* Unallocated space */
10488c2ecf20Sopenharmony_ci
10498c2ecf20Sopenharmony_ci	TEST_GROUP("Multiply, multiply accumulate, and absolute difference operations")
10508c2ecf20Sopenharmony_ci
10518c2ecf20Sopenharmony_ci	TEST_RR(    "mul	r0, r",1, VAL1,", r",2, VAL2,"")
10528c2ecf20Sopenharmony_ci	TEST_RR(    "mul	r7, r",8, VAL2,", r",9, VAL2,"")
10538c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08ff09) "	@ mul	pc, r8, r9")
10548c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08fd09) "	@ mul	sp, r8, r9")
10558c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb0ff709) "	@ mul	r7, pc, r9")
10568c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb0df709) "	@ mul	r7, sp, r9")
10578c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08f70f) "	@ mul	r7, r8, pc")
10588c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08f70d) "	@ mul	r7, r8, sp")
10598c2ecf20Sopenharmony_ci
10608c2ecf20Sopenharmony_ci	TEST_RRR(   "mla	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10618c2ecf20Sopenharmony_ci	TEST_RRR(   "mla	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10628c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08af09) "	@ mla	pc, r8, r9, r10");
10638c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08ad09) "	@ mla	sp, r8, r9, r10");
10648c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb0fa709) "	@ mla	r7, pc, r9, r10");
10658c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb0da709) "	@ mla	r7, sp, r9, r10");
10668c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08a70f) "	@ mla	r7, r8, pc, r10");
10678c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08a70d) "	@ mla	r7, r8, sp, r10");
10688c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb08d709) "	@ mla	r7, r8, r9, sp");
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_ci	TEST_RRR(   "mls	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10718c2ecf20Sopenharmony_ci	TEST_RRR(   "mls	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ci	TEST_RRR(   "smlabb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10748c2ecf20Sopenharmony_ci	TEST_RRR(   "smlabb	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10758c2ecf20Sopenharmony_ci	TEST_RRR(   "smlatb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10768c2ecf20Sopenharmony_ci	TEST_RRR(   "smlatb	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10778c2ecf20Sopenharmony_ci	TEST_RRR(   "smlabt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10788c2ecf20Sopenharmony_ci	TEST_RRR(   "smlabt	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10798c2ecf20Sopenharmony_ci	TEST_RRR(   "smlatt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
10808c2ecf20Sopenharmony_ci	TEST_RRR(   "smlatt	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
10818c2ecf20Sopenharmony_ci	TEST_RR(    "smulbb	r0, r",1, VAL1,", r",2, VAL2,"")
10828c2ecf20Sopenharmony_ci	TEST_RR(    "smulbb	r7, r",8, VAL3,", r",9, VAL1,"")
10838c2ecf20Sopenharmony_ci	TEST_RR(    "smultb	r0, r",1, VAL1,", r",2, VAL2,"")
10848c2ecf20Sopenharmony_ci	TEST_RR(    "smultb	r7, r",8, VAL3,", r",9, VAL1,"")
10858c2ecf20Sopenharmony_ci	TEST_RR(    "smulbt	r0, r",1, VAL1,", r",2, VAL2,"")
10868c2ecf20Sopenharmony_ci	TEST_RR(    "smulbt	r7, r",8, VAL3,", r",9, VAL1,"")
10878c2ecf20Sopenharmony_ci	TEST_RR(    "smultt	r0, r",1, VAL1,", r",2, VAL2,"")
10888c2ecf20Sopenharmony_ci	TEST_RR(    "smultt	r7, r",8, VAL3,", r",9, VAL1,"")
10898c2ecf20Sopenharmony_ci
10908c2ecf20Sopenharmony_ci	TEST_RRR(   "smlad	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
10918c2ecf20Sopenharmony_ci	TEST_RRR(   "smlad	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
10928c2ecf20Sopenharmony_ci	TEST_RRR(   "smladx	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
10938c2ecf20Sopenharmony_ci	TEST_RRR(   "smladx	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
10948c2ecf20Sopenharmony_ci	TEST_RR(    "smuad	r0, r",0,  HH1,", r",1, HH2,"")
10958c2ecf20Sopenharmony_ci	TEST_RR(    "smuad	r14, r",12,HH2,", r",10,HH1,"")
10968c2ecf20Sopenharmony_ci	TEST_RR(    "smuadx	r0, r",0,  HH1,", r",1, HH2,"")
10978c2ecf20Sopenharmony_ci	TEST_RR(    "smuadx	r14, r",12,HH2,", r",10,HH1,"")
10988c2ecf20Sopenharmony_ci
10998c2ecf20Sopenharmony_ci	TEST_RRR(   "smlawb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
11008c2ecf20Sopenharmony_ci	TEST_RRR(   "smlawb	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
11018c2ecf20Sopenharmony_ci	TEST_RRR(   "smlawt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
11028c2ecf20Sopenharmony_ci	TEST_RRR(   "smlawt	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
11038c2ecf20Sopenharmony_ci	TEST_RR(    "smulwb	r0, r",1, VAL1,", r",2, VAL2,"")
11048c2ecf20Sopenharmony_ci	TEST_RR(    "smulwb	r7, r",8, VAL3,", r",9, VAL1,"")
11058c2ecf20Sopenharmony_ci	TEST_RR(    "smulwt	r0, r",1, VAL1,", r",2, VAL2,"")
11068c2ecf20Sopenharmony_ci	TEST_RR(    "smulwt	r7, r",8, VAL3,", r",9, VAL1,"")
11078c2ecf20Sopenharmony_ci
11088c2ecf20Sopenharmony_ci	TEST_RRR(   "smlsd	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
11098c2ecf20Sopenharmony_ci	TEST_RRR(   "smlsd	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
11108c2ecf20Sopenharmony_ci	TEST_RRR(   "smlsdx	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
11118c2ecf20Sopenharmony_ci	TEST_RRR(   "smlsdx	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
11128c2ecf20Sopenharmony_ci	TEST_RR(    "smusd	r0, r",0,  HH1,", r",1, HH2,"")
11138c2ecf20Sopenharmony_ci	TEST_RR(    "smusd	r14, r",12,HH2,", r",10,HH1,"")
11148c2ecf20Sopenharmony_ci	TEST_RR(    "smusdx	r0, r",0,  HH1,", r",1, HH2,"")
11158c2ecf20Sopenharmony_ci	TEST_RR(    "smusdx	r14, r",12,HH2,", r",10,HH1,"")
11168c2ecf20Sopenharmony_ci
11178c2ecf20Sopenharmony_ci	TEST_RRR(   "smmla	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
11188c2ecf20Sopenharmony_ci	TEST_RRR(   "smmla	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
11198c2ecf20Sopenharmony_ci	TEST_RRR(   "smmlar	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
11208c2ecf20Sopenharmony_ci	TEST_RRR(   "smmlar	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
11218c2ecf20Sopenharmony_ci	TEST_RR(    "smmul	r0, r",0,  VAL1,", r",1, VAL2,"")
11228c2ecf20Sopenharmony_ci	TEST_RR(    "smmul	r14, r",12,VAL2,", r",10,VAL1,"")
11238c2ecf20Sopenharmony_ci	TEST_RR(    "smmulr	r0, r",0,  VAL1,", r",1, VAL2,"")
11248c2ecf20Sopenharmony_ci	TEST_RR(    "smmulr	r14, r",12,VAL2,", r",10,VAL1,"")
11258c2ecf20Sopenharmony_ci
11268c2ecf20Sopenharmony_ci	TEST_RRR(   "smmls	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
11278c2ecf20Sopenharmony_ci	TEST_RRR(   "smmls	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
11288c2ecf20Sopenharmony_ci	TEST_RRR(   "smmlsr	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
11298c2ecf20Sopenharmony_ci	TEST_RRR(   "smmlsr	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
11308c2ecf20Sopenharmony_ci
11318c2ecf20Sopenharmony_ci	TEST_RRR(   "usada8	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL3,"")
11328c2ecf20Sopenharmony_ci	TEST_RRR(   "usada8	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL3,"")
11338c2ecf20Sopenharmony_ci	TEST_RR(    "usad8	r0, r",0,  VAL1,", r",1, VAL2,"")
11348c2ecf20Sopenharmony_ci	TEST_RR(    "usad8	r14, r",12,VAL2,", r",10,VAL1,"")
11358c2ecf20Sopenharmony_ci
11368c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb00f010) "") /* Unallocated space */
11378c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb0fff1f) "") /* Unallocated space */
11388c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb70f010) "") /* Unallocated space */
11398c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb7fff1f) "") /* Unallocated space */
11408c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb700010) "") /* Unallocated space */
11418c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb7fff1f) "") /* Unallocated space */
11428c2ecf20Sopenharmony_ci
11438c2ecf20Sopenharmony_ci	TEST_GROUP("Long multiply, long multiply accumulate, and divide")
11448c2ecf20Sopenharmony_ci
11458c2ecf20Sopenharmony_ci	TEST_RR(   "smull	r0, r1, r",2, VAL1,", r",3, VAL2,"")
11468c2ecf20Sopenharmony_ci	TEST_RR(   "smull	r7, r8, r",9, VAL2,", r",10, VAL1,"")
11478c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb89f80a) "	@ smull	pc, r8, r9, r10");
11488c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb89d80a) "	@ smull	sp, r8, r9, r10");
11498c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb897f0a) "	@ smull	r7, pc, r9, r10");
11508c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb897d0a) "	@ smull	r7, sp, r9, r10");
11518c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb8f780a) "	@ smull	r7, r8, pc, r10");
11528c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb8d780a) "	@ smull	r7, r8, sp, r10");
11538c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb89780f) "	@ smull	r7, r8, r9, pc");
11548c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfb89780d) "	@ smull	r7, r8, r9, sp");
11558c2ecf20Sopenharmony_ci
11568c2ecf20Sopenharmony_ci	TEST_RR(   "umull	r0, r1, r",2, VAL1,", r",3, VAL2,"")
11578c2ecf20Sopenharmony_ci	TEST_RR(   "umull	r7, r8, r",9, VAL2,", r",10, VAL1,"")
11588c2ecf20Sopenharmony_ci
11598c2ecf20Sopenharmony_ci	TEST_RRRR( "smlal	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11608c2ecf20Sopenharmony_ci	TEST_RRRR( "smlal	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11618c2ecf20Sopenharmony_ci
11628c2ecf20Sopenharmony_ci	TEST_RRRR( "smlalbb	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11638c2ecf20Sopenharmony_ci	TEST_RRRR( "smlalbb	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11648c2ecf20Sopenharmony_ci	TEST_RRRR( "smlalbt	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11658c2ecf20Sopenharmony_ci	TEST_RRRR( "smlalbt	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11668c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaltb	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11678c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaltb	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11688c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaltt	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11698c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaltt	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_ci	TEST_RRRR( "smlald	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
11728c2ecf20Sopenharmony_ci	TEST_RRRR( "smlald	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
11738c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaldx	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
11748c2ecf20Sopenharmony_ci	TEST_RRRR( "smlaldx	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
11758c2ecf20Sopenharmony_ci
11768c2ecf20Sopenharmony_ci	TEST_RRRR( "smlsld	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
11778c2ecf20Sopenharmony_ci	TEST_RRRR( "smlsld	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
11788c2ecf20Sopenharmony_ci	TEST_RRRR( "smlsldx	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
11798c2ecf20Sopenharmony_ci	TEST_RRRR( "smlsldx	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
11808c2ecf20Sopenharmony_ci
11818c2ecf20Sopenharmony_ci	TEST_RRRR( "umlal	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11828c2ecf20Sopenharmony_ci	TEST_RRRR( "umlal	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11838c2ecf20Sopenharmony_ci	TEST_RRRR( "umaal	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
11848c2ecf20Sopenharmony_ci	TEST_RRRR( "umaal	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
11858c2ecf20Sopenharmony_ci
11868c2ecf20Sopenharmony_ci	TEST_GROUP("Coprocessor instructions")
11878c2ecf20Sopenharmony_ci
11888c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xfc000000) "")
11898c2ecf20Sopenharmony_ci	TEST_UNSUPPORTED(__inst_thumb32(0xffffffff) "")
11908c2ecf20Sopenharmony_ci
11918c2ecf20Sopenharmony_ci	TEST_GROUP("Testing instructions in IT blocks")
11928c2ecf20Sopenharmony_ci
11938c2ecf20Sopenharmony_ci	TEST_ITBLOCK("sub.w	r0, r0")
11948c2ecf20Sopenharmony_ci
11958c2ecf20Sopenharmony_ci	verbose("\n");
11968c2ecf20Sopenharmony_ci}
11978c2ecf20Sopenharmony_ci
1198