shlr.s 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085
  1. # Hitachi H8 testcase 'shlr'
  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. shlr_b_reg8_1:
  20. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  21. set_ccr_zero
  22. shlr.b r0l ; shift right logical by one
  23. ;;; .word 0x1108
  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. shlr_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. shlr.b @er0 ; shift right logical by one, indirect
  45. ;;; .word 0x7d00
  46. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  65. shlr_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. shlr.b @er0+ ; shift right logical by one, postinc
  70. ;;; .word 0x0174
  71. ;;; .word 0x6c08
  72. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  91. shlr_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. shlr.b @er0- ; shift right logical by one, postdec
  96. ;;; .word 0x0176
  97. ;;; .word 0x6c08
  98. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  117. shlr_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. shlr.b @+er0 ; shift right logical by one, preinc
  122. ;;; .word 0x0175
  123. ;;; .word 0x6c08
  124. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  143. shlr_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. shlr.b @-er0 ; shift right logical by one, predec
  148. ;;; .word 0x0177
  149. ;;; .word 0x6c08
  150. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  169. shlr_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. shlr.b @(2:2, er0) ; shift right logical by one, disp2
  174. ;;; .word 0x0176
  175. ;;; .word 0x6808
  176. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  195. shlr_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. shlr.b @(44:16, er0) ; shift right logical by one, disp16
  200. ;;; .word 0x0174
  201. ;;; .word 0x6e08
  202. ;;; .word 44
  203. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  222. shlr_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. shlr.b @(666:32, er0) ; shift right logical by one, disp32
  227. ;;; .word 0x7884
  228. ;;; .word 0x6a28
  229. ;;; .long 666
  230. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  249. shlr_b_abs16_1:
  250. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  251. set_ccr_zero
  252. shlr.b @byte_dest:16 ; shift right logical by one, abs16
  253. ;;; .word 0x6a18
  254. ;;; .word byte_dest
  255. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  274. shlr_b_abs32_1:
  275. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  276. set_ccr_zero
  277. shlr.b @byte_dest:32 ; shift right logical by one, abs32
  278. ;;; .word 0x6a38
  279. ;;; .long byte_dest
  280. ;;; .word 0x1100
  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.b #0xa5, @byte_dest
  299. .endif
  300. shlr_b_reg8_2:
  301. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  302. set_ccr_zero
  303. shlr.b #2, r0l ; shift right logical by two
  304. ;;; .word 0x1148
  305. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  306. test_zero_clear
  307. test_ovf_clear
  308. test_neg_clear
  309. test_h_gr16 0xa529 r0 ; 1010 0101 -> 0010 1001
  310. .if (sim_cpu)
  311. test_h_gr32 0xa5a5a529 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. shlr_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. shlr.b #2, @er0 ; shift right logical by two, indirect
  326. ;;; .word 0x7d00
  327. ;;; .word 0x1140
  328. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  329. test_zero_clear
  330. test_ovf_clear
  331. test_neg_clear
  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 -> 0010 1001
  341. cmp.b #0x29, @byte_dest
  342. beq .Lbind2
  343. fail
  344. .Lbind2:
  345. mov.b #0xa5, @byte_dest
  346. shlr_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. shlr.b #2, @er0+ ; shift right logical by two, postinc
  351. ;;; .word 0x0174
  352. ;;; .word 0x6c08
  353. ;;; .word 0x1140
  354. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  355. test_zero_clear
  356. test_ovf_clear
  357. test_neg_clear
  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 -> 0010 1001
  367. cmp.b #0x29, @byte_dest
  368. beq .Lbpostinc2
  369. fail
  370. .Lbpostinc2:
  371. mov.b #0xa5, @byte_dest
  372. shlr_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. shlr.b #2, @er0- ; shift right logical by two, postdec
  377. ;;; .word 0x0176
  378. ;;; .word 0x6c08
  379. ;;; .word 0x1140
  380. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  381. test_zero_clear
  382. test_ovf_clear
  383. test_neg_clear
  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 -> 0010 1001
  393. cmp.b #0x29, @byte_dest
  394. beq .Lbpostdec2
  395. fail
  396. .Lbpostdec2:
  397. mov.b #0xa5, @byte_dest
  398. shlr_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. shlr.b #2, @+er0 ; shift right logical by two, preinc
  403. ;;; .word 0x0175
  404. ;;; .word 0x6c08
  405. ;;; .word 0x1140
  406. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  407. test_zero_clear
  408. test_ovf_clear
  409. test_neg_clear
  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 -> 0010 1001
  419. cmp.b #0x29, @byte_dest
  420. beq .Lbpreinc2
  421. fail
  422. .Lbpreinc2:
  423. mov.b #0xa5, @byte_dest
  424. shlr_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. shlr.b #2, @-er0 ; shift right logical by two, predec
  429. ;;; .word 0x0177
  430. ;;; .word 0x6c08
  431. ;;; .word 0x1140
  432. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  433. test_zero_clear
  434. test_ovf_clear
  435. test_neg_clear
  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 -> 0010 1001
  445. cmp.b #0x29, @byte_dest
  446. beq .Lbpredec2
  447. fail
  448. .Lbpredec2:
  449. mov.b #0xa5, @byte_dest
  450. shlr_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. shlr.b #2, @(2:2, er0) ; shift right logical by two, disp2
  455. ;;; .word 0x0176
  456. ;;; .word 0x6808
  457. ;;; .word 0x1140
  458. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  459. test_zero_clear
  460. test_ovf_clear
  461. test_neg_clear
  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 -> 0010 1001
  471. cmp.b #0x29, @byte_dest
  472. beq .Lbdisp22
  473. fail
  474. .Lbdisp22:
  475. mov.b #0xa5, @byte_dest
  476. shlr_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. shlr.b #2, @(44:16, er0) ; shift right logical by two, disp16
  481. ;;; .word 0x0174
  482. ;;; .word 0x6e08
  483. ;;; .word 44
  484. ;;; .word 0x1140
  485. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  486. test_zero_clear
  487. test_ovf_clear
  488. test_neg_clear
  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 -> 0010 1001
  498. cmp.b #0x29, @byte_dest
  499. beq .Lbdisp162
  500. fail
  501. .Lbdisp162:
  502. mov.b #0xa5, @byte_dest
  503. shlr_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. shlr.b #2, @(666:32, er0) ; shift right logical by two, disp32
  508. ;;; .word 0x7884
  509. ;;; .word 0x6a28
  510. ;;; .long 666
  511. ;;; .word 0x1140
  512. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  513. test_zero_clear
  514. test_ovf_clear
  515. test_neg_clear
  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 -> 0010 1001
  525. cmp.b #0x29, @byte_dest
  526. beq .Lbdisp322
  527. fail
  528. .Lbdisp322:
  529. mov.b #0xa5, @byte_dest
  530. shlr_b_abs16_2:
  531. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  532. set_ccr_zero
  533. shlr.b #2, @byte_dest:16 ; shift right logical by two, abs16
  534. ;;; .word 0x6a18
  535. ;;; .word byte_dest
  536. ;;; .word 0x1140
  537. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  538. test_zero_clear
  539. test_ovf_clear
  540. test_neg_clear
  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 -> 0010 1001
  550. cmp.b #0x29, @byte_dest
  551. beq .Lbabs162
  552. fail
  553. .Lbabs162:
  554. mov.b #0xa5, @byte_dest
  555. shlr_b_abs32_2:
  556. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  557. set_ccr_zero
  558. shlr.b #2, @byte_dest:32 ; shift right logical by two, abs32
  559. ;;; .word 0x6a38
  560. ;;; .long byte_dest
  561. ;;; .word 0x1140
  562. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  563. test_zero_clear
  564. test_ovf_clear
  565. test_neg_clear
  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 -> 0010 1001
  575. cmp.b #0x29, @byte_dest
  576. beq .Lbabs322
  577. fail
  578. .Lbabs322:
  579. mov.b #0xa5, @byte_dest
  580. shlr_b_reg8_4:
  581. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  582. set_ccr_zero
  583. shlr.b #4, r0l ; shift right logical by four
  584. ;;; .word 0x11a8
  585. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  586. test_zero_clear
  587. test_ovf_clear
  588. test_neg_clear
  589. test_h_gr16 0xa50a r0 ; 1010 0101 -> 0000 1010
  590. test_h_gr32 0xa5a5a50a er0
  591. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  592. test_gr_a5a5 2
  593. test_gr_a5a5 3
  594. test_gr_a5a5 4
  595. test_gr_a5a5 5
  596. test_gr_a5a5 6
  597. test_gr_a5a5 7
  598. shlr_b_reg8_reg8:
  599. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  600. set_ccr_zero
  601. mov #5, r0h
  602. shlr.b r0h, r0l ; shift right logical by register value
  603. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  604. test_zero_clear
  605. test_ovf_clear
  606. test_neg_clear
  607. test_h_gr16 0x0505 r0 ; 1010 0101 -> 0000 0101
  608. test_h_gr32 0xa5a50505 er0
  609. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  610. test_gr_a5a5 2
  611. test_gr_a5a5 3
  612. test_gr_a5a5 4
  613. test_gr_a5a5 5
  614. test_gr_a5a5 6
  615. test_gr_a5a5 7
  616. shlr_b_ind_4:
  617. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  618. set_ccr_zero
  619. mov #byte_dest, er0
  620. shlr.b #4, @er0 ; shift right logical by four, indirect
  621. ;;; .word 0x7d00
  622. ;;; .word 0x11a0
  623. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  624. test_zero_clear
  625. test_ovf_clear
  626. test_neg_clear
  627. test_h_gr32 byte_dest er0
  628. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  629. test_gr_a5a5 2
  630. test_gr_a5a5 3
  631. test_gr_a5a5 4
  632. test_gr_a5a5 5
  633. test_gr_a5a5 6
  634. test_gr_a5a5 7
  635. ; 1010 0101 -> 0000 1010
  636. cmp.b #0x0a, @byte_dest
  637. beq .Lbind4
  638. fail
  639. .Lbind4:
  640. mov.b #0xa5, @byte_dest
  641. shlr_b_postinc_4:
  642. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  643. set_ccr_zero
  644. mov #byte_dest, er0
  645. shlr.b #4, @er0+ ; shift right logical by four, postinc
  646. ;;; .word 0x0174
  647. ;;; .word 0x6c08
  648. ;;; .word 0x11a0
  649. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  650. test_zero_clear
  651. test_ovf_clear
  652. test_neg_clear
  653. test_h_gr32 byte_dest+1 er0
  654. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  655. test_gr_a5a5 2
  656. test_gr_a5a5 3
  657. test_gr_a5a5 4
  658. test_gr_a5a5 5
  659. test_gr_a5a5 6
  660. test_gr_a5a5 7
  661. ; 1010 0101 -> 0000 1010
  662. cmp.b #0x0a, @byte_dest
  663. beq .Lbpostinc4
  664. fail
  665. .Lbpostinc4:
  666. mov.b #0xa5, @byte_dest
  667. shlr_b_postdec_4:
  668. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  669. set_ccr_zero
  670. mov #byte_dest, er0
  671. shlr.b #4, @er0- ; shift right logical by four, postdec
  672. ;;; .word 0x0176
  673. ;;; .word 0x6c08
  674. ;;; .word 0x11a0
  675. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  676. test_zero_clear
  677. test_ovf_clear
  678. test_neg_clear
  679. test_h_gr32 byte_dest-1 er0
  680. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  681. test_gr_a5a5 2
  682. test_gr_a5a5 3
  683. test_gr_a5a5 4
  684. test_gr_a5a5 5
  685. test_gr_a5a5 6
  686. test_gr_a5a5 7
  687. ; 1010 0101 -> 0000 1010
  688. cmp.b #0x0a, @byte_dest
  689. beq .Lbpostdec4
  690. fail
  691. .Lbpostdec4:
  692. mov.b #0xa5, @byte_dest
  693. shlr_b_preinc_4:
  694. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  695. set_ccr_zero
  696. mov #byte_dest-1, er0
  697. shlr.b #4, @+er0 ; shift right logical by four, preinc
  698. ;;; .word 0x0175
  699. ;;; .word 0x6c08
  700. ;;; .word 0x11a0
  701. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  702. test_zero_clear
  703. test_ovf_clear
  704. test_neg_clear
  705. test_h_gr32 byte_dest er0
  706. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  707. test_gr_a5a5 2
  708. test_gr_a5a5 3
  709. test_gr_a5a5 4
  710. test_gr_a5a5 5
  711. test_gr_a5a5 6
  712. test_gr_a5a5 7
  713. ; 1010 0101 -> 0000 1010
  714. cmp.b #0x0a, @byte_dest
  715. beq .Lbpreinc4
  716. fail
  717. .Lbpreinc4:
  718. mov.b #0xa5, @byte_dest
  719. shlr_b_predec_4:
  720. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  721. set_ccr_zero
  722. mov #byte_dest+1, er0
  723. shlr.b #4, @-er0 ; shift right logical by four, predec
  724. ;;; .word 0x0177
  725. ;;; .word 0x6c08
  726. ;;; .word 0x11a0
  727. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  728. test_zero_clear
  729. test_ovf_clear
  730. test_neg_clear
  731. test_h_gr32 byte_dest er0
  732. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  733. test_gr_a5a5 2
  734. test_gr_a5a5 3
  735. test_gr_a5a5 4
  736. test_gr_a5a5 5
  737. test_gr_a5a5 6
  738. test_gr_a5a5 7
  739. ; 1010 0101 -> 0000 1010
  740. cmp.b #0x0a, @byte_dest
  741. beq .Lbpredec4
  742. fail
  743. .Lbpredec4:
  744. mov.b #0xa5, @byte_dest
  745. shlr_b_disp2_4:
  746. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  747. set_ccr_zero
  748. mov #byte_dest-2, er0
  749. shlr.b #4, @(2:2, er0) ; shift right logical by four, disp2
  750. ;;; .word 0x0176
  751. ;;; .word 0x6808
  752. ;;; .word 0x11a0
  753. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  754. test_zero_clear
  755. test_ovf_clear
  756. test_neg_clear
  757. test_h_gr32 byte_dest-2 er0
  758. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  759. test_gr_a5a5 2
  760. test_gr_a5a5 3
  761. test_gr_a5a5 4
  762. test_gr_a5a5 5
  763. test_gr_a5a5 6
  764. test_gr_a5a5 7
  765. ; 1010 0101 -> 0000 1010
  766. cmp.b #0x0a, @byte_dest
  767. beq .Lbdisp24
  768. fail
  769. .Lbdisp24:
  770. mov.b #0xa5, @byte_dest
  771. shlr_b_disp16_4:
  772. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  773. set_ccr_zero
  774. mov #byte_dest-44, er0
  775. shlr.b #4, @(44:16, er0) ; shift right logical by four, disp16
  776. ;;; .word 0x0174
  777. ;;; .word 0x6e08
  778. ;;; .word 44
  779. ;;; .word 0x11a0
  780. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  781. test_zero_clear
  782. test_ovf_clear
  783. test_neg_clear
  784. test_h_gr32 byte_dest-44 er0
  785. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  786. test_gr_a5a5 2
  787. test_gr_a5a5 3
  788. test_gr_a5a5 4
  789. test_gr_a5a5 5
  790. test_gr_a5a5 6
  791. test_gr_a5a5 7
  792. ; 1010 0101 -> 0000 1010
  793. cmp.b #0x0a, @byte_dest
  794. beq .Lbdisp164
  795. fail
  796. .Lbdisp164:
  797. mov.b #0xa5, @byte_dest
  798. shlr_b_disp32_4:
  799. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  800. set_ccr_zero
  801. mov #byte_dest-666, er0
  802. shlr.b #4, @(666:32, er0) ; shift right logical by four, disp32
  803. ;;; .word 0x7884
  804. ;;; .word 0x6a28
  805. ;;; .long 666
  806. ;;; .word 0x11a0
  807. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  808. test_zero_clear
  809. test_ovf_clear
  810. test_neg_clear
  811. test_h_gr32 byte_dest-666 er0
  812. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  813. test_gr_a5a5 2
  814. test_gr_a5a5 3
  815. test_gr_a5a5 4
  816. test_gr_a5a5 5
  817. test_gr_a5a5 6
  818. test_gr_a5a5 7
  819. ; 1010 0101 -> 0000 1010
  820. cmp.b #0x0a, @byte_dest
  821. beq .Lbdisp324
  822. fail
  823. .Lbdisp324:
  824. mov.b #0xa5, @byte_dest
  825. shlr_b_abs16_4:
  826. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  827. set_ccr_zero
  828. shlr.b #4, @byte_dest:16 ; shift right logical by four, abs16
  829. ;;; .word 0x6a18
  830. ;;; .word byte_dest
  831. ;;; .word 0x11a0
  832. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  833. test_zero_clear
  834. test_ovf_clear
  835. test_neg_clear
  836. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  837. test_gr_a5a5 2
  838. test_gr_a5a5 2
  839. test_gr_a5a5 3
  840. test_gr_a5a5 4
  841. test_gr_a5a5 5
  842. test_gr_a5a5 6
  843. test_gr_a5a5 7
  844. ; 1010 0101 -> 0000 1010
  845. cmp.b #0x0a, @byte_dest
  846. beq .Lbabs164
  847. fail
  848. .Lbabs164:
  849. mov.b #0xa5, @byte_dest
  850. shlr_b_abs32_4:
  851. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  852. set_ccr_zero
  853. shlr.b #4, @byte_dest:32 ; shift right logical by four, abs32
  854. ;;; .word 0x6a38
  855. ;;; .long byte_dest
  856. ;;; .word 0x11a0
  857. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  858. test_zero_clear
  859. test_ovf_clear
  860. test_neg_clear
  861. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  862. test_gr_a5a5 2
  863. test_gr_a5a5 2
  864. test_gr_a5a5 3
  865. test_gr_a5a5 4
  866. test_gr_a5a5 5
  867. test_gr_a5a5 6
  868. test_gr_a5a5 7
  869. ; 1010 0101 -> 0000 1010
  870. cmp.b #0x0a, @byte_dest
  871. beq .Lbabs324
  872. fail
  873. .Lbabs324:
  874. mov.b #0xa5, @byte_dest
  875. .endif
  876. .if (sim_cpu == h8sx)
  877. shlr_w_imm5_1:
  878. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  879. set_ccr_zero
  880. shlr.w #15:5, r0 ; shift right logical by 5-bit immediate
  881. ;;; .word 0x038f
  882. ;;; .word 0x1110
  883. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  884. test_zero_clear
  885. test_ovf_clear
  886. test_neg_clear
  887. ; 1010 0101 1010 0101 -> 0000 0000 0000 0001
  888. test_h_gr32 0xa5a50001 er0
  889. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  890. test_gr_a5a5 2
  891. test_gr_a5a5 3
  892. test_gr_a5a5 4
  893. test_gr_a5a5 5
  894. test_gr_a5a5 6
  895. test_gr_a5a5 7
  896. .endif
  897. .if (sim_cpu) ; Not available in h8300 mode
  898. shlr_w_reg16_1:
  899. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  900. set_ccr_zero
  901. shlr.w r0 ; shift right logical by one
  902. ;;; .word 0x1110
  903. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  904. test_zero_clear
  905. test_ovf_clear
  906. test_neg_clear
  907. test_h_gr16 0x52d2 r0 ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  908. test_h_gr32 0xa5a552d2 er0
  909. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  910. test_gr_a5a5 2
  911. test_gr_a5a5 3
  912. test_gr_a5a5 4
  913. test_gr_a5a5 5
  914. test_gr_a5a5 6
  915. test_gr_a5a5 7
  916. .if (sim_cpu == h8sx)
  917. shlr_w_ind_1:
  918. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  919. set_ccr_zero
  920. mov #word_dest, er0
  921. shlr.w @er0 ; shift right logical by one, indirect
  922. ;;; .word 0x7d80
  923. ;;; .word 0x1110
  924. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  925. test_zero_clear
  926. test_ovf_clear
  927. test_neg_clear
  928. test_h_gr32 word_dest er0
  929. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  930. test_gr_a5a5 2
  931. test_gr_a5a5 3
  932. test_gr_a5a5 4
  933. test_gr_a5a5 5
  934. test_gr_a5a5 6
  935. test_gr_a5a5 7
  936. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  937. cmp.w #0x52d2, @word_dest
  938. beq .Lwind1
  939. fail
  940. .Lwind1:
  941. mov.w #0xa5a5, @word_dest
  942. shlr_w_postinc_1:
  943. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  944. set_ccr_zero
  945. mov #word_dest, er0
  946. shlr.w @er0+ ; shift right logical by one, postinc
  947. ;;; .word 0x0154
  948. ;;; .word 0x6d08
  949. ;;; .word 0x1110
  950. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  951. test_zero_clear
  952. test_ovf_clear
  953. test_neg_clear
  954. test_h_gr32 word_dest+2 er0
  955. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  956. test_gr_a5a5 2
  957. test_gr_a5a5 3
  958. test_gr_a5a5 4
  959. test_gr_a5a5 5
  960. test_gr_a5a5 6
  961. test_gr_a5a5 7
  962. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  963. cmp.w #0x52d2, @word_dest
  964. beq .Lwpostinc1
  965. fail
  966. .Lwpostinc1:
  967. mov.w #0xa5a5, @word_dest
  968. shlr_w_postdec_1:
  969. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  970. set_ccr_zero
  971. mov #word_dest, er0
  972. shlr.w @er0- ; shift right logical by one, postdec
  973. ;;; .word 0x0156
  974. ;;; .word 0x6d08
  975. ;;; .word 0x1110
  976. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  977. test_zero_clear
  978. test_ovf_clear
  979. test_neg_clear
  980. test_h_gr32 word_dest-2 er0
  981. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  982. test_gr_a5a5 2
  983. test_gr_a5a5 3
  984. test_gr_a5a5 4
  985. test_gr_a5a5 5
  986. test_gr_a5a5 6
  987. test_gr_a5a5 7
  988. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  989. cmp.w #0x52d2, @word_dest
  990. beq .Lwpostdec1
  991. fail
  992. .Lwpostdec1:
  993. mov.w #0xa5a5, @word_dest
  994. shlr_w_preinc_1:
  995. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  996. set_ccr_zero
  997. mov #word_dest-2, er0
  998. shlr.w @+er0 ; shift right logical by one, preinc
  999. ;;; .word 0x0155
  1000. ;;; .word 0x6d08
  1001. ;;; .word 0x1110
  1002. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1003. test_zero_clear
  1004. test_ovf_clear
  1005. test_neg_clear
  1006. test_h_gr32 word_dest er0
  1007. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1008. test_gr_a5a5 2
  1009. test_gr_a5a5 3
  1010. test_gr_a5a5 4
  1011. test_gr_a5a5 5
  1012. test_gr_a5a5 6
  1013. test_gr_a5a5 7
  1014. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1015. cmp.w #0x52d2, @word_dest
  1016. beq .Lwpreinc1
  1017. fail
  1018. .Lwpreinc1:
  1019. mov.w #0xa5a5, @word_dest
  1020. shlr_w_predec_1:
  1021. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1022. set_ccr_zero
  1023. mov #word_dest+2, er0
  1024. shlr.w @-er0 ; shift right logical by one, predec
  1025. ;;; .word 0x0157
  1026. ;;; .word 0x6d08
  1027. ;;; .word 0x1110
  1028. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1029. test_zero_clear
  1030. test_ovf_clear
  1031. test_neg_clear
  1032. test_h_gr32 word_dest er0
  1033. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1034. test_gr_a5a5 2
  1035. test_gr_a5a5 3
  1036. test_gr_a5a5 4
  1037. test_gr_a5a5 5
  1038. test_gr_a5a5 6
  1039. test_gr_a5a5 7
  1040. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1041. cmp.w #0x52d2, @word_dest
  1042. beq .Lwpredec1
  1043. fail
  1044. .Lwpredec1:
  1045. mov.w #0xa5a5, @word_dest
  1046. shlr_w_disp2_1:
  1047. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1048. set_ccr_zero
  1049. mov #word_dest-4, er0
  1050. shlr.w @(4:2, er0) ; shift right logical by one, disp2
  1051. ;;; .word 0x0156
  1052. ;;; .word 0x6908
  1053. ;;; .word 0x1110
  1054. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1055. test_zero_clear
  1056. test_ovf_clear
  1057. test_neg_clear
  1058. test_h_gr32 word_dest-4 er0
  1059. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1060. test_gr_a5a5 2
  1061. test_gr_a5a5 3
  1062. test_gr_a5a5 4
  1063. test_gr_a5a5 5
  1064. test_gr_a5a5 6
  1065. test_gr_a5a5 7
  1066. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1067. cmp.w #0x52d2, @word_dest
  1068. beq .Lwdisp21
  1069. fail
  1070. .Lwdisp21:
  1071. mov.w #0xa5a5, @word_dest
  1072. shlr_w_disp16_1:
  1073. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1074. set_ccr_zero
  1075. mov #word_dest-44, er0
  1076. shlr.w @(44:16, er0) ; shift right logical by one, disp16
  1077. ;;; .word 0x0154
  1078. ;;; .word 0x6f08
  1079. ;;; .word 44
  1080. ;;; .word 0x1110
  1081. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1082. test_zero_clear
  1083. test_ovf_clear
  1084. test_neg_clear
  1085. test_h_gr32 word_dest-44 er0
  1086. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1087. test_gr_a5a5 2
  1088. test_gr_a5a5 3
  1089. test_gr_a5a5 4
  1090. test_gr_a5a5 5
  1091. test_gr_a5a5 6
  1092. test_gr_a5a5 7
  1093. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1094. cmp.w #0x52d2, @word_dest
  1095. beq .Lwdisp161
  1096. fail
  1097. .Lwdisp161:
  1098. mov.w #0xa5a5, @word_dest
  1099. shlr_w_disp32_1:
  1100. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1101. set_ccr_zero
  1102. mov #word_dest-666, er0
  1103. shlr.w @(666:32, er0) ; shift right logical by one, disp32
  1104. ;;; .word 0x7884
  1105. ;;; .word 0x6b28
  1106. ;;; .long 666
  1107. ;;; .word 0x1110
  1108. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1109. test_zero_clear
  1110. test_ovf_clear
  1111. test_neg_clear
  1112. test_h_gr32 word_dest-666 er0
  1113. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1114. test_gr_a5a5 2
  1115. test_gr_a5a5 3
  1116. test_gr_a5a5 4
  1117. test_gr_a5a5 5
  1118. test_gr_a5a5 6
  1119. test_gr_a5a5 7
  1120. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1121. cmp.w #0x52d2, @word_dest
  1122. beq .Lwdisp321
  1123. fail
  1124. .Lwdisp321:
  1125. mov.w #0xa5a5, @word_dest
  1126. shlr_w_abs16_1:
  1127. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1128. set_ccr_zero
  1129. shlr.w @word_dest:16 ; shift right logical by one, abs16
  1130. ;;; .word 0x6b18
  1131. ;;; .word word_dest
  1132. ;;; .word 0x1110
  1133. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1134. test_zero_clear
  1135. test_ovf_clear
  1136. test_neg_clear
  1137. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1138. test_gr_a5a5 1
  1139. test_gr_a5a5 2
  1140. test_gr_a5a5 3
  1141. test_gr_a5a5 4
  1142. test_gr_a5a5 5
  1143. test_gr_a5a5 6
  1144. test_gr_a5a5 7
  1145. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1146. cmp.w #0x52d2, @word_dest
  1147. beq .Lwabs161
  1148. fail
  1149. .Lwabs161:
  1150. mov.w #0xa5a5, @word_dest
  1151. shlr_w_abs32_1:
  1152. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1153. set_ccr_zero
  1154. shlr.w @word_dest:32 ; shift right logical by one, abs32
  1155. ;;; .word 0x6b38
  1156. ;;; .long word_dest
  1157. ;;; .word 0x1110
  1158. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1159. test_zero_clear
  1160. test_ovf_clear
  1161. test_neg_clear
  1162. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1163. test_gr_a5a5 1
  1164. test_gr_a5a5 2
  1165. test_gr_a5a5 3
  1166. test_gr_a5a5 4
  1167. test_gr_a5a5 5
  1168. test_gr_a5a5 6
  1169. test_gr_a5a5 7
  1170. ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
  1171. cmp.w #0x52d2, @word_dest
  1172. beq .Lwabs321
  1173. fail
  1174. .Lwabs321:
  1175. mov.w #0xa5a5, @word_dest
  1176. .endif
  1177. shlr_w_reg16_2:
  1178. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1179. set_ccr_zero
  1180. shlr.w #2, r0 ; shift right logical by two
  1181. ;;; .word 0x1150
  1182. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1183. test_zero_clear
  1184. test_ovf_clear
  1185. test_neg_clear
  1186. test_h_gr16 0x2969 r0 ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1187. test_h_gr32 0xa5a52969 er0
  1188. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1189. test_gr_a5a5 2
  1190. test_gr_a5a5 3
  1191. test_gr_a5a5 4
  1192. test_gr_a5a5 5
  1193. test_gr_a5a5 6
  1194. test_gr_a5a5 7
  1195. .if (sim_cpu == h8sx)
  1196. shlr_w_ind_2:
  1197. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1198. set_ccr_zero
  1199. mov #word_dest, er0
  1200. shlr.w #2, @er0 ; shift right logical by two, indirect
  1201. ;;; .word 0x7d80
  1202. ;;; .word 0x1150
  1203. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1204. test_zero_clear
  1205. test_ovf_clear
  1206. test_neg_clear
  1207. test_h_gr32 word_dest er0
  1208. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1209. test_gr_a5a5 2
  1210. test_gr_a5a5 3
  1211. test_gr_a5a5 4
  1212. test_gr_a5a5 5
  1213. test_gr_a5a5 6
  1214. test_gr_a5a5 7
  1215. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1216. cmp.w #0x2969, @word_dest
  1217. beq .Lwind2
  1218. fail
  1219. .Lwind2:
  1220. mov.w #0xa5a5, @word_dest
  1221. shlr_w_postinc_2:
  1222. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1223. set_ccr_zero
  1224. mov #word_dest, er0
  1225. shlr.w #2, @er0+ ; shift right logical by two, postinc
  1226. ;;; .word 0x0154
  1227. ;;; .word 0x6d08
  1228. ;;; .word 0x1150
  1229. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1230. test_zero_clear
  1231. test_ovf_clear
  1232. test_neg_clear
  1233. test_h_gr32 word_dest+2 er0
  1234. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1235. test_gr_a5a5 2
  1236. test_gr_a5a5 3
  1237. test_gr_a5a5 4
  1238. test_gr_a5a5 5
  1239. test_gr_a5a5 6
  1240. test_gr_a5a5 7
  1241. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1242. cmp.w #0x2969, @word_dest
  1243. beq .Lwpostinc2
  1244. fail
  1245. .Lwpostinc2:
  1246. mov.w #0xa5a5, @word_dest
  1247. shlr_w_postdec_2:
  1248. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1249. set_ccr_zero
  1250. mov #word_dest, er0
  1251. shlr.w #2, @er0- ; shift right logical by two, postdec
  1252. ;;; .word 0x0156
  1253. ;;; .word 0x6d08
  1254. ;;; .word 0x1150
  1255. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1256. test_zero_clear
  1257. test_ovf_clear
  1258. test_neg_clear
  1259. test_h_gr32 word_dest-2 er0
  1260. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1261. test_gr_a5a5 2
  1262. test_gr_a5a5 3
  1263. test_gr_a5a5 4
  1264. test_gr_a5a5 5
  1265. test_gr_a5a5 6
  1266. test_gr_a5a5 7
  1267. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1268. cmp.w #0x2969, @word_dest
  1269. beq .Lwpostdec2
  1270. fail
  1271. .Lwpostdec2:
  1272. mov.w #0xa5a5, @word_dest
  1273. shlr_w_preinc_2:
  1274. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1275. set_ccr_zero
  1276. mov #word_dest-2, er0
  1277. shlr.w #2, @+er0 ; shift right logical by two, preinc
  1278. ;;; .word 0x0155
  1279. ;;; .word 0x6d08
  1280. ;;; .word 0x1150
  1281. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1282. test_zero_clear
  1283. test_ovf_clear
  1284. test_neg_clear
  1285. test_h_gr32 word_dest er0
  1286. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1287. test_gr_a5a5 2
  1288. test_gr_a5a5 3
  1289. test_gr_a5a5 4
  1290. test_gr_a5a5 5
  1291. test_gr_a5a5 6
  1292. test_gr_a5a5 7
  1293. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1294. cmp.w #0x2969, @word_dest
  1295. beq .Lwpreinc2
  1296. fail
  1297. .Lwpreinc2:
  1298. mov.w #0xa5a5, @word_dest
  1299. shlr_w_predec_2:
  1300. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1301. set_ccr_zero
  1302. mov #word_dest+2, er0
  1303. shlr.w #2, @-er0 ; shift right logical by two, predec
  1304. ;;; .word 0x0157
  1305. ;;; .word 0x6d08
  1306. ;;; .word 0x1150
  1307. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1308. test_zero_clear
  1309. test_ovf_clear
  1310. test_neg_clear
  1311. test_h_gr32 word_dest er0
  1312. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1313. test_gr_a5a5 2
  1314. test_gr_a5a5 3
  1315. test_gr_a5a5 4
  1316. test_gr_a5a5 5
  1317. test_gr_a5a5 6
  1318. test_gr_a5a5 7
  1319. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1320. cmp.w #0x2969, @word_dest
  1321. beq .Lwpredec2
  1322. fail
  1323. .Lwpredec2:
  1324. mov.w #0xa5a5, @word_dest
  1325. shlr_w_disp2_2:
  1326. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1327. set_ccr_zero
  1328. mov #word_dest-4, er0
  1329. shlr.w #2, @(4:2, er0) ; shift right logical by two, disp2
  1330. ;;; .word 0x0156
  1331. ;;; .word 0x6908
  1332. ;;; .word 0x1150
  1333. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1334. test_zero_clear
  1335. test_ovf_clear
  1336. test_neg_clear
  1337. test_h_gr32 word_dest-4 er0
  1338. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1339. test_gr_a5a5 2
  1340. test_gr_a5a5 3
  1341. test_gr_a5a5 4
  1342. test_gr_a5a5 5
  1343. test_gr_a5a5 6
  1344. test_gr_a5a5 7
  1345. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1346. cmp.w #0x2969, @word_dest
  1347. beq .Lwdisp22
  1348. fail
  1349. .Lwdisp22:
  1350. mov.w #0xa5a5, @word_dest
  1351. shlr_w_disp16_2:
  1352. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1353. set_ccr_zero
  1354. mov #word_dest-44, er0
  1355. shlr.w #2, @(44:16, er0) ; shift right logical by two, disp16
  1356. ;;; .word 0x0154
  1357. ;;; .word 0x6f08
  1358. ;;; .word 44
  1359. ;;; .word 0x1150
  1360. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1361. test_zero_clear
  1362. test_ovf_clear
  1363. test_neg_clear
  1364. test_h_gr32 word_dest-44 er0
  1365. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1366. test_gr_a5a5 2
  1367. test_gr_a5a5 3
  1368. test_gr_a5a5 4
  1369. test_gr_a5a5 5
  1370. test_gr_a5a5 6
  1371. test_gr_a5a5 7
  1372. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1373. cmp.w #0x2969, @word_dest
  1374. beq .Lwdisp162
  1375. fail
  1376. .Lwdisp162:
  1377. mov.w #0xa5a5, @word_dest
  1378. shlr_w_disp32_2:
  1379. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1380. set_ccr_zero
  1381. mov #word_dest-666, er0
  1382. shlr.w #2, @(666:32, er0) ; shift right logical by two, disp32
  1383. ;;; .word 0x7884
  1384. ;;; .word 0x6b28
  1385. ;;; .long 666
  1386. ;;; .word 0x1150
  1387. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1388. test_zero_clear
  1389. test_ovf_clear
  1390. test_neg_clear
  1391. test_h_gr32 word_dest-666 er0
  1392. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1393. test_gr_a5a5 2
  1394. test_gr_a5a5 3
  1395. test_gr_a5a5 4
  1396. test_gr_a5a5 5
  1397. test_gr_a5a5 6
  1398. test_gr_a5a5 7
  1399. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1400. cmp.w #0x2969, @word_dest
  1401. beq .Lwdisp322
  1402. fail
  1403. .Lwdisp322:
  1404. mov.w #0xa5a5, @word_dest
  1405. shlr_w_abs16_2:
  1406. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1407. set_ccr_zero
  1408. shlr.w #2, @word_dest:16 ; shift right logical by two, abs16
  1409. ;;; .word 0x6b18
  1410. ;;; .word word_dest
  1411. ;;; .word 0x1150
  1412. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1413. test_zero_clear
  1414. test_ovf_clear
  1415. test_neg_clear
  1416. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1417. test_gr_a5a5 2
  1418. test_gr_a5a5 2
  1419. test_gr_a5a5 3
  1420. test_gr_a5a5 4
  1421. test_gr_a5a5 5
  1422. test_gr_a5a5 6
  1423. test_gr_a5a5 7
  1424. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1425. cmp.w #0x2969, @word_dest
  1426. beq .Lwabs162
  1427. fail
  1428. .Lwabs162:
  1429. mov.w #0xa5a5, @word_dest
  1430. shlr_w_abs32_2:
  1431. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1432. set_ccr_zero
  1433. shlr.w #2, @word_dest:32 ; shift right logical by two, abs32
  1434. ;;; .word 0x6b38
  1435. ;;; .long word_dest
  1436. ;;; .word 0x1150
  1437. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1438. test_zero_clear
  1439. test_ovf_clear
  1440. test_neg_clear
  1441. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1442. test_gr_a5a5 2
  1443. test_gr_a5a5 2
  1444. test_gr_a5a5 3
  1445. test_gr_a5a5 4
  1446. test_gr_a5a5 5
  1447. test_gr_a5a5 6
  1448. test_gr_a5a5 7
  1449. ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
  1450. cmp.w #0x2969, @word_dest
  1451. beq .Lwabs322
  1452. fail
  1453. .Lwabs322:
  1454. mov.w #0xa5a5, @word_dest
  1455. shlr_w_reg16_4:
  1456. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1457. set_ccr_zero
  1458. shlr.w #4, r0 ; shift right logical by four
  1459. ;;; .word 0x1120
  1460. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1461. test_zero_clear
  1462. test_ovf_clear
  1463. test_neg_clear
  1464. test_h_gr16 0x0a5a r0 ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1465. test_h_gr32 0xa5a50a5a 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. shlr_w_reg16_reg8:
  1474. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1475. set_ccr_zero
  1476. mov #5, r1l
  1477. shlr.w r1l, r0 ; shift right logical by register value
  1478. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1479. test_zero_clear
  1480. test_ovf_clear
  1481. test_neg_clear
  1482. test_h_gr16 0x052d r0 ; 1010 0101 1010 0101 -> 0000 0101 0010 1101
  1483. test_h_gr32 0xa5a5052d er0
  1484. test_h_gr32 0xa5a5a505 er1
  1485. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1486. test_gr_a5a5 3
  1487. test_gr_a5a5 4
  1488. test_gr_a5a5 5
  1489. test_gr_a5a5 6
  1490. test_gr_a5a5 7
  1491. shlr_w_ind_4:
  1492. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1493. set_ccr_zero
  1494. mov #word_dest, er0
  1495. shlr.w #4, @er0 ; shift right logical by four, indirect
  1496. ;;; .word 0x7d80
  1497. ;;; .word 0x1120
  1498. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1499. test_zero_clear
  1500. test_ovf_clear
  1501. test_neg_clear
  1502. test_h_gr32 word_dest er0
  1503. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1504. test_gr_a5a5 2
  1505. test_gr_a5a5 3
  1506. test_gr_a5a5 4
  1507. test_gr_a5a5 5
  1508. test_gr_a5a5 6
  1509. test_gr_a5a5 7
  1510. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1511. cmp.w #0x0a5a, @word_dest
  1512. beq .Lwind4
  1513. fail
  1514. .Lwind4:
  1515. mov.w #0xa5a5, @word_dest
  1516. shlr_w_postinc_4:
  1517. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1518. set_ccr_zero
  1519. mov #word_dest, er0
  1520. shlr.w #4, @er0+ ; shift right logical by four, postinc
  1521. ;;; .word 0x0154
  1522. ;;; .word 0x6d08
  1523. ;;; .word 0x1120
  1524. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1525. test_zero_clear
  1526. test_ovf_clear
  1527. test_neg_clear
  1528. test_h_gr32 word_dest+2 er0
  1529. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1530. test_gr_a5a5 2
  1531. test_gr_a5a5 3
  1532. test_gr_a5a5 4
  1533. test_gr_a5a5 5
  1534. test_gr_a5a5 6
  1535. test_gr_a5a5 7
  1536. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1537. cmp.w #0x0a5a, @word_dest
  1538. beq .Lwpostinc4
  1539. fail
  1540. .Lwpostinc4:
  1541. mov.w #0xa5a5, @word_dest
  1542. shlr_w_postdec_4:
  1543. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1544. set_ccr_zero
  1545. mov #word_dest, er0
  1546. shlr.w #4, @er0- ; shift right logical by four, postdec
  1547. ;;; .word 0x0156
  1548. ;;; .word 0x6d08
  1549. ;;; .word 0x1120
  1550. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1551. test_zero_clear
  1552. test_ovf_clear
  1553. test_neg_clear
  1554. test_h_gr32 word_dest-2 er0
  1555. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1556. test_gr_a5a5 2
  1557. test_gr_a5a5 3
  1558. test_gr_a5a5 4
  1559. test_gr_a5a5 5
  1560. test_gr_a5a5 6
  1561. test_gr_a5a5 7
  1562. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1563. cmp.w #0x0a5a, @word_dest
  1564. beq .Lwpostdec4
  1565. fail
  1566. .Lwpostdec4:
  1567. mov.w #0xa5a5, @word_dest
  1568. shlr_w_preinc_4:
  1569. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1570. set_ccr_zero
  1571. mov #word_dest-2, er0
  1572. shlr.w #4, @+er0 ; shift right logical by four, preinc
  1573. ;;; .word 0x0155
  1574. ;;; .word 0x6d08
  1575. ;;; .word 0x1120
  1576. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1577. test_zero_clear
  1578. test_ovf_clear
  1579. test_neg_clear
  1580. test_h_gr32 word_dest er0
  1581. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1582. test_gr_a5a5 2
  1583. test_gr_a5a5 3
  1584. test_gr_a5a5 4
  1585. test_gr_a5a5 5
  1586. test_gr_a5a5 6
  1587. test_gr_a5a5 7
  1588. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1589. cmp.w #0x0a5a, @word_dest
  1590. beq .Lwpreinc4
  1591. fail
  1592. .Lwpreinc4:
  1593. mov.w #0xa5a5, @word_dest
  1594. shlr_w_predec_4:
  1595. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1596. set_ccr_zero
  1597. mov #word_dest+2, er0
  1598. shlr.w #4, @-er0 ; shift right logical by four, predec
  1599. ;;; .word 0x0157
  1600. ;;; .word 0x6d08
  1601. ;;; .word 0x1120
  1602. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1603. test_zero_clear
  1604. test_ovf_clear
  1605. test_neg_clear
  1606. test_h_gr32 word_dest er0
  1607. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1608. test_gr_a5a5 2
  1609. test_gr_a5a5 3
  1610. test_gr_a5a5 4
  1611. test_gr_a5a5 5
  1612. test_gr_a5a5 6
  1613. test_gr_a5a5 7
  1614. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1615. cmp.w #0x0a5a, @word_dest
  1616. beq .Lwpredec4
  1617. fail
  1618. .Lwpredec4:
  1619. mov.w #0xa5a5, @word_dest
  1620. shlr_w_disp2_4:
  1621. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1622. set_ccr_zero
  1623. mov #word_dest-4, er0
  1624. shlr.w #4, @(4:2, er0) ; shift right logical by four, disp2
  1625. ;;; .word 0x0156
  1626. ;;; .word 0x6908
  1627. ;;; .word 0x1120
  1628. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1629. test_zero_clear
  1630. test_ovf_clear
  1631. test_neg_clear
  1632. test_h_gr32 word_dest-4 er0
  1633. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1634. test_gr_a5a5 2
  1635. test_gr_a5a5 3
  1636. test_gr_a5a5 4
  1637. test_gr_a5a5 5
  1638. test_gr_a5a5 6
  1639. test_gr_a5a5 7
  1640. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1641. cmp.w #0x0a5a, @word_dest
  1642. beq .Lwdisp24
  1643. fail
  1644. .Lwdisp24:
  1645. mov.w #0xa5a5, @word_dest
  1646. shlr_w_disp16_4:
  1647. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1648. set_ccr_zero
  1649. mov #word_dest-44, er0
  1650. shlr.w #4, @(44:16, er0) ; shift right logical by four, disp16
  1651. ;;; .word 0x0154
  1652. ;;; .word 0x6f08
  1653. ;;; .word 44
  1654. ;;; .word 0x1120
  1655. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1656. test_zero_clear
  1657. test_ovf_clear
  1658. test_neg_clear
  1659. test_h_gr32 word_dest-44 er0
  1660. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1661. test_gr_a5a5 2
  1662. test_gr_a5a5 3
  1663. test_gr_a5a5 4
  1664. test_gr_a5a5 5
  1665. test_gr_a5a5 6
  1666. test_gr_a5a5 7
  1667. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1668. cmp.w #0x0a5a, @word_dest
  1669. beq .Lwdisp164
  1670. fail
  1671. .Lwdisp164:
  1672. mov.w #0xa5a5, @word_dest
  1673. shlr_w_disp32_4:
  1674. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1675. set_ccr_zero
  1676. mov #word_dest-666, er0
  1677. shlr.w #4, @(666:32, er0) ; shift right logical by four, disp32
  1678. ;;; .word 0x7884
  1679. ;;; .word 0x6b28
  1680. ;;; .long 666
  1681. ;;; .word 0x1120
  1682. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1683. test_zero_clear
  1684. test_ovf_clear
  1685. test_neg_clear
  1686. test_h_gr32 word_dest-666 er0
  1687. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1688. test_gr_a5a5 2
  1689. test_gr_a5a5 3
  1690. test_gr_a5a5 4
  1691. test_gr_a5a5 5
  1692. test_gr_a5a5 6
  1693. test_gr_a5a5 7
  1694. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1695. cmp.w #0x0a5a, @word_dest
  1696. beq .Lwdisp324
  1697. fail
  1698. .Lwdisp324:
  1699. mov.w #0xa5a5, @word_dest
  1700. shlr_w_abs16_4:
  1701. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1702. set_ccr_zero
  1703. shlr.w #4, @word_dest:16 ; shift right logical by four, abs16
  1704. ;;; .word 0x6b18
  1705. ;;; .word word_dest
  1706. ;;; .word 0x1120
  1707. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1708. test_zero_clear
  1709. test_ovf_clear
  1710. test_neg_clear
  1711. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1712. test_gr_a5a5 2
  1713. test_gr_a5a5 2
  1714. test_gr_a5a5 3
  1715. test_gr_a5a5 4
  1716. test_gr_a5a5 5
  1717. test_gr_a5a5 6
  1718. test_gr_a5a5 7
  1719. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1720. cmp.w #0x0a5a, @word_dest
  1721. beq .Lwabs164
  1722. fail
  1723. .Lwabs164:
  1724. mov.w #0xa5a5, @word_dest
  1725. shlr_w_abs32_4:
  1726. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1727. set_ccr_zero
  1728. shlr.w #4, @word_dest:32 ; shift right logical by four, abs32
  1729. ;;; .word 0x6b38
  1730. ;;; .long word_dest
  1731. ;;; .word 0x1120
  1732. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  1733. test_zero_clear
  1734. test_ovf_clear
  1735. test_neg_clear
  1736. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1737. test_gr_a5a5 2
  1738. test_gr_a5a5 2
  1739. test_gr_a5a5 3
  1740. test_gr_a5a5 4
  1741. test_gr_a5a5 5
  1742. test_gr_a5a5 6
  1743. test_gr_a5a5 7
  1744. ; 1010 0101 1010 0101 -> 0000 1010 0101 1010
  1745. cmp.w #0x0a5a, @word_dest
  1746. beq .Lwabs324
  1747. fail
  1748. .Lwabs324:
  1749. mov.w #0xa5a5, @word_dest
  1750. shlr_w_reg16_8:
  1751. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1752. set_ccr_zero
  1753. shlr.w #8, r0 ; shift right logical by eight
  1754. ;;; .word 0x1160
  1755. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1756. test_zero_clear
  1757. test_ovf_clear
  1758. test_neg_clear
  1759. test_h_gr16 0x00a5 r0 ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1760. test_h_gr32 0xa5a500a5 er0
  1761. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1762. test_gr_a5a5 2
  1763. test_gr_a5a5 3
  1764. test_gr_a5a5 4
  1765. test_gr_a5a5 5
  1766. test_gr_a5a5 6
  1767. test_gr_a5a5 7
  1768. shlr_w_ind_8:
  1769. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1770. set_ccr_zero
  1771. mov #word_dest, er0
  1772. shlr.w #8, @er0 ; shift right logical by eight, indirect
  1773. ;;; .word 0x7d80
  1774. ;;; .word 0x1160
  1775. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1776. test_zero_clear
  1777. test_ovf_clear
  1778. test_neg_clear
  1779. test_h_gr32 word_dest er0
  1780. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1781. test_gr_a5a5 2
  1782. test_gr_a5a5 3
  1783. test_gr_a5a5 4
  1784. test_gr_a5a5 5
  1785. test_gr_a5a5 6
  1786. test_gr_a5a5 7
  1787. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1788. cmp.w #0x00a5, @word_dest
  1789. beq .Lwind8
  1790. fail
  1791. .Lwind8:
  1792. mov.w #0xa5a5, @word_dest
  1793. shlr_w_postinc_8:
  1794. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1795. set_ccr_zero
  1796. mov #word_dest, er0
  1797. shlr.w #8, @er0+ ; shift right logical by eight, postinc
  1798. ;;; .word 0x0154
  1799. ;;; .word 0x6d08
  1800. ;;; .word 0x1160
  1801. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1802. test_zero_clear
  1803. test_ovf_clear
  1804. test_neg_clear
  1805. test_h_gr32 word_dest+2 er0
  1806. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1807. test_gr_a5a5 2
  1808. test_gr_a5a5 3
  1809. test_gr_a5a5 4
  1810. test_gr_a5a5 5
  1811. test_gr_a5a5 6
  1812. test_gr_a5a5 7
  1813. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1814. cmp.w #0x00a5, @word_dest
  1815. beq .Lwpostinc8
  1816. fail
  1817. .Lwpostinc8:
  1818. mov.w #0xa5a5, @word_dest
  1819. shlr_w_postdec_8:
  1820. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1821. set_ccr_zero
  1822. mov #word_dest, er0
  1823. shlr.w #8, @er0- ; shift right logical by eight, postdec
  1824. ;;; .word 0x0156
  1825. ;;; .word 0x6d08
  1826. ;;; .word 0x1160
  1827. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1828. test_zero_clear
  1829. test_ovf_clear
  1830. test_neg_clear
  1831. test_h_gr32 word_dest-2 er0
  1832. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1833. test_gr_a5a5 2
  1834. test_gr_a5a5 3
  1835. test_gr_a5a5 4
  1836. test_gr_a5a5 5
  1837. test_gr_a5a5 6
  1838. test_gr_a5a5 7
  1839. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1840. cmp.w #0x00a5, @word_dest
  1841. beq .Lwpostdec8
  1842. fail
  1843. .Lwpostdec8:
  1844. mov.w #0xa5a5, @word_dest
  1845. shlr_w_preinc_8:
  1846. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1847. set_ccr_zero
  1848. mov #word_dest-2, er0
  1849. shlr.w #8, @+er0 ; shift right logical by eight, preinc
  1850. ;;; .word 0x0155
  1851. ;;; .word 0x6d08
  1852. ;;; .word 0x1160
  1853. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1854. test_zero_clear
  1855. test_ovf_clear
  1856. test_neg_clear
  1857. test_h_gr32 word_dest er0
  1858. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1859. test_gr_a5a5 2
  1860. test_gr_a5a5 3
  1861. test_gr_a5a5 4
  1862. test_gr_a5a5 5
  1863. test_gr_a5a5 6
  1864. test_gr_a5a5 7
  1865. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1866. cmp.w #0x00a5, @word_dest
  1867. beq .Lwpreinc8
  1868. fail
  1869. .Lwpreinc8:
  1870. mov.w #0xa5a5, @word_dest
  1871. shlr_w_predec_8:
  1872. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1873. set_ccr_zero
  1874. mov #word_dest+2, er0
  1875. shlr.w #8, @-er0 ; shift right logical by eight, predec
  1876. ;;; .word 0x0157
  1877. ;;; .word 0x6d08
  1878. ;;; .word 0x1160
  1879. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1880. test_zero_clear
  1881. test_ovf_clear
  1882. test_neg_clear
  1883. test_h_gr32 word_dest er0
  1884. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1885. test_gr_a5a5 2
  1886. test_gr_a5a5 3
  1887. test_gr_a5a5 4
  1888. test_gr_a5a5 5
  1889. test_gr_a5a5 6
  1890. test_gr_a5a5 7
  1891. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1892. cmp.w #0x00a5, @word_dest
  1893. beq .Lwpredec8
  1894. fail
  1895. .Lwpredec8:
  1896. mov.w #0xa5a5, @word_dest
  1897. shlr_w_disp2_8:
  1898. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1899. set_ccr_zero
  1900. mov #word_dest-4, er0
  1901. shlr.w #8, @(4:2, er0) ; shift right logical by eight, disp2
  1902. ;;; .word 0x0156
  1903. ;;; .word 0x6908
  1904. ;;; .word 0x1160
  1905. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1906. test_zero_clear
  1907. test_ovf_clear
  1908. test_neg_clear
  1909. test_h_gr32 word_dest-4 er0
  1910. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1911. test_gr_a5a5 2
  1912. test_gr_a5a5 3
  1913. test_gr_a5a5 4
  1914. test_gr_a5a5 5
  1915. test_gr_a5a5 6
  1916. test_gr_a5a5 7
  1917. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1918. cmp.w #0x00a5, @word_dest
  1919. beq .Lwdisp28
  1920. fail
  1921. .Lwdisp28:
  1922. mov.w #0xa5a5, @word_dest
  1923. shlr_w_disp16_8:
  1924. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1925. set_ccr_zero
  1926. mov #word_dest-44, er0
  1927. shlr.w #8, @(44:16, er0) ; shift right logical by eight, disp16
  1928. ;;; .word 0x0154
  1929. ;;; .word 0x6f08
  1930. ;;; .word 44
  1931. ;;; .word 0x1160
  1932. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1933. test_zero_clear
  1934. test_ovf_clear
  1935. test_neg_clear
  1936. test_h_gr32 word_dest-44 er0
  1937. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1938. test_gr_a5a5 2
  1939. test_gr_a5a5 3
  1940. test_gr_a5a5 4
  1941. test_gr_a5a5 5
  1942. test_gr_a5a5 6
  1943. test_gr_a5a5 7
  1944. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1945. cmp.w #0x00a5, @word_dest
  1946. beq .Lwdisp168
  1947. fail
  1948. .Lwdisp168:
  1949. mov.w #0xa5a5, @word_dest
  1950. shlr_w_disp32_8:
  1951. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1952. set_ccr_zero
  1953. mov #word_dest-666, er0
  1954. shlr.w #8, @(666:32, er0) ; shift right logical by eight, disp32
  1955. ;;; .word 0x7884
  1956. ;;; .word 0x6b28
  1957. ;;; .long 666
  1958. ;;; .word 0x1160
  1959. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1960. test_zero_clear
  1961. test_ovf_clear
  1962. test_neg_clear
  1963. test_h_gr32 word_dest-666 er0
  1964. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1965. test_gr_a5a5 2
  1966. test_gr_a5a5 3
  1967. test_gr_a5a5 4
  1968. test_gr_a5a5 5
  1969. test_gr_a5a5 6
  1970. test_gr_a5a5 7
  1971. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1972. cmp.w #0x00a5, @word_dest
  1973. beq .Lwdisp328
  1974. fail
  1975. .Lwdisp328:
  1976. mov.w #0xa5a5, @word_dest
  1977. shlr_w_abs16_8:
  1978. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1979. set_ccr_zero
  1980. shlr.w #8, @word_dest:16 ; shift right logical by eight, abs16
  1981. ;;; .word 0x6b18
  1982. ;;; .word word_dest
  1983. ;;; .word 0x1160
  1984. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  1985. test_zero_clear
  1986. test_ovf_clear
  1987. test_neg_clear
  1988. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  1989. test_gr_a5a5 2
  1990. test_gr_a5a5 2
  1991. test_gr_a5a5 3
  1992. test_gr_a5a5 4
  1993. test_gr_a5a5 5
  1994. test_gr_a5a5 6
  1995. test_gr_a5a5 7
  1996. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  1997. cmp.w #0x00a5, @word_dest
  1998. beq .Lwabs168
  1999. fail
  2000. .Lwabs168:
  2001. mov.w #0xa5a5, @word_dest
  2002. shlr_w_abs32_8:
  2003. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2004. set_ccr_zero
  2005. shlr.w #8, @word_dest:32 ; shift right logical by eight, abs32
  2006. ;;; .word 0x6b38
  2007. ;;; .long word_dest
  2008. ;;; .word 0x1160
  2009. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2010. test_zero_clear
  2011. test_ovf_clear
  2012. test_neg_clear
  2013. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2014. test_gr_a5a5 2
  2015. test_gr_a5a5 2
  2016. test_gr_a5a5 3
  2017. test_gr_a5a5 4
  2018. test_gr_a5a5 5
  2019. test_gr_a5a5 6
  2020. test_gr_a5a5 7
  2021. ; 1010 0101 1010 0101 -> 0000 0000 1010 0101
  2022. cmp.w #0x00a5, @word_dest
  2023. beq .Lwabs328
  2024. fail
  2025. .Lwabs328:
  2026. mov.w #0xa5a5, @word_dest
  2027. shlr_l_imm5_1:
  2028. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2029. set_ccr_zero
  2030. shlr.l #31:5, er0 ; shift right logical by 5-bit immediate
  2031. ;;; .word 0x0399
  2032. ;;; .word 0x1130
  2033. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2034. test_zero_clear
  2035. test_ovf_clear
  2036. test_neg_clear
  2037. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2038. ; -> 0000 0000 0000 0000 0000 0000 0000 0001
  2039. test_h_gr32 0x1 er0
  2040. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2041. test_gr_a5a5 2
  2042. test_gr_a5a5 3
  2043. test_gr_a5a5 4
  2044. test_gr_a5a5 5
  2045. test_gr_a5a5 6
  2046. test_gr_a5a5 7
  2047. .endif
  2048. shlr_l_reg32_1:
  2049. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2050. set_ccr_zero
  2051. shlr.l er0 ; shift right logical by one, register
  2052. ;;; .word 0x1130
  2053. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2054. test_zero_clear
  2055. test_ovf_clear
  2056. test_neg_clear
  2057. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2058. ; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2059. test_h_gr32 0x52d2d2d2 er0
  2060. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2061. test_gr_a5a5 2
  2062. test_gr_a5a5 3
  2063. test_gr_a5a5 4
  2064. test_gr_a5a5 5
  2065. test_gr_a5a5 6
  2066. test_gr_a5a5 7
  2067. .if (sim_cpu == h8sx)
  2068. shlr_l_ind_1:
  2069. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2070. set_ccr_zero
  2071. mov #long_dest, er0
  2072. shlr.l @er0 ; shift right logical by one, indirect
  2073. ;;; .word 0x0104
  2074. ;;; .word 0x6908
  2075. ;;; .word 0x1130
  2076. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2077. test_zero_clear
  2078. test_ovf_clear
  2079. test_neg_clear
  2080. test_h_gr32 long_dest er0
  2081. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2082. test_gr_a5a5 2
  2083. test_gr_a5a5 3
  2084. test_gr_a5a5 4
  2085. test_gr_a5a5 5
  2086. test_gr_a5a5 6
  2087. test_gr_a5a5 7
  2088. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2089. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2090. cmp.l #0x52d2d2d2, @long_dest
  2091. beq .Llind1
  2092. fail
  2093. .Llind1:
  2094. mov #0xa5a5a5a5, @long_dest
  2095. shlr_l_postinc_1:
  2096. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2097. set_ccr_zero
  2098. mov #long_dest, er0
  2099. shlr.l @er0+ ; shift right logical by one, postinc
  2100. ;;; .word 0x0104
  2101. ;;; .word 0x6d08
  2102. ;;; .word 0x1130
  2103. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2104. test_zero_clear
  2105. test_ovf_clear
  2106. test_neg_clear
  2107. test_h_gr32 long_dest+4 er0
  2108. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2109. test_gr_a5a5 2
  2110. test_gr_a5a5 3
  2111. test_gr_a5a5 4
  2112. test_gr_a5a5 5
  2113. test_gr_a5a5 6
  2114. test_gr_a5a5 7
  2115. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2116. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2117. cmp.l #0x52d2d2d2, @long_dest
  2118. beq .Llpostinc1
  2119. fail
  2120. .Llpostinc1:
  2121. mov #0xa5a5a5a5, @long_dest
  2122. shlr_l_postdec_1:
  2123. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2124. set_ccr_zero
  2125. mov #long_dest, er0
  2126. shlr.l @er0- ; shift right logical by one, postdec
  2127. ;;; .word 0x0106
  2128. ;;; .word 0x6d08
  2129. ;;; .word 0x1130
  2130. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2131. test_zero_clear
  2132. test_ovf_clear
  2133. test_neg_clear
  2134. test_h_gr32 long_dest-4 er0
  2135. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2136. test_gr_a5a5 2
  2137. test_gr_a5a5 3
  2138. test_gr_a5a5 4
  2139. test_gr_a5a5 5
  2140. test_gr_a5a5 6
  2141. test_gr_a5a5 7
  2142. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2143. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2144. cmp.l #0x52d2d2d2, @long_dest
  2145. beq .Llpostdec1
  2146. fail
  2147. .Llpostdec1:
  2148. mov #0xa5a5a5a5, @long_dest
  2149. shlr_l_preinc_1:
  2150. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2151. set_ccr_zero
  2152. mov #long_dest-4, er0
  2153. shlr.l @+er0 ; shift right logical by one, preinc
  2154. ;;; .word 0x0105
  2155. ;;; .word 0x6d08
  2156. ;;; .word 0x1130
  2157. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2158. test_zero_clear
  2159. test_ovf_clear
  2160. test_neg_clear
  2161. test_h_gr32 long_dest er0
  2162. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2163. test_gr_a5a5 2
  2164. test_gr_a5a5 3
  2165. test_gr_a5a5 4
  2166. test_gr_a5a5 5
  2167. test_gr_a5a5 6
  2168. test_gr_a5a5 7
  2169. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2170. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2171. cmp.l #0x52d2d2d2, @long_dest
  2172. beq .Llpreinc1
  2173. fail
  2174. .Llpreinc1:
  2175. mov #0xa5a5a5a5, @long_dest
  2176. shlr_l_predec_1:
  2177. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2178. set_ccr_zero
  2179. mov #long_dest+4, er0
  2180. shlr.l @-er0 ; shift right logical by one, predec
  2181. ;;; .word 0x0107
  2182. ;;; .word 0x6d08
  2183. ;;; .word 0x1130
  2184. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2185. test_zero_clear
  2186. test_ovf_clear
  2187. test_neg_clear
  2188. test_h_gr32 long_dest er0
  2189. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2190. test_gr_a5a5 2
  2191. test_gr_a5a5 3
  2192. test_gr_a5a5 4
  2193. test_gr_a5a5 5
  2194. test_gr_a5a5 6
  2195. test_gr_a5a5 7
  2196. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2197. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2198. cmp.l #0x52d2d2d2, @long_dest
  2199. beq .Llpredec1
  2200. fail
  2201. .Llpredec1:
  2202. mov #0xa5a5a5a5, @long_dest
  2203. shlr_l_disp2_1:
  2204. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2205. set_ccr_zero
  2206. mov #long_dest-8, er0
  2207. shlr.l @(8:2, er0) ; shift right logical by one, disp2
  2208. ;;; .word 0x0106
  2209. ;;; .word 0x6908
  2210. ;;; .word 0x1130
  2211. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2212. test_zero_clear
  2213. test_ovf_clear
  2214. test_neg_clear
  2215. test_h_gr32 long_dest-8 er0
  2216. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2217. test_gr_a5a5 2
  2218. test_gr_a5a5 3
  2219. test_gr_a5a5 4
  2220. test_gr_a5a5 5
  2221. test_gr_a5a5 6
  2222. test_gr_a5a5 7
  2223. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2224. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2225. cmp.l #0x52d2d2d2, @long_dest
  2226. beq .Lldisp21
  2227. fail
  2228. .Lldisp21:
  2229. mov #0xa5a5a5a5, @long_dest
  2230. shlr_l_disp16_1:
  2231. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2232. set_ccr_zero
  2233. mov #long_dest-44, er0
  2234. shlr.l @(44:16, er0) ; shift right logical by one, disp16
  2235. ;;; .word 0x0104
  2236. ;;; .word 0x6f08
  2237. ;;; .word 44
  2238. ;;; .word 0x1130
  2239. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2240. test_zero_clear
  2241. test_ovf_clear
  2242. test_neg_clear
  2243. test_h_gr32 long_dest-44 er0
  2244. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2245. test_gr_a5a5 2
  2246. test_gr_a5a5 3
  2247. test_gr_a5a5 4
  2248. test_gr_a5a5 5
  2249. test_gr_a5a5 6
  2250. test_gr_a5a5 7
  2251. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2252. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2253. cmp.l #0x52d2d2d2, @long_dest
  2254. beq .Lldisp161
  2255. fail
  2256. .Lldisp161:
  2257. mov #0xa5a5a5a5, @long_dest
  2258. shlr_l_disp32_1:
  2259. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2260. set_ccr_zero
  2261. mov #long_dest-666, er0
  2262. shlr.l @(666:32, er0) ; shift right logical by one, disp32
  2263. ;;; .word 0x7884
  2264. ;;; .word 0x6b28
  2265. ;;; .long 666
  2266. ;;; .word 0x1130
  2267. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2268. test_zero_clear
  2269. test_ovf_clear
  2270. test_neg_clear
  2271. test_h_gr32 long_dest-666 er0
  2272. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2273. test_gr_a5a5 2
  2274. test_gr_a5a5 3
  2275. test_gr_a5a5 4
  2276. test_gr_a5a5 5
  2277. test_gr_a5a5 6
  2278. test_gr_a5a5 7
  2279. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2280. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2281. cmp.l #0x52d2d2d2, @long_dest
  2282. beq .Lldisp321
  2283. fail
  2284. .Lldisp321:
  2285. mov #0xa5a5a5a5, @long_dest
  2286. shlr_l_abs16_1:
  2287. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2288. set_ccr_zero
  2289. shlr.l @long_dest:16 ; shift right logical by one, abs16
  2290. ;;; .word 0x0104
  2291. ;;; .word 0x6b08
  2292. ;;; .word long_dest
  2293. ;;; .word 0x1130
  2294. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2295. test_zero_clear
  2296. test_ovf_clear
  2297. test_neg_clear
  2298. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2299. test_gr_a5a5 1
  2300. test_gr_a5a5 2
  2301. test_gr_a5a5 3
  2302. test_gr_a5a5 4
  2303. test_gr_a5a5 5
  2304. test_gr_a5a5 6
  2305. test_gr_a5a5 7
  2306. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2307. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2308. cmp.l #0x52d2d2d2, @long_dest
  2309. beq .Llabs161
  2310. fail
  2311. .Llabs161:
  2312. mov #0xa5a5a5a5, @long_dest
  2313. shlr_l_abs32_1:
  2314. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2315. set_ccr_zero
  2316. shlr.l @long_dest:32 ; shift right logical by one, abs32
  2317. ;;; .word 0x0104
  2318. ;;; .word 0x6b28
  2319. ;;; .long long_dest
  2320. ;;; .word 0x1130
  2321. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2322. test_zero_clear
  2323. test_ovf_clear
  2324. test_neg_clear
  2325. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2326. test_gr_a5a5 1
  2327. test_gr_a5a5 2
  2328. test_gr_a5a5 3
  2329. test_gr_a5a5 4
  2330. test_gr_a5a5 5
  2331. test_gr_a5a5 6
  2332. test_gr_a5a5 7
  2333. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2334. ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
  2335. cmp.l #0x52d2d2d2, @long_dest
  2336. beq .Llabs321
  2337. fail
  2338. .Llabs321:
  2339. mov #0xa5a5a5a5, @long_dest
  2340. .endif
  2341. shlr_l_reg32_2:
  2342. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2343. set_ccr_zero
  2344. shlr.l #2, er0 ; shift right logical by two, register
  2345. ;;; .word 0x1170
  2346. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2347. test_zero_clear
  2348. test_ovf_clear
  2349. test_neg_clear
  2350. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2351. ; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2352. test_h_gr32 0x29696969 er0
  2353. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2354. test_gr_a5a5 2
  2355. test_gr_a5a5 3
  2356. test_gr_a5a5 4
  2357. test_gr_a5a5 5
  2358. test_gr_a5a5 6
  2359. test_gr_a5a5 7
  2360. .if (sim_cpu == h8sx)
  2361. shlr_l_ind_2:
  2362. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2363. set_ccr_zero
  2364. mov #long_dest, er0
  2365. shlr.l #2, @er0 ; shift right logical by two, indirect
  2366. ;;; .word 0x0104
  2367. ;;; .word 0x6908
  2368. ;;; .word 0x1170
  2369. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2370. test_zero_clear
  2371. test_ovf_clear
  2372. test_neg_clear
  2373. test_h_gr32 long_dest er0
  2374. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2375. test_gr_a5a5 2
  2376. test_gr_a5a5 3
  2377. test_gr_a5a5 4
  2378. test_gr_a5a5 5
  2379. test_gr_a5a5 6
  2380. test_gr_a5a5 7
  2381. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2382. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2383. cmp.l #0x29696969, @long_dest
  2384. beq .Llind2
  2385. fail
  2386. .Llind2:
  2387. mov #0xa5a5a5a5, @long_dest
  2388. shlr_l_postinc_2:
  2389. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2390. set_ccr_zero
  2391. mov #long_dest, er0
  2392. shlr.l #2, @er0+ ; shift right logical by two, postinc
  2393. ;;; .word 0x0104
  2394. ;;; .word 0x6d08
  2395. ;;; .word 0x1170
  2396. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2397. test_zero_clear
  2398. test_ovf_clear
  2399. test_neg_clear
  2400. test_h_gr32 long_dest+4 er0
  2401. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2402. test_gr_a5a5 2
  2403. test_gr_a5a5 3
  2404. test_gr_a5a5 4
  2405. test_gr_a5a5 5
  2406. test_gr_a5a5 6
  2407. test_gr_a5a5 7
  2408. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2409. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2410. cmp.l #0x29696969, @long_dest
  2411. beq .Llpostinc2
  2412. fail
  2413. .Llpostinc2:
  2414. mov #0xa5a5a5a5, @long_dest
  2415. shlr_l_postdec_2:
  2416. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2417. set_ccr_zero
  2418. mov #long_dest, er0
  2419. shlr.l #2, @er0- ; shift right logical by two, postdec
  2420. ;;; .word 0x0106
  2421. ;;; .word 0x6d08
  2422. ;;; .word 0x1170
  2423. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2424. test_zero_clear
  2425. test_ovf_clear
  2426. test_neg_clear
  2427. test_h_gr32 long_dest-4 er0
  2428. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2429. test_gr_a5a5 2
  2430. test_gr_a5a5 3
  2431. test_gr_a5a5 4
  2432. test_gr_a5a5 5
  2433. test_gr_a5a5 6
  2434. test_gr_a5a5 7
  2435. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2436. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2437. cmp.l #0x29696969, @long_dest
  2438. beq .Llpostdec2
  2439. fail
  2440. .Llpostdec2:
  2441. mov #0xa5a5a5a5, @long_dest
  2442. shlr_l_preinc_2:
  2443. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2444. set_ccr_zero
  2445. mov #long_dest-4, er0
  2446. shlr.l #2, @+er0 ; shift right logical by two, preinc
  2447. ;;; .word 0x0105
  2448. ;;; .word 0x6d08
  2449. ;;; .word 0x1170
  2450. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2451. test_zero_clear
  2452. test_ovf_clear
  2453. test_neg_clear
  2454. test_h_gr32 long_dest er0
  2455. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2456. test_gr_a5a5 2
  2457. test_gr_a5a5 3
  2458. test_gr_a5a5 4
  2459. test_gr_a5a5 5
  2460. test_gr_a5a5 6
  2461. test_gr_a5a5 7
  2462. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2463. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2464. cmp.l #0x29696969, @long_dest
  2465. beq .Llpreinc2
  2466. fail
  2467. .Llpreinc2:
  2468. mov #0xa5a5a5a5, @long_dest
  2469. shlr_l_predec_2:
  2470. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2471. set_ccr_zero
  2472. mov #long_dest+4, er0
  2473. shlr.l #2, @-er0 ; shift right logical by two, predec
  2474. ;;; .word 0x0107
  2475. ;;; .word 0x6d08
  2476. ;;; .word 0x1170
  2477. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2478. test_zero_clear
  2479. test_ovf_clear
  2480. test_neg_clear
  2481. test_h_gr32 long_dest er0
  2482. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2483. test_gr_a5a5 2
  2484. test_gr_a5a5 3
  2485. test_gr_a5a5 4
  2486. test_gr_a5a5 5
  2487. test_gr_a5a5 6
  2488. test_gr_a5a5 7
  2489. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2490. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2491. cmp.l #0x29696969, @long_dest
  2492. beq .Llpredec2
  2493. fail
  2494. .Llpredec2:
  2495. mov #0xa5a5a5a5, @long_dest
  2496. shlr_l_disp2_2:
  2497. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2498. set_ccr_zero
  2499. mov #long_dest-8, er0
  2500. shlr.l #2, @(8:2, er0) ; shift right logical by two, disp2
  2501. ;;; .word 0x0106
  2502. ;;; .word 0x6908
  2503. ;;; .word 0x1170
  2504. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2505. test_zero_clear
  2506. test_ovf_clear
  2507. test_neg_clear
  2508. test_h_gr32 long_dest-8 er0
  2509. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2510. test_gr_a5a5 2
  2511. test_gr_a5a5 3
  2512. test_gr_a5a5 4
  2513. test_gr_a5a5 5
  2514. test_gr_a5a5 6
  2515. test_gr_a5a5 7
  2516. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2517. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2518. cmp.l #0x29696969, @long_dest
  2519. beq .Lldisp22
  2520. fail
  2521. .Lldisp22:
  2522. mov #0xa5a5a5a5, @long_dest
  2523. shlr_l_disp16_2:
  2524. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2525. set_ccr_zero
  2526. mov #long_dest-44, er0
  2527. shlr.l #2, @(44:16, er0) ; shift right logical by two, disp16
  2528. ;;; .word 0x0104
  2529. ;;; .word 0x6f08
  2530. ;;; .word 44
  2531. ;;; .word 0x1170
  2532. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2533. test_zero_clear
  2534. test_ovf_clear
  2535. test_neg_clear
  2536. test_h_gr32 long_dest-44 er0
  2537. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2538. test_gr_a5a5 2
  2539. test_gr_a5a5 3
  2540. test_gr_a5a5 4
  2541. test_gr_a5a5 5
  2542. test_gr_a5a5 6
  2543. test_gr_a5a5 7
  2544. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2545. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2546. cmp.l #0x29696969, @long_dest
  2547. beq .Lldisp162
  2548. fail
  2549. .Lldisp162:
  2550. mov #0xa5a5a5a5, @long_dest
  2551. shlr_l_disp32_2:
  2552. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2553. set_ccr_zero
  2554. mov #long_dest-666, er0
  2555. shlr.l #2, @(666:32, er0) ; shift right logical by two, disp32
  2556. ;;; .word 0x7884
  2557. ;;; .word 0x6b28
  2558. ;;; .long 666
  2559. ;;; .word 0x1170
  2560. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2561. test_zero_clear
  2562. test_ovf_clear
  2563. test_neg_clear
  2564. test_h_gr32 long_dest-666 er0
  2565. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2566. test_gr_a5a5 2
  2567. test_gr_a5a5 3
  2568. test_gr_a5a5 4
  2569. test_gr_a5a5 5
  2570. test_gr_a5a5 6
  2571. test_gr_a5a5 7
  2572. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2573. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2574. cmp.l #0x29696969, @long_dest
  2575. beq .Lldisp322
  2576. fail
  2577. .Lldisp322:
  2578. mov #0xa5a5a5a5, @long_dest
  2579. shlr_l_abs16_2:
  2580. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2581. set_ccr_zero
  2582. shlr.l #2, @long_dest:16 ; shift right logical by two, abs16
  2583. ;;; .word 0x0104
  2584. ;;; .word 0x6b08
  2585. ;;; .word long_dest
  2586. ;;; .word 0x1170
  2587. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2588. test_zero_clear
  2589. test_ovf_clear
  2590. test_neg_clear
  2591. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2592. test_gr_a5a5 1
  2593. test_gr_a5a5 2
  2594. test_gr_a5a5 3
  2595. test_gr_a5a5 4
  2596. test_gr_a5a5 5
  2597. test_gr_a5a5 6
  2598. test_gr_a5a5 7
  2599. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2600. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2601. cmp.l #0x29696969, @long_dest
  2602. beq .Llabs162
  2603. fail
  2604. .Llabs162:
  2605. mov #0xa5a5a5a5, @long_dest
  2606. shlr_l_abs32_2:
  2607. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2608. set_ccr_zero
  2609. shlr.l #2, @long_dest:32 ; shift right logical by two, abs32
  2610. ;;; .word 0x0104
  2611. ;;; .word 0x6b28
  2612. ;;; .long long_dest
  2613. ;;; .word 0x1170
  2614. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2615. test_zero_clear
  2616. test_ovf_clear
  2617. test_neg_clear
  2618. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2619. test_gr_a5a5 1
  2620. test_gr_a5a5 2
  2621. test_gr_a5a5 3
  2622. test_gr_a5a5 4
  2623. test_gr_a5a5 5
  2624. test_gr_a5a5 6
  2625. test_gr_a5a5 7
  2626. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2627. ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
  2628. cmp.l #0x29696969, @long_dest
  2629. beq .Llabs322
  2630. fail
  2631. .Llabs322:
  2632. mov #0xa5a5a5a5, @long_dest
  2633. shlr_l_reg32_4:
  2634. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2635. set_ccr_zero
  2636. shlr.l #4, er0 ; shift right logical by four, register
  2637. ;;; .word 0x1138
  2638. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2639. test_zero_clear
  2640. test_ovf_clear
  2641. test_neg_clear
  2642. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2643. ; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2644. test_h_gr32 0x0a5a5a5a er0
  2645. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2646. test_gr_a5a5 2
  2647. test_gr_a5a5 3
  2648. test_gr_a5a5 4
  2649. test_gr_a5a5 5
  2650. test_gr_a5a5 6
  2651. test_gr_a5a5 7
  2652. shlr_l_reg32_reg8:
  2653. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2654. set_ccr_zero
  2655. mov #5, r1l
  2656. shlr.l r1l, er0 ; shift right logical by value of register
  2657. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2658. test_zero_clear
  2659. test_ovf_clear
  2660. test_neg_clear
  2661. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2662. ; -> 0000 0101 0010 1101 0010 1101 0010 1101
  2663. test_h_gr32 0x052d2d2d er0
  2664. test_h_gr32 0xa5a5a505 er1
  2665. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  2666. test_gr_a5a5 3
  2667. test_gr_a5a5 4
  2668. test_gr_a5a5 5
  2669. test_gr_a5a5 6
  2670. test_gr_a5a5 7
  2671. shlr_l_ind_4:
  2672. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2673. set_ccr_zero
  2674. mov #long_dest, er0
  2675. shlr.l #4, @er0 ; shift right logical by four, indirect
  2676. ;;; .word 0x0104
  2677. ;;; .word 0x6908
  2678. ;;; .word 0x1138
  2679. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2680. test_zero_clear
  2681. test_ovf_clear
  2682. test_neg_clear
  2683. test_h_gr32 long_dest er0
  2684. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2685. test_gr_a5a5 2
  2686. test_gr_a5a5 3
  2687. test_gr_a5a5 4
  2688. test_gr_a5a5 5
  2689. test_gr_a5a5 6
  2690. test_gr_a5a5 7
  2691. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2692. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2693. cmp.l #0x0a5a5a5a, @long_dest
  2694. beq .Llind4
  2695. fail
  2696. .Llind4:
  2697. mov #0xa5a5a5a5, @long_dest
  2698. shlr_l_postinc_4:
  2699. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2700. set_ccr_zero
  2701. mov #long_dest, er0
  2702. shlr.l #4, @er0+ ; shift right logical by four, postinc
  2703. ;;; .word 0x0104
  2704. ;;; .word 0x6d08
  2705. ;;; .word 0x1138
  2706. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2707. test_zero_clear
  2708. test_ovf_clear
  2709. test_neg_clear
  2710. test_h_gr32 long_dest+4 er0
  2711. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2712. test_gr_a5a5 2
  2713. test_gr_a5a5 3
  2714. test_gr_a5a5 4
  2715. test_gr_a5a5 5
  2716. test_gr_a5a5 6
  2717. test_gr_a5a5 7
  2718. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2719. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2720. cmp.l #0x0a5a5a5a, @long_dest
  2721. beq .Llpostinc4
  2722. fail
  2723. .Llpostinc4:
  2724. mov #0xa5a5a5a5, @long_dest
  2725. shlr_l_postdec_4:
  2726. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2727. set_ccr_zero
  2728. mov #long_dest, er0
  2729. shlr.l #4, @er0- ; shift right logical by four, postdec
  2730. ;;; .word 0x0106
  2731. ;;; .word 0x6d08
  2732. ;;; .word 0x1138
  2733. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2734. test_zero_clear
  2735. test_ovf_clear
  2736. test_neg_clear
  2737. test_h_gr32 long_dest-4 er0
  2738. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2739. test_gr_a5a5 2
  2740. test_gr_a5a5 3
  2741. test_gr_a5a5 4
  2742. test_gr_a5a5 5
  2743. test_gr_a5a5 6
  2744. test_gr_a5a5 7
  2745. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2746. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2747. cmp.l #0x0a5a5a5a, @long_dest
  2748. beq .Llpostdec4
  2749. fail
  2750. .Llpostdec4:
  2751. mov #0xa5a5a5a5, @long_dest
  2752. shlr_l_preinc_4:
  2753. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2754. set_ccr_zero
  2755. mov #long_dest-4, er0
  2756. shlr.l #4, @+er0 ; shift right logical by four, preinc
  2757. ;;; .word 0x0105
  2758. ;;; .word 0x6d08
  2759. ;;; .word 0x1138
  2760. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2761. test_zero_clear
  2762. test_ovf_clear
  2763. test_neg_clear
  2764. test_h_gr32 long_dest er0
  2765. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2766. test_gr_a5a5 2
  2767. test_gr_a5a5 3
  2768. test_gr_a5a5 4
  2769. test_gr_a5a5 5
  2770. test_gr_a5a5 6
  2771. test_gr_a5a5 7
  2772. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2773. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2774. cmp.l #0x0a5a5a5a, @long_dest
  2775. beq .Llpreinc4
  2776. fail
  2777. .Llpreinc4:
  2778. mov #0xa5a5a5a5, @long_dest
  2779. shlr_l_predec_4:
  2780. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2781. set_ccr_zero
  2782. mov #long_dest+4, er0
  2783. shlr.l #4, @-er0 ; shift right logical by four, predec
  2784. ;;; .word 0x0107
  2785. ;;; .word 0x6d08
  2786. ;;; .word 0x1138
  2787. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2788. test_zero_clear
  2789. test_ovf_clear
  2790. test_neg_clear
  2791. test_h_gr32 long_dest er0
  2792. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2793. test_gr_a5a5 2
  2794. test_gr_a5a5 3
  2795. test_gr_a5a5 4
  2796. test_gr_a5a5 5
  2797. test_gr_a5a5 6
  2798. test_gr_a5a5 7
  2799. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2800. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2801. cmp.l #0x0a5a5a5a, @long_dest
  2802. beq .Llpredec4
  2803. fail
  2804. .Llpredec4:
  2805. mov #0xa5a5a5a5, @long_dest
  2806. shlr_l_disp2_4:
  2807. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2808. set_ccr_zero
  2809. mov #long_dest-8, er0
  2810. shlr.l #4, @(8:2, er0) ; shift right logical by four, disp2
  2811. ;;; .word 0x0106
  2812. ;;; .word 0x6908
  2813. ;;; .word 0x1138
  2814. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2815. test_zero_clear
  2816. test_ovf_clear
  2817. test_neg_clear
  2818. test_h_gr32 long_dest-8 er0
  2819. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2820. test_gr_a5a5 2
  2821. test_gr_a5a5 3
  2822. test_gr_a5a5 4
  2823. test_gr_a5a5 5
  2824. test_gr_a5a5 6
  2825. test_gr_a5a5 7
  2826. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2827. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2828. cmp.l #0x0a5a5a5a, @long_dest
  2829. beq .Lldisp24
  2830. fail
  2831. .Lldisp24:
  2832. mov #0xa5a5a5a5, @long_dest
  2833. shlr_l_disp16_4:
  2834. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2835. set_ccr_zero
  2836. mov #long_dest-44, er0
  2837. shlr.l #4, @(44:16, er0) ; shift right logical by four, disp16
  2838. ;;; .word 0x0104
  2839. ;;; .word 0x6f08
  2840. ;;; .word 44
  2841. ;;; .word 0x1138
  2842. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2843. test_zero_clear
  2844. test_ovf_clear
  2845. test_neg_clear
  2846. test_h_gr32 long_dest-44 er0
  2847. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2848. test_gr_a5a5 2
  2849. test_gr_a5a5 3
  2850. test_gr_a5a5 4
  2851. test_gr_a5a5 5
  2852. test_gr_a5a5 6
  2853. test_gr_a5a5 7
  2854. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2855. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2856. cmp.l #0x0a5a5a5a, @long_dest
  2857. beq .Lldisp164
  2858. fail
  2859. .Lldisp164:
  2860. mov #0xa5a5a5a5, @long_dest
  2861. shlr_l_disp32_4:
  2862. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2863. set_ccr_zero
  2864. mov #long_dest-666, er0
  2865. shlr.l #4, @(666:32, er0) ; shift right logical by four, disp32
  2866. ;;; .word 0x7884
  2867. ;;; .word 0x6b28
  2868. ;;; .long 666
  2869. ;;; .word 0x1138
  2870. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2871. test_zero_clear
  2872. test_ovf_clear
  2873. test_neg_clear
  2874. test_h_gr32 long_dest-666 er0
  2875. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2876. test_gr_a5a5 2
  2877. test_gr_a5a5 3
  2878. test_gr_a5a5 4
  2879. test_gr_a5a5 5
  2880. test_gr_a5a5 6
  2881. test_gr_a5a5 7
  2882. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2883. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2884. cmp.l #0x0a5a5a5a, @long_dest
  2885. beq .Lldisp324
  2886. fail
  2887. .Lldisp324:
  2888. mov #0xa5a5a5a5, @long_dest
  2889. shlr_l_abs16_4:
  2890. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2891. set_ccr_zero
  2892. shlr.l #4, @long_dest:16 ; shift right logical by four, abs16
  2893. ;;; .word 0x0104
  2894. ;;; .word 0x6b08
  2895. ;;; .word long_dest
  2896. ;;; .word 0x1138
  2897. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2898. test_zero_clear
  2899. test_ovf_clear
  2900. test_neg_clear
  2901. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2902. test_gr_a5a5 1
  2903. test_gr_a5a5 2
  2904. test_gr_a5a5 3
  2905. test_gr_a5a5 4
  2906. test_gr_a5a5 5
  2907. test_gr_a5a5 6
  2908. test_gr_a5a5 7
  2909. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2910. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2911. cmp.l #0x0a5a5a5a, @long_dest
  2912. beq .Llabs164
  2913. fail
  2914. .Llabs164:
  2915. mov #0xa5a5a5a5, @long_dest
  2916. shlr_l_abs32_4:
  2917. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2918. set_ccr_zero
  2919. shlr.l #4, @long_dest:32 ; shift right logical by four, abs32
  2920. ;;; .word 0x0104
  2921. ;;; .word 0x6b28
  2922. ;;; .long long_dest
  2923. ;;; .word 0x1138
  2924. test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
  2925. test_zero_clear
  2926. test_ovf_clear
  2927. test_neg_clear
  2928. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  2929. test_gr_a5a5 1
  2930. test_gr_a5a5 2
  2931. test_gr_a5a5 3
  2932. test_gr_a5a5 4
  2933. test_gr_a5a5 5
  2934. test_gr_a5a5 6
  2935. test_gr_a5a5 7
  2936. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2937. ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
  2938. cmp.l #0x0a5a5a5a, @long_dest
  2939. beq .Llabs324
  2940. fail
  2941. .Llabs324:
  2942. mov #0xa5a5a5a5, @long_dest
  2943. shlr_l_reg32_8:
  2944. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2945. set_ccr_zero
  2946. shlr.l #8, er0 ; shift right logical by eight, register
  2947. ;;; .word 0x1178
  2948. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2949. test_zero_clear
  2950. test_ovf_clear
  2951. test_neg_clear
  2952. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2953. ; -> 0000 0000 1010 0101 1010 0101 1010 0101
  2954. test_h_gr32 0x00a5a5a5 er0
  2955. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2956. test_gr_a5a5 2
  2957. test_gr_a5a5 3
  2958. test_gr_a5a5 4
  2959. test_gr_a5a5 5
  2960. test_gr_a5a5 6
  2961. test_gr_a5a5 7
  2962. shlr_l_ind_8:
  2963. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2964. set_ccr_zero
  2965. mov #long_dest, er0
  2966. shlr.l #8, @er0 ; shift right logical by eight, indirect
  2967. ;;; .word 0x0104
  2968. ;;; .word 0x6908
  2969. ;;; .word 0x1178
  2970. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2971. test_zero_clear
  2972. test_ovf_clear
  2973. test_neg_clear
  2974. test_h_gr32 long_dest er0
  2975. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  2976. test_gr_a5a5 2
  2977. test_gr_a5a5 3
  2978. test_gr_a5a5 4
  2979. test_gr_a5a5 5
  2980. test_gr_a5a5 6
  2981. test_gr_a5a5 7
  2982. ; 1010 0101 1010 0101 1010 0101 1010 0101
  2983. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  2984. cmp.l #0x00a5a5a5, @long_dest
  2985. beq .Llind8
  2986. fail
  2987. .Llind8:
  2988. mov #0xa5a5a5a5, @long_dest
  2989. shlr_l_postinc_8:
  2990. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  2991. set_ccr_zero
  2992. mov #long_dest, er0
  2993. shlr.l #8, @er0+ ; shift right logical by eight, postinc
  2994. ;;; .word 0x0104
  2995. ;;; .word 0x6d08
  2996. ;;; .word 0x1178
  2997. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  2998. test_zero_clear
  2999. test_ovf_clear
  3000. test_neg_clear
  3001. test_h_gr32 long_dest+4 er0
  3002. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3003. test_gr_a5a5 2
  3004. test_gr_a5a5 3
  3005. test_gr_a5a5 4
  3006. test_gr_a5a5 5
  3007. test_gr_a5a5 6
  3008. test_gr_a5a5 7
  3009. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3010. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3011. cmp.l #0x00a5a5a5, @long_dest
  3012. beq .Llpostinc8
  3013. fail
  3014. .Llpostinc8:
  3015. mov #0xa5a5a5a5, @long_dest
  3016. shlr_l_postdec_8:
  3017. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3018. set_ccr_zero
  3019. mov #long_dest, er0
  3020. shlr.l #8, @er0- ; shift right logical by eight, postdec
  3021. ;;; .word 0x0106
  3022. ;;; .word 0x6d08
  3023. ;;; .word 0x1178
  3024. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3025. test_zero_clear
  3026. test_ovf_clear
  3027. test_neg_clear
  3028. test_h_gr32 long_dest-4 er0
  3029. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3030. test_gr_a5a5 2
  3031. test_gr_a5a5 3
  3032. test_gr_a5a5 4
  3033. test_gr_a5a5 5
  3034. test_gr_a5a5 6
  3035. test_gr_a5a5 7
  3036. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3037. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3038. cmp.l #0x00a5a5a5, @long_dest
  3039. beq .Llpostdec8
  3040. fail
  3041. .Llpostdec8:
  3042. mov #0xa5a5a5a5, @long_dest
  3043. shlr_l_preinc_8:
  3044. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3045. set_ccr_zero
  3046. mov #long_dest-4, er0
  3047. shlr.l #8, @+er0 ; shift right logical by eight, preinc
  3048. ;;; .word 0x0105
  3049. ;;; .word 0x6d08
  3050. ;;; .word 0x1178
  3051. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3052. test_zero_clear
  3053. test_ovf_clear
  3054. test_neg_clear
  3055. test_h_gr32 long_dest er0
  3056. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3057. test_gr_a5a5 2
  3058. test_gr_a5a5 3
  3059. test_gr_a5a5 4
  3060. test_gr_a5a5 5
  3061. test_gr_a5a5 6
  3062. test_gr_a5a5 7
  3063. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3064. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3065. cmp.l #0x00a5a5a5, @long_dest
  3066. beq .Llpreinc8
  3067. fail
  3068. .Llpreinc8:
  3069. mov #0xa5a5a5a5, @long_dest
  3070. shlr_l_predec_8:
  3071. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3072. set_ccr_zero
  3073. mov #long_dest+4, er0
  3074. shlr.l #8, @-er0 ; shift right logical by eight, predec
  3075. ;;; .word 0x0107
  3076. ;;; .word 0x6d08
  3077. ;;; .word 0x1178
  3078. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3079. test_zero_clear
  3080. test_ovf_clear
  3081. test_neg_clear
  3082. test_h_gr32 long_dest er0
  3083. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3084. test_gr_a5a5 2
  3085. test_gr_a5a5 3
  3086. test_gr_a5a5 4
  3087. test_gr_a5a5 5
  3088. test_gr_a5a5 6
  3089. test_gr_a5a5 7
  3090. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3091. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3092. cmp.l #0x00a5a5a5, @long_dest
  3093. beq .Llpredec8
  3094. fail
  3095. .Llpredec8:
  3096. mov #0xa5a5a5a5, @long_dest
  3097. shlr_l_disp2_8:
  3098. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3099. set_ccr_zero
  3100. mov #long_dest-8, er0
  3101. shlr.l #8, @(8:2, er0) ; shift right logical by eight, disp2
  3102. ;;; .word 0x0106
  3103. ;;; .word 0x6908
  3104. ;;; .word 0x1178
  3105. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3106. test_zero_clear
  3107. test_ovf_clear
  3108. test_neg_clear
  3109. test_h_gr32 long_dest-8 er0
  3110. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3111. test_gr_a5a5 2
  3112. test_gr_a5a5 3
  3113. test_gr_a5a5 4
  3114. test_gr_a5a5 5
  3115. test_gr_a5a5 6
  3116. test_gr_a5a5 7
  3117. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3118. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3119. cmp.l #0x00a5a5a5, @long_dest
  3120. beq .Lldisp28
  3121. fail
  3122. .Lldisp28:
  3123. mov #0xa5a5a5a5, @long_dest
  3124. shlr_l_disp16_8:
  3125. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3126. set_ccr_zero
  3127. mov #long_dest-44, er0
  3128. shlr.l #8, @(44:16, er0) ; shift right logical by eight, disp16
  3129. ;;; .word 0x0104
  3130. ;;; .word 0x6f08
  3131. ;;; .word 44
  3132. ;;; .word 0x1178
  3133. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3134. test_zero_clear
  3135. test_ovf_clear
  3136. test_neg_clear
  3137. test_h_gr32 long_dest-44 er0
  3138. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3139. test_gr_a5a5 2
  3140. test_gr_a5a5 3
  3141. test_gr_a5a5 4
  3142. test_gr_a5a5 5
  3143. test_gr_a5a5 6
  3144. test_gr_a5a5 7
  3145. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3146. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3147. cmp.l #0x00a5a5a5, @long_dest
  3148. beq .Lldisp168
  3149. fail
  3150. .Lldisp168:
  3151. mov #0xa5a5a5a5, @long_dest
  3152. shlr_l_disp32_8:
  3153. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3154. set_ccr_zero
  3155. mov #long_dest-666, er0
  3156. shlr.l #8, @(666:32, er0) ; shift right logical by eight, disp32
  3157. ;;; .word 0x7884
  3158. ;;; .word 0x6b28
  3159. ;;; .long 666
  3160. ;;; .word 0x1178
  3161. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3162. test_zero_clear
  3163. test_ovf_clear
  3164. test_neg_clear
  3165. test_h_gr32 long_dest-666 er0
  3166. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3167. test_gr_a5a5 2
  3168. test_gr_a5a5 3
  3169. test_gr_a5a5 4
  3170. test_gr_a5a5 5
  3171. test_gr_a5a5 6
  3172. test_gr_a5a5 7
  3173. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3174. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3175. cmp.l #0x00a5a5a5, @long_dest
  3176. beq .Lldisp328
  3177. fail
  3178. .Lldisp328:
  3179. mov #0xa5a5a5a5, @long_dest
  3180. shlr_l_abs16_8:
  3181. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3182. set_ccr_zero
  3183. shlr.l #8, @long_dest:16 ; shift right logical by eight, abs16
  3184. ;;; .word 0x0104
  3185. ;;; .word 0x6b08
  3186. ;;; .word long_dest
  3187. ;;; .word 0x1178
  3188. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3189. test_zero_clear
  3190. test_ovf_clear
  3191. test_neg_clear
  3192. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  3193. test_gr_a5a5 1
  3194. test_gr_a5a5 2
  3195. test_gr_a5a5 3
  3196. test_gr_a5a5 4
  3197. test_gr_a5a5 5
  3198. test_gr_a5a5 6
  3199. test_gr_a5a5 7
  3200. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3201. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3202. cmp.l #0x00a5a5a5, @long_dest
  3203. beq .Llabs168
  3204. fail
  3205. .Llabs168:
  3206. mov #0xa5a5a5a5, @long_dest
  3207. shlr_l_abs32_8:
  3208. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3209. set_ccr_zero
  3210. shlr.l #8, @long_dest:32 ; shift right logical by eight, abs32
  3211. ;;; .word 0x0104
  3212. ;;; .word 0x6b28
  3213. ;;; .long long_dest
  3214. ;;; .word 0x1178
  3215. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3216. test_zero_clear
  3217. test_ovf_clear
  3218. test_neg_clear
  3219. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  3220. test_gr_a5a5 1
  3221. test_gr_a5a5 2
  3222. test_gr_a5a5 3
  3223. test_gr_a5a5 4
  3224. test_gr_a5a5 5
  3225. test_gr_a5a5 6
  3226. test_gr_a5a5 7
  3227. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3228. ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
  3229. cmp.l #0x00a5a5a5, @long_dest
  3230. beq .Llabs328
  3231. fail
  3232. .Llabs328:
  3233. mov #0xa5a5a5a5, @long_dest
  3234. shlr_l_reg32_16:
  3235. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3236. set_ccr_zero
  3237. shlr.l #16, er0 ; shift right logical by sixteen, register
  3238. ;;; .word 0x11f8
  3239. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3240. test_zero_clear
  3241. test_ovf_clear
  3242. test_neg_clear
  3243. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3244. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3245. test_h_gr32 0x0000a5a5 er0
  3246. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3247. test_gr_a5a5 2
  3248. test_gr_a5a5 3
  3249. test_gr_a5a5 4
  3250. test_gr_a5a5 5
  3251. test_gr_a5a5 6
  3252. test_gr_a5a5 7
  3253. shlr_l_ind_16:
  3254. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3255. set_ccr_zero
  3256. mov #long_dest, er0
  3257. shlr.l #16, @er0 ; shift right logical by sixteen, indirect
  3258. ;;; .word 0x0104
  3259. ;;; .word 0x6908
  3260. ;;; .word 0x11f8
  3261. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3262. test_zero_clear
  3263. test_ovf_clear
  3264. test_neg_clear
  3265. test_h_gr32 long_dest er0
  3266. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3267. test_gr_a5a5 2
  3268. test_gr_a5a5 3
  3269. test_gr_a5a5 4
  3270. test_gr_a5a5 5
  3271. test_gr_a5a5 6
  3272. test_gr_a5a5 7
  3273. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3274. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3275. cmp.l #0x0000a5a5, @long_dest
  3276. beq .Llind16
  3277. fail
  3278. .Llind16:
  3279. mov #0xa5a5a5a5, @long_dest
  3280. shlr_l_postinc_16:
  3281. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3282. set_ccr_zero
  3283. mov #long_dest, er0
  3284. shlr.l #16, @er0+ ; shift right logical by sixteen, postinc
  3285. ;;; .word 0x0104
  3286. ;;; .word 0x6d08
  3287. ;;; .word 0x11f8
  3288. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3289. test_zero_clear
  3290. test_ovf_clear
  3291. test_neg_clear
  3292. test_h_gr32 long_dest+4 er0
  3293. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3294. test_gr_a5a5 2
  3295. test_gr_a5a5 3
  3296. test_gr_a5a5 4
  3297. test_gr_a5a5 5
  3298. test_gr_a5a5 6
  3299. test_gr_a5a5 7
  3300. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3301. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3302. cmp.l #0x0000a5a5, @long_dest
  3303. beq .Llpostinc16
  3304. fail
  3305. .Llpostinc16:
  3306. mov #0xa5a5a5a5, @long_dest
  3307. shlr_l_postdec_16:
  3308. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3309. set_ccr_zero
  3310. mov #long_dest, er0
  3311. shlr.l #16, @er0- ; shift right logical by sixteen, postdec
  3312. ;;; .word 0x0106
  3313. ;;; .word 0x6d08
  3314. ;;; .word 0x11f8
  3315. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3316. test_zero_clear
  3317. test_ovf_clear
  3318. test_neg_clear
  3319. test_h_gr32 long_dest-4 er0
  3320. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3321. test_gr_a5a5 2
  3322. test_gr_a5a5 3
  3323. test_gr_a5a5 4
  3324. test_gr_a5a5 5
  3325. test_gr_a5a5 6
  3326. test_gr_a5a5 7
  3327. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3328. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3329. cmp.l #0x0000a5a5, @long_dest
  3330. beq .Llpostdec16
  3331. fail
  3332. .Llpostdec16:
  3333. mov #0xa5a5a5a5, @long_dest
  3334. shlr_l_preinc_16:
  3335. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3336. set_ccr_zero
  3337. mov #long_dest-4, er0
  3338. shlr.l #16, @+er0 ; shift right logical by sixteen, preinc
  3339. ;;; .word 0x0105
  3340. ;;; .word 0x6d08
  3341. ;;; .word 0x11f8
  3342. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3343. test_zero_clear
  3344. test_ovf_clear
  3345. test_neg_clear
  3346. test_h_gr32 long_dest er0
  3347. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3348. test_gr_a5a5 2
  3349. test_gr_a5a5 3
  3350. test_gr_a5a5 4
  3351. test_gr_a5a5 5
  3352. test_gr_a5a5 6
  3353. test_gr_a5a5 7
  3354. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3355. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3356. cmp.l #0x0000a5a5, @long_dest
  3357. beq .Llpreinc16
  3358. fail
  3359. .Llpreinc16:
  3360. mov #0xa5a5a5a5, @long_dest
  3361. shlr_l_predec_16:
  3362. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3363. set_ccr_zero
  3364. mov #long_dest+4, er0
  3365. shlr.l #16, @-er0 ; shift right logical by sixteen, predec
  3366. ;;; .word 0x0107
  3367. ;;; .word 0x6d08
  3368. ;;; .word 0x11f8
  3369. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3370. test_zero_clear
  3371. test_ovf_clear
  3372. test_neg_clear
  3373. test_h_gr32 long_dest er0
  3374. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3375. test_gr_a5a5 2
  3376. test_gr_a5a5 3
  3377. test_gr_a5a5 4
  3378. test_gr_a5a5 5
  3379. test_gr_a5a5 6
  3380. test_gr_a5a5 7
  3381. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3382. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3383. cmp.l #0x0000a5a5, @long_dest
  3384. beq .Llpredec16
  3385. fail
  3386. .Llpredec16:
  3387. mov #0xa5a5a5a5, @long_dest
  3388. shlr_l_disp2_16:
  3389. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3390. set_ccr_zero
  3391. mov #long_dest-8, er0
  3392. shlr.l #16, @(8:2, er0) ; shift right logical by 16, dest2
  3393. ;;; .word 0x0106
  3394. ;;; .word 0x6908
  3395. ;;; .word 0x11f8
  3396. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3397. test_zero_clear
  3398. test_ovf_clear
  3399. test_neg_clear
  3400. test_h_gr32 long_dest-8 er0
  3401. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3402. test_gr_a5a5 2
  3403. test_gr_a5a5 3
  3404. test_gr_a5a5 4
  3405. test_gr_a5a5 5
  3406. test_gr_a5a5 6
  3407. test_gr_a5a5 7
  3408. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3409. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3410. cmp.l #0x0000a5a5, @long_dest
  3411. beq .Lldisp216
  3412. fail
  3413. .Lldisp216:
  3414. mov #0xa5a5a5a5, @long_dest
  3415. shlr_l_disp16_16:
  3416. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3417. set_ccr_zero
  3418. mov #long_dest-44, er0
  3419. shlr.l #16, @(44:16, er0) ; shift right logical by 16, disp16
  3420. ;;; .word 0x0104
  3421. ;;; .word 0x6f08
  3422. ;;; .word 44
  3423. ;;; .word 0x11f8
  3424. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3425. test_zero_clear
  3426. test_ovf_clear
  3427. test_neg_clear
  3428. test_h_gr32 long_dest-44 er0
  3429. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3430. test_gr_a5a5 2
  3431. test_gr_a5a5 3
  3432. test_gr_a5a5 4
  3433. test_gr_a5a5 5
  3434. test_gr_a5a5 6
  3435. test_gr_a5a5 7
  3436. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3437. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3438. cmp.l #0x0000a5a5, @long_dest
  3439. beq .Lldisp1616
  3440. fail
  3441. .Lldisp1616:
  3442. mov #0xa5a5a5a5, @long_dest
  3443. shlr_l_disp32_16:
  3444. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3445. set_ccr_zero
  3446. mov #long_dest-666, er0
  3447. shlr.l #16, @(666:32, er0) ; shift right logical by 16, disp32
  3448. ;;; .word 0x7884
  3449. ;;; .word 0x6b28
  3450. ;;; .long 666
  3451. ;;; .word 0x11f8
  3452. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3453. test_zero_clear
  3454. test_ovf_clear
  3455. test_neg_clear
  3456. test_h_gr32 long_dest-666 er0
  3457. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  3458. test_gr_a5a5 2
  3459. test_gr_a5a5 3
  3460. test_gr_a5a5 4
  3461. test_gr_a5a5 5
  3462. test_gr_a5a5 6
  3463. test_gr_a5a5 7
  3464. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3465. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3466. cmp.l #0x0000a5a5, @long_dest
  3467. beq .Lldisp3216
  3468. fail
  3469. .Lldisp3216:
  3470. mov #0xa5a5a5a5, @long_dest
  3471. shlr_l_abs16_16:
  3472. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3473. set_ccr_zero
  3474. shlr.l #16, @long_dest:16 ; shift right logical by 16, abs16
  3475. ;;; .word 0x0104
  3476. ;;; .word 0x6b08
  3477. ;;; .word long_dest
  3478. ;;; .word 0x11f8
  3479. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3480. test_zero_clear
  3481. test_ovf_clear
  3482. test_neg_clear
  3483. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  3484. test_gr_a5a5 1
  3485. test_gr_a5a5 2
  3486. test_gr_a5a5 3
  3487. test_gr_a5a5 4
  3488. test_gr_a5a5 5
  3489. test_gr_a5a5 6
  3490. test_gr_a5a5 7
  3491. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3492. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3493. cmp.l #0x0000a5a5, @long_dest
  3494. beq .Llabs1616
  3495. fail
  3496. .Llabs1616:
  3497. mov #0xa5a5a5a5, @long_dest
  3498. shlr_l_abs32_16:
  3499. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  3500. set_ccr_zero
  3501. shlr.l #16, @long_dest:32 ; shift right logical by 16, abs32
  3502. ;;; .word 0x0104
  3503. ;;; .word 0x6b28
  3504. ;;; .long long_dest
  3505. ;;; .word 0x11f8
  3506. test_carry_set ; H=0 N=0 Z=0 V=0 C=1
  3507. test_zero_clear
  3508. test_ovf_clear
  3509. test_neg_clear
  3510. test_gr_a5a5 0 ; Make sure ALL general regs not disturbed
  3511. test_gr_a5a5 1
  3512. test_gr_a5a5 2
  3513. test_gr_a5a5 3
  3514. test_gr_a5a5 4
  3515. test_gr_a5a5 5
  3516. test_gr_a5a5 6
  3517. test_gr_a5a5 7
  3518. ; 1010 0101 1010 0101 1010 0101 1010 0101
  3519. ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
  3520. cmp.l #0x0000a5a5, @long_dest
  3521. beq .Llabs3216
  3522. fail
  3523. .Llabs3216:
  3524. mov #0xa5a5a5a5, @long_dest
  3525. .endif
  3526. .endif
  3527. pass
  3528. exit 0