test-arm.c 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367
  1. /*
  2. * arch/arm/kernel/kprobes-test-arm.c
  3. *
  4. * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/module.h>
  12. #include <asm/system_info.h>
  13. #include <asm/opcodes.h>
  14. #include <asm/probes.h>
  15. #include "test-core.h"
  16. #define TEST_ISA "32"
  17. #define TEST_ARM_TO_THUMB_INTERWORK_R(code1, reg, val, code2) \
  18. TESTCASE_START(code1 #reg code2) \
  19. TEST_ARG_REG(reg, val) \
  20. TEST_ARG_REG(14, 99f) \
  21. TEST_ARG_END("") \
  22. "50: nop \n\t" \
  23. "1: "code1 #reg code2" \n\t" \
  24. " bx lr \n\t" \
  25. ".thumb \n\t" \
  26. "3: adr lr, 2f \n\t" \
  27. " bx lr \n\t" \
  28. ".arm \n\t" \
  29. "2: nop \n\t" \
  30. TESTCASE_END
  31. #define TEST_ARM_TO_THUMB_INTERWORK_P(code1, reg, val, code2) \
  32. TESTCASE_START(code1 #reg code2) \
  33. TEST_ARG_PTR(reg, val) \
  34. TEST_ARG_REG(14, 99f) \
  35. TEST_ARG_MEM(15, 3f+1) \
  36. TEST_ARG_END("") \
  37. "50: nop \n\t" \
  38. "1: "code1 #reg code2" \n\t" \
  39. " bx lr \n\t" \
  40. ".thumb \n\t" \
  41. "3: adr lr, 2f \n\t" \
  42. " bx lr \n\t" \
  43. ".arm \n\t" \
  44. "2: nop \n\t" \
  45. TESTCASE_END
  46. void kprobe_arm_test_cases(void)
  47. {
  48. kprobe_test_flags = 0;
  49. TEST_GROUP("Data-processing (register), (register-shifted register), (immediate)")
  50. #define _DATA_PROCESSING_DNM(op,s,val) \
  51. TEST_RR( op "eq" s " r0, r",1, VAL1,", r",2, val, "") \
  52. TEST_RR( op "ne" s " r1, r",1, VAL1,", r",2, val, ", lsl #3") \
  53. TEST_RR( op "cs" s " r2, r",3, VAL1,", r",2, val, ", lsr #4") \
  54. TEST_RR( op "cc" s " r3, r",3, VAL1,", r",2, val, ", asr #5") \
  55. TEST_RR( op "mi" s " r4, r",5, VAL1,", r",2, N(val),", asr #6") \
  56. TEST_RR( op "pl" s " r5, r",5, VAL1,", r",2, val, ", ror #7") \
  57. TEST_RR( op "vs" s " r6, r",7, VAL1,", r",2, val, ", rrx") \
  58. TEST_R( op "vc" s " r6, r",7, VAL1,", pc, lsl #3") \
  59. TEST_R( op "vc" s " r6, r",7, VAL1,", sp, lsr #4") \
  60. TEST_R( op "vc" s " r6, pc, r",7, VAL1,", asr #5") \
  61. TEST_R( op "vc" s " r6, sp, r",7, VAL1,", ror #6") \
  62. TEST_RRR( op "hi" s " r8, r",9, VAL1,", r",14,val, ", lsl r",0, 3,"")\
  63. TEST_RRR( op "ls" s " r9, r",9, VAL1,", r",14,val, ", lsr r",7, 4,"")\
  64. TEST_RRR( op "ge" s " r10, r",11,VAL1,", r",14,val, ", asr r",7, 5,"")\
  65. TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\
  66. TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\
  67. TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\
  68. TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \
  69. TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \
  70. TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \
  71. TEST( op s " r4, pc" ", #0x00005a00")
  72. #define DATA_PROCESSING_DNM(op,val) \
  73. _DATA_PROCESSING_DNM(op,"",val) \
  74. _DATA_PROCESSING_DNM(op,"s",val)
  75. #define DATA_PROCESSING_NM(op,val) \
  76. TEST_RR( op "ne r",1, VAL1,", r",2, val, "") \
  77. TEST_RR( op "eq r",1, VAL1,", r",2, val, ", lsl #3") \
  78. TEST_RR( op "cc r",3, VAL1,", r",2, val, ", lsr #4") \
  79. TEST_RR( op "cs r",3, VAL1,", r",2, val, ", asr #5") \
  80. TEST_RR( op "pl r",5, VAL1,", r",2, N(val),", asr #6") \
  81. TEST_RR( op "mi r",5, VAL1,", r",2, val, ", ror #7") \
  82. TEST_RR( op "vc r",7, VAL1,", r",2, val, ", rrx") \
  83. TEST_R ( op "vs r",7, VAL1,", pc, lsl #3") \
  84. TEST_R ( op "vs r",7, VAL1,", sp, lsr #4") \
  85. TEST_R( op "vs pc, r",7, VAL1,", asr #5") \
  86. TEST_R( op "vs sp, r",7, VAL1,", ror #6") \
  87. TEST_RRR( op "ls r",9, VAL1,", r",14,val, ", lsl r",0, 3,"") \
  88. TEST_RRR( op "hi r",9, VAL1,", r",14,val, ", lsr r",7, 4,"") \
  89. TEST_RRR( op "lt r",11,VAL1,", r",14,val, ", asr r",7, 5,"") \
  90. TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \
  91. TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \
  92. TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \
  93. TEST_R( op "eq r",11,VAL1,", #0xf5") \
  94. TEST_R( op "ne r",0, VAL1,", #0xf5000000") \
  95. TEST_R( op " r",8, VAL2,", #0x000af000")
  96. #define _DATA_PROCESSING_DM(op,s,val) \
  97. TEST_R( op "eq" s " r0, r",1, val, "") \
  98. TEST_R( op "ne" s " r1, r",1, val, ", lsl #3") \
  99. TEST_R( op "cs" s " r2, r",3, val, ", lsr #4") \
  100. TEST_R( op "cc" s " r3, r",3, val, ", asr #5") \
  101. TEST_R( op "mi" s " r4, r",5, N(val),", asr #6") \
  102. TEST_R( op "pl" s " r5, r",5, val, ", ror #7") \
  103. TEST_R( op "vs" s " r6, r",10,val, ", rrx") \
  104. TEST( op "vs" s " r7, pc, lsl #3") \
  105. TEST( op "vs" s " r7, sp, lsr #4") \
  106. TEST_RR( op "vc" s " r8, r",7, val, ", lsl r",0, 3,"") \
  107. TEST_RR( op "hi" s " r9, r",9, val, ", lsr r",7, 4,"") \
  108. TEST_RR( op "ls" s " r10, r",9, val, ", asr r",7, 5,"") \
  109. TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \
  110. TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \
  111. TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \
  112. TEST( op "eq" s " r0, #0xf5") \
  113. TEST( op "ne" s " r11, #0xf5000000") \
  114. TEST( op s " r7, #0x000af000") \
  115. TEST( op s " r4, #0x00005a00")
  116. #define DATA_PROCESSING_DM(op,val) \
  117. _DATA_PROCESSING_DM(op,"",val) \
  118. _DATA_PROCESSING_DM(op,"s",val)
  119. DATA_PROCESSING_DNM("and",0xf00f00ff)
  120. DATA_PROCESSING_DNM("eor",0xf00f00ff)
  121. DATA_PROCESSING_DNM("sub",VAL2)
  122. DATA_PROCESSING_DNM("rsb",VAL2)
  123. DATA_PROCESSING_DNM("add",VAL2)
  124. DATA_PROCESSING_DNM("adc",VAL2)
  125. DATA_PROCESSING_DNM("sbc",VAL2)
  126. DATA_PROCESSING_DNM("rsc",VAL2)
  127. DATA_PROCESSING_NM("tst",0xf00f00ff)
  128. DATA_PROCESSING_NM("teq",0xf00f00ff)
  129. DATA_PROCESSING_NM("cmp",VAL2)
  130. DATA_PROCESSING_NM("cmn",VAL2)
  131. DATA_PROCESSING_DNM("orr",0xf00f00ff)
  132. DATA_PROCESSING_DM("mov",VAL2)
  133. DATA_PROCESSING_DNM("bic",0xf00f00ff)
  134. DATA_PROCESSING_DM("mvn",VAL2)
  135. TEST("mov ip, sp") /* This has special case emulation code */
  136. TEST_SUPPORTED("mov pc, #0x1000");
  137. TEST_SUPPORTED("mov sp, #0x1000");
  138. TEST_SUPPORTED("cmp pc, #0x1000");
  139. TEST_SUPPORTED("cmp sp, #0x1000");
  140. /* Data-processing with PC and a shift count in a register */
  141. TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc")
  142. TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc")
  143. TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc")
  144. TEST_UNSUPPORTED(__inst_arm(0xe151021f) " @ cmp r1, pc, lsl r2")
  145. TEST_UNSUPPORTED(__inst_arm(0xe17f0211) " @ cmn pc, r1, lsl r2")
  146. TEST_UNSUPPORTED(__inst_arm(0xe1a0121f) " @ mov r1, pc, lsl r2")
  147. TEST_UNSUPPORTED(__inst_arm(0xe1a0f211) " @ mov pc, r1, lsl r2")
  148. TEST_UNSUPPORTED(__inst_arm(0xe042131f) " @ sub r1, r2, pc, lsl r3")
  149. TEST_UNSUPPORTED(__inst_arm(0xe1cf1312) " @ bic r1, pc, r2, lsl r3")
  150. TEST_UNSUPPORTED(__inst_arm(0xe081f312) " @ add pc, r1, r2, lsl r3")
  151. /* Data-processing with PC as a target and status registers updated */
  152. TEST_UNSUPPORTED("movs pc, r1")
  153. TEST_UNSUPPORTED("movs pc, r1, lsl r2")
  154. TEST_UNSUPPORTED("movs pc, #0x10000")
  155. TEST_UNSUPPORTED("adds pc, lr, r1")
  156. TEST_UNSUPPORTED("adds pc, lr, r1, lsl r2")
  157. TEST_UNSUPPORTED("adds pc, lr, #4")
  158. /* Data-processing with SP as target */
  159. TEST("add sp, sp, #16")
  160. TEST("sub sp, sp, #8")
  161. TEST("bic sp, sp, #0x20")
  162. TEST("orr sp, sp, #0x20")
  163. TEST_PR( "add sp, r",10,0,", r",11,4,"")
  164. TEST_PRR("add sp, r",10,0,", r",11,4,", asl r",12,1,"")
  165. TEST_P( "mov sp, r",10,0,"")
  166. TEST_PR( "mov sp, r",10,0,", asl r",12,0,"")
  167. /* Data-processing with PC as target */
  168. TEST_BF( "add pc, pc, #2f-1b-8")
  169. TEST_BF_R ("add pc, pc, r",14,2f-1f-8,"")
  170. TEST_BF_R ("add pc, r",14,2f-1f-8,", pc")
  171. TEST_BF_R ("mov pc, r",0,2f,"")
  172. TEST_BF_R ("add pc, pc, r",14,(2f-1f-8)*2,", asr #1")
  173. TEST_BB( "sub pc, pc, #1b-2b+8")
  174. #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7)
  175. TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */
  176. #endif
  177. TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"")
  178. TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc")
  179. TEST_R( "add pc, pc, r",10,-2,", asl #1")
  180. #ifdef CONFIG_THUMB2_KERNEL
  181. TEST_ARM_TO_THUMB_INTERWORK_R("add pc, pc, r",0,3f-1f-8+1,"")
  182. TEST_ARM_TO_THUMB_INTERWORK_R("sub pc, r",0,3f+8+1,", #8")
  183. #endif
  184. TEST_GROUP("Miscellaneous instructions")
  185. TEST_RMASKED("mrs r",0,~PSR_IGNORE_BITS,", cpsr")
  186. TEST_RMASKED("mrspl r",7,~PSR_IGNORE_BITS,", cpsr")
  187. TEST_RMASKED("mrs r",14,~PSR_IGNORE_BITS,", cpsr")
  188. TEST_UNSUPPORTED(__inst_arm(0xe10ff000) " @ mrs r15, cpsr")
  189. TEST_UNSUPPORTED("mrs r0, spsr")
  190. TEST_UNSUPPORTED("mrs lr, spsr")
  191. TEST_UNSUPPORTED("msr cpsr, r0")
  192. TEST_UNSUPPORTED("msr cpsr_f, lr")
  193. TEST_UNSUPPORTED("msr spsr, r0")
  194. #if __LINUX_ARM_ARCH__ >= 5 || \
  195. (__LINUX_ARM_ARCH__ == 4 && !defined(CONFIG_CPU_32v4))
  196. TEST_BF_R("bx r",0,2f,"")
  197. TEST_BB_R("bx r",7,2f,"")
  198. TEST_BF_R("bxeq r",14,2f,"")
  199. #endif
  200. #if __LINUX_ARM_ARCH__ >= 5
  201. TEST_R("clz r0, r",0, 0x0,"")
  202. TEST_R("clzeq r7, r",14,0x1,"")
  203. TEST_R("clz lr, r",7, 0xffffffff,"")
  204. TEST( "clz r4, sp")
  205. TEST_UNSUPPORTED(__inst_arm(0x016fff10) " @ clz pc, r0")
  206. TEST_UNSUPPORTED(__inst_arm(0x016f0f1f) " @ clz r0, pc")
  207. #if __LINUX_ARM_ARCH__ >= 6
  208. TEST_UNSUPPORTED("bxj r0")
  209. #endif
  210. TEST_BF_R("blx r",0,2f,"")
  211. TEST_BB_R("blx r",7,2f,"")
  212. TEST_BF_R("blxeq r",14,2f,"")
  213. TEST_UNSUPPORTED(__inst_arm(0x0120003f) " @ blx pc")
  214. TEST_RR( "qadd r0, r",1, VAL1,", r",2, VAL2,"")
  215. TEST_RR( "qaddvs lr, r",9, VAL2,", r",8, VAL1,"")
  216. TEST_R( "qadd lr, r",9, VAL2,", r13")
  217. TEST_RR( "qsub r0, r",1, VAL1,", r",2, VAL2,"")
  218. TEST_RR( "qsubvs lr, r",9, VAL2,", r",8, VAL1,"")
  219. TEST_R( "qsub lr, r",9, VAL2,", r13")
  220. TEST_RR( "qdadd r0, r",1, VAL1,", r",2, VAL2,"")
  221. TEST_RR( "qdaddvs lr, r",9, VAL2,", r",8, VAL1,"")
  222. TEST_R( "qdadd lr, r",9, VAL2,", r13")
  223. TEST_RR( "qdsub r0, r",1, VAL1,", r",2, VAL2,"")
  224. TEST_RR( "qdsubvs lr, r",9, VAL2,", r",8, VAL1,"")
  225. TEST_R( "qdsub lr, r",9, VAL2,", r13")
  226. TEST_UNSUPPORTED(__inst_arm(0xe101f050) " @ qadd pc, r0, r1")
  227. TEST_UNSUPPORTED(__inst_arm(0xe121f050) " @ qsub pc, r0, r1")
  228. TEST_UNSUPPORTED(__inst_arm(0xe141f050) " @ qdadd pc, r0, r1")
  229. TEST_UNSUPPORTED(__inst_arm(0xe161f050) " @ qdsub pc, r0, r1")
  230. TEST_UNSUPPORTED(__inst_arm(0xe16f2050) " @ qdsub r2, r0, pc")
  231. TEST_UNSUPPORTED(__inst_arm(0xe161205f) " @ qdsub r2, pc, r1")
  232. TEST_UNSUPPORTED("bkpt 0xffff")
  233. TEST_UNSUPPORTED("bkpt 0x0000")
  234. TEST_UNSUPPORTED(__inst_arm(0xe1600070) " @ smc #0")
  235. TEST_GROUP("Halfword multiply and multiply-accumulate")
  236. TEST_RRR( "smlabb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  237. TEST_RRR( "smlabbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  238. TEST_RR( "smlabb lr, r",1, VAL2,", r",2, VAL3,", r13")
  239. TEST_UNSUPPORTED(__inst_arm(0xe10f3281) " @ smlabb pc, r1, r2, r3")
  240. TEST_RRR( "smlatb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  241. TEST_RRR( "smlatbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  242. TEST_RR( "smlatb lr, r",1, VAL2,", r",2, VAL3,", r13")
  243. TEST_UNSUPPORTED(__inst_arm(0xe10f32a1) " @ smlatb pc, r1, r2, r3")
  244. TEST_RRR( "smlabt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  245. TEST_RRR( "smlabtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  246. TEST_RR( "smlabt lr, r",1, VAL2,", r",2, VAL3,", r13")
  247. TEST_UNSUPPORTED(__inst_arm(0xe10f32c1) " @ smlabt pc, r1, r2, r3")
  248. TEST_RRR( "smlatt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  249. TEST_RRR( "smlattge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  250. TEST_RR( "smlatt lr, r",1, VAL2,", r",2, VAL3,", r13")
  251. TEST_UNSUPPORTED(__inst_arm(0xe10f32e1) " @ smlatt pc, r1, r2, r3")
  252. TEST_RRR( "smlawb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  253. TEST_RRR( "smlawbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  254. TEST_RR( "smlawb lr, r",1, VAL2,", r",2, VAL3,", r13")
  255. TEST_UNSUPPORTED(__inst_arm(0xe12f3281) " @ smlawb pc, r1, r2, r3")
  256. TEST_RRR( "smlawt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  257. TEST_RRR( "smlawtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  258. TEST_RR( "smlawt lr, r",1, VAL2,", r",2, VAL3,", r13")
  259. TEST_UNSUPPORTED(__inst_arm(0xe12f32c1) " @ smlawt pc, r1, r2, r3")
  260. TEST_UNSUPPORTED(__inst_arm(0xe12032cf) " @ smlawt r0, pc, r2, r3")
  261. TEST_UNSUPPORTED(__inst_arm(0xe1203fc1) " @ smlawt r0, r1, pc, r3")
  262. TEST_UNSUPPORTED(__inst_arm(0xe120f2c1) " @ smlawt r0, r1, r2, pc")
  263. TEST_RR( "smulwb r0, r",1, VAL1,", r",2, VAL2,"")
  264. TEST_RR( "smulwbge r7, r",8, VAL3,", r",9, VAL1,"")
  265. TEST_R( "smulwb lr, r",1, VAL2,", r13")
  266. TEST_UNSUPPORTED(__inst_arm(0xe12f02a1) " @ smulwb pc, r1, r2")
  267. TEST_RR( "smulwt r0, r",1, VAL1,", r",2, VAL2,"")
  268. TEST_RR( "smulwtge r7, r",8, VAL3,", r",9, VAL1,"")
  269. TEST_R( "smulwt lr, r",1, VAL2,", r13")
  270. TEST_UNSUPPORTED(__inst_arm(0xe12f02e1) " @ smulwt pc, r1, r2")
  271. TEST_RRRR( "smlalbb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  272. TEST_RRRR( "smlalbble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  273. TEST_RRR( "smlalbb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  274. TEST_UNSUPPORTED(__inst_arm(0xe14f1382) " @ smlalbb pc, r1, r2, r3")
  275. TEST_UNSUPPORTED(__inst_arm(0xe141f382) " @ smlalbb r1, pc, r2, r3")
  276. TEST_RRRR( "smlaltb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  277. TEST_RRRR( "smlaltble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  278. TEST_RRR( "smlaltb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  279. TEST_UNSUPPORTED(__inst_arm(0xe14f13a2) " @ smlaltb pc, r1, r2, r3")
  280. TEST_UNSUPPORTED(__inst_arm(0xe141f3a2) " @ smlaltb r1, pc, r2, r3")
  281. TEST_RRRR( "smlalbt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  282. TEST_RRRR( "smlalbtle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  283. TEST_RRR( "smlalbt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  284. TEST_UNSUPPORTED(__inst_arm(0xe14f13c2) " @ smlalbt pc, r1, r2, r3")
  285. TEST_UNSUPPORTED(__inst_arm(0xe141f3c2) " @ smlalbt r1, pc, r2, r3")
  286. TEST_RRRR( "smlaltt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  287. TEST_RRRR( "smlalttle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  288. TEST_RRR( "smlaltt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  289. TEST_UNSUPPORTED(__inst_arm(0xe14f13e2) " @ smlalbb pc, r1, r2, r3")
  290. TEST_UNSUPPORTED(__inst_arm(0xe140f3e2) " @ smlalbb r0, pc, r2, r3")
  291. TEST_UNSUPPORTED(__inst_arm(0xe14013ef) " @ smlalbb r0, r1, pc, r3")
  292. TEST_UNSUPPORTED(__inst_arm(0xe1401fe2) " @ smlalbb r0, r1, r2, pc")
  293. TEST_RR( "smulbb r0, r",1, VAL1,", r",2, VAL2,"")
  294. TEST_RR( "smulbbge r7, r",8, VAL3,", r",9, VAL1,"")
  295. TEST_R( "smulbb lr, r",1, VAL2,", r13")
  296. TEST_UNSUPPORTED(__inst_arm(0xe16f0281) " @ smulbb pc, r1, r2")
  297. TEST_RR( "smultb r0, r",1, VAL1,", r",2, VAL2,"")
  298. TEST_RR( "smultbge r7, r",8, VAL3,", r",9, VAL1,"")
  299. TEST_R( "smultb lr, r",1, VAL2,", r13")
  300. TEST_UNSUPPORTED(__inst_arm(0xe16f02a1) " @ smultb pc, r1, r2")
  301. TEST_RR( "smulbt r0, r",1, VAL1,", r",2, VAL2,"")
  302. TEST_RR( "smulbtge r7, r",8, VAL3,", r",9, VAL1,"")
  303. TEST_R( "smulbt lr, r",1, VAL2,", r13")
  304. TEST_UNSUPPORTED(__inst_arm(0xe16f02c1) " @ smultb pc, r1, r2")
  305. TEST_RR( "smultt r0, r",1, VAL1,", r",2, VAL2,"")
  306. TEST_RR( "smulttge r7, r",8, VAL3,", r",9, VAL1,"")
  307. TEST_R( "smultt lr, r",1, VAL2,", r13")
  308. TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2")
  309. TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2")
  310. TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc")
  311. #endif
  312. TEST_GROUP("Multiply and multiply-accumulate")
  313. TEST_RR( "mul r0, r",1, VAL1,", r",2, VAL2,"")
  314. TEST_RR( "mulls r7, r",8, VAL2,", r",9, VAL2,"")
  315. TEST_R( "mul lr, r",4, VAL3,", r13")
  316. TEST_UNSUPPORTED(__inst_arm(0xe00f0291) " @ mul pc, r1, r2")
  317. TEST_UNSUPPORTED(__inst_arm(0xe000029f) " @ mul r0, pc, r2")
  318. TEST_UNSUPPORTED(__inst_arm(0xe0000f91) " @ mul r0, r1, pc")
  319. TEST_RR( "muls r0, r",1, VAL1,", r",2, VAL2,"")
  320. TEST_RR( "mullss r7, r",8, VAL2,", r",9, VAL2,"")
  321. TEST_R( "muls lr, r",4, VAL3,", r13")
  322. TEST_UNSUPPORTED(__inst_arm(0xe01f0291) " @ muls pc, r1, r2")
  323. TEST_RRR( "mla r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  324. TEST_RRR( "mlahi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  325. TEST_RR( "mla lr, r",1, VAL2,", r",2, VAL3,", r13")
  326. TEST_UNSUPPORTED(__inst_arm(0xe02f3291) " @ mla pc, r1, r2, r3")
  327. TEST_RRR( "mlas r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  328. TEST_RRR( "mlahis r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  329. TEST_RR( "mlas lr, r",1, VAL2,", r",2, VAL3,", r13")
  330. TEST_UNSUPPORTED(__inst_arm(0xe03f3291) " @ mlas pc, r1, r2, r3")
  331. #if __LINUX_ARM_ARCH__ >= 6
  332. TEST_RR( "umaal r0, r1, r",2, VAL1,", r",3, VAL2,"")
  333. TEST_RR( "umaalls r7, r8, r",9, VAL2,", r",10, VAL1,"")
  334. TEST_R( "umaal lr, r12, r",11,VAL3,", r13")
  335. TEST_UNSUPPORTED(__inst_arm(0xe041f392) " @ umaal pc, r1, r2, r3")
  336. TEST_UNSUPPORTED(__inst_arm(0xe04f0392) " @ umaal r0, pc, r2, r3")
  337. TEST_UNSUPPORTED(__inst_arm(0xe0500090) " @ undef")
  338. TEST_UNSUPPORTED(__inst_arm(0xe05fff9f) " @ undef")
  339. #endif
  340. #if __LINUX_ARM_ARCH__ >= 7
  341. TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
  342. TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
  343. TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
  344. TEST_UNSUPPORTED(__inst_arm(0xe06f3291) " @ mls pc, r1, r2, r3")
  345. TEST_UNSUPPORTED(__inst_arm(0xe060329f) " @ mls r0, pc, r2, r3")
  346. TEST_UNSUPPORTED(__inst_arm(0xe0603f91) " @ mls r0, r1, pc, r3")
  347. TEST_UNSUPPORTED(__inst_arm(0xe060f291) " @ mls r0, r1, r2, pc")
  348. #endif
  349. TEST_UNSUPPORTED(__inst_arm(0xe0700090) " @ undef")
  350. TEST_UNSUPPORTED(__inst_arm(0xe07fff9f) " @ undef")
  351. TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"")
  352. TEST_RR( "umullls r7, r8, r",9, VAL2,", r",10, VAL1,"")
  353. TEST_R( "umull lr, r12, r",11,VAL3,", r13")
  354. TEST_UNSUPPORTED(__inst_arm(0xe081f392) " @ umull pc, r1, r2, r3")
  355. TEST_UNSUPPORTED(__inst_arm(0xe08f1392) " @ umull r1, pc, r2, r3")
  356. TEST_RR( "umulls r0, r1, r",2, VAL1,", r",3, VAL2,"")
  357. TEST_RR( "umulllss r7, r8, r",9, VAL2,", r",10, VAL1,"")
  358. TEST_R( "umulls lr, r12, r",11,VAL3,", r13")
  359. TEST_UNSUPPORTED(__inst_arm(0xe091f392) " @ umulls pc, r1, r2, r3")
  360. TEST_UNSUPPORTED(__inst_arm(0xe09f1392) " @ umulls r1, pc, r2, r3")
  361. TEST_RRRR( "umlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  362. TEST_RRRR( "umlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  363. TEST_RRR( "umlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  364. TEST_UNSUPPORTED(__inst_arm(0xe0af1392) " @ umlal pc, r1, r2, r3")
  365. TEST_UNSUPPORTED(__inst_arm(0xe0a1f392) " @ umlal r1, pc, r2, r3")
  366. TEST_RRRR( "umlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  367. TEST_RRRR( "umlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  368. TEST_RRR( "umlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  369. TEST_UNSUPPORTED(__inst_arm(0xe0bf1392) " @ umlals pc, r1, r2, r3")
  370. TEST_UNSUPPORTED(__inst_arm(0xe0b1f392) " @ umlals r1, pc, r2, r3")
  371. TEST_RR( "smull r0, r1, r",2, VAL1,", r",3, VAL2,"")
  372. TEST_RR( "smullls r7, r8, r",9, VAL2,", r",10, VAL1,"")
  373. TEST_R( "smull lr, r12, r",11,VAL3,", r13")
  374. TEST_UNSUPPORTED(__inst_arm(0xe0c1f392) " @ smull pc, r1, r2, r3")
  375. TEST_UNSUPPORTED(__inst_arm(0xe0cf1392) " @ smull r1, pc, r2, r3")
  376. TEST_RR( "smulls r0, r1, r",2, VAL1,", r",3, VAL2,"")
  377. TEST_RR( "smulllss r7, r8, r",9, VAL2,", r",10, VAL1,"")
  378. TEST_R( "smulls lr, r12, r",11,VAL3,", r13")
  379. TEST_UNSUPPORTED(__inst_arm(0xe0d1f392) " @ smulls pc, r1, r2, r3")
  380. TEST_UNSUPPORTED(__inst_arm(0xe0df1392) " @ smulls r1, pc, r2, r3")
  381. TEST_RRRR( "smlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  382. TEST_RRRR( "smlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  383. TEST_RRR( "smlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  384. TEST_UNSUPPORTED(__inst_arm(0xe0ef1392) " @ smlal pc, r1, r2, r3")
  385. TEST_UNSUPPORTED(__inst_arm(0xe0e1f392) " @ smlal r1, pc, r2, r3")
  386. TEST_RRRR( "smlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
  387. TEST_RRRR( "smlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
  388. TEST_RRR( "smlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
  389. TEST_UNSUPPORTED(__inst_arm(0xe0ff1392) " @ smlals pc, r1, r2, r3")
  390. TEST_UNSUPPORTED(__inst_arm(0xe0f0f392) " @ smlals r0, pc, r2, r3")
  391. TEST_UNSUPPORTED(__inst_arm(0xe0f0139f) " @ smlals r0, r1, pc, r3")
  392. TEST_UNSUPPORTED(__inst_arm(0xe0f01f92) " @ smlals r0, r1, r2, pc")
  393. TEST_GROUP("Synchronization primitives")
  394. #if __LINUX_ARM_ARCH__ < 6
  395. TEST_RP("swp lr, r",7,VAL2,", [r",8,0,"]")
  396. TEST_R( "swpvs r0, r",1,VAL1,", [sp]")
  397. TEST_RP("swp sp, r",14,VAL2,", [r",12,13*4,"]")
  398. #else
  399. TEST_UNSUPPORTED(__inst_arm(0xe108e097) " @ swp lr, r7, [r8]")
  400. TEST_UNSUPPORTED(__inst_arm(0x610d0091) " @ swpvs r0, r1, [sp]")
  401. TEST_UNSUPPORTED(__inst_arm(0xe10cd09e) " @ swp sp, r14 [r12]")
  402. #endif
  403. TEST_UNSUPPORTED(__inst_arm(0xe102f091) " @ swp pc, r1, [r2]")
  404. TEST_UNSUPPORTED(__inst_arm(0xe102009f) " @ swp r0, pc, [r2]")
  405. TEST_UNSUPPORTED(__inst_arm(0xe10f0091) " @ swp r0, r1, [pc]")
  406. #if __LINUX_ARM_ARCH__ < 6
  407. TEST_RP("swpb lr, r",7,VAL2,", [r",8,0,"]")
  408. TEST_R( "swpvsb r0, r",1,VAL1,", [sp]")
  409. #else
  410. TEST_UNSUPPORTED(__inst_arm(0xe148e097) " @ swpb lr, r7, [r8]")
  411. TEST_UNSUPPORTED(__inst_arm(0x614d0091) " @ swpvsb r0, r1, [sp]")
  412. #endif
  413. TEST_UNSUPPORTED(__inst_arm(0xe142f091) " @ swpb pc, r1, [r2]")
  414. TEST_UNSUPPORTED(__inst_arm(0xe1100090)) /* Unallocated space */
  415. TEST_UNSUPPORTED(__inst_arm(0xe1200090)) /* Unallocated space */
  416. TEST_UNSUPPORTED(__inst_arm(0xe1300090)) /* Unallocated space */
  417. TEST_UNSUPPORTED(__inst_arm(0xe1500090)) /* Unallocated space */
  418. TEST_UNSUPPORTED(__inst_arm(0xe1600090)) /* Unallocated space */
  419. TEST_UNSUPPORTED(__inst_arm(0xe1700090)) /* Unallocated space */
  420. #if __LINUX_ARM_ARCH__ >= 6
  421. TEST_UNSUPPORTED("ldrex r2, [sp]")
  422. #endif
  423. #if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
  424. TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
  425. TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
  426. TEST_UNSUPPORTED("strexb r0, r2, [sp]")
  427. TEST_UNSUPPORTED("ldrexb r2, [sp]")
  428. TEST_UNSUPPORTED("strexh r0, r2, [sp]")
  429. TEST_UNSUPPORTED("ldrexh r2, [sp]")
  430. #endif
  431. TEST_GROUP("Extra load/store instructions")
  432. TEST_RPR( "strh r",0, VAL1,", [r",1, 48,", -r",2, 24,"]")
  433. TEST_RPR( "streqh r",14,VAL2,", [r",11,0, ", r",12, 48,"]")
  434. TEST_UNSUPPORTED( "streqh r14, [r13, r12]")
  435. TEST_UNSUPPORTED( "streqh r14, [r12, r13]")
  436. TEST_RPR( "strh r",1, VAL1,", [r",2, 24,", r",3, 48,"]!")
  437. TEST_RPR( "strneh r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
  438. TEST_RPR( "strh r",2, VAL1,", [r",3, 24,"], r",4, 48,"")
  439. TEST_RPR( "strh r",10,VAL2,", [r",9, 48,"], -r",11,24,"")
  440. TEST_UNSUPPORTED(__inst_arm(0xe1afc0ba) " @ strh r12, [pc, r10]!")
  441. TEST_UNSUPPORTED(__inst_arm(0xe089f0bb) " @ strh pc, [r9], r11")
  442. TEST_UNSUPPORTED(__inst_arm(0xe089a0bf) " @ strh r10, [r9], pc")
  443. TEST_PR( "ldrh r0, [r",0, 48,", -r",2, 24,"]")
  444. TEST_PR( "ldrcsh r14, [r",13,0, ", r",12, 48,"]")
  445. TEST_PR( "ldrh r1, [r",2, 24,", r",3, 48,"]!")
  446. TEST_PR( "ldrcch r12, [r",11,48,", -r",10,24,"]!")
  447. TEST_PR( "ldrh r2, [r",3, 24,"], r",4, 48,"")
  448. TEST_PR( "ldrh r10, [r",9, 48,"], -r",11,24,"")
  449. TEST_UNSUPPORTED(__inst_arm(0xe1bfc0ba) " @ ldrh r12, [pc, r10]!")
  450. TEST_UNSUPPORTED(__inst_arm(0xe099f0bb) " @ ldrh pc, [r9], r11")
  451. TEST_UNSUPPORTED(__inst_arm(0xe099a0bf) " @ ldrh r10, [r9], pc")
  452. TEST_RP( "strh r",0, VAL1,", [r",1, 24,", #-2]")
  453. TEST_RP( "strmih r",14,VAL2,", [r",13,0, ", #2]")
  454. TEST_RP( "strh r",1, VAL1,", [r",2, 24,", #4]!")
  455. TEST_RP( "strplh r",12,VAL2,", [r",11,24,", #-4]!")
  456. TEST_RP( "strh r",2, VAL1,", [r",3, 24,"], #48")
  457. TEST_RP( "strh r",10,VAL2,", [r",9, 64,"], #-48")
  458. TEST_RP( "strh r",3, VAL1,", [r",13,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"]!")
  459. TEST_UNSUPPORTED("strh r3, [r13, #-"__stringify(MAX_STACK_SIZE)"-8]!")
  460. TEST_RP( "strh r",4, VAL1,", [r",14,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"-8]!")
  461. TEST_UNSUPPORTED(__inst_arm(0xe1efc3b0) " @ strh r12, [pc, #48]!")
  462. TEST_UNSUPPORTED(__inst_arm(0xe0c9f3b0) " @ strh pc, [r9], #48")
  463. TEST_P( "ldrh r0, [r",0, 24,", #-2]")
  464. TEST_P( "ldrvsh r14, [r",13,0, ", #2]")
  465. TEST_P( "ldrh r1, [r",2, 24,", #4]!")
  466. TEST_P( "ldrvch r12, [r",11,24,", #-4]!")
  467. TEST_P( "ldrh r2, [r",3, 24,"], #48")
  468. TEST_P( "ldrh r10, [r",9, 64,"], #-48")
  469. TEST( "ldrh r0, [pc, #0]")
  470. TEST_UNSUPPORTED(__inst_arm(0xe1ffc3b0) " @ ldrh r12, [pc, #48]!")
  471. TEST_UNSUPPORTED(__inst_arm(0xe0d9f3b0) " @ ldrh pc, [r9], #48")
  472. TEST_PR( "ldrsb r0, [r",0, 48,", -r",2, 24,"]")
  473. TEST_PR( "ldrhisb r14, [r",13,0,", r",12, 48,"]")
  474. TEST_PR( "ldrsb r1, [r",2, 24,", r",3, 48,"]!")
  475. TEST_PR( "ldrlssb r12, [r",11,48,", -r",10,24,"]!")
  476. TEST_PR( "ldrsb r2, [r",3, 24,"], r",4, 48,"")
  477. TEST_PR( "ldrsb r10, [r",9, 48,"], -r",11,24,"")
  478. TEST_UNSUPPORTED(__inst_arm(0xe1bfc0da) " @ ldrsb r12, [pc, r10]!")
  479. TEST_UNSUPPORTED(__inst_arm(0xe099f0db) " @ ldrsb pc, [r9], r11")
  480. TEST_P( "ldrsb r0, [r",0, 24,", #-1]")
  481. TEST_P( "ldrgesb r14, [r",13,0, ", #1]")
  482. TEST_P( "ldrsb r1, [r",2, 24,", #4]!")
  483. TEST_P( "ldrltsb r12, [r",11,24,", #-4]!")
  484. TEST_P( "ldrsb r2, [r",3, 24,"], #48")
  485. TEST_P( "ldrsb r10, [r",9, 64,"], #-48")
  486. TEST( "ldrsb r0, [pc, #0]")
  487. TEST_UNSUPPORTED(__inst_arm(0xe1ffc3d0) " @ ldrsb r12, [pc, #48]!")
  488. TEST_UNSUPPORTED(__inst_arm(0xe0d9f3d0) " @ ldrsb pc, [r9], #48")
  489. TEST_PR( "ldrsh r0, [r",0, 48,", -r",2, 24,"]")
  490. TEST_PR( "ldrgtsh r14, [r",13,0, ", r",12, 48,"]")
  491. TEST_PR( "ldrsh r1, [r",2, 24,", r",3, 48,"]!")
  492. TEST_PR( "ldrlesh r12, [r",11,48,", -r",10,24,"]!")
  493. TEST_PR( "ldrsh r2, [r",3, 24,"], r",4, 48,"")
  494. TEST_PR( "ldrsh r10, [r",9, 48,"], -r",11,24,"")
  495. TEST_UNSUPPORTED(__inst_arm(0xe1bfc0fa) " @ ldrsh r12, [pc, r10]!")
  496. TEST_UNSUPPORTED(__inst_arm(0xe099f0fb) " @ ldrsh pc, [r9], r11")
  497. TEST_P( "ldrsh r0, [r",0, 24,", #-1]")
  498. TEST_P( "ldreqsh r14, [r",13,0 ,", #1]")
  499. TEST_P( "ldrsh r1, [r",2, 24,", #4]!")
  500. TEST_P( "ldrnesh r12, [r",11,24,", #-4]!")
  501. TEST_P( "ldrsh r2, [r",3, 24,"], #48")
  502. TEST_P( "ldrsh r10, [r",9, 64,"], #-48")
  503. TEST( "ldrsh r0, [pc, #0]")
  504. TEST_UNSUPPORTED(__inst_arm(0xe1ffc3f0) " @ ldrsh r12, [pc, #48]!")
  505. TEST_UNSUPPORTED(__inst_arm(0xe0d9f3f0) " @ ldrsh pc, [r9], #48")
  506. #if __LINUX_ARM_ARCH__ >= 7
  507. TEST_UNSUPPORTED("strht r1, [r2], r3")
  508. TEST_UNSUPPORTED("ldrht r1, [r2], r3")
  509. TEST_UNSUPPORTED("strht r1, [r2], #48")
  510. TEST_UNSUPPORTED("ldrht r1, [r2], #48")
  511. TEST_UNSUPPORTED("ldrsbt r1, [r2], r3")
  512. TEST_UNSUPPORTED("ldrsbt r1, [r2], #48")
  513. TEST_UNSUPPORTED("ldrsht r1, [r2], r3")
  514. TEST_UNSUPPORTED("ldrsht r1, [r2], #48")
  515. #endif
  516. #if __LINUX_ARM_ARCH__ >= 5
  517. TEST_RPR( "strd r",0, VAL1,", [r",1, 48,", -r",2,24,"]")
  518. TEST_RPR( "strccd r",8, VAL2,", [r",11,0, ", r",12,48,"]")
  519. TEST_UNSUPPORTED( "strccd r8, [r13, r12]")
  520. TEST_UNSUPPORTED( "strccd r8, [r12, r13]")
  521. TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!")
  522. TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
  523. TEST_RPR( "strd r",2, VAL1,", [r",5, 24,"], r",4,48,"")
  524. TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"")
  525. TEST_UNSUPPORTED(__inst_arm(0xe1afc0fa) " @ strd r12, [pc, r10]!")
  526. TEST_PR( "ldrd r0, [r",0, 48,", -r",2,24,"]")
  527. TEST_PR( "ldrmid r8, [r",13,0, ", r",12,48,"]")
  528. TEST_PR( "ldrd r4, [r",2, 24,", r",3, 48,"]!")
  529. TEST_PR( "ldrpld r6, [r",11,48,", -r",10,24,"]!")
  530. TEST_PR( "ldrd r2, [r",5, 24,"], r",4,48,"")
  531. TEST_PR( "ldrd r10, [r",9,48,"], -r",7,24,"")
  532. TEST_UNSUPPORTED(__inst_arm(0xe1afc0da) " @ ldrd r12, [pc, r10]!")
  533. TEST_UNSUPPORTED(__inst_arm(0xe089f0db) " @ ldrd pc, [r9], r11")
  534. TEST_UNSUPPORTED(__inst_arm(0xe089e0db) " @ ldrd lr, [r9], r11")
  535. TEST_UNSUPPORTED(__inst_arm(0xe089c0df) " @ ldrd r12, [r9], pc")
  536. TEST_RP( "strd r",0, VAL1,", [r",1, 24,", #-8]")
  537. TEST_RP( "strvsd r",8, VAL2,", [r",13,0, ", #8]")
  538. TEST_RP( "strd r",4, VAL1,", [r",2, 24,", #16]!")
  539. TEST_RP( "strvcd r",12,VAL2,", [r",11,24,", #-16]!")
  540. TEST_RP( "strd r",2, VAL1,", [r",4, 24,"], #48")
  541. TEST_RP( "strd r",10,VAL2,", [r",9, 64,"], #-48")
  542. TEST_RP( "strd r",6, VAL1,", [r",13,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"]!")
  543. TEST_UNSUPPORTED("strd r6, [r13, #-"__stringify(MAX_STACK_SIZE)"-8]!")
  544. TEST_RP( "strd r",4, VAL1,", [r",12,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"-8]!")
  545. TEST_UNSUPPORTED(__inst_arm(0xe1efc3f0) " @ strd r12, [pc, #48]!")
  546. TEST_P( "ldrd r0, [r",0, 24,", #-8]")
  547. TEST_P( "ldrhid r8, [r",13,0, ", #8]")
  548. TEST_P( "ldrd r4, [r",2, 24,", #16]!")
  549. TEST_P( "ldrlsd r6, [r",11,24,", #-16]!")
  550. TEST_P( "ldrd r2, [r",5, 24,"], #48")
  551. TEST_P( "ldrd r10, [r",9,6,"], #-48")
  552. TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!")
  553. TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48")
  554. TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48")
  555. #endif
  556. TEST_GROUP("Miscellaneous")
  557. #if __LINUX_ARM_ARCH__ >= 7
  558. TEST("movw r0, #0")
  559. TEST("movw r0, #0xffff")
  560. TEST("movw lr, #0xffff")
  561. TEST_UNSUPPORTED(__inst_arm(0xe300f000) " @ movw pc, #0")
  562. TEST_R("movt r",0, VAL1,", #0")
  563. TEST_R("movt r",0, VAL2,", #0xffff")
  564. TEST_R("movt r",14,VAL1,", #0xffff")
  565. TEST_UNSUPPORTED(__inst_arm(0xe340f000) " @ movt pc, #0")
  566. #endif
  567. TEST_UNSUPPORTED("msr cpsr, 0x13")
  568. TEST_UNSUPPORTED("msr cpsr_f, 0xf0000000")
  569. TEST_UNSUPPORTED("msr spsr, 0x13")
  570. #if __LINUX_ARM_ARCH__ >= 7
  571. TEST_SUPPORTED("yield")
  572. TEST("sev")
  573. TEST("nop")
  574. TEST("wfi")
  575. TEST_SUPPORTED("wfe")
  576. TEST_UNSUPPORTED("dbg #0")
  577. #endif
  578. TEST_GROUP("Load/store word and unsigned byte")
  579. #define LOAD_STORE(byte) \
  580. TEST_RP( "str"byte" r",0, VAL1,", [r",1, 24,", #-2]") \
  581. TEST_RP( "str"byte" r",14,VAL2,", [r",13,0, ", #2]") \
  582. TEST_RP( "str"byte" r",1, VAL1,", [r",2, 24,", #4]!") \
  583. TEST_RP( "str"byte" r",12,VAL2,", [r",11,24,", #-4]!") \
  584. TEST_RP( "str"byte" r",2, VAL1,", [r",3, 24,"], #48") \
  585. TEST_RP( "str"byte" r",10,VAL2,", [r",9, 64,"], #-48") \
  586. TEST_RP( "str"byte" r",3, VAL1,", [r",13,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"]!") \
  587. TEST_UNSUPPORTED("str"byte" r3, [r13, #-"__stringify(MAX_STACK_SIZE)"-8]!") \
  588. TEST_RP( "str"byte" r",4, VAL1,", [r",10,TEST_MEMORY_SIZE,", #-"__stringify(MAX_STACK_SIZE)"-8]!") \
  589. TEST_RPR("str"byte" r",0, VAL1,", [r",1, 48,", -r",2, 24,"]") \
  590. TEST_RPR("str"byte" r",14,VAL2,", [r",11,0, ", r",12, 48,"]") \
  591. TEST_UNSUPPORTED("str"byte" r14, [r13, r12]") \
  592. TEST_UNSUPPORTED("str"byte" r14, [r12, r13]") \
  593. TEST_RPR("str"byte" r",1, VAL1,", [r",2, 24,", r",3, 48,"]!") \
  594. TEST_RPR("str"byte" r",12,VAL2,", [r",11,48,", -r",10,24,"]!") \
  595. TEST_RPR("str"byte" r",2, VAL1,", [r",3, 24,"], r",4, 48,"") \
  596. TEST_RPR("str"byte" r",10,VAL2,", [r",9, 48,"], -r",11,24,"") \
  597. TEST_RPR("str"byte" r",0, VAL1,", [r",1, 24,", r",2, 32,", asl #1]")\
  598. TEST_RPR("str"byte" r",14,VAL2,", [r",11,0, ", r",12, 32,", lsr #2]")\
  599. TEST_UNSUPPORTED("str"byte" r14, [r13, r12, lsr #2]") \
  600. TEST_RPR("str"byte" r",1, VAL1,", [r",2, 24,", r",3, 32,", asr #3]!")\
  601. TEST_RPR("str"byte" r",12,VAL2,", [r",11,24,", r",10, 4,", ror #31]!")\
  602. TEST_P( "ldr"byte" r0, [r",0, 24,", #-2]") \
  603. TEST_P( "ldr"byte" r14, [r",13,0, ", #2]") \
  604. TEST_P( "ldr"byte" r1, [r",2, 24,", #4]!") \
  605. TEST_P( "ldr"byte" r12, [r",11,24,", #-4]!") \
  606. TEST_P( "ldr"byte" r2, [r",3, 24,"], #48") \
  607. TEST_P( "ldr"byte" r10, [r",9, 64,"], #-48") \
  608. TEST_PR( "ldr"byte" r0, [r",0, 48,", -r",2, 24,"]") \
  609. TEST_PR( "ldr"byte" r14, [r",13,0, ", r",12, 48,"]") \
  610. TEST_PR( "ldr"byte" r1, [r",2, 24,", r",3, 48,"]!") \
  611. TEST_PR( "ldr"byte" r12, [r",11,48,", -r",10,24,"]!") \
  612. TEST_PR( "ldr"byte" r2, [r",3, 24,"], r",4, 48,"") \
  613. TEST_PR( "ldr"byte" r10, [r",9, 48,"], -r",11,24,"") \
  614. TEST_PR( "ldr"byte" r0, [r",0, 24,", r",2, 32,", asl #1]") \
  615. TEST_PR( "ldr"byte" r14, [r",13,0, ", r",12, 32,", lsr #2]") \
  616. TEST_PR( "ldr"byte" r1, [r",2, 24,", r",3, 32,", asr #3]!") \
  617. TEST_PR( "ldr"byte" r12, [r",11,24,", r",10, 4,", ror #31]!") \
  618. TEST( "ldr"byte" r0, [pc, #0]") \
  619. TEST_R( "ldr"byte" r12, [pc, r",14,0,"]")
  620. LOAD_STORE("")
  621. TEST_P( "str pc, [r",0,0,", #15*4]")
  622. TEST_UNSUPPORTED( "str pc, [sp, r2]")
  623. TEST_BF( "ldr pc, [sp, #15*4]")
  624. TEST_BF_R("ldr pc, [sp, r",2,15*4,"]")
  625. TEST_P( "str sp, [r",0,0,", #13*4]")
  626. TEST_UNSUPPORTED( "str sp, [sp, r2]")
  627. TEST_BF( "ldr sp, [sp, #13*4]")
  628. TEST_BF_R("ldr sp, [sp, r",2,13*4,"]")
  629. #ifdef CONFIG_THUMB2_KERNEL
  630. TEST_ARM_TO_THUMB_INTERWORK_P("ldr pc, [r",0,0,", #15*4]")
  631. #endif
  632. TEST_UNSUPPORTED(__inst_arm(0xe5af6008) " @ str r6, [pc, #8]!")
  633. TEST_UNSUPPORTED(__inst_arm(0xe7af6008) " @ str r6, [pc, r8]!")
  634. TEST_UNSUPPORTED(__inst_arm(0xe5bf6008) " @ ldr r6, [pc, #8]!")
  635. TEST_UNSUPPORTED(__inst_arm(0xe7bf6008) " @ ldr r6, [pc, r8]!")
  636. TEST_UNSUPPORTED(__inst_arm(0xe788600f) " @ str r6, [r8, pc]")
  637. TEST_UNSUPPORTED(__inst_arm(0xe798600f) " @ ldr r6, [r8, pc]")
  638. LOAD_STORE("b")
  639. TEST_UNSUPPORTED(__inst_arm(0xe5f7f008) " @ ldrb pc, [r7, #8]!")
  640. TEST_UNSUPPORTED(__inst_arm(0xe7f7f008) " @ ldrb pc, [r7, r8]!")
  641. TEST_UNSUPPORTED(__inst_arm(0xe5ef6008) " @ strb r6, [pc, #8]!")
  642. TEST_UNSUPPORTED(__inst_arm(0xe7ef6008) " @ strb r6, [pc, r3]!")
  643. TEST_UNSUPPORTED(__inst_arm(0xe5ff6008) " @ ldrb r6, [pc, #8]!")
  644. TEST_UNSUPPORTED(__inst_arm(0xe7ff6008) " @ ldrb r6, [pc, r3]!")
  645. TEST_UNSUPPORTED("ldrt r0, [r1], #4")
  646. TEST_UNSUPPORTED("ldrt r1, [r2], r3")
  647. TEST_UNSUPPORTED("strt r2, [r3], #4")
  648. TEST_UNSUPPORTED("strt r3, [r4], r5")
  649. TEST_UNSUPPORTED("ldrbt r4, [r5], #4")
  650. TEST_UNSUPPORTED("ldrbt r5, [r6], r7")
  651. TEST_UNSUPPORTED("strbt r6, [r7], #4")
  652. TEST_UNSUPPORTED("strbt r7, [r8], r9")
  653. #if __LINUX_ARM_ARCH__ >= 7
  654. TEST_GROUP("Parallel addition and subtraction, signed")
  655. TEST_UNSUPPORTED(__inst_arm(0xe6000010) "") /* Unallocated space */
  656. TEST_UNSUPPORTED(__inst_arm(0xe60fffff) "") /* Unallocated space */
  657. TEST_RR( "sadd16 r0, r",0, HH1,", r",1, HH2,"")
  658. TEST_RR( "sadd16 r14, r",12,HH2,", r",10,HH1,"")
  659. TEST_UNSUPPORTED(__inst_arm(0xe61cff1a) " @ sadd16 pc, r12, r10")
  660. TEST_RR( "sasx r0, r",0, HH1,", r",1, HH2,"")
  661. TEST_RR( "sasx r14, r",12,HH2,", r",10,HH1,"")
  662. TEST_UNSUPPORTED(__inst_arm(0xe61cff3a) " @ sasx pc, r12, r10")
  663. TEST_RR( "ssax r0, r",0, HH1,", r",1, HH2,"")
  664. TEST_RR( "ssax r14, r",12,HH2,", r",10,HH1,"")
  665. TEST_UNSUPPORTED(__inst_arm(0xe61cff5a) " @ ssax pc, r12, r10")
  666. TEST_RR( "ssub16 r0, r",0, HH1,", r",1, HH2,"")
  667. TEST_RR( "ssub16 r14, r",12,HH2,", r",10,HH1,"")
  668. TEST_UNSUPPORTED(__inst_arm(0xe61cff7a) " @ ssub16 pc, r12, r10")
  669. TEST_RR( "sadd8 r0, r",0, HH1,", r",1, HH2,"")
  670. TEST_RR( "sadd8 r14, r",12,HH2,", r",10,HH1,"")
  671. TEST_UNSUPPORTED(__inst_arm(0xe61cff9a) " @ sadd8 pc, r12, r10")
  672. TEST_UNSUPPORTED(__inst_arm(0xe61000b0) "") /* Unallocated space */
  673. TEST_UNSUPPORTED(__inst_arm(0xe61fffbf) "") /* Unallocated space */
  674. TEST_UNSUPPORTED(__inst_arm(0xe61000d0) "") /* Unallocated space */
  675. TEST_UNSUPPORTED(__inst_arm(0xe61fffdf) "") /* Unallocated space */
  676. TEST_RR( "ssub8 r0, r",0, HH1,", r",1, HH2,"")
  677. TEST_RR( "ssub8 r14, r",12,HH2,", r",10,HH1,"")
  678. TEST_UNSUPPORTED(__inst_arm(0xe61cfffa) " @ ssub8 pc, r12, r10")
  679. TEST_RR( "qadd16 r0, r",0, HH1,", r",1, HH2,"")
  680. TEST_RR( "qadd16 r14, r",12,HH2,", r",10,HH1,"")
  681. TEST_UNSUPPORTED(__inst_arm(0xe62cff1a) " @ qadd16 pc, r12, r10")
  682. TEST_RR( "qasx r0, r",0, HH1,", r",1, HH2,"")
  683. TEST_RR( "qasx r14, r",12,HH2,", r",10,HH1,"")
  684. TEST_UNSUPPORTED(__inst_arm(0xe62cff3a) " @ qasx pc, r12, r10")
  685. TEST_RR( "qsax r0, r",0, HH1,", r",1, HH2,"")
  686. TEST_RR( "qsax r14, r",12,HH2,", r",10,HH1,"")
  687. TEST_UNSUPPORTED(__inst_arm(0xe62cff5a) " @ qsax pc, r12, r10")
  688. TEST_RR( "qsub16 r0, r",0, HH1,", r",1, HH2,"")
  689. TEST_RR( "qsub16 r14, r",12,HH2,", r",10,HH1,"")
  690. TEST_UNSUPPORTED(__inst_arm(0xe62cff7a) " @ qsub16 pc, r12, r10")
  691. TEST_RR( "qadd8 r0, r",0, HH1,", r",1, HH2,"")
  692. TEST_RR( "qadd8 r14, r",12,HH2,", r",10,HH1,"")
  693. TEST_UNSUPPORTED(__inst_arm(0xe62cff9a) " @ qadd8 pc, r12, r10")
  694. TEST_UNSUPPORTED(__inst_arm(0xe62000b0) "") /* Unallocated space */
  695. TEST_UNSUPPORTED(__inst_arm(0xe62fffbf) "") /* Unallocated space */
  696. TEST_UNSUPPORTED(__inst_arm(0xe62000d0) "") /* Unallocated space */
  697. TEST_UNSUPPORTED(__inst_arm(0xe62fffdf) "") /* Unallocated space */
  698. TEST_RR( "qsub8 r0, r",0, HH1,", r",1, HH2,"")
  699. TEST_RR( "qsub8 r14, r",12,HH2,", r",10,HH1,"")
  700. TEST_UNSUPPORTED(__inst_arm(0xe62cfffa) " @ qsub8 pc, r12, r10")
  701. TEST_RR( "shadd16 r0, r",0, HH1,", r",1, HH2,"")
  702. TEST_RR( "shadd16 r14, r",12,HH2,", r",10,HH1,"")
  703. TEST_UNSUPPORTED(__inst_arm(0xe63cff1a) " @ shadd16 pc, r12, r10")
  704. TEST_RR( "shasx r0, r",0, HH1,", r",1, HH2,"")
  705. TEST_RR( "shasx r14, r",12,HH2,", r",10,HH1,"")
  706. TEST_UNSUPPORTED(__inst_arm(0xe63cff3a) " @ shasx pc, r12, r10")
  707. TEST_RR( "shsax r0, r",0, HH1,", r",1, HH2,"")
  708. TEST_RR( "shsax r14, r",12,HH2,", r",10,HH1,"")
  709. TEST_UNSUPPORTED(__inst_arm(0xe63cff5a) " @ shsax pc, r12, r10")
  710. TEST_RR( "shsub16 r0, r",0, HH1,", r",1, HH2,"")
  711. TEST_RR( "shsub16 r14, r",12,HH2,", r",10,HH1,"")
  712. TEST_UNSUPPORTED(__inst_arm(0xe63cff7a) " @ shsub16 pc, r12, r10")
  713. TEST_RR( "shadd8 r0, r",0, HH1,", r",1, HH2,"")
  714. TEST_RR( "shadd8 r14, r",12,HH2,", r",10,HH1,"")
  715. TEST_UNSUPPORTED(__inst_arm(0xe63cff9a) " @ shadd8 pc, r12, r10")
  716. TEST_UNSUPPORTED(__inst_arm(0xe63000b0) "") /* Unallocated space */
  717. TEST_UNSUPPORTED(__inst_arm(0xe63fffbf) "") /* Unallocated space */
  718. TEST_UNSUPPORTED(__inst_arm(0xe63000d0) "") /* Unallocated space */
  719. TEST_UNSUPPORTED(__inst_arm(0xe63fffdf) "") /* Unallocated space */
  720. TEST_RR( "shsub8 r0, r",0, HH1,", r",1, HH2,"")
  721. TEST_RR( "shsub8 r14, r",12,HH2,", r",10,HH1,"")
  722. TEST_UNSUPPORTED(__inst_arm(0xe63cfffa) " @ shsub8 pc, r12, r10")
  723. TEST_GROUP("Parallel addition and subtraction, unsigned")
  724. TEST_UNSUPPORTED(__inst_arm(0xe6400010) "") /* Unallocated space */
  725. TEST_UNSUPPORTED(__inst_arm(0xe64fffff) "") /* Unallocated space */
  726. TEST_RR( "uadd16 r0, r",0, HH1,", r",1, HH2,"")
  727. TEST_RR( "uadd16 r14, r",12,HH2,", r",10,HH1,"")
  728. TEST_UNSUPPORTED(__inst_arm(0xe65cff1a) " @ uadd16 pc, r12, r10")
  729. TEST_RR( "uasx r0, r",0, HH1,", r",1, HH2,"")
  730. TEST_RR( "uasx r14, r",12,HH2,", r",10,HH1,"")
  731. TEST_UNSUPPORTED(__inst_arm(0xe65cff3a) " @ uasx pc, r12, r10")
  732. TEST_RR( "usax r0, r",0, HH1,", r",1, HH2,"")
  733. TEST_RR( "usax r14, r",12,HH2,", r",10,HH1,"")
  734. TEST_UNSUPPORTED(__inst_arm(0xe65cff5a) " @ usax pc, r12, r10")
  735. TEST_RR( "usub16 r0, r",0, HH1,", r",1, HH2,"")
  736. TEST_RR( "usub16 r14, r",12,HH2,", r",10,HH1,"")
  737. TEST_UNSUPPORTED(__inst_arm(0xe65cff7a) " @ usub16 pc, r12, r10")
  738. TEST_RR( "uadd8 r0, r",0, HH1,", r",1, HH2,"")
  739. TEST_RR( "uadd8 r14, r",12,HH2,", r",10,HH1,"")
  740. TEST_UNSUPPORTED(__inst_arm(0xe65cff9a) " @ uadd8 pc, r12, r10")
  741. TEST_UNSUPPORTED(__inst_arm(0xe65000b0) "") /* Unallocated space */
  742. TEST_UNSUPPORTED(__inst_arm(0xe65fffbf) "") /* Unallocated space */
  743. TEST_UNSUPPORTED(__inst_arm(0xe65000d0) "") /* Unallocated space */
  744. TEST_UNSUPPORTED(__inst_arm(0xe65fffdf) "") /* Unallocated space */
  745. TEST_RR( "usub8 r0, r",0, HH1,", r",1, HH2,"")
  746. TEST_RR( "usub8 r14, r",12,HH2,", r",10,HH1,"")
  747. TEST_UNSUPPORTED(__inst_arm(0xe65cfffa) " @ usub8 pc, r12, r10")
  748. TEST_RR( "uqadd16 r0, r",0, HH1,", r",1, HH2,"")
  749. TEST_RR( "uqadd16 r14, r",12,HH2,", r",10,HH1,"")
  750. TEST_UNSUPPORTED(__inst_arm(0xe66cff1a) " @ uqadd16 pc, r12, r10")
  751. TEST_RR( "uqasx r0, r",0, HH1,", r",1, HH2,"")
  752. TEST_RR( "uqasx r14, r",12,HH2,", r",10,HH1,"")
  753. TEST_UNSUPPORTED(__inst_arm(0xe66cff3a) " @ uqasx pc, r12, r10")
  754. TEST_RR( "uqsax r0, r",0, HH1,", r",1, HH2,"")
  755. TEST_RR( "uqsax r14, r",12,HH2,", r",10,HH1,"")
  756. TEST_UNSUPPORTED(__inst_arm(0xe66cff5a) " @ uqsax pc, r12, r10")
  757. TEST_RR( "uqsub16 r0, r",0, HH1,", r",1, HH2,"")
  758. TEST_RR( "uqsub16 r14, r",12,HH2,", r",10,HH1,"")
  759. TEST_UNSUPPORTED(__inst_arm(0xe66cff7a) " @ uqsub16 pc, r12, r10")
  760. TEST_RR( "uqadd8 r0, r",0, HH1,", r",1, HH2,"")
  761. TEST_RR( "uqadd8 r14, r",12,HH2,", r",10,HH1,"")
  762. TEST_UNSUPPORTED(__inst_arm(0xe66cff9a) " @ uqadd8 pc, r12, r10")
  763. TEST_UNSUPPORTED(__inst_arm(0xe66000b0) "") /* Unallocated space */
  764. TEST_UNSUPPORTED(__inst_arm(0xe66fffbf) "") /* Unallocated space */
  765. TEST_UNSUPPORTED(__inst_arm(0xe66000d0) "") /* Unallocated space */
  766. TEST_UNSUPPORTED(__inst_arm(0xe66fffdf) "") /* Unallocated space */
  767. TEST_RR( "uqsub8 r0, r",0, HH1,", r",1, HH2,"")
  768. TEST_RR( "uqsub8 r14, r",12,HH2,", r",10,HH1,"")
  769. TEST_UNSUPPORTED(__inst_arm(0xe66cfffa) " @ uqsub8 pc, r12, r10")
  770. TEST_RR( "uhadd16 r0, r",0, HH1,", r",1, HH2,"")
  771. TEST_RR( "uhadd16 r14, r",12,HH2,", r",10,HH1,"")
  772. TEST_UNSUPPORTED(__inst_arm(0xe67cff1a) " @ uhadd16 pc, r12, r10")
  773. TEST_RR( "uhasx r0, r",0, HH1,", r",1, HH2,"")
  774. TEST_RR( "uhasx r14, r",12,HH2,", r",10,HH1,"")
  775. TEST_UNSUPPORTED(__inst_arm(0xe67cff3a) " @ uhasx pc, r12, r10")
  776. TEST_RR( "uhsax r0, r",0, HH1,", r",1, HH2,"")
  777. TEST_RR( "uhsax r14, r",12,HH2,", r",10,HH1,"")
  778. TEST_UNSUPPORTED(__inst_arm(0xe67cff5a) " @ uhsax pc, r12, r10")
  779. TEST_RR( "uhsub16 r0, r",0, HH1,", r",1, HH2,"")
  780. TEST_RR( "uhsub16 r14, r",12,HH2,", r",10,HH1,"")
  781. TEST_UNSUPPORTED(__inst_arm(0xe67cff7a) " @ uhsub16 pc, r12, r10")
  782. TEST_RR( "uhadd8 r0, r",0, HH1,", r",1, HH2,"")
  783. TEST_RR( "uhadd8 r14, r",12,HH2,", r",10,HH1,"")
  784. TEST_UNSUPPORTED(__inst_arm(0xe67cff9a) " @ uhadd8 pc, r12, r10")
  785. TEST_UNSUPPORTED(__inst_arm(0xe67000b0) "") /* Unallocated space */
  786. TEST_UNSUPPORTED(__inst_arm(0xe67fffbf) "") /* Unallocated space */
  787. TEST_UNSUPPORTED(__inst_arm(0xe67000d0) "") /* Unallocated space */
  788. TEST_UNSUPPORTED(__inst_arm(0xe67fffdf) "") /* Unallocated space */
  789. TEST_RR( "uhsub8 r0, r",0, HH1,", r",1, HH2,"")
  790. TEST_RR( "uhsub8 r14, r",12,HH2,", r",10,HH1,"")
  791. TEST_UNSUPPORTED(__inst_arm(0xe67cfffa) " @ uhsub8 pc, r12, r10")
  792. TEST_UNSUPPORTED(__inst_arm(0xe67feffa) " @ uhsub8 r14, pc, r10")
  793. TEST_UNSUPPORTED(__inst_arm(0xe67cefff) " @ uhsub8 r14, r12, pc")
  794. #endif /* __LINUX_ARM_ARCH__ >= 7 */
  795. #if __LINUX_ARM_ARCH__ >= 6
  796. TEST_GROUP("Packing, unpacking, saturation, and reversal")
  797. TEST_RR( "pkhbt r0, r",0, HH1,", r",1, HH2,"")
  798. TEST_RR( "pkhbt r14,r",12, HH1,", r",10,HH2,", lsl #2")
  799. TEST_UNSUPPORTED(__inst_arm(0xe68cf11a) " @ pkhbt pc, r12, r10, lsl #2")
  800. TEST_RR( "pkhtb r0, r",0, HH1,", r",1, HH2,"")
  801. TEST_RR( "pkhtb r14,r",12, HH1,", r",10,HH2,", asr #2")
  802. TEST_UNSUPPORTED(__inst_arm(0xe68cf15a) " @ pkhtb pc, r12, r10, asr #2")
  803. TEST_UNSUPPORTED(__inst_arm(0xe68fe15a) " @ pkhtb r14, pc, r10, asr #2")
  804. TEST_UNSUPPORTED(__inst_arm(0xe68ce15f) " @ pkhtb r14, r12, pc, asr #2")
  805. TEST_UNSUPPORTED(__inst_arm(0xe6900010) "") /* Unallocated space */
  806. TEST_UNSUPPORTED(__inst_arm(0xe69fffdf) "") /* Unallocated space */
  807. TEST_R( "ssat r0, #24, r",0, VAL1,"")
  808. TEST_R( "ssat r14, #24, r",12, VAL2,"")
  809. TEST_R( "ssat r0, #24, r",0, VAL1,", lsl #8")
  810. TEST_R( "ssat r14, #24, r",12, VAL2,", asr #8")
  811. TEST_UNSUPPORTED(__inst_arm(0xe6b7f01c) " @ ssat pc, #24, r12")
  812. TEST_R( "usat r0, #24, r",0, VAL1,"")
  813. TEST_R( "usat r14, #24, r",12, VAL2,"")
  814. TEST_R( "usat r0, #24, r",0, VAL1,", lsl #8")
  815. TEST_R( "usat r14, #24, r",12, VAL2,", asr #8")
  816. TEST_UNSUPPORTED(__inst_arm(0xe6f7f01c) " @ usat pc, #24, r12")
  817. TEST_RR( "sxtab16 r0, r",0, HH1,", r",1, HH2,"")
  818. TEST_RR( "sxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8")
  819. TEST_R( "sxtb16 r8, r",7, HH1,"")
  820. TEST_UNSUPPORTED(__inst_arm(0xe68cf47a) " @ sxtab16 pc,r12, r10, ror #8")
  821. TEST_RR( "sel r0, r",0, VAL1,", r",1, VAL2,"")
  822. TEST_RR( "sel r14, r",12,VAL1,", r",10, VAL2,"")
  823. TEST_UNSUPPORTED(__inst_arm(0xe68cffba) " @ sel pc, r12, r10")
  824. TEST_UNSUPPORTED(__inst_arm(0xe68fefba) " @ sel r14, pc, r10")
  825. TEST_UNSUPPORTED(__inst_arm(0xe68cefbf) " @ sel r14, r12, pc")
  826. TEST_R( "ssat16 r0, #12, r",0, HH1,"")
  827. TEST_R( "ssat16 r14, #12, r",12, HH2,"")
  828. TEST_UNSUPPORTED(__inst_arm(0xe6abff3c) " @ ssat16 pc, #12, r12")
  829. TEST_RR( "sxtab r0, r",0, HH1,", r",1, HH2,"")
  830. TEST_RR( "sxtab r14,r",12, HH2,", r",10,HH1,", ror #8")
  831. TEST_R( "sxtb r8, r",7, HH1,"")
  832. TEST_UNSUPPORTED(__inst_arm(0xe6acf47a) " @ sxtab pc,r12, r10, ror #8")
  833. TEST_R( "rev r0, r",0, VAL1,"")
  834. TEST_R( "rev r14, r",12, VAL2,"")
  835. TEST_UNSUPPORTED(__inst_arm(0xe6bfff3c) " @ rev pc, r12")
  836. TEST_RR( "sxtah r0, r",0, HH1,", r",1, HH2,"")
  837. TEST_RR( "sxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
  838. TEST_R( "sxth r8, r",7, HH1,"")
  839. TEST_UNSUPPORTED(__inst_arm(0xe6bcf47a) " @ sxtah pc,r12, r10, ror #8")
  840. TEST_R( "rev16 r0, r",0, VAL1,"")
  841. TEST_R( "rev16 r14, r",12, VAL2,"")
  842. TEST_UNSUPPORTED(__inst_arm(0xe6bfffbc) " @ rev16 pc, r12")
  843. TEST_RR( "uxtab16 r0, r",0, HH1,", r",1, HH2,"")
  844. TEST_RR( "uxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8")
  845. TEST_R( "uxtb16 r8, r",7, HH1,"")
  846. TEST_UNSUPPORTED(__inst_arm(0xe6ccf47a) " @ uxtab16 pc,r12, r10, ror #8")
  847. TEST_R( "usat16 r0, #12, r",0, HH1,"")
  848. TEST_R( "usat16 r14, #12, r",12, HH2,"")
  849. TEST_UNSUPPORTED(__inst_arm(0xe6ecff3c) " @ usat16 pc, #12, r12")
  850. TEST_UNSUPPORTED(__inst_arm(0xe6ecef3f) " @ usat16 r14, #12, pc")
  851. TEST_RR( "uxtab r0, r",0, HH1,", r",1, HH2,"")
  852. TEST_RR( "uxtab r14,r",12, HH2,", r",10,HH1,", ror #8")
  853. TEST_R( "uxtb r8, r",7, HH1,"")
  854. TEST_UNSUPPORTED(__inst_arm(0xe6ecf47a) " @ uxtab pc,r12, r10, ror #8")
  855. #if __LINUX_ARM_ARCH__ >= 7
  856. TEST_R( "rbit r0, r",0, VAL1,"")
  857. TEST_R( "rbit r14, r",12, VAL2,"")
  858. TEST_UNSUPPORTED(__inst_arm(0xe6ffff3c) " @ rbit pc, r12")
  859. #endif
  860. TEST_RR( "uxtah r0, r",0, HH1,", r",1, HH2,"")
  861. TEST_RR( "uxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
  862. TEST_R( "uxth r8, r",7, HH1,"")
  863. TEST_UNSUPPORTED(__inst_arm(0xe6fff077) " @ uxth pc, r7")
  864. TEST_UNSUPPORTED(__inst_arm(0xe6ff807f) " @ uxth r8, pc")
  865. TEST_UNSUPPORTED(__inst_arm(0xe6fcf47a) " @ uxtah pc, r12, r10, ror #8")
  866. TEST_UNSUPPORTED(__inst_arm(0xe6fce47f) " @ uxtah r14, r12, pc, ror #8")
  867. TEST_R( "revsh r0, r",0, VAL1,"")
  868. TEST_R( "revsh r14, r",12, VAL2,"")
  869. TEST_UNSUPPORTED(__inst_arm(0xe6ffff3c) " @ revsh pc, r12")
  870. TEST_UNSUPPORTED(__inst_arm(0xe6ffef3f) " @ revsh r14, pc")
  871. TEST_UNSUPPORTED(__inst_arm(0xe6900070) "") /* Unallocated space */
  872. TEST_UNSUPPORTED(__inst_arm(0xe69fff7f) "") /* Unallocated space */
  873. TEST_UNSUPPORTED(__inst_arm(0xe6d00070) "") /* Unallocated space */
  874. TEST_UNSUPPORTED(__inst_arm(0xe6dfff7f) "") /* Unallocated space */
  875. #endif /* __LINUX_ARM_ARCH__ >= 6 */
  876. #if __LINUX_ARM_ARCH__ >= 6
  877. TEST_GROUP("Signed multiplies")
  878. TEST_RRR( "smlad r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
  879. TEST_RRR( "smlad r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
  880. TEST_UNSUPPORTED(__inst_arm(0xe70f8a1c) " @ smlad pc, r12, r10, r8")
  881. TEST_RRR( "smladx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
  882. TEST_RRR( "smladx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
  883. TEST_UNSUPPORTED(__inst_arm(0xe70f8a3c) " @ smladx pc, r12, r10, r8")
  884. TEST_RR( "smuad r0, r",0, HH1,", r",1, HH2,"")
  885. TEST_RR( "smuad r14, r",12,HH2,", r",10,HH1,"")
  886. TEST_UNSUPPORTED(__inst_arm(0xe70ffa1c) " @ smuad pc, r12, r10")
  887. TEST_RR( "smuadx r0, r",0, HH1,", r",1, HH2,"")
  888. TEST_RR( "smuadx r14, r",12,HH2,", r",10,HH1,"")
  889. TEST_UNSUPPORTED(__inst_arm(0xe70ffa3c) " @ smuadx pc, r12, r10")
  890. TEST_RRR( "smlsd r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
  891. TEST_RRR( "smlsd r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
  892. TEST_UNSUPPORTED(__inst_arm(0xe70f8a5c) " @ smlsd pc, r12, r10, r8")
  893. TEST_RRR( "smlsdx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
  894. TEST_RRR( "smlsdx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
  895. TEST_UNSUPPORTED(__inst_arm(0xe70f8a7c) " @ smlsdx pc, r12, r10, r8")
  896. TEST_RR( "smusd r0, r",0, HH1,", r",1, HH2,"")
  897. TEST_RR( "smusd r14, r",12,HH2,", r",10,HH1,"")
  898. TEST_UNSUPPORTED(__inst_arm(0xe70ffa5c) " @ smusd pc, r12, r10")
  899. TEST_RR( "smusdx r0, r",0, HH1,", r",1, HH2,"")
  900. TEST_RR( "smusdx r14, r",12,HH2,", r",10,HH1,"")
  901. TEST_UNSUPPORTED(__inst_arm(0xe70ffa7c) " @ smusdx pc, r12, r10")
  902. TEST_RRRR( "smlald r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
  903. TEST_RRRR( "smlald r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
  904. TEST_UNSUPPORTED(__inst_arm(0xe74af819) " @ smlald pc, r10, r9, r8")
  905. TEST_UNSUPPORTED(__inst_arm(0xe74fb819) " @ smlald r11, pc, r9, r8")
  906. TEST_UNSUPPORTED(__inst_arm(0xe74ab81f) " @ smlald r11, r10, pc, r8")
  907. TEST_UNSUPPORTED(__inst_arm(0xe74abf19) " @ smlald r11, r10, r9, pc")
  908. TEST_RRRR( "smlaldx r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
  909. TEST_RRRR( "smlaldx r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
  910. TEST_UNSUPPORTED(__inst_arm(0xe74af839) " @ smlaldx pc, r10, r9, r8")
  911. TEST_UNSUPPORTED(__inst_arm(0xe74fb839) " @ smlaldx r11, pc, r9, r8")
  912. TEST_RRR( "smmla r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
  913. TEST_RRR( "smmla r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
  914. TEST_UNSUPPORTED(__inst_arm(0xe75f8a1c) " @ smmla pc, r12, r10, r8")
  915. TEST_RRR( "smmlar r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
  916. TEST_RRR( "smmlar r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
  917. TEST_UNSUPPORTED(__inst_arm(0xe75f8a3c) " @ smmlar pc, r12, r10, r8")
  918. TEST_RR( "smmul r0, r",0, VAL1,", r",1, VAL2,"")
  919. TEST_RR( "smmul r14, r",12,VAL2,", r",10,VAL1,"")
  920. TEST_UNSUPPORTED(__inst_arm(0xe75ffa1c) " @ smmul pc, r12, r10")
  921. TEST_RR( "smmulr r0, r",0, VAL1,", r",1, VAL2,"")
  922. TEST_RR( "smmulr r14, r",12,VAL2,", r",10,VAL1,"")
  923. TEST_UNSUPPORTED(__inst_arm(0xe75ffa3c) " @ smmulr pc, r12, r10")
  924. TEST_RRR( "smmls r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
  925. TEST_RRR( "smmls r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
  926. TEST_UNSUPPORTED(__inst_arm(0xe75f8adc) " @ smmls pc, r12, r10, r8")
  927. TEST_RRR( "smmlsr r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
  928. TEST_RRR( "smmlsr r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
  929. TEST_UNSUPPORTED(__inst_arm(0xe75f8afc) " @ smmlsr pc, r12, r10, r8")
  930. TEST_UNSUPPORTED(__inst_arm(0xe75e8aff) " @ smmlsr r14, pc, r10, r8")
  931. TEST_UNSUPPORTED(__inst_arm(0xe75e8ffc) " @ smmlsr r14, r12, pc, r8")
  932. TEST_UNSUPPORTED(__inst_arm(0xe75efafc) " @ smmlsr r14, r12, r10, pc")
  933. TEST_RR( "usad8 r0, r",0, VAL1,", r",1, VAL2,"")
  934. TEST_RR( "usad8 r14, r",12,VAL2,", r",10,VAL1,"")
  935. TEST_UNSUPPORTED(__inst_arm(0xe75ffa1c) " @ usad8 pc, r12, r10")
  936. TEST_UNSUPPORTED(__inst_arm(0xe75efa1f) " @ usad8 r14, pc, r10")
  937. TEST_UNSUPPORTED(__inst_arm(0xe75eff1c) " @ usad8 r14, r12, pc")
  938. TEST_RRR( "usada8 r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL3,"")
  939. TEST_RRR( "usada8 r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL3,"")
  940. TEST_UNSUPPORTED(__inst_arm(0xe78f8a1c) " @ usada8 pc, r12, r10, r8")
  941. TEST_UNSUPPORTED(__inst_arm(0xe78e8a1f) " @ usada8 r14, pc, r10, r8")
  942. TEST_UNSUPPORTED(__inst_arm(0xe78e8f1c) " @ usada8 r14, r12, pc, r8")
  943. #endif /* __LINUX_ARM_ARCH__ >= 6 */
  944. #if __LINUX_ARM_ARCH__ >= 7
  945. TEST_GROUP("Bit Field")
  946. TEST_R( "sbfx r0, r",0 , VAL1,", #0, #31")
  947. TEST_R( "sbfxeq r14, r",12, VAL2,", #8, #16")
  948. TEST_R( "sbfx r4, r",10, VAL1,", #16, #15")
  949. TEST_UNSUPPORTED(__inst_arm(0xe7aff45c) " @ sbfx pc, r12, #8, #16")
  950. TEST_R( "ubfx r0, r",0 , VAL1,", #0, #31")
  951. TEST_R( "ubfxcs r14, r",12, VAL2,", #8, #16")
  952. TEST_R( "ubfx r4, r",10, VAL1,", #16, #15")
  953. TEST_UNSUPPORTED(__inst_arm(0xe7eff45c) " @ ubfx pc, r12, #8, #16")
  954. TEST_UNSUPPORTED(__inst_arm(0xe7efc45f) " @ ubfx r12, pc, #8, #16")
  955. TEST_R( "bfc r",0, VAL1,", #4, #20")
  956. TEST_R( "bfcvs r",14,VAL2,", #4, #20")
  957. TEST_R( "bfc r",7, VAL1,", #0, #31")
  958. TEST_R( "bfc r",8, VAL2,", #0, #31")
  959. TEST_UNSUPPORTED(__inst_arm(0xe7def01f) " @ bfc pc, #0, #31");
  960. TEST_RR( "bfi r",0, VAL1,", r",0 , VAL2,", #0, #31")
  961. TEST_RR( "bfipl r",12,VAL1,", r",14 , VAL2,", #4, #20")
  962. TEST_UNSUPPORTED(__inst_arm(0xe7d7f21e) " @ bfi pc, r14, #4, #20")
  963. TEST_UNSUPPORTED(__inst_arm(0x07f000f0) "") /* Permanently UNDEFINED */
  964. TEST_UNSUPPORTED(__inst_arm(0x07ffffff) "") /* Permanently UNDEFINED */
  965. #endif /* __LINUX_ARM_ARCH__ >= 6 */
  966. TEST_GROUP("Branch, branch with link, and block data transfer")
  967. TEST_P( "stmda r",0, 16*4,", {r0}")
  968. TEST_P( "stmeqda r",4, 16*4,", {r0-r15}")
  969. TEST_P( "stmneda r",8, 16*4,"!, {r8-r15}")
  970. TEST_P( "stmda r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  971. TEST_P( "stmda r",13,0, "!, {pc}")
  972. TEST_P( "ldmda r",0, 16*4,", {r0}")
  973. TEST_BF_P("ldmcsda r",4, 15*4,", {r0-r15}")
  974. TEST_BF_P("ldmccda r",7, 15*4,"!, {r8-r15}")
  975. TEST_P( "ldmda r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  976. TEST_BF_P("ldmda r",14,15*4,"!, {pc}")
  977. TEST_P( "stmia r",0, 16*4,", {r0}")
  978. TEST_P( "stmmiia r",4, 16*4,", {r0-r15}")
  979. TEST_P( "stmplia r",8, 16*4,"!, {r8-r15}")
  980. TEST_P( "stmia r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  981. TEST_P( "stmia r",14,0, "!, {pc}")
  982. TEST_P( "ldmia r",0, 16*4,", {r0}")
  983. TEST_BF_P("ldmvsia r",4, 0, ", {r0-r15}")
  984. TEST_BF_P("ldmvcia r",7, 8*4, "!, {r8-r15}")
  985. TEST_P( "ldmia r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  986. TEST_BF_P("ldmia r",14,15*4,"!, {pc}")
  987. TEST_P( "stmdb r",0, 16*4,", {r0}")
  988. TEST_P( "stmhidb r",4, 16*4,", {r0-r15}")
  989. TEST_P( "stmlsdb r",8, 16*4,"!, {r8-r15}")
  990. TEST_P( "stmdb r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  991. TEST_P( "stmdb r",13,4, "!, {pc}")
  992. TEST_P( "ldmdb r",0, 16*4,", {r0}")
  993. TEST_BF_P("ldmgedb r",4, 16*4,", {r0-r15}")
  994. TEST_BF_P("ldmltdb r",7, 16*4,"!, {r8-r15}")
  995. TEST_P( "ldmdb r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  996. TEST_BF_P("ldmdb r",14,16*4,"!, {pc}")
  997. TEST_P( "stmib r",0, 16*4,", {r0}")
  998. TEST_P( "stmgtib r",4, 16*4,", {r0-r15}")
  999. TEST_P( "stmleib r",8, 16*4,"!, {r8-r15}")
  1000. TEST_P( "stmib r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  1001. TEST_P( "stmib r",13,-4, "!, {pc}")
  1002. TEST_P( "ldmib r",0, 16*4,", {r0}")
  1003. TEST_BF_P("ldmeqib r",4, -4,", {r0-r15}")
  1004. TEST_BF_P("ldmneib r",7, 7*4,"!, {r8-r15}")
  1005. TEST_P( "ldmib r",12,16*4,"!, {r1,r3,r5,r7,r8-r11,r14}")
  1006. TEST_BF_P("ldmib r",14,14*4,"!, {pc}")
  1007. TEST_P( "stmdb r",13,16*4,"!, {r3-r12,lr}")
  1008. TEST_P( "stmeqdb r",13,16*4,"!, {r3-r12}")
  1009. TEST_P( "stmnedb r",2, 16*4,", {r3-r12,lr}")
  1010. TEST_P( "stmdb r",13,16*4,"!, {r2-r12,lr}")
  1011. TEST_P( "stmdb r",0, 16*4,", {r0-r12}")
  1012. TEST_P( "stmdb r",0, 16*4,", {r0-r12,lr}")
  1013. TEST_BF_P("ldmia r",13,5*4, "!, {r3-r12,pc}")
  1014. TEST_P( "ldmccia r",13,5*4, "!, {r3-r12}")
  1015. TEST_BF_P("ldmcsia r",2, 5*4, "!, {r3-r12,pc}")
  1016. TEST_BF_P("ldmia r",13,4*4, "!, {r2-r12,pc}")
  1017. TEST_P( "ldmia r",0, 16*4,", {r0-r12}")
  1018. TEST_P( "ldmia r",0, 16*4,", {r0-r12,lr}")
  1019. #ifdef CONFIG_THUMB2_KERNEL
  1020. TEST_ARM_TO_THUMB_INTERWORK_P("ldmplia r",0,15*4,", {pc}")
  1021. TEST_ARM_TO_THUMB_INTERWORK_P("ldmmiia r",13,0,", {r0-r15}")
  1022. #endif
  1023. TEST_BF("b 2f")
  1024. TEST_BF("bl 2f")
  1025. TEST_BB("b 2b")
  1026. TEST_BB("bl 2b")
  1027. TEST_BF("beq 2f")
  1028. TEST_BF("bleq 2f")
  1029. TEST_BB("bne 2b")
  1030. TEST_BB("blne 2b")
  1031. TEST_BF("bgt 2f")
  1032. TEST_BF("blgt 2f")
  1033. TEST_BB("blt 2b")
  1034. TEST_BB("bllt 2b")
  1035. TEST_GROUP("Supervisor Call, and coprocessor instructions")
  1036. /*
  1037. * We can't really test these by executing them, so all
  1038. * we can do is check that probes are, or are not allowed.
  1039. * At the moment none are allowed...
  1040. */
  1041. #define TEST_COPROCESSOR(code) TEST_UNSUPPORTED(code)
  1042. #define COPROCESSOR_INSTRUCTIONS_ST_LD(two,cc) \
  1043. TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #4]") \
  1044. TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #-4]") \
  1045. TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #4]!") \
  1046. TEST_COPROCESSOR("stc"two" 0, cr0, [r13, #-4]!") \
  1047. TEST_COPROCESSOR("stc"two" 0, cr0, [r13], #4") \
  1048. TEST_COPROCESSOR("stc"two" 0, cr0, [r13], #-4") \
  1049. TEST_COPROCESSOR("stc"two" 0, cr0, [r13], {1}") \
  1050. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #4]") \
  1051. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #-4]") \
  1052. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #4]!") \
  1053. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13, #-4]!") \
  1054. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], #4") \
  1055. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], #-4") \
  1056. TEST_COPROCESSOR("stc"two"l 0, cr0, [r13], {1}") \
  1057. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #4]") \
  1058. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #-4]") \
  1059. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #4]!") \
  1060. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13, #-4]!") \
  1061. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], #4") \
  1062. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], #-4") \
  1063. TEST_COPROCESSOR("ldc"two" 0, cr0, [r13], {1}") \
  1064. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #4]") \
  1065. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #-4]") \
  1066. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #4]!") \
  1067. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13, #-4]!") \
  1068. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], #4") \
  1069. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], #-4") \
  1070. TEST_COPROCESSOR("ldc"two"l 0, cr0, [r13], {1}") \
  1071. \
  1072. TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #4]") \
  1073. TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #-4]") \
  1074. TEST_UNSUPPORTED(__inst_arm(0x##cc##daf0001) " @ stc"two" 0, cr0, [r15, #4]!") \
  1075. TEST_UNSUPPORTED(__inst_arm(0x##cc##d2f0001) " @ stc"two" 0, cr0, [r15, #-4]!") \
  1076. TEST_UNSUPPORTED(__inst_arm(0x##cc##caf0001) " @ stc"two" 0, cr0, [r15], #4") \
  1077. TEST_UNSUPPORTED(__inst_arm(0x##cc##c2f0001) " @ stc"two" 0, cr0, [r15], #-4") \
  1078. TEST_COPROCESSOR( "stc"two" 0, cr0, [r15], {1}") \
  1079. TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #4]") \
  1080. TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #-4]") \
  1081. TEST_UNSUPPORTED(__inst_arm(0x##cc##def0001) " @ stc"two"l 0, cr0, [r15, #4]!") \
  1082. TEST_UNSUPPORTED(__inst_arm(0x##cc##d6f0001) " @ stc"two"l 0, cr0, [r15, #-4]!") \
  1083. TEST_UNSUPPORTED(__inst_arm(0x##cc##cef0001) " @ stc"two"l 0, cr0, [r15], #4") \
  1084. TEST_UNSUPPORTED(__inst_arm(0x##cc##c6f0001) " @ stc"two"l 0, cr0, [r15], #-4") \
  1085. TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15], {1}") \
  1086. TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #4]") \
  1087. TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #-4]") \
  1088. TEST_UNSUPPORTED(__inst_arm(0x##cc##dbf0001) " @ ldc"two" 0, cr0, [r15, #4]!") \
  1089. TEST_UNSUPPORTED(__inst_arm(0x##cc##d3f0001) " @ ldc"two" 0, cr0, [r15, #-4]!") \
  1090. TEST_UNSUPPORTED(__inst_arm(0x##cc##cbf0001) " @ ldc"two" 0, cr0, [r15], #4") \
  1091. TEST_UNSUPPORTED(__inst_arm(0x##cc##c3f0001) " @ ldc"two" 0, cr0, [r15], #-4") \
  1092. TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15], {1}") \
  1093. TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #4]") \
  1094. TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #-4]") \
  1095. TEST_UNSUPPORTED(__inst_arm(0x##cc##dff0001) " @ ldc"two"l 0, cr0, [r15, #4]!") \
  1096. TEST_UNSUPPORTED(__inst_arm(0x##cc##d7f0001) " @ ldc"two"l 0, cr0, [r15, #-4]!") \
  1097. TEST_UNSUPPORTED(__inst_arm(0x##cc##cff0001) " @ ldc"two"l 0, cr0, [r15], #4") \
  1098. TEST_UNSUPPORTED(__inst_arm(0x##cc##c7f0001) " @ ldc"two"l 0, cr0, [r15], #-4") \
  1099. TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15], {1}")
  1100. #define COPROCESSOR_INSTRUCTIONS_MC_MR(two,cc) \
  1101. \
  1102. TEST_COPROCESSOR( "mcrr"two" 0, 15, r0, r14, cr0") \
  1103. TEST_COPROCESSOR( "mcrr"two" 15, 0, r14, r0, cr15") \
  1104. TEST_UNSUPPORTED(__inst_arm(0x##cc##c4f00f0) " @ mcrr"two" 0, 15, r0, r15, cr0") \
  1105. TEST_UNSUPPORTED(__inst_arm(0x##cc##c40ff0f) " @ mcrr"two" 15, 0, r15, r0, cr15") \
  1106. TEST_COPROCESSOR( "mrrc"two" 0, 15, r0, r14, cr0") \
  1107. TEST_COPROCESSOR( "mrrc"two" 15, 0, r14, r0, cr15") \
  1108. TEST_UNSUPPORTED(__inst_arm(0x##cc##c5f00f0) " @ mrrc"two" 0, 15, r0, r15, cr0") \
  1109. TEST_UNSUPPORTED(__inst_arm(0x##cc##c50ff0f) " @ mrrc"two" 15, 0, r15, r0, cr15") \
  1110. TEST_COPROCESSOR( "cdp"two" 15, 15, cr15, cr15, cr15, 7") \
  1111. TEST_COPROCESSOR( "cdp"two" 0, 0, cr0, cr0, cr0, 0") \
  1112. TEST_COPROCESSOR( "mcr"two" 15, 7, r15, cr15, cr15, 7") \
  1113. TEST_COPROCESSOR( "mcr"two" 0, 0, r0, cr0, cr0, 0") \
  1114. TEST_COPROCESSOR( "mrc"two" 15, 7, r15, cr15, cr15, 7") \
  1115. TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")
  1116. COPROCESSOR_INSTRUCTIONS_ST_LD("",e)
  1117. #if __LINUX_ARM_ARCH__ >= 5
  1118. COPROCESSOR_INSTRUCTIONS_MC_MR("",e)
  1119. #endif
  1120. TEST_UNSUPPORTED("svc 0")
  1121. TEST_UNSUPPORTED("svc 0xffffff")
  1122. TEST_UNSUPPORTED("svc 0")
  1123. TEST_GROUP("Unconditional instruction")
  1124. #if __LINUX_ARM_ARCH__ >= 6
  1125. TEST_UNSUPPORTED("srsda sp, 0x13")
  1126. TEST_UNSUPPORTED("srsdb sp, 0x13")
  1127. TEST_UNSUPPORTED("srsia sp, 0x13")
  1128. TEST_UNSUPPORTED("srsib sp, 0x13")
  1129. TEST_UNSUPPORTED("srsda sp!, 0x13")
  1130. TEST_UNSUPPORTED("srsdb sp!, 0x13")
  1131. TEST_UNSUPPORTED("srsia sp!, 0x13")
  1132. TEST_UNSUPPORTED("srsib sp!, 0x13")
  1133. TEST_UNSUPPORTED("rfeda sp")
  1134. TEST_UNSUPPORTED("rfedb sp")
  1135. TEST_UNSUPPORTED("rfeia sp")
  1136. TEST_UNSUPPORTED("rfeib sp")
  1137. TEST_UNSUPPORTED("rfeda sp!")
  1138. TEST_UNSUPPORTED("rfedb sp!")
  1139. TEST_UNSUPPORTED("rfeia sp!")
  1140. TEST_UNSUPPORTED("rfeib sp!")
  1141. TEST_UNSUPPORTED(__inst_arm(0xf81d0a00) " @ rfeda pc")
  1142. TEST_UNSUPPORTED(__inst_arm(0xf91d0a00) " @ rfedb pc")
  1143. TEST_UNSUPPORTED(__inst_arm(0xf89d0a00) " @ rfeia pc")
  1144. TEST_UNSUPPORTED(__inst_arm(0xf99d0a00) " @ rfeib pc")
  1145. TEST_UNSUPPORTED(__inst_arm(0xf83d0a00) " @ rfeda pc!")
  1146. TEST_UNSUPPORTED(__inst_arm(0xf93d0a00) " @ rfedb pc!")
  1147. TEST_UNSUPPORTED(__inst_arm(0xf8bd0a00) " @ rfeia pc!")
  1148. TEST_UNSUPPORTED(__inst_arm(0xf9bd0a00) " @ rfeib pc!")
  1149. #endif /* __LINUX_ARM_ARCH__ >= 6 */
  1150. #if __LINUX_ARM_ARCH__ >= 6
  1151. TEST_X( "blx __dummy_thumb_subroutine_even",
  1152. ".thumb \n\t"
  1153. ".space 4 \n\t"
  1154. ".type __dummy_thumb_subroutine_even, %%function \n\t"
  1155. "__dummy_thumb_subroutine_even: \n\t"
  1156. "mov r0, pc \n\t"
  1157. "bx lr \n\t"
  1158. ".arm \n\t"
  1159. )
  1160. TEST( "blx __dummy_thumb_subroutine_even")
  1161. TEST_X( "blx __dummy_thumb_subroutine_odd",
  1162. ".thumb \n\t"
  1163. ".space 2 \n\t"
  1164. ".type __dummy_thumb_subroutine_odd, %%function \n\t"
  1165. "__dummy_thumb_subroutine_odd: \n\t"
  1166. "mov r0, pc \n\t"
  1167. "bx lr \n\t"
  1168. ".arm \n\t"
  1169. )
  1170. TEST( "blx __dummy_thumb_subroutine_odd")
  1171. #endif /* __LINUX_ARM_ARCH__ >= 6 */
  1172. #if __LINUX_ARM_ARCH__ >= 5
  1173. COPROCESSOR_INSTRUCTIONS_ST_LD("2",f)
  1174. #endif
  1175. #if __LINUX_ARM_ARCH__ >= 6
  1176. COPROCESSOR_INSTRUCTIONS_MC_MR("2",f)
  1177. #endif
  1178. TEST_GROUP("Miscellaneous instructions, memory hints, and Advanced SIMD instructions")
  1179. #if __LINUX_ARM_ARCH__ >= 6
  1180. TEST_UNSUPPORTED("cps 0x13")
  1181. TEST_UNSUPPORTED("cpsie i")
  1182. TEST_UNSUPPORTED("cpsid i")
  1183. TEST_UNSUPPORTED("cpsie i,0x13")
  1184. TEST_UNSUPPORTED("cpsid i,0x13")
  1185. TEST_UNSUPPORTED("setend le")
  1186. TEST_UNSUPPORTED("setend be")
  1187. #endif
  1188. #if __LINUX_ARM_ARCH__ >= 7
  1189. TEST_P("pli [r",0,0b,", #16]")
  1190. TEST( "pli [pc, #0]")
  1191. TEST_RR("pli [r",12,0b,", r",0, 16,"]")
  1192. TEST_RR("pli [r",0, 0b,", -r",12,16,", lsl #4]")
  1193. #endif
  1194. #if __LINUX_ARM_ARCH__ >= 5
  1195. TEST_P("pld [r",0,32,", #-16]")
  1196. TEST( "pld [pc, #0]")
  1197. TEST_PR("pld [r",7, 24, ", r",0, 16,"]")
  1198. TEST_PR("pld [r",8, 24, ", -r",12,16,", lsl #4]")
  1199. #endif
  1200. #if __LINUX_ARM_ARCH__ >= 7
  1201. TEST_SUPPORTED( __inst_arm(0xf590f000) " @ pldw [r0, #0]")
  1202. TEST_SUPPORTED( __inst_arm(0xf797f000) " @ pldw [r7, r0]")
  1203. TEST_SUPPORTED( __inst_arm(0xf798f18c) " @ pldw [r8, r12, lsl #3]");
  1204. #endif
  1205. #if __LINUX_ARM_ARCH__ >= 7
  1206. TEST_UNSUPPORTED("clrex")
  1207. TEST_UNSUPPORTED("dsb")
  1208. TEST_UNSUPPORTED("dmb")
  1209. TEST_UNSUPPORTED("isb")
  1210. #endif
  1211. verbose("\n");
  1212. }