Go to the documentation of this file.
11 #include <linux/kernel.h>
12 #include <linux/module.h>
19 #define TEST_ARM_TO_THUMB_INTERWORK_R(code1, reg, val, code2) \
20 TESTCASE_START(code1 #reg code2) \
21 TEST_ARG_REG(reg, val) \
22 TEST_ARG_REG(14, 99f) \
25 "1: "code1 #reg code2" \n\t" \
28 "3: adr lr, 2f \n\t" \
34 #define TEST_ARM_TO_THUMB_INTERWORK_P(code1, reg, val, code2) \
35 TESTCASE_START(code1 #reg code2) \
36 TEST_ARG_PTR(reg, val) \
37 TEST_ARG_REG(14, 99f) \
38 TEST_ARG_MEM(15, 3f+1) \
41 "1: "code1 #reg code2" \n\t" \
44 "3: adr lr, 2f \n\t" \
55 TEST_GROUP(
"Data-processing (register), (register-shifted register), (immediate)")
57 #define _DATA_PROCESSING_DNM(op,s,val) \
58 TEST_RR( op "eq" s " r0, r",1, VAL1,", r",2, val, "") \
59 TEST_RR( op "ne" s " r1, r",1, VAL1,", r",2, val, ", lsl #3") \
60 TEST_RR( op "cs" s " r2, r",3, VAL1,", r",2, val, ", lsr #4") \
61 TEST_RR( op "cc" s " r3, r",3, VAL1,", r",2, val, ", asr #5") \
62 TEST_RR( op "mi" s " r4, r",5, VAL1,", r",2, N(val),", asr #6") \
63 TEST_RR( op "pl" s " r5, r",5, VAL1,", r",2, val, ", ror #7") \
64 TEST_RR( op "vs" s " r6, r",7, VAL1,", r",2, val, ", rrx") \
65 TEST_R( op "vc" s " r6, r",7, VAL1,", pc, lsl #3") \
66 TEST_R( op "vc" s " r6, r",7, VAL1,", sp, lsr #4") \
67 TEST_R( op "vc" s " r6, pc, r",7, VAL1,", asr #5") \
68 TEST_R( op "vc" s " r6, sp, r",7, VAL1,", ror #6") \
69 TEST_RRR( op "hi" s " r8, r",9, VAL1,", r",14,val, ", lsl r",0, 3,"")\
70 TEST_RRR( op "ls" s " r9, r",9, VAL1,", r",14,val, ", lsr r",7, 4,"")\
71 TEST_RRR( op "ge" s " r10, r",11,VAL1,", r",14,val, ", asr r",7, 5,"")\
72 TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\
73 TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\
74 TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\
75 TEST_RR( op s " r12, pc" ", r",14,val, ", ror r",14,7,"")\
76 TEST_RR( op s " r14, r",0, val, ", pc" ", lsl r",14,8,"")\
77 TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \
78 TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \
79 TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \
80 TEST( op s " r4, pc" ", #0x00005a00")
82 #define DATA_PROCESSING_DNM(op,val) \
83 _DATA_PROCESSING_DNM(op,"",val) \
84 _DATA_PROCESSING_DNM(op,"s",val)
86 #define DATA_PROCESSING_NM(op,val) \
87 TEST_RR( op "ne r",1, VAL1,", r",2, val, "") \
88 TEST_RR( op "eq r",1, VAL1,", r",2, val, ", lsl #3") \
89 TEST_RR( op "cc r",3, VAL1,", r",2, val, ", lsr #4") \
90 TEST_RR( op "cs r",3, VAL1,", r",2, val, ", asr #5") \
91 TEST_RR( op "pl r",5, VAL1,", r",2, N(val),", asr #6") \
92 TEST_RR( op "mi r",5, VAL1,", r",2, val, ", ror #7") \
93 TEST_RR( op "vc r",7, VAL1,", r",2, val, ", rrx") \
94 TEST_R ( op "vs r",7, VAL1,", pc, lsl #3") \
95 TEST_R ( op "vs r",7, VAL1,", sp, lsr #4") \
96 TEST_R( op "vs pc, r",7, VAL1,", asr #5") \
97 TEST_R( op "vs sp, r",7, VAL1,", ror #6") \
98 TEST_RRR( op "ls r",9, VAL1,", r",14,val, ", lsl r",0, 3,"") \
99 TEST_RRR( op "hi r",9, VAL1,", r",14,val, ", lsr r",7, 4,"") \
100 TEST_RRR( op "lt r",11,VAL1,", r",14,val, ", asr r",7, 5,"") \
101 TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \
102 TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \
103 TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \
104 TEST_RR( op " pc" ", r",14,val, ", ror r",14,7,"") \
105 TEST_RR( op " r",0, val, ", pc" ", lsl r",14,8,"") \
106 TEST_R( op "eq r",11,VAL1,", #0xf5") \
107 TEST_R( op "ne r",0, VAL1,", #0xf5000000") \
108 TEST_R( op " r",8, VAL2,", #0x000af000")
110 #define _DATA_PROCESSING_DM(op,s,val) \
111 TEST_R( op "eq" s " r0, r",1, val, "") \
112 TEST_R( op "ne" s " r1, r",1, val, ", lsl #3") \
113 TEST_R( op "cs" s " r2, r",3, val, ", lsr #4") \
114 TEST_R( op "cc" s " r3, r",3, val, ", asr #5") \
115 TEST_R( op "mi" s " r4, r",5, N(val),", asr #6") \
116 TEST_R( op "pl" s " r5, r",5, val, ", ror #7") \
117 TEST_R( op "vs" s " r6, r",10,val, ", rrx") \
118 TEST( op "vs" s " r7, pc, lsl #3") \
119 TEST( op "vs" s " r7, sp, lsr #4") \
120 TEST_RR( op "vc" s " r8, r",7, val, ", lsl r",0, 3,"") \
121 TEST_RR( op "hi" s " r9, r",9, val, ", lsr r",7, 4,"") \
122 TEST_RR( op "ls" s " r10, r",9, val, ", asr r",7, 5,"") \
123 TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \
124 TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \
125 TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \
126 TEST_R( op "le" s " r14, pc" ", lsl r",14,8,"") \
127 TEST( op "eq" s " r0, #0xf5") \
128 TEST( op "ne" s " r11, #0xf5000000") \
129 TEST( op s " r7, #0x000af000") \
130 TEST( op s " r4, #0x00005a00")
132 #define DATA_PROCESSING_DM(op,val) \
133 _DATA_PROCESSING_DM(op,"",val) \
134 _DATA_PROCESSING_DM(op,"s",val)
174 TEST(
"add sp, sp, #16")
175 TEST(
"sub sp, sp, #8")
176 TEST(
"bic sp, sp, #0x20")
177 TEST(
"orr sp, sp, #0x20")
178 TEST_PR(
"add sp, r",10,0,
", r",11,4,
"")
179 TEST_PRR(
"add sp, r",10,0,
", r",11,4,
", asl r",12,1,
"")
180 TEST_P(
"mov sp, r",10,0,
"")
181 TEST_PR(
"mov sp, r",10,0,
", asl r",12,0,
"")
184 TEST_BF(
"add pc, pc, #2f-1b-8")
189 TEST_BB(
"sub pc, pc, #1b-2b+8")
190 #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7)
191 TEST_BB(
"sub pc, pc, #1b-2b+8-2")
195 TEST_RR(
"add pc, pc, r",10,-2,
", asl r",11,1,
"")
196 #ifdef CONFIG_THUMB2_KERNEL
203 TEST(
"mrspl r7, cpsr")
204 TEST(
"mrs r14, cpsr")
217 TEST_R(
"clz r0, r",0, 0x0,
"")
218 TEST_R(
"clzeq r7, r",14,0x1,
"")
219 TEST_R(
"clz lr, r",7, 0xffffffff,
"")
224 #if __LINUX_ARM_ARCH__ >= 6
257 TEST_GROUP(
"Halfword multiply and multiply-accumulate")
259 TEST_RRR(
"smlabb r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
260 TEST_RRR(
"smlabbge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
263 TEST_RRR(
"smlatb r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
264 TEST_RRR(
"smlatbge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
267 TEST_RRR(
"smlabt r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
268 TEST_RRR(
"smlabtge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
271 TEST_RRR(
"smlatt r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
272 TEST_RRR(
"smlattge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
276 TEST_RRR(
"smlawb r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
277 TEST_RRR(
"smlawbge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
280 TEST_RRR(
"smlawt r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
281 TEST_RRR(
"smlawtge r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
297 TEST_RRRR(
"smlalbb r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
298 TEST_RRRR(
"smlalbble r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
299 TEST_RRR(
"smlalbb r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
302 TEST_RRRR(
"smlaltb r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
303 TEST_RRRR(
"smlaltble r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
304 TEST_RRR(
"smlaltb r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
307 TEST_RRRR(
"smlalbt r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
308 TEST_RRRR(
"smlalbtle r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
309 TEST_RRR(
"smlalbt r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
312 TEST_RRRR(
"smlaltt r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
313 TEST_RRRR(
"smlalttle r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
314 TEST_RRR(
"smlaltt r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
339 TEST_GROUP(
"Multiply and multiply-accumulate")
352 TEST_RRR(
"mla r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
353 TEST_RRR(
"mlahi r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
356 TEST_RRR(
"mlas r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
357 TEST_RRR(
"mlahis r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
361 #if __LINUX_ARM_ARCH__ >= 6
371 #if __LINUX_ARM_ARCH__ >= 7
372 TEST_RRR(
"mls r0, r",1,
VAL1,
", r",2,
VAL2,
", r",3,
VAL3,
"")
373 TEST_RRR(
"mlshi r7, r",8,
VAL3,
", r",9,
VAL1,
", r",10,
VAL2,
"")
395 TEST_RRRR(
"umlal r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
396 TEST_RRRR(
"umlalle r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
397 TEST_RRR(
"umlal r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
400 TEST_RRRR(
"umlals r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
401 TEST_RRRR(
"umlalles r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
402 TEST_RRR(
"umlals r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
417 TEST_RRRR(
"smlal r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
418 TEST_RRRR(
"smlalle r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
419 TEST_RRR(
"smlal r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
422 TEST_RRRR(
"smlals r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
", r",3,
VAL4)
423 TEST_RRRR(
"smlalles r",8,
VAL4,
", r",9,
VAL1,
", r",10,
VAL2,
", r",11,
VAL3)
424 TEST_RRR(
"smlals r",14,
VAL3,
", r",7,
VAL4,
", r",5,
VAL1,
", r13")
432 #if __LINUX_ARM_ARCH__ < 6
444 #if __LINUX_ARM_ARCH__ < 6
459 #if __LINUX_ARM_ARCH__ >= 6
462 #if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
472 TEST_RPR(
"strh r",0,
VAL1,
", [r",1, 48,
", -r",2, 24,
"]")
473 TEST_RPR(
"streqh r",14,
VAL2,
", [r",13,0,
", r",12, 48,
"]")
474 TEST_RPR(
"strh r",1,
VAL1,
", [r",2, 24,
", r",3, 48,
"]!")
475 TEST_RPR(
"strneh r",12,
VAL2,
", [r",11,48,
", -r",10,24,
"]!")
476 TEST_RPR(
"strh r",2,
VAL1,
", [r",3, 24,
"], r",4, 48,
"")
477 TEST_RPR(
"strh r",10,
VAL2,
", [r",9, 48,
"], -r",11,24,
"")
482 TEST_PR(
"ldrh r0, [r",0, 48,
", -r",2, 24,
"]")
483 TEST_PR(
"ldrcsh r14, [r",13,0,
", r",12, 48,
"]")
484 TEST_PR(
"ldrh r1, [r",2, 24,
", r",3, 48,
"]!")
485 TEST_PR(
"ldrcch r12, [r",11,48,
", -r",10,24,
"]!")
486 TEST_PR(
"ldrh r2, [r",3, 24,
"], r",4, 48,
"")
487 TEST_PR(
"ldrh r10, [r",9, 48,
"], -r",11,24,
"")
495 TEST_RP(
"strplh r",12,
VAL2,
", [r",11,24,
", #-4]!")
501 TEST_P(
"ldrh r0, [r",0, 24,
", #-2]")
502 TEST_P(
"ldrvsh r14, [r",13,0,
", #2]")
503 TEST_P(
"ldrh r1, [r",2, 24,
", #4]!")
504 TEST_P(
"ldrvch r12, [r",11,24,
", #-4]!")
505 TEST_P(
"ldrh r2, [r",3, 24,
"], #48")
506 TEST_P(
"ldrh r10, [r",9, 64,
"], #-48")
507 TEST(
"ldrh r0, [pc, #0]")
511 TEST_PR(
"ldrsb r0, [r",0, 48,
", -r",2, 24,
"]")
512 TEST_PR(
"ldrhisb r14, [r",13,0,
", r",12, 48,
"]")
513 TEST_PR(
"ldrsb r1, [r",2, 24,
", r",3, 48,
"]!")
514 TEST_PR(
"ldrlssb r12, [r",11,48,
", -r",10,24,
"]!")
515 TEST_PR(
"ldrsb r2, [r",3, 24,
"], r",4, 48,
"")
516 TEST_PR(
"ldrsb r10, [r",9, 48,
"], -r",11,24,
"")
520 TEST_P(
"ldrsb r0, [r",0, 24,
", #-1]")
521 TEST_P(
"ldrgesb r14, [r",13,0,
", #1]")
522 TEST_P(
"ldrsb r1, [r",2, 24,
", #4]!")
523 TEST_P(
"ldrltsb r12, [r",11,24,
", #-4]!")
524 TEST_P(
"ldrsb r2, [r",3, 24,
"], #48")
525 TEST_P(
"ldrsb r10, [r",9, 64,
"], #-48")
526 TEST(
"ldrsb r0, [pc, #0]")
530 TEST_PR(
"ldrsh r0, [r",0, 48,
", -r",2, 24,
"]")
531 TEST_PR(
"ldrgtsh r14, [r",13,0,
", r",12, 48,
"]")
532 TEST_PR(
"ldrsh r1, [r",2, 24,
", r",3, 48,
"]!")
533 TEST_PR(
"ldrlesh r12, [r",11,48,
", -r",10,24,
"]!")
534 TEST_PR(
"ldrsh r2, [r",3, 24,
"], r",4, 48,
"")
535 TEST_PR(
"ldrsh r10, [r",9, 48,
"], -r",11,24,
"")
539 TEST_P(
"ldrsh r0, [r",0, 24,
", #-1]")
540 TEST_P(
"ldreqsh r14, [r",13,0 ,
", #1]")
541 TEST_P(
"ldrsh r1, [r",2, 24,
", #4]!")
542 TEST_P(
"ldrnesh r12, [r",11,24,
", #-4]!")
543 TEST_P(
"ldrsh r2, [r",3, 24,
"], #48")
544 TEST_P(
"ldrsh r10, [r",9, 64,
"], #-48")
545 TEST(
"ldrsh r0, [pc, #0]")
549 #if __LINUX_ARM_ARCH__ >= 7
560 TEST_RPR(
"strd r",0,
VAL1,
", [r",1, 48,
", -r",2,24,
"]")
561 TEST_RPR(
"strccd r",8,
VAL2,
", [r",13,0,
", r",12,48,
"]")
562 TEST_RPR(
"strd r",4,
VAL1,
", [r",2, 24,
", r",3, 48,
"]!")
563 TEST_RPR(
"strcsd r",12,
VAL2,
", [r",11,48,
", -r",10,24,
"]!")
564 TEST_RPR(
"strd r",2,
VAL1,
", [r",5, 24,
"], r",4,48,
"")
565 TEST_RPR(
"strd r",10,
VAL2,
", [r",9, 48,
"], -r",7,24,
"")
568 TEST_PR(
"ldrd r0, [r",0, 48,
", -r",2,24,
"]")
569 TEST_PR(
"ldrmid r8, [r",13,0,
", r",12,48,
"]")
570 TEST_PR(
"ldrd r4, [r",2, 24,
", r",3, 48,
"]!")
571 TEST_PR(
"ldrpld r6, [r",11,48,
", -r",10,24,
"]!")
572 TEST_PR(
"ldrd r2, [r",5, 24,
"], r",4,48,
"")
573 TEST_PR(
"ldrd r10, [r",9,48,
"], -r",7,24,
"")
582 TEST_RP(
"strvcd r",12,
VAL2,
", [r",11,24,
", #-16]!")
587 TEST_P(
"ldrd r0, [r",0, 24,
", #-8]")
588 TEST_P(
"ldrhid r8, [r",13,0,
", #8]")
589 TEST_P(
"ldrd r4, [r",2, 24,
", #16]!")
590 TEST_P(
"ldrlsd r6, [r",11,24,
", #-16]!")
591 TEST_P(
"ldrd r2, [r",5, 24,
"], #48")
592 TEST_P(
"ldrd r10, [r",9,6,
"], #-48")
599 #if __LINUX_ARM_ARCH__ >= 7
601 TEST(
"movw r0, #0xffff")
602 TEST(
"movw lr, #0xffff")
614 #if __LINUX_ARM_ARCH__ >= 7
623 TEST_GROUP(
"Load/store word and unsigned byte")
625 #define LOAD_STORE(byte) \
626 TEST_RP( "str"byte" r",0, VAL1,", [r",1, 24,", #-2]") \
627 TEST_RP( "str"byte" r",14,VAL2,", [r",13,0, ", #2]") \
628 TEST_RP( "str"byte" r",1, VAL1,", [r",2, 24,", #4]!") \
629 TEST_RP( "str"byte" r",12,VAL2,", [r",11,24,", #-4]!") \
630 TEST_RP( "str"byte" r",2, VAL1,", [r",3, 24,"], #48") \
631 TEST_RP( "str"byte" r",10,VAL2,", [r",9, 64,"], #-48") \
632 TEST_RPR("str"byte" r",0, VAL1,", [r",1, 48,", -r",2, 24,"]") \
633 TEST_RPR("str"byte" r",14,VAL2,", [r",13,0, ", r",12, 48,"]") \
634 TEST_RPR("str"byte" r",1, VAL1,", [r",2, 24,", r",3, 48,"]!") \
635 TEST_RPR("str"byte" r",12,VAL2,", [r",11,48,", -r",10,24,"]!") \
636 TEST_RPR("str"byte" r",2, VAL1,", [r",3, 24,"], r",4, 48,"") \
637 TEST_RPR("str"byte" r",10,VAL2,", [r",9, 48,"], -r",11,24,"") \
638 TEST_RPR("str"byte" r",0, VAL1,", [r",1, 24,", r",2, 32,", asl #1]")\
639 TEST_RPR("str"byte" r",14,VAL2,", [r",13,0, ", r",12, 32,", lsr #2]")\
640 TEST_RPR("str"byte" r",1, VAL1,", [r",2, 24,", r",3, 32,", asr #3]!")\
641 TEST_RPR("str"byte" r",12,VAL2,", [r",11,24,", r",10, 4,", ror #31]!")\
642 TEST_P( "ldr"byte" r0, [r",0, 24,", #-2]") \
643 TEST_P( "ldr"byte" r14, [r",13,0, ", #2]") \
644 TEST_P( "ldr"byte" r1, [r",2, 24,", #4]!") \
645 TEST_P( "ldr"byte" r12, [r",11,24,", #-4]!") \
646 TEST_P( "ldr"byte" r2, [r",3, 24,"], #48") \
647 TEST_P( "ldr"byte" r10, [r",9, 64,"], #-48") \
648 TEST_PR( "ldr"byte" r0, [r",0, 48,", -r",2, 24,"]") \
649 TEST_PR( "ldr"byte" r14, [r",13,0, ", r",12, 48,"]") \
650 TEST_PR( "ldr"byte" r1, [r",2, 24,", r",3, 48,"]!") \
651 TEST_PR( "ldr"byte" r12, [r",11,48,", -r",10,24,"]!") \
652 TEST_PR( "ldr"byte" r2, [r",3, 24,"], r",4, 48,"") \
653 TEST_PR( "ldr"byte" r10, [r",9, 48,"], -r",11,24,"") \
654 TEST_PR( "ldr"byte" r0, [r",0, 24,", r",2, 32,", asl #1]") \
655 TEST_PR( "ldr"byte" r14, [r",13,0, ", r",12, 32,", lsr #2]") \
656 TEST_PR( "ldr"byte" r1, [r",2, 24,", r",3, 32,", asr #3]!") \
657 TEST_PR( "ldr"byte" r12, [r",11,24,", r",10, 4,", ror #31]!") \
658 TEST( "ldr"byte" r0, [pc, #0]") \
659 TEST_R( "ldr"byte" r12, [pc, r",14,0,"]")
662 TEST_P(
"str pc, [r",0,0,
", #15*4]")
663 TEST_R(
"str pc, [sp, r",2,15*4,
"]")
664 TEST_BF(
"ldr pc, [sp, #15*4]")
667 TEST_P(
"str sp, [r",0,0,
", #13*4]")
668 TEST_R(
"str sp, [sp, r",2,13*4,
"]")
669 TEST_BF(
"ldr sp, [sp, #13*4]")
672 #ifdef CONFIG_THUMB2_KERNEL
699 #if __LINUX_ARM_ARCH__ >= 7
700 TEST_GROUP(
"Parallel addition and subtraction, signed")
774 TEST_GROUP(
"Parallel addition and subtraction, unsigned")
851 #if __LINUX_ARM_ARCH__ >= 6
852 TEST_GROUP(
"Packing, unpacking, saturation, and reversal")
868 TEST_R(
"ssat r14, #24, r",12,
VAL2,
", asr #8")
874 TEST_R(
"usat r14, #24, r",12,
VAL2,
", asr #8")
925 #if __LINUX_ARM_ARCH__ >= 7
951 #if __LINUX_ARM_ARCH__ >= 6
954 TEST_RRR(
"smlad r0, r",0,
HH1,
", r",1,
HH2,
", r",2,
VAL1,
"")
955 TEST_RRR(
"smlad r14, r",12,
HH2,
", r",10,
HH1,
", r",8,
VAL2,
"")
957 TEST_RRR(
"smladx r0, r",0,
HH1,
", r",1,
HH2,
", r",2,
VAL1,
"")
958 TEST_RRR(
"smladx r14, r",12,
HH2,
", r",10,
HH1,
", r",8,
VAL2,
"")
968 TEST_RRR(
"smlsd r0, r",0,
HH1,
", r",1,
HH2,
", r",2,
VAL1,
"")
969 TEST_RRR(
"smlsd r14, r",12,
HH2,
", r",10,
HH1,
", r",8,
VAL2,
"")
971 TEST_RRR(
"smlsdx r0, r",0,
HH1,
", r",1,
HH2,
", r",2,
VAL1,
"")
972 TEST_RRR(
"smlsdx r14, r",12,
HH2,
", r",10,
HH1,
", r",8,
VAL2,
"")
982 TEST_RRRR(
"smlald r",0,
VAL1,
", r",1,
VAL2,
", r",0,
HH1,
", r",1,
HH2)
983 TEST_RRRR(
"smlald r",11,
VAL2,
", r",10,
VAL1,
", r",9,
HH2,
", r",8,
HH1)
989 TEST_RRRR(
"smlaldx r",0,
VAL1,
", r",1,
VAL2,
", r",0,
HH1,
", r",1,
HH2)
990 TEST_RRRR(
"smlaldx r",11,
VAL2,
", r",10,
VAL1,
", r",9,
HH2,
", r",8,
HH1)
994 TEST_RRR(
"smmla r0, r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL1,
"")
995 TEST_RRR(
"smmla r14, r",12,
VAL2,
", r",10,
VAL1,
", r",8,
VAL2,
"")
997 TEST_RRR(
"smmlar r0, r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL1,
"")
998 TEST_RRR(
"smmlar r14, r",12,
VAL2,
", r",10,
VAL1,
", r",8,
VAL2,
"")
1008 TEST_RRR(
"smmls r0, r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL1,
"")
1009 TEST_RRR(
"smmls r14, r",12,
VAL2,
", r",10,
VAL1,
", r",8,
VAL2,
"")
1011 TEST_RRR(
"smmlsr r0, r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL1,
"")
1012 TEST_RRR(
"smmlsr r14, r",12,
VAL2,
", r",10,
VAL1,
", r",8,
VAL2,
"")
1024 TEST_RRR(
"usada8 r0, r",0,
VAL1,
", r",1,
VAL2,
", r",2,
VAL3,
"")
1025 TEST_RRR(
"usada8 r14, r",12,
VAL2,
", r",10,
VAL1,
", r",8,
VAL3,
"")
1031 #if __LINUX_ARM_ARCH__ >= 7
1035 TEST_R(
"sbfxeq r14, r",12,
VAL2,
", #8, #16")
1040 TEST_R(
"ubfxcs r14, r",12,
VAL2,
", #8, #16")
1059 TEST_GROUP(
"Branch, branch with link, and block data transfer")
1061 TEST_P(
"stmda r",0, 16*4,
", {r0}")
1062 TEST_P(
"stmeqda r",4, 16*4,
", {r0-r15}")
1063 TEST_P(
"stmneda r",8, 16*4,
"!, {r8-r15}")
1064 TEST_P(
"stmda r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1065 TEST_P(
"stmda r",13,0,
"!, {pc}")
1067 TEST_P(
"ldmda r",0, 16*4,
", {r0}")
1068 TEST_BF_P(
"ldmcsda r",4, 15*4,
", {r0-r15}")
1069 TEST_BF_P(
"ldmccda r",7, 15*4,
"!, {r8-r15}")
1070 TEST_P(
"ldmda r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1073 TEST_P(
"stmia r",0, 16*4,
", {r0}")
1074 TEST_P(
"stmmiia r",4, 16*4,
", {r0-r15}")
1075 TEST_P(
"stmplia r",8, 16*4,
"!, {r8-r15}")
1076 TEST_P(
"stmia r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1077 TEST_P(
"stmia r",14,0,
"!, {pc}")
1079 TEST_P(
"ldmia r",0, 16*4,
", {r0}")
1080 TEST_BF_P(
"ldmvsia r",4, 0,
", {r0-r15}")
1081 TEST_BF_P(
"ldmvcia r",7, 8*4,
"!, {r8-r15}")
1082 TEST_P(
"ldmia r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1085 TEST_P(
"stmdb r",0, 16*4,
", {r0}")
1086 TEST_P(
"stmhidb r",4, 16*4,
", {r0-r15}")
1087 TEST_P(
"stmlsdb r",8, 16*4,
"!, {r8-r15}")
1088 TEST_P(
"stmdb r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1089 TEST_P(
"stmdb r",13,4,
"!, {pc}")
1091 TEST_P(
"ldmdb r",0, 16*4,
", {r0}")
1092 TEST_BF_P(
"ldmgedb r",4, 16*4,
", {r0-r15}")
1093 TEST_BF_P(
"ldmltdb r",7, 16*4,
"!, {r8-r15}")
1094 TEST_P(
"ldmdb r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1097 TEST_P(
"stmib r",0, 16*4,
", {r0}")
1098 TEST_P(
"stmgtib r",4, 16*4,
", {r0-r15}")
1099 TEST_P(
"stmleib r",8, 16*4,
"!, {r8-r15}")
1100 TEST_P(
"stmib r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1101 TEST_P(
"stmib r",13,-4,
"!, {pc}")
1103 TEST_P(
"ldmib r",0, 16*4,
", {r0}")
1104 TEST_BF_P(
"ldmeqib r",4, -4,
", {r0-r15}")
1105 TEST_BF_P(
"ldmneib r",7, 7*4,
"!, {r8-r15}")
1106 TEST_P(
"ldmib r",12,16*4,
"!, {r1,r3,r5,r7,r8-r11,r14}")
1109 TEST_P(
"stmdb r",13,16*4,
"!, {r3-r12,lr}")
1110 TEST_P(
"stmeqdb r",13,16*4,
"!, {r3-r12}")
1111 TEST_P(
"stmnedb r",2, 16*4,
", {r3-r12,lr}")
1112 TEST_P(
"stmdb r",13,16*4,
"!, {r2-r12,lr}")
1113 TEST_P(
"stmdb r",0, 16*4,
", {r0-r12}")
1114 TEST_P(
"stmdb r",0, 16*4,
", {r0-r12,lr}")
1116 TEST_BF_P(
"ldmia r",13,5*4,
"!, {r3-r12,pc}")
1117 TEST_P(
"ldmccia r",13,5*4,
"!, {r3-r12}")
1118 TEST_BF_P(
"ldmcsia r",2, 5*4,
"!, {r3-r12,pc}")
1119 TEST_BF_P(
"ldmia r",13,4*4,
"!, {r2-r12,pc}")
1120 TEST_P(
"ldmia r",0, 16*4,
", {r0-r12}")
1121 TEST_P(
"ldmia r",0, 16*4,
", {r0-r12,lr}")
1123 #ifdef CONFIG_THUMB2_KERNEL
1142 TEST_GROUP(
"Supervisor Call, and coprocessor instructions")
1149 #define TEST_COPROCESSOR(code) TEST_UNSUPPORTED(code)
1151 #define COPROCESSOR_INSTRUCTIONS_ST_LD(two,cc) \
1152 TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #4]") \
1153 TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #-4]") \
1154 TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #4]!") \
1155 TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #-4]!") \
1156 TEST_COPROCESSOR("stc"two" 0, cr0, [r13], #4") \
1157 TEST_COPROCESSOR("stc"two" 0, cr0, [r13], #-4") \
1158 TEST_COPROCESSOR("stc"two" 0, cr0, [r13], {1}") \
1159 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #4]") \
1160 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #-4]") \
1161 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #4]!") \
1162 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #-4]!") \
1163 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], #4") \
1164 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], #-4") \
1165 TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], {1}") \
1166 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #4]") \
1167 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #-4]") \
1168 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #4]!") \
1169 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #-4]!") \
1170 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], #4") \
1171 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], #-4") \
1172 TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], {1}") \
1173 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #4]") \
1174 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #-4]") \
1175 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #4]!") \
1176 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #-4]!") \
1177 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], #4") \
1178 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], #-4") \
1179 TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], {1}") \
1181 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #4]") \
1182 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #-4]") \
1183 TEST_UNSUPPORTED(".word 0x"cc"daf0001 @ stc"two" 0, cr0, [r15, #4]!") \
1184 TEST_UNSUPPORTED(".word 0x"cc"d2f0001 @ stc"two" 0, cr0, [r15, #-4]!") \
1185 TEST_UNSUPPORTED(".word 0x"cc"caf0001 @ stc"two" 0, cr0, [r15], #4") \
1186 TEST_UNSUPPORTED(".word 0x"cc"c2f0001 @ stc"two" 0, cr0, [r15], #-4") \
1187 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15], {1}") \
1188 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #4]") \
1189 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #-4]") \
1190 TEST_UNSUPPORTED(".word 0x"cc"def0001 @ stc"two"l 0, cr0, [r15, #4]!") \
1191 TEST_UNSUPPORTED(".word 0x"cc"d6f0001 @ stc"two"l 0, cr0, [r15, #-4]!") \
1192 TEST_UNSUPPORTED(".word 0x"cc"cef0001 @ stc"two"l 0, cr0, [r15], #4") \
1193 TEST_UNSUPPORTED(".word 0x"cc"c6f0001 @ stc"two"l 0, cr0, [r15], #-4") \
1194 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15], {1}") \
1195 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #4]") \
1196 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #-4]") \
1197 TEST_UNSUPPORTED(".word 0x"cc"dbf0001 @ ldc"two" 0, cr0, [r15, #4]!") \
1198 TEST_UNSUPPORTED(".word 0x"cc"d3f0001 @ ldc"two" 0, cr0, [r15, #-4]!") \
1199 TEST_UNSUPPORTED(".word 0x"cc"cbf0001 @ ldc"two" 0, cr0, [r15], #4") \
1200 TEST_UNSUPPORTED(".word 0x"cc"c3f0001 @ ldc"two" 0, cr0, [r15], #-4") \
1201 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15], {1}") \
1202 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #4]") \
1203 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #-4]") \
1204 TEST_UNSUPPORTED(".word 0x"cc"dff0001 @ ldc"two"l 0, cr0, [r15, #4]!") \
1205 TEST_UNSUPPORTED(".word 0x"cc"d7f0001 @ ldc"two"l 0, cr0, [r15, #-4]!") \
1206 TEST_UNSUPPORTED(".word 0x"cc"cff0001 @ ldc"two"l 0, cr0, [r15], #4") \
1207 TEST_UNSUPPORTED(".word 0x"cc"c7f0001 @ ldc"two"l 0, cr0, [r15], #-4") \
1208 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15], {1}")
1210 #define COPROCESSOR_INSTRUCTIONS_MC_MR(two,cc) \
1212 TEST_COPROCESSOR( "mcrr"two" 0, 15, r0, r14, cr0") \
1213 TEST_COPROCESSOR( "mcrr"two" 15, 0, r14, r0, cr15") \
1214 TEST_UNSUPPORTED(".word 0x"cc"c4f00f0 @ mcrr"two" 0, 15, r0, r15, cr0") \
1215 TEST_UNSUPPORTED(".word 0x"cc"c40ff0f @ mcrr"two" 15, 0, r15, r0, cr15") \
1216 TEST_COPROCESSOR( "mrrc"two" 0, 15, r0, r14, cr0") \
1217 TEST_COPROCESSOR( "mrrc"two" 15, 0, r14, r0, cr15") \
1218 TEST_UNSUPPORTED(".word 0x"cc"c5f00f0 @ mrrc"two" 0, 15, r0, r15, cr0") \
1219 TEST_UNSUPPORTED(".word 0x"cc"c50ff0f @ mrrc"two" 15, 0, r15, r0, cr15") \
1220 TEST_COPROCESSOR( "cdp"two" 15, 15, cr15, cr15, cr15, 7") \
1221 TEST_COPROCESSOR( "cdp"two" 0, 0, cr0, cr0, cr0, 0") \
1222 TEST_COPROCESSOR( "mcr"two" 15, 7, r15, cr15, cr15, 7") \
1223 TEST_COPROCESSOR( "mcr"two" 0, 0, r0, cr0, cr0, 0") \
1224 TEST_COPROCESSOR( "mrc"two" 15, 7, r15, cr15, cr15, 7") \
1225 TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")
1236 #if __LINUX_ARM_ARCH__ >= 6
1264 #if __LINUX_ARM_ARCH__ >= 6
1265 TEST_X(
"blx __dummy_thumb_subroutine_even",
1268 ".type __dummy_thumb_subroutine_even, %%function \n\t"
1269 "__dummy_thumb_subroutine_even: \n\t"
1274 TEST(
"blx __dummy_thumb_subroutine_even")
1276 TEST_X(
"blx __dummy_thumb_subroutine_odd",
1279 ".type __dummy_thumb_subroutine_odd, %%function \n\t"
1280 "__dummy_thumb_subroutine_odd: \n\t"
1285 TEST(
"blx __dummy_thumb_subroutine_odd")
1289 #if __LINUX_ARM_ARCH__ >= 6
1293 TEST_GROUP(
"Miscellaneous instructions, memory hints, and Advanced SIMD instructions")
1295 #if __LINUX_ARM_ARCH__ >= 6
1305 #if __LINUX_ARM_ARCH__ >= 7
1306 TEST_P(
"pli [r",0,0
b,
", #16]")
1307 TEST(
"pli [pc, #0]")
1308 TEST_RR(
"pli [r",12,0
b,
", r",0, 16,
"]")
1309 TEST_RR(
"pli [r",0, 0
b,
", -r",12,16,
", lsl #4]")
1312 #if __LINUX_ARM_ARCH__ >= 5
1313 TEST_P(
"pld [r",0,32,
", #-16]")
1314 TEST(
"pld [pc, #0]")
1315 TEST_PR(
"pld [r",7, 24,
", r",0, 16,
"]")
1316 TEST_PR(
"pld [r",8, 24,
", -r",12,16,
", lsl #4]")
1319 #if __LINUX_ARM_ARCH__ >= 7
1325 #if __LINUX_ARM_ARCH__ >= 7