rotxr.s 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002
  1. # Hitachi H8 testcase 'rotxr'
  2. # mach(): h8300s h8sx
  3. # as(h8300): --defsym sim_cpu=0
  4. # as(h8300h): --defsym sim_cpu=1
  5. # as(h8300s): --defsym sim_cpu=2
  6. # as(h8sx): --defsym sim_cpu=3
  7. # ld(h8300h): -m h8300helf
  8. # ld(h8300s): -m h8300self
  9. # ld(h8sx): -m h8300sxelf
  10. .include "testutils.inc"
  11. start
  12. .data
  13. byte_dest: .byte 0xa5
  14. .align 2
  15. word_dest: .word 0xa5a5
  16. .align 4
  17. long_dest: .long 0xa5a5a5a5
  18. .text
  19. rotxr_b_reg8_1:
  20. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  21. set_ccr_zero
  22. rotxr.b r0l ; shift right arithmetic by one
  23. ;;; .word 0x1308
  24. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  25. test_zero_clear
  26. test_ovf_clear
  27. test_neg_clear
  28. test_h_gr16 0xa552 r0 ; 1010 0101 -> 0101 0010
  29. .if (sim_cpu)
  30. test_h_gr32 0xa5a5a552 er0
  31. .endif
  32. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  33. test_gr_a5a5 2
  34. test_gr_a5a5 3
  35. test_gr_a5a5 4
  36. test_gr_a5a5 5
  37. test_gr_a5a5 6
  38. test_gr_a5a5 7
  39. .if (sim_cpu == h8sx)
  40. rotxr_b_ind_1:
  41. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  42. set_ccr_zero
  43. mov #byte_dest, er0
  44. rotxr.b @er0 ; shift right arithmetic by one, indirect
  45. ;;; .word 0x7d00
  46. ;;; .word 0x1300
  47. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  48. test_zero_clear
  49. test_ovf_clear
  50. test_neg_clear
  51. test_h_gr32 byte_dest er0
  52. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  53. test_gr_a5a5 2
  54. test_gr_a5a5 3
  55. test_gr_a5a5 4
  56. test_gr_a5a5 5
  57. test_gr_a5a5 6
  58. test_gr_a5a5 7
  59. ; 1010 0101 -> 0101 0010
  60. cmp.b #0x52, @byte_dest
  61. beq .Lbind1
  62. fail
  63. .Lbind1:
  64. mov #0xa5a5a5a5, @byte_dest
  65. rotxr_b_postinc_1:
  66. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  67. set_ccr_zero
  68. mov #byte_dest, er0
  69. rotxr.b @er0+ ; shift right arithmetic by one, postinc
  70. ;;; .word 0x0174
  71. ;;; .word 0x6c08
  72. ;;; .word 0x1300
  73. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  74. test_zero_clear
  75. test_ovf_clear
  76. test_neg_clear
  77. test_h_gr32 byte_dest+1 er0
  78. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  79. test_gr_a5a5 2
  80. test_gr_a5a5 3
  81. test_gr_a5a5 4
  82. test_gr_a5a5 5
  83. test_gr_a5a5 6
  84. test_gr_a5a5 7
  85. ; 1010 0101 -> 0101 0010
  86. cmp.b #0x52, @byte_dest
  87. beq .Lbpostinc1
  88. fail
  89. .Lbpostinc1:
  90. mov #0xa5a5a5a5, @byte_dest
  91. rotxr_b_postdec_1:
  92. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  93. set_ccr_zero
  94. mov #byte_dest, er0
  95. rotxr.b @er0- ; shift right arithmetic by one, postdec
  96. ;;; .word 0x0176
  97. ;;; .word 0x6c08
  98. ;;; .word 0x1300
  99. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  100. test_zero_clear
  101. test_ovf_clear
  102. test_neg_clear
  103. test_h_gr32 byte_dest-1 er0
  104. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  105. test_gr_a5a5 2
  106. test_gr_a5a5 3
  107. test_gr_a5a5 4
  108. test_gr_a5a5 5
  109. test_gr_a5a5 6
  110. test_gr_a5a5 7
  111. ; 1010 0101 -> 0101 0010
  112. cmp.b #0x52, @byte_dest
  113. beq .Lbpostdec1
  114. fail
  115. .Lbpostdec1:
  116. mov #0xa5a5a5a5, @byte_dest
  117. rotxr_b_preinc_1:
  118. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  119. set_ccr_zero
  120. mov #byte_dest-1, er0
  121. rotxr.b @+er0 ; shift right arithmetic by one, preinc
  122. ;;; .word 0x0175
  123. ;;; .word 0x6c08
  124. ;;; .word 0x1300
  125. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  126. test_zero_clear
  127. test_ovf_clear
  128. test_neg_clear
  129. test_h_gr32 byte_dest er0
  130. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  131. test_gr_a5a5 2
  132. test_gr_a5a5 3
  133. test_gr_a5a5 4
  134. test_gr_a5a5 5
  135. test_gr_a5a5 6
  136. test_gr_a5a5 7
  137. ; 1010 0101 -> 0101 0010
  138. cmp.b #0x52, @byte_dest
  139. beq .Lbpreinc1
  140. fail
  141. .Lbpreinc1:
  142. mov #0xa5a5a5a5, @byte_dest
  143. rotxr_b_predec_1:
  144. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  145. set_ccr_zero
  146. mov #byte_dest+1, er0
  147. rotxr.b @-er0 ; shift right arithmetic by one, predec
  148. ;;; .word 0x0177
  149. ;;; .word 0x6c08
  150. ;;; .word 0x1300
  151. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  152. test_zero_clear
  153. test_ovf_clear
  154. test_neg_clear
  155. test_h_gr32 byte_dest er0
  156. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  157. test_gr_a5a5 2
  158. test_gr_a5a5 3
  159. test_gr_a5a5 4
  160. test_gr_a5a5 5
  161. test_gr_a5a5 6
  162. test_gr_a5a5 7
  163. ; 1010 0101 -> 0101 0010
  164. cmp.b #0x52, @byte_dest
  165. beq .Lbpredec1
  166. fail
  167. .Lbpredec1:
  168. mov #0xa5a5a5a5, @byte_dest
  169. rotxr_b_disp2_1:
  170. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  171. set_ccr_zero
  172. mov #byte_dest-2, er0
  173. rotxr.b @(2:2, er0) ; shift right arithmetic by one, disp2
  174. ;;; .word 0x0176
  175. ;;; .word 0x6808
  176. ;;; .word 0x1300
  177. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  178. test_zero_clear
  179. test_ovf_clear
  180. test_neg_clear
  181. test_h_gr32 byte_dest-2 er0
  182. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  183. test_gr_a5a5 2
  184. test_gr_a5a5 3
  185. test_gr_a5a5 4
  186. test_gr_a5a5 5
  187. test_gr_a5a5 6
  188. test_gr_a5a5 7
  189. ; 1010 0101 -> 0101 0010
  190. cmp.b #0x52, @byte_dest
  191. beq .Lbdisp21
  192. fail
  193. .Lbdisp21:
  194. mov #0xa5a5a5a5, @byte_dest
  195. rotxr_b_disp16_1:
  196. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  197. set_ccr_zero
  198. mov #byte_dest-44, er0
  199. rotxr.b @(44:16, er0) ; shift right arithmetic by one, disp16
  200. ;;; .word 0x0174
  201. ;;; .word 0x6e08
  202. ;;; .word 44
  203. ;;; .word 0x1300
  204. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  205. test_zero_clear
  206. test_ovf_clear
  207. test_neg_clear
  208. test_h_gr32 byte_dest-44 er0
  209. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  210. test_gr_a5a5 2
  211. test_gr_a5a5 3
  212. test_gr_a5a5 4
  213. test_gr_a5a5 5
  214. test_gr_a5a5 6
  215. test_gr_a5a5 7
  216. ; 1010 0101 -> 0101 0010
  217. cmp.b #0x52, @byte_dest
  218. beq .Lbdisp161
  219. fail
  220. .Lbdisp161:
  221. mov #0xa5a5a5a5, @byte_dest
  222. rotxr_b_disp32_1:
  223. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  224. set_ccr_zero
  225. mov #byte_dest-666, er0
  226. rotxr.b @(666:32, er0) ; shift right arithmetic by one, disp32
  227. ;;; .word 0x7884
  228. ;;; .word 0x6a28
  229. ;;; .long 666
  230. ;;; .word 0x1300
  231. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  232. test_zero_clear
  233. test_ovf_clear
  234. test_neg_clear
  235. test_h_gr32 byte_dest-666 er0
  236. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  237. test_gr_a5a5 2
  238. test_gr_a5a5 3
  239. test_gr_a5a5 4
  240. test_gr_a5a5 5
  241. test_gr_a5a5 6
  242. test_gr_a5a5 7
  243. ; 1010 0101 -> 0101 0010
  244. cmp.b #0x52, @byte_dest
  245. beq .Lbdisp321
  246. fail
  247. .Lbdisp321:
  248. mov #0xa5a5a5a5, @byte_dest
  249. rotxr_b_abs16_1:
  250. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  251. set_ccr_zero
  252. rotxr.b @byte_dest:16 ; shift right arithmetic by one, abs16
  253. ;;; .word 0x6a18
  254. ;;; .word byte_dest
  255. ;;; .word 0x1300
  256. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  257. test_zero_clear
  258. test_ovf_clear
  259. test_neg_clear
  260. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  261. test_gr_a5a5 2
  262. test_gr_a5a5 2
  263. test_gr_a5a5 3
  264. test_gr_a5a5 4
  265. test_gr_a5a5 5
  266. test_gr_a5a5 6
  267. test_gr_a5a5 7
  268. ; 1010 0101 -> 0101 0010
  269. cmp.b #0x52, @byte_dest
  270. beq .Lbabs161
  271. fail
  272. .Lbabs161:
  273. mov #0xa5a5a5a5, @byte_dest
  274. rotxr_b_abs32_1:
  275. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  276. set_ccr_zero
  277. rotxr.b @byte_dest:32 ; shift right arithmetic by one, abs32
  278. ;;; .word 0x6a38
  279. ;;; .long byte_dest
  280. ;;; .word 0x1300
  281. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  282. test_zero_clear
  283. test_ovf_clear
  284. test_neg_clear
  285. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  286. test_gr_a5a5 2
  287. test_gr_a5a5 2
  288. test_gr_a5a5 3
  289. test_gr_a5a5 4
  290. test_gr_a5a5 5
  291. test_gr_a5a5 6
  292. test_gr_a5a5 7
  293. ; 1010 0101 -> 0101 0010
  294. cmp.b #0x52, @byte_dest
  295. beq .Lbabs321
  296. fail
  297. .Lbabs321:
  298. mov #0xa5a5a5a5, @byte_dest
  299. .endif
  300. rotxr_b_reg8_2:
  301. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  302. set_ccr_zero
  303. rotxr.b #2, r0l ; shift right arithmetic by two
  304. ;;; .word 0x1348
  305. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  306. test_zero_clear
  307. test_ovf_clear
  308. test_neg_set
  309. test_h_gr16 0xa5a9 r0 ; 1010 0101 -> 1010 1001
  310. .if (sim_cpu)
  311. test_h_gr32 0xa5a5a5a9 er0
  312. .endif
  313. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  314. test_gr_a5a5 2
  315. test_gr_a5a5 3
  316. test_gr_a5a5 4
  317. test_gr_a5a5 5
  318. test_gr_a5a5 6
  319. test_gr_a5a5 7
  320. .if (sim_cpu == h8sx)
  321. rotxr_b_ind_2:
  322. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  323. set_ccr_zero
  324. mov #byte_dest, er0
  325. rotxr.b #2, @er0 ; shift right arithmetic by two, indirect
  326. ;;; .word 0x7d00
  327. ;;; .word 0x1340
  328. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  329. test_zero_clear
  330. test_ovf_clear
  331. test_neg_set
  332. test_h_gr32 byte_dest er0
  333. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  334. test_gr_a5a5 2
  335. test_gr_a5a5 3
  336. test_gr_a5a5 4
  337. test_gr_a5a5 5
  338. test_gr_a5a5 6
  339. test_gr_a5a5 7
  340. ; 1010 0101 -> 1010 1001
  341. cmp.b #0xa9, @byte_dest
  342. beq .Lbind2
  343. fail
  344. .Lbind2:
  345. mov #0xa5a5a5a5, @byte_dest
  346. rotxr_b_postinc_2:
  347. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  348. set_ccr_zero
  349. mov #byte_dest, er0
  350. rotxr.b #2, @er0+ ; shift right arithmetic by two, postinc
  351. ;;; .word 0x0174
  352. ;;; .word 0x6c08
  353. ;;; .word 0x1340
  354. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  355. test_zero_clear
  356. test_ovf_clear
  357. test_neg_set
  358. test_h_gr32 byte_dest+1 er0
  359. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  360. test_gr_a5a5 2
  361. test_gr_a5a5 3
  362. test_gr_a5a5 4
  363. test_gr_a5a5 5
  364. test_gr_a5a5 6
  365. test_gr_a5a5 7
  366. ; 1010 0101 -> 1010 1001
  367. cmp.b #0xa9, @byte_dest
  368. beq .Lbpostinc2
  369. fail
  370. .Lbpostinc2:
  371. mov #0xa5a5a5a5, @byte_dest
  372. rotxr_b_postdec_2:
  373. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  374. set_ccr_zero
  375. mov #byte_dest, er0
  376. rotxr.b #2, @er0- ; shift right arithmetic by two, postdec
  377. ;;; .word 0x0176
  378. ;;; .word 0x6c08
  379. ;;; .word 0x1340
  380. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  381. test_zero_clear
  382. test_ovf_clear
  383. test_neg_set
  384. test_h_gr32 byte_dest-1 er0
  385. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  386. test_gr_a5a5 2
  387. test_gr_a5a5 3
  388. test_gr_a5a5 4
  389. test_gr_a5a5 5
  390. test_gr_a5a5 6
  391. test_gr_a5a5 7
  392. ; 1010 0101 -> 1010 1001
  393. cmp.b #0xa9, @byte_dest
  394. beq .Lbpostdec2
  395. fail
  396. .Lbpostdec2:
  397. mov #0xa5a5a5a5, @byte_dest
  398. rotxr_b_preinc_2:
  399. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  400. set_ccr_zero
  401. mov #byte_dest-1, er0
  402. rotxr.b #2, @+er0 ; shift right arithmetic by two, preinc
  403. ;;; .word 0x0175
  404. ;;; .word 0x6c08
  405. ;;; .word 0x1340
  406. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  407. test_zero_clear
  408. test_ovf_clear
  409. test_neg_set
  410. test_h_gr32 byte_dest er0
  411. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  412. test_gr_a5a5 2
  413. test_gr_a5a5 3
  414. test_gr_a5a5 4
  415. test_gr_a5a5 5
  416. test_gr_a5a5 6
  417. test_gr_a5a5 7
  418. ; 1010 0101 -> 1010 1001
  419. cmp.b #0xa9, @byte_dest
  420. beq .Lbpreinc2
  421. fail
  422. .Lbpreinc2:
  423. mov #0xa5a5a5a5, @byte_dest
  424. rotxr_b_predec_2:
  425. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  426. set_ccr_zero
  427. mov #byte_dest+1, er0
  428. rotxr.b #2, @-er0 ; shift right arithmetic by two, predec
  429. ;;; .word 0x0177
  430. ;;; .word 0x6c08
  431. ;;; .word 0x1340
  432. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  433. test_zero_clear
  434. test_ovf_clear
  435. test_neg_set
  436. test_h_gr32 byte_dest er0
  437. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  438. test_gr_a5a5 2
  439. test_gr_a5a5 3
  440. test_gr_a5a5 4
  441. test_gr_a5a5 5
  442. test_gr_a5a5 6
  443. test_gr_a5a5 7
  444. ; 1010 0101 -> 1010 1001
  445. cmp.b #0xa9, @byte_dest
  446. beq .Lbpredec2
  447. fail
  448. .Lbpredec2:
  449. mov #0xa5a5a5a5, @byte_dest
  450. rotxr_b_disp2_2:
  451. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  452. set_ccr_zero
  453. mov #byte_dest-2, er0
  454. rotxr.b #2, @(2:2, er0) ; shift right arithmetic by two, disp2
  455. ;;; .word 0x0176
  456. ;;; .word 0x6808
  457. ;;; .word 0x1340
  458. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  459. test_zero_clear
  460. test_ovf_clear
  461. test_neg_set
  462. test_h_gr32 byte_dest-2 er0
  463. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  464. test_gr_a5a5 2
  465. test_gr_a5a5 3
  466. test_gr_a5a5 4
  467. test_gr_a5a5 5
  468. test_gr_a5a5 6
  469. test_gr_a5a5 7
  470. ; 1010 0101 -> 1010 1001
  471. cmp.b #0xa9, @byte_dest
  472. beq .Lbdisp22
  473. fail
  474. .Lbdisp22:
  475. mov #0xa5a5a5a5, @byte_dest
  476. rotxr_b_disp16_2:
  477. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  478. set_ccr_zero
  479. mov #byte_dest-44, er0
  480. rotxr.b #2, @(44:16, er0) ; shift right arithmetic by two, disp16
  481. ;;; .word 0x0174
  482. ;;; .word 0x6e08
  483. ;;; .word 44
  484. ;;; .word 0x1340
  485. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  486. test_zero_clear
  487. test_ovf_clear
  488. test_neg_set
  489. test_h_gr32 byte_dest-44 er0
  490. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  491. test_gr_a5a5 2
  492. test_gr_a5a5 3
  493. test_gr_a5a5 4
  494. test_gr_a5a5 5
  495. test_gr_a5a5 6
  496. test_gr_a5a5 7
  497. ; 1010 0101 -> 1010 1001
  498. cmp.b #0xa9, @byte_dest
  499. beq .Lbdisp162
  500. fail
  501. .Lbdisp162:
  502. mov #0xa5a5a5a5, @byte_dest
  503. rotxr_b_disp32_2:
  504. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  505. set_ccr_zero
  506. mov #byte_dest-666, er0
  507. rotxr.b #2, @(666:32, er0) ; shift right arithmetic by two, disp32
  508. ;;; .word 0x7884
  509. ;;; .word 0x6a28
  510. ;;; .long 666
  511. ;;; .word 0x1340
  512. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  513. test_zero_clear
  514. test_ovf_clear
  515. test_neg_set
  516. test_h_gr32 byte_dest-666 er0
  517. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  518. test_gr_a5a5 2
  519. test_gr_a5a5 3
  520. test_gr_a5a5 4
  521. test_gr_a5a5 5
  522. test_gr_a5a5 6
  523. test_gr_a5a5 7
  524. ; 1010 0101 -> 1010 1001
  525. cmp.b #0xa9, @byte_dest
  526. beq .Lbdisp322
  527. fail
  528. .Lbdisp322:
  529. mov #0xa5a5a5a5, @byte_dest
  530. rotxr_b_abs16_2:
  531. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  532. set_ccr_zero
  533. rotxr.b #2, @byte_dest:16 ; shift right arithmetic by two, abs16
  534. ;;; .word 0x6a18
  535. ;;; .word byte_dest
  536. ;;; .word 0x1340
  537. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  538. test_zero_clear
  539. test_ovf_clear
  540. test_neg_set
  541. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  542. test_gr_a5a5 2
  543. test_gr_a5a5 2
  544. test_gr_a5a5 3
  545. test_gr_a5a5 4
  546. test_gr_a5a5 5
  547. test_gr_a5a5 6
  548. test_gr_a5a5 7
  549. ; 1010 0101 -> 1010 1001
  550. cmp.b #0xa9, @byte_dest
  551. beq .Lbabs162
  552. fail
  553. .Lbabs162:
  554. mov #0xa5a5a5a5, @byte_dest
  555. rotxr_b_abs32_2:
  556. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  557. set_ccr_zero
  558. rotxr.b #2, @byte_dest:32 ; shift right arithmetic by two, abs32
  559. ;;; .word 0x6a38
  560. ;;; .long byte_dest
  561. ;;; .word 0x1340
  562. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  563. test_zero_clear
  564. test_ovf_clear
  565. test_neg_set
  566. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  567. test_gr_a5a5 2
  568. test_gr_a5a5 2
  569. test_gr_a5a5 3
  570. test_gr_a5a5 4
  571. test_gr_a5a5 5
  572. test_gr_a5a5 6
  573. test_gr_a5a5 7
  574. ; 1010 0101 -> 1010 1001
  575. cmp.b #0xa9, @byte_dest
  576. beq .Lbabs322
  577. fail
  578. .Lbabs322:
  579. mov #0xa5a5a5a5, @byte_dest
  580. .endif
  581. .if (sim_cpu) ; Not available in h8300 mode
  582. rotxr_w_reg16_1:
  583. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  584. set_ccr_zero
  585. rotxr.w r0 ; shift right arithmetic by one
  586. ;;; .word 0x1310
  587. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  588. test_zero_clear
  589. test_ovf_clear
  590. test_neg_clear
  591. test_h_gr16 0x52d2 r0 ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  592. test_h_gr32 0xa5a552d2 er0
  593. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  594. test_gr_a5a5 2
  595. test_gr_a5a5 3
  596. test_gr_a5a5 4
  597. test_gr_a5a5 5
  598. test_gr_a5a5 6
  599. test_gr_a5a5 7
  600. .if (sim_cpu == h8sx)
  601. rotxr_w_ind_1:
  602. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  603. set_ccr_zero
  604. mov #word_dest, er0
  605. rotxr.w @er0 ; shift right arithmetic by one, indirect
  606. ;;; .word 0x7d80
  607. ;;; .word 0x1310
  608. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  609. test_zero_clear
  610. test_ovf_clear
  611. test_neg_clear
  612. test_h_gr32 word_dest er0
  613. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  614. test_gr_a5a5 2
  615. test_gr_a5a5 3
  616. test_gr_a5a5 4
  617. test_gr_a5a5 5
  618. test_gr_a5a5 6
  619. test_gr_a5a5 7
  620. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  621. cmp.w #0x52d2, @word_dest
  622. beq .Lwind1
  623. fail
  624. .Lwind1:
  625. mov #0xa5a5a5a5, @word_dest
  626. rotxr_w_postinc_1:
  627. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  628. set_ccr_zero
  629. mov #word_dest, er0
  630. rotxr.w @er0+ ; shift right arithmetic by one, postinc
  631. ;;; .word 0x0154
  632. ;;; .word 0x6d08
  633. ;;; .word 0x1310
  634. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  635. test_zero_clear
  636. test_ovf_clear
  637. test_neg_clear
  638. test_h_gr32 word_dest+2 er0
  639. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  640. test_gr_a5a5 2
  641. test_gr_a5a5 3
  642. test_gr_a5a5 4
  643. test_gr_a5a5 5
  644. test_gr_a5a5 6
  645. test_gr_a5a5 7
  646. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  647. cmp.w #0x52d2, @word_dest
  648. beq .Lwpostinc1
  649. fail
  650. .Lwpostinc1:
  651. mov #0xa5a5a5a5, @word_dest
  652. rotxr_w_postdec_1:
  653. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  654. set_ccr_zero
  655. mov #word_dest, er0
  656. rotxr.w @er0- ; shift right arithmetic by one, postdec
  657. ;;; .word 0x0156
  658. ;;; .word 0x6d08
  659. ;;; .word 0x1310
  660. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  661. test_zero_clear
  662. test_ovf_clear
  663. test_neg_clear
  664. test_h_gr32 word_dest-2 er0
  665. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  666. test_gr_a5a5 2
  667. test_gr_a5a5 3
  668. test_gr_a5a5 4
  669. test_gr_a5a5 5
  670. test_gr_a5a5 6
  671. test_gr_a5a5 7
  672. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  673. cmp.w #0x52d2, @word_dest
  674. beq .Lwpostdec1
  675. fail
  676. .Lwpostdec1:
  677. mov #0xa5a5a5a5, @word_dest
  678. rotxr_w_preinc_1:
  679. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  680. set_ccr_zero
  681. mov #word_dest-2, er0
  682. rotxr.w @+er0 ; shift right arithmetic by one, preinc
  683. ;;; .word 0x0155
  684. ;;; .word 0x6d08
  685. ;;; .word 0x1310
  686. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  687. test_zero_clear
  688. test_ovf_clear
  689. test_neg_clear
  690. test_h_gr32 word_dest er0
  691. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  692. test_gr_a5a5 2
  693. test_gr_a5a5 3
  694. test_gr_a5a5 4
  695. test_gr_a5a5 5
  696. test_gr_a5a5 6
  697. test_gr_a5a5 7
  698. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  699. cmp.w #0x52d2, @word_dest
  700. beq .Lwpreinc1
  701. fail
  702. .Lwpreinc1:
  703. mov #0xa5a5a5a5, @word_dest
  704. rotxr_w_predec_1:
  705. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  706. set_ccr_zero
  707. mov #word_dest+2, er0
  708. rotxr.w @-er0 ; shift right arithmetic by one, predec
  709. ;;; .word 0x0157
  710. ;;; .word 0x6d08
  711. ;;; .word 0x1310
  712. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  713. test_zero_clear
  714. test_ovf_clear
  715. test_neg_clear
  716. test_h_gr32 word_dest er0
  717. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  718. test_gr_a5a5 2
  719. test_gr_a5a5 3
  720. test_gr_a5a5 4
  721. test_gr_a5a5 5
  722. test_gr_a5a5 6
  723. test_gr_a5a5 7
  724. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  725. cmp.w #0x52d2, @word_dest
  726. beq .Lwpredec1
  727. fail
  728. .Lwpredec1:
  729. mov #0xa5a5a5a5, @word_dest
  730. rotxr_w_disp2_1:
  731. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  732. set_ccr_zero
  733. mov #word_dest-4, er0
  734. rotxr.w @(4:2, er0) ; shift right arithmetic by one, disp2
  735. ;;; .word 0x0156
  736. ;;; .word 0xa908
  737. ;;; .word 0x1310
  738. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  739. test_zero_clear
  740. test_ovf_clear
  741. test_neg_clear
  742. test_h_gr32 word_dest-4 er0
  743. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  744. test_gr_a5a5 2
  745. test_gr_a5a5 3
  746. test_gr_a5a5 4
  747. test_gr_a5a5 5
  748. test_gr_a5a5 6
  749. test_gr_a5a5 7
  750. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  751. cmp.w #0x52d2, @word_dest
  752. beq .Lwdisp21
  753. fail
  754. .Lwdisp21:
  755. mov #0xa5a5a5a5, @word_dest
  756. rotxr_w_disp16_1:
  757. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  758. set_ccr_zero
  759. mov #word_dest-44, er0
  760. rotxr.w @(44:16, er0) ; shift right arithmetic by one, disp16
  761. ;;; .word 0x0154
  762. ;;; .word 0x6f08
  763. ;;; .word 44
  764. ;;; .word 0x1310
  765. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  766. test_zero_clear
  767. test_ovf_clear
  768. test_neg_clear
  769. test_h_gr32 word_dest-44 er0
  770. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  771. test_gr_a5a5 2
  772. test_gr_a5a5 3
  773. test_gr_a5a5 4
  774. test_gr_a5a5 5
  775. test_gr_a5a5 6
  776. test_gr_a5a5 7
  777. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  778. cmp.w #0x52d2, @word_dest
  779. beq .Lwdisp161
  780. fail
  781. .Lwdisp161:
  782. mov #0xa5a5a5a5, @word_dest
  783. rotxr_w_disp32_1:
  784. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  785. set_ccr_zero
  786. mov #word_dest-666, er0
  787. rotxr.w @(666:32, er0) ; shift right arithmetic by one, disp32
  788. ;;; .word 0x7884
  789. ;;; .word 0x6b28
  790. ;;; .long 666
  791. ;;; .word 0x1310
  792. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  793. test_zero_clear
  794. test_ovf_clear
  795. test_neg_clear
  796. test_h_gr32 word_dest-666 er0
  797. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  798. test_gr_a5a5 2
  799. test_gr_a5a5 3
  800. test_gr_a5a5 4
  801. test_gr_a5a5 5
  802. test_gr_a5a5 6
  803. test_gr_a5a5 7
  804. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  805. cmp.w #0x52d2, @word_dest
  806. beq .Lwdisp321
  807. fail
  808. .Lwdisp321:
  809. mov #0xa5a5a5a5, @word_dest
  810. rotxr_w_abs16_1:
  811. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  812. set_ccr_zero
  813. rotxr.w @word_dest:16 ; shift right arithmetic by one, abs16
  814. ;;; .word 0x6b18
  815. ;;; .word word_dest
  816. ;;; .word 0x1310
  817. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  818. test_zero_clear
  819. test_ovf_clear
  820. test_neg_clear
  821. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  822. test_gr_a5a5 1
  823. test_gr_a5a5 2
  824. test_gr_a5a5 3
  825. test_gr_a5a5 4
  826. test_gr_a5a5 5
  827. test_gr_a5a5 6
  828. test_gr_a5a5 7
  829. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  830. cmp.w #0x52d2, @word_dest
  831. beq .Lwabs161
  832. fail
  833. .Lwabs161:
  834. mov #0xa5a5a5a5, @word_dest
  835. rotxr_w_abs32_1:
  836. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  837. set_ccr_zero
  838. rotxr.w @word_dest:32 ; shift right arithmetic by one, abs32
  839. ;;; .word 0x6b38
  840. ;;; .long word_dest
  841. ;;; .word 0x1310
  842. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  843. test_zero_clear
  844. test_ovf_clear
  845. test_neg_clear
  846. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  847. test_gr_a5a5 1
  848. test_gr_a5a5 2
  849. test_gr_a5a5 3
  850. test_gr_a5a5 4
  851. test_gr_a5a5 5
  852. test_gr_a5a5 6
  853. test_gr_a5a5 7
  854. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  855. cmp.w #0x52d2, @word_dest
  856. beq .Lwabs321
  857. fail
  858. .Lwabs321:
  859. mov #0xa5a5a5a5, @word_dest
  860. .endif
  861. rotxr_w_reg16_2:
  862. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  863. set_ccr_zero
  864. rotxr.w #2, r0 ; shift right arithmetic by two
  865. ;;; .word 0x1350
  866. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  867. test_zero_clear
  868. test_ovf_clear
  869. test_neg_set
  870. test_h_gr16 0xa969 r0 ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  871. test_h_gr32 0xa5a5a969 er0
  872. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  873. test_gr_a5a5 2
  874. test_gr_a5a5 3
  875. test_gr_a5a5 4
  876. test_gr_a5a5 5
  877. test_gr_a5a5 6
  878. test_gr_a5a5 7
  879. .if (sim_cpu == h8sx)
  880. rotxr_w_ind_2:
  881. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  882. set_ccr_zero
  883. mov #word_dest, er0
  884. rotxr.w #2, @er0 ; shift right arithmetic by two, indirect
  885. ;;; .word 0x7d80
  886. ;;; .word 0x1350
  887. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  888. test_zero_clear
  889. test_ovf_clear
  890. test_neg_set
  891. test_h_gr32 word_dest er0
  892. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  893. test_gr_a5a5 2
  894. test_gr_a5a5 3
  895. test_gr_a5a5 4
  896. test_gr_a5a5 5
  897. test_gr_a5a5 6
  898. test_gr_a5a5 7
  899. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  900. cmp.w #0xa969, @word_dest
  901. beq .Lwind2
  902. fail
  903. .Lwind2:
  904. mov #0xa5a5a5a5, @word_dest
  905. rotxr_w_postinc_2:
  906. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  907. set_ccr_zero
  908. mov #word_dest, er0
  909. rotxr.w #2, @er0+ ; shift right arithmetic by two, postinc
  910. ;;; .word 0x0154
  911. ;;; .word 0x6d08
  912. ;;; .word 0x1350
  913. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  914. test_zero_clear
  915. test_ovf_clear
  916. test_neg_set
  917. test_h_gr32 word_dest+2 er0
  918. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  919. test_gr_a5a5 2
  920. test_gr_a5a5 3
  921. test_gr_a5a5 4
  922. test_gr_a5a5 5
  923. test_gr_a5a5 6
  924. test_gr_a5a5 7
  925. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  926. cmp.w #0xa969, @word_dest
  927. beq .Lwpostinc2
  928. fail
  929. .Lwpostinc2:
  930. mov #0xa5a5a5a5, @word_dest
  931. rotxr_w_postdec_2:
  932. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  933. set_ccr_zero
  934. mov #word_dest, er0
  935. rotxr.w #2, @er0- ; shift right arithmetic by two, postdec
  936. ;;; .word 0x0156
  937. ;;; .word 0x6d08
  938. ;;; .word 0x1350
  939. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  940. test_zero_clear
  941. test_ovf_clear
  942. test_neg_set
  943. test_h_gr32 word_dest-2 er0
  944. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  945. test_gr_a5a5 2
  946. test_gr_a5a5 3
  947. test_gr_a5a5 4
  948. test_gr_a5a5 5
  949. test_gr_a5a5 6
  950. test_gr_a5a5 7
  951. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  952. cmp.w #0xa969, @word_dest
  953. beq .Lwpostdec2
  954. fail
  955. .Lwpostdec2:
  956. mov #0xa5a5a5a5, @word_dest
  957. rotxr_w_preinc_2:
  958. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  959. set_ccr_zero
  960. mov #word_dest-2, er0
  961. rotxr.w #2, @+er0 ; shift right arithmetic by two, preinc
  962. ;;; .word 0x0155
  963. ;;; .word 0x6d08
  964. ;;; .word 0x1350
  965. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  966. test_zero_clear
  967. test_ovf_clear
  968. test_neg_set
  969. test_h_gr32 word_dest er0
  970. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  971. test_gr_a5a5 2
  972. test_gr_a5a5 3
  973. test_gr_a5a5 4
  974. test_gr_a5a5 5
  975. test_gr_a5a5 6
  976. test_gr_a5a5 7
  977. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  978. cmp.w #0xa969, @word_dest
  979. beq .Lwpreinc2
  980. fail
  981. .Lwpreinc2:
  982. mov #0xa5a5a5a5, @word_dest
  983. rotxr_w_predec_2:
  984. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  985. set_ccr_zero
  986. mov #word_dest+2, er0
  987. rotxr.w #2, @-er0 ; shift right arithmetic by two, predec
  988. ;;; .word 0x0157
  989. ;;; .word 0x6d08
  990. ;;; .word 0x1350
  991. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  992. test_zero_clear
  993. test_ovf_clear
  994. test_neg_set
  995. test_h_gr32 word_dest er0
  996. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  997. test_gr_a5a5 2
  998. test_gr_a5a5 3
  999. test_gr_a5a5 4
  1000. test_gr_a5a5 5
  1001. test_gr_a5a5 6
  1002. test_gr_a5a5 7
  1003. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1004. cmp.w #0xa969, @word_dest
  1005. beq .Lwpredec2
  1006. fail
  1007. .Lwpredec2:
  1008. mov #0xa5a5a5a5, @word_dest
  1009. rotxr_w_disp2_2:
  1010. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1011. set_ccr_zero
  1012. mov #word_dest-4, er0
  1013. rotxr.w #2, @(4:2, er0) ; shift right arithmetic by two, disp2
  1014. ;;; .word 0x0156
  1015. ;;; .word 0xa908
  1016. ;;; .word 0x1350
  1017. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1018. test_zero_clear
  1019. test_ovf_clear
  1020. test_neg_set
  1021. test_h_gr32 word_dest-4 er0
  1022. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1023. test_gr_a5a5 2
  1024. test_gr_a5a5 3
  1025. test_gr_a5a5 4
  1026. test_gr_a5a5 5
  1027. test_gr_a5a5 6
  1028. test_gr_a5a5 7
  1029. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1030. cmp.w #0xa969, @word_dest
  1031. beq .Lwdisp22
  1032. fail
  1033. .Lwdisp22:
  1034. mov #0xa5a5a5a5, @word_dest
  1035. rotxr_w_disp16_2:
  1036. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1037. set_ccr_zero
  1038. mov #word_dest-44, er0
  1039. rotxr.w #2, @(44:16, er0) ; shift right arithmetic by two, disp16
  1040. ;;; .word 0x0154
  1041. ;;; .word 0x6f08
  1042. ;;; .word 44
  1043. ;;; .word 0x1350
  1044. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1045. test_zero_clear
  1046. test_ovf_clear
  1047. test_neg_set
  1048. test_h_gr32 word_dest-44 er0
  1049. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1050. test_gr_a5a5 2
  1051. test_gr_a5a5 3
  1052. test_gr_a5a5 4
  1053. test_gr_a5a5 5
  1054. test_gr_a5a5 6
  1055. test_gr_a5a5 7
  1056. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1057. cmp.w #0xa969, @word_dest
  1058. beq .Lwdisp162
  1059. fail
  1060. .Lwdisp162:
  1061. mov #0xa5a5a5a5, @word_dest
  1062. rotxr_w_disp32_2:
  1063. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1064. set_ccr_zero
  1065. mov #word_dest-666, er0
  1066. rotxr.w #2, @(666:32, er0) ; shift right arithmetic by two, disp32
  1067. ;;; .word 0x7884
  1068. ;;; .word 0x6b28
  1069. ;;; .long 666
  1070. ;;; .word 0x1350
  1071. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1072. test_zero_clear
  1073. test_ovf_clear
  1074. test_neg_set
  1075. test_h_gr32 word_dest-666 er0
  1076. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1077. test_gr_a5a5 2
  1078. test_gr_a5a5 3
  1079. test_gr_a5a5 4
  1080. test_gr_a5a5 5
  1081. test_gr_a5a5 6
  1082. test_gr_a5a5 7
  1083. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1084. cmp.w #0xa969, @word_dest
  1085. beq .Lwdisp322
  1086. fail
  1087. .Lwdisp322:
  1088. mov #0xa5a5a5a5, @word_dest
  1089. rotxr_w_abs16_2:
  1090. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1091. set_ccr_zero
  1092. rotxr.w #2, @word_dest:16 ; shift right arithmetic by two, abs16
  1093. ;;; .word 0x6b18
  1094. ;;; .word word_dest
  1095. ;;; .word 0x1350
  1096. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1097. test_zero_clear
  1098. test_ovf_clear
  1099. test_neg_set
  1100. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1101. test_gr_a5a5 2
  1102. test_gr_a5a5 2
  1103. test_gr_a5a5 3
  1104. test_gr_a5a5 4
  1105. test_gr_a5a5 5
  1106. test_gr_a5a5 6
  1107. test_gr_a5a5 7
  1108. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1109. cmp.w #0xa969, @word_dest
  1110. beq .Lwabs162
  1111. fail
  1112. .Lwabs162:
  1113. mov #0xa5a5a5a5, @word_dest
  1114. rotxr_w_abs32_2:
  1115. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1116. set_ccr_zero
  1117. rotxr.w #2, @word_dest:32 ; shift right arithmetic by two, abs32
  1118. ;;; .word 0x6b38
  1119. ;;; .long word_dest
  1120. ;;; .word 0x1350
  1121. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1122. test_zero_clear
  1123. test_ovf_clear
  1124. test_neg_set
  1125. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1126. test_gr_a5a5 2
  1127. test_gr_a5a5 2
  1128. test_gr_a5a5 3
  1129. test_gr_a5a5 4
  1130. test_gr_a5a5 5
  1131. test_gr_a5a5 6
  1132. test_gr_a5a5 7
  1133. ; 1010 0101 1010 0101 -> 1010 1001 0110 1001
  1134. cmp.w #0xa969, @word_dest
  1135. beq .Lwabs322
  1136. fail
  1137. .Lwabs322:
  1138. mov #0xa5a5a5a5, @word_dest
  1139. .endif
  1140. rotxr_l_reg32_1:
  1141. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1142. set_ccr_zero
  1143. rotxr.l er0 ; shift right arithmetic by one, register
  1144. ;;; .word 0x1330
  1145. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1146. test_zero_clear
  1147. test_ovf_clear
  1148. test_neg_clear
  1149. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1150. ; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1151. test_h_gr32 0x52d2d2d2 er0
  1152. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1153. test_gr_a5a5 2
  1154. test_gr_a5a5 3
  1155. test_gr_a5a5 4
  1156. test_gr_a5a5 5
  1157. test_gr_a5a5 6
  1158. test_gr_a5a5 7
  1159. .if (sim_cpu == h8sx)
  1160. rotxr_l_ind_1:
  1161. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1162. set_ccr_zero
  1163. mov #long_dest, er0
  1164. rotxr.l @er0 ; shift right arithmetic by one, indirect
  1165. ;;; .word 0x0104
  1166. ;;; .word 0xa908
  1167. ;;; .word 0x1330
  1168. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1169. test_zero_clear
  1170. test_ovf_clear
  1171. test_neg_clear
  1172. test_h_gr32 long_dest er0
  1173. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1174. test_gr_a5a5 2
  1175. test_gr_a5a5 3
  1176. test_gr_a5a5 4
  1177. test_gr_a5a5 5
  1178. test_gr_a5a5 6
  1179. test_gr_a5a5 7
  1180. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1181. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1182. cmp.l #0x52d2d2d2, @long_dest
  1183. beq .Llind1
  1184. fail
  1185. .Llind1:
  1186. mov #0xa5a5a5a5, @long_dest
  1187. rotxr_l_postinc_1:
  1188. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1189. set_ccr_zero
  1190. mov #long_dest, er0
  1191. rotxr.l @er0+ ; shift right arithmetic by one, postinc
  1192. ;;; .word 0x0104
  1193. ;;; .word 0x6d08
  1194. ;;; .word 0x1330
  1195. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1196. test_zero_clear
  1197. test_ovf_clear
  1198. test_neg_clear
  1199. test_h_gr32 long_dest+4 er0
  1200. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1201. test_gr_a5a5 2
  1202. test_gr_a5a5 3
  1203. test_gr_a5a5 4
  1204. test_gr_a5a5 5
  1205. test_gr_a5a5 6
  1206. test_gr_a5a5 7
  1207. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1208. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1209. cmp.l #0x52d2d2d2, @long_dest
  1210. beq .Llpostinc1
  1211. fail
  1212. .Llpostinc1:
  1213. mov #0xa5a5a5a5, @long_dest
  1214. rotxr_l_postdec_1:
  1215. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1216. set_ccr_zero
  1217. mov #long_dest, er0
  1218. rotxr.l @er0- ; shift right arithmetic by one, postdec
  1219. ;;; .word 0x0106
  1220. ;;; .word 0x6d08
  1221. ;;; .word 0x1330
  1222. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1223. test_zero_clear
  1224. test_ovf_clear
  1225. test_neg_clear
  1226. test_h_gr32 long_dest-4 er0
  1227. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1228. test_gr_a5a5 2
  1229. test_gr_a5a5 3
  1230. test_gr_a5a5 4
  1231. test_gr_a5a5 5
  1232. test_gr_a5a5 6
  1233. test_gr_a5a5 7
  1234. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1235. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1236. cmp.l #0x52d2d2d2, @long_dest
  1237. beq .Llpostdec1
  1238. fail
  1239. .Llpostdec1:
  1240. mov #0xa5a5a5a5, @long_dest
  1241. rotxr_l_preinc_1:
  1242. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1243. set_ccr_zero
  1244. mov #long_dest-4, er0
  1245. rotxr.l @+er0 ; shift right arithmetic by one, preinc
  1246. ;;; .word 0x0105
  1247. ;;; .word 0x6d08
  1248. ;;; .word 0x1330
  1249. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1250. test_zero_clear
  1251. test_ovf_clear
  1252. test_neg_clear
  1253. test_h_gr32 long_dest er0
  1254. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1255. test_gr_a5a5 2
  1256. test_gr_a5a5 3
  1257. test_gr_a5a5 4
  1258. test_gr_a5a5 5
  1259. test_gr_a5a5 6
  1260. test_gr_a5a5 7
  1261. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1262. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1263. cmp.l #0x52d2d2d2, @long_dest
  1264. beq .Llpreinc1
  1265. fail
  1266. .Llpreinc1:
  1267. mov #0xa5a5a5a5, @long_dest
  1268. rotxr_l_predec_1:
  1269. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1270. set_ccr_zero
  1271. mov #long_dest+4, er0
  1272. rotxr.l @-er0 ; shift right arithmetic by one, predec
  1273. ;;; .word 0x0107
  1274. ;;; .word 0x6d08
  1275. ;;; .word 0x1330
  1276. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1277. test_zero_clear
  1278. test_ovf_clear
  1279. test_neg_clear
  1280. test_h_gr32 long_dest er0
  1281. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1282. test_gr_a5a5 2
  1283. test_gr_a5a5 3
  1284. test_gr_a5a5 4
  1285. test_gr_a5a5 5
  1286. test_gr_a5a5 6
  1287. test_gr_a5a5 7
  1288. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1289. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1290. cmp.l #0x52d2d2d2, @long_dest
  1291. beq .Llpredec1
  1292. fail
  1293. .Llpredec1:
  1294. mov #0xa5a5a5a5, @long_dest
  1295. rotxr_l_disp2_1:
  1296. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1297. set_ccr_zero
  1298. mov #long_dest-8, er0
  1299. rotxr.l @(8:2, er0) ; shift right arithmetic by one, disp2
  1300. ;;; .word 0x0106
  1301. ;;; .word 0xa908
  1302. ;;; .word 0x1330
  1303. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1304. test_zero_clear
  1305. test_ovf_clear
  1306. test_neg_clear
  1307. test_h_gr32 long_dest-8 er0
  1308. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1309. test_gr_a5a5 2
  1310. test_gr_a5a5 3
  1311. test_gr_a5a5 4
  1312. test_gr_a5a5 5
  1313. test_gr_a5a5 6
  1314. test_gr_a5a5 7
  1315. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1316. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1317. cmp.l #0x52d2d2d2, @long_dest
  1318. beq .Lldisp21
  1319. fail
  1320. .Lldisp21:
  1321. mov #0xa5a5a5a5, @long_dest
  1322. rotxr_l_disp16_1:
  1323. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1324. set_ccr_zero
  1325. mov #long_dest-44, er0
  1326. rotxr.l @(44:16, er0) ; shift right arithmetic by one, disp16
  1327. ;;; .word 0x0104
  1328. ;;; .word 0x6f08
  1329. ;;; .word 44
  1330. ;;; .word 0x1330
  1331. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1332. test_zero_clear
  1333. test_ovf_clear
  1334. test_neg_clear
  1335. test_h_gr32 long_dest-44 er0
  1336. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1337. test_gr_a5a5 2
  1338. test_gr_a5a5 3
  1339. test_gr_a5a5 4
  1340. test_gr_a5a5 5
  1341. test_gr_a5a5 6
  1342. test_gr_a5a5 7
  1343. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1344. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1345. cmp.l #0x52d2d2d2, @long_dest
  1346. beq .Lldisp161
  1347. fail
  1348. .Lldisp161:
  1349. mov #0xa5a5a5a5, @long_dest
  1350. rotxr_l_disp32_1:
  1351. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1352. set_ccr_zero
  1353. mov #long_dest-666, er0
  1354. rotxr.l @(666:32, er0) ; shift right arithmetic by one, disp32
  1355. ;;; .word 0x7884
  1356. ;;; .word 0x6b28
  1357. ;;; .long 666
  1358. ;;; .word 0x1330
  1359. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1360. test_zero_clear
  1361. test_ovf_clear
  1362. test_neg_clear
  1363. test_h_gr32 long_dest-666 er0
  1364. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1365. test_gr_a5a5 2
  1366. test_gr_a5a5 3
  1367. test_gr_a5a5 4
  1368. test_gr_a5a5 5
  1369. test_gr_a5a5 6
  1370. test_gr_a5a5 7
  1371. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1372. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1373. cmp.l #0x52d2d2d2, @long_dest
  1374. beq .Lldisp321
  1375. fail
  1376. .Lldisp321:
  1377. mov #0xa5a5a5a5, @long_dest
  1378. rotxr_l_abs16_1:
  1379. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1380. set_ccr_zero
  1381. rotxr.l @long_dest:16 ; shift right arithmetic by one, abs16
  1382. ;;; .word 0x0104
  1383. ;;; .word 0x6b08
  1384. ;;; .word long_dest
  1385. ;;; .word 0x1330
  1386. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1387. test_zero_clear
  1388. test_ovf_clear
  1389. test_neg_clear
  1390. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1391. test_gr_a5a5 1
  1392. test_gr_a5a5 2
  1393. test_gr_a5a5 3
  1394. test_gr_a5a5 4
  1395. test_gr_a5a5 5
  1396. test_gr_a5a5 6
  1397. test_gr_a5a5 7
  1398. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1399. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1400. cmp.l #0x52d2d2d2, @long_dest
  1401. beq .Llabs161
  1402. fail
  1403. .Llabs161:
  1404. mov #0xa5a5a5a5, @long_dest
  1405. rotxr_l_abs32_1:
  1406. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1407. set_ccr_zero
  1408. rotxr.l @long_dest:32 ; shift right arithmetic by one, abs32
  1409. ;;; .word 0x0104
  1410. ;;; .word 0x6b28
  1411. ;;; .long long_dest
  1412. ;;; .word 0x1330
  1413. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1414. test_zero_clear
  1415. test_ovf_clear
  1416. test_neg_clear
  1417. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1418. test_gr_a5a5 1
  1419. test_gr_a5a5 2
  1420. test_gr_a5a5 3
  1421. test_gr_a5a5 4
  1422. test_gr_a5a5 5
  1423. test_gr_a5a5 6
  1424. test_gr_a5a5 7
  1425. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1426. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  1427. cmp.l #0x52d2d2d2, @long_dest
  1428. beq .Llabs321
  1429. fail
  1430. .Llabs321:
  1431. mov #0xa5a5a5a5, @long_dest
  1432. .endif
  1433. rotxr_l_reg32_2:
  1434. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1435. set_ccr_zero
  1436. rotxr.l #2, er0 ; shift right arithmetic by two, register
  1437. ;;; .word 0x1370
  1438. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1439. test_zero_clear
  1440. test_ovf_clear
  1441. test_neg_set
  1442. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1443. ; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1444. test_h_gr32 0xa9696969 er0
  1445. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1446. test_gr_a5a5 2
  1447. test_gr_a5a5 3
  1448. test_gr_a5a5 4
  1449. test_gr_a5a5 5
  1450. test_gr_a5a5 6
  1451. test_gr_a5a5 7
  1452. .if (sim_cpu == h8sx)
  1453. rotxr_l_ind_2:
  1454. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1455. set_ccr_zero
  1456. mov #long_dest, er0
  1457. rotxr.l #2, @er0 ; shift right arithmetic by two, indirect
  1458. ;;; .word 0x0104
  1459. ;;; .word 0xa908
  1460. ;;; .word 0x1370
  1461. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1462. test_zero_clear
  1463. test_ovf_clear
  1464. test_neg_set
  1465. test_h_gr32 long_dest er0
  1466. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1467. test_gr_a5a5 2
  1468. test_gr_a5a5 3
  1469. test_gr_a5a5 4
  1470. test_gr_a5a5 5
  1471. test_gr_a5a5 6
  1472. test_gr_a5a5 7
  1473. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1474. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1475. cmp.l #0xa9696969, @long_dest
  1476. beq .Llind2
  1477. fail
  1478. .Llind2:
  1479. mov #0xa5a5a5a5, @long_dest
  1480. rotxr_l_postinc_2:
  1481. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1482. set_ccr_zero
  1483. mov #long_dest, er0
  1484. rotxr.l #2, @er0+ ; shift right arithmetic by two, postinc
  1485. ;;; .word 0x0104
  1486. ;;; .word 0x6d08
  1487. ;;; .word 0x1370
  1488. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1489. test_zero_clear
  1490. test_ovf_clear
  1491. test_neg_set
  1492. test_h_gr32 long_dest+4 er0
  1493. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1494. test_gr_a5a5 2
  1495. test_gr_a5a5 3
  1496. test_gr_a5a5 4
  1497. test_gr_a5a5 5
  1498. test_gr_a5a5 6
  1499. test_gr_a5a5 7
  1500. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1501. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1502. cmp.l #0xa9696969, @long_dest
  1503. beq .Llpostinc2
  1504. fail
  1505. .Llpostinc2:
  1506. mov #0xa5a5a5a5, @long_dest
  1507. rotxr_l_postdec_2:
  1508. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1509. set_ccr_zero
  1510. mov #long_dest, er0
  1511. rotxr.l #2, @er0- ; shift right arithmetic by two, postdec
  1512. ;;; .word 0x0106
  1513. ;;; .word 0x6d08
  1514. ;;; .word 0x1370
  1515. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1516. test_zero_clear
  1517. test_ovf_clear
  1518. test_neg_set
  1519. test_h_gr32 long_dest-4 er0
  1520. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1521. test_gr_a5a5 2
  1522. test_gr_a5a5 3
  1523. test_gr_a5a5 4
  1524. test_gr_a5a5 5
  1525. test_gr_a5a5 6
  1526. test_gr_a5a5 7
  1527. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1528. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1529. cmp.l #0xa9696969, @long_dest
  1530. beq .Llpostdec2
  1531. fail
  1532. .Llpostdec2:
  1533. mov #0xa5a5a5a5, @long_dest
  1534. rotxr_l_preinc_2:
  1535. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1536. set_ccr_zero
  1537. mov #long_dest-4, er0
  1538. rotxr.l #2, @+er0 ; shift right arithmetic by two, preinc
  1539. ;;; .word 0x0105
  1540. ;;; .word 0x6d08
  1541. ;;; .word 0x1370
  1542. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1543. test_zero_clear
  1544. test_ovf_clear
  1545. test_neg_set
  1546. test_h_gr32 long_dest er0
  1547. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1548. test_gr_a5a5 2
  1549. test_gr_a5a5 3
  1550. test_gr_a5a5 4
  1551. test_gr_a5a5 5
  1552. test_gr_a5a5 6
  1553. test_gr_a5a5 7
  1554. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1555. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1556. cmp.l #0xa9696969, @long_dest
  1557. beq .Llpreinc2
  1558. fail
  1559. .Llpreinc2:
  1560. mov #0xa5a5a5a5, @long_dest
  1561. rotxr_l_predec_2:
  1562. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1563. set_ccr_zero
  1564. mov #long_dest+4, er0
  1565. rotxr.l #2, @-er0 ; shift right arithmetic by two, predec
  1566. ;;; .word 0x0107
  1567. ;;; .word 0x6d08
  1568. ;;; .word 0x1370
  1569. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1570. test_zero_clear
  1571. test_ovf_clear
  1572. test_neg_set
  1573. test_h_gr32 long_dest er0
  1574. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1575. test_gr_a5a5 2
  1576. test_gr_a5a5 3
  1577. test_gr_a5a5 4
  1578. test_gr_a5a5 5
  1579. test_gr_a5a5 6
  1580. test_gr_a5a5 7
  1581. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1582. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1583. cmp.l #0xa9696969, @long_dest
  1584. beq .Llpredec2
  1585. fail
  1586. .Llpredec2:
  1587. mov #0xa5a5a5a5, @long_dest
  1588. rotxr_l_disp2_2:
  1589. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1590. set_ccr_zero
  1591. mov #long_dest-8, er0
  1592. rotxr.l #2, @(8:2, er0) ; shift right arithmetic by two, disp2
  1593. ;;; .word 0x0106
  1594. ;;; .word 0xa908
  1595. ;;; .word 0x1370
  1596. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1597. test_zero_clear
  1598. test_ovf_clear
  1599. test_neg_set
  1600. test_h_gr32 long_dest-8 er0
  1601. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1602. test_gr_a5a5 2
  1603. test_gr_a5a5 3
  1604. test_gr_a5a5 4
  1605. test_gr_a5a5 5
  1606. test_gr_a5a5 6
  1607. test_gr_a5a5 7
  1608. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1609. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1610. cmp.l #0xa9696969, @long_dest
  1611. beq .Lldisp22
  1612. fail
  1613. .Lldisp22:
  1614. mov #0xa5a5a5a5, @long_dest
  1615. rotxr_l_disp16_2:
  1616. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1617. set_ccr_zero
  1618. mov #long_dest-44, er0
  1619. rotxr.l #2, @(44:16, er0) ; shift right arithmetic by two, disp16
  1620. ;;; .word 0x0104
  1621. ;;; .word 0x6f08
  1622. ;;; .word 44
  1623. ;;; .word 0x1370
  1624. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1625. test_zero_clear
  1626. test_ovf_clear
  1627. test_neg_set
  1628. test_h_gr32 long_dest-44 er0
  1629. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1630. test_gr_a5a5 2
  1631. test_gr_a5a5 3
  1632. test_gr_a5a5 4
  1633. test_gr_a5a5 5
  1634. test_gr_a5a5 6
  1635. test_gr_a5a5 7
  1636. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1637. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1638. cmp.l #0xa9696969, @long_dest
  1639. beq .Lldisp162
  1640. fail
  1641. .Lldisp162:
  1642. mov #0xa5a5a5a5, @long_dest
  1643. rotxr_l_disp32_2:
  1644. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1645. set_ccr_zero
  1646. mov #long_dest-666, er0
  1647. rotxr.l #2, @(666:32, er0) ; shift right arithmetic by two, disp32
  1648. ;;; .word 0x7884
  1649. ;;; .word 0x6b28
  1650. ;;; .long 666
  1651. ;;; .word 0x1370
  1652. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1653. test_zero_clear
  1654. test_ovf_clear
  1655. test_neg_set
  1656. test_h_gr32 long_dest-666 er0
  1657. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1658. test_gr_a5a5 2
  1659. test_gr_a5a5 3
  1660. test_gr_a5a5 4
  1661. test_gr_a5a5 5
  1662. test_gr_a5a5 6
  1663. test_gr_a5a5 7
  1664. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1665. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1666. cmp.l #0xa9696969, @long_dest
  1667. beq .Lldisp322
  1668. fail
  1669. .Lldisp322:
  1670. mov #0xa5a5a5a5, @long_dest
  1671. rotxr_l_abs16_2:
  1672. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1673. set_ccr_zero
  1674. rotxr.l #2, @long_dest:16 ; shift right arithmetic by two, abs16
  1675. ;;; .word 0x0104
  1676. ;;; .word 0x6b08
  1677. ;;; .word long_dest
  1678. ;;; .word 0x1370
  1679. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1680. test_zero_clear
  1681. test_ovf_clear
  1682. test_neg_set
  1683. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1684. test_gr_a5a5 1
  1685. test_gr_a5a5 2
  1686. test_gr_a5a5 3
  1687. test_gr_a5a5 4
  1688. test_gr_a5a5 5
  1689. test_gr_a5a5 6
  1690. test_gr_a5a5 7
  1691. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1692. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1693. cmp.l #0xa9696969, @long_dest
  1694. beq .Llabs162
  1695. fail
  1696. .Llabs162:
  1697. mov #0xa5a5a5a5, @long_dest
  1698. rotxr_l_abs32_2:
  1699. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1700. set_ccr_zero
  1701. rotxr.l #2, @long_dest:32 ; shift right arithmetic by two, abs32
  1702. ;;; .word 0x0104
  1703. ;;; .word 0x6b28
  1704. ;;; .long long_dest
  1705. ;;; .word 0x1370
  1706. test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
  1707. test_zero_clear
  1708. test_ovf_clear
  1709. test_neg_set
  1710. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1711. test_gr_a5a5 1
  1712. test_gr_a5a5 2
  1713. test_gr_a5a5 3
  1714. test_gr_a5a5 4
  1715. test_gr_a5a5 5
  1716. test_gr_a5a5 6
  1717. test_gr_a5a5 7
  1718. ; 1010 0101 1010 0101 1010 0101 1010 0101
  1719. ;; -> 1010 1001 0110 1001 0110 1001 0110 1001
  1720. cmp.l #0xa9696969, @long_dest
  1721. beq .Llabs322
  1722. fail
  1723. .Llabs322:
  1724. mov #0xa5a5a5a5, @long_dest
  1725. .endif
  1726. .endif
  1727. pass
  1728. exit 0