semcrisv10f-switch.c 370 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047
  1. /* Simulator instruction semantics for crisv10f.
  2. THIS FILE IS MACHINE GENERATED WITH CGEN.
  3. Copyright 1996-2022 Free Software Foundation, Inc.
  4. This file is part of the GNU simulators.
  5. This file is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License along
  14. with this program; if not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifdef DEFINE_LABELS
  17. /* The labels have the case they have because the enum of insn types
  18. is all uppercase and in the non-stdc case the insn symbol is built
  19. into the enum name. */
  20. static struct {
  21. int index;
  22. void *label;
  23. } labels[] = {
  24. { CRISV10F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
  25. { CRISV10F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
  26. { CRISV10F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
  27. { CRISV10F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
  28. { CRISV10F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
  29. { CRISV10F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
  30. { CRISV10F_INSN_NOP, && case_sem_INSN_NOP },
  31. { CRISV10F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
  32. { CRISV10F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
  33. { CRISV10F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
  34. { CRISV10F_INSN_MOVEPCR, && case_sem_INSN_MOVEPCR },
  35. { CRISV10F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
  36. { CRISV10F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
  37. { CRISV10F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
  38. { CRISV10F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
  39. { CRISV10F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
  40. { CRISV10F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
  41. { CRISV10F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
  42. { CRISV10F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
  43. { CRISV10F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
  44. { CRISV10F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
  45. { CRISV10F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
  46. { CRISV10F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
  47. { CRISV10F_INSN_ADDQ, && case_sem_INSN_ADDQ },
  48. { CRISV10F_INSN_SUBQ, && case_sem_INSN_SUBQ },
  49. { CRISV10F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
  50. { CRISV10F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
  51. { CRISV10F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
  52. { CRISV10F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
  53. { CRISV10F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
  54. { CRISV10F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
  55. { CRISV10F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
  56. { CRISV10F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
  57. { CRISV10F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
  58. { CRISV10F_INSN_CMPQ, && case_sem_INSN_CMPQ },
  59. { CRISV10F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
  60. { CRISV10F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
  61. { CRISV10F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
  62. { CRISV10F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
  63. { CRISV10F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
  64. { CRISV10F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
  65. { CRISV10F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
  66. { CRISV10F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
  67. { CRISV10F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
  68. { CRISV10F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
  69. { CRISV10F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
  70. { CRISV10F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
  71. { CRISV10F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
  72. { CRISV10F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
  73. { CRISV10F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
  74. { CRISV10F_INSN_MOVE_R_SPRV10, && case_sem_INSN_MOVE_R_SPRV10 },
  75. { CRISV10F_INSN_MOVE_SPR_RV10, && case_sem_INSN_MOVE_SPR_RV10 },
  76. { CRISV10F_INSN_RET_TYPE, && case_sem_INSN_RET_TYPE },
  77. { CRISV10F_INSN_MOVE_M_SPRV10, && case_sem_INSN_MOVE_M_SPRV10 },
  78. { CRISV10F_INSN_MOVE_C_SPRV10_P5, && case_sem_INSN_MOVE_C_SPRV10_P5 },
  79. { CRISV10F_INSN_MOVE_C_SPRV10_P9, && case_sem_INSN_MOVE_C_SPRV10_P9 },
  80. { CRISV10F_INSN_MOVE_C_SPRV10_P10, && case_sem_INSN_MOVE_C_SPRV10_P10 },
  81. { CRISV10F_INSN_MOVE_C_SPRV10_P11, && case_sem_INSN_MOVE_C_SPRV10_P11 },
  82. { CRISV10F_INSN_MOVE_C_SPRV10_P12, && case_sem_INSN_MOVE_C_SPRV10_P12 },
  83. { CRISV10F_INSN_MOVE_C_SPRV10_P13, && case_sem_INSN_MOVE_C_SPRV10_P13 },
  84. { CRISV10F_INSN_MOVE_C_SPRV10_P7, && case_sem_INSN_MOVE_C_SPRV10_P7 },
  85. { CRISV10F_INSN_MOVE_C_SPRV10_P14, && case_sem_INSN_MOVE_C_SPRV10_P14 },
  86. { CRISV10F_INSN_MOVE_C_SPRV10_P15, && case_sem_INSN_MOVE_C_SPRV10_P15 },
  87. { CRISV10F_INSN_MOVE_SPR_MV10, && case_sem_INSN_MOVE_SPR_MV10 },
  88. { CRISV10F_INSN_SBFS, && case_sem_INSN_SBFS },
  89. { CRISV10F_INSN_MOVEM_R_M, && case_sem_INSN_MOVEM_R_M },
  90. { CRISV10F_INSN_MOVEM_M_R, && case_sem_INSN_MOVEM_M_R },
  91. { CRISV10F_INSN_MOVEM_M_PC, && case_sem_INSN_MOVEM_M_PC },
  92. { CRISV10F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
  93. { CRISV10F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
  94. { CRISV10F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
  95. { CRISV10F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
  96. { CRISV10F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
  97. { CRISV10F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
  98. { CRISV10F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
  99. { CRISV10F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
  100. { CRISV10F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
  101. { CRISV10F_INSN_ADDCPC, && case_sem_INSN_ADDCPC },
  102. { CRISV10F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
  103. { CRISV10F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
  104. { CRISV10F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
  105. { CRISV10F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
  106. { CRISV10F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
  107. { CRISV10F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
  108. { CRISV10F_INSN_ADDSPCPC, && case_sem_INSN_ADDSPCPC },
  109. { CRISV10F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
  110. { CRISV10F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
  111. { CRISV10F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
  112. { CRISV10F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
  113. { CRISV10F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
  114. { CRISV10F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
  115. { CRISV10F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
  116. { CRISV10F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
  117. { CRISV10F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
  118. { CRISV10F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
  119. { CRISV10F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
  120. { CRISV10F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
  121. { CRISV10F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
  122. { CRISV10F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
  123. { CRISV10F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
  124. { CRISV10F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
  125. { CRISV10F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
  126. { CRISV10F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
  127. { CRISV10F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
  128. { CRISV10F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
  129. { CRISV10F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
  130. { CRISV10F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
  131. { CRISV10F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
  132. { CRISV10F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
  133. { CRISV10F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
  134. { CRISV10F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
  135. { CRISV10F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
  136. { CRISV10F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
  137. { CRISV10F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
  138. { CRISV10F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
  139. { CRISV10F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
  140. { CRISV10F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
  141. { CRISV10F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
  142. { CRISV10F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
  143. { CRISV10F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
  144. { CRISV10F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
  145. { CRISV10F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
  146. { CRISV10F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
  147. { CRISV10F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
  148. { CRISV10F_INSN_MULS_B, && case_sem_INSN_MULS_B },
  149. { CRISV10F_INSN_MULS_W, && case_sem_INSN_MULS_W },
  150. { CRISV10F_INSN_MULS_D, && case_sem_INSN_MULS_D },
  151. { CRISV10F_INSN_MULU_B, && case_sem_INSN_MULU_B },
  152. { CRISV10F_INSN_MULU_W, && case_sem_INSN_MULU_W },
  153. { CRISV10F_INSN_MULU_D, && case_sem_INSN_MULU_D },
  154. { CRISV10F_INSN_MSTEP, && case_sem_INSN_MSTEP },
  155. { CRISV10F_INSN_DSTEP, && case_sem_INSN_DSTEP },
  156. { CRISV10F_INSN_ABS, && case_sem_INSN_ABS },
  157. { CRISV10F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
  158. { CRISV10F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
  159. { CRISV10F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
  160. { CRISV10F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
  161. { CRISV10F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
  162. { CRISV10F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
  163. { CRISV10F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
  164. { CRISV10F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
  165. { CRISV10F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
  166. { CRISV10F_INSN_ANDQ, && case_sem_INSN_ANDQ },
  167. { CRISV10F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
  168. { CRISV10F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
  169. { CRISV10F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
  170. { CRISV10F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
  171. { CRISV10F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
  172. { CRISV10F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
  173. { CRISV10F_INSN_ORCBR, && case_sem_INSN_ORCBR },
  174. { CRISV10F_INSN_ORCWR, && case_sem_INSN_ORCWR },
  175. { CRISV10F_INSN_ORCDR, && case_sem_INSN_ORCDR },
  176. { CRISV10F_INSN_ORQ, && case_sem_INSN_ORQ },
  177. { CRISV10F_INSN_XOR, && case_sem_INSN_XOR },
  178. { CRISV10F_INSN_SWAP, && case_sem_INSN_SWAP },
  179. { CRISV10F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
  180. { CRISV10F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
  181. { CRISV10F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
  182. { CRISV10F_INSN_ASRQ, && case_sem_INSN_ASRQ },
  183. { CRISV10F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
  184. { CRISV10F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
  185. { CRISV10F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
  186. { CRISV10F_INSN_LSRQ, && case_sem_INSN_LSRQ },
  187. { CRISV10F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
  188. { CRISV10F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
  189. { CRISV10F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
  190. { CRISV10F_INSN_LSLQ, && case_sem_INSN_LSLQ },
  191. { CRISV10F_INSN_BTST, && case_sem_INSN_BTST },
  192. { CRISV10F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
  193. { CRISV10F_INSN_SETF, && case_sem_INSN_SETF },
  194. { CRISV10F_INSN_CLEARF, && case_sem_INSN_CLEARF },
  195. { CRISV10F_INSN_BCC_B, && case_sem_INSN_BCC_B },
  196. { CRISV10F_INSN_BA_B, && case_sem_INSN_BA_B },
  197. { CRISV10F_INSN_BCC_W, && case_sem_INSN_BCC_W },
  198. { CRISV10F_INSN_BA_W, && case_sem_INSN_BA_W },
  199. { CRISV10F_INSN_JUMP_R, && case_sem_INSN_JUMP_R },
  200. { CRISV10F_INSN_JUMP_M, && case_sem_INSN_JUMP_M },
  201. { CRISV10F_INSN_JUMP_C, && case_sem_INSN_JUMP_C },
  202. { CRISV10F_INSN_BREAK, && case_sem_INSN_BREAK },
  203. { CRISV10F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
  204. { CRISV10F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
  205. { CRISV10F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
  206. { CRISV10F_INSN_BOUND_M_B_M, && case_sem_INSN_BOUND_M_B_M },
  207. { CRISV10F_INSN_BOUND_M_W_M, && case_sem_INSN_BOUND_M_W_M },
  208. { CRISV10F_INSN_BOUND_M_D_M, && case_sem_INSN_BOUND_M_D_M },
  209. { CRISV10F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
  210. { CRISV10F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
  211. { CRISV10F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
  212. { CRISV10F_INSN_SCC, && case_sem_INSN_SCC },
  213. { CRISV10F_INSN_LZ, && case_sem_INSN_LZ },
  214. { CRISV10F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
  215. { CRISV10F_INSN_BDAPQPC, && case_sem_INSN_BDAPQPC },
  216. { CRISV10F_INSN_BDAP_32_PC, && case_sem_INSN_BDAP_32_PC },
  217. { CRISV10F_INSN_MOVE_M_PCPLUS_P0, && case_sem_INSN_MOVE_M_PCPLUS_P0 },
  218. { CRISV10F_INSN_MOVE_M_SPPLUS_P8, && case_sem_INSN_MOVE_M_SPPLUS_P8 },
  219. { CRISV10F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
  220. { CRISV10F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
  221. { CRISV10F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
  222. { CRISV10F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
  223. { CRISV10F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
  224. { CRISV10F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
  225. { CRISV10F_INSN_DIP_M, && case_sem_INSN_DIP_M },
  226. { CRISV10F_INSN_DIP_C, && case_sem_INSN_DIP_C },
  227. { CRISV10F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
  228. { CRISV10F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
  229. { CRISV10F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
  230. { CRISV10F_INSN_BIAP_PC_B_R, && case_sem_INSN_BIAP_PC_B_R },
  231. { CRISV10F_INSN_BIAP_PC_W_R, && case_sem_INSN_BIAP_PC_W_R },
  232. { CRISV10F_INSN_BIAP_PC_D_R, && case_sem_INSN_BIAP_PC_D_R },
  233. { 0, 0 }
  234. };
  235. int i;
  236. for (i = 0; labels[i].label != 0; ++i)
  237. {
  238. #if FAST_P
  239. CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
  240. #else
  241. CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
  242. #endif
  243. }
  244. #undef DEFINE_LABELS
  245. #endif /* DEFINE_LABELS */
  246. #ifdef DEFINE_SWITCH
  247. /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
  248. off frills like tracing and profiling. */
  249. /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
  250. that can cause it to be optimized out. Another way would be to emit
  251. special handlers into the instruction "stream". */
  252. #if FAST_P
  253. #undef CGEN_TRACE_RESULT
  254. #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
  255. #endif
  256. #undef GET_ATTR
  257. #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
  258. {
  259. #if WITH_SCACHE_PBB
  260. /* Branch to next handler without going around main loop. */
  261. #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
  262. SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
  263. #else /* ! WITH_SCACHE_PBB */
  264. #define NEXT(vpc) BREAK (sem)
  265. #ifdef __GNUC__
  266. #if FAST_P
  267. SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
  268. #else
  269. SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
  270. #endif
  271. #else
  272. SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
  273. #endif
  274. #endif /* ! WITH_SCACHE_PBB */
  275. {
  276. CASE (sem, INSN_X_INVALID) : /* --invalid-- */
  277. {
  278. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  279. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  280. #define FLD(f) abuf->fields.sfmt_empty.f
  281. int UNUSED written = 0;
  282. IADDR UNUSED pc = abuf->addr;
  283. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  284. {
  285. /* Update the recorded pc in the cpu state struct.
  286. Only necessary for WITH_SCACHE case, but to avoid the
  287. conditional compilation .... */
  288. SET_H_PC (pc);
  289. /* Virtual insns have zero size. Overwrite vpc with address of next insn
  290. using the default-insn-bitsize spec. When executing insns in parallel
  291. we may want to queue the fault and continue execution. */
  292. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  293. vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
  294. }
  295. #undef FLD
  296. }
  297. NEXT (vpc);
  298. CASE (sem, INSN_X_AFTER) : /* --after-- */
  299. {
  300. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  301. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  302. #define FLD(f) abuf->fields.sfmt_empty.f
  303. int UNUSED written = 0;
  304. IADDR UNUSED pc = abuf->addr;
  305. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  306. {
  307. #if WITH_SCACHE_PBB_CRISV10F
  308. crisv10f_pbb_after (current_cpu, sem_arg);
  309. #endif
  310. }
  311. #undef FLD
  312. }
  313. NEXT (vpc);
  314. CASE (sem, INSN_X_BEFORE) : /* --before-- */
  315. {
  316. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  317. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  318. #define FLD(f) abuf->fields.sfmt_empty.f
  319. int UNUSED written = 0;
  320. IADDR UNUSED pc = abuf->addr;
  321. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  322. {
  323. #if WITH_SCACHE_PBB_CRISV10F
  324. crisv10f_pbb_before (current_cpu, sem_arg);
  325. #endif
  326. }
  327. #undef FLD
  328. }
  329. NEXT (vpc);
  330. CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
  331. {
  332. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  333. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  334. #define FLD(f) abuf->fields.sfmt_empty.f
  335. int UNUSED written = 0;
  336. IADDR UNUSED pc = abuf->addr;
  337. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  338. {
  339. #if WITH_SCACHE_PBB_CRISV10F
  340. #ifdef DEFINE_SWITCH
  341. vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
  342. pbb_br_type, pbb_br_npc);
  343. BREAK (sem);
  344. #else
  345. /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
  346. vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
  347. CPU_PBB_BR_TYPE (current_cpu),
  348. CPU_PBB_BR_NPC (current_cpu));
  349. #endif
  350. #endif
  351. }
  352. #undef FLD
  353. }
  354. NEXT (vpc);
  355. CASE (sem, INSN_X_CHAIN) : /* --chain-- */
  356. {
  357. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  358. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  359. #define FLD(f) abuf->fields.sfmt_empty.f
  360. int UNUSED written = 0;
  361. IADDR UNUSED pc = abuf->addr;
  362. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  363. {
  364. #if WITH_SCACHE_PBB_CRISV10F
  365. vpc = crisv10f_pbb_chain (current_cpu, sem_arg);
  366. #ifdef DEFINE_SWITCH
  367. BREAK (sem);
  368. #endif
  369. #endif
  370. }
  371. #undef FLD
  372. }
  373. NEXT (vpc);
  374. CASE (sem, INSN_X_BEGIN) : /* --begin-- */
  375. {
  376. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  377. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  378. #define FLD(f) abuf->fields.sfmt_empty.f
  379. int UNUSED written = 0;
  380. IADDR UNUSED pc = abuf->addr;
  381. vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
  382. {
  383. #if WITH_SCACHE_PBB_CRISV10F
  384. #if defined DEFINE_SWITCH || defined FAST_P
  385. /* In the switch case FAST_P is a constant, allowing several optimizations
  386. in any called inline functions. */
  387. vpc = crisv10f_pbb_begin (current_cpu, FAST_P);
  388. #else
  389. #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
  390. vpc = crisv10f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
  391. #else
  392. vpc = crisv10f_pbb_begin (current_cpu, 0);
  393. #endif
  394. #endif
  395. #endif
  396. }
  397. #undef FLD
  398. }
  399. NEXT (vpc);
  400. CASE (sem, INSN_NOP) : /* nop */
  401. {
  402. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  403. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  404. #define FLD(f) abuf->fields.sfmt_empty.f
  405. int UNUSED written = 0;
  406. IADDR UNUSED pc = abuf->addr;
  407. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  408. {
  409. {
  410. BI opval = 0;
  411. CPU (h_xbit) = opval;
  412. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  413. }
  414. {
  415. BI opval = 0;
  416. SET_H_INSN_PREFIXED_P (opval);
  417. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  418. }
  419. }
  420. #undef FLD
  421. }
  422. NEXT (vpc);
  423. CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
  424. {
  425. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  426. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  427. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  428. int UNUSED written = 0;
  429. IADDR UNUSED pc = abuf->addr;
  430. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  431. {
  432. QI tmp_newval;
  433. tmp_newval = GET_H_GR (FLD (f_operand1));
  434. {
  435. SI tmp_oldregval;
  436. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  437. {
  438. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  439. SET_H_GR (FLD (f_operand2), opval);
  440. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  441. }
  442. }
  443. {
  444. {
  445. BI opval = LTQI (tmp_newval, 0);
  446. CPU (h_nbit) = opval;
  447. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  448. }
  449. {
  450. BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  451. CPU (h_zbit) = opval;
  452. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  453. }
  454. SET_H_CBIT_MOVE (0);
  455. SET_H_VBIT_MOVE (0);
  456. {
  457. {
  458. BI opval = 0;
  459. CPU (h_xbit) = opval;
  460. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  461. }
  462. {
  463. BI opval = 0;
  464. SET_H_INSN_PREFIXED_P (opval);
  465. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  466. }
  467. }
  468. }
  469. }
  470. #undef FLD
  471. }
  472. NEXT (vpc);
  473. CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
  474. {
  475. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  476. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  477. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  478. int UNUSED written = 0;
  479. IADDR UNUSED pc = abuf->addr;
  480. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  481. {
  482. HI tmp_newval;
  483. tmp_newval = GET_H_GR (FLD (f_operand1));
  484. {
  485. SI tmp_oldregval;
  486. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  487. {
  488. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  489. SET_H_GR (FLD (f_operand2), opval);
  490. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  491. }
  492. }
  493. {
  494. {
  495. BI opval = LTHI (tmp_newval, 0);
  496. CPU (h_nbit) = opval;
  497. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  498. }
  499. {
  500. BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  501. CPU (h_zbit) = opval;
  502. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  503. }
  504. SET_H_CBIT_MOVE (0);
  505. SET_H_VBIT_MOVE (0);
  506. {
  507. {
  508. BI opval = 0;
  509. CPU (h_xbit) = opval;
  510. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  511. }
  512. {
  513. BI opval = 0;
  514. SET_H_INSN_PREFIXED_P (opval);
  515. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  516. }
  517. }
  518. }
  519. }
  520. #undef FLD
  521. }
  522. NEXT (vpc);
  523. CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
  524. {
  525. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  526. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  527. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  528. int UNUSED written = 0;
  529. IADDR UNUSED pc = abuf->addr;
  530. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  531. {
  532. SI tmp_newval;
  533. tmp_newval = GET_H_GR (FLD (f_operand1));
  534. {
  535. SI opval = tmp_newval;
  536. SET_H_GR (FLD (f_operand2), opval);
  537. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  538. }
  539. {
  540. {
  541. BI opval = LTSI (tmp_newval, 0);
  542. CPU (h_nbit) = opval;
  543. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  544. }
  545. {
  546. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  547. CPU (h_zbit) = opval;
  548. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  549. }
  550. SET_H_CBIT_MOVE (0);
  551. SET_H_VBIT_MOVE (0);
  552. {
  553. {
  554. BI opval = 0;
  555. CPU (h_xbit) = opval;
  556. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  557. }
  558. {
  559. BI opval = 0;
  560. SET_H_INSN_PREFIXED_P (opval);
  561. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  562. }
  563. }
  564. }
  565. }
  566. #undef FLD
  567. }
  568. NEXT (vpc);
  569. CASE (sem, INSN_MOVEPCR) : /* move.d PC,${Rd} */
  570. {
  571. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  572. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  573. #define FLD(f) abuf->fields.sfmt_moveq.f
  574. int UNUSED written = 0;
  575. IADDR UNUSED pc = abuf->addr;
  576. SEM_BRANCH_INIT
  577. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  578. {
  579. SI tmp_pcval;
  580. tmp_pcval = ADDSI (pc, 2);
  581. {
  582. SI opval = tmp_pcval;
  583. SET_H_GR (FLD (f_operand2), opval);
  584. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  585. }
  586. {
  587. {
  588. BI opval = LTSI (tmp_pcval, 0);
  589. CPU (h_nbit) = opval;
  590. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  591. }
  592. {
  593. BI opval = ANDIF (EQSI (tmp_pcval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  594. CPU (h_zbit) = opval;
  595. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  596. }
  597. SET_H_CBIT_MOVE (0);
  598. SET_H_VBIT_MOVE (0);
  599. {
  600. {
  601. BI opval = 0;
  602. CPU (h_xbit) = opval;
  603. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  604. }
  605. {
  606. BI opval = 0;
  607. SET_H_INSN_PREFIXED_P (opval);
  608. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  609. }
  610. }
  611. }
  612. }
  613. SEM_BRANCH_FINI (vpc);
  614. #undef FLD
  615. }
  616. NEXT (vpc);
  617. CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
  618. {
  619. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  620. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  621. #define FLD(f) abuf->fields.sfmt_moveq.f
  622. int UNUSED written = 0;
  623. IADDR UNUSED pc = abuf->addr;
  624. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  625. {
  626. SI tmp_newval;
  627. tmp_newval = FLD (f_s6);
  628. {
  629. SI opval = tmp_newval;
  630. SET_H_GR (FLD (f_operand2), opval);
  631. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  632. }
  633. {
  634. SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
  635. SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
  636. SET_H_CBIT_MOVE (0);
  637. SET_H_VBIT_MOVE (0);
  638. {
  639. {
  640. BI opval = 0;
  641. CPU (h_xbit) = opval;
  642. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  643. }
  644. {
  645. BI opval = 0;
  646. SET_H_INSN_PREFIXED_P (opval);
  647. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  648. }
  649. }
  650. }
  651. }
  652. #undef FLD
  653. }
  654. NEXT (vpc);
  655. CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
  656. {
  657. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  658. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  659. #define FLD(f) abuf->fields.sfmt_muls_b.f
  660. int UNUSED written = 0;
  661. IADDR UNUSED pc = abuf->addr;
  662. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  663. {
  664. QI tmp_tmpops;
  665. SI tmp_newval;
  666. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  667. tmp_newval = EXTQISI (tmp_tmpops);
  668. {
  669. SI opval = tmp_newval;
  670. SET_H_GR (FLD (f_operand2), opval);
  671. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  672. }
  673. {
  674. {
  675. BI opval = LTSI (tmp_newval, 0);
  676. CPU (h_nbit) = opval;
  677. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  678. }
  679. {
  680. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  681. CPU (h_zbit) = opval;
  682. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  683. }
  684. SET_H_CBIT_MOVE (0);
  685. SET_H_VBIT_MOVE (0);
  686. {
  687. {
  688. BI opval = 0;
  689. CPU (h_xbit) = opval;
  690. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  691. }
  692. {
  693. BI opval = 0;
  694. SET_H_INSN_PREFIXED_P (opval);
  695. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  696. }
  697. }
  698. }
  699. }
  700. #undef FLD
  701. }
  702. NEXT (vpc);
  703. CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
  704. {
  705. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  706. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  707. #define FLD(f) abuf->fields.sfmt_muls_b.f
  708. int UNUSED written = 0;
  709. IADDR UNUSED pc = abuf->addr;
  710. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  711. {
  712. HI tmp_tmpops;
  713. SI tmp_newval;
  714. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  715. tmp_newval = EXTHISI (tmp_tmpops);
  716. {
  717. SI opval = tmp_newval;
  718. SET_H_GR (FLD (f_operand2), opval);
  719. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  720. }
  721. {
  722. {
  723. BI opval = LTSI (tmp_newval, 0);
  724. CPU (h_nbit) = opval;
  725. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  726. }
  727. {
  728. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  729. CPU (h_zbit) = opval;
  730. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  731. }
  732. SET_H_CBIT_MOVE (0);
  733. SET_H_VBIT_MOVE (0);
  734. {
  735. {
  736. BI opval = 0;
  737. CPU (h_xbit) = opval;
  738. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  739. }
  740. {
  741. BI opval = 0;
  742. SET_H_INSN_PREFIXED_P (opval);
  743. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  744. }
  745. }
  746. }
  747. }
  748. #undef FLD
  749. }
  750. NEXT (vpc);
  751. CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
  752. {
  753. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  754. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  755. #define FLD(f) abuf->fields.sfmt_muls_b.f
  756. int UNUSED written = 0;
  757. IADDR UNUSED pc = abuf->addr;
  758. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  759. {
  760. QI tmp_tmpops;
  761. SI tmp_newval;
  762. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  763. tmp_newval = ZEXTQISI (tmp_tmpops);
  764. {
  765. SI opval = tmp_newval;
  766. SET_H_GR (FLD (f_operand2), opval);
  767. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  768. }
  769. {
  770. {
  771. BI opval = LTSI (tmp_newval, 0);
  772. CPU (h_nbit) = opval;
  773. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  774. }
  775. {
  776. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  777. CPU (h_zbit) = opval;
  778. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  779. }
  780. SET_H_CBIT_MOVE (0);
  781. SET_H_VBIT_MOVE (0);
  782. {
  783. {
  784. BI opval = 0;
  785. CPU (h_xbit) = opval;
  786. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  787. }
  788. {
  789. BI opval = 0;
  790. SET_H_INSN_PREFIXED_P (opval);
  791. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  792. }
  793. }
  794. }
  795. }
  796. #undef FLD
  797. }
  798. NEXT (vpc);
  799. CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
  800. {
  801. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  802. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  803. #define FLD(f) abuf->fields.sfmt_muls_b.f
  804. int UNUSED written = 0;
  805. IADDR UNUSED pc = abuf->addr;
  806. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  807. {
  808. HI tmp_tmpops;
  809. SI tmp_newval;
  810. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  811. tmp_newval = ZEXTHISI (tmp_tmpops);
  812. {
  813. SI opval = tmp_newval;
  814. SET_H_GR (FLD (f_operand2), opval);
  815. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  816. }
  817. {
  818. {
  819. BI opval = LTSI (tmp_newval, 0);
  820. CPU (h_nbit) = opval;
  821. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  822. }
  823. {
  824. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  825. CPU (h_zbit) = opval;
  826. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  827. }
  828. SET_H_CBIT_MOVE (0);
  829. SET_H_VBIT_MOVE (0);
  830. {
  831. {
  832. BI opval = 0;
  833. CPU (h_xbit) = opval;
  834. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  835. }
  836. {
  837. BI opval = 0;
  838. SET_H_INSN_PREFIXED_P (opval);
  839. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  840. }
  841. }
  842. }
  843. }
  844. #undef FLD
  845. }
  846. NEXT (vpc);
  847. CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
  848. {
  849. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  850. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  851. #define FLD(f) abuf->fields.sfmt_addcbr.f
  852. int UNUSED written = 0;
  853. IADDR UNUSED pc = abuf->addr;
  854. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  855. {
  856. QI tmp_newval;
  857. tmp_newval = FLD (f_indir_pc__byte);
  858. {
  859. SI tmp_oldregval;
  860. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  861. {
  862. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  863. SET_H_GR (FLD (f_operand2), opval);
  864. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  865. }
  866. }
  867. {
  868. {
  869. BI opval = LTQI (tmp_newval, 0);
  870. CPU (h_nbit) = opval;
  871. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  872. }
  873. {
  874. BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  875. CPU (h_zbit) = opval;
  876. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  877. }
  878. SET_H_CBIT_MOVE (0);
  879. SET_H_VBIT_MOVE (0);
  880. {
  881. {
  882. BI opval = 0;
  883. CPU (h_xbit) = opval;
  884. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  885. }
  886. {
  887. BI opval = 0;
  888. SET_H_INSN_PREFIXED_P (opval);
  889. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  890. }
  891. }
  892. }
  893. }
  894. #undef FLD
  895. }
  896. NEXT (vpc);
  897. CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
  898. {
  899. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  900. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  901. #define FLD(f) abuf->fields.sfmt_addcwr.f
  902. int UNUSED written = 0;
  903. IADDR UNUSED pc = abuf->addr;
  904. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  905. {
  906. HI tmp_newval;
  907. tmp_newval = FLD (f_indir_pc__word);
  908. {
  909. SI tmp_oldregval;
  910. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  911. {
  912. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  913. SET_H_GR (FLD (f_operand2), opval);
  914. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  915. }
  916. }
  917. {
  918. {
  919. BI opval = LTHI (tmp_newval, 0);
  920. CPU (h_nbit) = opval;
  921. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  922. }
  923. {
  924. BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  925. CPU (h_zbit) = opval;
  926. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  927. }
  928. SET_H_CBIT_MOVE (0);
  929. SET_H_VBIT_MOVE (0);
  930. {
  931. {
  932. BI opval = 0;
  933. CPU (h_xbit) = opval;
  934. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  935. }
  936. {
  937. BI opval = 0;
  938. SET_H_INSN_PREFIXED_P (opval);
  939. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  940. }
  941. }
  942. }
  943. }
  944. #undef FLD
  945. }
  946. NEXT (vpc);
  947. CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
  948. {
  949. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  950. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  951. #define FLD(f) abuf->fields.sfmt_bound_cd.f
  952. int UNUSED written = 0;
  953. IADDR UNUSED pc = abuf->addr;
  954. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  955. {
  956. SI tmp_newval;
  957. tmp_newval = FLD (f_indir_pc__dword);
  958. {
  959. SI opval = tmp_newval;
  960. SET_H_GR (FLD (f_operand2), opval);
  961. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  962. }
  963. {
  964. {
  965. BI opval = LTSI (tmp_newval, 0);
  966. CPU (h_nbit) = opval;
  967. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  968. }
  969. {
  970. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  971. CPU (h_zbit) = opval;
  972. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  973. }
  974. SET_H_CBIT_MOVE (0);
  975. SET_H_VBIT_MOVE (0);
  976. {
  977. {
  978. BI opval = 0;
  979. CPU (h_xbit) = opval;
  980. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  981. }
  982. {
  983. BI opval = 0;
  984. SET_H_INSN_PREFIXED_P (opval);
  985. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  986. }
  987. }
  988. }
  989. }
  990. #undef FLD
  991. }
  992. NEXT (vpc);
  993. CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
  994. {
  995. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  996. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  997. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  998. int UNUSED written = 0;
  999. IADDR UNUSED pc = abuf->addr;
  1000. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1001. {
  1002. SI tmp_newval;
  1003. tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  1004. {
  1005. SI opval = tmp_newval;
  1006. SET_H_GR (FLD (f_operand2), opval);
  1007. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1008. }
  1009. {
  1010. {
  1011. BI opval = LTSI (tmp_newval, 0);
  1012. CPU (h_nbit) = opval;
  1013. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1014. }
  1015. {
  1016. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  1017. CPU (h_zbit) = opval;
  1018. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1019. }
  1020. SET_H_CBIT_MOVE (0);
  1021. SET_H_VBIT_MOVE (0);
  1022. {
  1023. {
  1024. BI opval = 0;
  1025. CPU (h_xbit) = opval;
  1026. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1027. }
  1028. {
  1029. BI opval = 0;
  1030. SET_H_INSN_PREFIXED_P (opval);
  1031. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1032. }
  1033. }
  1034. }
  1035. }
  1036. #undef FLD
  1037. }
  1038. NEXT (vpc);
  1039. CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
  1040. {
  1041. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1042. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1043. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  1044. int UNUSED written = 0;
  1045. IADDR UNUSED pc = abuf->addr;
  1046. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1047. {
  1048. SI tmp_newval;
  1049. tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  1050. {
  1051. SI opval = tmp_newval;
  1052. SET_H_GR (FLD (f_operand2), opval);
  1053. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1054. }
  1055. {
  1056. {
  1057. BI opval = LTSI (tmp_newval, 0);
  1058. CPU (h_nbit) = opval;
  1059. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1060. }
  1061. {
  1062. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  1063. CPU (h_zbit) = opval;
  1064. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1065. }
  1066. SET_H_CBIT_MOVE (0);
  1067. SET_H_VBIT_MOVE (0);
  1068. {
  1069. {
  1070. BI opval = 0;
  1071. CPU (h_xbit) = opval;
  1072. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1073. }
  1074. {
  1075. BI opval = 0;
  1076. SET_H_INSN_PREFIXED_P (opval);
  1077. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1078. }
  1079. }
  1080. }
  1081. }
  1082. #undef FLD
  1083. }
  1084. NEXT (vpc);
  1085. CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
  1086. {
  1087. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1088. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1089. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  1090. int UNUSED written = 0;
  1091. IADDR UNUSED pc = abuf->addr;
  1092. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1093. {
  1094. SI tmp_newval;
  1095. tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  1096. {
  1097. SI opval = tmp_newval;
  1098. SET_H_GR (FLD (f_operand2), opval);
  1099. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1100. }
  1101. {
  1102. {
  1103. BI opval = LTSI (tmp_newval, 0);
  1104. CPU (h_nbit) = opval;
  1105. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1106. }
  1107. {
  1108. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  1109. CPU (h_zbit) = opval;
  1110. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1111. }
  1112. SET_H_CBIT_MOVE (0);
  1113. SET_H_VBIT_MOVE (0);
  1114. {
  1115. {
  1116. BI opval = 0;
  1117. CPU (h_xbit) = opval;
  1118. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1119. }
  1120. {
  1121. BI opval = 0;
  1122. SET_H_INSN_PREFIXED_P (opval);
  1123. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1124. }
  1125. }
  1126. }
  1127. }
  1128. #undef FLD
  1129. }
  1130. NEXT (vpc);
  1131. CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
  1132. {
  1133. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1134. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1135. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  1136. int UNUSED written = 0;
  1137. IADDR UNUSED pc = abuf->addr;
  1138. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1139. {
  1140. SI tmp_newval;
  1141. tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  1142. {
  1143. SI opval = tmp_newval;
  1144. SET_H_GR (FLD (f_operand2), opval);
  1145. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1146. }
  1147. {
  1148. {
  1149. BI opval = LTSI (tmp_newval, 0);
  1150. CPU (h_nbit) = opval;
  1151. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1152. }
  1153. {
  1154. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  1155. CPU (h_zbit) = opval;
  1156. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1157. }
  1158. SET_H_CBIT_MOVE (0);
  1159. SET_H_VBIT_MOVE (0);
  1160. {
  1161. {
  1162. BI opval = 0;
  1163. CPU (h_xbit) = opval;
  1164. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1165. }
  1166. {
  1167. BI opval = 0;
  1168. SET_H_INSN_PREFIXED_P (opval);
  1169. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1170. }
  1171. }
  1172. }
  1173. }
  1174. #undef FLD
  1175. }
  1176. NEXT (vpc);
  1177. CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
  1178. {
  1179. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1180. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1181. #define FLD(f) abuf->fields.sfmt_addq.f
  1182. int UNUSED written = 0;
  1183. IADDR UNUSED pc = abuf->addr;
  1184. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1185. {
  1186. SI tmp_tmpopd;
  1187. SI tmp_tmpops;
  1188. BI tmp_carry;
  1189. SI tmp_newval;
  1190. tmp_tmpops = FLD (f_u6);
  1191. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1192. tmp_carry = CPU (h_cbit);
  1193. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1194. {
  1195. SI opval = tmp_newval;
  1196. SET_H_GR (FLD (f_operand2), opval);
  1197. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1198. }
  1199. {
  1200. {
  1201. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  1202. CPU (h_cbit) = opval;
  1203. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1204. }
  1205. {
  1206. BI opval = LTSI (tmp_newval, 0);
  1207. CPU (h_nbit) = opval;
  1208. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1209. }
  1210. {
  1211. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1212. CPU (h_zbit) = opval;
  1213. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1214. }
  1215. {
  1216. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1217. CPU (h_vbit) = opval;
  1218. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1219. }
  1220. {
  1221. {
  1222. BI opval = 0;
  1223. CPU (h_xbit) = opval;
  1224. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1225. }
  1226. {
  1227. BI opval = 0;
  1228. SET_H_INSN_PREFIXED_P (opval);
  1229. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1230. }
  1231. }
  1232. }
  1233. }
  1234. #undef FLD
  1235. }
  1236. NEXT (vpc);
  1237. CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
  1238. {
  1239. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1240. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1241. #define FLD(f) abuf->fields.sfmt_addq.f
  1242. int UNUSED written = 0;
  1243. IADDR UNUSED pc = abuf->addr;
  1244. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1245. {
  1246. SI tmp_tmpopd;
  1247. SI tmp_tmpops;
  1248. BI tmp_carry;
  1249. SI tmp_newval;
  1250. tmp_tmpops = FLD (f_u6);
  1251. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1252. tmp_carry = CPU (h_cbit);
  1253. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1254. {
  1255. SI opval = tmp_newval;
  1256. SET_H_GR (FLD (f_operand2), opval);
  1257. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1258. }
  1259. {
  1260. {
  1261. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1262. CPU (h_cbit) = opval;
  1263. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1264. }
  1265. {
  1266. BI opval = LTSI (tmp_newval, 0);
  1267. CPU (h_nbit) = opval;
  1268. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1269. }
  1270. {
  1271. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1272. CPU (h_zbit) = opval;
  1273. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1274. }
  1275. {
  1276. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1277. CPU (h_vbit) = opval;
  1278. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1279. }
  1280. {
  1281. {
  1282. BI opval = 0;
  1283. CPU (h_xbit) = opval;
  1284. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1285. }
  1286. {
  1287. BI opval = 0;
  1288. SET_H_INSN_PREFIXED_P (opval);
  1289. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1290. }
  1291. }
  1292. }
  1293. }
  1294. #undef FLD
  1295. }
  1296. NEXT (vpc);
  1297. CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
  1298. {
  1299. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1300. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1301. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  1302. int UNUSED written = 0;
  1303. IADDR UNUSED pc = abuf->addr;
  1304. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1305. {
  1306. QI tmp_tmpopd;
  1307. QI tmp_tmpops;
  1308. BI tmp_carry;
  1309. QI tmp_newval;
  1310. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  1311. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1312. tmp_carry = CPU (h_cbit);
  1313. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1314. ((void) 0); /*nop*/
  1315. {
  1316. {
  1317. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  1318. CPU (h_cbit) = opval;
  1319. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1320. }
  1321. {
  1322. BI opval = LTQI (tmp_newval, 0);
  1323. CPU (h_nbit) = opval;
  1324. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1325. }
  1326. {
  1327. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1328. CPU (h_zbit) = opval;
  1329. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1330. }
  1331. {
  1332. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  1333. CPU (h_vbit) = opval;
  1334. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1335. }
  1336. {
  1337. {
  1338. BI opval = 0;
  1339. CPU (h_xbit) = opval;
  1340. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1341. }
  1342. {
  1343. BI opval = 0;
  1344. SET_H_INSN_PREFIXED_P (opval);
  1345. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1346. }
  1347. }
  1348. }
  1349. }
  1350. #undef FLD
  1351. }
  1352. NEXT (vpc);
  1353. CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
  1354. {
  1355. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1356. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1357. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  1358. int UNUSED written = 0;
  1359. IADDR UNUSED pc = abuf->addr;
  1360. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1361. {
  1362. HI tmp_tmpopd;
  1363. HI tmp_tmpops;
  1364. BI tmp_carry;
  1365. HI tmp_newval;
  1366. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  1367. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1368. tmp_carry = CPU (h_cbit);
  1369. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1370. ((void) 0); /*nop*/
  1371. {
  1372. {
  1373. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  1374. CPU (h_cbit) = opval;
  1375. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1376. }
  1377. {
  1378. BI opval = LTHI (tmp_newval, 0);
  1379. CPU (h_nbit) = opval;
  1380. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1381. }
  1382. {
  1383. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1384. CPU (h_zbit) = opval;
  1385. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1386. }
  1387. {
  1388. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  1389. CPU (h_vbit) = opval;
  1390. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1391. }
  1392. {
  1393. {
  1394. BI opval = 0;
  1395. CPU (h_xbit) = opval;
  1396. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1397. }
  1398. {
  1399. BI opval = 0;
  1400. SET_H_INSN_PREFIXED_P (opval);
  1401. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1402. }
  1403. }
  1404. }
  1405. }
  1406. #undef FLD
  1407. }
  1408. NEXT (vpc);
  1409. CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
  1410. {
  1411. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1412. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1413. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  1414. int UNUSED written = 0;
  1415. IADDR UNUSED pc = abuf->addr;
  1416. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1417. {
  1418. SI tmp_tmpopd;
  1419. SI tmp_tmpops;
  1420. BI tmp_carry;
  1421. SI tmp_newval;
  1422. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  1423. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1424. tmp_carry = CPU (h_cbit);
  1425. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1426. ((void) 0); /*nop*/
  1427. {
  1428. {
  1429. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1430. CPU (h_cbit) = opval;
  1431. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1432. }
  1433. {
  1434. BI opval = LTSI (tmp_newval, 0);
  1435. CPU (h_nbit) = opval;
  1436. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1437. }
  1438. {
  1439. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1440. CPU (h_zbit) = opval;
  1441. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1442. }
  1443. {
  1444. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1445. CPU (h_vbit) = opval;
  1446. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1447. }
  1448. {
  1449. {
  1450. BI opval = 0;
  1451. CPU (h_xbit) = opval;
  1452. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1453. }
  1454. {
  1455. BI opval = 0;
  1456. SET_H_INSN_PREFIXED_P (opval);
  1457. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1458. }
  1459. }
  1460. }
  1461. }
  1462. #undef FLD
  1463. }
  1464. NEXT (vpc);
  1465. CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
  1466. {
  1467. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1468. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1469. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  1470. int UNUSED written = 0;
  1471. IADDR UNUSED pc = abuf->addr;
  1472. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1473. {
  1474. QI tmp_tmpopd;
  1475. QI tmp_tmpops;
  1476. BI tmp_carry;
  1477. QI tmp_newval;
  1478. tmp_tmpops = ({ SI tmp_addr;
  1479. QI tmp_tmp_mem;
  1480. BI tmp_postinc;
  1481. tmp_postinc = FLD (f_memmode);
  1482. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  1483. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  1484. ; if (NEBI (tmp_postinc, 0)) {
  1485. {
  1486. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  1487. tmp_addr = ADDSI (tmp_addr, 1);
  1488. }
  1489. {
  1490. SI opval = tmp_addr;
  1491. SET_H_GR (FLD (f_operand1), opval);
  1492. written |= (1 << 9);
  1493. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1494. }
  1495. }
  1496. }
  1497. ; tmp_tmp_mem; });
  1498. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1499. tmp_carry = CPU (h_cbit);
  1500. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1501. ((void) 0); /*nop*/
  1502. {
  1503. {
  1504. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  1505. CPU (h_cbit) = opval;
  1506. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1507. }
  1508. {
  1509. BI opval = LTQI (tmp_newval, 0);
  1510. CPU (h_nbit) = opval;
  1511. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1512. }
  1513. {
  1514. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1515. CPU (h_zbit) = opval;
  1516. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1517. }
  1518. {
  1519. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  1520. CPU (h_vbit) = opval;
  1521. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1522. }
  1523. {
  1524. {
  1525. BI opval = 0;
  1526. CPU (h_xbit) = opval;
  1527. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1528. }
  1529. {
  1530. BI opval = 0;
  1531. SET_H_INSN_PREFIXED_P (opval);
  1532. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1533. }
  1534. }
  1535. }
  1536. }
  1537. abuf->written = written;
  1538. #undef FLD
  1539. }
  1540. NEXT (vpc);
  1541. CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
  1542. {
  1543. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1544. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1545. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  1546. int UNUSED written = 0;
  1547. IADDR UNUSED pc = abuf->addr;
  1548. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1549. {
  1550. HI tmp_tmpopd;
  1551. HI tmp_tmpops;
  1552. BI tmp_carry;
  1553. HI tmp_newval;
  1554. tmp_tmpops = ({ SI tmp_addr;
  1555. HI tmp_tmp_mem;
  1556. BI tmp_postinc;
  1557. tmp_postinc = FLD (f_memmode);
  1558. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  1559. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  1560. ; if (NEBI (tmp_postinc, 0)) {
  1561. {
  1562. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  1563. tmp_addr = ADDSI (tmp_addr, 2);
  1564. }
  1565. {
  1566. SI opval = tmp_addr;
  1567. SET_H_GR (FLD (f_operand1), opval);
  1568. written |= (1 << 9);
  1569. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1570. }
  1571. }
  1572. }
  1573. ; tmp_tmp_mem; });
  1574. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1575. tmp_carry = CPU (h_cbit);
  1576. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1577. ((void) 0); /*nop*/
  1578. {
  1579. {
  1580. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  1581. CPU (h_cbit) = opval;
  1582. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1583. }
  1584. {
  1585. BI opval = LTHI (tmp_newval, 0);
  1586. CPU (h_nbit) = opval;
  1587. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1588. }
  1589. {
  1590. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1591. CPU (h_zbit) = opval;
  1592. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1593. }
  1594. {
  1595. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  1596. CPU (h_vbit) = opval;
  1597. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1598. }
  1599. {
  1600. {
  1601. BI opval = 0;
  1602. CPU (h_xbit) = opval;
  1603. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1604. }
  1605. {
  1606. BI opval = 0;
  1607. SET_H_INSN_PREFIXED_P (opval);
  1608. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1609. }
  1610. }
  1611. }
  1612. }
  1613. abuf->written = written;
  1614. #undef FLD
  1615. }
  1616. NEXT (vpc);
  1617. CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
  1618. {
  1619. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1620. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1621. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  1622. int UNUSED written = 0;
  1623. IADDR UNUSED pc = abuf->addr;
  1624. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1625. {
  1626. SI tmp_tmpopd;
  1627. SI tmp_tmpops;
  1628. BI tmp_carry;
  1629. SI tmp_newval;
  1630. tmp_tmpops = ({ SI tmp_addr;
  1631. SI tmp_tmp_mem;
  1632. BI tmp_postinc;
  1633. tmp_postinc = FLD (f_memmode);
  1634. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  1635. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  1636. ; if (NEBI (tmp_postinc, 0)) {
  1637. {
  1638. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  1639. tmp_addr = ADDSI (tmp_addr, 4);
  1640. }
  1641. {
  1642. SI opval = tmp_addr;
  1643. SET_H_GR (FLD (f_operand1), opval);
  1644. written |= (1 << 9);
  1645. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1646. }
  1647. }
  1648. }
  1649. ; tmp_tmp_mem; });
  1650. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1651. tmp_carry = CPU (h_cbit);
  1652. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1653. ((void) 0); /*nop*/
  1654. {
  1655. {
  1656. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1657. CPU (h_cbit) = opval;
  1658. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1659. }
  1660. {
  1661. BI opval = LTSI (tmp_newval, 0);
  1662. CPU (h_nbit) = opval;
  1663. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1664. }
  1665. {
  1666. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1667. CPU (h_zbit) = opval;
  1668. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1669. }
  1670. {
  1671. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1672. CPU (h_vbit) = opval;
  1673. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1674. }
  1675. {
  1676. {
  1677. BI opval = 0;
  1678. CPU (h_xbit) = opval;
  1679. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1680. }
  1681. {
  1682. BI opval = 0;
  1683. SET_H_INSN_PREFIXED_P (opval);
  1684. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1685. }
  1686. }
  1687. }
  1688. }
  1689. abuf->written = written;
  1690. #undef FLD
  1691. }
  1692. NEXT (vpc);
  1693. CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
  1694. {
  1695. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1696. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1697. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  1698. int UNUSED written = 0;
  1699. IADDR UNUSED pc = abuf->addr;
  1700. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1701. {
  1702. QI tmp_tmpopd;
  1703. QI tmp_tmpops;
  1704. BI tmp_carry;
  1705. QI tmp_newval;
  1706. tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
  1707. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1708. tmp_carry = CPU (h_cbit);
  1709. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1710. ((void) 0); /*nop*/
  1711. {
  1712. {
  1713. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  1714. CPU (h_cbit) = opval;
  1715. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1716. }
  1717. {
  1718. BI opval = LTQI (tmp_newval, 0);
  1719. CPU (h_nbit) = opval;
  1720. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1721. }
  1722. {
  1723. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1724. CPU (h_zbit) = opval;
  1725. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1726. }
  1727. {
  1728. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  1729. CPU (h_vbit) = opval;
  1730. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1731. }
  1732. {
  1733. {
  1734. BI opval = 0;
  1735. CPU (h_xbit) = opval;
  1736. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1737. }
  1738. {
  1739. BI opval = 0;
  1740. SET_H_INSN_PREFIXED_P (opval);
  1741. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1742. }
  1743. }
  1744. }
  1745. }
  1746. #undef FLD
  1747. }
  1748. NEXT (vpc);
  1749. CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
  1750. {
  1751. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1752. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1753. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  1754. int UNUSED written = 0;
  1755. IADDR UNUSED pc = abuf->addr;
  1756. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  1757. {
  1758. HI tmp_tmpopd;
  1759. HI tmp_tmpops;
  1760. BI tmp_carry;
  1761. HI tmp_newval;
  1762. tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
  1763. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1764. tmp_carry = CPU (h_cbit);
  1765. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1766. ((void) 0); /*nop*/
  1767. {
  1768. {
  1769. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  1770. CPU (h_cbit) = opval;
  1771. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1772. }
  1773. {
  1774. BI opval = LTHI (tmp_newval, 0);
  1775. CPU (h_nbit) = opval;
  1776. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1777. }
  1778. {
  1779. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1780. CPU (h_zbit) = opval;
  1781. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1782. }
  1783. {
  1784. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  1785. CPU (h_vbit) = opval;
  1786. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1787. }
  1788. {
  1789. {
  1790. BI opval = 0;
  1791. CPU (h_xbit) = opval;
  1792. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1793. }
  1794. {
  1795. BI opval = 0;
  1796. SET_H_INSN_PREFIXED_P (opval);
  1797. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1798. }
  1799. }
  1800. }
  1801. }
  1802. #undef FLD
  1803. }
  1804. NEXT (vpc);
  1805. CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
  1806. {
  1807. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1808. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1809. #define FLD(f) abuf->fields.sfmt_bound_cd.f
  1810. int UNUSED written = 0;
  1811. IADDR UNUSED pc = abuf->addr;
  1812. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  1813. {
  1814. SI tmp_tmpopd;
  1815. SI tmp_tmpops;
  1816. BI tmp_carry;
  1817. SI tmp_newval;
  1818. tmp_tmpops = FLD (f_indir_pc__dword);
  1819. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1820. tmp_carry = CPU (h_cbit);
  1821. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1822. ((void) 0); /*nop*/
  1823. {
  1824. {
  1825. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1826. CPU (h_cbit) = opval;
  1827. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1828. }
  1829. {
  1830. BI opval = LTSI (tmp_newval, 0);
  1831. CPU (h_nbit) = opval;
  1832. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1833. }
  1834. {
  1835. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1836. CPU (h_zbit) = opval;
  1837. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1838. }
  1839. {
  1840. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1841. CPU (h_vbit) = opval;
  1842. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1843. }
  1844. {
  1845. {
  1846. BI opval = 0;
  1847. CPU (h_xbit) = opval;
  1848. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1849. }
  1850. {
  1851. BI opval = 0;
  1852. SET_H_INSN_PREFIXED_P (opval);
  1853. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1854. }
  1855. }
  1856. }
  1857. }
  1858. #undef FLD
  1859. }
  1860. NEXT (vpc);
  1861. CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
  1862. {
  1863. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1864. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1865. #define FLD(f) abuf->fields.sfmt_andq.f
  1866. int UNUSED written = 0;
  1867. IADDR UNUSED pc = abuf->addr;
  1868. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1869. {
  1870. SI tmp_tmpopd;
  1871. SI tmp_tmpops;
  1872. BI tmp_carry;
  1873. SI tmp_newval;
  1874. tmp_tmpops = FLD (f_s6);
  1875. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1876. tmp_carry = CPU (h_cbit);
  1877. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1878. ((void) 0); /*nop*/
  1879. {
  1880. {
  1881. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1882. CPU (h_cbit) = opval;
  1883. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1884. }
  1885. {
  1886. BI opval = LTSI (tmp_newval, 0);
  1887. CPU (h_nbit) = opval;
  1888. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1889. }
  1890. {
  1891. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1892. CPU (h_zbit) = opval;
  1893. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1894. }
  1895. {
  1896. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1897. CPU (h_vbit) = opval;
  1898. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1899. }
  1900. {
  1901. {
  1902. BI opval = 0;
  1903. CPU (h_xbit) = opval;
  1904. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1905. }
  1906. {
  1907. BI opval = 0;
  1908. SET_H_INSN_PREFIXED_P (opval);
  1909. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1910. }
  1911. }
  1912. }
  1913. }
  1914. #undef FLD
  1915. }
  1916. NEXT (vpc);
  1917. CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
  1918. {
  1919. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1920. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1921. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  1922. int UNUSED written = 0;
  1923. IADDR UNUSED pc = abuf->addr;
  1924. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  1925. {
  1926. SI tmp_tmpopd;
  1927. SI tmp_tmpops;
  1928. BI tmp_carry;
  1929. SI tmp_newval;
  1930. tmp_tmpops = EXTQISI (({ SI tmp_addr;
  1931. QI tmp_tmp_mem;
  1932. BI tmp_postinc;
  1933. tmp_postinc = FLD (f_memmode);
  1934. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  1935. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  1936. ; if (NEBI (tmp_postinc, 0)) {
  1937. {
  1938. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  1939. tmp_addr = ADDSI (tmp_addr, 1);
  1940. }
  1941. {
  1942. SI opval = tmp_addr;
  1943. SET_H_GR (FLD (f_operand1), opval);
  1944. written |= (1 << 9);
  1945. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  1946. }
  1947. }
  1948. }
  1949. ; tmp_tmp_mem; }));
  1950. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  1951. tmp_carry = CPU (h_cbit);
  1952. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  1953. ((void) 0); /*nop*/
  1954. {
  1955. {
  1956. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  1957. CPU (h_cbit) = opval;
  1958. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  1959. }
  1960. {
  1961. BI opval = LTSI (tmp_newval, 0);
  1962. CPU (h_nbit) = opval;
  1963. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  1964. }
  1965. {
  1966. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  1967. CPU (h_zbit) = opval;
  1968. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  1969. }
  1970. {
  1971. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  1972. CPU (h_vbit) = opval;
  1973. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  1974. }
  1975. {
  1976. {
  1977. BI opval = 0;
  1978. CPU (h_xbit) = opval;
  1979. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  1980. }
  1981. {
  1982. BI opval = 0;
  1983. SET_H_INSN_PREFIXED_P (opval);
  1984. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  1985. }
  1986. }
  1987. }
  1988. }
  1989. abuf->written = written;
  1990. #undef FLD
  1991. }
  1992. NEXT (vpc);
  1993. CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
  1994. {
  1995. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  1996. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  1997. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  1998. int UNUSED written = 0;
  1999. IADDR UNUSED pc = abuf->addr;
  2000. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2001. {
  2002. SI tmp_tmpopd;
  2003. SI tmp_tmpops;
  2004. BI tmp_carry;
  2005. SI tmp_newval;
  2006. tmp_tmpops = EXTHISI (({ SI tmp_addr;
  2007. HI tmp_tmp_mem;
  2008. BI tmp_postinc;
  2009. tmp_postinc = FLD (f_memmode);
  2010. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2011. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  2012. ; if (NEBI (tmp_postinc, 0)) {
  2013. {
  2014. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2015. tmp_addr = ADDSI (tmp_addr, 2);
  2016. }
  2017. {
  2018. SI opval = tmp_addr;
  2019. SET_H_GR (FLD (f_operand1), opval);
  2020. written |= (1 << 9);
  2021. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2022. }
  2023. }
  2024. }
  2025. ; tmp_tmp_mem; }));
  2026. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2027. tmp_carry = CPU (h_cbit);
  2028. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2029. ((void) 0); /*nop*/
  2030. {
  2031. {
  2032. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2033. CPU (h_cbit) = opval;
  2034. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2035. }
  2036. {
  2037. BI opval = LTSI (tmp_newval, 0);
  2038. CPU (h_nbit) = opval;
  2039. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2040. }
  2041. {
  2042. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2043. CPU (h_zbit) = opval;
  2044. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2045. }
  2046. {
  2047. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2048. CPU (h_vbit) = opval;
  2049. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2050. }
  2051. {
  2052. {
  2053. BI opval = 0;
  2054. CPU (h_xbit) = opval;
  2055. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2056. }
  2057. {
  2058. BI opval = 0;
  2059. SET_H_INSN_PREFIXED_P (opval);
  2060. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2061. }
  2062. }
  2063. }
  2064. }
  2065. abuf->written = written;
  2066. #undef FLD
  2067. }
  2068. NEXT (vpc);
  2069. CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
  2070. {
  2071. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2072. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2073. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  2074. int UNUSED written = 0;
  2075. IADDR UNUSED pc = abuf->addr;
  2076. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  2077. {
  2078. SI tmp_tmpopd;
  2079. SI tmp_tmpops;
  2080. BI tmp_carry;
  2081. SI tmp_newval;
  2082. tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  2083. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2084. tmp_carry = CPU (h_cbit);
  2085. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2086. ((void) 0); /*nop*/
  2087. {
  2088. {
  2089. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2090. CPU (h_cbit) = opval;
  2091. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2092. }
  2093. {
  2094. BI opval = LTSI (tmp_newval, 0);
  2095. CPU (h_nbit) = opval;
  2096. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2097. }
  2098. {
  2099. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2100. CPU (h_zbit) = opval;
  2101. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2102. }
  2103. {
  2104. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2105. CPU (h_vbit) = opval;
  2106. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2107. }
  2108. {
  2109. {
  2110. BI opval = 0;
  2111. CPU (h_xbit) = opval;
  2112. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2113. }
  2114. {
  2115. BI opval = 0;
  2116. SET_H_INSN_PREFIXED_P (opval);
  2117. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2118. }
  2119. }
  2120. }
  2121. }
  2122. #undef FLD
  2123. }
  2124. NEXT (vpc);
  2125. CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
  2126. {
  2127. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2128. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2129. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  2130. int UNUSED written = 0;
  2131. IADDR UNUSED pc = abuf->addr;
  2132. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  2133. {
  2134. SI tmp_tmpopd;
  2135. SI tmp_tmpops;
  2136. BI tmp_carry;
  2137. SI tmp_newval;
  2138. tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  2139. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2140. tmp_carry = CPU (h_cbit);
  2141. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2142. ((void) 0); /*nop*/
  2143. {
  2144. {
  2145. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2146. CPU (h_cbit) = opval;
  2147. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2148. }
  2149. {
  2150. BI opval = LTSI (tmp_newval, 0);
  2151. CPU (h_nbit) = opval;
  2152. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2153. }
  2154. {
  2155. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2156. CPU (h_zbit) = opval;
  2157. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2158. }
  2159. {
  2160. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2161. CPU (h_vbit) = opval;
  2162. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2163. }
  2164. {
  2165. {
  2166. BI opval = 0;
  2167. CPU (h_xbit) = opval;
  2168. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2169. }
  2170. {
  2171. BI opval = 0;
  2172. SET_H_INSN_PREFIXED_P (opval);
  2173. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2174. }
  2175. }
  2176. }
  2177. }
  2178. #undef FLD
  2179. }
  2180. NEXT (vpc);
  2181. CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
  2182. {
  2183. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2184. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2185. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2186. int UNUSED written = 0;
  2187. IADDR UNUSED pc = abuf->addr;
  2188. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2189. {
  2190. SI tmp_tmpopd;
  2191. SI tmp_tmpops;
  2192. BI tmp_carry;
  2193. SI tmp_newval;
  2194. tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
  2195. QI tmp_tmp_mem;
  2196. BI tmp_postinc;
  2197. tmp_postinc = FLD (f_memmode);
  2198. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2199. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  2200. ; if (NEBI (tmp_postinc, 0)) {
  2201. {
  2202. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2203. tmp_addr = ADDSI (tmp_addr, 1);
  2204. }
  2205. {
  2206. SI opval = tmp_addr;
  2207. SET_H_GR (FLD (f_operand1), opval);
  2208. written |= (1 << 9);
  2209. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2210. }
  2211. }
  2212. }
  2213. ; tmp_tmp_mem; }));
  2214. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2215. tmp_carry = CPU (h_cbit);
  2216. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2217. ((void) 0); /*nop*/
  2218. {
  2219. {
  2220. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2221. CPU (h_cbit) = opval;
  2222. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2223. }
  2224. {
  2225. BI opval = LTSI (tmp_newval, 0);
  2226. CPU (h_nbit) = opval;
  2227. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2228. }
  2229. {
  2230. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2231. CPU (h_zbit) = opval;
  2232. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2233. }
  2234. {
  2235. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2236. CPU (h_vbit) = opval;
  2237. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2238. }
  2239. {
  2240. {
  2241. BI opval = 0;
  2242. CPU (h_xbit) = opval;
  2243. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2244. }
  2245. {
  2246. BI opval = 0;
  2247. SET_H_INSN_PREFIXED_P (opval);
  2248. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2249. }
  2250. }
  2251. }
  2252. }
  2253. abuf->written = written;
  2254. #undef FLD
  2255. }
  2256. NEXT (vpc);
  2257. CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
  2258. {
  2259. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2260. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2261. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2262. int UNUSED written = 0;
  2263. IADDR UNUSED pc = abuf->addr;
  2264. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2265. {
  2266. SI tmp_tmpopd;
  2267. SI tmp_tmpops;
  2268. BI tmp_carry;
  2269. SI tmp_newval;
  2270. tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
  2271. HI tmp_tmp_mem;
  2272. BI tmp_postinc;
  2273. tmp_postinc = FLD (f_memmode);
  2274. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2275. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  2276. ; if (NEBI (tmp_postinc, 0)) {
  2277. {
  2278. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2279. tmp_addr = ADDSI (tmp_addr, 2);
  2280. }
  2281. {
  2282. SI opval = tmp_addr;
  2283. SET_H_GR (FLD (f_operand1), opval);
  2284. written |= (1 << 9);
  2285. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2286. }
  2287. }
  2288. }
  2289. ; tmp_tmp_mem; }));
  2290. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2291. tmp_carry = CPU (h_cbit);
  2292. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2293. ((void) 0); /*nop*/
  2294. {
  2295. {
  2296. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2297. CPU (h_cbit) = opval;
  2298. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2299. }
  2300. {
  2301. BI opval = LTSI (tmp_newval, 0);
  2302. CPU (h_nbit) = opval;
  2303. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2304. }
  2305. {
  2306. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2307. CPU (h_zbit) = opval;
  2308. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2309. }
  2310. {
  2311. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2312. CPU (h_vbit) = opval;
  2313. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2314. }
  2315. {
  2316. {
  2317. BI opval = 0;
  2318. CPU (h_xbit) = opval;
  2319. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2320. }
  2321. {
  2322. BI opval = 0;
  2323. SET_H_INSN_PREFIXED_P (opval);
  2324. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2325. }
  2326. }
  2327. }
  2328. }
  2329. abuf->written = written;
  2330. #undef FLD
  2331. }
  2332. NEXT (vpc);
  2333. CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
  2334. {
  2335. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2336. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2337. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  2338. int UNUSED written = 0;
  2339. IADDR UNUSED pc = abuf->addr;
  2340. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  2341. {
  2342. SI tmp_tmpopd;
  2343. SI tmp_tmpops;
  2344. BI tmp_carry;
  2345. SI tmp_newval;
  2346. tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  2347. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2348. tmp_carry = CPU (h_cbit);
  2349. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2350. ((void) 0); /*nop*/
  2351. {
  2352. {
  2353. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2354. CPU (h_cbit) = opval;
  2355. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2356. }
  2357. {
  2358. BI opval = LTSI (tmp_newval, 0);
  2359. CPU (h_nbit) = opval;
  2360. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2361. }
  2362. {
  2363. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2364. CPU (h_zbit) = opval;
  2365. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2366. }
  2367. {
  2368. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2369. CPU (h_vbit) = opval;
  2370. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2371. }
  2372. {
  2373. {
  2374. BI opval = 0;
  2375. CPU (h_xbit) = opval;
  2376. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2377. }
  2378. {
  2379. BI opval = 0;
  2380. SET_H_INSN_PREFIXED_P (opval);
  2381. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2382. }
  2383. }
  2384. }
  2385. }
  2386. #undef FLD
  2387. }
  2388. NEXT (vpc);
  2389. CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
  2390. {
  2391. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2392. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2393. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  2394. int UNUSED written = 0;
  2395. IADDR UNUSED pc = abuf->addr;
  2396. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  2397. {
  2398. SI tmp_tmpopd;
  2399. SI tmp_tmpops;
  2400. BI tmp_carry;
  2401. SI tmp_newval;
  2402. tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  2403. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  2404. tmp_carry = CPU (h_cbit);
  2405. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  2406. ((void) 0); /*nop*/
  2407. {
  2408. {
  2409. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  2410. CPU (h_cbit) = opval;
  2411. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  2412. }
  2413. {
  2414. BI opval = LTSI (tmp_newval, 0);
  2415. CPU (h_nbit) = opval;
  2416. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2417. }
  2418. {
  2419. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  2420. CPU (h_zbit) = opval;
  2421. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2422. }
  2423. {
  2424. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  2425. CPU (h_vbit) = opval;
  2426. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  2427. }
  2428. {
  2429. {
  2430. BI opval = 0;
  2431. CPU (h_xbit) = opval;
  2432. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2433. }
  2434. {
  2435. BI opval = 0;
  2436. SET_H_INSN_PREFIXED_P (opval);
  2437. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2438. }
  2439. }
  2440. }
  2441. }
  2442. #undef FLD
  2443. }
  2444. NEXT (vpc);
  2445. CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
  2446. {
  2447. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2448. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2449. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  2450. int UNUSED written = 0;
  2451. IADDR UNUSED pc = abuf->addr;
  2452. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2453. {
  2454. SI tmp_tmp;
  2455. tmp_tmp = ({ SI tmp_addr;
  2456. QI tmp_tmp_mem;
  2457. BI tmp_postinc;
  2458. tmp_postinc = FLD (f_memmode);
  2459. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2460. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  2461. ; if (NEBI (tmp_postinc, 0)) {
  2462. {
  2463. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2464. tmp_addr = ADDSI (tmp_addr, 1);
  2465. }
  2466. {
  2467. SI opval = tmp_addr;
  2468. SET_H_GR (FLD (f_operand1), opval);
  2469. written |= (1 << 10);
  2470. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2471. }
  2472. }
  2473. }
  2474. ; tmp_tmp_mem; });
  2475. {
  2476. SI tmp_oldregval;
  2477. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  2478. {
  2479. SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
  2480. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  2481. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2482. }
  2483. }
  2484. {
  2485. {
  2486. BI opval = LTQI (tmp_tmp, 0);
  2487. CPU (h_nbit) = opval;
  2488. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2489. }
  2490. {
  2491. BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2492. CPU (h_zbit) = opval;
  2493. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2494. }
  2495. SET_H_CBIT_MOVE (0);
  2496. SET_H_VBIT_MOVE (0);
  2497. {
  2498. {
  2499. BI opval = 0;
  2500. CPU (h_xbit) = opval;
  2501. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2502. }
  2503. {
  2504. BI opval = 0;
  2505. SET_H_INSN_PREFIXED_P (opval);
  2506. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2507. }
  2508. }
  2509. }
  2510. }
  2511. abuf->written = written;
  2512. #undef FLD
  2513. }
  2514. NEXT (vpc);
  2515. CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
  2516. {
  2517. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2518. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2519. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  2520. int UNUSED written = 0;
  2521. IADDR UNUSED pc = abuf->addr;
  2522. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2523. {
  2524. SI tmp_tmp;
  2525. tmp_tmp = ({ SI tmp_addr;
  2526. HI tmp_tmp_mem;
  2527. BI tmp_postinc;
  2528. tmp_postinc = FLD (f_memmode);
  2529. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2530. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  2531. ; if (NEBI (tmp_postinc, 0)) {
  2532. {
  2533. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2534. tmp_addr = ADDSI (tmp_addr, 2);
  2535. }
  2536. {
  2537. SI opval = tmp_addr;
  2538. SET_H_GR (FLD (f_operand1), opval);
  2539. written |= (1 << 10);
  2540. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2541. }
  2542. }
  2543. }
  2544. ; tmp_tmp_mem; });
  2545. {
  2546. SI tmp_oldregval;
  2547. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  2548. {
  2549. SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  2550. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  2551. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2552. }
  2553. }
  2554. {
  2555. {
  2556. BI opval = LTHI (tmp_tmp, 0);
  2557. CPU (h_nbit) = opval;
  2558. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2559. }
  2560. {
  2561. BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2562. CPU (h_zbit) = opval;
  2563. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2564. }
  2565. SET_H_CBIT_MOVE (0);
  2566. SET_H_VBIT_MOVE (0);
  2567. {
  2568. {
  2569. BI opval = 0;
  2570. CPU (h_xbit) = opval;
  2571. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2572. }
  2573. {
  2574. BI opval = 0;
  2575. SET_H_INSN_PREFIXED_P (opval);
  2576. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2577. }
  2578. }
  2579. }
  2580. }
  2581. abuf->written = written;
  2582. #undef FLD
  2583. }
  2584. NEXT (vpc);
  2585. CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
  2586. {
  2587. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2588. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2589. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  2590. int UNUSED written = 0;
  2591. IADDR UNUSED pc = abuf->addr;
  2592. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2593. {
  2594. SI tmp_tmp;
  2595. tmp_tmp = ({ SI tmp_addr;
  2596. SI tmp_tmp_mem;
  2597. BI tmp_postinc;
  2598. tmp_postinc = FLD (f_memmode);
  2599. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2600. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  2601. ; if (NEBI (tmp_postinc, 0)) {
  2602. {
  2603. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2604. tmp_addr = ADDSI (tmp_addr, 4);
  2605. }
  2606. {
  2607. SI opval = tmp_addr;
  2608. SET_H_GR (FLD (f_operand1), opval);
  2609. written |= (1 << 9);
  2610. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2611. }
  2612. }
  2613. }
  2614. ; tmp_tmp_mem; });
  2615. {
  2616. SI opval = tmp_tmp;
  2617. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  2618. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2619. }
  2620. {
  2621. {
  2622. BI opval = LTSI (tmp_tmp, 0);
  2623. CPU (h_nbit) = opval;
  2624. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2625. }
  2626. {
  2627. BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2628. CPU (h_zbit) = opval;
  2629. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2630. }
  2631. SET_H_CBIT_MOVE (0);
  2632. SET_H_VBIT_MOVE (0);
  2633. {
  2634. {
  2635. BI opval = 0;
  2636. CPU (h_xbit) = opval;
  2637. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2638. }
  2639. {
  2640. BI opval = 0;
  2641. SET_H_INSN_PREFIXED_P (opval);
  2642. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2643. }
  2644. }
  2645. }
  2646. }
  2647. abuf->written = written;
  2648. #undef FLD
  2649. }
  2650. NEXT (vpc);
  2651. CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
  2652. {
  2653. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2654. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2655. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2656. int UNUSED written = 0;
  2657. IADDR UNUSED pc = abuf->addr;
  2658. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2659. {
  2660. SI tmp_tmp;
  2661. tmp_tmp = EXTQISI (({ SI tmp_addr;
  2662. QI tmp_tmp_mem;
  2663. BI tmp_postinc;
  2664. tmp_postinc = FLD (f_memmode);
  2665. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2666. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  2667. ; if (NEBI (tmp_postinc, 0)) {
  2668. {
  2669. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2670. tmp_addr = ADDSI (tmp_addr, 1);
  2671. }
  2672. {
  2673. SI opval = tmp_addr;
  2674. SET_H_GR (FLD (f_operand1), opval);
  2675. written |= (1 << 8);
  2676. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2677. }
  2678. }
  2679. }
  2680. ; tmp_tmp_mem; }));
  2681. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  2682. {
  2683. SI opval = tmp_tmp;
  2684. SET_H_GR (FLD (f_operand1), opval);
  2685. written |= (1 << 8);
  2686. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2687. }
  2688. } else {
  2689. {
  2690. SI opval = tmp_tmp;
  2691. SET_H_GR (FLD (f_operand2), opval);
  2692. written |= (1 << 7);
  2693. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2694. }
  2695. }
  2696. {
  2697. {
  2698. BI opval = LTSI (tmp_tmp, 0);
  2699. CPU (h_nbit) = opval;
  2700. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2701. }
  2702. {
  2703. BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2704. CPU (h_zbit) = opval;
  2705. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2706. }
  2707. SET_H_CBIT_MOVE (0);
  2708. SET_H_VBIT_MOVE (0);
  2709. {
  2710. {
  2711. BI opval = 0;
  2712. CPU (h_xbit) = opval;
  2713. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2714. }
  2715. {
  2716. BI opval = 0;
  2717. SET_H_INSN_PREFIXED_P (opval);
  2718. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2719. }
  2720. }
  2721. }
  2722. }
  2723. abuf->written = written;
  2724. #undef FLD
  2725. }
  2726. NEXT (vpc);
  2727. CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
  2728. {
  2729. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2730. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2731. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2732. int UNUSED written = 0;
  2733. IADDR UNUSED pc = abuf->addr;
  2734. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2735. {
  2736. SI tmp_tmp;
  2737. tmp_tmp = EXTHISI (({ SI tmp_addr;
  2738. HI tmp_tmp_mem;
  2739. BI tmp_postinc;
  2740. tmp_postinc = FLD (f_memmode);
  2741. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2742. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  2743. ; if (NEBI (tmp_postinc, 0)) {
  2744. {
  2745. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2746. tmp_addr = ADDSI (tmp_addr, 2);
  2747. }
  2748. {
  2749. SI opval = tmp_addr;
  2750. SET_H_GR (FLD (f_operand1), opval);
  2751. written |= (1 << 8);
  2752. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2753. }
  2754. }
  2755. }
  2756. ; tmp_tmp_mem; }));
  2757. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  2758. {
  2759. SI opval = tmp_tmp;
  2760. SET_H_GR (FLD (f_operand1), opval);
  2761. written |= (1 << 8);
  2762. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2763. }
  2764. } else {
  2765. {
  2766. SI opval = tmp_tmp;
  2767. SET_H_GR (FLD (f_operand2), opval);
  2768. written |= (1 << 7);
  2769. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2770. }
  2771. }
  2772. {
  2773. {
  2774. BI opval = LTSI (tmp_tmp, 0);
  2775. CPU (h_nbit) = opval;
  2776. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2777. }
  2778. {
  2779. BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2780. CPU (h_zbit) = opval;
  2781. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2782. }
  2783. SET_H_CBIT_MOVE (0);
  2784. SET_H_VBIT_MOVE (0);
  2785. {
  2786. {
  2787. BI opval = 0;
  2788. CPU (h_xbit) = opval;
  2789. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2790. }
  2791. {
  2792. BI opval = 0;
  2793. SET_H_INSN_PREFIXED_P (opval);
  2794. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2795. }
  2796. }
  2797. }
  2798. }
  2799. abuf->written = written;
  2800. #undef FLD
  2801. }
  2802. NEXT (vpc);
  2803. CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
  2804. {
  2805. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2806. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2807. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2808. int UNUSED written = 0;
  2809. IADDR UNUSED pc = abuf->addr;
  2810. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2811. {
  2812. SI tmp_tmp;
  2813. tmp_tmp = ZEXTQISI (({ SI tmp_addr;
  2814. QI tmp_tmp_mem;
  2815. BI tmp_postinc;
  2816. tmp_postinc = FLD (f_memmode);
  2817. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2818. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  2819. ; if (NEBI (tmp_postinc, 0)) {
  2820. {
  2821. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2822. tmp_addr = ADDSI (tmp_addr, 1);
  2823. }
  2824. {
  2825. SI opval = tmp_addr;
  2826. SET_H_GR (FLD (f_operand1), opval);
  2827. written |= (1 << 8);
  2828. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2829. }
  2830. }
  2831. }
  2832. ; tmp_tmp_mem; }));
  2833. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  2834. {
  2835. SI opval = tmp_tmp;
  2836. SET_H_GR (FLD (f_operand1), opval);
  2837. written |= (1 << 8);
  2838. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2839. }
  2840. } else {
  2841. {
  2842. SI opval = tmp_tmp;
  2843. SET_H_GR (FLD (f_operand2), opval);
  2844. written |= (1 << 7);
  2845. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2846. }
  2847. }
  2848. {
  2849. {
  2850. BI opval = LTSI (tmp_tmp, 0);
  2851. CPU (h_nbit) = opval;
  2852. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2853. }
  2854. {
  2855. BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2856. CPU (h_zbit) = opval;
  2857. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2858. }
  2859. SET_H_CBIT_MOVE (0);
  2860. SET_H_VBIT_MOVE (0);
  2861. {
  2862. {
  2863. BI opval = 0;
  2864. CPU (h_xbit) = opval;
  2865. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2866. }
  2867. {
  2868. BI opval = 0;
  2869. SET_H_INSN_PREFIXED_P (opval);
  2870. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2871. }
  2872. }
  2873. }
  2874. }
  2875. abuf->written = written;
  2876. #undef FLD
  2877. }
  2878. NEXT (vpc);
  2879. CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
  2880. {
  2881. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2882. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2883. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  2884. int UNUSED written = 0;
  2885. IADDR UNUSED pc = abuf->addr;
  2886. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2887. {
  2888. SI tmp_tmp;
  2889. tmp_tmp = ZEXTHISI (({ SI tmp_addr;
  2890. HI tmp_tmp_mem;
  2891. BI tmp_postinc;
  2892. tmp_postinc = FLD (f_memmode);
  2893. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  2894. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  2895. ; if (NEBI (tmp_postinc, 0)) {
  2896. {
  2897. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  2898. tmp_addr = ADDSI (tmp_addr, 2);
  2899. }
  2900. {
  2901. SI opval = tmp_addr;
  2902. SET_H_GR (FLD (f_operand1), opval);
  2903. written |= (1 << 8);
  2904. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2905. }
  2906. }
  2907. }
  2908. ; tmp_tmp_mem; }));
  2909. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  2910. {
  2911. SI opval = tmp_tmp;
  2912. SET_H_GR (FLD (f_operand1), opval);
  2913. written |= (1 << 8);
  2914. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2915. }
  2916. } else {
  2917. {
  2918. SI opval = tmp_tmp;
  2919. SET_H_GR (FLD (f_operand2), opval);
  2920. written |= (1 << 7);
  2921. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  2922. }
  2923. }
  2924. {
  2925. {
  2926. BI opval = LTSI (tmp_tmp, 0);
  2927. CPU (h_nbit) = opval;
  2928. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  2929. }
  2930. {
  2931. BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  2932. CPU (h_zbit) = opval;
  2933. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  2934. }
  2935. SET_H_CBIT_MOVE (0);
  2936. SET_H_VBIT_MOVE (0);
  2937. {
  2938. {
  2939. BI opval = 0;
  2940. CPU (h_xbit) = opval;
  2941. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2942. }
  2943. {
  2944. BI opval = 0;
  2945. SET_H_INSN_PREFIXED_P (opval);
  2946. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2947. }
  2948. }
  2949. }
  2950. }
  2951. abuf->written = written;
  2952. #undef FLD
  2953. }
  2954. NEXT (vpc);
  2955. CASE (sem, INSN_MOVE_R_SPRV10) : /* move ${Rs},${Pd} */
  2956. {
  2957. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2958. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  2959. #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
  2960. int UNUSED written = 0;
  2961. IADDR UNUSED pc = abuf->addr;
  2962. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  2963. {
  2964. SI tmp_tmp;
  2965. SI tmp_rno;
  2966. tmp_tmp = GET_H_GR (FLD (f_operand1));
  2967. tmp_rno = FLD (f_operand2);
  2968. if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
  2969. cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
  2970. }
  2971. else {
  2972. {
  2973. SI opval = tmp_tmp;
  2974. SET_H_SR (FLD (f_operand2), opval);
  2975. written |= (1 << 2);
  2976. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  2977. }
  2978. }
  2979. {
  2980. {
  2981. BI opval = 0;
  2982. CPU (h_xbit) = opval;
  2983. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  2984. }
  2985. {
  2986. BI opval = 0;
  2987. SET_H_INSN_PREFIXED_P (opval);
  2988. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  2989. }
  2990. }
  2991. }
  2992. abuf->written = written;
  2993. #undef FLD
  2994. }
  2995. NEXT (vpc);
  2996. CASE (sem, INSN_MOVE_SPR_RV10) : /* move ${Ps},${Rd-sfield} */
  2997. {
  2998. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  2999. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3000. #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
  3001. int UNUSED written = 0;
  3002. IADDR UNUSED pc = abuf->addr;
  3003. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  3004. {
  3005. SI tmp_grno;
  3006. SI tmp_prno;
  3007. SI tmp_newval;
  3008. tmp_prno = FLD (f_operand2);
  3009. tmp_newval = GET_H_SR (FLD (f_operand2));
  3010. if (EQSI (tmp_prno, 5)) {
  3011. {
  3012. SI tmp_oldregval;
  3013. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
  3014. {
  3015. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  3016. SET_H_GR (FLD (f_operand1), opval);
  3017. written |= (1 << 4);
  3018. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3019. }
  3020. }
  3021. }
  3022. else if (EQSI (tmp_prno, 9)) {
  3023. {
  3024. SI opval = tmp_newval;
  3025. SET_H_GR (FLD (f_operand1), opval);
  3026. written |= (1 << 4);
  3027. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3028. }
  3029. }
  3030. else if (EQSI (tmp_prno, 10)) {
  3031. {
  3032. SI opval = tmp_newval;
  3033. SET_H_GR (FLD (f_operand1), opval);
  3034. written |= (1 << 4);
  3035. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3036. }
  3037. }
  3038. else if (EQSI (tmp_prno, 11)) {
  3039. {
  3040. SI opval = tmp_newval;
  3041. SET_H_GR (FLD (f_operand1), opval);
  3042. written |= (1 << 4);
  3043. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3044. }
  3045. }
  3046. else if (EQSI (tmp_prno, 12)) {
  3047. {
  3048. SI opval = tmp_newval;
  3049. SET_H_GR (FLD (f_operand1), opval);
  3050. written |= (1 << 4);
  3051. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3052. }
  3053. }
  3054. else if (EQSI (tmp_prno, 13)) {
  3055. {
  3056. SI opval = tmp_newval;
  3057. SET_H_GR (FLD (f_operand1), opval);
  3058. written |= (1 << 4);
  3059. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3060. }
  3061. }
  3062. else if (EQSI (tmp_prno, 0)) {
  3063. {
  3064. SI tmp_oldregval;
  3065. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
  3066. {
  3067. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  3068. SET_H_GR (FLD (f_operand1), opval);
  3069. written |= (1 << 4);
  3070. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3071. }
  3072. }
  3073. }
  3074. else if (EQSI (tmp_prno, 1)) {
  3075. {
  3076. SI tmp_oldregval;
  3077. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
  3078. {
  3079. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  3080. SET_H_GR (FLD (f_operand1), opval);
  3081. written |= (1 << 4);
  3082. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3083. }
  3084. }
  3085. }
  3086. else if (EQSI (tmp_prno, 4)) {
  3087. {
  3088. SI tmp_oldregval;
  3089. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
  3090. {
  3091. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  3092. SET_H_GR (FLD (f_operand1), opval);
  3093. written |= (1 << 4);
  3094. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3095. }
  3096. }
  3097. }
  3098. else if (EQSI (tmp_prno, 8)) {
  3099. {
  3100. SI opval = tmp_newval;
  3101. SET_H_GR (FLD (f_operand1), opval);
  3102. written |= (1 << 4);
  3103. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3104. }
  3105. }
  3106. else if (EQSI (tmp_prno, 7)) {
  3107. {
  3108. SI opval = tmp_newval;
  3109. SET_H_GR (FLD (f_operand1), opval);
  3110. written |= (1 << 4);
  3111. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3112. }
  3113. }
  3114. else if (EQSI (tmp_prno, 14)) {
  3115. {
  3116. SI opval = tmp_newval;
  3117. SET_H_GR (FLD (f_operand1), opval);
  3118. written |= (1 << 4);
  3119. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3120. }
  3121. }
  3122. else if (EQSI (tmp_prno, 15)) {
  3123. {
  3124. SI opval = tmp_newval;
  3125. SET_H_GR (FLD (f_operand1), opval);
  3126. written |= (1 << 4);
  3127. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3128. }
  3129. }
  3130. else {
  3131. cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
  3132. }
  3133. {
  3134. {
  3135. BI opval = 0;
  3136. CPU (h_xbit) = opval;
  3137. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3138. }
  3139. {
  3140. BI opval = 0;
  3141. SET_H_INSN_PREFIXED_P (opval);
  3142. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3143. }
  3144. }
  3145. }
  3146. abuf->written = written;
  3147. #undef FLD
  3148. }
  3149. NEXT (vpc);
  3150. CASE (sem, INSN_RET_TYPE) : /* ret/reti/retb */
  3151. {
  3152. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3153. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3154. #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
  3155. int UNUSED written = 0;
  3156. IADDR UNUSED pc = abuf->addr;
  3157. SEM_BRANCH_INIT
  3158. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  3159. {
  3160. SI tmp_retaddr;
  3161. tmp_retaddr = GET_H_SR (FLD (f_operand2));
  3162. {
  3163. {
  3164. BI opval = 0;
  3165. CPU (h_xbit) = opval;
  3166. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3167. }
  3168. {
  3169. BI opval = 0;
  3170. SET_H_INSN_PREFIXED_P (opval);
  3171. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3172. }
  3173. }
  3174. {
  3175. {
  3176. USI opval = tmp_retaddr;
  3177. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  3178. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  3179. }
  3180. }
  3181. }
  3182. SEM_BRANCH_FINI (vpc);
  3183. #undef FLD
  3184. }
  3185. NEXT (vpc);
  3186. CASE (sem, INSN_MOVE_M_SPRV10) : /* move [${Rs}${inc}],${Pd} */
  3187. {
  3188. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3189. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3190. #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
  3191. int UNUSED written = 0;
  3192. IADDR UNUSED pc = abuf->addr;
  3193. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  3194. {
  3195. SI tmp_rno;
  3196. SI tmp_newval;
  3197. tmp_rno = FLD (f_operand2);
  3198. if (EQSI (tmp_rno, 5)) {
  3199. tmp_newval = EXTHISI (({ SI tmp_addr;
  3200. HI tmp_tmp_mem;
  3201. BI tmp_postinc;
  3202. tmp_postinc = FLD (f_memmode);
  3203. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3204. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  3205. ; if (NEBI (tmp_postinc, 0)) {
  3206. {
  3207. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3208. tmp_addr = ADDSI (tmp_addr, 2);
  3209. }
  3210. {
  3211. SI opval = tmp_addr;
  3212. SET_H_GR (FLD (f_operand1), opval);
  3213. written |= (1 << 8);
  3214. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3215. }
  3216. }
  3217. }
  3218. ; tmp_tmp_mem; }));
  3219. }
  3220. else if (EQSI (tmp_rno, 9)) {
  3221. tmp_newval = ({ SI tmp_addr;
  3222. SI tmp_tmp_mem;
  3223. BI tmp_postinc;
  3224. tmp_postinc = FLD (f_memmode);
  3225. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3226. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3227. ; if (NEBI (tmp_postinc, 0)) {
  3228. {
  3229. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3230. tmp_addr = ADDSI (tmp_addr, 4);
  3231. }
  3232. {
  3233. SI opval = tmp_addr;
  3234. SET_H_GR (FLD (f_operand1), opval);
  3235. written |= (1 << 8);
  3236. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3237. }
  3238. }
  3239. }
  3240. ; tmp_tmp_mem; });
  3241. }
  3242. else if (EQSI (tmp_rno, 10)) {
  3243. tmp_newval = ({ SI tmp_addr;
  3244. SI tmp_tmp_mem;
  3245. BI tmp_postinc;
  3246. tmp_postinc = FLD (f_memmode);
  3247. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3248. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3249. ; if (NEBI (tmp_postinc, 0)) {
  3250. {
  3251. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3252. tmp_addr = ADDSI (tmp_addr, 4);
  3253. }
  3254. {
  3255. SI opval = tmp_addr;
  3256. SET_H_GR (FLD (f_operand1), opval);
  3257. written |= (1 << 8);
  3258. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3259. }
  3260. }
  3261. }
  3262. ; tmp_tmp_mem; });
  3263. }
  3264. else if (EQSI (tmp_rno, 11)) {
  3265. tmp_newval = ({ SI tmp_addr;
  3266. SI tmp_tmp_mem;
  3267. BI tmp_postinc;
  3268. tmp_postinc = FLD (f_memmode);
  3269. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3270. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3271. ; if (NEBI (tmp_postinc, 0)) {
  3272. {
  3273. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3274. tmp_addr = ADDSI (tmp_addr, 4);
  3275. }
  3276. {
  3277. SI opval = tmp_addr;
  3278. SET_H_GR (FLD (f_operand1), opval);
  3279. written |= (1 << 8);
  3280. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3281. }
  3282. }
  3283. }
  3284. ; tmp_tmp_mem; });
  3285. }
  3286. else if (EQSI (tmp_rno, 12)) {
  3287. tmp_newval = ({ SI tmp_addr;
  3288. SI tmp_tmp_mem;
  3289. BI tmp_postinc;
  3290. tmp_postinc = FLD (f_memmode);
  3291. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3292. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3293. ; if (NEBI (tmp_postinc, 0)) {
  3294. {
  3295. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3296. tmp_addr = ADDSI (tmp_addr, 4);
  3297. }
  3298. {
  3299. SI opval = tmp_addr;
  3300. SET_H_GR (FLD (f_operand1), opval);
  3301. written |= (1 << 8);
  3302. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3303. }
  3304. }
  3305. }
  3306. ; tmp_tmp_mem; });
  3307. }
  3308. else if (EQSI (tmp_rno, 13)) {
  3309. tmp_newval = ({ SI tmp_addr;
  3310. SI tmp_tmp_mem;
  3311. BI tmp_postinc;
  3312. tmp_postinc = FLD (f_memmode);
  3313. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3314. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3315. ; if (NEBI (tmp_postinc, 0)) {
  3316. {
  3317. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3318. tmp_addr = ADDSI (tmp_addr, 4);
  3319. }
  3320. {
  3321. SI opval = tmp_addr;
  3322. SET_H_GR (FLD (f_operand1), opval);
  3323. written |= (1 << 8);
  3324. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3325. }
  3326. }
  3327. }
  3328. ; tmp_tmp_mem; });
  3329. }
  3330. else if (EQSI (tmp_rno, 7)) {
  3331. tmp_newval = ({ SI tmp_addr;
  3332. SI tmp_tmp_mem;
  3333. BI tmp_postinc;
  3334. tmp_postinc = FLD (f_memmode);
  3335. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3336. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3337. ; if (NEBI (tmp_postinc, 0)) {
  3338. {
  3339. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3340. tmp_addr = ADDSI (tmp_addr, 4);
  3341. }
  3342. {
  3343. SI opval = tmp_addr;
  3344. SET_H_GR (FLD (f_operand1), opval);
  3345. written |= (1 << 8);
  3346. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3347. }
  3348. }
  3349. }
  3350. ; tmp_tmp_mem; });
  3351. }
  3352. else if (EQSI (tmp_rno, 14)) {
  3353. tmp_newval = ({ SI tmp_addr;
  3354. SI tmp_tmp_mem;
  3355. BI tmp_postinc;
  3356. tmp_postinc = FLD (f_memmode);
  3357. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3358. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3359. ; if (NEBI (tmp_postinc, 0)) {
  3360. {
  3361. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3362. tmp_addr = ADDSI (tmp_addr, 4);
  3363. }
  3364. {
  3365. SI opval = tmp_addr;
  3366. SET_H_GR (FLD (f_operand1), opval);
  3367. written |= (1 << 8);
  3368. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3369. }
  3370. }
  3371. }
  3372. ; tmp_tmp_mem; });
  3373. }
  3374. else if (EQSI (tmp_rno, 15)) {
  3375. tmp_newval = ({ SI tmp_addr;
  3376. SI tmp_tmp_mem;
  3377. BI tmp_postinc;
  3378. tmp_postinc = FLD (f_memmode);
  3379. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3380. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  3381. ; if (NEBI (tmp_postinc, 0)) {
  3382. {
  3383. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3384. tmp_addr = ADDSI (tmp_addr, 4);
  3385. }
  3386. {
  3387. SI opval = tmp_addr;
  3388. SET_H_GR (FLD (f_operand1), opval);
  3389. written |= (1 << 8);
  3390. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3391. }
  3392. }
  3393. }
  3394. ; tmp_tmp_mem; });
  3395. }
  3396. else {
  3397. cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
  3398. }
  3399. {
  3400. SI opval = tmp_newval;
  3401. SET_H_SR (FLD (f_operand2), opval);
  3402. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3403. }
  3404. {
  3405. {
  3406. BI opval = 0;
  3407. CPU (h_xbit) = opval;
  3408. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3409. }
  3410. {
  3411. BI opval = 0;
  3412. SET_H_INSN_PREFIXED_P (opval);
  3413. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3414. }
  3415. }
  3416. }
  3417. abuf->written = written;
  3418. #undef FLD
  3419. }
  3420. NEXT (vpc);
  3421. CASE (sem, INSN_MOVE_C_SPRV10_P5) : /* move ${sconst16},${Pd} */
  3422. {
  3423. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3424. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3425. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p5.f
  3426. int UNUSED written = 0;
  3427. IADDR UNUSED pc = abuf->addr;
  3428. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  3429. {
  3430. {
  3431. SI opval = FLD (f_indir_pc__word);
  3432. SET_H_SR (FLD (f_operand2), opval);
  3433. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3434. }
  3435. {
  3436. {
  3437. BI opval = 0;
  3438. CPU (h_xbit) = opval;
  3439. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3440. }
  3441. {
  3442. BI opval = 0;
  3443. SET_H_INSN_PREFIXED_P (opval);
  3444. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3445. }
  3446. }
  3447. }
  3448. #undef FLD
  3449. }
  3450. NEXT (vpc);
  3451. CASE (sem, INSN_MOVE_C_SPRV10_P9) : /* move ${const32},${Pd} */
  3452. {
  3453. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3454. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3455. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3456. int UNUSED written = 0;
  3457. IADDR UNUSED pc = abuf->addr;
  3458. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3459. {
  3460. {
  3461. SI opval = FLD (f_indir_pc__dword);
  3462. SET_H_SR (FLD (f_operand2), opval);
  3463. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3464. }
  3465. {
  3466. {
  3467. BI opval = 0;
  3468. CPU (h_xbit) = opval;
  3469. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3470. }
  3471. {
  3472. BI opval = 0;
  3473. SET_H_INSN_PREFIXED_P (opval);
  3474. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3475. }
  3476. }
  3477. }
  3478. #undef FLD
  3479. }
  3480. NEXT (vpc);
  3481. CASE (sem, INSN_MOVE_C_SPRV10_P10) : /* move ${const32},${Pd} */
  3482. {
  3483. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3484. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3485. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3486. int UNUSED written = 0;
  3487. IADDR UNUSED pc = abuf->addr;
  3488. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3489. {
  3490. {
  3491. SI opval = FLD (f_indir_pc__dword);
  3492. SET_H_SR (FLD (f_operand2), opval);
  3493. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3494. }
  3495. {
  3496. {
  3497. BI opval = 0;
  3498. CPU (h_xbit) = opval;
  3499. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3500. }
  3501. {
  3502. BI opval = 0;
  3503. SET_H_INSN_PREFIXED_P (opval);
  3504. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3505. }
  3506. }
  3507. }
  3508. #undef FLD
  3509. }
  3510. NEXT (vpc);
  3511. CASE (sem, INSN_MOVE_C_SPRV10_P11) : /* move ${const32},${Pd} */
  3512. {
  3513. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3514. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3515. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3516. int UNUSED written = 0;
  3517. IADDR UNUSED pc = abuf->addr;
  3518. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3519. {
  3520. {
  3521. SI opval = FLD (f_indir_pc__dword);
  3522. SET_H_SR (FLD (f_operand2), opval);
  3523. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3524. }
  3525. {
  3526. {
  3527. BI opval = 0;
  3528. CPU (h_xbit) = opval;
  3529. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3530. }
  3531. {
  3532. BI opval = 0;
  3533. SET_H_INSN_PREFIXED_P (opval);
  3534. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3535. }
  3536. }
  3537. }
  3538. #undef FLD
  3539. }
  3540. NEXT (vpc);
  3541. CASE (sem, INSN_MOVE_C_SPRV10_P12) : /* move ${const32},${Pd} */
  3542. {
  3543. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3544. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3545. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3546. int UNUSED written = 0;
  3547. IADDR UNUSED pc = abuf->addr;
  3548. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3549. {
  3550. {
  3551. SI opval = FLD (f_indir_pc__dword);
  3552. SET_H_SR (FLD (f_operand2), opval);
  3553. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3554. }
  3555. {
  3556. {
  3557. BI opval = 0;
  3558. CPU (h_xbit) = opval;
  3559. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3560. }
  3561. {
  3562. BI opval = 0;
  3563. SET_H_INSN_PREFIXED_P (opval);
  3564. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3565. }
  3566. }
  3567. }
  3568. #undef FLD
  3569. }
  3570. NEXT (vpc);
  3571. CASE (sem, INSN_MOVE_C_SPRV10_P13) : /* move ${const32},${Pd} */
  3572. {
  3573. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3574. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3575. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3576. int UNUSED written = 0;
  3577. IADDR UNUSED pc = abuf->addr;
  3578. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3579. {
  3580. {
  3581. SI opval = FLD (f_indir_pc__dword);
  3582. SET_H_SR (FLD (f_operand2), opval);
  3583. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3584. }
  3585. {
  3586. {
  3587. BI opval = 0;
  3588. CPU (h_xbit) = opval;
  3589. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3590. }
  3591. {
  3592. BI opval = 0;
  3593. SET_H_INSN_PREFIXED_P (opval);
  3594. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3595. }
  3596. }
  3597. }
  3598. #undef FLD
  3599. }
  3600. NEXT (vpc);
  3601. CASE (sem, INSN_MOVE_C_SPRV10_P7) : /* move ${const32},${Pd} */
  3602. {
  3603. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3604. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3605. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3606. int UNUSED written = 0;
  3607. IADDR UNUSED pc = abuf->addr;
  3608. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3609. {
  3610. {
  3611. SI opval = FLD (f_indir_pc__dword);
  3612. SET_H_SR (FLD (f_operand2), opval);
  3613. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3614. }
  3615. {
  3616. {
  3617. BI opval = 0;
  3618. CPU (h_xbit) = opval;
  3619. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3620. }
  3621. {
  3622. BI opval = 0;
  3623. SET_H_INSN_PREFIXED_P (opval);
  3624. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3625. }
  3626. }
  3627. }
  3628. #undef FLD
  3629. }
  3630. NEXT (vpc);
  3631. CASE (sem, INSN_MOVE_C_SPRV10_P14) : /* move ${const32},${Pd} */
  3632. {
  3633. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3634. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3635. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3636. int UNUSED written = 0;
  3637. IADDR UNUSED pc = abuf->addr;
  3638. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3639. {
  3640. {
  3641. SI opval = FLD (f_indir_pc__dword);
  3642. SET_H_SR (FLD (f_operand2), opval);
  3643. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3644. }
  3645. {
  3646. {
  3647. BI opval = 0;
  3648. CPU (h_xbit) = opval;
  3649. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3650. }
  3651. {
  3652. BI opval = 0;
  3653. SET_H_INSN_PREFIXED_P (opval);
  3654. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3655. }
  3656. }
  3657. }
  3658. #undef FLD
  3659. }
  3660. NEXT (vpc);
  3661. CASE (sem, INSN_MOVE_C_SPRV10_P15) : /* move ${const32},${Pd} */
  3662. {
  3663. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3664. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3665. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  3666. int UNUSED written = 0;
  3667. IADDR UNUSED pc = abuf->addr;
  3668. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  3669. {
  3670. {
  3671. SI opval = FLD (f_indir_pc__dword);
  3672. SET_H_SR (FLD (f_operand2), opval);
  3673. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  3674. }
  3675. {
  3676. {
  3677. BI opval = 0;
  3678. CPU (h_xbit) = opval;
  3679. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  3680. }
  3681. {
  3682. BI opval = 0;
  3683. SET_H_INSN_PREFIXED_P (opval);
  3684. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  3685. }
  3686. }
  3687. }
  3688. #undef FLD
  3689. }
  3690. NEXT (vpc);
  3691. CASE (sem, INSN_MOVE_SPR_MV10) : /* move ${Ps},[${Rd-sfield}${inc}] */
  3692. {
  3693. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  3694. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  3695. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  3696. int UNUSED written = 0;
  3697. IADDR UNUSED pc = abuf->addr;
  3698. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  3699. {
  3700. SI tmp_rno;
  3701. tmp_rno = FLD (f_operand2);
  3702. if (EQSI (tmp_rno, 5)) {
  3703. {
  3704. SI tmp_addr;
  3705. BI tmp_postinc;
  3706. tmp_postinc = FLD (f_memmode);
  3707. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3708. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3709. if (EQBI (CPU (h_pbit), 0)) {
  3710. {
  3711. {
  3712. HI opval = GET_H_SR (FLD (f_operand2));
  3713. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  3714. written |= (1 << 11);
  3715. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3716. }
  3717. {
  3718. BI opval = CPU (h_pbit);
  3719. CPU (h_cbit) = opval;
  3720. written |= (1 << 10);
  3721. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3722. }
  3723. }
  3724. } else {
  3725. {
  3726. BI opval = 1;
  3727. CPU (h_cbit) = opval;
  3728. written |= (1 << 10);
  3729. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3730. }
  3731. }
  3732. } else {
  3733. {
  3734. HI opval = GET_H_SR (FLD (f_operand2));
  3735. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  3736. written |= (1 << 11);
  3737. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3738. }
  3739. }
  3740. if (NEBI (tmp_postinc, 0)) {
  3741. {
  3742. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3743. tmp_addr = ADDSI (tmp_addr, 2);
  3744. }
  3745. {
  3746. SI opval = tmp_addr;
  3747. SET_H_GR (FLD (f_operand1), opval);
  3748. written |= (1 << 9);
  3749. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3750. }
  3751. }
  3752. }
  3753. }
  3754. }
  3755. else if (EQSI (tmp_rno, 9)) {
  3756. {
  3757. SI tmp_addr;
  3758. BI tmp_postinc;
  3759. tmp_postinc = FLD (f_memmode);
  3760. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3761. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3762. if (EQBI (CPU (h_pbit), 0)) {
  3763. {
  3764. {
  3765. SI opval = GET_H_SR (FLD (f_operand2));
  3766. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3767. written |= (1 << 13);
  3768. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3769. }
  3770. {
  3771. BI opval = CPU (h_pbit);
  3772. CPU (h_cbit) = opval;
  3773. written |= (1 << 10);
  3774. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3775. }
  3776. }
  3777. } else {
  3778. {
  3779. BI opval = 1;
  3780. CPU (h_cbit) = opval;
  3781. written |= (1 << 10);
  3782. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3783. }
  3784. }
  3785. } else {
  3786. {
  3787. SI opval = GET_H_SR (FLD (f_operand2));
  3788. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3789. written |= (1 << 13);
  3790. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3791. }
  3792. }
  3793. if (NEBI (tmp_postinc, 0)) {
  3794. {
  3795. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3796. tmp_addr = ADDSI (tmp_addr, 4);
  3797. }
  3798. {
  3799. SI opval = tmp_addr;
  3800. SET_H_GR (FLD (f_operand1), opval);
  3801. written |= (1 << 9);
  3802. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3803. }
  3804. }
  3805. }
  3806. }
  3807. }
  3808. else if (EQSI (tmp_rno, 10)) {
  3809. {
  3810. SI tmp_addr;
  3811. BI tmp_postinc;
  3812. tmp_postinc = FLD (f_memmode);
  3813. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3814. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3815. if (EQBI (CPU (h_pbit), 0)) {
  3816. {
  3817. {
  3818. SI opval = GET_H_SR (FLD (f_operand2));
  3819. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3820. written |= (1 << 13);
  3821. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3822. }
  3823. {
  3824. BI opval = CPU (h_pbit);
  3825. CPU (h_cbit) = opval;
  3826. written |= (1 << 10);
  3827. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3828. }
  3829. }
  3830. } else {
  3831. {
  3832. BI opval = 1;
  3833. CPU (h_cbit) = opval;
  3834. written |= (1 << 10);
  3835. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3836. }
  3837. }
  3838. } else {
  3839. {
  3840. SI opval = GET_H_SR (FLD (f_operand2));
  3841. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3842. written |= (1 << 13);
  3843. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3844. }
  3845. }
  3846. if (NEBI (tmp_postinc, 0)) {
  3847. {
  3848. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3849. tmp_addr = ADDSI (tmp_addr, 4);
  3850. }
  3851. {
  3852. SI opval = tmp_addr;
  3853. SET_H_GR (FLD (f_operand1), opval);
  3854. written |= (1 << 9);
  3855. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3856. }
  3857. }
  3858. }
  3859. }
  3860. }
  3861. else if (EQSI (tmp_rno, 11)) {
  3862. {
  3863. SI tmp_addr;
  3864. BI tmp_postinc;
  3865. tmp_postinc = FLD (f_memmode);
  3866. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3867. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3868. if (EQBI (CPU (h_pbit), 0)) {
  3869. {
  3870. {
  3871. SI opval = GET_H_SR (FLD (f_operand2));
  3872. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3873. written |= (1 << 13);
  3874. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3875. }
  3876. {
  3877. BI opval = CPU (h_pbit);
  3878. CPU (h_cbit) = opval;
  3879. written |= (1 << 10);
  3880. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3881. }
  3882. }
  3883. } else {
  3884. {
  3885. BI opval = 1;
  3886. CPU (h_cbit) = opval;
  3887. written |= (1 << 10);
  3888. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3889. }
  3890. }
  3891. } else {
  3892. {
  3893. SI opval = GET_H_SR (FLD (f_operand2));
  3894. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3895. written |= (1 << 13);
  3896. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3897. }
  3898. }
  3899. if (NEBI (tmp_postinc, 0)) {
  3900. {
  3901. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3902. tmp_addr = ADDSI (tmp_addr, 4);
  3903. }
  3904. {
  3905. SI opval = tmp_addr;
  3906. SET_H_GR (FLD (f_operand1), opval);
  3907. written |= (1 << 9);
  3908. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3909. }
  3910. }
  3911. }
  3912. }
  3913. }
  3914. else if (EQSI (tmp_rno, 12)) {
  3915. {
  3916. SI tmp_addr;
  3917. BI tmp_postinc;
  3918. tmp_postinc = FLD (f_memmode);
  3919. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3920. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3921. if (EQBI (CPU (h_pbit), 0)) {
  3922. {
  3923. {
  3924. SI opval = GET_H_SR (FLD (f_operand2));
  3925. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3926. written |= (1 << 13);
  3927. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3928. }
  3929. {
  3930. BI opval = CPU (h_pbit);
  3931. CPU (h_cbit) = opval;
  3932. written |= (1 << 10);
  3933. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3934. }
  3935. }
  3936. } else {
  3937. {
  3938. BI opval = 1;
  3939. CPU (h_cbit) = opval;
  3940. written |= (1 << 10);
  3941. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3942. }
  3943. }
  3944. } else {
  3945. {
  3946. SI opval = GET_H_SR (FLD (f_operand2));
  3947. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3948. written |= (1 << 13);
  3949. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3950. }
  3951. }
  3952. if (NEBI (tmp_postinc, 0)) {
  3953. {
  3954. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  3955. tmp_addr = ADDSI (tmp_addr, 4);
  3956. }
  3957. {
  3958. SI opval = tmp_addr;
  3959. SET_H_GR (FLD (f_operand1), opval);
  3960. written |= (1 << 9);
  3961. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  3962. }
  3963. }
  3964. }
  3965. }
  3966. }
  3967. else if (EQSI (tmp_rno, 13)) {
  3968. {
  3969. SI tmp_addr;
  3970. BI tmp_postinc;
  3971. tmp_postinc = FLD (f_memmode);
  3972. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  3973. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  3974. if (EQBI (CPU (h_pbit), 0)) {
  3975. {
  3976. {
  3977. SI opval = GET_H_SR (FLD (f_operand2));
  3978. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  3979. written |= (1 << 13);
  3980. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  3981. }
  3982. {
  3983. BI opval = CPU (h_pbit);
  3984. CPU (h_cbit) = opval;
  3985. written |= (1 << 10);
  3986. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3987. }
  3988. }
  3989. } else {
  3990. {
  3991. BI opval = 1;
  3992. CPU (h_cbit) = opval;
  3993. written |= (1 << 10);
  3994. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  3995. }
  3996. }
  3997. } else {
  3998. {
  3999. SI opval = GET_H_SR (FLD (f_operand2));
  4000. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4001. written |= (1 << 13);
  4002. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4003. }
  4004. }
  4005. if (NEBI (tmp_postinc, 0)) {
  4006. {
  4007. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4008. tmp_addr = ADDSI (tmp_addr, 4);
  4009. }
  4010. {
  4011. SI opval = tmp_addr;
  4012. SET_H_GR (FLD (f_operand1), opval);
  4013. written |= (1 << 9);
  4014. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4015. }
  4016. }
  4017. }
  4018. }
  4019. }
  4020. else if (EQSI (tmp_rno, 0)) {
  4021. {
  4022. SI tmp_addr;
  4023. BI tmp_postinc;
  4024. tmp_postinc = FLD (f_memmode);
  4025. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4026. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4027. if (EQBI (CPU (h_pbit), 0)) {
  4028. {
  4029. {
  4030. QI opval = GET_H_SR (FLD (f_operand2));
  4031. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  4032. written |= (1 << 12);
  4033. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4034. }
  4035. {
  4036. BI opval = CPU (h_pbit);
  4037. CPU (h_cbit) = opval;
  4038. written |= (1 << 10);
  4039. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4040. }
  4041. }
  4042. } else {
  4043. {
  4044. BI opval = 1;
  4045. CPU (h_cbit) = opval;
  4046. written |= (1 << 10);
  4047. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4048. }
  4049. }
  4050. } else {
  4051. {
  4052. QI opval = GET_H_SR (FLD (f_operand2));
  4053. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  4054. written |= (1 << 12);
  4055. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4056. }
  4057. }
  4058. if (NEBI (tmp_postinc, 0)) {
  4059. {
  4060. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4061. tmp_addr = ADDSI (tmp_addr, 1);
  4062. }
  4063. {
  4064. SI opval = tmp_addr;
  4065. SET_H_GR (FLD (f_operand1), opval);
  4066. written |= (1 << 9);
  4067. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4068. }
  4069. }
  4070. }
  4071. }
  4072. }
  4073. else if (EQSI (tmp_rno, 1)) {
  4074. {
  4075. SI tmp_addr;
  4076. BI tmp_postinc;
  4077. tmp_postinc = FLD (f_memmode);
  4078. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4079. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4080. if (EQBI (CPU (h_pbit), 0)) {
  4081. {
  4082. {
  4083. QI opval = GET_H_SR (FLD (f_operand2));
  4084. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  4085. written |= (1 << 12);
  4086. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4087. }
  4088. {
  4089. BI opval = CPU (h_pbit);
  4090. CPU (h_cbit) = opval;
  4091. written |= (1 << 10);
  4092. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4093. }
  4094. }
  4095. } else {
  4096. {
  4097. BI opval = 1;
  4098. CPU (h_cbit) = opval;
  4099. written |= (1 << 10);
  4100. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4101. }
  4102. }
  4103. } else {
  4104. {
  4105. QI opval = GET_H_SR (FLD (f_operand2));
  4106. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  4107. written |= (1 << 12);
  4108. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4109. }
  4110. }
  4111. if (NEBI (tmp_postinc, 0)) {
  4112. {
  4113. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4114. tmp_addr = ADDSI (tmp_addr, 1);
  4115. }
  4116. {
  4117. SI opval = tmp_addr;
  4118. SET_H_GR (FLD (f_operand1), opval);
  4119. written |= (1 << 9);
  4120. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4121. }
  4122. }
  4123. }
  4124. }
  4125. }
  4126. else if (EQSI (tmp_rno, 4)) {
  4127. {
  4128. SI tmp_addr;
  4129. BI tmp_postinc;
  4130. tmp_postinc = FLD (f_memmode);
  4131. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4132. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4133. if (EQBI (CPU (h_pbit), 0)) {
  4134. {
  4135. {
  4136. HI opval = GET_H_SR (FLD (f_operand2));
  4137. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  4138. written |= (1 << 11);
  4139. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4140. }
  4141. {
  4142. BI opval = CPU (h_pbit);
  4143. CPU (h_cbit) = opval;
  4144. written |= (1 << 10);
  4145. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4146. }
  4147. }
  4148. } else {
  4149. {
  4150. BI opval = 1;
  4151. CPU (h_cbit) = opval;
  4152. written |= (1 << 10);
  4153. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4154. }
  4155. }
  4156. } else {
  4157. {
  4158. HI opval = GET_H_SR (FLD (f_operand2));
  4159. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  4160. written |= (1 << 11);
  4161. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4162. }
  4163. }
  4164. if (NEBI (tmp_postinc, 0)) {
  4165. {
  4166. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4167. tmp_addr = ADDSI (tmp_addr, 2);
  4168. }
  4169. {
  4170. SI opval = tmp_addr;
  4171. SET_H_GR (FLD (f_operand1), opval);
  4172. written |= (1 << 9);
  4173. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4174. }
  4175. }
  4176. }
  4177. }
  4178. }
  4179. else if (EQSI (tmp_rno, 8)) {
  4180. {
  4181. SI tmp_addr;
  4182. BI tmp_postinc;
  4183. tmp_postinc = FLD (f_memmode);
  4184. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4185. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4186. if (EQBI (CPU (h_pbit), 0)) {
  4187. {
  4188. {
  4189. SI opval = GET_H_SR (FLD (f_operand2));
  4190. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4191. written |= (1 << 13);
  4192. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4193. }
  4194. {
  4195. BI opval = CPU (h_pbit);
  4196. CPU (h_cbit) = opval;
  4197. written |= (1 << 10);
  4198. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4199. }
  4200. }
  4201. } else {
  4202. {
  4203. BI opval = 1;
  4204. CPU (h_cbit) = opval;
  4205. written |= (1 << 10);
  4206. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4207. }
  4208. }
  4209. } else {
  4210. {
  4211. SI opval = GET_H_SR (FLD (f_operand2));
  4212. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4213. written |= (1 << 13);
  4214. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4215. }
  4216. }
  4217. if (NEBI (tmp_postinc, 0)) {
  4218. {
  4219. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4220. tmp_addr = ADDSI (tmp_addr, 4);
  4221. }
  4222. {
  4223. SI opval = tmp_addr;
  4224. SET_H_GR (FLD (f_operand1), opval);
  4225. written |= (1 << 9);
  4226. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4227. }
  4228. }
  4229. }
  4230. }
  4231. }
  4232. else if (EQSI (tmp_rno, 7)) {
  4233. {
  4234. SI tmp_addr;
  4235. BI tmp_postinc;
  4236. tmp_postinc = FLD (f_memmode);
  4237. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4238. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4239. if (EQBI (CPU (h_pbit), 0)) {
  4240. {
  4241. {
  4242. SI opval = GET_H_SR (FLD (f_operand2));
  4243. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4244. written |= (1 << 13);
  4245. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4246. }
  4247. {
  4248. BI opval = CPU (h_pbit);
  4249. CPU (h_cbit) = opval;
  4250. written |= (1 << 10);
  4251. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4252. }
  4253. }
  4254. } else {
  4255. {
  4256. BI opval = 1;
  4257. CPU (h_cbit) = opval;
  4258. written |= (1 << 10);
  4259. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4260. }
  4261. }
  4262. } else {
  4263. {
  4264. SI opval = GET_H_SR (FLD (f_operand2));
  4265. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4266. written |= (1 << 13);
  4267. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4268. }
  4269. }
  4270. if (NEBI (tmp_postinc, 0)) {
  4271. {
  4272. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4273. tmp_addr = ADDSI (tmp_addr, 4);
  4274. }
  4275. {
  4276. SI opval = tmp_addr;
  4277. SET_H_GR (FLD (f_operand1), opval);
  4278. written |= (1 << 9);
  4279. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4280. }
  4281. }
  4282. }
  4283. }
  4284. }
  4285. else if (EQSI (tmp_rno, 14)) {
  4286. {
  4287. SI tmp_addr;
  4288. BI tmp_postinc;
  4289. tmp_postinc = FLD (f_memmode);
  4290. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4291. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4292. if (EQBI (CPU (h_pbit), 0)) {
  4293. {
  4294. {
  4295. SI opval = GET_H_SR (FLD (f_operand2));
  4296. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4297. written |= (1 << 13);
  4298. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4299. }
  4300. {
  4301. BI opval = CPU (h_pbit);
  4302. CPU (h_cbit) = opval;
  4303. written |= (1 << 10);
  4304. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4305. }
  4306. }
  4307. } else {
  4308. {
  4309. BI opval = 1;
  4310. CPU (h_cbit) = opval;
  4311. written |= (1 << 10);
  4312. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4313. }
  4314. }
  4315. } else {
  4316. {
  4317. SI opval = GET_H_SR (FLD (f_operand2));
  4318. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4319. written |= (1 << 13);
  4320. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4321. }
  4322. }
  4323. if (NEBI (tmp_postinc, 0)) {
  4324. {
  4325. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4326. tmp_addr = ADDSI (tmp_addr, 4);
  4327. }
  4328. {
  4329. SI opval = tmp_addr;
  4330. SET_H_GR (FLD (f_operand1), opval);
  4331. written |= (1 << 9);
  4332. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4333. }
  4334. }
  4335. }
  4336. }
  4337. }
  4338. else if (EQSI (tmp_rno, 15)) {
  4339. {
  4340. SI tmp_addr;
  4341. BI tmp_postinc;
  4342. tmp_postinc = FLD (f_memmode);
  4343. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4344. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  4345. if (EQBI (CPU (h_pbit), 0)) {
  4346. {
  4347. {
  4348. SI opval = GET_H_SR (FLD (f_operand2));
  4349. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4350. written |= (1 << 13);
  4351. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4352. }
  4353. {
  4354. BI opval = CPU (h_pbit);
  4355. CPU (h_cbit) = opval;
  4356. written |= (1 << 10);
  4357. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4358. }
  4359. }
  4360. } else {
  4361. {
  4362. BI opval = 1;
  4363. CPU (h_cbit) = opval;
  4364. written |= (1 << 10);
  4365. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  4366. }
  4367. }
  4368. } else {
  4369. {
  4370. SI opval = GET_H_SR (FLD (f_operand2));
  4371. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4372. written |= (1 << 13);
  4373. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4374. }
  4375. }
  4376. if (NEBI (tmp_postinc, 0)) {
  4377. {
  4378. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  4379. tmp_addr = ADDSI (tmp_addr, 4);
  4380. }
  4381. {
  4382. SI opval = tmp_addr;
  4383. SET_H_GR (FLD (f_operand1), opval);
  4384. written |= (1 << 9);
  4385. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4386. }
  4387. }
  4388. }
  4389. }
  4390. }
  4391. else {
  4392. cgen_rtx_error (current_cpu, "write from unimplemented special register");
  4393. }
  4394. {
  4395. {
  4396. BI opval = 0;
  4397. CPU (h_xbit) = opval;
  4398. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  4399. }
  4400. {
  4401. BI opval = 0;
  4402. SET_H_INSN_PREFIXED_P (opval);
  4403. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  4404. }
  4405. }
  4406. }
  4407. abuf->written = written;
  4408. #undef FLD
  4409. }
  4410. NEXT (vpc);
  4411. CASE (sem, INSN_SBFS) : /* sbfs [${Rd-sfield}${inc}] */
  4412. {
  4413. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  4414. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  4415. #define FLD(f) abuf->fields.sfmt_empty.f
  4416. int UNUSED written = 0;
  4417. IADDR UNUSED pc = abuf->addr;
  4418. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  4419. cgen_rtx_error (current_cpu, "SBFS isn't implemented");
  4420. #undef FLD
  4421. }
  4422. NEXT (vpc);
  4423. CASE (sem, INSN_MOVEM_R_M) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
  4424. {
  4425. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  4426. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  4427. #define FLD(f) abuf->fields.sfmt_movem_r_m.f
  4428. int UNUSED written = 0;
  4429. IADDR UNUSED pc = abuf->addr;
  4430. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  4431. {
  4432. SI tmp_addr;
  4433. BI tmp_postinc;
  4434. tmp_postinc = FLD (f_memmode);
  4435. {
  4436. SI tmp_dummy;
  4437. tmp_dummy = GET_H_GR (FLD (f_operand2));
  4438. }
  4439. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4440. {
  4441. if (GESI (FLD (f_operand2), 15)) {
  4442. {
  4443. SI tmp_tmp;
  4444. tmp_tmp = GET_H_GR (((UINT) 15));
  4445. {
  4446. SI opval = tmp_tmp;
  4447. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4448. written |= (1 << 23);
  4449. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4450. }
  4451. tmp_addr = ADDSI (tmp_addr, 4);
  4452. }
  4453. }
  4454. if (GESI (FLD (f_operand2), 14)) {
  4455. {
  4456. SI tmp_tmp;
  4457. tmp_tmp = GET_H_GR (((UINT) 14));
  4458. {
  4459. SI opval = tmp_tmp;
  4460. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4461. written |= (1 << 23);
  4462. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4463. }
  4464. tmp_addr = ADDSI (tmp_addr, 4);
  4465. }
  4466. }
  4467. if (GESI (FLD (f_operand2), 13)) {
  4468. {
  4469. SI tmp_tmp;
  4470. tmp_tmp = GET_H_GR (((UINT) 13));
  4471. {
  4472. SI opval = tmp_tmp;
  4473. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4474. written |= (1 << 23);
  4475. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4476. }
  4477. tmp_addr = ADDSI (tmp_addr, 4);
  4478. }
  4479. }
  4480. if (GESI (FLD (f_operand2), 12)) {
  4481. {
  4482. SI tmp_tmp;
  4483. tmp_tmp = GET_H_GR (((UINT) 12));
  4484. {
  4485. SI opval = tmp_tmp;
  4486. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4487. written |= (1 << 23);
  4488. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4489. }
  4490. tmp_addr = ADDSI (tmp_addr, 4);
  4491. }
  4492. }
  4493. if (GESI (FLD (f_operand2), 11)) {
  4494. {
  4495. SI tmp_tmp;
  4496. tmp_tmp = GET_H_GR (((UINT) 11));
  4497. {
  4498. SI opval = tmp_tmp;
  4499. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4500. written |= (1 << 23);
  4501. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4502. }
  4503. tmp_addr = ADDSI (tmp_addr, 4);
  4504. }
  4505. }
  4506. if (GESI (FLD (f_operand2), 10)) {
  4507. {
  4508. SI tmp_tmp;
  4509. tmp_tmp = GET_H_GR (((UINT) 10));
  4510. {
  4511. SI opval = tmp_tmp;
  4512. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4513. written |= (1 << 23);
  4514. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4515. }
  4516. tmp_addr = ADDSI (tmp_addr, 4);
  4517. }
  4518. }
  4519. if (GESI (FLD (f_operand2), 9)) {
  4520. {
  4521. SI tmp_tmp;
  4522. tmp_tmp = GET_H_GR (((UINT) 9));
  4523. {
  4524. SI opval = tmp_tmp;
  4525. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4526. written |= (1 << 23);
  4527. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4528. }
  4529. tmp_addr = ADDSI (tmp_addr, 4);
  4530. }
  4531. }
  4532. if (GESI (FLD (f_operand2), 8)) {
  4533. {
  4534. SI tmp_tmp;
  4535. tmp_tmp = GET_H_GR (((UINT) 8));
  4536. {
  4537. SI opval = tmp_tmp;
  4538. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4539. written |= (1 << 23);
  4540. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4541. }
  4542. tmp_addr = ADDSI (tmp_addr, 4);
  4543. }
  4544. }
  4545. if (GESI (FLD (f_operand2), 7)) {
  4546. {
  4547. SI tmp_tmp;
  4548. tmp_tmp = GET_H_GR (((UINT) 7));
  4549. {
  4550. SI opval = tmp_tmp;
  4551. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4552. written |= (1 << 23);
  4553. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4554. }
  4555. tmp_addr = ADDSI (tmp_addr, 4);
  4556. }
  4557. }
  4558. if (GESI (FLD (f_operand2), 6)) {
  4559. {
  4560. SI tmp_tmp;
  4561. tmp_tmp = GET_H_GR (((UINT) 6));
  4562. {
  4563. SI opval = tmp_tmp;
  4564. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4565. written |= (1 << 23);
  4566. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4567. }
  4568. tmp_addr = ADDSI (tmp_addr, 4);
  4569. }
  4570. }
  4571. if (GESI (FLD (f_operand2), 5)) {
  4572. {
  4573. SI tmp_tmp;
  4574. tmp_tmp = GET_H_GR (((UINT) 5));
  4575. {
  4576. SI opval = tmp_tmp;
  4577. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4578. written |= (1 << 23);
  4579. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4580. }
  4581. tmp_addr = ADDSI (tmp_addr, 4);
  4582. }
  4583. }
  4584. if (GESI (FLD (f_operand2), 4)) {
  4585. {
  4586. SI tmp_tmp;
  4587. tmp_tmp = GET_H_GR (((UINT) 4));
  4588. {
  4589. SI opval = tmp_tmp;
  4590. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4591. written |= (1 << 23);
  4592. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4593. }
  4594. tmp_addr = ADDSI (tmp_addr, 4);
  4595. }
  4596. }
  4597. if (GESI (FLD (f_operand2), 3)) {
  4598. {
  4599. SI tmp_tmp;
  4600. tmp_tmp = GET_H_GR (((UINT) 3));
  4601. {
  4602. SI opval = tmp_tmp;
  4603. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4604. written |= (1 << 23);
  4605. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4606. }
  4607. tmp_addr = ADDSI (tmp_addr, 4);
  4608. }
  4609. }
  4610. if (GESI (FLD (f_operand2), 2)) {
  4611. {
  4612. SI tmp_tmp;
  4613. tmp_tmp = GET_H_GR (((UINT) 2));
  4614. {
  4615. SI opval = tmp_tmp;
  4616. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4617. written |= (1 << 23);
  4618. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4619. }
  4620. tmp_addr = ADDSI (tmp_addr, 4);
  4621. }
  4622. }
  4623. if (GESI (FLD (f_operand2), 1)) {
  4624. {
  4625. SI tmp_tmp;
  4626. tmp_tmp = GET_H_GR (((UINT) 1));
  4627. {
  4628. SI opval = tmp_tmp;
  4629. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4630. written |= (1 << 23);
  4631. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4632. }
  4633. tmp_addr = ADDSI (tmp_addr, 4);
  4634. }
  4635. }
  4636. if (GESI (FLD (f_operand2), 0)) {
  4637. {
  4638. SI tmp_tmp;
  4639. tmp_tmp = GET_H_GR (((UINT) 0));
  4640. {
  4641. SI opval = tmp_tmp;
  4642. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  4643. written |= (1 << 23);
  4644. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  4645. }
  4646. tmp_addr = ADDSI (tmp_addr, 4);
  4647. }
  4648. }
  4649. }
  4650. if (NEBI (tmp_postinc, 0)) {
  4651. {
  4652. SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
  4653. SET_H_GR (FLD (f_operand1), opval);
  4654. written |= (1 << 22);
  4655. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4656. }
  4657. }
  4658. {
  4659. {
  4660. BI opval = 0;
  4661. CPU (h_xbit) = opval;
  4662. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  4663. }
  4664. {
  4665. BI opval = 0;
  4666. SET_H_INSN_PREFIXED_P (opval);
  4667. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  4668. }
  4669. }
  4670. }
  4671. abuf->written = written;
  4672. #undef FLD
  4673. }
  4674. NEXT (vpc);
  4675. CASE (sem, INSN_MOVEM_M_R) : /* movem [${Rs}${inc}],${Rd} */
  4676. {
  4677. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  4678. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  4679. #define FLD(f) abuf->fields.sfmt_movem_m_r.f
  4680. int UNUSED written = 0;
  4681. IADDR UNUSED pc = abuf->addr;
  4682. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  4683. {
  4684. SI tmp_addr;
  4685. BI tmp_postinc;
  4686. tmp_postinc = FLD (f_memmode);
  4687. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4688. {
  4689. SI tmp_dummy;
  4690. tmp_dummy = GET_H_GR (FLD (f_operand2));
  4691. }
  4692. {
  4693. if (GESI (FLD (f_operand2), 14)) {
  4694. {
  4695. SI tmp_tmp;
  4696. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4697. {
  4698. SI opval = tmp_tmp;
  4699. SET_H_GR (((UINT) 14), opval);
  4700. written |= (1 << 14);
  4701. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4702. }
  4703. tmp_addr = ADDSI (tmp_addr, 4);
  4704. }
  4705. }
  4706. if (GESI (FLD (f_operand2), 13)) {
  4707. {
  4708. SI tmp_tmp;
  4709. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4710. {
  4711. SI opval = tmp_tmp;
  4712. SET_H_GR (((UINT) 13), opval);
  4713. written |= (1 << 13);
  4714. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4715. }
  4716. tmp_addr = ADDSI (tmp_addr, 4);
  4717. }
  4718. }
  4719. if (GESI (FLD (f_operand2), 12)) {
  4720. {
  4721. SI tmp_tmp;
  4722. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4723. {
  4724. SI opval = tmp_tmp;
  4725. SET_H_GR (((UINT) 12), opval);
  4726. written |= (1 << 12);
  4727. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4728. }
  4729. tmp_addr = ADDSI (tmp_addr, 4);
  4730. }
  4731. }
  4732. if (GESI (FLD (f_operand2), 11)) {
  4733. {
  4734. SI tmp_tmp;
  4735. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4736. {
  4737. SI opval = tmp_tmp;
  4738. SET_H_GR (((UINT) 11), opval);
  4739. written |= (1 << 11);
  4740. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4741. }
  4742. tmp_addr = ADDSI (tmp_addr, 4);
  4743. }
  4744. }
  4745. if (GESI (FLD (f_operand2), 10)) {
  4746. {
  4747. SI tmp_tmp;
  4748. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4749. {
  4750. SI opval = tmp_tmp;
  4751. SET_H_GR (((UINT) 10), opval);
  4752. written |= (1 << 10);
  4753. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4754. }
  4755. tmp_addr = ADDSI (tmp_addr, 4);
  4756. }
  4757. }
  4758. if (GESI (FLD (f_operand2), 9)) {
  4759. {
  4760. SI tmp_tmp;
  4761. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4762. {
  4763. SI opval = tmp_tmp;
  4764. SET_H_GR (((UINT) 9), opval);
  4765. written |= (1 << 22);
  4766. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4767. }
  4768. tmp_addr = ADDSI (tmp_addr, 4);
  4769. }
  4770. }
  4771. if (GESI (FLD (f_operand2), 8)) {
  4772. {
  4773. SI tmp_tmp;
  4774. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4775. {
  4776. SI opval = tmp_tmp;
  4777. SET_H_GR (((UINT) 8), opval);
  4778. written |= (1 << 21);
  4779. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4780. }
  4781. tmp_addr = ADDSI (tmp_addr, 4);
  4782. }
  4783. }
  4784. if (GESI (FLD (f_operand2), 7)) {
  4785. {
  4786. SI tmp_tmp;
  4787. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4788. {
  4789. SI opval = tmp_tmp;
  4790. SET_H_GR (((UINT) 7), opval);
  4791. written |= (1 << 20);
  4792. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4793. }
  4794. tmp_addr = ADDSI (tmp_addr, 4);
  4795. }
  4796. }
  4797. if (GESI (FLD (f_operand2), 6)) {
  4798. {
  4799. SI tmp_tmp;
  4800. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4801. {
  4802. SI opval = tmp_tmp;
  4803. SET_H_GR (((UINT) 6), opval);
  4804. written |= (1 << 19);
  4805. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4806. }
  4807. tmp_addr = ADDSI (tmp_addr, 4);
  4808. }
  4809. }
  4810. if (GESI (FLD (f_operand2), 5)) {
  4811. {
  4812. SI tmp_tmp;
  4813. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4814. {
  4815. SI opval = tmp_tmp;
  4816. SET_H_GR (((UINT) 5), opval);
  4817. written |= (1 << 18);
  4818. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4819. }
  4820. tmp_addr = ADDSI (tmp_addr, 4);
  4821. }
  4822. }
  4823. if (GESI (FLD (f_operand2), 4)) {
  4824. {
  4825. SI tmp_tmp;
  4826. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4827. {
  4828. SI opval = tmp_tmp;
  4829. SET_H_GR (((UINT) 4), opval);
  4830. written |= (1 << 17);
  4831. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4832. }
  4833. tmp_addr = ADDSI (tmp_addr, 4);
  4834. }
  4835. }
  4836. if (GESI (FLD (f_operand2), 3)) {
  4837. {
  4838. SI tmp_tmp;
  4839. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4840. {
  4841. SI opval = tmp_tmp;
  4842. SET_H_GR (((UINT) 3), opval);
  4843. written |= (1 << 16);
  4844. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4845. }
  4846. tmp_addr = ADDSI (tmp_addr, 4);
  4847. }
  4848. }
  4849. if (GESI (FLD (f_operand2), 2)) {
  4850. {
  4851. SI tmp_tmp;
  4852. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4853. {
  4854. SI opval = tmp_tmp;
  4855. SET_H_GR (((UINT) 2), opval);
  4856. written |= (1 << 15);
  4857. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4858. }
  4859. tmp_addr = ADDSI (tmp_addr, 4);
  4860. }
  4861. }
  4862. if (GESI (FLD (f_operand2), 1)) {
  4863. {
  4864. SI tmp_tmp;
  4865. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4866. {
  4867. SI opval = tmp_tmp;
  4868. SET_H_GR (((UINT) 1), opval);
  4869. written |= (1 << 9);
  4870. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4871. }
  4872. tmp_addr = ADDSI (tmp_addr, 4);
  4873. }
  4874. }
  4875. if (GESI (FLD (f_operand2), 0)) {
  4876. {
  4877. SI tmp_tmp;
  4878. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4879. {
  4880. SI opval = tmp_tmp;
  4881. SET_H_GR (((UINT) 0), opval);
  4882. written |= (1 << 8);
  4883. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4884. }
  4885. tmp_addr = ADDSI (tmp_addr, 4);
  4886. }
  4887. }
  4888. }
  4889. if (NEBI (tmp_postinc, 0)) {
  4890. {
  4891. SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
  4892. SET_H_GR (FLD (f_operand1), opval);
  4893. written |= (1 << 7);
  4894. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4895. }
  4896. }
  4897. {
  4898. {
  4899. BI opval = 0;
  4900. CPU (h_xbit) = opval;
  4901. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  4902. }
  4903. {
  4904. BI opval = 0;
  4905. SET_H_INSN_PREFIXED_P (opval);
  4906. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  4907. }
  4908. }
  4909. }
  4910. abuf->written = written;
  4911. #undef FLD
  4912. }
  4913. NEXT (vpc);
  4914. CASE (sem, INSN_MOVEM_M_PC) : /* movem [${Rs}${inc}],${Rd} */
  4915. {
  4916. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  4917. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  4918. #define FLD(f) abuf->fields.sfmt_movem_m_r.f
  4919. int UNUSED written = 0;
  4920. IADDR UNUSED pc = abuf->addr;
  4921. SEM_BRANCH_INIT
  4922. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  4923. {
  4924. SI tmp_addr;
  4925. BI tmp_postinc;
  4926. tmp_postinc = FLD (f_memmode);
  4927. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  4928. {
  4929. {
  4930. USI opval = GETMEMSI (current_cpu, pc, tmp_addr);
  4931. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  4932. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  4933. }
  4934. tmp_addr = ADDSI (tmp_addr, 4);
  4935. {
  4936. SI tmp_tmp;
  4937. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4938. {
  4939. SI opval = tmp_tmp;
  4940. SET_H_GR (((UINT) 14), opval);
  4941. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4942. }
  4943. tmp_addr = ADDSI (tmp_addr, 4);
  4944. }
  4945. {
  4946. SI tmp_tmp;
  4947. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4948. {
  4949. SI opval = tmp_tmp;
  4950. SET_H_GR (((UINT) 13), opval);
  4951. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4952. }
  4953. tmp_addr = ADDSI (tmp_addr, 4);
  4954. }
  4955. {
  4956. SI tmp_tmp;
  4957. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4958. {
  4959. SI opval = tmp_tmp;
  4960. SET_H_GR (((UINT) 12), opval);
  4961. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4962. }
  4963. tmp_addr = ADDSI (tmp_addr, 4);
  4964. }
  4965. {
  4966. SI tmp_tmp;
  4967. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4968. {
  4969. SI opval = tmp_tmp;
  4970. SET_H_GR (((UINT) 11), opval);
  4971. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4972. }
  4973. tmp_addr = ADDSI (tmp_addr, 4);
  4974. }
  4975. {
  4976. SI tmp_tmp;
  4977. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4978. {
  4979. SI opval = tmp_tmp;
  4980. SET_H_GR (((UINT) 10), opval);
  4981. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4982. }
  4983. tmp_addr = ADDSI (tmp_addr, 4);
  4984. }
  4985. {
  4986. SI tmp_tmp;
  4987. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4988. {
  4989. SI opval = tmp_tmp;
  4990. SET_H_GR (((UINT) 9), opval);
  4991. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  4992. }
  4993. tmp_addr = ADDSI (tmp_addr, 4);
  4994. }
  4995. {
  4996. SI tmp_tmp;
  4997. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  4998. {
  4999. SI opval = tmp_tmp;
  5000. SET_H_GR (((UINT) 8), opval);
  5001. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5002. }
  5003. tmp_addr = ADDSI (tmp_addr, 4);
  5004. }
  5005. {
  5006. SI tmp_tmp;
  5007. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5008. {
  5009. SI opval = tmp_tmp;
  5010. SET_H_GR (((UINT) 7), opval);
  5011. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5012. }
  5013. tmp_addr = ADDSI (tmp_addr, 4);
  5014. }
  5015. {
  5016. SI tmp_tmp;
  5017. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5018. {
  5019. SI opval = tmp_tmp;
  5020. SET_H_GR (((UINT) 6), opval);
  5021. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5022. }
  5023. tmp_addr = ADDSI (tmp_addr, 4);
  5024. }
  5025. {
  5026. SI tmp_tmp;
  5027. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5028. {
  5029. SI opval = tmp_tmp;
  5030. SET_H_GR (((UINT) 5), opval);
  5031. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5032. }
  5033. tmp_addr = ADDSI (tmp_addr, 4);
  5034. }
  5035. {
  5036. SI tmp_tmp;
  5037. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5038. {
  5039. SI opval = tmp_tmp;
  5040. SET_H_GR (((UINT) 4), opval);
  5041. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5042. }
  5043. tmp_addr = ADDSI (tmp_addr, 4);
  5044. }
  5045. {
  5046. SI tmp_tmp;
  5047. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5048. {
  5049. SI opval = tmp_tmp;
  5050. SET_H_GR (((UINT) 3), opval);
  5051. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5052. }
  5053. tmp_addr = ADDSI (tmp_addr, 4);
  5054. }
  5055. {
  5056. SI tmp_tmp;
  5057. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5058. {
  5059. SI opval = tmp_tmp;
  5060. SET_H_GR (((UINT) 2), opval);
  5061. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5062. }
  5063. tmp_addr = ADDSI (tmp_addr, 4);
  5064. }
  5065. {
  5066. SI tmp_tmp;
  5067. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5068. {
  5069. SI opval = tmp_tmp;
  5070. SET_H_GR (((UINT) 1), opval);
  5071. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5072. }
  5073. tmp_addr = ADDSI (tmp_addr, 4);
  5074. }
  5075. {
  5076. SI tmp_tmp;
  5077. tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
  5078. {
  5079. SI opval = tmp_tmp;
  5080. SET_H_GR (((UINT) 0), opval);
  5081. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5082. }
  5083. tmp_addr = ADDSI (tmp_addr, 4);
  5084. }
  5085. }
  5086. if (NEBI (tmp_postinc, 0)) {
  5087. {
  5088. SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
  5089. SET_H_GR (FLD (f_operand1), opval);
  5090. written |= (1 << 5);
  5091. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5092. }
  5093. }
  5094. {
  5095. {
  5096. BI opval = 0;
  5097. CPU (h_xbit) = opval;
  5098. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5099. }
  5100. {
  5101. BI opval = 0;
  5102. SET_H_INSN_PREFIXED_P (opval);
  5103. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5104. }
  5105. }
  5106. }
  5107. abuf->written = written;
  5108. SEM_BRANCH_FINI (vpc);
  5109. #undef FLD
  5110. }
  5111. NEXT (vpc);
  5112. CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
  5113. {
  5114. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5115. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5116. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  5117. int UNUSED written = 0;
  5118. IADDR UNUSED pc = abuf->addr;
  5119. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5120. {
  5121. QI tmp_tmpopd;
  5122. QI tmp_tmpops;
  5123. BI tmp_carry;
  5124. QI tmp_newval;
  5125. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  5126. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5127. tmp_carry = CPU (h_cbit);
  5128. tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5129. {
  5130. SI tmp_oldregval;
  5131. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  5132. {
  5133. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  5134. SET_H_GR (FLD (f_operand2), opval);
  5135. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5136. }
  5137. }
  5138. {
  5139. {
  5140. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
  5141. CPU (h_cbit) = opval;
  5142. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5143. }
  5144. {
  5145. BI opval = LTQI (tmp_newval, 0);
  5146. CPU (h_nbit) = opval;
  5147. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5148. }
  5149. {
  5150. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5151. CPU (h_zbit) = opval;
  5152. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5153. }
  5154. {
  5155. BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  5156. CPU (h_vbit) = opval;
  5157. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5158. }
  5159. {
  5160. {
  5161. BI opval = 0;
  5162. CPU (h_xbit) = opval;
  5163. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5164. }
  5165. {
  5166. BI opval = 0;
  5167. SET_H_INSN_PREFIXED_P (opval);
  5168. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5169. }
  5170. }
  5171. }
  5172. }
  5173. #undef FLD
  5174. }
  5175. NEXT (vpc);
  5176. CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
  5177. {
  5178. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5179. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5180. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  5181. int UNUSED written = 0;
  5182. IADDR UNUSED pc = abuf->addr;
  5183. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5184. {
  5185. HI tmp_tmpopd;
  5186. HI tmp_tmpops;
  5187. BI tmp_carry;
  5188. HI tmp_newval;
  5189. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  5190. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5191. tmp_carry = CPU (h_cbit);
  5192. tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5193. {
  5194. SI tmp_oldregval;
  5195. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  5196. {
  5197. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  5198. SET_H_GR (FLD (f_operand2), opval);
  5199. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5200. }
  5201. }
  5202. {
  5203. {
  5204. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
  5205. CPU (h_cbit) = opval;
  5206. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5207. }
  5208. {
  5209. BI opval = LTHI (tmp_newval, 0);
  5210. CPU (h_nbit) = opval;
  5211. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5212. }
  5213. {
  5214. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5215. CPU (h_zbit) = opval;
  5216. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5217. }
  5218. {
  5219. BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  5220. CPU (h_vbit) = opval;
  5221. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5222. }
  5223. {
  5224. {
  5225. BI opval = 0;
  5226. CPU (h_xbit) = opval;
  5227. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5228. }
  5229. {
  5230. BI opval = 0;
  5231. SET_H_INSN_PREFIXED_P (opval);
  5232. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5233. }
  5234. }
  5235. }
  5236. }
  5237. #undef FLD
  5238. }
  5239. NEXT (vpc);
  5240. CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
  5241. {
  5242. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5243. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5244. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  5245. int UNUSED written = 0;
  5246. IADDR UNUSED pc = abuf->addr;
  5247. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5248. {
  5249. SI tmp_tmpopd;
  5250. SI tmp_tmpops;
  5251. BI tmp_carry;
  5252. SI tmp_newval;
  5253. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  5254. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5255. tmp_carry = CPU (h_cbit);
  5256. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5257. {
  5258. SI opval = tmp_newval;
  5259. SET_H_GR (FLD (f_operand2), opval);
  5260. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5261. }
  5262. {
  5263. {
  5264. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5265. CPU (h_cbit) = opval;
  5266. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5267. }
  5268. {
  5269. BI opval = LTSI (tmp_newval, 0);
  5270. CPU (h_nbit) = opval;
  5271. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5272. }
  5273. {
  5274. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5275. CPU (h_zbit) = opval;
  5276. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5277. }
  5278. {
  5279. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5280. CPU (h_vbit) = opval;
  5281. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5282. }
  5283. {
  5284. {
  5285. BI opval = 0;
  5286. CPU (h_xbit) = opval;
  5287. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5288. }
  5289. {
  5290. BI opval = 0;
  5291. SET_H_INSN_PREFIXED_P (opval);
  5292. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5293. }
  5294. }
  5295. }
  5296. }
  5297. #undef FLD
  5298. }
  5299. NEXT (vpc);
  5300. CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
  5301. {
  5302. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5303. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5304. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  5305. int UNUSED written = 0;
  5306. IADDR UNUSED pc = abuf->addr;
  5307. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5308. {
  5309. QI tmp_tmpopd;
  5310. QI tmp_tmpops;
  5311. BI tmp_carry;
  5312. QI tmp_newval;
  5313. tmp_tmpops = ({ SI tmp_addr;
  5314. QI tmp_tmp_mem;
  5315. BI tmp_postinc;
  5316. tmp_postinc = FLD (f_memmode);
  5317. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  5318. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  5319. ; if (NEBI (tmp_postinc, 0)) {
  5320. {
  5321. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  5322. tmp_addr = ADDSI (tmp_addr, 1);
  5323. }
  5324. {
  5325. SI opval = tmp_addr;
  5326. SET_H_GR (FLD (f_operand1), opval);
  5327. written |= (1 << 12);
  5328. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5329. }
  5330. }
  5331. }
  5332. ; tmp_tmp_mem; });
  5333. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5334. tmp_carry = CPU (h_cbit);
  5335. tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5336. {
  5337. SI tmp_oldregval;
  5338. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  5339. {
  5340. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  5341. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  5342. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5343. }
  5344. }
  5345. {
  5346. {
  5347. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
  5348. CPU (h_cbit) = opval;
  5349. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5350. }
  5351. {
  5352. BI opval = LTQI (tmp_newval, 0);
  5353. CPU (h_nbit) = opval;
  5354. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5355. }
  5356. {
  5357. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5358. CPU (h_zbit) = opval;
  5359. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5360. }
  5361. {
  5362. BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  5363. CPU (h_vbit) = opval;
  5364. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5365. }
  5366. {
  5367. {
  5368. BI opval = 0;
  5369. CPU (h_xbit) = opval;
  5370. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5371. }
  5372. {
  5373. BI opval = 0;
  5374. SET_H_INSN_PREFIXED_P (opval);
  5375. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5376. }
  5377. }
  5378. }
  5379. }
  5380. abuf->written = written;
  5381. #undef FLD
  5382. }
  5383. NEXT (vpc);
  5384. CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
  5385. {
  5386. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5387. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5388. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  5389. int UNUSED written = 0;
  5390. IADDR UNUSED pc = abuf->addr;
  5391. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5392. {
  5393. HI tmp_tmpopd;
  5394. HI tmp_tmpops;
  5395. BI tmp_carry;
  5396. HI tmp_newval;
  5397. tmp_tmpops = ({ SI tmp_addr;
  5398. HI tmp_tmp_mem;
  5399. BI tmp_postinc;
  5400. tmp_postinc = FLD (f_memmode);
  5401. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  5402. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  5403. ; if (NEBI (tmp_postinc, 0)) {
  5404. {
  5405. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  5406. tmp_addr = ADDSI (tmp_addr, 2);
  5407. }
  5408. {
  5409. SI opval = tmp_addr;
  5410. SET_H_GR (FLD (f_operand1), opval);
  5411. written |= (1 << 12);
  5412. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5413. }
  5414. }
  5415. }
  5416. ; tmp_tmp_mem; });
  5417. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5418. tmp_carry = CPU (h_cbit);
  5419. tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5420. {
  5421. SI tmp_oldregval;
  5422. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  5423. {
  5424. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  5425. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  5426. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5427. }
  5428. }
  5429. {
  5430. {
  5431. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
  5432. CPU (h_cbit) = opval;
  5433. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5434. }
  5435. {
  5436. BI opval = LTHI (tmp_newval, 0);
  5437. CPU (h_nbit) = opval;
  5438. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5439. }
  5440. {
  5441. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5442. CPU (h_zbit) = opval;
  5443. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5444. }
  5445. {
  5446. BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  5447. CPU (h_vbit) = opval;
  5448. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5449. }
  5450. {
  5451. {
  5452. BI opval = 0;
  5453. CPU (h_xbit) = opval;
  5454. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5455. }
  5456. {
  5457. BI opval = 0;
  5458. SET_H_INSN_PREFIXED_P (opval);
  5459. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5460. }
  5461. }
  5462. }
  5463. }
  5464. abuf->written = written;
  5465. #undef FLD
  5466. }
  5467. NEXT (vpc);
  5468. CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
  5469. {
  5470. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5471. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5472. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  5473. int UNUSED written = 0;
  5474. IADDR UNUSED pc = abuf->addr;
  5475. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5476. {
  5477. SI tmp_tmpopd;
  5478. SI tmp_tmpops;
  5479. BI tmp_carry;
  5480. SI tmp_newval;
  5481. tmp_tmpops = ({ SI tmp_addr;
  5482. SI tmp_tmp_mem;
  5483. BI tmp_postinc;
  5484. tmp_postinc = FLD (f_memmode);
  5485. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  5486. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  5487. ; if (NEBI (tmp_postinc, 0)) {
  5488. {
  5489. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  5490. tmp_addr = ADDSI (tmp_addr, 4);
  5491. }
  5492. {
  5493. SI opval = tmp_addr;
  5494. SET_H_GR (FLD (f_operand1), opval);
  5495. written |= (1 << 11);
  5496. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5497. }
  5498. }
  5499. }
  5500. ; tmp_tmp_mem; });
  5501. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5502. tmp_carry = CPU (h_cbit);
  5503. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5504. {
  5505. SI opval = tmp_newval;
  5506. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  5507. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5508. }
  5509. {
  5510. {
  5511. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5512. CPU (h_cbit) = opval;
  5513. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5514. }
  5515. {
  5516. BI opval = LTSI (tmp_newval, 0);
  5517. CPU (h_nbit) = opval;
  5518. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5519. }
  5520. {
  5521. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5522. CPU (h_zbit) = opval;
  5523. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5524. }
  5525. {
  5526. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5527. CPU (h_vbit) = opval;
  5528. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5529. }
  5530. {
  5531. {
  5532. BI opval = 0;
  5533. CPU (h_xbit) = opval;
  5534. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5535. }
  5536. {
  5537. BI opval = 0;
  5538. SET_H_INSN_PREFIXED_P (opval);
  5539. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5540. }
  5541. }
  5542. }
  5543. }
  5544. abuf->written = written;
  5545. #undef FLD
  5546. }
  5547. NEXT (vpc);
  5548. CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
  5549. {
  5550. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5551. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5552. #define FLD(f) abuf->fields.sfmt_addcbr.f
  5553. int UNUSED written = 0;
  5554. IADDR UNUSED pc = abuf->addr;
  5555. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  5556. {
  5557. QI tmp_tmpopd;
  5558. QI tmp_tmpops;
  5559. BI tmp_carry;
  5560. QI tmp_newval;
  5561. tmp_tmpops = FLD (f_indir_pc__byte);
  5562. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5563. tmp_carry = CPU (h_cbit);
  5564. tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5565. {
  5566. SI tmp_oldregval;
  5567. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  5568. {
  5569. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  5570. SET_H_GR (FLD (f_operand2), opval);
  5571. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5572. }
  5573. }
  5574. {
  5575. {
  5576. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
  5577. CPU (h_cbit) = opval;
  5578. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5579. }
  5580. {
  5581. BI opval = LTQI (tmp_newval, 0);
  5582. CPU (h_nbit) = opval;
  5583. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5584. }
  5585. {
  5586. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5587. CPU (h_zbit) = opval;
  5588. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5589. }
  5590. {
  5591. BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  5592. CPU (h_vbit) = opval;
  5593. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5594. }
  5595. {
  5596. {
  5597. BI opval = 0;
  5598. CPU (h_xbit) = opval;
  5599. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5600. }
  5601. {
  5602. BI opval = 0;
  5603. SET_H_INSN_PREFIXED_P (opval);
  5604. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5605. }
  5606. }
  5607. }
  5608. }
  5609. #undef FLD
  5610. }
  5611. NEXT (vpc);
  5612. CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
  5613. {
  5614. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5615. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5616. #define FLD(f) abuf->fields.sfmt_addcwr.f
  5617. int UNUSED written = 0;
  5618. IADDR UNUSED pc = abuf->addr;
  5619. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  5620. {
  5621. HI tmp_tmpopd;
  5622. HI tmp_tmpops;
  5623. BI tmp_carry;
  5624. HI tmp_newval;
  5625. tmp_tmpops = FLD (f_indir_pc__word);
  5626. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5627. tmp_carry = CPU (h_cbit);
  5628. tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5629. {
  5630. SI tmp_oldregval;
  5631. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  5632. {
  5633. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  5634. SET_H_GR (FLD (f_operand2), opval);
  5635. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5636. }
  5637. }
  5638. {
  5639. {
  5640. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
  5641. CPU (h_cbit) = opval;
  5642. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5643. }
  5644. {
  5645. BI opval = LTHI (tmp_newval, 0);
  5646. CPU (h_nbit) = opval;
  5647. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5648. }
  5649. {
  5650. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5651. CPU (h_zbit) = opval;
  5652. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5653. }
  5654. {
  5655. BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  5656. CPU (h_vbit) = opval;
  5657. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5658. }
  5659. {
  5660. {
  5661. BI opval = 0;
  5662. CPU (h_xbit) = opval;
  5663. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5664. }
  5665. {
  5666. BI opval = 0;
  5667. SET_H_INSN_PREFIXED_P (opval);
  5668. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5669. }
  5670. }
  5671. }
  5672. }
  5673. #undef FLD
  5674. }
  5675. NEXT (vpc);
  5676. CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
  5677. {
  5678. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5679. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5680. #define FLD(f) abuf->fields.sfmt_addcdr.f
  5681. int UNUSED written = 0;
  5682. IADDR UNUSED pc = abuf->addr;
  5683. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  5684. {
  5685. SI tmp_tmpopd;
  5686. SI tmp_tmpops;
  5687. BI tmp_carry;
  5688. SI tmp_newval;
  5689. tmp_tmpops = FLD (f_indir_pc__dword);
  5690. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5691. tmp_carry = CPU (h_cbit);
  5692. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5693. {
  5694. SI opval = tmp_newval;
  5695. SET_H_GR (FLD (f_operand2), opval);
  5696. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5697. }
  5698. {
  5699. {
  5700. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5701. CPU (h_cbit) = opval;
  5702. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5703. }
  5704. {
  5705. BI opval = LTSI (tmp_newval, 0);
  5706. CPU (h_nbit) = opval;
  5707. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5708. }
  5709. {
  5710. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5711. CPU (h_zbit) = opval;
  5712. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5713. }
  5714. {
  5715. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5716. CPU (h_vbit) = opval;
  5717. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5718. }
  5719. {
  5720. {
  5721. BI opval = 0;
  5722. CPU (h_xbit) = opval;
  5723. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5724. }
  5725. {
  5726. BI opval = 0;
  5727. SET_H_INSN_PREFIXED_P (opval);
  5728. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5729. }
  5730. }
  5731. }
  5732. }
  5733. #undef FLD
  5734. }
  5735. NEXT (vpc);
  5736. CASE (sem, INSN_ADDCPC) : /* add.d ${sconst32},PC */
  5737. {
  5738. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5739. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5740. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  5741. int UNUSED written = 0;
  5742. IADDR UNUSED pc = abuf->addr;
  5743. SEM_BRANCH_INIT
  5744. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  5745. {
  5746. SI tmp_newpc;
  5747. SI tmp_oldpc;
  5748. SI tmp_offs;
  5749. tmp_offs = FLD (f_indir_pc__dword);
  5750. tmp_oldpc = ADDSI (pc, 6);
  5751. tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
  5752. {
  5753. USI opval = tmp_newpc;
  5754. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  5755. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  5756. }
  5757. {
  5758. {
  5759. BI opval = ORIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (tmp_offs, 0), GESI (tmp_newpc, 0))));
  5760. CPU (h_cbit) = opval;
  5761. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5762. }
  5763. {
  5764. BI opval = LTSI (tmp_newpc, 0);
  5765. CPU (h_nbit) = opval;
  5766. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5767. }
  5768. {
  5769. BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5770. CPU (h_zbit) = opval;
  5771. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5772. }
  5773. {
  5774. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (tmp_offs, 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
  5775. CPU (h_vbit) = opval;
  5776. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5777. }
  5778. {
  5779. {
  5780. BI opval = 0;
  5781. CPU (h_xbit) = opval;
  5782. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5783. }
  5784. {
  5785. BI opval = 0;
  5786. SET_H_INSN_PREFIXED_P (opval);
  5787. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5788. }
  5789. }
  5790. }
  5791. }
  5792. SEM_BRANCH_FINI (vpc);
  5793. #undef FLD
  5794. }
  5795. NEXT (vpc);
  5796. CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
  5797. {
  5798. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5799. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5800. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  5801. int UNUSED written = 0;
  5802. IADDR UNUSED pc = abuf->addr;
  5803. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5804. {
  5805. SI tmp_tmpopd;
  5806. SI tmp_tmpops;
  5807. BI tmp_carry;
  5808. SI tmp_newval;
  5809. tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  5810. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5811. tmp_carry = CPU (h_cbit);
  5812. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5813. {
  5814. SI opval = tmp_newval;
  5815. SET_H_GR (FLD (f_operand2), opval);
  5816. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5817. }
  5818. {
  5819. {
  5820. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5821. CPU (h_cbit) = opval;
  5822. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5823. }
  5824. {
  5825. BI opval = LTSI (tmp_newval, 0);
  5826. CPU (h_nbit) = opval;
  5827. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5828. }
  5829. {
  5830. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5831. CPU (h_zbit) = opval;
  5832. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5833. }
  5834. {
  5835. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5836. CPU (h_vbit) = opval;
  5837. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5838. }
  5839. {
  5840. {
  5841. BI opval = 0;
  5842. CPU (h_xbit) = opval;
  5843. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5844. }
  5845. {
  5846. BI opval = 0;
  5847. SET_H_INSN_PREFIXED_P (opval);
  5848. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5849. }
  5850. }
  5851. }
  5852. }
  5853. #undef FLD
  5854. }
  5855. NEXT (vpc);
  5856. CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
  5857. {
  5858. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5859. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5860. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  5861. int UNUSED written = 0;
  5862. IADDR UNUSED pc = abuf->addr;
  5863. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5864. {
  5865. SI tmp_tmpopd;
  5866. SI tmp_tmpops;
  5867. BI tmp_carry;
  5868. SI tmp_newval;
  5869. tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  5870. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5871. tmp_carry = CPU (h_cbit);
  5872. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5873. {
  5874. SI opval = tmp_newval;
  5875. SET_H_GR (FLD (f_operand2), opval);
  5876. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5877. }
  5878. {
  5879. {
  5880. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5881. CPU (h_cbit) = opval;
  5882. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5883. }
  5884. {
  5885. BI opval = LTSI (tmp_newval, 0);
  5886. CPU (h_nbit) = opval;
  5887. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5888. }
  5889. {
  5890. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5891. CPU (h_zbit) = opval;
  5892. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5893. }
  5894. {
  5895. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5896. CPU (h_vbit) = opval;
  5897. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5898. }
  5899. {
  5900. {
  5901. BI opval = 0;
  5902. CPU (h_xbit) = opval;
  5903. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5904. }
  5905. {
  5906. BI opval = 0;
  5907. SET_H_INSN_PREFIXED_P (opval);
  5908. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5909. }
  5910. }
  5911. }
  5912. }
  5913. #undef FLD
  5914. }
  5915. NEXT (vpc);
  5916. CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
  5917. {
  5918. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5919. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  5920. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  5921. int UNUSED written = 0;
  5922. IADDR UNUSED pc = abuf->addr;
  5923. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  5924. {
  5925. SI tmp_tmpopd;
  5926. SI tmp_tmpops;
  5927. BI tmp_carry;
  5928. SI tmp_newval;
  5929. tmp_tmpops = EXTQISI (({ SI tmp_addr;
  5930. QI tmp_tmp_mem;
  5931. BI tmp_postinc;
  5932. tmp_postinc = FLD (f_memmode);
  5933. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  5934. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  5935. ; if (NEBI (tmp_postinc, 0)) {
  5936. {
  5937. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  5938. tmp_addr = ADDSI (tmp_addr, 1);
  5939. }
  5940. {
  5941. SI opval = tmp_addr;
  5942. SET_H_GR (FLD (f_operand1), opval);
  5943. written |= (1 << 11);
  5944. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5945. }
  5946. }
  5947. }
  5948. ; tmp_tmp_mem; }));
  5949. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  5950. tmp_carry = CPU (h_cbit);
  5951. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  5952. {
  5953. SI opval = tmp_newval;
  5954. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  5955. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  5956. }
  5957. {
  5958. {
  5959. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  5960. CPU (h_cbit) = opval;
  5961. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  5962. }
  5963. {
  5964. BI opval = LTSI (tmp_newval, 0);
  5965. CPU (h_nbit) = opval;
  5966. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  5967. }
  5968. {
  5969. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  5970. CPU (h_zbit) = opval;
  5971. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  5972. }
  5973. {
  5974. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  5975. CPU (h_vbit) = opval;
  5976. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  5977. }
  5978. {
  5979. {
  5980. BI opval = 0;
  5981. CPU (h_xbit) = opval;
  5982. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  5983. }
  5984. {
  5985. BI opval = 0;
  5986. SET_H_INSN_PREFIXED_P (opval);
  5987. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  5988. }
  5989. }
  5990. }
  5991. }
  5992. abuf->written = written;
  5993. #undef FLD
  5994. }
  5995. NEXT (vpc);
  5996. CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
  5997. {
  5998. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  5999. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6000. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  6001. int UNUSED written = 0;
  6002. IADDR UNUSED pc = abuf->addr;
  6003. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6004. {
  6005. SI tmp_tmpopd;
  6006. SI tmp_tmpops;
  6007. BI tmp_carry;
  6008. SI tmp_newval;
  6009. tmp_tmpops = EXTHISI (({ SI tmp_addr;
  6010. HI tmp_tmp_mem;
  6011. BI tmp_postinc;
  6012. tmp_postinc = FLD (f_memmode);
  6013. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  6014. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  6015. ; if (NEBI (tmp_postinc, 0)) {
  6016. {
  6017. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  6018. tmp_addr = ADDSI (tmp_addr, 2);
  6019. }
  6020. {
  6021. SI opval = tmp_addr;
  6022. SET_H_GR (FLD (f_operand1), opval);
  6023. written |= (1 << 11);
  6024. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6025. }
  6026. }
  6027. }
  6028. ; tmp_tmp_mem; }));
  6029. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6030. tmp_carry = CPU (h_cbit);
  6031. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6032. {
  6033. SI opval = tmp_newval;
  6034. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  6035. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6036. }
  6037. {
  6038. {
  6039. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6040. CPU (h_cbit) = opval;
  6041. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6042. }
  6043. {
  6044. BI opval = LTSI (tmp_newval, 0);
  6045. CPU (h_nbit) = opval;
  6046. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6047. }
  6048. {
  6049. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6050. CPU (h_zbit) = opval;
  6051. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6052. }
  6053. {
  6054. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6055. CPU (h_vbit) = opval;
  6056. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6057. }
  6058. {
  6059. {
  6060. BI opval = 0;
  6061. CPU (h_xbit) = opval;
  6062. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6063. }
  6064. {
  6065. BI opval = 0;
  6066. SET_H_INSN_PREFIXED_P (opval);
  6067. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6068. }
  6069. }
  6070. }
  6071. }
  6072. abuf->written = written;
  6073. #undef FLD
  6074. }
  6075. NEXT (vpc);
  6076. CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
  6077. {
  6078. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6079. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6080. #define FLD(f) abuf->fields.sfmt_addcbr.f
  6081. int UNUSED written = 0;
  6082. IADDR UNUSED pc = abuf->addr;
  6083. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  6084. {
  6085. SI tmp_tmpopd;
  6086. SI tmp_tmpops;
  6087. BI tmp_carry;
  6088. SI tmp_newval;
  6089. tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  6090. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6091. tmp_carry = CPU (h_cbit);
  6092. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6093. {
  6094. SI opval = tmp_newval;
  6095. SET_H_GR (FLD (f_operand2), opval);
  6096. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6097. }
  6098. {
  6099. {
  6100. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6101. CPU (h_cbit) = opval;
  6102. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6103. }
  6104. {
  6105. BI opval = LTSI (tmp_newval, 0);
  6106. CPU (h_nbit) = opval;
  6107. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6108. }
  6109. {
  6110. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6111. CPU (h_zbit) = opval;
  6112. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6113. }
  6114. {
  6115. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6116. CPU (h_vbit) = opval;
  6117. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6118. }
  6119. {
  6120. {
  6121. BI opval = 0;
  6122. CPU (h_xbit) = opval;
  6123. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6124. }
  6125. {
  6126. BI opval = 0;
  6127. SET_H_INSN_PREFIXED_P (opval);
  6128. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6129. }
  6130. }
  6131. }
  6132. }
  6133. #undef FLD
  6134. }
  6135. NEXT (vpc);
  6136. CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
  6137. {
  6138. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6139. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6140. #define FLD(f) abuf->fields.sfmt_addcwr.f
  6141. int UNUSED written = 0;
  6142. IADDR UNUSED pc = abuf->addr;
  6143. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  6144. {
  6145. SI tmp_tmpopd;
  6146. SI tmp_tmpops;
  6147. BI tmp_carry;
  6148. SI tmp_newval;
  6149. tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  6150. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6151. tmp_carry = CPU (h_cbit);
  6152. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6153. {
  6154. SI opval = tmp_newval;
  6155. SET_H_GR (FLD (f_operand2), opval);
  6156. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6157. }
  6158. {
  6159. {
  6160. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6161. CPU (h_cbit) = opval;
  6162. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6163. }
  6164. {
  6165. BI opval = LTSI (tmp_newval, 0);
  6166. CPU (h_nbit) = opval;
  6167. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6168. }
  6169. {
  6170. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6171. CPU (h_zbit) = opval;
  6172. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6173. }
  6174. {
  6175. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6176. CPU (h_vbit) = opval;
  6177. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6178. }
  6179. {
  6180. {
  6181. BI opval = 0;
  6182. CPU (h_xbit) = opval;
  6183. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6184. }
  6185. {
  6186. BI opval = 0;
  6187. SET_H_INSN_PREFIXED_P (opval);
  6188. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6189. }
  6190. }
  6191. }
  6192. }
  6193. #undef FLD
  6194. }
  6195. NEXT (vpc);
  6196. CASE (sem, INSN_ADDSPCPC) : /* adds.w [PC],PC */
  6197. {
  6198. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6199. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6200. #define FLD(f) abuf->fields.sfmt_empty.f
  6201. int UNUSED written = 0;
  6202. IADDR UNUSED pc = abuf->addr;
  6203. SEM_BRANCH_INIT
  6204. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6205. {
  6206. SI tmp_newpc;
  6207. SI tmp_oldpc;
  6208. HI tmp_offs;
  6209. if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
  6210. cgen_rtx_error (current_cpu, "Unexpected adds.w [PC],PC without prefix");
  6211. }
  6212. tmp_offs = GETMEMHI (current_cpu, pc, CPU (h_prefixreg_pre_v32));
  6213. tmp_oldpc = ADDSI (pc, 2);
  6214. tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
  6215. {
  6216. USI opval = tmp_newpc;
  6217. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  6218. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  6219. }
  6220. {
  6221. {
  6222. BI opval = ORIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (EXTHISI (tmp_offs), 0), GESI (tmp_newpc, 0))));
  6223. CPU (h_cbit) = opval;
  6224. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6225. }
  6226. {
  6227. BI opval = LTSI (tmp_newpc, 0);
  6228. CPU (h_nbit) = opval;
  6229. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6230. }
  6231. {
  6232. BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6233. CPU (h_zbit) = opval;
  6234. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6235. }
  6236. {
  6237. BI opval = ORIF (ANDIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (EXTHISI (tmp_offs), 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
  6238. CPU (h_vbit) = opval;
  6239. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6240. }
  6241. {
  6242. {
  6243. BI opval = 0;
  6244. CPU (h_xbit) = opval;
  6245. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6246. }
  6247. {
  6248. BI opval = 0;
  6249. SET_H_INSN_PREFIXED_P (opval);
  6250. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6251. }
  6252. }
  6253. }
  6254. }
  6255. SEM_BRANCH_FINI (vpc);
  6256. #undef FLD
  6257. }
  6258. NEXT (vpc);
  6259. CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
  6260. {
  6261. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6262. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6263. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  6264. int UNUSED written = 0;
  6265. IADDR UNUSED pc = abuf->addr;
  6266. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6267. {
  6268. SI tmp_tmpopd;
  6269. SI tmp_tmpops;
  6270. BI tmp_carry;
  6271. SI tmp_newval;
  6272. tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  6273. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6274. tmp_carry = CPU (h_cbit);
  6275. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6276. {
  6277. SI opval = tmp_newval;
  6278. SET_H_GR (FLD (f_operand2), opval);
  6279. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6280. }
  6281. {
  6282. {
  6283. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6284. CPU (h_cbit) = opval;
  6285. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6286. }
  6287. {
  6288. BI opval = LTSI (tmp_newval, 0);
  6289. CPU (h_nbit) = opval;
  6290. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6291. }
  6292. {
  6293. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6294. CPU (h_zbit) = opval;
  6295. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6296. }
  6297. {
  6298. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6299. CPU (h_vbit) = opval;
  6300. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6301. }
  6302. {
  6303. {
  6304. BI opval = 0;
  6305. CPU (h_xbit) = opval;
  6306. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6307. }
  6308. {
  6309. BI opval = 0;
  6310. SET_H_INSN_PREFIXED_P (opval);
  6311. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6312. }
  6313. }
  6314. }
  6315. }
  6316. #undef FLD
  6317. }
  6318. NEXT (vpc);
  6319. CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
  6320. {
  6321. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6322. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6323. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  6324. int UNUSED written = 0;
  6325. IADDR UNUSED pc = abuf->addr;
  6326. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6327. {
  6328. SI tmp_tmpopd;
  6329. SI tmp_tmpops;
  6330. BI tmp_carry;
  6331. SI tmp_newval;
  6332. tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  6333. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6334. tmp_carry = CPU (h_cbit);
  6335. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6336. {
  6337. SI opval = tmp_newval;
  6338. SET_H_GR (FLD (f_operand2), opval);
  6339. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6340. }
  6341. {
  6342. {
  6343. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6344. CPU (h_cbit) = opval;
  6345. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6346. }
  6347. {
  6348. BI opval = LTSI (tmp_newval, 0);
  6349. CPU (h_nbit) = opval;
  6350. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6351. }
  6352. {
  6353. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6354. CPU (h_zbit) = opval;
  6355. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6356. }
  6357. {
  6358. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6359. CPU (h_vbit) = opval;
  6360. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6361. }
  6362. {
  6363. {
  6364. BI opval = 0;
  6365. CPU (h_xbit) = opval;
  6366. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6367. }
  6368. {
  6369. BI opval = 0;
  6370. SET_H_INSN_PREFIXED_P (opval);
  6371. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6372. }
  6373. }
  6374. }
  6375. }
  6376. #undef FLD
  6377. }
  6378. NEXT (vpc);
  6379. CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
  6380. {
  6381. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6382. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6383. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  6384. int UNUSED written = 0;
  6385. IADDR UNUSED pc = abuf->addr;
  6386. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6387. {
  6388. SI tmp_tmpopd;
  6389. SI tmp_tmpops;
  6390. BI tmp_carry;
  6391. SI tmp_newval;
  6392. tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
  6393. QI tmp_tmp_mem;
  6394. BI tmp_postinc;
  6395. tmp_postinc = FLD (f_memmode);
  6396. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  6397. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  6398. ; if (NEBI (tmp_postinc, 0)) {
  6399. {
  6400. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  6401. tmp_addr = ADDSI (tmp_addr, 1);
  6402. }
  6403. {
  6404. SI opval = tmp_addr;
  6405. SET_H_GR (FLD (f_operand1), opval);
  6406. written |= (1 << 11);
  6407. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6408. }
  6409. }
  6410. }
  6411. ; tmp_tmp_mem; }));
  6412. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6413. tmp_carry = CPU (h_cbit);
  6414. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6415. {
  6416. SI opval = tmp_newval;
  6417. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  6418. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6419. }
  6420. {
  6421. {
  6422. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6423. CPU (h_cbit) = opval;
  6424. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6425. }
  6426. {
  6427. BI opval = LTSI (tmp_newval, 0);
  6428. CPU (h_nbit) = opval;
  6429. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6430. }
  6431. {
  6432. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6433. CPU (h_zbit) = opval;
  6434. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6435. }
  6436. {
  6437. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6438. CPU (h_vbit) = opval;
  6439. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6440. }
  6441. {
  6442. {
  6443. BI opval = 0;
  6444. CPU (h_xbit) = opval;
  6445. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6446. }
  6447. {
  6448. BI opval = 0;
  6449. SET_H_INSN_PREFIXED_P (opval);
  6450. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6451. }
  6452. }
  6453. }
  6454. }
  6455. abuf->written = written;
  6456. #undef FLD
  6457. }
  6458. NEXT (vpc);
  6459. CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
  6460. {
  6461. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6462. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6463. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  6464. int UNUSED written = 0;
  6465. IADDR UNUSED pc = abuf->addr;
  6466. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6467. {
  6468. SI tmp_tmpopd;
  6469. SI tmp_tmpops;
  6470. BI tmp_carry;
  6471. SI tmp_newval;
  6472. tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
  6473. HI tmp_tmp_mem;
  6474. BI tmp_postinc;
  6475. tmp_postinc = FLD (f_memmode);
  6476. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  6477. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  6478. ; if (NEBI (tmp_postinc, 0)) {
  6479. {
  6480. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  6481. tmp_addr = ADDSI (tmp_addr, 2);
  6482. }
  6483. {
  6484. SI opval = tmp_addr;
  6485. SET_H_GR (FLD (f_operand1), opval);
  6486. written |= (1 << 11);
  6487. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6488. }
  6489. }
  6490. }
  6491. ; tmp_tmp_mem; }));
  6492. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6493. tmp_carry = CPU (h_cbit);
  6494. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6495. {
  6496. SI opval = tmp_newval;
  6497. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  6498. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6499. }
  6500. {
  6501. {
  6502. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6503. CPU (h_cbit) = opval;
  6504. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6505. }
  6506. {
  6507. BI opval = LTSI (tmp_newval, 0);
  6508. CPU (h_nbit) = opval;
  6509. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6510. }
  6511. {
  6512. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6513. CPU (h_zbit) = opval;
  6514. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6515. }
  6516. {
  6517. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6518. CPU (h_vbit) = opval;
  6519. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6520. }
  6521. {
  6522. {
  6523. BI opval = 0;
  6524. CPU (h_xbit) = opval;
  6525. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6526. }
  6527. {
  6528. BI opval = 0;
  6529. SET_H_INSN_PREFIXED_P (opval);
  6530. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6531. }
  6532. }
  6533. }
  6534. }
  6535. abuf->written = written;
  6536. #undef FLD
  6537. }
  6538. NEXT (vpc);
  6539. CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
  6540. {
  6541. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6542. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6543. #define FLD(f) abuf->fields.sfmt_addcbr.f
  6544. int UNUSED written = 0;
  6545. IADDR UNUSED pc = abuf->addr;
  6546. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  6547. {
  6548. SI tmp_tmpopd;
  6549. SI tmp_tmpops;
  6550. BI tmp_carry;
  6551. SI tmp_newval;
  6552. tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  6553. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6554. tmp_carry = CPU (h_cbit);
  6555. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6556. {
  6557. SI opval = tmp_newval;
  6558. SET_H_GR (FLD (f_operand2), opval);
  6559. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6560. }
  6561. {
  6562. {
  6563. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6564. CPU (h_cbit) = opval;
  6565. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6566. }
  6567. {
  6568. BI opval = LTSI (tmp_newval, 0);
  6569. CPU (h_nbit) = opval;
  6570. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6571. }
  6572. {
  6573. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6574. CPU (h_zbit) = opval;
  6575. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6576. }
  6577. {
  6578. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6579. CPU (h_vbit) = opval;
  6580. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6581. }
  6582. {
  6583. {
  6584. BI opval = 0;
  6585. CPU (h_xbit) = opval;
  6586. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6587. }
  6588. {
  6589. BI opval = 0;
  6590. SET_H_INSN_PREFIXED_P (opval);
  6591. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6592. }
  6593. }
  6594. }
  6595. }
  6596. #undef FLD
  6597. }
  6598. NEXT (vpc);
  6599. CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
  6600. {
  6601. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6602. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6603. #define FLD(f) abuf->fields.sfmt_addcwr.f
  6604. int UNUSED written = 0;
  6605. IADDR UNUSED pc = abuf->addr;
  6606. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  6607. {
  6608. SI tmp_tmpopd;
  6609. SI tmp_tmpops;
  6610. BI tmp_carry;
  6611. SI tmp_newval;
  6612. tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  6613. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6614. tmp_carry = CPU (h_cbit);
  6615. tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6616. {
  6617. SI opval = tmp_newval;
  6618. SET_H_GR (FLD (f_operand2), opval);
  6619. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6620. }
  6621. {
  6622. {
  6623. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
  6624. CPU (h_cbit) = opval;
  6625. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6626. }
  6627. {
  6628. BI opval = LTSI (tmp_newval, 0);
  6629. CPU (h_nbit) = opval;
  6630. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6631. }
  6632. {
  6633. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6634. CPU (h_zbit) = opval;
  6635. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6636. }
  6637. {
  6638. BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6639. CPU (h_vbit) = opval;
  6640. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6641. }
  6642. {
  6643. {
  6644. BI opval = 0;
  6645. CPU (h_xbit) = opval;
  6646. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6647. }
  6648. {
  6649. BI opval = 0;
  6650. SET_H_INSN_PREFIXED_P (opval);
  6651. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6652. }
  6653. }
  6654. }
  6655. }
  6656. #undef FLD
  6657. }
  6658. NEXT (vpc);
  6659. CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
  6660. {
  6661. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6662. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6663. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  6664. int UNUSED written = 0;
  6665. IADDR UNUSED pc = abuf->addr;
  6666. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6667. {
  6668. QI tmp_tmpopd;
  6669. QI tmp_tmpops;
  6670. BI tmp_carry;
  6671. QI tmp_newval;
  6672. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  6673. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6674. tmp_carry = CPU (h_cbit);
  6675. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6676. {
  6677. SI tmp_oldregval;
  6678. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  6679. {
  6680. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  6681. SET_H_GR (FLD (f_operand2), opval);
  6682. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6683. }
  6684. }
  6685. {
  6686. {
  6687. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  6688. CPU (h_cbit) = opval;
  6689. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6690. }
  6691. {
  6692. BI opval = LTQI (tmp_newval, 0);
  6693. CPU (h_nbit) = opval;
  6694. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6695. }
  6696. {
  6697. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6698. CPU (h_zbit) = opval;
  6699. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6700. }
  6701. {
  6702. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  6703. CPU (h_vbit) = opval;
  6704. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6705. }
  6706. {
  6707. {
  6708. BI opval = 0;
  6709. CPU (h_xbit) = opval;
  6710. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6711. }
  6712. {
  6713. BI opval = 0;
  6714. SET_H_INSN_PREFIXED_P (opval);
  6715. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6716. }
  6717. }
  6718. }
  6719. }
  6720. #undef FLD
  6721. }
  6722. NEXT (vpc);
  6723. CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
  6724. {
  6725. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6726. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6727. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  6728. int UNUSED written = 0;
  6729. IADDR UNUSED pc = abuf->addr;
  6730. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6731. {
  6732. HI tmp_tmpopd;
  6733. HI tmp_tmpops;
  6734. BI tmp_carry;
  6735. HI tmp_newval;
  6736. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  6737. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6738. tmp_carry = CPU (h_cbit);
  6739. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6740. {
  6741. SI tmp_oldregval;
  6742. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  6743. {
  6744. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  6745. SET_H_GR (FLD (f_operand2), opval);
  6746. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6747. }
  6748. }
  6749. {
  6750. {
  6751. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  6752. CPU (h_cbit) = opval;
  6753. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6754. }
  6755. {
  6756. BI opval = LTHI (tmp_newval, 0);
  6757. CPU (h_nbit) = opval;
  6758. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6759. }
  6760. {
  6761. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6762. CPU (h_zbit) = opval;
  6763. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6764. }
  6765. {
  6766. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  6767. CPU (h_vbit) = opval;
  6768. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6769. }
  6770. {
  6771. {
  6772. BI opval = 0;
  6773. CPU (h_xbit) = opval;
  6774. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6775. }
  6776. {
  6777. BI opval = 0;
  6778. SET_H_INSN_PREFIXED_P (opval);
  6779. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6780. }
  6781. }
  6782. }
  6783. }
  6784. #undef FLD
  6785. }
  6786. NEXT (vpc);
  6787. CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
  6788. {
  6789. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6790. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6791. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  6792. int UNUSED written = 0;
  6793. IADDR UNUSED pc = abuf->addr;
  6794. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6795. {
  6796. SI tmp_tmpopd;
  6797. SI tmp_tmpops;
  6798. BI tmp_carry;
  6799. SI tmp_newval;
  6800. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  6801. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6802. tmp_carry = CPU (h_cbit);
  6803. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6804. {
  6805. SI opval = tmp_newval;
  6806. SET_H_GR (FLD (f_operand2), opval);
  6807. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6808. }
  6809. {
  6810. {
  6811. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  6812. CPU (h_cbit) = opval;
  6813. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6814. }
  6815. {
  6816. BI opval = LTSI (tmp_newval, 0);
  6817. CPU (h_nbit) = opval;
  6818. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6819. }
  6820. {
  6821. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6822. CPU (h_zbit) = opval;
  6823. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6824. }
  6825. {
  6826. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  6827. CPU (h_vbit) = opval;
  6828. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6829. }
  6830. {
  6831. {
  6832. BI opval = 0;
  6833. CPU (h_xbit) = opval;
  6834. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6835. }
  6836. {
  6837. BI opval = 0;
  6838. SET_H_INSN_PREFIXED_P (opval);
  6839. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6840. }
  6841. }
  6842. }
  6843. }
  6844. #undef FLD
  6845. }
  6846. NEXT (vpc);
  6847. CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
  6848. {
  6849. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6850. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6851. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  6852. int UNUSED written = 0;
  6853. IADDR UNUSED pc = abuf->addr;
  6854. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6855. {
  6856. QI tmp_tmpopd;
  6857. QI tmp_tmpops;
  6858. BI tmp_carry;
  6859. QI tmp_newval;
  6860. tmp_tmpops = ({ SI tmp_addr;
  6861. QI tmp_tmp_mem;
  6862. BI tmp_postinc;
  6863. tmp_postinc = FLD (f_memmode);
  6864. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  6865. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  6866. ; if (NEBI (tmp_postinc, 0)) {
  6867. {
  6868. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  6869. tmp_addr = ADDSI (tmp_addr, 1);
  6870. }
  6871. {
  6872. SI opval = tmp_addr;
  6873. SET_H_GR (FLD (f_operand1), opval);
  6874. written |= (1 << 12);
  6875. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6876. }
  6877. }
  6878. }
  6879. ; tmp_tmp_mem; });
  6880. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6881. tmp_carry = CPU (h_cbit);
  6882. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6883. {
  6884. SI tmp_oldregval;
  6885. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  6886. {
  6887. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  6888. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  6889. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6890. }
  6891. }
  6892. {
  6893. {
  6894. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  6895. CPU (h_cbit) = opval;
  6896. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6897. }
  6898. {
  6899. BI opval = LTQI (tmp_newval, 0);
  6900. CPU (h_nbit) = opval;
  6901. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6902. }
  6903. {
  6904. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6905. CPU (h_zbit) = opval;
  6906. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6907. }
  6908. {
  6909. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  6910. CPU (h_vbit) = opval;
  6911. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6912. }
  6913. {
  6914. {
  6915. BI opval = 0;
  6916. CPU (h_xbit) = opval;
  6917. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  6918. }
  6919. {
  6920. BI opval = 0;
  6921. SET_H_INSN_PREFIXED_P (opval);
  6922. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  6923. }
  6924. }
  6925. }
  6926. }
  6927. abuf->written = written;
  6928. #undef FLD
  6929. }
  6930. NEXT (vpc);
  6931. CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
  6932. {
  6933. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  6934. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  6935. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  6936. int UNUSED written = 0;
  6937. IADDR UNUSED pc = abuf->addr;
  6938. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  6939. {
  6940. HI tmp_tmpopd;
  6941. HI tmp_tmpops;
  6942. BI tmp_carry;
  6943. HI tmp_newval;
  6944. tmp_tmpops = ({ SI tmp_addr;
  6945. HI tmp_tmp_mem;
  6946. BI tmp_postinc;
  6947. tmp_postinc = FLD (f_memmode);
  6948. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  6949. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  6950. ; if (NEBI (tmp_postinc, 0)) {
  6951. {
  6952. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  6953. tmp_addr = ADDSI (tmp_addr, 2);
  6954. }
  6955. {
  6956. SI opval = tmp_addr;
  6957. SET_H_GR (FLD (f_operand1), opval);
  6958. written |= (1 << 12);
  6959. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6960. }
  6961. }
  6962. }
  6963. ; tmp_tmp_mem; });
  6964. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  6965. tmp_carry = CPU (h_cbit);
  6966. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  6967. {
  6968. SI tmp_oldregval;
  6969. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  6970. {
  6971. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  6972. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  6973. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  6974. }
  6975. }
  6976. {
  6977. {
  6978. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  6979. CPU (h_cbit) = opval;
  6980. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  6981. }
  6982. {
  6983. BI opval = LTHI (tmp_newval, 0);
  6984. CPU (h_nbit) = opval;
  6985. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  6986. }
  6987. {
  6988. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  6989. CPU (h_zbit) = opval;
  6990. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  6991. }
  6992. {
  6993. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  6994. CPU (h_vbit) = opval;
  6995. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  6996. }
  6997. {
  6998. {
  6999. BI opval = 0;
  7000. CPU (h_xbit) = opval;
  7001. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7002. }
  7003. {
  7004. BI opval = 0;
  7005. SET_H_INSN_PREFIXED_P (opval);
  7006. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7007. }
  7008. }
  7009. }
  7010. }
  7011. abuf->written = written;
  7012. #undef FLD
  7013. }
  7014. NEXT (vpc);
  7015. CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
  7016. {
  7017. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7018. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7019. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  7020. int UNUSED written = 0;
  7021. IADDR UNUSED pc = abuf->addr;
  7022. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7023. {
  7024. SI tmp_tmpopd;
  7025. SI tmp_tmpops;
  7026. BI tmp_carry;
  7027. SI tmp_newval;
  7028. tmp_tmpops = ({ SI tmp_addr;
  7029. SI tmp_tmp_mem;
  7030. BI tmp_postinc;
  7031. tmp_postinc = FLD (f_memmode);
  7032. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  7033. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  7034. ; if (NEBI (tmp_postinc, 0)) {
  7035. {
  7036. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  7037. tmp_addr = ADDSI (tmp_addr, 4);
  7038. }
  7039. {
  7040. SI opval = tmp_addr;
  7041. SET_H_GR (FLD (f_operand1), opval);
  7042. written |= (1 << 11);
  7043. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7044. }
  7045. }
  7046. }
  7047. ; tmp_tmp_mem; });
  7048. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7049. tmp_carry = CPU (h_cbit);
  7050. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7051. {
  7052. SI opval = tmp_newval;
  7053. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  7054. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7055. }
  7056. {
  7057. {
  7058. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7059. CPU (h_cbit) = opval;
  7060. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7061. }
  7062. {
  7063. BI opval = LTSI (tmp_newval, 0);
  7064. CPU (h_nbit) = opval;
  7065. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7066. }
  7067. {
  7068. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7069. CPU (h_zbit) = opval;
  7070. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7071. }
  7072. {
  7073. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7074. CPU (h_vbit) = opval;
  7075. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7076. }
  7077. {
  7078. {
  7079. BI opval = 0;
  7080. CPU (h_xbit) = opval;
  7081. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7082. }
  7083. {
  7084. BI opval = 0;
  7085. SET_H_INSN_PREFIXED_P (opval);
  7086. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7087. }
  7088. }
  7089. }
  7090. }
  7091. abuf->written = written;
  7092. #undef FLD
  7093. }
  7094. NEXT (vpc);
  7095. CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
  7096. {
  7097. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7098. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7099. #define FLD(f) abuf->fields.sfmt_addcbr.f
  7100. int UNUSED written = 0;
  7101. IADDR UNUSED pc = abuf->addr;
  7102. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  7103. {
  7104. QI tmp_tmpopd;
  7105. QI tmp_tmpops;
  7106. BI tmp_carry;
  7107. QI tmp_newval;
  7108. tmp_tmpops = FLD (f_indir_pc__byte);
  7109. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7110. tmp_carry = CPU (h_cbit);
  7111. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7112. {
  7113. SI tmp_oldregval;
  7114. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  7115. {
  7116. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  7117. SET_H_GR (FLD (f_operand2), opval);
  7118. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7119. }
  7120. }
  7121. {
  7122. {
  7123. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  7124. CPU (h_cbit) = opval;
  7125. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7126. }
  7127. {
  7128. BI opval = LTQI (tmp_newval, 0);
  7129. CPU (h_nbit) = opval;
  7130. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7131. }
  7132. {
  7133. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7134. CPU (h_zbit) = opval;
  7135. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7136. }
  7137. {
  7138. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  7139. CPU (h_vbit) = opval;
  7140. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7141. }
  7142. {
  7143. {
  7144. BI opval = 0;
  7145. CPU (h_xbit) = opval;
  7146. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7147. }
  7148. {
  7149. BI opval = 0;
  7150. SET_H_INSN_PREFIXED_P (opval);
  7151. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7152. }
  7153. }
  7154. }
  7155. }
  7156. #undef FLD
  7157. }
  7158. NEXT (vpc);
  7159. CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
  7160. {
  7161. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7162. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7163. #define FLD(f) abuf->fields.sfmt_addcwr.f
  7164. int UNUSED written = 0;
  7165. IADDR UNUSED pc = abuf->addr;
  7166. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  7167. {
  7168. HI tmp_tmpopd;
  7169. HI tmp_tmpops;
  7170. BI tmp_carry;
  7171. HI tmp_newval;
  7172. tmp_tmpops = FLD (f_indir_pc__word);
  7173. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7174. tmp_carry = CPU (h_cbit);
  7175. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7176. {
  7177. SI tmp_oldregval;
  7178. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  7179. {
  7180. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  7181. SET_H_GR (FLD (f_operand2), opval);
  7182. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7183. }
  7184. }
  7185. {
  7186. {
  7187. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  7188. CPU (h_cbit) = opval;
  7189. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7190. }
  7191. {
  7192. BI opval = LTHI (tmp_newval, 0);
  7193. CPU (h_nbit) = opval;
  7194. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7195. }
  7196. {
  7197. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7198. CPU (h_zbit) = opval;
  7199. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7200. }
  7201. {
  7202. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  7203. CPU (h_vbit) = opval;
  7204. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7205. }
  7206. {
  7207. {
  7208. BI opval = 0;
  7209. CPU (h_xbit) = opval;
  7210. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7211. }
  7212. {
  7213. BI opval = 0;
  7214. SET_H_INSN_PREFIXED_P (opval);
  7215. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7216. }
  7217. }
  7218. }
  7219. }
  7220. #undef FLD
  7221. }
  7222. NEXT (vpc);
  7223. CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
  7224. {
  7225. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7226. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7227. #define FLD(f) abuf->fields.sfmt_addcdr.f
  7228. int UNUSED written = 0;
  7229. IADDR UNUSED pc = abuf->addr;
  7230. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  7231. {
  7232. SI tmp_tmpopd;
  7233. SI tmp_tmpops;
  7234. BI tmp_carry;
  7235. SI tmp_newval;
  7236. tmp_tmpops = FLD (f_indir_pc__dword);
  7237. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7238. tmp_carry = CPU (h_cbit);
  7239. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7240. {
  7241. SI opval = tmp_newval;
  7242. SET_H_GR (FLD (f_operand2), opval);
  7243. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7244. }
  7245. {
  7246. {
  7247. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7248. CPU (h_cbit) = opval;
  7249. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7250. }
  7251. {
  7252. BI opval = LTSI (tmp_newval, 0);
  7253. CPU (h_nbit) = opval;
  7254. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7255. }
  7256. {
  7257. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7258. CPU (h_zbit) = opval;
  7259. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7260. }
  7261. {
  7262. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7263. CPU (h_vbit) = opval;
  7264. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7265. }
  7266. {
  7267. {
  7268. BI opval = 0;
  7269. CPU (h_xbit) = opval;
  7270. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7271. }
  7272. {
  7273. BI opval = 0;
  7274. SET_H_INSN_PREFIXED_P (opval);
  7275. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7276. }
  7277. }
  7278. }
  7279. }
  7280. #undef FLD
  7281. }
  7282. NEXT (vpc);
  7283. CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
  7284. {
  7285. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7286. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7287. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  7288. int UNUSED written = 0;
  7289. IADDR UNUSED pc = abuf->addr;
  7290. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7291. {
  7292. SI tmp_tmpopd;
  7293. SI tmp_tmpops;
  7294. BI tmp_carry;
  7295. SI tmp_newval;
  7296. tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  7297. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7298. tmp_carry = CPU (h_cbit);
  7299. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7300. {
  7301. SI opval = tmp_newval;
  7302. SET_H_GR (FLD (f_operand2), opval);
  7303. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7304. }
  7305. {
  7306. {
  7307. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7308. CPU (h_cbit) = opval;
  7309. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7310. }
  7311. {
  7312. BI opval = LTSI (tmp_newval, 0);
  7313. CPU (h_nbit) = opval;
  7314. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7315. }
  7316. {
  7317. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7318. CPU (h_zbit) = opval;
  7319. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7320. }
  7321. {
  7322. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7323. CPU (h_vbit) = opval;
  7324. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7325. }
  7326. {
  7327. {
  7328. BI opval = 0;
  7329. CPU (h_xbit) = opval;
  7330. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7331. }
  7332. {
  7333. BI opval = 0;
  7334. SET_H_INSN_PREFIXED_P (opval);
  7335. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7336. }
  7337. }
  7338. }
  7339. }
  7340. #undef FLD
  7341. }
  7342. NEXT (vpc);
  7343. CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
  7344. {
  7345. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7346. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7347. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  7348. int UNUSED written = 0;
  7349. IADDR UNUSED pc = abuf->addr;
  7350. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7351. {
  7352. SI tmp_tmpopd;
  7353. SI tmp_tmpops;
  7354. BI tmp_carry;
  7355. SI tmp_newval;
  7356. tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  7357. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7358. tmp_carry = CPU (h_cbit);
  7359. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7360. {
  7361. SI opval = tmp_newval;
  7362. SET_H_GR (FLD (f_operand2), opval);
  7363. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7364. }
  7365. {
  7366. {
  7367. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7368. CPU (h_cbit) = opval;
  7369. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7370. }
  7371. {
  7372. BI opval = LTSI (tmp_newval, 0);
  7373. CPU (h_nbit) = opval;
  7374. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7375. }
  7376. {
  7377. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7378. CPU (h_zbit) = opval;
  7379. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7380. }
  7381. {
  7382. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7383. CPU (h_vbit) = opval;
  7384. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7385. }
  7386. {
  7387. {
  7388. BI opval = 0;
  7389. CPU (h_xbit) = opval;
  7390. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7391. }
  7392. {
  7393. BI opval = 0;
  7394. SET_H_INSN_PREFIXED_P (opval);
  7395. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7396. }
  7397. }
  7398. }
  7399. }
  7400. #undef FLD
  7401. }
  7402. NEXT (vpc);
  7403. CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
  7404. {
  7405. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7406. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7407. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  7408. int UNUSED written = 0;
  7409. IADDR UNUSED pc = abuf->addr;
  7410. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7411. {
  7412. SI tmp_tmpopd;
  7413. SI tmp_tmpops;
  7414. BI tmp_carry;
  7415. SI tmp_newval;
  7416. tmp_tmpops = EXTQISI (({ SI tmp_addr;
  7417. QI tmp_tmp_mem;
  7418. BI tmp_postinc;
  7419. tmp_postinc = FLD (f_memmode);
  7420. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  7421. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  7422. ; if (NEBI (tmp_postinc, 0)) {
  7423. {
  7424. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  7425. tmp_addr = ADDSI (tmp_addr, 1);
  7426. }
  7427. {
  7428. SI opval = tmp_addr;
  7429. SET_H_GR (FLD (f_operand1), opval);
  7430. written |= (1 << 11);
  7431. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7432. }
  7433. }
  7434. }
  7435. ; tmp_tmp_mem; }));
  7436. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7437. tmp_carry = CPU (h_cbit);
  7438. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7439. {
  7440. SI opval = tmp_newval;
  7441. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  7442. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7443. }
  7444. {
  7445. {
  7446. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7447. CPU (h_cbit) = opval;
  7448. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7449. }
  7450. {
  7451. BI opval = LTSI (tmp_newval, 0);
  7452. CPU (h_nbit) = opval;
  7453. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7454. }
  7455. {
  7456. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7457. CPU (h_zbit) = opval;
  7458. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7459. }
  7460. {
  7461. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7462. CPU (h_vbit) = opval;
  7463. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7464. }
  7465. {
  7466. {
  7467. BI opval = 0;
  7468. CPU (h_xbit) = opval;
  7469. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7470. }
  7471. {
  7472. BI opval = 0;
  7473. SET_H_INSN_PREFIXED_P (opval);
  7474. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7475. }
  7476. }
  7477. }
  7478. }
  7479. abuf->written = written;
  7480. #undef FLD
  7481. }
  7482. NEXT (vpc);
  7483. CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
  7484. {
  7485. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7486. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7487. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  7488. int UNUSED written = 0;
  7489. IADDR UNUSED pc = abuf->addr;
  7490. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7491. {
  7492. SI tmp_tmpopd;
  7493. SI tmp_tmpops;
  7494. BI tmp_carry;
  7495. SI tmp_newval;
  7496. tmp_tmpops = EXTHISI (({ SI tmp_addr;
  7497. HI tmp_tmp_mem;
  7498. BI tmp_postinc;
  7499. tmp_postinc = FLD (f_memmode);
  7500. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  7501. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  7502. ; if (NEBI (tmp_postinc, 0)) {
  7503. {
  7504. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  7505. tmp_addr = ADDSI (tmp_addr, 2);
  7506. }
  7507. {
  7508. SI opval = tmp_addr;
  7509. SET_H_GR (FLD (f_operand1), opval);
  7510. written |= (1 << 11);
  7511. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7512. }
  7513. }
  7514. }
  7515. ; tmp_tmp_mem; }));
  7516. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7517. tmp_carry = CPU (h_cbit);
  7518. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7519. {
  7520. SI opval = tmp_newval;
  7521. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  7522. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7523. }
  7524. {
  7525. {
  7526. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7527. CPU (h_cbit) = opval;
  7528. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7529. }
  7530. {
  7531. BI opval = LTSI (tmp_newval, 0);
  7532. CPU (h_nbit) = opval;
  7533. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7534. }
  7535. {
  7536. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7537. CPU (h_zbit) = opval;
  7538. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7539. }
  7540. {
  7541. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7542. CPU (h_vbit) = opval;
  7543. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7544. }
  7545. {
  7546. {
  7547. BI opval = 0;
  7548. CPU (h_xbit) = opval;
  7549. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7550. }
  7551. {
  7552. BI opval = 0;
  7553. SET_H_INSN_PREFIXED_P (opval);
  7554. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7555. }
  7556. }
  7557. }
  7558. }
  7559. abuf->written = written;
  7560. #undef FLD
  7561. }
  7562. NEXT (vpc);
  7563. CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
  7564. {
  7565. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7566. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7567. #define FLD(f) abuf->fields.sfmt_addcbr.f
  7568. int UNUSED written = 0;
  7569. IADDR UNUSED pc = abuf->addr;
  7570. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  7571. {
  7572. SI tmp_tmpopd;
  7573. SI tmp_tmpops;
  7574. BI tmp_carry;
  7575. SI tmp_newval;
  7576. tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  7577. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7578. tmp_carry = CPU (h_cbit);
  7579. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7580. {
  7581. SI opval = tmp_newval;
  7582. SET_H_GR (FLD (f_operand2), opval);
  7583. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7584. }
  7585. {
  7586. {
  7587. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7588. CPU (h_cbit) = opval;
  7589. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7590. }
  7591. {
  7592. BI opval = LTSI (tmp_newval, 0);
  7593. CPU (h_nbit) = opval;
  7594. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7595. }
  7596. {
  7597. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7598. CPU (h_zbit) = opval;
  7599. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7600. }
  7601. {
  7602. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7603. CPU (h_vbit) = opval;
  7604. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7605. }
  7606. {
  7607. {
  7608. BI opval = 0;
  7609. CPU (h_xbit) = opval;
  7610. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7611. }
  7612. {
  7613. BI opval = 0;
  7614. SET_H_INSN_PREFIXED_P (opval);
  7615. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7616. }
  7617. }
  7618. }
  7619. }
  7620. #undef FLD
  7621. }
  7622. NEXT (vpc);
  7623. CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
  7624. {
  7625. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7626. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7627. #define FLD(f) abuf->fields.sfmt_addcwr.f
  7628. int UNUSED written = 0;
  7629. IADDR UNUSED pc = abuf->addr;
  7630. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  7631. {
  7632. SI tmp_tmpopd;
  7633. SI tmp_tmpops;
  7634. BI tmp_carry;
  7635. SI tmp_newval;
  7636. tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  7637. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7638. tmp_carry = CPU (h_cbit);
  7639. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7640. {
  7641. SI opval = tmp_newval;
  7642. SET_H_GR (FLD (f_operand2), opval);
  7643. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7644. }
  7645. {
  7646. {
  7647. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7648. CPU (h_cbit) = opval;
  7649. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7650. }
  7651. {
  7652. BI opval = LTSI (tmp_newval, 0);
  7653. CPU (h_nbit) = opval;
  7654. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7655. }
  7656. {
  7657. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7658. CPU (h_zbit) = opval;
  7659. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7660. }
  7661. {
  7662. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7663. CPU (h_vbit) = opval;
  7664. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7665. }
  7666. {
  7667. {
  7668. BI opval = 0;
  7669. CPU (h_xbit) = opval;
  7670. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7671. }
  7672. {
  7673. BI opval = 0;
  7674. SET_H_INSN_PREFIXED_P (opval);
  7675. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7676. }
  7677. }
  7678. }
  7679. }
  7680. #undef FLD
  7681. }
  7682. NEXT (vpc);
  7683. CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
  7684. {
  7685. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7686. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7687. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  7688. int UNUSED written = 0;
  7689. IADDR UNUSED pc = abuf->addr;
  7690. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7691. {
  7692. SI tmp_tmpopd;
  7693. SI tmp_tmpops;
  7694. BI tmp_carry;
  7695. SI tmp_newval;
  7696. tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  7697. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7698. tmp_carry = CPU (h_cbit);
  7699. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7700. {
  7701. SI opval = tmp_newval;
  7702. SET_H_GR (FLD (f_operand2), opval);
  7703. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7704. }
  7705. {
  7706. {
  7707. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7708. CPU (h_cbit) = opval;
  7709. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7710. }
  7711. {
  7712. BI opval = LTSI (tmp_newval, 0);
  7713. CPU (h_nbit) = opval;
  7714. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7715. }
  7716. {
  7717. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7718. CPU (h_zbit) = opval;
  7719. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7720. }
  7721. {
  7722. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7723. CPU (h_vbit) = opval;
  7724. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7725. }
  7726. {
  7727. {
  7728. BI opval = 0;
  7729. CPU (h_xbit) = opval;
  7730. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7731. }
  7732. {
  7733. BI opval = 0;
  7734. SET_H_INSN_PREFIXED_P (opval);
  7735. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7736. }
  7737. }
  7738. }
  7739. }
  7740. #undef FLD
  7741. }
  7742. NEXT (vpc);
  7743. CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
  7744. {
  7745. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7746. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7747. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  7748. int UNUSED written = 0;
  7749. IADDR UNUSED pc = abuf->addr;
  7750. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7751. {
  7752. SI tmp_tmpopd;
  7753. SI tmp_tmpops;
  7754. BI tmp_carry;
  7755. SI tmp_newval;
  7756. tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  7757. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7758. tmp_carry = CPU (h_cbit);
  7759. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7760. {
  7761. SI opval = tmp_newval;
  7762. SET_H_GR (FLD (f_operand2), opval);
  7763. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7764. }
  7765. {
  7766. {
  7767. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7768. CPU (h_cbit) = opval;
  7769. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7770. }
  7771. {
  7772. BI opval = LTSI (tmp_newval, 0);
  7773. CPU (h_nbit) = opval;
  7774. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7775. }
  7776. {
  7777. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7778. CPU (h_zbit) = opval;
  7779. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7780. }
  7781. {
  7782. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7783. CPU (h_vbit) = opval;
  7784. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7785. }
  7786. {
  7787. {
  7788. BI opval = 0;
  7789. CPU (h_xbit) = opval;
  7790. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7791. }
  7792. {
  7793. BI opval = 0;
  7794. SET_H_INSN_PREFIXED_P (opval);
  7795. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7796. }
  7797. }
  7798. }
  7799. }
  7800. #undef FLD
  7801. }
  7802. NEXT (vpc);
  7803. CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
  7804. {
  7805. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7806. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7807. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  7808. int UNUSED written = 0;
  7809. IADDR UNUSED pc = abuf->addr;
  7810. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7811. {
  7812. SI tmp_tmpopd;
  7813. SI tmp_tmpops;
  7814. BI tmp_carry;
  7815. SI tmp_newval;
  7816. tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
  7817. QI tmp_tmp_mem;
  7818. BI tmp_postinc;
  7819. tmp_postinc = FLD (f_memmode);
  7820. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  7821. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  7822. ; if (NEBI (tmp_postinc, 0)) {
  7823. {
  7824. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  7825. tmp_addr = ADDSI (tmp_addr, 1);
  7826. }
  7827. {
  7828. SI opval = tmp_addr;
  7829. SET_H_GR (FLD (f_operand1), opval);
  7830. written |= (1 << 11);
  7831. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7832. }
  7833. }
  7834. }
  7835. ; tmp_tmp_mem; }));
  7836. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7837. tmp_carry = CPU (h_cbit);
  7838. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7839. {
  7840. SI opval = tmp_newval;
  7841. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  7842. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7843. }
  7844. {
  7845. {
  7846. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7847. CPU (h_cbit) = opval;
  7848. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7849. }
  7850. {
  7851. BI opval = LTSI (tmp_newval, 0);
  7852. CPU (h_nbit) = opval;
  7853. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7854. }
  7855. {
  7856. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7857. CPU (h_zbit) = opval;
  7858. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7859. }
  7860. {
  7861. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7862. CPU (h_vbit) = opval;
  7863. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7864. }
  7865. {
  7866. {
  7867. BI opval = 0;
  7868. CPU (h_xbit) = opval;
  7869. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7870. }
  7871. {
  7872. BI opval = 0;
  7873. SET_H_INSN_PREFIXED_P (opval);
  7874. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7875. }
  7876. }
  7877. }
  7878. }
  7879. abuf->written = written;
  7880. #undef FLD
  7881. }
  7882. NEXT (vpc);
  7883. CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
  7884. {
  7885. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7886. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7887. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  7888. int UNUSED written = 0;
  7889. IADDR UNUSED pc = abuf->addr;
  7890. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  7891. {
  7892. SI tmp_tmpopd;
  7893. SI tmp_tmpops;
  7894. BI tmp_carry;
  7895. SI tmp_newval;
  7896. tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
  7897. HI tmp_tmp_mem;
  7898. BI tmp_postinc;
  7899. tmp_postinc = FLD (f_memmode);
  7900. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  7901. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  7902. ; if (NEBI (tmp_postinc, 0)) {
  7903. {
  7904. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  7905. tmp_addr = ADDSI (tmp_addr, 2);
  7906. }
  7907. {
  7908. SI opval = tmp_addr;
  7909. SET_H_GR (FLD (f_operand1), opval);
  7910. written |= (1 << 11);
  7911. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7912. }
  7913. }
  7914. }
  7915. ; tmp_tmp_mem; }));
  7916. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7917. tmp_carry = CPU (h_cbit);
  7918. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7919. {
  7920. SI opval = tmp_newval;
  7921. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  7922. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7923. }
  7924. {
  7925. {
  7926. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7927. CPU (h_cbit) = opval;
  7928. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7929. }
  7930. {
  7931. BI opval = LTSI (tmp_newval, 0);
  7932. CPU (h_nbit) = opval;
  7933. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7934. }
  7935. {
  7936. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7937. CPU (h_zbit) = opval;
  7938. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  7939. }
  7940. {
  7941. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  7942. CPU (h_vbit) = opval;
  7943. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  7944. }
  7945. {
  7946. {
  7947. BI opval = 0;
  7948. CPU (h_xbit) = opval;
  7949. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  7950. }
  7951. {
  7952. BI opval = 0;
  7953. SET_H_INSN_PREFIXED_P (opval);
  7954. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  7955. }
  7956. }
  7957. }
  7958. }
  7959. abuf->written = written;
  7960. #undef FLD
  7961. }
  7962. NEXT (vpc);
  7963. CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
  7964. {
  7965. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  7966. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  7967. #define FLD(f) abuf->fields.sfmt_addcbr.f
  7968. int UNUSED written = 0;
  7969. IADDR UNUSED pc = abuf->addr;
  7970. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  7971. {
  7972. SI tmp_tmpopd;
  7973. SI tmp_tmpops;
  7974. BI tmp_carry;
  7975. SI tmp_newval;
  7976. tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  7977. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  7978. tmp_carry = CPU (h_cbit);
  7979. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  7980. {
  7981. SI opval = tmp_newval;
  7982. SET_H_GR (FLD (f_operand2), opval);
  7983. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  7984. }
  7985. {
  7986. {
  7987. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  7988. CPU (h_cbit) = opval;
  7989. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  7990. }
  7991. {
  7992. BI opval = LTSI (tmp_newval, 0);
  7993. CPU (h_nbit) = opval;
  7994. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  7995. }
  7996. {
  7997. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  7998. CPU (h_zbit) = opval;
  7999. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8000. }
  8001. {
  8002. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  8003. CPU (h_vbit) = opval;
  8004. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8005. }
  8006. {
  8007. {
  8008. BI opval = 0;
  8009. CPU (h_xbit) = opval;
  8010. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8011. }
  8012. {
  8013. BI opval = 0;
  8014. SET_H_INSN_PREFIXED_P (opval);
  8015. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8016. }
  8017. }
  8018. }
  8019. }
  8020. #undef FLD
  8021. }
  8022. NEXT (vpc);
  8023. CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
  8024. {
  8025. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8026. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8027. #define FLD(f) abuf->fields.sfmt_addcwr.f
  8028. int UNUSED written = 0;
  8029. IADDR UNUSED pc = abuf->addr;
  8030. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  8031. {
  8032. SI tmp_tmpopd;
  8033. SI tmp_tmpops;
  8034. BI tmp_carry;
  8035. SI tmp_newval;
  8036. tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
  8037. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  8038. tmp_carry = CPU (h_cbit);
  8039. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8040. {
  8041. SI opval = tmp_newval;
  8042. SET_H_GR (FLD (f_operand2), opval);
  8043. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8044. }
  8045. {
  8046. {
  8047. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  8048. CPU (h_cbit) = opval;
  8049. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8050. }
  8051. {
  8052. BI opval = LTSI (tmp_newval, 0);
  8053. CPU (h_nbit) = opval;
  8054. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8055. }
  8056. {
  8057. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8058. CPU (h_zbit) = opval;
  8059. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8060. }
  8061. {
  8062. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  8063. CPU (h_vbit) = opval;
  8064. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8065. }
  8066. {
  8067. {
  8068. BI opval = 0;
  8069. CPU (h_xbit) = opval;
  8070. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8071. }
  8072. {
  8073. BI opval = 0;
  8074. SET_H_INSN_PREFIXED_P (opval);
  8075. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8076. }
  8077. }
  8078. }
  8079. }
  8080. #undef FLD
  8081. }
  8082. NEXT (vpc);
  8083. CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
  8084. {
  8085. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8086. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8087. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8088. int UNUSED written = 0;
  8089. IADDR UNUSED pc = abuf->addr;
  8090. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8091. {
  8092. {
  8093. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
  8094. SET_H_GR (FLD (f_operand1), opval);
  8095. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8096. }
  8097. {
  8098. {
  8099. BI opval = 0;
  8100. CPU (h_xbit) = opval;
  8101. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8102. }
  8103. {
  8104. BI opval = 0;
  8105. SET_H_INSN_PREFIXED_P (opval);
  8106. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8107. }
  8108. }
  8109. }
  8110. #undef FLD
  8111. }
  8112. NEXT (vpc);
  8113. CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
  8114. {
  8115. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8116. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8117. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8118. int UNUSED written = 0;
  8119. IADDR UNUSED pc = abuf->addr;
  8120. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8121. {
  8122. {
  8123. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
  8124. SET_H_GR (FLD (f_operand1), opval);
  8125. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8126. }
  8127. {
  8128. {
  8129. BI opval = 0;
  8130. CPU (h_xbit) = opval;
  8131. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8132. }
  8133. {
  8134. BI opval = 0;
  8135. SET_H_INSN_PREFIXED_P (opval);
  8136. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8137. }
  8138. }
  8139. }
  8140. #undef FLD
  8141. }
  8142. NEXT (vpc);
  8143. CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
  8144. {
  8145. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8146. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8147. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8148. int UNUSED written = 0;
  8149. IADDR UNUSED pc = abuf->addr;
  8150. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8151. {
  8152. {
  8153. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
  8154. SET_H_GR (FLD (f_operand1), opval);
  8155. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8156. }
  8157. {
  8158. {
  8159. BI opval = 0;
  8160. CPU (h_xbit) = opval;
  8161. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8162. }
  8163. {
  8164. BI opval = 0;
  8165. SET_H_INSN_PREFIXED_P (opval);
  8166. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8167. }
  8168. }
  8169. }
  8170. #undef FLD
  8171. }
  8172. NEXT (vpc);
  8173. CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
  8174. {
  8175. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8176. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8177. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  8178. int UNUSED written = 0;
  8179. IADDR UNUSED pc = abuf->addr;
  8180. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8181. {
  8182. QI tmp_tmpopd;
  8183. QI tmp_tmpops;
  8184. BI tmp_carry;
  8185. QI tmp_newval;
  8186. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  8187. tmp_tmpopd = 0;
  8188. tmp_carry = CPU (h_cbit);
  8189. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8190. {
  8191. SI tmp_oldregval;
  8192. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  8193. {
  8194. SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
  8195. SET_H_GR (FLD (f_operand2), opval);
  8196. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8197. }
  8198. }
  8199. {
  8200. {
  8201. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  8202. CPU (h_cbit) = opval;
  8203. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8204. }
  8205. {
  8206. BI opval = LTQI (tmp_newval, 0);
  8207. CPU (h_nbit) = opval;
  8208. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8209. }
  8210. {
  8211. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8212. CPU (h_zbit) = opval;
  8213. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8214. }
  8215. {
  8216. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  8217. CPU (h_vbit) = opval;
  8218. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8219. }
  8220. {
  8221. {
  8222. BI opval = 0;
  8223. CPU (h_xbit) = opval;
  8224. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8225. }
  8226. {
  8227. BI opval = 0;
  8228. SET_H_INSN_PREFIXED_P (opval);
  8229. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8230. }
  8231. }
  8232. }
  8233. }
  8234. #undef FLD
  8235. }
  8236. NEXT (vpc);
  8237. CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
  8238. {
  8239. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8240. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8241. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  8242. int UNUSED written = 0;
  8243. IADDR UNUSED pc = abuf->addr;
  8244. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8245. {
  8246. HI tmp_tmpopd;
  8247. HI tmp_tmpops;
  8248. BI tmp_carry;
  8249. HI tmp_newval;
  8250. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  8251. tmp_tmpopd = 0;
  8252. tmp_carry = CPU (h_cbit);
  8253. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8254. {
  8255. SI tmp_oldregval;
  8256. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  8257. {
  8258. SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  8259. SET_H_GR (FLD (f_operand2), opval);
  8260. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8261. }
  8262. }
  8263. {
  8264. {
  8265. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  8266. CPU (h_cbit) = opval;
  8267. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8268. }
  8269. {
  8270. BI opval = LTHI (tmp_newval, 0);
  8271. CPU (h_nbit) = opval;
  8272. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8273. }
  8274. {
  8275. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8276. CPU (h_zbit) = opval;
  8277. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8278. }
  8279. {
  8280. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  8281. CPU (h_vbit) = opval;
  8282. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8283. }
  8284. {
  8285. {
  8286. BI opval = 0;
  8287. CPU (h_xbit) = opval;
  8288. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8289. }
  8290. {
  8291. BI opval = 0;
  8292. SET_H_INSN_PREFIXED_P (opval);
  8293. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8294. }
  8295. }
  8296. }
  8297. }
  8298. #undef FLD
  8299. }
  8300. NEXT (vpc);
  8301. CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
  8302. {
  8303. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8304. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8305. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  8306. int UNUSED written = 0;
  8307. IADDR UNUSED pc = abuf->addr;
  8308. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8309. {
  8310. SI tmp_tmpopd;
  8311. SI tmp_tmpops;
  8312. BI tmp_carry;
  8313. SI tmp_newval;
  8314. tmp_tmpops = GET_H_GR (FLD (f_operand1));
  8315. tmp_tmpopd = 0;
  8316. tmp_carry = CPU (h_cbit);
  8317. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8318. {
  8319. SI opval = tmp_newval;
  8320. SET_H_GR (FLD (f_operand2), opval);
  8321. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8322. }
  8323. {
  8324. {
  8325. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  8326. CPU (h_cbit) = opval;
  8327. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8328. }
  8329. {
  8330. BI opval = LTSI (tmp_newval, 0);
  8331. CPU (h_nbit) = opval;
  8332. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8333. }
  8334. {
  8335. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8336. CPU (h_zbit) = opval;
  8337. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8338. }
  8339. {
  8340. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  8341. CPU (h_vbit) = opval;
  8342. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8343. }
  8344. {
  8345. {
  8346. BI opval = 0;
  8347. CPU (h_xbit) = opval;
  8348. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8349. }
  8350. {
  8351. BI opval = 0;
  8352. SET_H_INSN_PREFIXED_P (opval);
  8353. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8354. }
  8355. }
  8356. }
  8357. }
  8358. #undef FLD
  8359. }
  8360. NEXT (vpc);
  8361. CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
  8362. {
  8363. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8364. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8365. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  8366. int UNUSED written = 0;
  8367. IADDR UNUSED pc = abuf->addr;
  8368. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8369. {
  8370. QI tmp_tmpd;
  8371. tmp_tmpd = ({ SI tmp_addr;
  8372. QI tmp_tmp_mem;
  8373. BI tmp_postinc;
  8374. tmp_postinc = FLD (f_memmode);
  8375. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8376. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  8377. ; if (NEBI (tmp_postinc, 0)) {
  8378. {
  8379. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8380. tmp_addr = ADDSI (tmp_addr, 1);
  8381. }
  8382. {
  8383. SI opval = tmp_addr;
  8384. SET_H_GR (FLD (f_operand1), opval);
  8385. written |= (1 << 8);
  8386. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8387. }
  8388. }
  8389. }
  8390. ; tmp_tmp_mem; });
  8391. {
  8392. QI tmp_tmpopd;
  8393. QI tmp_tmpops;
  8394. BI tmp_carry;
  8395. QI tmp_newval;
  8396. tmp_tmpops = 0;
  8397. tmp_tmpopd = tmp_tmpd;
  8398. tmp_carry = CPU (h_cbit);
  8399. tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8400. ((void) 0); /*nop*/
  8401. {
  8402. {
  8403. BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
  8404. CPU (h_cbit) = opval;
  8405. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8406. }
  8407. {
  8408. BI opval = LTQI (tmp_newval, 0);
  8409. CPU (h_nbit) = opval;
  8410. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8411. }
  8412. {
  8413. BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8414. CPU (h_zbit) = opval;
  8415. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8416. }
  8417. {
  8418. BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
  8419. CPU (h_vbit) = opval;
  8420. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8421. }
  8422. {
  8423. {
  8424. BI opval = 0;
  8425. CPU (h_xbit) = opval;
  8426. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8427. }
  8428. {
  8429. BI opval = 0;
  8430. SET_H_INSN_PREFIXED_P (opval);
  8431. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8432. }
  8433. }
  8434. }
  8435. }
  8436. }
  8437. abuf->written = written;
  8438. #undef FLD
  8439. }
  8440. NEXT (vpc);
  8441. CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
  8442. {
  8443. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8444. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8445. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  8446. int UNUSED written = 0;
  8447. IADDR UNUSED pc = abuf->addr;
  8448. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8449. {
  8450. HI tmp_tmpd;
  8451. tmp_tmpd = ({ SI tmp_addr;
  8452. HI tmp_tmp_mem;
  8453. BI tmp_postinc;
  8454. tmp_postinc = FLD (f_memmode);
  8455. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8456. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  8457. ; if (NEBI (tmp_postinc, 0)) {
  8458. {
  8459. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8460. tmp_addr = ADDSI (tmp_addr, 2);
  8461. }
  8462. {
  8463. SI opval = tmp_addr;
  8464. SET_H_GR (FLD (f_operand1), opval);
  8465. written |= (1 << 8);
  8466. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8467. }
  8468. }
  8469. }
  8470. ; tmp_tmp_mem; });
  8471. {
  8472. HI tmp_tmpopd;
  8473. HI tmp_tmpops;
  8474. BI tmp_carry;
  8475. HI tmp_newval;
  8476. tmp_tmpops = 0;
  8477. tmp_tmpopd = tmp_tmpd;
  8478. tmp_carry = CPU (h_cbit);
  8479. tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8480. ((void) 0); /*nop*/
  8481. {
  8482. {
  8483. BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
  8484. CPU (h_cbit) = opval;
  8485. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8486. }
  8487. {
  8488. BI opval = LTHI (tmp_newval, 0);
  8489. CPU (h_nbit) = opval;
  8490. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8491. }
  8492. {
  8493. BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8494. CPU (h_zbit) = opval;
  8495. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8496. }
  8497. {
  8498. BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
  8499. CPU (h_vbit) = opval;
  8500. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8501. }
  8502. {
  8503. {
  8504. BI opval = 0;
  8505. CPU (h_xbit) = opval;
  8506. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8507. }
  8508. {
  8509. BI opval = 0;
  8510. SET_H_INSN_PREFIXED_P (opval);
  8511. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8512. }
  8513. }
  8514. }
  8515. }
  8516. }
  8517. abuf->written = written;
  8518. #undef FLD
  8519. }
  8520. NEXT (vpc);
  8521. CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
  8522. {
  8523. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8524. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8525. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  8526. int UNUSED written = 0;
  8527. IADDR UNUSED pc = abuf->addr;
  8528. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8529. {
  8530. SI tmp_tmpd;
  8531. tmp_tmpd = ({ SI tmp_addr;
  8532. SI tmp_tmp_mem;
  8533. BI tmp_postinc;
  8534. tmp_postinc = FLD (f_memmode);
  8535. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8536. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  8537. ; if (NEBI (tmp_postinc, 0)) {
  8538. {
  8539. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8540. tmp_addr = ADDSI (tmp_addr, 4);
  8541. }
  8542. {
  8543. SI opval = tmp_addr;
  8544. SET_H_GR (FLD (f_operand1), opval);
  8545. written |= (1 << 8);
  8546. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8547. }
  8548. }
  8549. }
  8550. ; tmp_tmp_mem; });
  8551. {
  8552. SI tmp_tmpopd;
  8553. SI tmp_tmpops;
  8554. BI tmp_carry;
  8555. SI tmp_newval;
  8556. tmp_tmpops = 0;
  8557. tmp_tmpopd = tmp_tmpd;
  8558. tmp_carry = CPU (h_cbit);
  8559. tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
  8560. ((void) 0); /*nop*/
  8561. {
  8562. {
  8563. BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
  8564. CPU (h_cbit) = opval;
  8565. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8566. }
  8567. {
  8568. BI opval = LTSI (tmp_newval, 0);
  8569. CPU (h_nbit) = opval;
  8570. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8571. }
  8572. {
  8573. BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8574. CPU (h_zbit) = opval;
  8575. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8576. }
  8577. {
  8578. BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
  8579. CPU (h_vbit) = opval;
  8580. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8581. }
  8582. {
  8583. {
  8584. BI opval = 0;
  8585. CPU (h_xbit) = opval;
  8586. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8587. }
  8588. {
  8589. BI opval = 0;
  8590. SET_H_INSN_PREFIXED_P (opval);
  8591. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8592. }
  8593. }
  8594. }
  8595. }
  8596. }
  8597. abuf->written = written;
  8598. #undef FLD
  8599. }
  8600. NEXT (vpc);
  8601. CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
  8602. {
  8603. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8604. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8605. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8606. int UNUSED written = 0;
  8607. IADDR UNUSED pc = abuf->addr;
  8608. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8609. {
  8610. QI tmp_tmpd;
  8611. tmp_tmpd = GET_H_GR (FLD (f_operand2));
  8612. {
  8613. SI tmp_addr;
  8614. BI tmp_postinc;
  8615. tmp_postinc = FLD (f_memmode);
  8616. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8617. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  8618. if (EQBI (CPU (h_pbit), 0)) {
  8619. {
  8620. {
  8621. QI opval = tmp_tmpd;
  8622. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  8623. written |= (1 << 10);
  8624. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8625. }
  8626. {
  8627. BI opval = CPU (h_pbit);
  8628. CPU (h_cbit) = opval;
  8629. written |= (1 << 9);
  8630. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8631. }
  8632. }
  8633. } else {
  8634. {
  8635. BI opval = 1;
  8636. CPU (h_cbit) = opval;
  8637. written |= (1 << 9);
  8638. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8639. }
  8640. }
  8641. } else {
  8642. {
  8643. QI opval = tmp_tmpd;
  8644. SETMEMQI (current_cpu, pc, tmp_addr, opval);
  8645. written |= (1 << 10);
  8646. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8647. }
  8648. }
  8649. if (NEBI (tmp_postinc, 0)) {
  8650. {
  8651. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8652. tmp_addr = ADDSI (tmp_addr, 1);
  8653. }
  8654. {
  8655. SI opval = tmp_addr;
  8656. SET_H_GR (FLD (f_operand1), opval);
  8657. written |= (1 << 8);
  8658. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8659. }
  8660. }
  8661. }
  8662. }
  8663. {
  8664. {
  8665. BI opval = 0;
  8666. CPU (h_xbit) = opval;
  8667. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8668. }
  8669. {
  8670. BI opval = 0;
  8671. SET_H_INSN_PREFIXED_P (opval);
  8672. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8673. }
  8674. }
  8675. }
  8676. abuf->written = written;
  8677. #undef FLD
  8678. }
  8679. NEXT (vpc);
  8680. CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
  8681. {
  8682. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8683. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8684. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8685. int UNUSED written = 0;
  8686. IADDR UNUSED pc = abuf->addr;
  8687. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8688. {
  8689. HI tmp_tmpd;
  8690. tmp_tmpd = GET_H_GR (FLD (f_operand2));
  8691. {
  8692. SI tmp_addr;
  8693. BI tmp_postinc;
  8694. tmp_postinc = FLD (f_memmode);
  8695. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8696. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  8697. if (EQBI (CPU (h_pbit), 0)) {
  8698. {
  8699. {
  8700. HI opval = tmp_tmpd;
  8701. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  8702. written |= (1 << 10);
  8703. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8704. }
  8705. {
  8706. BI opval = CPU (h_pbit);
  8707. CPU (h_cbit) = opval;
  8708. written |= (1 << 9);
  8709. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8710. }
  8711. }
  8712. } else {
  8713. {
  8714. BI opval = 1;
  8715. CPU (h_cbit) = opval;
  8716. written |= (1 << 9);
  8717. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8718. }
  8719. }
  8720. } else {
  8721. {
  8722. HI opval = tmp_tmpd;
  8723. SETMEMHI (current_cpu, pc, tmp_addr, opval);
  8724. written |= (1 << 10);
  8725. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8726. }
  8727. }
  8728. if (NEBI (tmp_postinc, 0)) {
  8729. {
  8730. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8731. tmp_addr = ADDSI (tmp_addr, 2);
  8732. }
  8733. {
  8734. SI opval = tmp_addr;
  8735. SET_H_GR (FLD (f_operand1), opval);
  8736. written |= (1 << 8);
  8737. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8738. }
  8739. }
  8740. }
  8741. }
  8742. {
  8743. {
  8744. BI opval = 0;
  8745. CPU (h_xbit) = opval;
  8746. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8747. }
  8748. {
  8749. BI opval = 0;
  8750. SET_H_INSN_PREFIXED_P (opval);
  8751. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8752. }
  8753. }
  8754. }
  8755. abuf->written = written;
  8756. #undef FLD
  8757. }
  8758. NEXT (vpc);
  8759. CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
  8760. {
  8761. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8762. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8763. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  8764. int UNUSED written = 0;
  8765. IADDR UNUSED pc = abuf->addr;
  8766. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8767. {
  8768. SI tmp_tmpd;
  8769. tmp_tmpd = GET_H_GR (FLD (f_operand2));
  8770. {
  8771. SI tmp_addr;
  8772. BI tmp_postinc;
  8773. tmp_postinc = FLD (f_memmode);
  8774. tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  8775. if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
  8776. if (EQBI (CPU (h_pbit), 0)) {
  8777. {
  8778. {
  8779. SI opval = tmp_tmpd;
  8780. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  8781. written |= (1 << 10);
  8782. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8783. }
  8784. {
  8785. BI opval = CPU (h_pbit);
  8786. CPU (h_cbit) = opval;
  8787. written |= (1 << 9);
  8788. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8789. }
  8790. }
  8791. } else {
  8792. {
  8793. BI opval = 1;
  8794. CPU (h_cbit) = opval;
  8795. written |= (1 << 9);
  8796. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8797. }
  8798. }
  8799. } else {
  8800. {
  8801. SI opval = tmp_tmpd;
  8802. SETMEMSI (current_cpu, pc, tmp_addr, opval);
  8803. written |= (1 << 10);
  8804. CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
  8805. }
  8806. }
  8807. if (NEBI (tmp_postinc, 0)) {
  8808. {
  8809. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  8810. tmp_addr = ADDSI (tmp_addr, 4);
  8811. }
  8812. {
  8813. SI opval = tmp_addr;
  8814. SET_H_GR (FLD (f_operand1), opval);
  8815. written |= (1 << 8);
  8816. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8817. }
  8818. }
  8819. }
  8820. }
  8821. {
  8822. {
  8823. BI opval = 0;
  8824. CPU (h_xbit) = opval;
  8825. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8826. }
  8827. {
  8828. BI opval = 0;
  8829. SET_H_INSN_PREFIXED_P (opval);
  8830. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8831. }
  8832. }
  8833. }
  8834. abuf->written = written;
  8835. #undef FLD
  8836. }
  8837. NEXT (vpc);
  8838. CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
  8839. {
  8840. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8841. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8842. #define FLD(f) abuf->fields.sfmt_muls_b.f
  8843. int UNUSED written = 0;
  8844. IADDR UNUSED pc = abuf->addr;
  8845. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8846. {
  8847. DI tmp_src1;
  8848. DI tmp_src2;
  8849. DI tmp_tmpr;
  8850. tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  8851. tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
  8852. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  8853. {
  8854. SI opval = TRUNCDISI (tmp_tmpr);
  8855. SET_H_GR (FLD (f_operand2), opval);
  8856. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8857. }
  8858. {
  8859. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  8860. SET_H_SR (((UINT) 7), opval);
  8861. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  8862. }
  8863. {
  8864. {
  8865. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  8866. CPU (h_cbit) = opval;
  8867. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8868. }
  8869. {
  8870. BI opval = LTDI (tmp_tmpr, 0);
  8871. CPU (h_nbit) = opval;
  8872. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8873. }
  8874. {
  8875. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8876. CPU (h_zbit) = opval;
  8877. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8878. }
  8879. {
  8880. BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
  8881. CPU (h_vbit) = opval;
  8882. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8883. }
  8884. {
  8885. {
  8886. BI opval = 0;
  8887. CPU (h_xbit) = opval;
  8888. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8889. }
  8890. {
  8891. BI opval = 0;
  8892. SET_H_INSN_PREFIXED_P (opval);
  8893. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8894. }
  8895. }
  8896. }
  8897. }
  8898. #undef FLD
  8899. }
  8900. NEXT (vpc);
  8901. CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
  8902. {
  8903. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8904. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8905. #define FLD(f) abuf->fields.sfmt_muls_b.f
  8906. int UNUSED written = 0;
  8907. IADDR UNUSED pc = abuf->addr;
  8908. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8909. {
  8910. DI tmp_src1;
  8911. DI tmp_src2;
  8912. DI tmp_tmpr;
  8913. tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  8914. tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
  8915. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  8916. {
  8917. SI opval = TRUNCDISI (tmp_tmpr);
  8918. SET_H_GR (FLD (f_operand2), opval);
  8919. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8920. }
  8921. {
  8922. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  8923. SET_H_SR (((UINT) 7), opval);
  8924. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  8925. }
  8926. {
  8927. {
  8928. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  8929. CPU (h_cbit) = opval;
  8930. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8931. }
  8932. {
  8933. BI opval = LTDI (tmp_tmpr, 0);
  8934. CPU (h_nbit) = opval;
  8935. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8936. }
  8937. {
  8938. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  8939. CPU (h_zbit) = opval;
  8940. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  8941. }
  8942. {
  8943. BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
  8944. CPU (h_vbit) = opval;
  8945. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  8946. }
  8947. {
  8948. {
  8949. BI opval = 0;
  8950. CPU (h_xbit) = opval;
  8951. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  8952. }
  8953. {
  8954. BI opval = 0;
  8955. SET_H_INSN_PREFIXED_P (opval);
  8956. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  8957. }
  8958. }
  8959. }
  8960. }
  8961. #undef FLD
  8962. }
  8963. NEXT (vpc);
  8964. CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
  8965. {
  8966. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  8967. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  8968. #define FLD(f) abuf->fields.sfmt_muls_b.f
  8969. int UNUSED written = 0;
  8970. IADDR UNUSED pc = abuf->addr;
  8971. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  8972. {
  8973. DI tmp_src1;
  8974. DI tmp_src2;
  8975. DI tmp_tmpr;
  8976. tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
  8977. tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
  8978. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  8979. {
  8980. SI opval = TRUNCDISI (tmp_tmpr);
  8981. SET_H_GR (FLD (f_operand2), opval);
  8982. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  8983. }
  8984. {
  8985. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  8986. SET_H_SR (((UINT) 7), opval);
  8987. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  8988. }
  8989. {
  8990. {
  8991. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  8992. CPU (h_cbit) = opval;
  8993. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  8994. }
  8995. {
  8996. BI opval = LTDI (tmp_tmpr, 0);
  8997. CPU (h_nbit) = opval;
  8998. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  8999. }
  9000. {
  9001. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  9002. CPU (h_zbit) = opval;
  9003. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9004. }
  9005. {
  9006. BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
  9007. CPU (h_vbit) = opval;
  9008. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  9009. }
  9010. {
  9011. {
  9012. BI opval = 0;
  9013. CPU (h_xbit) = opval;
  9014. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9015. }
  9016. {
  9017. BI opval = 0;
  9018. SET_H_INSN_PREFIXED_P (opval);
  9019. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9020. }
  9021. }
  9022. }
  9023. }
  9024. #undef FLD
  9025. }
  9026. NEXT (vpc);
  9027. CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
  9028. {
  9029. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9030. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9031. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9032. int UNUSED written = 0;
  9033. IADDR UNUSED pc = abuf->addr;
  9034. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9035. {
  9036. DI tmp_src1;
  9037. DI tmp_src2;
  9038. DI tmp_tmpr;
  9039. tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  9040. tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
  9041. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  9042. {
  9043. SI opval = TRUNCDISI (tmp_tmpr);
  9044. SET_H_GR (FLD (f_operand2), opval);
  9045. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9046. }
  9047. {
  9048. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  9049. SET_H_SR (((UINT) 7), opval);
  9050. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  9051. }
  9052. {
  9053. {
  9054. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  9055. CPU (h_cbit) = opval;
  9056. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  9057. }
  9058. {
  9059. BI opval = LTDI (tmp_tmpr, 0);
  9060. CPU (h_nbit) = opval;
  9061. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9062. }
  9063. {
  9064. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  9065. CPU (h_zbit) = opval;
  9066. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9067. }
  9068. {
  9069. BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
  9070. CPU (h_vbit) = opval;
  9071. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  9072. }
  9073. {
  9074. {
  9075. BI opval = 0;
  9076. CPU (h_xbit) = opval;
  9077. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9078. }
  9079. {
  9080. BI opval = 0;
  9081. SET_H_INSN_PREFIXED_P (opval);
  9082. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9083. }
  9084. }
  9085. }
  9086. }
  9087. #undef FLD
  9088. }
  9089. NEXT (vpc);
  9090. CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
  9091. {
  9092. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9093. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9094. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9095. int UNUSED written = 0;
  9096. IADDR UNUSED pc = abuf->addr;
  9097. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9098. {
  9099. DI tmp_src1;
  9100. DI tmp_src2;
  9101. DI tmp_tmpr;
  9102. tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  9103. tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
  9104. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  9105. {
  9106. SI opval = TRUNCDISI (tmp_tmpr);
  9107. SET_H_GR (FLD (f_operand2), opval);
  9108. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9109. }
  9110. {
  9111. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  9112. SET_H_SR (((UINT) 7), opval);
  9113. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  9114. }
  9115. {
  9116. {
  9117. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  9118. CPU (h_cbit) = opval;
  9119. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  9120. }
  9121. {
  9122. BI opval = LTDI (tmp_tmpr, 0);
  9123. CPU (h_nbit) = opval;
  9124. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9125. }
  9126. {
  9127. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  9128. CPU (h_zbit) = opval;
  9129. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9130. }
  9131. {
  9132. BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
  9133. CPU (h_vbit) = opval;
  9134. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  9135. }
  9136. {
  9137. {
  9138. BI opval = 0;
  9139. CPU (h_xbit) = opval;
  9140. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9141. }
  9142. {
  9143. BI opval = 0;
  9144. SET_H_INSN_PREFIXED_P (opval);
  9145. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9146. }
  9147. }
  9148. }
  9149. }
  9150. #undef FLD
  9151. }
  9152. NEXT (vpc);
  9153. CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
  9154. {
  9155. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9156. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9157. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9158. int UNUSED written = 0;
  9159. IADDR UNUSED pc = abuf->addr;
  9160. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9161. {
  9162. DI tmp_src1;
  9163. DI tmp_src2;
  9164. DI tmp_tmpr;
  9165. tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
  9166. tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
  9167. tmp_tmpr = MULDI (tmp_src1, tmp_src2);
  9168. {
  9169. SI opval = TRUNCDISI (tmp_tmpr);
  9170. SET_H_GR (FLD (f_operand2), opval);
  9171. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9172. }
  9173. {
  9174. SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
  9175. SET_H_SR (((UINT) 7), opval);
  9176. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  9177. }
  9178. {
  9179. {
  9180. BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
  9181. CPU (h_cbit) = opval;
  9182. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  9183. }
  9184. {
  9185. BI opval = LTDI (tmp_tmpr, 0);
  9186. CPU (h_nbit) = opval;
  9187. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9188. }
  9189. {
  9190. BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
  9191. CPU (h_zbit) = opval;
  9192. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9193. }
  9194. {
  9195. BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
  9196. CPU (h_vbit) = opval;
  9197. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  9198. }
  9199. {
  9200. {
  9201. BI opval = 0;
  9202. CPU (h_xbit) = opval;
  9203. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9204. }
  9205. {
  9206. BI opval = 0;
  9207. SET_H_INSN_PREFIXED_P (opval);
  9208. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9209. }
  9210. }
  9211. }
  9212. }
  9213. #undef FLD
  9214. }
  9215. NEXT (vpc);
  9216. CASE (sem, INSN_MSTEP) : /* mstep $Rs,$Rd */
  9217. {
  9218. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9219. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9220. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9221. int UNUSED written = 0;
  9222. IADDR UNUSED pc = abuf->addr;
  9223. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9224. {
  9225. SI tmp_tmpd;
  9226. SI tmp_tmps;
  9227. tmp_tmps = GET_H_GR (FLD (f_operand1));
  9228. tmp_tmpd = ADDSI (SLLSI (GET_H_GR (FLD (f_operand2)), 1), ((CPU (h_nbit)) ? (tmp_tmps) : (0)));
  9229. {
  9230. SI opval = tmp_tmpd;
  9231. SET_H_GR (FLD (f_operand2), opval);
  9232. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9233. }
  9234. {
  9235. {
  9236. BI opval = LTSI (tmp_tmpd, 0);
  9237. CPU (h_nbit) = opval;
  9238. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9239. }
  9240. {
  9241. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9242. CPU (h_zbit) = opval;
  9243. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9244. }
  9245. SET_H_CBIT_MOVE (0);
  9246. SET_H_VBIT_MOVE (0);
  9247. {
  9248. {
  9249. BI opval = 0;
  9250. CPU (h_xbit) = opval;
  9251. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9252. }
  9253. {
  9254. BI opval = 0;
  9255. SET_H_INSN_PREFIXED_P (opval);
  9256. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9257. }
  9258. }
  9259. }
  9260. }
  9261. #undef FLD
  9262. }
  9263. NEXT (vpc);
  9264. CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
  9265. {
  9266. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9267. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9268. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9269. int UNUSED written = 0;
  9270. IADDR UNUSED pc = abuf->addr;
  9271. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9272. {
  9273. SI tmp_tmp;
  9274. SI tmp_tmps;
  9275. SI tmp_tmpd;
  9276. tmp_tmps = GET_H_GR (FLD (f_operand1));
  9277. tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
  9278. tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
  9279. {
  9280. SI opval = tmp_tmpd;
  9281. SET_H_GR (FLD (f_operand2), opval);
  9282. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9283. }
  9284. {
  9285. {
  9286. BI opval = LTSI (tmp_tmpd, 0);
  9287. CPU (h_nbit) = opval;
  9288. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9289. }
  9290. {
  9291. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9292. CPU (h_zbit) = opval;
  9293. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9294. }
  9295. SET_H_CBIT_MOVE (0);
  9296. SET_H_VBIT_MOVE (0);
  9297. {
  9298. {
  9299. BI opval = 0;
  9300. CPU (h_xbit) = opval;
  9301. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9302. }
  9303. {
  9304. BI opval = 0;
  9305. SET_H_INSN_PREFIXED_P (opval);
  9306. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9307. }
  9308. }
  9309. }
  9310. }
  9311. #undef FLD
  9312. }
  9313. NEXT (vpc);
  9314. CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
  9315. {
  9316. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9317. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9318. #define FLD(f) abuf->fields.sfmt_muls_b.f
  9319. int UNUSED written = 0;
  9320. IADDR UNUSED pc = abuf->addr;
  9321. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9322. {
  9323. SI tmp_tmpd;
  9324. tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
  9325. {
  9326. SI opval = tmp_tmpd;
  9327. SET_H_GR (FLD (f_operand2), opval);
  9328. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9329. }
  9330. {
  9331. {
  9332. BI opval = LTSI (tmp_tmpd, 0);
  9333. CPU (h_nbit) = opval;
  9334. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9335. }
  9336. {
  9337. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9338. CPU (h_zbit) = opval;
  9339. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9340. }
  9341. SET_H_CBIT_MOVE (0);
  9342. SET_H_VBIT_MOVE (0);
  9343. {
  9344. {
  9345. BI opval = 0;
  9346. CPU (h_xbit) = opval;
  9347. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9348. }
  9349. {
  9350. BI opval = 0;
  9351. SET_H_INSN_PREFIXED_P (opval);
  9352. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9353. }
  9354. }
  9355. }
  9356. }
  9357. #undef FLD
  9358. }
  9359. NEXT (vpc);
  9360. CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
  9361. {
  9362. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9363. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9364. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  9365. int UNUSED written = 0;
  9366. IADDR UNUSED pc = abuf->addr;
  9367. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9368. {
  9369. QI tmp_tmpd;
  9370. tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  9371. {
  9372. SI tmp_oldregval;
  9373. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9374. {
  9375. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  9376. SET_H_GR (FLD (f_operand2), opval);
  9377. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9378. }
  9379. }
  9380. {
  9381. {
  9382. BI opval = LTQI (tmp_tmpd, 0);
  9383. CPU (h_nbit) = opval;
  9384. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9385. }
  9386. {
  9387. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9388. CPU (h_zbit) = opval;
  9389. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9390. }
  9391. SET_H_CBIT_MOVE (0);
  9392. SET_H_VBIT_MOVE (0);
  9393. {
  9394. {
  9395. BI opval = 0;
  9396. CPU (h_xbit) = opval;
  9397. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9398. }
  9399. {
  9400. BI opval = 0;
  9401. SET_H_INSN_PREFIXED_P (opval);
  9402. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9403. }
  9404. }
  9405. }
  9406. }
  9407. #undef FLD
  9408. }
  9409. NEXT (vpc);
  9410. CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
  9411. {
  9412. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9413. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9414. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  9415. int UNUSED written = 0;
  9416. IADDR UNUSED pc = abuf->addr;
  9417. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9418. {
  9419. HI tmp_tmpd;
  9420. tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  9421. {
  9422. SI tmp_oldregval;
  9423. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9424. {
  9425. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  9426. SET_H_GR (FLD (f_operand2), opval);
  9427. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9428. }
  9429. }
  9430. {
  9431. {
  9432. BI opval = LTHI (tmp_tmpd, 0);
  9433. CPU (h_nbit) = opval;
  9434. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9435. }
  9436. {
  9437. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9438. CPU (h_zbit) = opval;
  9439. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9440. }
  9441. SET_H_CBIT_MOVE (0);
  9442. SET_H_VBIT_MOVE (0);
  9443. {
  9444. {
  9445. BI opval = 0;
  9446. CPU (h_xbit) = opval;
  9447. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9448. }
  9449. {
  9450. BI opval = 0;
  9451. SET_H_INSN_PREFIXED_P (opval);
  9452. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9453. }
  9454. }
  9455. }
  9456. }
  9457. #undef FLD
  9458. }
  9459. NEXT (vpc);
  9460. CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
  9461. {
  9462. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9463. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9464. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  9465. int UNUSED written = 0;
  9466. IADDR UNUSED pc = abuf->addr;
  9467. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9468. {
  9469. SI tmp_tmpd;
  9470. tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  9471. {
  9472. SI opval = tmp_tmpd;
  9473. SET_H_GR (FLD (f_operand2), opval);
  9474. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9475. }
  9476. {
  9477. {
  9478. BI opval = LTSI (tmp_tmpd, 0);
  9479. CPU (h_nbit) = opval;
  9480. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9481. }
  9482. {
  9483. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9484. CPU (h_zbit) = opval;
  9485. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9486. }
  9487. SET_H_CBIT_MOVE (0);
  9488. SET_H_VBIT_MOVE (0);
  9489. {
  9490. {
  9491. BI opval = 0;
  9492. CPU (h_xbit) = opval;
  9493. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9494. }
  9495. {
  9496. BI opval = 0;
  9497. SET_H_INSN_PREFIXED_P (opval);
  9498. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9499. }
  9500. }
  9501. }
  9502. }
  9503. #undef FLD
  9504. }
  9505. NEXT (vpc);
  9506. CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
  9507. {
  9508. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9509. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9510. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  9511. int UNUSED written = 0;
  9512. IADDR UNUSED pc = abuf->addr;
  9513. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9514. {
  9515. QI tmp_tmpd;
  9516. tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  9517. QI tmp_tmp_mem;
  9518. BI tmp_postinc;
  9519. tmp_postinc = FLD (f_memmode);
  9520. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  9521. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  9522. ; if (NEBI (tmp_postinc, 0)) {
  9523. {
  9524. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  9525. tmp_addr = ADDSI (tmp_addr, 1);
  9526. }
  9527. {
  9528. SI opval = tmp_addr;
  9529. SET_H_GR (FLD (f_operand1), opval);
  9530. written |= (1 << 11);
  9531. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9532. }
  9533. }
  9534. }
  9535. ; tmp_tmp_mem; }));
  9536. {
  9537. SI tmp_oldregval;
  9538. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  9539. {
  9540. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  9541. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  9542. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9543. }
  9544. }
  9545. {
  9546. {
  9547. BI opval = LTQI (tmp_tmpd, 0);
  9548. CPU (h_nbit) = opval;
  9549. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9550. }
  9551. {
  9552. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9553. CPU (h_zbit) = opval;
  9554. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9555. }
  9556. SET_H_CBIT_MOVE (0);
  9557. SET_H_VBIT_MOVE (0);
  9558. {
  9559. {
  9560. BI opval = 0;
  9561. CPU (h_xbit) = opval;
  9562. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9563. }
  9564. {
  9565. BI opval = 0;
  9566. SET_H_INSN_PREFIXED_P (opval);
  9567. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9568. }
  9569. }
  9570. }
  9571. }
  9572. abuf->written = written;
  9573. #undef FLD
  9574. }
  9575. NEXT (vpc);
  9576. CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
  9577. {
  9578. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9579. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9580. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  9581. int UNUSED written = 0;
  9582. IADDR UNUSED pc = abuf->addr;
  9583. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9584. {
  9585. HI tmp_tmpd;
  9586. tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  9587. HI tmp_tmp_mem;
  9588. BI tmp_postinc;
  9589. tmp_postinc = FLD (f_memmode);
  9590. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  9591. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  9592. ; if (NEBI (tmp_postinc, 0)) {
  9593. {
  9594. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  9595. tmp_addr = ADDSI (tmp_addr, 2);
  9596. }
  9597. {
  9598. SI opval = tmp_addr;
  9599. SET_H_GR (FLD (f_operand1), opval);
  9600. written |= (1 << 11);
  9601. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9602. }
  9603. }
  9604. }
  9605. ; tmp_tmp_mem; }));
  9606. {
  9607. SI tmp_oldregval;
  9608. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  9609. {
  9610. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  9611. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  9612. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9613. }
  9614. }
  9615. {
  9616. {
  9617. BI opval = LTHI (tmp_tmpd, 0);
  9618. CPU (h_nbit) = opval;
  9619. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9620. }
  9621. {
  9622. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9623. CPU (h_zbit) = opval;
  9624. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9625. }
  9626. SET_H_CBIT_MOVE (0);
  9627. SET_H_VBIT_MOVE (0);
  9628. {
  9629. {
  9630. BI opval = 0;
  9631. CPU (h_xbit) = opval;
  9632. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9633. }
  9634. {
  9635. BI opval = 0;
  9636. SET_H_INSN_PREFIXED_P (opval);
  9637. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9638. }
  9639. }
  9640. }
  9641. }
  9642. abuf->written = written;
  9643. #undef FLD
  9644. }
  9645. NEXT (vpc);
  9646. CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
  9647. {
  9648. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9649. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9650. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  9651. int UNUSED written = 0;
  9652. IADDR UNUSED pc = abuf->addr;
  9653. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9654. {
  9655. SI tmp_tmpd;
  9656. tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  9657. SI tmp_tmp_mem;
  9658. BI tmp_postinc;
  9659. tmp_postinc = FLD (f_memmode);
  9660. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  9661. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  9662. ; if (NEBI (tmp_postinc, 0)) {
  9663. {
  9664. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  9665. tmp_addr = ADDSI (tmp_addr, 4);
  9666. }
  9667. {
  9668. SI opval = tmp_addr;
  9669. SET_H_GR (FLD (f_operand1), opval);
  9670. written |= (1 << 10);
  9671. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9672. }
  9673. }
  9674. }
  9675. ; tmp_tmp_mem; }));
  9676. {
  9677. SI opval = tmp_tmpd;
  9678. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  9679. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9680. }
  9681. {
  9682. {
  9683. BI opval = LTSI (tmp_tmpd, 0);
  9684. CPU (h_nbit) = opval;
  9685. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9686. }
  9687. {
  9688. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9689. CPU (h_zbit) = opval;
  9690. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9691. }
  9692. SET_H_CBIT_MOVE (0);
  9693. SET_H_VBIT_MOVE (0);
  9694. {
  9695. {
  9696. BI opval = 0;
  9697. CPU (h_xbit) = opval;
  9698. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9699. }
  9700. {
  9701. BI opval = 0;
  9702. SET_H_INSN_PREFIXED_P (opval);
  9703. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9704. }
  9705. }
  9706. }
  9707. }
  9708. abuf->written = written;
  9709. #undef FLD
  9710. }
  9711. NEXT (vpc);
  9712. CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
  9713. {
  9714. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9715. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9716. #define FLD(f) abuf->fields.sfmt_addcbr.f
  9717. int UNUSED written = 0;
  9718. IADDR UNUSED pc = abuf->addr;
  9719. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  9720. {
  9721. QI tmp_tmpd;
  9722. tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
  9723. {
  9724. SI tmp_oldregval;
  9725. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9726. {
  9727. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  9728. SET_H_GR (FLD (f_operand2), opval);
  9729. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9730. }
  9731. }
  9732. {
  9733. {
  9734. BI opval = LTQI (tmp_tmpd, 0);
  9735. CPU (h_nbit) = opval;
  9736. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9737. }
  9738. {
  9739. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9740. CPU (h_zbit) = opval;
  9741. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9742. }
  9743. SET_H_CBIT_MOVE (0);
  9744. SET_H_VBIT_MOVE (0);
  9745. {
  9746. {
  9747. BI opval = 0;
  9748. CPU (h_xbit) = opval;
  9749. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9750. }
  9751. {
  9752. BI opval = 0;
  9753. SET_H_INSN_PREFIXED_P (opval);
  9754. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9755. }
  9756. }
  9757. }
  9758. }
  9759. #undef FLD
  9760. }
  9761. NEXT (vpc);
  9762. CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
  9763. {
  9764. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9765. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9766. #define FLD(f) abuf->fields.sfmt_addcwr.f
  9767. int UNUSED written = 0;
  9768. IADDR UNUSED pc = abuf->addr;
  9769. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  9770. {
  9771. HI tmp_tmpd;
  9772. tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
  9773. {
  9774. SI tmp_oldregval;
  9775. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9776. {
  9777. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  9778. SET_H_GR (FLD (f_operand2), opval);
  9779. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9780. }
  9781. }
  9782. {
  9783. {
  9784. BI opval = LTHI (tmp_tmpd, 0);
  9785. CPU (h_nbit) = opval;
  9786. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9787. }
  9788. {
  9789. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9790. CPU (h_zbit) = opval;
  9791. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9792. }
  9793. SET_H_CBIT_MOVE (0);
  9794. SET_H_VBIT_MOVE (0);
  9795. {
  9796. {
  9797. BI opval = 0;
  9798. CPU (h_xbit) = opval;
  9799. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9800. }
  9801. {
  9802. BI opval = 0;
  9803. SET_H_INSN_PREFIXED_P (opval);
  9804. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9805. }
  9806. }
  9807. }
  9808. }
  9809. #undef FLD
  9810. }
  9811. NEXT (vpc);
  9812. CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
  9813. {
  9814. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9815. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9816. #define FLD(f) abuf->fields.sfmt_addcdr.f
  9817. int UNUSED written = 0;
  9818. IADDR UNUSED pc = abuf->addr;
  9819. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  9820. {
  9821. SI tmp_tmpd;
  9822. tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
  9823. {
  9824. SI opval = tmp_tmpd;
  9825. SET_H_GR (FLD (f_operand2), opval);
  9826. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9827. }
  9828. {
  9829. {
  9830. BI opval = LTSI (tmp_tmpd, 0);
  9831. CPU (h_nbit) = opval;
  9832. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9833. }
  9834. {
  9835. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9836. CPU (h_zbit) = opval;
  9837. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9838. }
  9839. SET_H_CBIT_MOVE (0);
  9840. SET_H_VBIT_MOVE (0);
  9841. {
  9842. {
  9843. BI opval = 0;
  9844. CPU (h_xbit) = opval;
  9845. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9846. }
  9847. {
  9848. BI opval = 0;
  9849. SET_H_INSN_PREFIXED_P (opval);
  9850. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9851. }
  9852. }
  9853. }
  9854. }
  9855. #undef FLD
  9856. }
  9857. NEXT (vpc);
  9858. CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
  9859. {
  9860. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9861. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9862. #define FLD(f) abuf->fields.sfmt_andq.f
  9863. int UNUSED written = 0;
  9864. IADDR UNUSED pc = abuf->addr;
  9865. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9866. {
  9867. SI tmp_tmpd;
  9868. tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
  9869. {
  9870. SI opval = tmp_tmpd;
  9871. SET_H_GR (FLD (f_operand2), opval);
  9872. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9873. }
  9874. {
  9875. {
  9876. BI opval = LTSI (tmp_tmpd, 0);
  9877. CPU (h_nbit) = opval;
  9878. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9879. }
  9880. {
  9881. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9882. CPU (h_zbit) = opval;
  9883. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9884. }
  9885. SET_H_CBIT_MOVE (0);
  9886. SET_H_VBIT_MOVE (0);
  9887. {
  9888. {
  9889. BI opval = 0;
  9890. CPU (h_xbit) = opval;
  9891. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9892. }
  9893. {
  9894. BI opval = 0;
  9895. SET_H_INSN_PREFIXED_P (opval);
  9896. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9897. }
  9898. }
  9899. }
  9900. }
  9901. #undef FLD
  9902. }
  9903. NEXT (vpc);
  9904. CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
  9905. {
  9906. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9907. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9908. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  9909. int UNUSED written = 0;
  9910. IADDR UNUSED pc = abuf->addr;
  9911. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9912. {
  9913. QI tmp_tmpd;
  9914. tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  9915. {
  9916. SI tmp_oldregval;
  9917. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9918. {
  9919. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  9920. SET_H_GR (FLD (f_operand2), opval);
  9921. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9922. }
  9923. }
  9924. {
  9925. {
  9926. BI opval = LTQI (tmp_tmpd, 0);
  9927. CPU (h_nbit) = opval;
  9928. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9929. }
  9930. {
  9931. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9932. CPU (h_zbit) = opval;
  9933. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9934. }
  9935. SET_H_CBIT_MOVE (0);
  9936. SET_H_VBIT_MOVE (0);
  9937. {
  9938. {
  9939. BI opval = 0;
  9940. CPU (h_xbit) = opval;
  9941. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9942. }
  9943. {
  9944. BI opval = 0;
  9945. SET_H_INSN_PREFIXED_P (opval);
  9946. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9947. }
  9948. }
  9949. }
  9950. }
  9951. #undef FLD
  9952. }
  9953. NEXT (vpc);
  9954. CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
  9955. {
  9956. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  9957. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  9958. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  9959. int UNUSED written = 0;
  9960. IADDR UNUSED pc = abuf->addr;
  9961. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  9962. {
  9963. HI tmp_tmpd;
  9964. tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  9965. {
  9966. SI tmp_oldregval;
  9967. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  9968. {
  9969. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  9970. SET_H_GR (FLD (f_operand2), opval);
  9971. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  9972. }
  9973. }
  9974. {
  9975. {
  9976. BI opval = LTHI (tmp_tmpd, 0);
  9977. CPU (h_nbit) = opval;
  9978. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  9979. }
  9980. {
  9981. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  9982. CPU (h_zbit) = opval;
  9983. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  9984. }
  9985. SET_H_CBIT_MOVE (0);
  9986. SET_H_VBIT_MOVE (0);
  9987. {
  9988. {
  9989. BI opval = 0;
  9990. CPU (h_xbit) = opval;
  9991. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  9992. }
  9993. {
  9994. BI opval = 0;
  9995. SET_H_INSN_PREFIXED_P (opval);
  9996. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  9997. }
  9998. }
  9999. }
  10000. }
  10001. #undef FLD
  10002. }
  10003. NEXT (vpc);
  10004. CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
  10005. {
  10006. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10007. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10008. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10009. int UNUSED written = 0;
  10010. IADDR UNUSED pc = abuf->addr;
  10011. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10012. {
  10013. SI tmp_tmpd;
  10014. tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  10015. {
  10016. SI opval = tmp_tmpd;
  10017. SET_H_GR (FLD (f_operand2), opval);
  10018. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10019. }
  10020. {
  10021. {
  10022. BI opval = LTSI (tmp_tmpd, 0);
  10023. CPU (h_nbit) = opval;
  10024. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10025. }
  10026. {
  10027. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10028. CPU (h_zbit) = opval;
  10029. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10030. }
  10031. SET_H_CBIT_MOVE (0);
  10032. SET_H_VBIT_MOVE (0);
  10033. {
  10034. {
  10035. BI opval = 0;
  10036. CPU (h_xbit) = opval;
  10037. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10038. }
  10039. {
  10040. BI opval = 0;
  10041. SET_H_INSN_PREFIXED_P (opval);
  10042. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10043. }
  10044. }
  10045. }
  10046. }
  10047. #undef FLD
  10048. }
  10049. NEXT (vpc);
  10050. CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
  10051. {
  10052. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10053. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10054. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  10055. int UNUSED written = 0;
  10056. IADDR UNUSED pc = abuf->addr;
  10057. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10058. {
  10059. QI tmp_tmpd;
  10060. tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  10061. QI tmp_tmp_mem;
  10062. BI tmp_postinc;
  10063. tmp_postinc = FLD (f_memmode);
  10064. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  10065. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  10066. ; if (NEBI (tmp_postinc, 0)) {
  10067. {
  10068. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  10069. tmp_addr = ADDSI (tmp_addr, 1);
  10070. }
  10071. {
  10072. SI opval = tmp_addr;
  10073. SET_H_GR (FLD (f_operand1), opval);
  10074. written |= (1 << 11);
  10075. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10076. }
  10077. }
  10078. }
  10079. ; tmp_tmp_mem; }));
  10080. {
  10081. SI tmp_oldregval;
  10082. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  10083. {
  10084. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  10085. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  10086. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10087. }
  10088. }
  10089. {
  10090. {
  10091. BI opval = LTQI (tmp_tmpd, 0);
  10092. CPU (h_nbit) = opval;
  10093. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10094. }
  10095. {
  10096. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10097. CPU (h_zbit) = opval;
  10098. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10099. }
  10100. SET_H_CBIT_MOVE (0);
  10101. SET_H_VBIT_MOVE (0);
  10102. {
  10103. {
  10104. BI opval = 0;
  10105. CPU (h_xbit) = opval;
  10106. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10107. }
  10108. {
  10109. BI opval = 0;
  10110. SET_H_INSN_PREFIXED_P (opval);
  10111. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10112. }
  10113. }
  10114. }
  10115. }
  10116. abuf->written = written;
  10117. #undef FLD
  10118. }
  10119. NEXT (vpc);
  10120. CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
  10121. {
  10122. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10123. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10124. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  10125. int UNUSED written = 0;
  10126. IADDR UNUSED pc = abuf->addr;
  10127. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10128. {
  10129. HI tmp_tmpd;
  10130. tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  10131. HI tmp_tmp_mem;
  10132. BI tmp_postinc;
  10133. tmp_postinc = FLD (f_memmode);
  10134. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  10135. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  10136. ; if (NEBI (tmp_postinc, 0)) {
  10137. {
  10138. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  10139. tmp_addr = ADDSI (tmp_addr, 2);
  10140. }
  10141. {
  10142. SI opval = tmp_addr;
  10143. SET_H_GR (FLD (f_operand1), opval);
  10144. written |= (1 << 11);
  10145. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10146. }
  10147. }
  10148. }
  10149. ; tmp_tmp_mem; }));
  10150. {
  10151. SI tmp_oldregval;
  10152. tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
  10153. {
  10154. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  10155. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  10156. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10157. }
  10158. }
  10159. {
  10160. {
  10161. BI opval = LTHI (tmp_tmpd, 0);
  10162. CPU (h_nbit) = opval;
  10163. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10164. }
  10165. {
  10166. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10167. CPU (h_zbit) = opval;
  10168. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10169. }
  10170. SET_H_CBIT_MOVE (0);
  10171. SET_H_VBIT_MOVE (0);
  10172. {
  10173. {
  10174. BI opval = 0;
  10175. CPU (h_xbit) = opval;
  10176. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10177. }
  10178. {
  10179. BI opval = 0;
  10180. SET_H_INSN_PREFIXED_P (opval);
  10181. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10182. }
  10183. }
  10184. }
  10185. }
  10186. abuf->written = written;
  10187. #undef FLD
  10188. }
  10189. NEXT (vpc);
  10190. CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
  10191. {
  10192. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10193. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10194. #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
  10195. int UNUSED written = 0;
  10196. IADDR UNUSED pc = abuf->addr;
  10197. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10198. {
  10199. SI tmp_tmpd;
  10200. tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
  10201. SI tmp_tmp_mem;
  10202. BI tmp_postinc;
  10203. tmp_postinc = FLD (f_memmode);
  10204. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  10205. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  10206. ; if (NEBI (tmp_postinc, 0)) {
  10207. {
  10208. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  10209. tmp_addr = ADDSI (tmp_addr, 4);
  10210. }
  10211. {
  10212. SI opval = tmp_addr;
  10213. SET_H_GR (FLD (f_operand1), opval);
  10214. written |= (1 << 10);
  10215. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10216. }
  10217. }
  10218. }
  10219. ; tmp_tmp_mem; }));
  10220. {
  10221. SI opval = tmp_tmpd;
  10222. SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
  10223. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10224. }
  10225. {
  10226. {
  10227. BI opval = LTSI (tmp_tmpd, 0);
  10228. CPU (h_nbit) = opval;
  10229. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10230. }
  10231. {
  10232. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10233. CPU (h_zbit) = opval;
  10234. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10235. }
  10236. SET_H_CBIT_MOVE (0);
  10237. SET_H_VBIT_MOVE (0);
  10238. {
  10239. {
  10240. BI opval = 0;
  10241. CPU (h_xbit) = opval;
  10242. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10243. }
  10244. {
  10245. BI opval = 0;
  10246. SET_H_INSN_PREFIXED_P (opval);
  10247. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10248. }
  10249. }
  10250. }
  10251. }
  10252. abuf->written = written;
  10253. #undef FLD
  10254. }
  10255. NEXT (vpc);
  10256. CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
  10257. {
  10258. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10259. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10260. #define FLD(f) abuf->fields.sfmt_addcbr.f
  10261. int UNUSED written = 0;
  10262. IADDR UNUSED pc = abuf->addr;
  10263. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  10264. {
  10265. QI tmp_tmpd;
  10266. tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
  10267. {
  10268. SI tmp_oldregval;
  10269. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10270. {
  10271. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  10272. SET_H_GR (FLD (f_operand2), opval);
  10273. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10274. }
  10275. }
  10276. {
  10277. {
  10278. BI opval = LTQI (tmp_tmpd, 0);
  10279. CPU (h_nbit) = opval;
  10280. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10281. }
  10282. {
  10283. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10284. CPU (h_zbit) = opval;
  10285. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10286. }
  10287. SET_H_CBIT_MOVE (0);
  10288. SET_H_VBIT_MOVE (0);
  10289. {
  10290. {
  10291. BI opval = 0;
  10292. CPU (h_xbit) = opval;
  10293. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10294. }
  10295. {
  10296. BI opval = 0;
  10297. SET_H_INSN_PREFIXED_P (opval);
  10298. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10299. }
  10300. }
  10301. }
  10302. }
  10303. #undef FLD
  10304. }
  10305. NEXT (vpc);
  10306. CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
  10307. {
  10308. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10309. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10310. #define FLD(f) abuf->fields.sfmt_addcwr.f
  10311. int UNUSED written = 0;
  10312. IADDR UNUSED pc = abuf->addr;
  10313. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  10314. {
  10315. HI tmp_tmpd;
  10316. tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
  10317. {
  10318. SI tmp_oldregval;
  10319. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10320. {
  10321. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  10322. SET_H_GR (FLD (f_operand2), opval);
  10323. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10324. }
  10325. }
  10326. {
  10327. {
  10328. BI opval = LTHI (tmp_tmpd, 0);
  10329. CPU (h_nbit) = opval;
  10330. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10331. }
  10332. {
  10333. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10334. CPU (h_zbit) = opval;
  10335. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10336. }
  10337. SET_H_CBIT_MOVE (0);
  10338. SET_H_VBIT_MOVE (0);
  10339. {
  10340. {
  10341. BI opval = 0;
  10342. CPU (h_xbit) = opval;
  10343. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10344. }
  10345. {
  10346. BI opval = 0;
  10347. SET_H_INSN_PREFIXED_P (opval);
  10348. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10349. }
  10350. }
  10351. }
  10352. }
  10353. #undef FLD
  10354. }
  10355. NEXT (vpc);
  10356. CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
  10357. {
  10358. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10359. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10360. #define FLD(f) abuf->fields.sfmt_addcdr.f
  10361. int UNUSED written = 0;
  10362. IADDR UNUSED pc = abuf->addr;
  10363. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  10364. {
  10365. SI tmp_tmpd;
  10366. tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
  10367. {
  10368. SI opval = tmp_tmpd;
  10369. SET_H_GR (FLD (f_operand2), opval);
  10370. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10371. }
  10372. {
  10373. {
  10374. BI opval = LTSI (tmp_tmpd, 0);
  10375. CPU (h_nbit) = opval;
  10376. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10377. }
  10378. {
  10379. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10380. CPU (h_zbit) = opval;
  10381. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10382. }
  10383. SET_H_CBIT_MOVE (0);
  10384. SET_H_VBIT_MOVE (0);
  10385. {
  10386. {
  10387. BI opval = 0;
  10388. CPU (h_xbit) = opval;
  10389. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10390. }
  10391. {
  10392. BI opval = 0;
  10393. SET_H_INSN_PREFIXED_P (opval);
  10394. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10395. }
  10396. }
  10397. }
  10398. }
  10399. #undef FLD
  10400. }
  10401. NEXT (vpc);
  10402. CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
  10403. {
  10404. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10405. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10406. #define FLD(f) abuf->fields.sfmt_andq.f
  10407. int UNUSED written = 0;
  10408. IADDR UNUSED pc = abuf->addr;
  10409. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10410. {
  10411. SI tmp_tmpd;
  10412. tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
  10413. {
  10414. SI opval = tmp_tmpd;
  10415. SET_H_GR (FLD (f_operand2), opval);
  10416. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10417. }
  10418. {
  10419. {
  10420. BI opval = LTSI (tmp_tmpd, 0);
  10421. CPU (h_nbit) = opval;
  10422. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10423. }
  10424. {
  10425. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10426. CPU (h_zbit) = opval;
  10427. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10428. }
  10429. SET_H_CBIT_MOVE (0);
  10430. SET_H_VBIT_MOVE (0);
  10431. {
  10432. {
  10433. BI opval = 0;
  10434. CPU (h_xbit) = opval;
  10435. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10436. }
  10437. {
  10438. BI opval = 0;
  10439. SET_H_INSN_PREFIXED_P (opval);
  10440. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10441. }
  10442. }
  10443. }
  10444. }
  10445. #undef FLD
  10446. }
  10447. NEXT (vpc);
  10448. CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
  10449. {
  10450. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10451. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10452. #define FLD(f) abuf->fields.sfmt_muls_b.f
  10453. int UNUSED written = 0;
  10454. IADDR UNUSED pc = abuf->addr;
  10455. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10456. {
  10457. SI tmp_tmpd;
  10458. tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
  10459. {
  10460. SI opval = tmp_tmpd;
  10461. SET_H_GR (FLD (f_operand2), opval);
  10462. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10463. }
  10464. {
  10465. {
  10466. BI opval = LTSI (tmp_tmpd, 0);
  10467. CPU (h_nbit) = opval;
  10468. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10469. }
  10470. {
  10471. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10472. CPU (h_zbit) = opval;
  10473. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10474. }
  10475. SET_H_CBIT_MOVE (0);
  10476. SET_H_VBIT_MOVE (0);
  10477. {
  10478. {
  10479. BI opval = 0;
  10480. CPU (h_xbit) = opval;
  10481. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10482. }
  10483. {
  10484. BI opval = 0;
  10485. SET_H_INSN_PREFIXED_P (opval);
  10486. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10487. }
  10488. }
  10489. }
  10490. }
  10491. #undef FLD
  10492. }
  10493. NEXT (vpc);
  10494. CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
  10495. {
  10496. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10497. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10498. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  10499. int UNUSED written = 0;
  10500. IADDR UNUSED pc = abuf->addr;
  10501. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10502. {
  10503. SI tmp_tmps;
  10504. SI tmp_tmpd;
  10505. tmp_tmps = GET_H_GR (FLD (f_operand1));
  10506. tmp_tmpd = ({ SI tmp_tmpcode;
  10507. SI tmp_tmpval;
  10508. SI tmp_tmpres;
  10509. tmp_tmpcode = FLD (f_operand2);
  10510. ; tmp_tmpval = tmp_tmps;
  10511. ; if (EQSI (tmp_tmpcode, 0)) {
  10512. tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
  10513. }
  10514. else if (EQSI (tmp_tmpcode, 1)) {
  10515. tmp_tmpres = ({ SI tmp_tmpr;
  10516. tmp_tmpr = tmp_tmpval;
  10517. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10518. }
  10519. else if (EQSI (tmp_tmpcode, 2)) {
  10520. tmp_tmpres = ({ SI tmp_tmpb;
  10521. tmp_tmpb = tmp_tmpval;
  10522. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10523. }
  10524. else if (EQSI (tmp_tmpcode, 3)) {
  10525. tmp_tmpres = ({ SI tmp_tmpr;
  10526. tmp_tmpr = ({ SI tmp_tmpb;
  10527. tmp_tmpb = tmp_tmpval;
  10528. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10529. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10530. }
  10531. else if (EQSI (tmp_tmpcode, 4)) {
  10532. tmp_tmpres = ({ SI tmp_tmpb;
  10533. tmp_tmpb = tmp_tmpval;
  10534. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10535. }
  10536. else if (EQSI (tmp_tmpcode, 5)) {
  10537. tmp_tmpres = ({ SI tmp_tmpr;
  10538. tmp_tmpr = ({ SI tmp_tmpb;
  10539. tmp_tmpb = tmp_tmpval;
  10540. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10541. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10542. }
  10543. else if (EQSI (tmp_tmpcode, 6)) {
  10544. tmp_tmpres = ({ SI tmp_tmpb;
  10545. tmp_tmpb = ({ SI tmp_tmpb;
  10546. tmp_tmpb = tmp_tmpval;
  10547. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10548. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10549. }
  10550. else if (EQSI (tmp_tmpcode, 7)) {
  10551. tmp_tmpres = ({ SI tmp_tmpr;
  10552. tmp_tmpr = ({ SI tmp_tmpb;
  10553. tmp_tmpb = ({ SI tmp_tmpb;
  10554. tmp_tmpb = tmp_tmpval;
  10555. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10556. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10557. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10558. }
  10559. else if (EQSI (tmp_tmpcode, 8)) {
  10560. tmp_tmpres = INVSI (tmp_tmpval);
  10561. }
  10562. else if (EQSI (tmp_tmpcode, 9)) {
  10563. tmp_tmpres = ({ SI tmp_tmpr;
  10564. tmp_tmpr = INVSI (tmp_tmpval);
  10565. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10566. }
  10567. else if (EQSI (tmp_tmpcode, 10)) {
  10568. tmp_tmpres = ({ SI tmp_tmpb;
  10569. tmp_tmpb = INVSI (tmp_tmpval);
  10570. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10571. }
  10572. else if (EQSI (tmp_tmpcode, 11)) {
  10573. tmp_tmpres = ({ SI tmp_tmpr;
  10574. tmp_tmpr = ({ SI tmp_tmpb;
  10575. tmp_tmpb = INVSI (tmp_tmpval);
  10576. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10577. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10578. }
  10579. else if (EQSI (tmp_tmpcode, 12)) {
  10580. tmp_tmpres = ({ SI tmp_tmpb;
  10581. tmp_tmpb = INVSI (tmp_tmpval);
  10582. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10583. }
  10584. else if (EQSI (tmp_tmpcode, 13)) {
  10585. tmp_tmpres = ({ SI tmp_tmpr;
  10586. tmp_tmpr = ({ SI tmp_tmpb;
  10587. tmp_tmpb = INVSI (tmp_tmpval);
  10588. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10589. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10590. }
  10591. else if (EQSI (tmp_tmpcode, 14)) {
  10592. tmp_tmpres = ({ SI tmp_tmpb;
  10593. tmp_tmpb = ({ SI tmp_tmpb;
  10594. tmp_tmpb = INVSI (tmp_tmpval);
  10595. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10596. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10597. }
  10598. else if (EQSI (tmp_tmpcode, 15)) {
  10599. tmp_tmpres = ({ SI tmp_tmpr;
  10600. tmp_tmpr = ({ SI tmp_tmpb;
  10601. tmp_tmpb = ({ SI tmp_tmpb;
  10602. tmp_tmpb = INVSI (tmp_tmpval);
  10603. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
  10604. ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
  10605. ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
  10606. }
  10607. ; tmp_tmpres; });
  10608. {
  10609. SI opval = tmp_tmpd;
  10610. SET_H_GR (FLD (f_operand1), opval);
  10611. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10612. }
  10613. {
  10614. {
  10615. BI opval = LTSI (tmp_tmpd, 0);
  10616. CPU (h_nbit) = opval;
  10617. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10618. }
  10619. {
  10620. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10621. CPU (h_zbit) = opval;
  10622. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10623. }
  10624. SET_H_CBIT_MOVE (0);
  10625. SET_H_VBIT_MOVE (0);
  10626. {
  10627. {
  10628. BI opval = 0;
  10629. CPU (h_xbit) = opval;
  10630. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10631. }
  10632. {
  10633. BI opval = 0;
  10634. SET_H_INSN_PREFIXED_P (opval);
  10635. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10636. }
  10637. }
  10638. }
  10639. }
  10640. #undef FLD
  10641. }
  10642. NEXT (vpc);
  10643. CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
  10644. {
  10645. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10646. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10647. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10648. int UNUSED written = 0;
  10649. IADDR UNUSED pc = abuf->addr;
  10650. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10651. {
  10652. QI tmp_tmpd;
  10653. SI tmp_cnt1;
  10654. SI tmp_cnt2;
  10655. tmp_cnt1 = GET_H_GR (FLD (f_operand1));
  10656. tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
  10657. tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
  10658. {
  10659. SI tmp_oldregval;
  10660. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10661. {
  10662. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  10663. SET_H_GR (FLD (f_operand2), opval);
  10664. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10665. }
  10666. }
  10667. {
  10668. {
  10669. BI opval = LTQI (tmp_tmpd, 0);
  10670. CPU (h_nbit) = opval;
  10671. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10672. }
  10673. {
  10674. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10675. CPU (h_zbit) = opval;
  10676. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10677. }
  10678. SET_H_CBIT_MOVE (0);
  10679. SET_H_VBIT_MOVE (0);
  10680. {
  10681. {
  10682. BI opval = 0;
  10683. CPU (h_xbit) = opval;
  10684. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10685. }
  10686. {
  10687. BI opval = 0;
  10688. SET_H_INSN_PREFIXED_P (opval);
  10689. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10690. }
  10691. }
  10692. }
  10693. }
  10694. #undef FLD
  10695. }
  10696. NEXT (vpc);
  10697. CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
  10698. {
  10699. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10700. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10701. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10702. int UNUSED written = 0;
  10703. IADDR UNUSED pc = abuf->addr;
  10704. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10705. {
  10706. HI tmp_tmpd;
  10707. SI tmp_cnt1;
  10708. SI tmp_cnt2;
  10709. tmp_cnt1 = GET_H_GR (FLD (f_operand1));
  10710. tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
  10711. tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
  10712. {
  10713. SI tmp_oldregval;
  10714. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10715. {
  10716. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  10717. SET_H_GR (FLD (f_operand2), opval);
  10718. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10719. }
  10720. }
  10721. {
  10722. {
  10723. BI opval = LTHI (tmp_tmpd, 0);
  10724. CPU (h_nbit) = opval;
  10725. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10726. }
  10727. {
  10728. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10729. CPU (h_zbit) = opval;
  10730. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10731. }
  10732. SET_H_CBIT_MOVE (0);
  10733. SET_H_VBIT_MOVE (0);
  10734. {
  10735. {
  10736. BI opval = 0;
  10737. CPU (h_xbit) = opval;
  10738. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10739. }
  10740. {
  10741. BI opval = 0;
  10742. SET_H_INSN_PREFIXED_P (opval);
  10743. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10744. }
  10745. }
  10746. }
  10747. }
  10748. #undef FLD
  10749. }
  10750. NEXT (vpc);
  10751. CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
  10752. {
  10753. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10754. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10755. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10756. int UNUSED written = 0;
  10757. IADDR UNUSED pc = abuf->addr;
  10758. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10759. {
  10760. SI tmp_tmpd;
  10761. SI tmp_cnt1;
  10762. SI tmp_cnt2;
  10763. tmp_cnt1 = GET_H_GR (FLD (f_operand1));
  10764. tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
  10765. tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
  10766. {
  10767. SI opval = tmp_tmpd;
  10768. SET_H_GR (FLD (f_operand2), opval);
  10769. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10770. }
  10771. {
  10772. {
  10773. BI opval = LTSI (tmp_tmpd, 0);
  10774. CPU (h_nbit) = opval;
  10775. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10776. }
  10777. {
  10778. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10779. CPU (h_zbit) = opval;
  10780. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10781. }
  10782. SET_H_CBIT_MOVE (0);
  10783. SET_H_VBIT_MOVE (0);
  10784. {
  10785. {
  10786. BI opval = 0;
  10787. CPU (h_xbit) = opval;
  10788. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10789. }
  10790. {
  10791. BI opval = 0;
  10792. SET_H_INSN_PREFIXED_P (opval);
  10793. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10794. }
  10795. }
  10796. }
  10797. }
  10798. #undef FLD
  10799. }
  10800. NEXT (vpc);
  10801. CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
  10802. {
  10803. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10804. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10805. #define FLD(f) abuf->fields.sfmt_asrq.f
  10806. int UNUSED written = 0;
  10807. IADDR UNUSED pc = abuf->addr;
  10808. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10809. {
  10810. SI tmp_tmpd;
  10811. tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
  10812. {
  10813. SI opval = tmp_tmpd;
  10814. SET_H_GR (FLD (f_operand2), opval);
  10815. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10816. }
  10817. {
  10818. {
  10819. BI opval = LTSI (tmp_tmpd, 0);
  10820. CPU (h_nbit) = opval;
  10821. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10822. }
  10823. {
  10824. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10825. CPU (h_zbit) = opval;
  10826. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10827. }
  10828. SET_H_CBIT_MOVE (0);
  10829. SET_H_VBIT_MOVE (0);
  10830. {
  10831. {
  10832. BI opval = 0;
  10833. CPU (h_xbit) = opval;
  10834. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10835. }
  10836. {
  10837. BI opval = 0;
  10838. SET_H_INSN_PREFIXED_P (opval);
  10839. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10840. }
  10841. }
  10842. }
  10843. }
  10844. #undef FLD
  10845. }
  10846. NEXT (vpc);
  10847. CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
  10848. {
  10849. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10850. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10851. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10852. int UNUSED written = 0;
  10853. IADDR UNUSED pc = abuf->addr;
  10854. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10855. {
  10856. SI tmp_tmpd;
  10857. SI tmp_cnt;
  10858. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  10859. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  10860. {
  10861. SI tmp_oldregval;
  10862. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10863. {
  10864. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  10865. SET_H_GR (FLD (f_operand2), opval);
  10866. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10867. }
  10868. }
  10869. {
  10870. {
  10871. BI opval = LTQI (tmp_tmpd, 0);
  10872. CPU (h_nbit) = opval;
  10873. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10874. }
  10875. {
  10876. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10877. CPU (h_zbit) = opval;
  10878. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10879. }
  10880. SET_H_CBIT_MOVE (0);
  10881. SET_H_VBIT_MOVE (0);
  10882. {
  10883. {
  10884. BI opval = 0;
  10885. CPU (h_xbit) = opval;
  10886. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10887. }
  10888. {
  10889. BI opval = 0;
  10890. SET_H_INSN_PREFIXED_P (opval);
  10891. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10892. }
  10893. }
  10894. }
  10895. }
  10896. #undef FLD
  10897. }
  10898. NEXT (vpc);
  10899. CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
  10900. {
  10901. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10902. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10903. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10904. int UNUSED written = 0;
  10905. IADDR UNUSED pc = abuf->addr;
  10906. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10907. {
  10908. SI tmp_tmpd;
  10909. SI tmp_cnt;
  10910. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  10911. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  10912. {
  10913. SI tmp_oldregval;
  10914. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  10915. {
  10916. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  10917. SET_H_GR (FLD (f_operand2), opval);
  10918. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10919. }
  10920. }
  10921. {
  10922. {
  10923. BI opval = LTHI (tmp_tmpd, 0);
  10924. CPU (h_nbit) = opval;
  10925. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10926. }
  10927. {
  10928. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10929. CPU (h_zbit) = opval;
  10930. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10931. }
  10932. SET_H_CBIT_MOVE (0);
  10933. SET_H_VBIT_MOVE (0);
  10934. {
  10935. {
  10936. BI opval = 0;
  10937. CPU (h_xbit) = opval;
  10938. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10939. }
  10940. {
  10941. BI opval = 0;
  10942. SET_H_INSN_PREFIXED_P (opval);
  10943. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10944. }
  10945. }
  10946. }
  10947. }
  10948. #undef FLD
  10949. }
  10950. NEXT (vpc);
  10951. CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
  10952. {
  10953. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  10954. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  10955. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  10956. int UNUSED written = 0;
  10957. IADDR UNUSED pc = abuf->addr;
  10958. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  10959. {
  10960. SI tmp_tmpd;
  10961. SI tmp_cnt;
  10962. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  10963. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  10964. {
  10965. SI opval = tmp_tmpd;
  10966. SET_H_GR (FLD (f_operand2), opval);
  10967. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  10968. }
  10969. {
  10970. {
  10971. BI opval = LTSI (tmp_tmpd, 0);
  10972. CPU (h_nbit) = opval;
  10973. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  10974. }
  10975. {
  10976. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  10977. CPU (h_zbit) = opval;
  10978. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  10979. }
  10980. SET_H_CBIT_MOVE (0);
  10981. SET_H_VBIT_MOVE (0);
  10982. {
  10983. {
  10984. BI opval = 0;
  10985. CPU (h_xbit) = opval;
  10986. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  10987. }
  10988. {
  10989. BI opval = 0;
  10990. SET_H_INSN_PREFIXED_P (opval);
  10991. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  10992. }
  10993. }
  10994. }
  10995. }
  10996. #undef FLD
  10997. }
  10998. NEXT (vpc);
  10999. CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
  11000. {
  11001. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11002. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11003. #define FLD(f) abuf->fields.sfmt_asrq.f
  11004. int UNUSED written = 0;
  11005. IADDR UNUSED pc = abuf->addr;
  11006. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11007. {
  11008. SI tmp_tmpd;
  11009. tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
  11010. {
  11011. SI opval = tmp_tmpd;
  11012. SET_H_GR (FLD (f_operand2), opval);
  11013. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11014. }
  11015. {
  11016. {
  11017. BI opval = LTSI (tmp_tmpd, 0);
  11018. CPU (h_nbit) = opval;
  11019. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11020. }
  11021. {
  11022. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11023. CPU (h_zbit) = opval;
  11024. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11025. }
  11026. SET_H_CBIT_MOVE (0);
  11027. SET_H_VBIT_MOVE (0);
  11028. {
  11029. {
  11030. BI opval = 0;
  11031. CPU (h_xbit) = opval;
  11032. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11033. }
  11034. {
  11035. BI opval = 0;
  11036. SET_H_INSN_PREFIXED_P (opval);
  11037. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11038. }
  11039. }
  11040. }
  11041. }
  11042. #undef FLD
  11043. }
  11044. NEXT (vpc);
  11045. CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
  11046. {
  11047. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11048. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11049. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  11050. int UNUSED written = 0;
  11051. IADDR UNUSED pc = abuf->addr;
  11052. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11053. {
  11054. SI tmp_tmpd;
  11055. SI tmp_cnt;
  11056. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  11057. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  11058. {
  11059. SI tmp_oldregval;
  11060. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  11061. {
  11062. SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
  11063. SET_H_GR (FLD (f_operand2), opval);
  11064. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11065. }
  11066. }
  11067. {
  11068. {
  11069. BI opval = LTQI (tmp_tmpd, 0);
  11070. CPU (h_nbit) = opval;
  11071. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11072. }
  11073. {
  11074. BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11075. CPU (h_zbit) = opval;
  11076. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11077. }
  11078. SET_H_CBIT_MOVE (0);
  11079. SET_H_VBIT_MOVE (0);
  11080. {
  11081. {
  11082. BI opval = 0;
  11083. CPU (h_xbit) = opval;
  11084. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11085. }
  11086. {
  11087. BI opval = 0;
  11088. SET_H_INSN_PREFIXED_P (opval);
  11089. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11090. }
  11091. }
  11092. }
  11093. }
  11094. #undef FLD
  11095. }
  11096. NEXT (vpc);
  11097. CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
  11098. {
  11099. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11100. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11101. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  11102. int UNUSED written = 0;
  11103. IADDR UNUSED pc = abuf->addr;
  11104. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11105. {
  11106. SI tmp_tmpd;
  11107. SI tmp_cnt;
  11108. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  11109. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  11110. {
  11111. SI tmp_oldregval;
  11112. tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
  11113. {
  11114. SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
  11115. SET_H_GR (FLD (f_operand2), opval);
  11116. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11117. }
  11118. }
  11119. {
  11120. {
  11121. BI opval = LTHI (tmp_tmpd, 0);
  11122. CPU (h_nbit) = opval;
  11123. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11124. }
  11125. {
  11126. BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11127. CPU (h_zbit) = opval;
  11128. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11129. }
  11130. SET_H_CBIT_MOVE (0);
  11131. SET_H_VBIT_MOVE (0);
  11132. {
  11133. {
  11134. BI opval = 0;
  11135. CPU (h_xbit) = opval;
  11136. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11137. }
  11138. {
  11139. BI opval = 0;
  11140. SET_H_INSN_PREFIXED_P (opval);
  11141. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11142. }
  11143. }
  11144. }
  11145. }
  11146. #undef FLD
  11147. }
  11148. NEXT (vpc);
  11149. CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
  11150. {
  11151. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11152. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11153. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  11154. int UNUSED written = 0;
  11155. IADDR UNUSED pc = abuf->addr;
  11156. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11157. {
  11158. SI tmp_tmpd;
  11159. SI tmp_cnt;
  11160. tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
  11161. tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
  11162. {
  11163. SI opval = tmp_tmpd;
  11164. SET_H_GR (FLD (f_operand2), opval);
  11165. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11166. }
  11167. {
  11168. {
  11169. BI opval = LTSI (tmp_tmpd, 0);
  11170. CPU (h_nbit) = opval;
  11171. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11172. }
  11173. {
  11174. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11175. CPU (h_zbit) = opval;
  11176. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11177. }
  11178. SET_H_CBIT_MOVE (0);
  11179. SET_H_VBIT_MOVE (0);
  11180. {
  11181. {
  11182. BI opval = 0;
  11183. CPU (h_xbit) = opval;
  11184. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11185. }
  11186. {
  11187. BI opval = 0;
  11188. SET_H_INSN_PREFIXED_P (opval);
  11189. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11190. }
  11191. }
  11192. }
  11193. }
  11194. #undef FLD
  11195. }
  11196. NEXT (vpc);
  11197. CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
  11198. {
  11199. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11200. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11201. #define FLD(f) abuf->fields.sfmt_asrq.f
  11202. int UNUSED written = 0;
  11203. IADDR UNUSED pc = abuf->addr;
  11204. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11205. {
  11206. SI tmp_tmpd;
  11207. tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
  11208. {
  11209. SI opval = tmp_tmpd;
  11210. SET_H_GR (FLD (f_operand2), opval);
  11211. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11212. }
  11213. {
  11214. {
  11215. BI opval = LTSI (tmp_tmpd, 0);
  11216. CPU (h_nbit) = opval;
  11217. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11218. }
  11219. {
  11220. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11221. CPU (h_zbit) = opval;
  11222. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11223. }
  11224. SET_H_CBIT_MOVE (0);
  11225. SET_H_VBIT_MOVE (0);
  11226. {
  11227. {
  11228. BI opval = 0;
  11229. CPU (h_xbit) = opval;
  11230. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11231. }
  11232. {
  11233. BI opval = 0;
  11234. SET_H_INSN_PREFIXED_P (opval);
  11235. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11236. }
  11237. }
  11238. }
  11239. }
  11240. #undef FLD
  11241. }
  11242. NEXT (vpc);
  11243. CASE (sem, INSN_BTST) : /* $Rs,$Rd */
  11244. {
  11245. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11246. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11247. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  11248. int UNUSED written = 0;
  11249. IADDR UNUSED pc = abuf->addr;
  11250. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11251. {
  11252. SI tmp_tmpd;
  11253. SI tmp_cnt;
  11254. tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
  11255. {
  11256. {
  11257. BI opval = LTSI (tmp_tmpd, 0);
  11258. CPU (h_nbit) = opval;
  11259. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11260. }
  11261. {
  11262. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11263. CPU (h_zbit) = opval;
  11264. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11265. }
  11266. SET_H_CBIT_MOVE (0);
  11267. SET_H_VBIT_MOVE (0);
  11268. {
  11269. {
  11270. BI opval = 0;
  11271. CPU (h_xbit) = opval;
  11272. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11273. }
  11274. {
  11275. BI opval = 0;
  11276. SET_H_INSN_PREFIXED_P (opval);
  11277. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11278. }
  11279. }
  11280. }
  11281. }
  11282. #undef FLD
  11283. }
  11284. NEXT (vpc);
  11285. CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
  11286. {
  11287. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11288. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11289. #define FLD(f) abuf->fields.sfmt_asrq.f
  11290. int UNUSED written = 0;
  11291. IADDR UNUSED pc = abuf->addr;
  11292. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11293. {
  11294. SI tmp_tmpd;
  11295. tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
  11296. {
  11297. {
  11298. BI opval = LTSI (tmp_tmpd, 0);
  11299. CPU (h_nbit) = opval;
  11300. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11301. }
  11302. {
  11303. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11304. CPU (h_zbit) = opval;
  11305. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11306. }
  11307. SET_H_CBIT_MOVE (0);
  11308. SET_H_VBIT_MOVE (0);
  11309. {
  11310. {
  11311. BI opval = 0;
  11312. CPU (h_xbit) = opval;
  11313. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11314. }
  11315. {
  11316. BI opval = 0;
  11317. SET_H_INSN_PREFIXED_P (opval);
  11318. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11319. }
  11320. }
  11321. }
  11322. }
  11323. #undef FLD
  11324. }
  11325. NEXT (vpc);
  11326. CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
  11327. {
  11328. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11329. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11330. #define FLD(f) abuf->fields.sfmt_setf.f
  11331. int UNUSED written = 0;
  11332. IADDR UNUSED pc = abuf->addr;
  11333. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11334. {
  11335. SI tmp_tmp;
  11336. tmp_tmp = FLD (f_dstsrc);
  11337. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
  11338. {
  11339. BI opval = 1;
  11340. CPU (h_cbit) = opval;
  11341. written |= (1 << 1);
  11342. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  11343. }
  11344. }
  11345. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
  11346. {
  11347. BI opval = 1;
  11348. CPU (h_vbit) = opval;
  11349. written |= (1 << 7);
  11350. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  11351. }
  11352. }
  11353. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
  11354. {
  11355. BI opval = 1;
  11356. CPU (h_zbit) = opval;
  11357. written |= (1 << 9);
  11358. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11359. }
  11360. }
  11361. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
  11362. {
  11363. BI opval = 1;
  11364. CPU (h_nbit) = opval;
  11365. written |= (1 << 3);
  11366. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11367. }
  11368. }
  11369. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
  11370. {
  11371. BI opval = 1;
  11372. CPU (h_xbit) = opval;
  11373. written |= (1 << 8);
  11374. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11375. }
  11376. }
  11377. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
  11378. {
  11379. BI opval = 1;
  11380. SET_H_IBIT (opval);
  11381. written |= (1 << 2);
  11382. CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
  11383. }
  11384. }
  11385. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
  11386. {
  11387. BI opval = 1;
  11388. SET_H_UBIT (opval);
  11389. written |= (1 << 6);
  11390. CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
  11391. }
  11392. }
  11393. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
  11394. {
  11395. BI opval = 1;
  11396. CPU (h_pbit) = opval;
  11397. written |= (1 << 4);
  11398. CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
  11399. }
  11400. }
  11401. {
  11402. BI opval = 0;
  11403. SET_H_INSN_PREFIXED_P (opval);
  11404. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11405. }
  11406. if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
  11407. {
  11408. BI opval = 0;
  11409. CPU (h_xbit) = opval;
  11410. written |= (1 << 8);
  11411. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11412. }
  11413. }
  11414. }
  11415. abuf->written = written;
  11416. #undef FLD
  11417. }
  11418. NEXT (vpc);
  11419. CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
  11420. {
  11421. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11422. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11423. #define FLD(f) abuf->fields.sfmt_setf.f
  11424. int UNUSED written = 0;
  11425. IADDR UNUSED pc = abuf->addr;
  11426. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11427. {
  11428. SI tmp_tmp;
  11429. tmp_tmp = FLD (f_dstsrc);
  11430. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
  11431. {
  11432. BI opval = 0;
  11433. CPU (h_cbit) = opval;
  11434. written |= (1 << 1);
  11435. CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
  11436. }
  11437. }
  11438. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
  11439. {
  11440. BI opval = 0;
  11441. CPU (h_vbit) = opval;
  11442. written |= (1 << 7);
  11443. CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
  11444. }
  11445. }
  11446. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
  11447. {
  11448. BI opval = 0;
  11449. CPU (h_zbit) = opval;
  11450. written |= (1 << 9);
  11451. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11452. }
  11453. }
  11454. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
  11455. {
  11456. BI opval = 0;
  11457. CPU (h_nbit) = opval;
  11458. written |= (1 << 3);
  11459. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11460. }
  11461. }
  11462. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
  11463. {
  11464. BI opval = 0;
  11465. CPU (h_xbit) = opval;
  11466. written |= (1 << 8);
  11467. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11468. }
  11469. }
  11470. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
  11471. {
  11472. BI opval = 0;
  11473. SET_H_IBIT (opval);
  11474. written |= (1 << 2);
  11475. CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
  11476. }
  11477. }
  11478. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
  11479. {
  11480. BI opval = 0;
  11481. SET_H_UBIT (opval);
  11482. written |= (1 << 6);
  11483. CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
  11484. }
  11485. }
  11486. if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
  11487. {
  11488. BI opval = 0;
  11489. CPU (h_pbit) = opval;
  11490. written |= (1 << 4);
  11491. CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
  11492. }
  11493. }
  11494. {
  11495. {
  11496. BI opval = 0;
  11497. CPU (h_xbit) = opval;
  11498. written |= (1 << 8);
  11499. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11500. }
  11501. {
  11502. BI opval = 0;
  11503. SET_H_INSN_PREFIXED_P (opval);
  11504. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11505. }
  11506. }
  11507. }
  11508. abuf->written = written;
  11509. #undef FLD
  11510. }
  11511. NEXT (vpc);
  11512. CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
  11513. {
  11514. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11515. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11516. #define FLD(f) abuf->fields.sfmt_bcc_b.f
  11517. int UNUSED written = 0;
  11518. IADDR UNUSED pc = abuf->addr;
  11519. SEM_BRANCH_INIT
  11520. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11521. {
  11522. BI tmp_truthval;
  11523. tmp_truthval = ({ SI tmp_tmpcond;
  11524. BI tmp_condres;
  11525. tmp_tmpcond = FLD (f_operand2);
  11526. ; if (EQSI (tmp_tmpcond, 0)) {
  11527. tmp_condres = NOTBI (CPU (h_cbit));
  11528. }
  11529. else if (EQSI (tmp_tmpcond, 1)) {
  11530. tmp_condres = CPU (h_cbit);
  11531. }
  11532. else if (EQSI (tmp_tmpcond, 2)) {
  11533. tmp_condres = NOTBI (CPU (h_zbit));
  11534. }
  11535. else if (EQSI (tmp_tmpcond, 3)) {
  11536. tmp_condres = CPU (h_zbit);
  11537. }
  11538. else if (EQSI (tmp_tmpcond, 4)) {
  11539. tmp_condres = NOTBI (CPU (h_vbit));
  11540. }
  11541. else if (EQSI (tmp_tmpcond, 5)) {
  11542. tmp_condres = CPU (h_vbit);
  11543. }
  11544. else if (EQSI (tmp_tmpcond, 6)) {
  11545. tmp_condres = NOTBI (CPU (h_nbit));
  11546. }
  11547. else if (EQSI (tmp_tmpcond, 7)) {
  11548. tmp_condres = CPU (h_nbit);
  11549. }
  11550. else if (EQSI (tmp_tmpcond, 8)) {
  11551. tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
  11552. }
  11553. else if (EQSI (tmp_tmpcond, 9)) {
  11554. tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
  11555. }
  11556. else if (EQSI (tmp_tmpcond, 10)) {
  11557. tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
  11558. }
  11559. else if (EQSI (tmp_tmpcond, 11)) {
  11560. tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
  11561. }
  11562. else if (EQSI (tmp_tmpcond, 12)) {
  11563. tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
  11564. }
  11565. else if (EQSI (tmp_tmpcond, 13)) {
  11566. tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
  11567. }
  11568. else if (EQSI (tmp_tmpcond, 14)) {
  11569. tmp_condres = 1;
  11570. }
  11571. else if (EQSI (tmp_tmpcond, 15)) {
  11572. tmp_condres = CPU (h_pbit);
  11573. }
  11574. ; tmp_condres; });
  11575. crisv10f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
  11576. {
  11577. {
  11578. BI opval = 0;
  11579. CPU (h_xbit) = opval;
  11580. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11581. }
  11582. {
  11583. BI opval = 0;
  11584. SET_H_INSN_PREFIXED_P (opval);
  11585. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11586. }
  11587. }
  11588. if (tmp_truthval) {
  11589. {
  11590. {
  11591. USI opval = FLD (i_o_pcrel);
  11592. SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
  11593. written |= (1 << 8);
  11594. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11595. }
  11596. }
  11597. }
  11598. }
  11599. abuf->written = written;
  11600. SEM_BRANCH_FINI (vpc);
  11601. #undef FLD
  11602. }
  11603. NEXT (vpc);
  11604. CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
  11605. {
  11606. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11607. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11608. #define FLD(f) abuf->fields.sfmt_bcc_b.f
  11609. int UNUSED written = 0;
  11610. IADDR UNUSED pc = abuf->addr;
  11611. SEM_BRANCH_INIT
  11612. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11613. {
  11614. {
  11615. {
  11616. BI opval = 0;
  11617. CPU (h_xbit) = opval;
  11618. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11619. }
  11620. {
  11621. BI opval = 0;
  11622. SET_H_INSN_PREFIXED_P (opval);
  11623. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11624. }
  11625. }
  11626. {
  11627. {
  11628. USI opval = FLD (i_o_pcrel);
  11629. SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
  11630. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11631. }
  11632. }
  11633. }
  11634. SEM_BRANCH_FINI (vpc);
  11635. #undef FLD
  11636. }
  11637. NEXT (vpc);
  11638. CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
  11639. {
  11640. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11641. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11642. #define FLD(f) abuf->fields.sfmt_bcc_w.f
  11643. int UNUSED written = 0;
  11644. IADDR UNUSED pc = abuf->addr;
  11645. SEM_BRANCH_INIT
  11646. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  11647. {
  11648. BI tmp_truthval;
  11649. tmp_truthval = ({ SI tmp_tmpcond;
  11650. BI tmp_condres;
  11651. tmp_tmpcond = FLD (f_operand2);
  11652. ; if (EQSI (tmp_tmpcond, 0)) {
  11653. tmp_condres = NOTBI (CPU (h_cbit));
  11654. }
  11655. else if (EQSI (tmp_tmpcond, 1)) {
  11656. tmp_condres = CPU (h_cbit);
  11657. }
  11658. else if (EQSI (tmp_tmpcond, 2)) {
  11659. tmp_condres = NOTBI (CPU (h_zbit));
  11660. }
  11661. else if (EQSI (tmp_tmpcond, 3)) {
  11662. tmp_condres = CPU (h_zbit);
  11663. }
  11664. else if (EQSI (tmp_tmpcond, 4)) {
  11665. tmp_condres = NOTBI (CPU (h_vbit));
  11666. }
  11667. else if (EQSI (tmp_tmpcond, 5)) {
  11668. tmp_condres = CPU (h_vbit);
  11669. }
  11670. else if (EQSI (tmp_tmpcond, 6)) {
  11671. tmp_condres = NOTBI (CPU (h_nbit));
  11672. }
  11673. else if (EQSI (tmp_tmpcond, 7)) {
  11674. tmp_condres = CPU (h_nbit);
  11675. }
  11676. else if (EQSI (tmp_tmpcond, 8)) {
  11677. tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
  11678. }
  11679. else if (EQSI (tmp_tmpcond, 9)) {
  11680. tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
  11681. }
  11682. else if (EQSI (tmp_tmpcond, 10)) {
  11683. tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
  11684. }
  11685. else if (EQSI (tmp_tmpcond, 11)) {
  11686. tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
  11687. }
  11688. else if (EQSI (tmp_tmpcond, 12)) {
  11689. tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
  11690. }
  11691. else if (EQSI (tmp_tmpcond, 13)) {
  11692. tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
  11693. }
  11694. else if (EQSI (tmp_tmpcond, 14)) {
  11695. tmp_condres = 1;
  11696. }
  11697. else if (EQSI (tmp_tmpcond, 15)) {
  11698. tmp_condres = CPU (h_pbit);
  11699. }
  11700. ; tmp_condres; });
  11701. crisv10f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
  11702. {
  11703. {
  11704. BI opval = 0;
  11705. CPU (h_xbit) = opval;
  11706. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11707. }
  11708. {
  11709. BI opval = 0;
  11710. SET_H_INSN_PREFIXED_P (opval);
  11711. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11712. }
  11713. }
  11714. if (tmp_truthval) {
  11715. {
  11716. {
  11717. USI opval = FLD (i_o_word_pcrel);
  11718. SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
  11719. written |= (1 << 8);
  11720. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11721. }
  11722. }
  11723. }
  11724. }
  11725. abuf->written = written;
  11726. SEM_BRANCH_FINI (vpc);
  11727. #undef FLD
  11728. }
  11729. NEXT (vpc);
  11730. CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
  11731. {
  11732. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11733. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11734. #define FLD(f) abuf->fields.sfmt_bcc_w.f
  11735. int UNUSED written = 0;
  11736. IADDR UNUSED pc = abuf->addr;
  11737. SEM_BRANCH_INIT
  11738. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  11739. {
  11740. {
  11741. {
  11742. BI opval = 0;
  11743. CPU (h_xbit) = opval;
  11744. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11745. }
  11746. {
  11747. BI opval = 0;
  11748. SET_H_INSN_PREFIXED_P (opval);
  11749. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11750. }
  11751. }
  11752. {
  11753. {
  11754. USI opval = FLD (i_o_word_pcrel);
  11755. SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
  11756. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11757. }
  11758. }
  11759. }
  11760. SEM_BRANCH_FINI (vpc);
  11761. #undef FLD
  11762. }
  11763. NEXT (vpc);
  11764. CASE (sem, INSN_JUMP_R) : /* jump/jsr/jir ${Rs} */
  11765. {
  11766. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11767. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11768. #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
  11769. int UNUSED written = 0;
  11770. IADDR UNUSED pc = abuf->addr;
  11771. SEM_BRANCH_INIT
  11772. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11773. {
  11774. {
  11775. SI opval = ADDSI (pc, 2);
  11776. SET_H_SR (FLD (f_operand2), opval);
  11777. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  11778. }
  11779. {
  11780. USI opval = GET_H_GR (FLD (f_operand1));
  11781. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  11782. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11783. }
  11784. {
  11785. {
  11786. BI opval = 0;
  11787. CPU (h_xbit) = opval;
  11788. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11789. }
  11790. {
  11791. BI opval = 0;
  11792. SET_H_INSN_PREFIXED_P (opval);
  11793. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11794. }
  11795. }
  11796. }
  11797. SEM_BRANCH_FINI (vpc);
  11798. #undef FLD
  11799. }
  11800. NEXT (vpc);
  11801. CASE (sem, INSN_JUMP_M) : /* jump/jsr/jir [${Rs}${inc}] */
  11802. {
  11803. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11804. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11805. #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
  11806. int UNUSED written = 0;
  11807. IADDR UNUSED pc = abuf->addr;
  11808. SEM_BRANCH_INIT
  11809. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11810. {
  11811. {
  11812. SI opval = ADDSI (pc, 2);
  11813. SET_H_SR (FLD (f_operand2), opval);
  11814. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  11815. }
  11816. {
  11817. USI opval = ({ SI tmp_addr;
  11818. SI tmp_tmp_mem;
  11819. BI tmp_postinc;
  11820. tmp_postinc = FLD (f_memmode);
  11821. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  11822. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  11823. ; if (NEBI (tmp_postinc, 0)) {
  11824. {
  11825. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  11826. tmp_addr = ADDSI (tmp_addr, 4);
  11827. }
  11828. {
  11829. SI opval = tmp_addr;
  11830. SET_H_GR (FLD (f_operand1), opval);
  11831. written |= (1 << 7);
  11832. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11833. }
  11834. }
  11835. }
  11836. ; tmp_tmp_mem; });
  11837. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  11838. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11839. }
  11840. {
  11841. {
  11842. BI opval = 0;
  11843. CPU (h_xbit) = opval;
  11844. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11845. }
  11846. {
  11847. BI opval = 0;
  11848. SET_H_INSN_PREFIXED_P (opval);
  11849. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11850. }
  11851. }
  11852. }
  11853. abuf->written = written;
  11854. SEM_BRANCH_FINI (vpc);
  11855. #undef FLD
  11856. }
  11857. NEXT (vpc);
  11858. CASE (sem, INSN_JUMP_C) : /* jump/jsr/jir ${const32} */
  11859. {
  11860. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11861. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11862. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  11863. int UNUSED written = 0;
  11864. IADDR UNUSED pc = abuf->addr;
  11865. SEM_BRANCH_INIT
  11866. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  11867. {
  11868. {
  11869. SI opval = ADDSI (pc, 6);
  11870. SET_H_SR (FLD (f_operand2), opval);
  11871. CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
  11872. }
  11873. {
  11874. USI opval = FLD (f_indir_pc__dword);
  11875. SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
  11876. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11877. }
  11878. {
  11879. {
  11880. BI opval = 0;
  11881. CPU (h_xbit) = opval;
  11882. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11883. }
  11884. {
  11885. BI opval = 0;
  11886. SET_H_INSN_PREFIXED_P (opval);
  11887. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11888. }
  11889. }
  11890. }
  11891. SEM_BRANCH_FINI (vpc);
  11892. #undef FLD
  11893. }
  11894. NEXT (vpc);
  11895. CASE (sem, INSN_BREAK) : /* break $n */
  11896. {
  11897. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11898. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11899. #define FLD(f) abuf->fields.sfmt_break.f
  11900. int UNUSED written = 0;
  11901. IADDR UNUSED pc = abuf->addr;
  11902. SEM_BRANCH_INIT
  11903. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11904. {
  11905. {
  11906. {
  11907. BI opval = 0;
  11908. CPU (h_xbit) = opval;
  11909. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11910. }
  11911. {
  11912. BI opval = 0;
  11913. SET_H_INSN_PREFIXED_P (opval);
  11914. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11915. }
  11916. }
  11917. {
  11918. USI opval = crisv10f_break_handler (current_cpu, FLD (f_u4), pc);
  11919. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  11920. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  11921. }
  11922. }
  11923. SEM_BRANCH_FINI (vpc);
  11924. #undef FLD
  11925. }
  11926. NEXT (vpc);
  11927. CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
  11928. {
  11929. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11930. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11931. #define FLD(f) abuf->fields.sfmt_muls_b.f
  11932. int UNUSED written = 0;
  11933. IADDR UNUSED pc = abuf->addr;
  11934. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11935. {
  11936. SI tmp_tmpopd;
  11937. SI tmp_tmpops;
  11938. SI tmp_newval;
  11939. tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
  11940. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  11941. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  11942. {
  11943. SI opval = tmp_newval;
  11944. SET_H_GR (FLD (f_operand2), opval);
  11945. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11946. }
  11947. {
  11948. {
  11949. BI opval = LTSI (tmp_newval, 0);
  11950. CPU (h_nbit) = opval;
  11951. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  11952. }
  11953. {
  11954. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  11955. CPU (h_zbit) = opval;
  11956. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  11957. }
  11958. SET_H_CBIT_MOVE (0);
  11959. SET_H_VBIT_MOVE (0);
  11960. {
  11961. {
  11962. BI opval = 0;
  11963. CPU (h_xbit) = opval;
  11964. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  11965. }
  11966. {
  11967. BI opval = 0;
  11968. SET_H_INSN_PREFIXED_P (opval);
  11969. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  11970. }
  11971. }
  11972. }
  11973. }
  11974. #undef FLD
  11975. }
  11976. NEXT (vpc);
  11977. CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
  11978. {
  11979. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  11980. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  11981. #define FLD(f) abuf->fields.sfmt_muls_b.f
  11982. int UNUSED written = 0;
  11983. IADDR UNUSED pc = abuf->addr;
  11984. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  11985. {
  11986. SI tmp_tmpopd;
  11987. SI tmp_tmpops;
  11988. SI tmp_newval;
  11989. tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
  11990. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  11991. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  11992. {
  11993. SI opval = tmp_newval;
  11994. SET_H_GR (FLD (f_operand2), opval);
  11995. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  11996. }
  11997. {
  11998. {
  11999. BI opval = LTSI (tmp_newval, 0);
  12000. CPU (h_nbit) = opval;
  12001. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12002. }
  12003. {
  12004. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12005. CPU (h_zbit) = opval;
  12006. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12007. }
  12008. SET_H_CBIT_MOVE (0);
  12009. SET_H_VBIT_MOVE (0);
  12010. {
  12011. {
  12012. BI opval = 0;
  12013. CPU (h_xbit) = opval;
  12014. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12015. }
  12016. {
  12017. BI opval = 0;
  12018. SET_H_INSN_PREFIXED_P (opval);
  12019. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12020. }
  12021. }
  12022. }
  12023. }
  12024. #undef FLD
  12025. }
  12026. NEXT (vpc);
  12027. CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
  12028. {
  12029. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12030. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12031. #define FLD(f) abuf->fields.sfmt_muls_b.f
  12032. int UNUSED written = 0;
  12033. IADDR UNUSED pc = abuf->addr;
  12034. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12035. {
  12036. SI tmp_tmpopd;
  12037. SI tmp_tmpops;
  12038. SI tmp_newval;
  12039. tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
  12040. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12041. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12042. {
  12043. SI opval = tmp_newval;
  12044. SET_H_GR (FLD (f_operand2), opval);
  12045. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12046. }
  12047. {
  12048. {
  12049. BI opval = LTSI (tmp_newval, 0);
  12050. CPU (h_nbit) = opval;
  12051. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12052. }
  12053. {
  12054. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12055. CPU (h_zbit) = opval;
  12056. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12057. }
  12058. SET_H_CBIT_MOVE (0);
  12059. SET_H_VBIT_MOVE (0);
  12060. {
  12061. {
  12062. BI opval = 0;
  12063. CPU (h_xbit) = opval;
  12064. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12065. }
  12066. {
  12067. BI opval = 0;
  12068. SET_H_INSN_PREFIXED_P (opval);
  12069. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12070. }
  12071. }
  12072. }
  12073. }
  12074. #undef FLD
  12075. }
  12076. NEXT (vpc);
  12077. CASE (sem, INSN_BOUND_M_B_M) : /* bound-m.b [${Rs}${inc}],${Rd} */
  12078. {
  12079. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12080. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12081. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  12082. int UNUSED written = 0;
  12083. IADDR UNUSED pc = abuf->addr;
  12084. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12085. {
  12086. SI tmp_tmpopd;
  12087. SI tmp_tmpops;
  12088. SI tmp_newval;
  12089. tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
  12090. QI tmp_tmp_mem;
  12091. BI tmp_postinc;
  12092. tmp_postinc = FLD (f_memmode);
  12093. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  12094. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  12095. ; if (NEBI (tmp_postinc, 0)) {
  12096. {
  12097. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12098. tmp_addr = ADDSI (tmp_addr, 1);
  12099. }
  12100. {
  12101. SI opval = tmp_addr;
  12102. SET_H_GR (FLD (f_operand1), opval);
  12103. written |= (1 << 9);
  12104. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12105. }
  12106. }
  12107. }
  12108. ; tmp_tmp_mem; }));
  12109. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12110. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12111. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  12112. {
  12113. SI opval = tmp_newval;
  12114. SET_H_GR (FLD (f_operand1), opval);
  12115. written |= (1 << 9);
  12116. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12117. }
  12118. } else {
  12119. {
  12120. SI opval = tmp_newval;
  12121. SET_H_GR (FLD (f_operand2), opval);
  12122. written |= (1 << 8);
  12123. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12124. }
  12125. }
  12126. {
  12127. {
  12128. BI opval = LTSI (tmp_newval, 0);
  12129. CPU (h_nbit) = opval;
  12130. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12131. }
  12132. {
  12133. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12134. CPU (h_zbit) = opval;
  12135. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12136. }
  12137. SET_H_CBIT_MOVE (0);
  12138. SET_H_VBIT_MOVE (0);
  12139. {
  12140. {
  12141. BI opval = 0;
  12142. CPU (h_xbit) = opval;
  12143. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12144. }
  12145. {
  12146. BI opval = 0;
  12147. SET_H_INSN_PREFIXED_P (opval);
  12148. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12149. }
  12150. }
  12151. }
  12152. }
  12153. abuf->written = written;
  12154. #undef FLD
  12155. }
  12156. NEXT (vpc);
  12157. CASE (sem, INSN_BOUND_M_W_M) : /* bound-m.w [${Rs}${inc}],${Rd} */
  12158. {
  12159. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12160. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12161. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  12162. int UNUSED written = 0;
  12163. IADDR UNUSED pc = abuf->addr;
  12164. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12165. {
  12166. SI tmp_tmpopd;
  12167. SI tmp_tmpops;
  12168. SI tmp_newval;
  12169. tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
  12170. HI tmp_tmp_mem;
  12171. BI tmp_postinc;
  12172. tmp_postinc = FLD (f_memmode);
  12173. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  12174. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  12175. ; if (NEBI (tmp_postinc, 0)) {
  12176. {
  12177. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12178. tmp_addr = ADDSI (tmp_addr, 2);
  12179. }
  12180. {
  12181. SI opval = tmp_addr;
  12182. SET_H_GR (FLD (f_operand1), opval);
  12183. written |= (1 << 9);
  12184. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12185. }
  12186. }
  12187. }
  12188. ; tmp_tmp_mem; }));
  12189. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12190. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12191. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  12192. {
  12193. SI opval = tmp_newval;
  12194. SET_H_GR (FLD (f_operand1), opval);
  12195. written |= (1 << 9);
  12196. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12197. }
  12198. } else {
  12199. {
  12200. SI opval = tmp_newval;
  12201. SET_H_GR (FLD (f_operand2), opval);
  12202. written |= (1 << 8);
  12203. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12204. }
  12205. }
  12206. {
  12207. {
  12208. BI opval = LTSI (tmp_newval, 0);
  12209. CPU (h_nbit) = opval;
  12210. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12211. }
  12212. {
  12213. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12214. CPU (h_zbit) = opval;
  12215. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12216. }
  12217. SET_H_CBIT_MOVE (0);
  12218. SET_H_VBIT_MOVE (0);
  12219. {
  12220. {
  12221. BI opval = 0;
  12222. CPU (h_xbit) = opval;
  12223. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12224. }
  12225. {
  12226. BI opval = 0;
  12227. SET_H_INSN_PREFIXED_P (opval);
  12228. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12229. }
  12230. }
  12231. }
  12232. }
  12233. abuf->written = written;
  12234. #undef FLD
  12235. }
  12236. NEXT (vpc);
  12237. CASE (sem, INSN_BOUND_M_D_M) : /* bound-m.d [${Rs}${inc}],${Rd} */
  12238. {
  12239. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12240. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12241. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  12242. int UNUSED written = 0;
  12243. IADDR UNUSED pc = abuf->addr;
  12244. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12245. {
  12246. SI tmp_tmpopd;
  12247. SI tmp_tmpops;
  12248. SI tmp_newval;
  12249. tmp_tmpops = ({ SI tmp_addr;
  12250. SI tmp_tmp_mem;
  12251. BI tmp_postinc;
  12252. tmp_postinc = FLD (f_memmode);
  12253. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  12254. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  12255. ; if (NEBI (tmp_postinc, 0)) {
  12256. {
  12257. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12258. tmp_addr = ADDSI (tmp_addr, 4);
  12259. }
  12260. {
  12261. SI opval = tmp_addr;
  12262. SET_H_GR (FLD (f_operand1), opval);
  12263. written |= (1 << 9);
  12264. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12265. }
  12266. }
  12267. }
  12268. ; tmp_tmp_mem; });
  12269. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12270. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12271. if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
  12272. {
  12273. SI opval = tmp_newval;
  12274. SET_H_GR (FLD (f_operand1), opval);
  12275. written |= (1 << 9);
  12276. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12277. }
  12278. } else {
  12279. {
  12280. SI opval = tmp_newval;
  12281. SET_H_GR (FLD (f_operand2), opval);
  12282. written |= (1 << 8);
  12283. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12284. }
  12285. }
  12286. {
  12287. {
  12288. BI opval = LTSI (tmp_newval, 0);
  12289. CPU (h_nbit) = opval;
  12290. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12291. }
  12292. {
  12293. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12294. CPU (h_zbit) = opval;
  12295. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12296. }
  12297. SET_H_CBIT_MOVE (0);
  12298. SET_H_VBIT_MOVE (0);
  12299. {
  12300. {
  12301. BI opval = 0;
  12302. CPU (h_xbit) = opval;
  12303. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12304. }
  12305. {
  12306. BI opval = 0;
  12307. SET_H_INSN_PREFIXED_P (opval);
  12308. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12309. }
  12310. }
  12311. }
  12312. }
  12313. abuf->written = written;
  12314. #undef FLD
  12315. }
  12316. NEXT (vpc);
  12317. CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
  12318. {
  12319. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12320. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12321. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  12322. int UNUSED written = 0;
  12323. IADDR UNUSED pc = abuf->addr;
  12324. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  12325. {
  12326. SI tmp_tmpopd;
  12327. SI tmp_tmpops;
  12328. SI tmp_newval;
  12329. tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
  12330. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12331. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12332. {
  12333. SI opval = tmp_newval;
  12334. SET_H_GR (FLD (f_operand2), opval);
  12335. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12336. }
  12337. {
  12338. {
  12339. BI opval = LTSI (tmp_newval, 0);
  12340. CPU (h_nbit) = opval;
  12341. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12342. }
  12343. {
  12344. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12345. CPU (h_zbit) = opval;
  12346. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12347. }
  12348. SET_H_CBIT_MOVE (0);
  12349. SET_H_VBIT_MOVE (0);
  12350. {
  12351. {
  12352. BI opval = 0;
  12353. CPU (h_xbit) = opval;
  12354. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12355. }
  12356. {
  12357. BI opval = 0;
  12358. SET_H_INSN_PREFIXED_P (opval);
  12359. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12360. }
  12361. }
  12362. }
  12363. }
  12364. #undef FLD
  12365. }
  12366. NEXT (vpc);
  12367. CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
  12368. {
  12369. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12370. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12371. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  12372. int UNUSED written = 0;
  12373. IADDR UNUSED pc = abuf->addr;
  12374. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  12375. {
  12376. SI tmp_tmpopd;
  12377. SI tmp_tmpops;
  12378. SI tmp_newval;
  12379. tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
  12380. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12381. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12382. {
  12383. SI opval = tmp_newval;
  12384. SET_H_GR (FLD (f_operand2), opval);
  12385. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12386. }
  12387. {
  12388. {
  12389. BI opval = LTSI (tmp_newval, 0);
  12390. CPU (h_nbit) = opval;
  12391. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12392. }
  12393. {
  12394. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12395. CPU (h_zbit) = opval;
  12396. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12397. }
  12398. SET_H_CBIT_MOVE (0);
  12399. SET_H_VBIT_MOVE (0);
  12400. {
  12401. {
  12402. BI opval = 0;
  12403. CPU (h_xbit) = opval;
  12404. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12405. }
  12406. {
  12407. BI opval = 0;
  12408. SET_H_INSN_PREFIXED_P (opval);
  12409. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12410. }
  12411. }
  12412. }
  12413. }
  12414. #undef FLD
  12415. }
  12416. NEXT (vpc);
  12417. CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
  12418. {
  12419. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12420. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12421. #define FLD(f) abuf->fields.sfmt_bound_cd.f
  12422. int UNUSED written = 0;
  12423. IADDR UNUSED pc = abuf->addr;
  12424. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  12425. {
  12426. SI tmp_tmpopd;
  12427. SI tmp_tmpops;
  12428. SI tmp_newval;
  12429. tmp_tmpops = FLD (f_indir_pc__dword);
  12430. tmp_tmpopd = GET_H_GR (FLD (f_operand2));
  12431. tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
  12432. {
  12433. SI opval = tmp_newval;
  12434. SET_H_GR (FLD (f_operand2), opval);
  12435. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12436. }
  12437. {
  12438. {
  12439. BI opval = LTSI (tmp_newval, 0);
  12440. CPU (h_nbit) = opval;
  12441. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12442. }
  12443. {
  12444. BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12445. CPU (h_zbit) = opval;
  12446. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12447. }
  12448. SET_H_CBIT_MOVE (0);
  12449. SET_H_VBIT_MOVE (0);
  12450. {
  12451. {
  12452. BI opval = 0;
  12453. CPU (h_xbit) = opval;
  12454. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12455. }
  12456. {
  12457. BI opval = 0;
  12458. SET_H_INSN_PREFIXED_P (opval);
  12459. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12460. }
  12461. }
  12462. }
  12463. }
  12464. #undef FLD
  12465. }
  12466. NEXT (vpc);
  12467. CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
  12468. {
  12469. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12470. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12471. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  12472. int UNUSED written = 0;
  12473. IADDR UNUSED pc = abuf->addr;
  12474. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12475. {
  12476. BI tmp_truthval;
  12477. tmp_truthval = ({ SI tmp_tmpcond;
  12478. BI tmp_condres;
  12479. tmp_tmpcond = FLD (f_operand2);
  12480. ; if (EQSI (tmp_tmpcond, 0)) {
  12481. tmp_condres = NOTBI (CPU (h_cbit));
  12482. }
  12483. else if (EQSI (tmp_tmpcond, 1)) {
  12484. tmp_condres = CPU (h_cbit);
  12485. }
  12486. else if (EQSI (tmp_tmpcond, 2)) {
  12487. tmp_condres = NOTBI (CPU (h_zbit));
  12488. }
  12489. else if (EQSI (tmp_tmpcond, 3)) {
  12490. tmp_condres = CPU (h_zbit);
  12491. }
  12492. else if (EQSI (tmp_tmpcond, 4)) {
  12493. tmp_condres = NOTBI (CPU (h_vbit));
  12494. }
  12495. else if (EQSI (tmp_tmpcond, 5)) {
  12496. tmp_condres = CPU (h_vbit);
  12497. }
  12498. else if (EQSI (tmp_tmpcond, 6)) {
  12499. tmp_condres = NOTBI (CPU (h_nbit));
  12500. }
  12501. else if (EQSI (tmp_tmpcond, 7)) {
  12502. tmp_condres = CPU (h_nbit);
  12503. }
  12504. else if (EQSI (tmp_tmpcond, 8)) {
  12505. tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
  12506. }
  12507. else if (EQSI (tmp_tmpcond, 9)) {
  12508. tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
  12509. }
  12510. else if (EQSI (tmp_tmpcond, 10)) {
  12511. tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
  12512. }
  12513. else if (EQSI (tmp_tmpcond, 11)) {
  12514. tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
  12515. }
  12516. else if (EQSI (tmp_tmpcond, 12)) {
  12517. tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
  12518. }
  12519. else if (EQSI (tmp_tmpcond, 13)) {
  12520. tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
  12521. }
  12522. else if (EQSI (tmp_tmpcond, 14)) {
  12523. tmp_condres = 1;
  12524. }
  12525. else if (EQSI (tmp_tmpcond, 15)) {
  12526. tmp_condres = CPU (h_pbit);
  12527. }
  12528. ; tmp_condres; });
  12529. {
  12530. SI opval = ZEXTBISI (tmp_truthval);
  12531. SET_H_GR (FLD (f_operand1), opval);
  12532. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12533. }
  12534. {
  12535. {
  12536. BI opval = 0;
  12537. CPU (h_xbit) = opval;
  12538. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12539. }
  12540. {
  12541. BI opval = 0;
  12542. SET_H_INSN_PREFIXED_P (opval);
  12543. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12544. }
  12545. }
  12546. }
  12547. #undef FLD
  12548. }
  12549. NEXT (vpc);
  12550. CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
  12551. {
  12552. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12553. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12554. #define FLD(f) abuf->fields.sfmt_muls_b.f
  12555. int UNUSED written = 0;
  12556. IADDR UNUSED pc = abuf->addr;
  12557. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12558. {
  12559. SI tmp_tmpd;
  12560. SI tmp_tmp;
  12561. tmp_tmp = GET_H_GR (FLD (f_operand1));
  12562. tmp_tmpd = 0;
  12563. {
  12564. if (GESI (tmp_tmp, 0)) {
  12565. {
  12566. tmp_tmp = SLLSI (tmp_tmp, 1);
  12567. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12568. }
  12569. }
  12570. if (GESI (tmp_tmp, 0)) {
  12571. {
  12572. tmp_tmp = SLLSI (tmp_tmp, 1);
  12573. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12574. }
  12575. }
  12576. if (GESI (tmp_tmp, 0)) {
  12577. {
  12578. tmp_tmp = SLLSI (tmp_tmp, 1);
  12579. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12580. }
  12581. }
  12582. if (GESI (tmp_tmp, 0)) {
  12583. {
  12584. tmp_tmp = SLLSI (tmp_tmp, 1);
  12585. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12586. }
  12587. }
  12588. if (GESI (tmp_tmp, 0)) {
  12589. {
  12590. tmp_tmp = SLLSI (tmp_tmp, 1);
  12591. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12592. }
  12593. }
  12594. if (GESI (tmp_tmp, 0)) {
  12595. {
  12596. tmp_tmp = SLLSI (tmp_tmp, 1);
  12597. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12598. }
  12599. }
  12600. if (GESI (tmp_tmp, 0)) {
  12601. {
  12602. tmp_tmp = SLLSI (tmp_tmp, 1);
  12603. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12604. }
  12605. }
  12606. if (GESI (tmp_tmp, 0)) {
  12607. {
  12608. tmp_tmp = SLLSI (tmp_tmp, 1);
  12609. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12610. }
  12611. }
  12612. if (GESI (tmp_tmp, 0)) {
  12613. {
  12614. tmp_tmp = SLLSI (tmp_tmp, 1);
  12615. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12616. }
  12617. }
  12618. if (GESI (tmp_tmp, 0)) {
  12619. {
  12620. tmp_tmp = SLLSI (tmp_tmp, 1);
  12621. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12622. }
  12623. }
  12624. if (GESI (tmp_tmp, 0)) {
  12625. {
  12626. tmp_tmp = SLLSI (tmp_tmp, 1);
  12627. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12628. }
  12629. }
  12630. if (GESI (tmp_tmp, 0)) {
  12631. {
  12632. tmp_tmp = SLLSI (tmp_tmp, 1);
  12633. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12634. }
  12635. }
  12636. if (GESI (tmp_tmp, 0)) {
  12637. {
  12638. tmp_tmp = SLLSI (tmp_tmp, 1);
  12639. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12640. }
  12641. }
  12642. if (GESI (tmp_tmp, 0)) {
  12643. {
  12644. tmp_tmp = SLLSI (tmp_tmp, 1);
  12645. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12646. }
  12647. }
  12648. if (GESI (tmp_tmp, 0)) {
  12649. {
  12650. tmp_tmp = SLLSI (tmp_tmp, 1);
  12651. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12652. }
  12653. }
  12654. if (GESI (tmp_tmp, 0)) {
  12655. {
  12656. tmp_tmp = SLLSI (tmp_tmp, 1);
  12657. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12658. }
  12659. }
  12660. if (GESI (tmp_tmp, 0)) {
  12661. {
  12662. tmp_tmp = SLLSI (tmp_tmp, 1);
  12663. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12664. }
  12665. }
  12666. if (GESI (tmp_tmp, 0)) {
  12667. {
  12668. tmp_tmp = SLLSI (tmp_tmp, 1);
  12669. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12670. }
  12671. }
  12672. if (GESI (tmp_tmp, 0)) {
  12673. {
  12674. tmp_tmp = SLLSI (tmp_tmp, 1);
  12675. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12676. }
  12677. }
  12678. if (GESI (tmp_tmp, 0)) {
  12679. {
  12680. tmp_tmp = SLLSI (tmp_tmp, 1);
  12681. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12682. }
  12683. }
  12684. if (GESI (tmp_tmp, 0)) {
  12685. {
  12686. tmp_tmp = SLLSI (tmp_tmp, 1);
  12687. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12688. }
  12689. }
  12690. if (GESI (tmp_tmp, 0)) {
  12691. {
  12692. tmp_tmp = SLLSI (tmp_tmp, 1);
  12693. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12694. }
  12695. }
  12696. if (GESI (tmp_tmp, 0)) {
  12697. {
  12698. tmp_tmp = SLLSI (tmp_tmp, 1);
  12699. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12700. }
  12701. }
  12702. if (GESI (tmp_tmp, 0)) {
  12703. {
  12704. tmp_tmp = SLLSI (tmp_tmp, 1);
  12705. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12706. }
  12707. }
  12708. if (GESI (tmp_tmp, 0)) {
  12709. {
  12710. tmp_tmp = SLLSI (tmp_tmp, 1);
  12711. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12712. }
  12713. }
  12714. if (GESI (tmp_tmp, 0)) {
  12715. {
  12716. tmp_tmp = SLLSI (tmp_tmp, 1);
  12717. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12718. }
  12719. }
  12720. if (GESI (tmp_tmp, 0)) {
  12721. {
  12722. tmp_tmp = SLLSI (tmp_tmp, 1);
  12723. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12724. }
  12725. }
  12726. if (GESI (tmp_tmp, 0)) {
  12727. {
  12728. tmp_tmp = SLLSI (tmp_tmp, 1);
  12729. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12730. }
  12731. }
  12732. if (GESI (tmp_tmp, 0)) {
  12733. {
  12734. tmp_tmp = SLLSI (tmp_tmp, 1);
  12735. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12736. }
  12737. }
  12738. if (GESI (tmp_tmp, 0)) {
  12739. {
  12740. tmp_tmp = SLLSI (tmp_tmp, 1);
  12741. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12742. }
  12743. }
  12744. if (GESI (tmp_tmp, 0)) {
  12745. {
  12746. tmp_tmp = SLLSI (tmp_tmp, 1);
  12747. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12748. }
  12749. }
  12750. if (GESI (tmp_tmp, 0)) {
  12751. {
  12752. tmp_tmp = SLLSI (tmp_tmp, 1);
  12753. tmp_tmpd = ADDSI (tmp_tmpd, 1);
  12754. }
  12755. }
  12756. }
  12757. {
  12758. SI opval = tmp_tmpd;
  12759. SET_H_GR (FLD (f_operand2), opval);
  12760. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12761. }
  12762. {
  12763. {
  12764. BI opval = LTSI (tmp_tmpd, 0);
  12765. CPU (h_nbit) = opval;
  12766. CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
  12767. }
  12768. {
  12769. BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
  12770. CPU (h_zbit) = opval;
  12771. CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
  12772. }
  12773. SET_H_CBIT_MOVE (0);
  12774. SET_H_VBIT_MOVE (0);
  12775. {
  12776. {
  12777. BI opval = 0;
  12778. CPU (h_xbit) = opval;
  12779. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12780. }
  12781. {
  12782. BI opval = 0;
  12783. SET_H_INSN_PREFIXED_P (opval);
  12784. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12785. }
  12786. }
  12787. }
  12788. }
  12789. #undef FLD
  12790. }
  12791. NEXT (vpc);
  12792. CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
  12793. {
  12794. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12795. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12796. #define FLD(f) abuf->fields.sfmt_addoq.f
  12797. int UNUSED written = 0;
  12798. IADDR UNUSED pc = abuf->addr;
  12799. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12800. {
  12801. {
  12802. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
  12803. CPU (h_prefixreg_pre_v32) = opval;
  12804. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  12805. }
  12806. {
  12807. BI opval = 1;
  12808. SET_H_INSN_PREFIXED_P (opval);
  12809. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12810. }
  12811. }
  12812. #undef FLD
  12813. }
  12814. NEXT (vpc);
  12815. CASE (sem, INSN_BDAPQPC) : /* bdapq $o,PC */
  12816. {
  12817. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12818. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12819. #define FLD(f) abuf->fields.sfmt_addoq.f
  12820. int UNUSED written = 0;
  12821. IADDR UNUSED pc = abuf->addr;
  12822. SEM_BRANCH_INIT
  12823. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12824. {
  12825. {
  12826. SI opval = ADDSI (ADDSI (pc, 2), FLD (f_s8));
  12827. CPU (h_prefixreg_pre_v32) = opval;
  12828. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  12829. }
  12830. {
  12831. BI opval = 1;
  12832. SET_H_INSN_PREFIXED_P (opval);
  12833. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12834. }
  12835. cris_flush_simulator_decode_cache (current_cpu, pc);
  12836. }
  12837. SEM_BRANCH_FINI (vpc);
  12838. #undef FLD
  12839. }
  12840. NEXT (vpc);
  12841. CASE (sem, INSN_BDAP_32_PC) : /* bdap ${sconst32},PC */
  12842. {
  12843. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12844. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12845. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  12846. int UNUSED written = 0;
  12847. IADDR UNUSED pc = abuf->addr;
  12848. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  12849. {
  12850. SI tmp_newpc;
  12851. SI tmp_oldpc;
  12852. SI tmp_offs;
  12853. tmp_offs = FLD (f_indir_pc__dword);
  12854. tmp_oldpc = ADDSI (pc, 6);
  12855. tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
  12856. {
  12857. SI opval = tmp_newpc;
  12858. CPU (h_prefixreg_pre_v32) = opval;
  12859. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  12860. }
  12861. {
  12862. BI opval = 1;
  12863. SET_H_INSN_PREFIXED_P (opval);
  12864. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12865. }
  12866. }
  12867. #undef FLD
  12868. }
  12869. NEXT (vpc);
  12870. CASE (sem, INSN_MOVE_M_PCPLUS_P0) : /* move [PC+],P0 */
  12871. {
  12872. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12873. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12874. #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
  12875. int UNUSED written = 0;
  12876. IADDR UNUSED pc = abuf->addr;
  12877. SEM_BRANCH_INIT
  12878. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12879. if (GET_H_INSN_PREFIXED_P ()) {
  12880. {
  12881. QI tmp_dummy;
  12882. tmp_dummy = ({ SI tmp_addr;
  12883. QI tmp_tmp_mem;
  12884. BI tmp_postinc;
  12885. tmp_postinc = FLD (f_memmode);
  12886. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (pc) : (CPU (h_prefixreg_pre_v32)));
  12887. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  12888. ; if (NEBI (tmp_postinc, 0)) {
  12889. {
  12890. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12891. tmp_addr = ADDSI (tmp_addr, 1);
  12892. }
  12893. {
  12894. USI opval = tmp_addr;
  12895. SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
  12896. written |= (1 << 5);
  12897. CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
  12898. }
  12899. }
  12900. }
  12901. ; tmp_tmp_mem; });
  12902. {
  12903. {
  12904. BI opval = 0;
  12905. CPU (h_xbit) = opval;
  12906. written |= (1 << 7);
  12907. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12908. }
  12909. {
  12910. BI opval = 0;
  12911. SET_H_INSN_PREFIXED_P (opval);
  12912. written |= (1 << 6);
  12913. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12914. }
  12915. }
  12916. }
  12917. } else {
  12918. cgen_rtx_error (current_cpu, "move [PC+],P0 without prefix is not implemented");
  12919. }
  12920. abuf->written = written;
  12921. SEM_BRANCH_FINI (vpc);
  12922. #undef FLD
  12923. }
  12924. NEXT (vpc);
  12925. CASE (sem, INSN_MOVE_M_SPPLUS_P8) : /* move [SP+],P8 */
  12926. {
  12927. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12928. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12929. #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
  12930. int UNUSED written = 0;
  12931. IADDR UNUSED pc = abuf->addr;
  12932. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12933. if (GET_H_INSN_PREFIXED_P ()) {
  12934. {
  12935. SI tmp_dummy;
  12936. tmp_dummy = ({ SI tmp_addr;
  12937. SI tmp_tmp_mem;
  12938. BI tmp_postinc;
  12939. tmp_postinc = FLD (f_memmode);
  12940. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (((UINT) 14))) : (CPU (h_prefixreg_pre_v32)));
  12941. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  12942. ; if (NEBI (tmp_postinc, 0)) {
  12943. {
  12944. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12945. tmp_addr = ADDSI (tmp_addr, 4);
  12946. }
  12947. {
  12948. SI opval = tmp_addr;
  12949. SET_H_GR (((UINT) 14), opval);
  12950. written |= (1 << 5);
  12951. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  12952. }
  12953. }
  12954. }
  12955. ; tmp_tmp_mem; });
  12956. {
  12957. {
  12958. BI opval = 0;
  12959. CPU (h_xbit) = opval;
  12960. written |= (1 << 7);
  12961. CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
  12962. }
  12963. {
  12964. BI opval = 0;
  12965. SET_H_INSN_PREFIXED_P (opval);
  12966. written |= (1 << 6);
  12967. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  12968. }
  12969. }
  12970. }
  12971. } else {
  12972. cgen_rtx_error (current_cpu, "move [SP+],P8 without prefix is not implemented");
  12973. }
  12974. abuf->written = written;
  12975. #undef FLD
  12976. }
  12977. NEXT (vpc);
  12978. CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
  12979. {
  12980. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  12981. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  12982. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  12983. int UNUSED written = 0;
  12984. IADDR UNUSED pc = abuf->addr;
  12985. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  12986. {
  12987. QI tmp_tmps;
  12988. tmp_tmps = ({ SI tmp_addr;
  12989. QI tmp_tmp_mem;
  12990. BI tmp_postinc;
  12991. tmp_postinc = FLD (f_memmode);
  12992. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  12993. ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
  12994. ; if (NEBI (tmp_postinc, 0)) {
  12995. {
  12996. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  12997. tmp_addr = ADDSI (tmp_addr, 1);
  12998. }
  12999. {
  13000. SI opval = tmp_addr;
  13001. SET_H_GR (FLD (f_operand1), opval);
  13002. written |= (1 << 6);
  13003. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  13004. }
  13005. }
  13006. }
  13007. ; tmp_tmp_mem; });
  13008. {
  13009. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
  13010. CPU (h_prefixreg_pre_v32) = opval;
  13011. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13012. }
  13013. {
  13014. BI opval = 1;
  13015. SET_H_INSN_PREFIXED_P (opval);
  13016. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13017. }
  13018. }
  13019. abuf->written = written;
  13020. #undef FLD
  13021. }
  13022. NEXT (vpc);
  13023. CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
  13024. {
  13025. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13026. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13027. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  13028. int UNUSED written = 0;
  13029. IADDR UNUSED pc = abuf->addr;
  13030. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13031. {
  13032. HI tmp_tmps;
  13033. tmp_tmps = ({ SI tmp_addr;
  13034. HI tmp_tmp_mem;
  13035. BI tmp_postinc;
  13036. tmp_postinc = FLD (f_memmode);
  13037. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  13038. ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
  13039. ; if (NEBI (tmp_postinc, 0)) {
  13040. {
  13041. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  13042. tmp_addr = ADDSI (tmp_addr, 2);
  13043. }
  13044. {
  13045. SI opval = tmp_addr;
  13046. SET_H_GR (FLD (f_operand1), opval);
  13047. written |= (1 << 6);
  13048. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  13049. }
  13050. }
  13051. }
  13052. ; tmp_tmp_mem; });
  13053. {
  13054. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
  13055. CPU (h_prefixreg_pre_v32) = opval;
  13056. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13057. }
  13058. {
  13059. BI opval = 1;
  13060. SET_H_INSN_PREFIXED_P (opval);
  13061. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13062. }
  13063. }
  13064. abuf->written = written;
  13065. #undef FLD
  13066. }
  13067. NEXT (vpc);
  13068. CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
  13069. {
  13070. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13071. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13072. #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
  13073. int UNUSED written = 0;
  13074. IADDR UNUSED pc = abuf->addr;
  13075. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13076. {
  13077. SI tmp_tmps;
  13078. tmp_tmps = ({ SI tmp_addr;
  13079. SI tmp_tmp_mem;
  13080. BI tmp_postinc;
  13081. tmp_postinc = FLD (f_memmode);
  13082. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  13083. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  13084. ; if (NEBI (tmp_postinc, 0)) {
  13085. {
  13086. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  13087. tmp_addr = ADDSI (tmp_addr, 4);
  13088. }
  13089. {
  13090. SI opval = tmp_addr;
  13091. SET_H_GR (FLD (f_operand1), opval);
  13092. written |= (1 << 6);
  13093. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  13094. }
  13095. }
  13096. }
  13097. ; tmp_tmp_mem; });
  13098. {
  13099. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
  13100. CPU (h_prefixreg_pre_v32) = opval;
  13101. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13102. }
  13103. {
  13104. BI opval = 1;
  13105. SET_H_INSN_PREFIXED_P (opval);
  13106. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13107. }
  13108. }
  13109. abuf->written = written;
  13110. #undef FLD
  13111. }
  13112. NEXT (vpc);
  13113. CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
  13114. {
  13115. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13116. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13117. #define FLD(f) abuf->fields.sfmt_bound_cb.f
  13118. int UNUSED written = 0;
  13119. IADDR UNUSED pc = abuf->addr;
  13120. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  13121. {
  13122. {
  13123. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
  13124. CPU (h_prefixreg_pre_v32) = opval;
  13125. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13126. }
  13127. {
  13128. BI opval = 1;
  13129. SET_H_INSN_PREFIXED_P (opval);
  13130. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13131. }
  13132. }
  13133. #undef FLD
  13134. }
  13135. NEXT (vpc);
  13136. CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
  13137. {
  13138. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13139. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13140. #define FLD(f) abuf->fields.sfmt_bound_cw.f
  13141. int UNUSED written = 0;
  13142. IADDR UNUSED pc = abuf->addr;
  13143. vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
  13144. {
  13145. {
  13146. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
  13147. CPU (h_prefixreg_pre_v32) = opval;
  13148. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13149. }
  13150. {
  13151. BI opval = 1;
  13152. SET_H_INSN_PREFIXED_P (opval);
  13153. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13154. }
  13155. }
  13156. #undef FLD
  13157. }
  13158. NEXT (vpc);
  13159. CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
  13160. {
  13161. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13162. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13163. #define FLD(f) abuf->fields.sfmt_bound_cd.f
  13164. int UNUSED written = 0;
  13165. IADDR UNUSED pc = abuf->addr;
  13166. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  13167. {
  13168. {
  13169. SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
  13170. CPU (h_prefixreg_pre_v32) = opval;
  13171. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13172. }
  13173. {
  13174. BI opval = 1;
  13175. SET_H_INSN_PREFIXED_P (opval);
  13176. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13177. }
  13178. }
  13179. #undef FLD
  13180. }
  13181. NEXT (vpc);
  13182. CASE (sem, INSN_DIP_M) : /* dip [${Rs}${inc}] */
  13183. {
  13184. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13185. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13186. #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
  13187. int UNUSED written = 0;
  13188. IADDR UNUSED pc = abuf->addr;
  13189. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13190. {
  13191. SI tmp_tmps;
  13192. tmp_tmps = ({ SI tmp_addr;
  13193. SI tmp_tmp_mem;
  13194. BI tmp_postinc;
  13195. tmp_postinc = FLD (f_memmode);
  13196. ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
  13197. ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
  13198. ; if (NEBI (tmp_postinc, 0)) {
  13199. {
  13200. if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
  13201. tmp_addr = ADDSI (tmp_addr, 4);
  13202. }
  13203. {
  13204. SI opval = tmp_addr;
  13205. SET_H_GR (FLD (f_operand1), opval);
  13206. written |= (1 << 5);
  13207. CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
  13208. }
  13209. }
  13210. }
  13211. ; tmp_tmp_mem; });
  13212. {
  13213. SI opval = tmp_tmps;
  13214. CPU (h_prefixreg_pre_v32) = opval;
  13215. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13216. }
  13217. {
  13218. BI opval = 1;
  13219. SET_H_INSN_PREFIXED_P (opval);
  13220. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13221. }
  13222. }
  13223. abuf->written = written;
  13224. #undef FLD
  13225. }
  13226. NEXT (vpc);
  13227. CASE (sem, INSN_DIP_C) : /* dip [PC+] */
  13228. {
  13229. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13230. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13231. #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
  13232. int UNUSED written = 0;
  13233. IADDR UNUSED pc = abuf->addr;
  13234. vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
  13235. {
  13236. {
  13237. SI opval = FLD (f_indir_pc__dword);
  13238. CPU (h_prefixreg_pre_v32) = opval;
  13239. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13240. }
  13241. {
  13242. BI opval = 1;
  13243. SET_H_INSN_PREFIXED_P (opval);
  13244. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13245. }
  13246. }
  13247. #undef FLD
  13248. }
  13249. NEXT (vpc);
  13250. CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
  13251. {
  13252. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13253. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13254. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  13255. int UNUSED written = 0;
  13256. IADDR UNUSED pc = abuf->addr;
  13257. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13258. {
  13259. {
  13260. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
  13261. CPU (h_prefixreg_pre_v32) = opval;
  13262. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13263. }
  13264. {
  13265. BI opval = 1;
  13266. SET_H_INSN_PREFIXED_P (opval);
  13267. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13268. }
  13269. }
  13270. #undef FLD
  13271. }
  13272. NEXT (vpc);
  13273. CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
  13274. {
  13275. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13276. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13277. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  13278. int UNUSED written = 0;
  13279. IADDR UNUSED pc = abuf->addr;
  13280. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13281. {
  13282. {
  13283. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
  13284. CPU (h_prefixreg_pre_v32) = opval;
  13285. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13286. }
  13287. {
  13288. BI opval = 1;
  13289. SET_H_INSN_PREFIXED_P (opval);
  13290. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13291. }
  13292. }
  13293. #undef FLD
  13294. }
  13295. NEXT (vpc);
  13296. CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
  13297. {
  13298. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13299. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13300. #define FLD(f) abuf->fields.sfmt_add_b_r.f
  13301. int UNUSED written = 0;
  13302. IADDR UNUSED pc = abuf->addr;
  13303. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13304. {
  13305. {
  13306. SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
  13307. CPU (h_prefixreg_pre_v32) = opval;
  13308. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13309. }
  13310. {
  13311. BI opval = 1;
  13312. SET_H_INSN_PREFIXED_P (opval);
  13313. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13314. }
  13315. }
  13316. #undef FLD
  13317. }
  13318. NEXT (vpc);
  13319. CASE (sem, INSN_BIAP_PC_B_R) : /* biap-pc.b ${Rs-dfield}.m,PC */
  13320. {
  13321. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13322. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13323. #define FLD(f) abuf->fields.sfmt_addoq.f
  13324. int UNUSED written = 0;
  13325. IADDR UNUSED pc = abuf->addr;
  13326. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13327. {
  13328. {
  13329. SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 1));
  13330. CPU (h_prefixreg_pre_v32) = opval;
  13331. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13332. }
  13333. {
  13334. BI opval = 1;
  13335. SET_H_INSN_PREFIXED_P (opval);
  13336. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13337. }
  13338. }
  13339. #undef FLD
  13340. }
  13341. NEXT (vpc);
  13342. CASE (sem, INSN_BIAP_PC_W_R) : /* biap-pc.w ${Rs-dfield}.m,PC */
  13343. {
  13344. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13345. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13346. #define FLD(f) abuf->fields.sfmt_addoq.f
  13347. int UNUSED written = 0;
  13348. IADDR UNUSED pc = abuf->addr;
  13349. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13350. {
  13351. {
  13352. SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 2));
  13353. CPU (h_prefixreg_pre_v32) = opval;
  13354. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13355. }
  13356. {
  13357. BI opval = 1;
  13358. SET_H_INSN_PREFIXED_P (opval);
  13359. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13360. }
  13361. }
  13362. #undef FLD
  13363. }
  13364. NEXT (vpc);
  13365. CASE (sem, INSN_BIAP_PC_D_R) : /* biap-pc.d ${Rs-dfield}.m,PC */
  13366. {
  13367. SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
  13368. ARGBUF *abuf = SEM_ARGBUF (sem_arg);
  13369. #define FLD(f) abuf->fields.sfmt_addoq.f
  13370. int UNUSED written = 0;
  13371. IADDR UNUSED pc = abuf->addr;
  13372. vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
  13373. {
  13374. {
  13375. SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 4));
  13376. CPU (h_prefixreg_pre_v32) = opval;
  13377. CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
  13378. }
  13379. {
  13380. BI opval = 1;
  13381. SET_H_INSN_PREFIXED_P (opval);
  13382. CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
  13383. }
  13384. }
  13385. #undef FLD
  13386. }
  13387. NEXT (vpc);
  13388. }
  13389. ENDSWITCH (sem) /* End of semantic switch. */
  13390. /* At this point `vpc' contains the next insn to execute. */
  13391. }
  13392. #undef DEFINE_SWITCH
  13393. #endif /* DEFINE_SWITCH */