12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803 |
- ; Fujitsu FRV opcode support, for GNU Binutils. -*- Scheme -*-
- ;
- ; Copyright 2000, 2001, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
- ;
- ; Contributed by Red Hat Inc; developed under contract from Fujitsu.
- ;
- ; This file is part of the GNU Binutils.
- ;
- ; This program is free software; you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation; either version 3 of the License, or
- ; (at your option) any later version.
- ;
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You should have received a copy of the GNU General Public License
- ; along with this program; if not, write to the Free Software
- ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- ; MA 02110-1301, USA.
- (include "simplify.inc")
- ; define-arch must appear first
- (define-arch
- (name frv) ; name of cpu architecture
- (comment "Fujitsu FRV")
- (insn-lsb0? #t)
- (machs frv fr550 fr500 fr450 fr400 tomcat simple)
- (isas frv)
- )
- (define-isa
- (name frv)
- (base-insn-bitsize 32)
- ; Initial bitnumbers to decode insns by.
- (decode-assist (24 23 22 21 20 19 18))
- (liw-insns 1) ; The frv fetches up to 1 insns at a time.
- (parallel-insns 8) ; The frv executes up to 8 insns at a time.
- )
- ; Cpu family definitions.
- ;
- (define-cpu
- ; cpu names must be distinct from the architecture name and machine names.
- ; The "b" suffix stands for "base" and is the convention.
- ; The "f" suffix stands for "family" and is the convention.
- (name frvbf)
- (comment "Fujitsu FRV base family")
- (endian big)
- (word-bitsize 32)
- )
- ; Generic FR-V machine. Supports the entire architecture
- (define-mach
- (name frv)
- (comment "Generic FRV cpu")
- (cpu frvbf)
- )
- (define-model
- (name frv) (comment "Generic FRV model") (attrs)
- (mach frv)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- ; (state)
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; FR550 machine
- (define-mach
- (name fr550)
- (comment "FR550 cpu")
- (cpu frvbf)
- )
- (define-model
- (name fr550) (comment "FR550 model") (attrs)
- (mach fr550)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- (state
- ; State items
- ; These are all masks with each bit representing one register.
- (prev-fr-load DI) ; Previous use of FR register was target of a load
- (prev-fr-complex-1 DI) ; Previous use of FR register has variable latency
- (prev-fr-complex-2 DI) ; Previous use of FR register has variable latency
- (prev-ccr-complex DI) ; Previous use of CCR register has variable latency
- (prev-acc-mmac DI) ; Previous use of ACC register was a MMAC category
- (cur-fr-load DI) ; Current use of FR register was target of a load
- (cur-fr-complex-1 DI) ; Current use of FR register has variable latency
- (cur-fr-complex-2 DI) ; Current use of FR register has variable latency
- (cur-ccr-complex SI) ; Current use of CCR register has variable latency
- (cur-acc-mmac DI) ; Current use of ACC register was a MMAC category
- )
- ; Basic unit for instructions with no latency penalties
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Basic integer insn unit
- (unit u-integer "Integer Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer multiplication unit
- (unit u-imul "Integer Multiplication Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer division unit
- (unit u-idiv "Integer Division Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Branch unit
- (unit u-branch "Branch Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- ((pc)) ; outputs
- () ; profile action (default)
- )
- ; Trap unit
- (unit u-trap "Trap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Condition code check unit
- (unit u-check "Check Unit" ()
- 1 1 ; issue done
- () ; state
- ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Float Arithmetic unit
- (unit u-float-arith "Float Arithmetic unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1) ; inputs
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Dual Arithmetic unit
- (unit u-float-dual-arith "Float Arithmetic unit" ()
- ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI
- 1 3 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1) ; inputs
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Div unit
- (unit u-float-div "Float Div unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)) ; inputs
- ((FRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Square Root unit
- (unit u-float-sqrt "Float Square Root unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Compare unit
- (unit u-float-compare "Float Compare unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FCCi_2 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Dual Float Compare unit
- (unit u-float-dual-compare "Float Dual Compare unit" ()
- ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI
- 1 3 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)) ; inputs
- ((FCCi_2 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to GR unit
- (unit u-fr2gr "FR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintk INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to FR unit
- (unit u-gr2fr "GR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; SPR Move to GR unit
- (unit u-spr2gr "SPR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((spr INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to SPR unit
- (unit u-gr2spr "GR Move to SPR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((spr INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR set half unit
- (unit u-set-hilo "GR Set Half" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((GRkhi INT -1) (GRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR load unit
- (unit u-gr-load "GR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (GRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR store unit
- (unit u-gr-store "GR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; FR load unit
- (unit u-fr-load "FR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR store unit
- (unit u-fr-store "FR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Swap unit
- (unit u-swap "Swap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to FR unit
- (unit u-fr2fr "FR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1)) ; inputs
- ((FRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Clrgr unit
- (unit u-clrgr "Clrgr Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Clrfr unit
- (unit u-clrfr "Clrfr Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache invalidate unit
- (unit u-ici "Insn cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache invalidate unit
- (unit u-dci "Data cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache flush unit
- (unit u-dcf "Data cache flush unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache preload unit
- (unit u-icpl "Insn cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache preload unit
- (unit u-dcpl "Data cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache unlock unit
- (unit u-icul "Insn cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache unlock unit
- (unit u-dcul "Data cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; commit unit
- (unit u-commit "Commit Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRk INT -1) (FRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Float Conversion unit
- (unit u-float-convert "Float Conversion unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media units
- (unit u-media "Media unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-quad "Media-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
- ((FRintkeven INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-dual-expand "Media Dual Expand unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintkeven INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-dual "Media-3-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-acc "Media unit for M-3 using ACC" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1) (ACC40Si INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-acc-dual "Media-3-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((FRintkeven INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-wtacc "Media-3-wtacc unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (ACC40Sk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-mclracc "Media-3-mclracc unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- (unit u-media-set "Media set" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4 "Media-4 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-acc "Media-4-acc unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-add-sub "Media-4-add-sub unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-add-sub-dual "Media-4-add-sub-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-quad "Media-4-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- )
- ; FR500 machine.
- (define-mach
- (name fr500)
- (comment "FR500 cpu")
- (cpu frvbf)
- )
- (define-model
- (name fr500) (comment "FR500 model") (attrs)
- (mach fr500)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- (state
- ; State items
- ; These are all masks with each bit representing one register.
- (prev-fpop DI) ; Previous use of FR register was floating point insn
- (prev-media DI) ; Previous use of FR register was a media insn
- (prev-cc-complex DI) ; Previous use of ICC register was not simple
- (cur-fpop DI) ; Current use of FR register was floating point insn
- (cur-media DI) ; Current use of FR register was a media insn
- (cur-cc-complex DI) ; Current use of ICC register was not simple
- )
- ; Basic unit for instructions with no latency penalties
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Basic integer insn unit
- (unit u-integer "Integer Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer multiplication unit
- (unit u-imul "Integer Multiplication Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer division unit
- (unit u-idiv "Integer Division Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Branch unit
- (unit u-branch "Branch Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- ((pc)) ; outputs
- () ; profile action (default)
- )
- ; Trap unit
- (unit u-trap "Trap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Condition code check unit
- (unit u-check "Check Unit" ()
- 1 1 ; issue done
- () ; state
- ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Clrgr unit
- (unit u-clrgr "Clrgr Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Clrfr unit
- (unit u-clrfr "Clrfr Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; GR set half unit
- (unit u-set-hilo "GR Set Half" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((GRkhi INT -1) (GRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR load unit -- TODO doesn't handle quad
- (unit u-gr-load "GR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (GRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR store unit -- TODO doesn't handle quad
- (unit u-gr-store "GR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; GR recovering store unit -- TODO doesn't handle quad
- (unit u-gr-r-store "GR Recovering Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; FR load unit -- TODO doesn't handle quad
- (unit u-fr-load "FR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR store unit -- TODO doesn't handle quad
- (unit u-fr-store "FR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; FR recovering store unit -- TODO doesn't handle quad
- (unit u-fr-r-store "FR Recovering Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Swap unit
- (unit u-swap "Swap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to FR unit
- (unit u-fr2fr "FR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1)) ; inputs
- ((FRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to GR unit
- (unit u-fr2gr "FR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintk INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; SPR Move to GR unit
- (unit u-spr2gr "SPR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((spr INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to FR unit
- (unit u-gr2fr "GR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to SPR unit
- (unit u-gr2spr "GR Move to SPR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((spr INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Arithmetic unit
- (unit u-float-arith "Float Arithmetic unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1) ; inputs
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Dual Arithmetic unit
- (unit u-float-dual-arith "Float Arithmetic unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1) ; inputs
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Div unit
- (unit u-float-div "Float Div unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)) ; inputs
- ((FRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Square Root unit
- (unit u-float-sqrt "Float Square Root unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Dual Square Root unit
- (unit u-float-dual-sqrt "Float Dual Square Root unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1)) ; inputs
- ((FRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Compare unit
- (unit u-float-compare "Float Compare unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)
- (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
- ((FCCi_2 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Dual Float Compare unit
- (unit u-float-dual-compare "Float Dual Compare unit" ()
- 1 1 ; issue done
- () ; state
- ((FRi INT -1) (FRj INT -1)) ; inputs
- ((FCCi_2 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Float Conversion unit
- (unit u-float-convert "Float Conversion unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs
- ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Dual Float Conversion unit
- (unit u-float-dual-convert "Float Dual Conversion unit" ()
- 1 1 ; issue done
- () ; state
- ((FRj INT -1) (FRintj INT -1)) ; inputs
- ((FRk INT -1) (FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit
- (unit u-media "Media unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1) (ACC40Si INT -1) (ACCGi INT -1)) ; inputs
- ((FRintk INT -1) (ACC40Sk INT -1) (ACC40Uk INT -1) (ACCGk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Quad Arithmetic unit
- (unit u-media-quad-arith "Media Quad Arithmetic unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual Multiplication unit
- (unit u-media-dual-mul "Media Dual Multiplication unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Quad Multiplication unit
- (unit u-media-quad-mul "Media Quad Multiplication unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Quad Complex unit
- (unit u-media-quad-complex "Media Quad Complex unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual Expand unit
- (unit u-media-dual-expand "Media Dual Expand unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual Unpack unit
- (unit u-media-dual-unpack "Media Dual Unpack unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual byte to half unit
- (unit u-media-dual-btoh "Media Byte to byte" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual half to byte unit
- (unit u-media-dual-htob "Media Half to byte" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual byte to half unit extended
- (unit u-media-dual-btohe "Media Byte to byte extended" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Barrier unit
- (unit u-barrier "Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Memory Barrier unit
- (unit u-membar "Memory Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache invalidate unit
- (unit u-ici "Insn cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache invalidate unit
- (unit u-dci "Data cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache flush unit
- (unit u-dcf "Data cache flush unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache preload unit
- (unit u-icpl "Insn cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache preload unit
- (unit u-dcpl "Data cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache unlock unit
- (unit u-icul "Insn cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache unlock unit
- (unit u-dcul "Data cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; commit unit
- (unit u-commit "Commit Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRk INT -1) (FRk INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; Tomcat machine. Early version of fr500 machine
- (define-mach
- (name tomcat)
- (comment "Tomcat -- early version of fr500")
- (cpu frvbf)
- )
- (define-model
- (name tomcat) (comment "Tomcat model") (attrs)
- (mach tomcat)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- ; (state)
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; FR400 machine
- (define-mach
- (name fr400)
- (comment "FR400 cpu")
- (cpu frvbf)
- )
- (define-model
- (name fr400) (comment "FR400 model") (attrs)
- (mach fr400)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- (state
- ; State items
- ; These are all masks with each bit representing one register.
- (prev-fp-load DI) ; Previous use of FR register was floating point load
- (prev-fr-p4 DI) ; Previous use of FR register was media unit 4
- (prev-fr-p6 DI) ; Previous use of FR register was media unit 6
- (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2
- (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4
- (cur-fp-load DI) ; Current use of FR register is floating point load
- (cur-fr-p4 DI) ; Current use of FR register is media unit 4
- (cur-fr-p6 DI) ; Current use of FR register is media unit 6
- (cur-acc-p2 DI) ; Current use of ACC register is media unit 2
- (cur-acc-p4 DI) ; Current use of ACC register is media unit 4
- )
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Basic integer insn unit
- (unit u-integer "Integer Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer multiplication unit
- (unit u-imul "Integer Multiplication Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer division unit
- (unit u-idiv "Integer Division Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Branch unit
- (unit u-branch "Branch Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- ((pc)) ; outputs
- () ; profile action (default)
- )
- ; Trap unit
- (unit u-trap "Trap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Condition code check unit
- (unit u-check "Check Unit" ()
- 1 1 ; issue done
- () ; state
- ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; GR set half unit
- (unit u-set-hilo "GR Set Half" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((GRkhi INT -1) (GRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR load unit -- TODO doesn't handle quad
- (unit u-gr-load "GR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (GRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR store unit -- TODO doesn't handle quad
- (unit u-gr-store "GR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; FR load unit -- TODO doesn't handle quad
- (unit u-fr-load "FR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR store unit -- TODO doesn't handle quad
- (unit u-fr-store "FR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Swap unit
- (unit u-swap "Swap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to GR unit
- (unit u-fr2gr "FR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintk INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; SPR Move to GR unit
- (unit u-spr2gr "SPR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((spr INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to FR unit
- (unit u-gr2fr "GR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to SPR unit
- (unit u-gr2spr "GR Move to SPR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((spr INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M1 -- see table 13-8 in the fr400 LSI
- (unit u-media-1 "Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-1-quad "Media-1-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((FRkhi INT -1) (FRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M2 -- see table 13-8 in the fr400 LSI
- (unit u-media-2 "Media-2 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-quad "Media-2-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-acc "Media-2-acc unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-add-sub "Media-2-add-sub unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M3 -- see table 13-8 in the fr400 LSI
- (unit u-media-3 "Media-3 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-dual "Media-3-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-quad "Media-3-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M4 -- see table 13-8 in the fr400 LSI
- (unit u-media-4 "Media-4 unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-accg "Media-4-accg unit" ()
- 1 1 ; issue done
- () ; state
- ((ACCGi INT -1) (FRinti INT -1)) ; inputs
- ((ACCGk INT -1) (FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M6 -- see table 13-8 in the fr400 LSI
- (unit u-media-6 "Media-6 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M7 -- see table 13-8 in the fr400 LSI
- (unit u-media-7 "Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FCCk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual Expand unit
- (unit u-media-dual-expand "Media Dual Expand unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual half to byte unit
- (unit u-media-dual-htob "Media Half to byte" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Barrier unit
- (unit u-barrier "Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Memory Barrier unit
- (unit u-membar "Memory Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache invalidate unit
- (unit u-ici "Insn cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache invalidate unit
- (unit u-dci "Data cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache flush unit
- (unit u-dcf "Data cache flush unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache preload unit
- (unit u-icpl "Insn cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache preload unit
- (unit u-dcpl "Data cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache unlock unit
- (unit u-icul "Insn cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache unlock unit
- (unit u-dcul "Data cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; FR450 machine
- (define-mach
- (name fr450)
- (comment "FR450 cpu")
- (cpu frvbf)
- )
- (define-model
- (name fr450) (comment "FR450 model") (attrs)
- (mach fr450)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- (state
- ; State items
- ; These are all masks with each bit representing one register.
- (prev-fp-load DI) ; Previous use of FR register was floating point load
- (prev-fr-p4 DI) ; Previous use of FR register was media unit 4
- (prev-fr-p6 DI) ; Previous use of FR register was media unit 6
- (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2
- (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4
- (cur-fp-load DI) ; Current use of FR register is floating point load
- (cur-fr-p4 DI) ; Current use of FR register is media unit 4
- (cur-fr-p6 DI) ; Current use of FR register is media unit 6
- (cur-acc-p2 DI) ; Current use of ACC register is media unit 2
- (cur-acc-p4 DI) ; Current use of ACC register is media unit 4
- )
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Basic integer insn unit
- (unit u-integer "Integer Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer multiplication unit
- (unit u-imul "Integer Multiplication Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Integer division unit
- (unit u-idiv "Integer Division Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Branch unit
- (unit u-branch "Branch Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- ((pc)) ; outputs
- () ; profile action (default)
- )
- ; Trap unit
- (unit u-trap "Trap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)
- (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Condition code check unit
- (unit u-check "Check Unit" ()
- 1 1 ; issue done
- () ; state
- ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; GR set half unit
- (unit u-set-hilo "GR Set Half" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((GRkhi INT -1) (GRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR load unit -- TODO doesn't handle quad
- (unit u-gr-load "GR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1) (GRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR store unit -- TODO doesn't handle quad
- (unit u-gr-store "GR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; FR load unit -- TODO doesn't handle quad
- (unit u-fr-load "FR Load Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR store unit -- TODO doesn't handle quad
- (unit u-fr-store "FR Store Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Swap unit
- (unit u-swap "Swap Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- ((GRk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; FR Move to GR unit
- (unit u-fr2gr "FR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((FRintk INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; SPR Move to GR unit
- (unit u-spr2gr "SPR Move to GR Unit" ()
- 1 1 ; issue done
- () ; state
- ((spr INT -1)) ; inputs
- ((GRj INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to FR unit
- (unit u-gr2fr "GR Move to FR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; GR Move to SPR unit
- (unit u-gr2spr "GR Move to SPR Unit" ()
- 1 1 ; issue done
- () ; state
- ((GRj INT -1)) ; inputs
- ((spr INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M1 -- see table 14-8 in the fr450 LSI
- (unit u-media-1 "Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-1-quad "Media-1-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- ((FRkhi INT -1) (FRklo INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M2 -- see table 14-8 in the fr450 LSI
- (unit u-media-2 "Media-2 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-quad "Media-2-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-acc "Media-2-acc unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-add-sub "Media-2-add-sub unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((ACC40Sk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M3 -- see table 14-8 in the fr450 LSI
- (unit u-media-3 "Media-3 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-dual "Media-3-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-3-quad "Media-3-quad unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M4 -- see table 14-8 in the fr450 LSI
- (unit u-media-4 "Media-4 unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
- ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-accg "Media-4-accg unit" ()
- 1 1 ; issue done
- () ; state
- ((ACCGi INT -1) (FRinti INT -1)) ; inputs
- ((ACCGk INT -1) (FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
- 1 1 ; issue done
- () ; state
- ((ACC40Si INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- (unit u-media-4-mclracca "Media-4 unit for MCLRACC with #A=1" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Media unit M6 -- see table 14-8 in the fr450 LSI
- (unit u-media-6 "Media-6 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media unit M7 -- see table 14-8 in the fr450 LSI
- (unit u-media-7 "Media-1 unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1) (FRintj INT -1)) ; inputs
- ((FCCk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual Expand unit
- (unit u-media-dual-expand "Media Dual Expand unit" ()
- 1 1 ; issue done
- () ; state
- ((FRinti INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Media Dual half to byte unit
- (unit u-media-dual-htob "Media Half to byte" ()
- 1 1 ; issue done
- () ; state
- ((FRintj INT -1)) ; inputs
- ((FRintk INT -1)) ; outputs
- () ; profile action (default)
- )
- ; Barrier unit
- (unit u-barrier "Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Memory Barrier unit
- (unit u-membar "Memory Barrier unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache invalidate unit
- (unit u-ici "Insn cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache invalidate unit
- (unit u-dci "Data cache invalidate unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache flush unit
- (unit u-dcf "Data cache flush unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache preload unit
- (unit u-icpl "Insn cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache preload unit
- (unit u-dcpl "Data cache preload unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Insn cache unlock unit
- (unit u-icul "Insn cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- ; Data cache unlock unit
- (unit u-dcul "Data cache unlock unit" ()
- 1 1 ; issue done
- () ; state
- ((GRi INT -1) (GRj INT -1)) ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; Simple machine - single issue integer machine
- (define-mach
- (name simple)
- (comment "Simple single issue integer cpu")
- (cpu frvbf)
- )
- (define-model
- (name simple) (comment "Simple model") (attrs)
- (mach simple)
- (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
- ; `state' is a list of variables for recording model state
- (state)
- (unit u-exec "Execution Unit" ()
- 1 1 ; issue done
- () ; state
- () ; inputs
- () ; outputs
- () ; profile action (default)
- )
- )
- ; The instruction fetch/execute cycle.
- ;
- ; This is how to fetch and decode an instruction.
- ; Leave it out for now
- ; (define-extract (const SI 0))
- ; This is how to execute a decoded instruction.
- ; Leave it out for now
- ; (define-execute (const SI 0))
- ; An attribute to describe which unit an insn runs in.
- (define-attr
- (for insn)
- (type enum)
- (name UNIT)
- (comment "parallel execution pipeline selection")
- ; The order of declaration is significant.
- ; See the *_unit_mapping tables in frv.opc
- ; Keep variations on the same unit together.
- ; Keep the '01' variant immediately after the '1' variant in each unit.
- ; Keep the 'ALL' variations immediately after the last numbered variant in each unit.
- (values NIL
- I0 I1 I01 I2 I3 IALL
- FM0 FM1 FM01 FM2 FM3 FMALL FMLOW
- B0 B1 B01
- C
- MULT-DIV ; multiply/division slotted differently on different machines
- IACC ; iacc multiply slotted differently on different machines
- LOAD ; loads slotted differently on different machines
- STORE ; store slotted differently on different machines
- SCAN ; scan, scani slotted differently on different machines
- DCPL ; dcpl slotted differently on different machines
- MDUALACC ; media dual acc slotted differently on different machines
- MDCUTSSI ; mdcutssi insn slotted differently on different machines
- MCLRACC-1; mclracc A==1 slotted differently on different machines
- NUM_UNITS
- )
- )
- ; Attributes to describe major categories of insns
- (define-attr
- (for insn)
- (type enum)
- (name FR400-MAJOR)
- (comment "fr400 major insn categories")
- ; The order of declaration is significant. Keep variations on the same major
- ; together.
- (values NONE
- I-1 I-2 I-3 I-4 I-5
- B-1 B-2 B-3 B-4 B-5 B-6
- C-1 C-2
- M-1 M-2
- )
- )
- (define-attr
- (for insn)
- (type enum)
- (name FR450-MAJOR)
- (comment "fr450 major insn categories")
- ; The order of declaration is significant. Keep variations on the same major
- ; together.
- (values NONE
- I-1 I-2 I-3 I-4 I-5
- B-1 B-2 B-3 B-4 B-5 B-6
- C-1 C-2
- M-1 M-2 M-3 M-4 M-5 M-6
- )
- )
- (define-attr
- (for insn)
- (type enum)
- (name FR500-MAJOR)
- (comment "fr500 major insn categories")
- ; The order of declaration is significant. Keep variations on the same major
- ; together.
- (values NONE
- I-1 I-2 I-3 I-4 I-5 I-6
- B-1 B-2 B-3 B-4 B-5 B-6
- C-1 C-2
- F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8
- M-1 M-2 M-3 M-4 M-5 M-6 M-7 M-8
- )
- )
- (define-attr
- (for insn)
- (type enum)
- (name FR550-MAJOR)
- (comment "fr550 major insn categories")
- ; The order of declaration is significant. Keep variations on the same major
- ; together.
- (values NONE
- I-1 I-2 I-3 I-4 I-5 I-6 I-7 I-8
- B-1 B-2 B-3 B-4 B-5 B-6
- C-1 C-2
- F-1 F-2 F-3 F-4
- M-1 M-2 M-3 M-4 M-5
- )
- )
- ; Privileged insn
- (define-attr
- (for insn)
- (type boolean)
- (name PRIVILEGED)
- (comment "insn only allowed in supervisor mode")
- )
- ; Non-Excepting insn
- (define-attr
- (for insn)
- (type boolean)
- (name NON-EXCEPTING)
- (comment "non-excepting insn")
- )
- ; Conditional insn
- (define-attr
- (for insn)
- (type boolean)
- (name CONDITIONAL)
- (comment "conditional insn")
- )
- ; insn accesses FR registers
- (define-attr
- (for insn)
- (type boolean)
- (name FR-ACCESS)
- (comment "insn accesses FR registers")
- )
- ; insn preserves MSR.OVF
- (define-attr
- (for insn)
- (type boolean)
- (name PRESERVE-OVF)
- (comment "Preserve value of MSR.OVF")
- )
- ; "Audio" instruction provided by the fr405 but not the original fr400 core.
- (define-attr
- (for insn)
- (type boolean)
- (name AUDIO)
- (comment "Audio instruction added with FR405")
- )
- ; null attribute -- used as a place holder for where an attribue is required.
- (define-attr
- (for insn)
- (type boolean)
- (name NA)
- (comment "placeholder attribute")
- (attrs META) ; do not define in any generated file for now
- )
- ; IDOC attribute for instruction documentation.
- (define-attr
- (for insn)
- (type enum)
- (name IDOC)
- (comment "insn kind for documentation")
- (attrs META)
- (values
- (MEM - () "Memory")
- (ALU - () "ALU")
- (FPU - () "FPU")
- (BR - () "Branch")
- (PRIV - () "Priviledged")
- (MISC - () "Miscellaneous")
- )
- )
- ; Instruction fields.
- ;
- ; Attributes:
- ; PCREL-ADDR: pc relative value (for reloc and disassembly purposes)
- ; ABS-ADDR: absolute address (for reloc and disassembly purposes?)
- ; RESERVED: bits are not used to decode insn, must be all 0
- (dnf f-pack "packing bit" () 31 1)
- (dnf f-op "primary opcode" () 24 7)
- (dnf f-ope1 "extended opcode" () 11 6)
- (dnf f-ope2 "extended opcode" () 9 4)
- (dnf f-ope3 "extended opcode" () 15 3)
- (dnf f-ope4 "extended opcode" () 7 2)
- (dnf f-GRi "source register 1" () 17 6)
- (dnf f-GRj "source register 2" () 5 6)
- (dnf f-GRk "destination register" () 30 6)
- (dnf f-FRi "source register 1" () 17 6)
- (dnf f-FRj "source register 2" () 5 6)
- (dnf f-FRk "destination register" () 30 6)
- (dnf f-CPRi "source register 1" () 17 6)
- (dnf f-CPRj "source register 2" () 5 6)
- (dnf f-CPRk "destination register" () 30 6)
- (dnf f-ACCGi "source register" () 17 6)
- (dnf f-ACCGk "destination register" () 30 6)
- (dnf f-ACC40Si "40 bit signed accumulator" () 17 6)
- (dnf f-ACC40Ui "40 bit unsigned accumulator" () 17 6)
- (dnf f-ACC40Sk "40 bit accumulator" () 30 6)
- (dnf f-ACC40Uk "40 bit accumulator" () 30 6)
- (dnf f-CRi "source register" () 14 3)
- (dnf f-CRj "source register" () 2 3)
- (dnf f-CRk "destination register" () 27 3)
- (dnf f-CCi "condition register" () 11 3)
- (df f-CRj_int "target cr for ck insns" () 26 2 UINT
- ((value pc) (sub WI value 4))
- ((value pc) (add WI value 4))
- )
- (dnf f-CRj_float "target cr for fck insns" () 26 2)
- (dnf f-ICCi_1 "condition register" () 11 2)
- (dnf f-ICCi_2 "condition register" () 26 2)
- (dnf f-ICCi_3 "condition register" () 1 2)
- (dnf f-FCCi_1 "condition register" () 11 2)
- (dnf f-FCCi_2 "condition register" () 26 2)
- (dnf f-FCCi_3 "condition register" () 1 2)
- (dnf f-FCCk "condition register" () 26 2)
- (dnf f-eir "exception insn register" () 17 6)
- (df f-s10 "10 bit sign extended" () 9 10 INT #f #f)
- (df f-s12 "12 bit sign extended" () 11 12 INT #f #f)
- (df f-d12 "12 bit sign extended" () 11 12 INT #f #f)
- (df f-u16 "16 bit unsigned" () 15 16 UINT #f #f)
- (df f-s16 "16 bit sign extended" () 15 16 INT #f #f)
- (df f-s6 "6 bit signed" () 5 6 INT #f #f)
- (df f-s6_1 "6 bit signed" () 11 6 INT #f #f)
- (df f-u6 "6 bit unsigned" () 5 6 UINT #f #f)
- (df f-s5 "5 bit signed" () 4 5 INT #f #f)
- (df f-u12-h "upper 6 bits of u12" () 17 6 INT #f #f)
- (df f-u12-l "lower 6 bits of u12" () 5 6 UINT #f #f)
- (dnmf f-u12 "12 bit signed immediate" () INT
- (f-u12-h f-u12-l)
- (sequence () ; insert
- (set (ifield f-u12-h) (sra SI (ifield f-u12) 6))
- (set (ifield f-u12-l) (and (ifield f-u12) #x3f))
- )
- (sequence () ; extract
- (set (ifield f-u12) (or (mul (ifield f-u12-h) 64)
- (ifield f-u12-l)))
- )
- )
- (dnf f-int-cc "integer branch conditions" () 30 4)
- (dnf f-flt-cc "floating branch conditions" () 30 4)
- (df f-cond "conditional arithmetic" () 8 1 UINT #f #f)
- (df f-ccond "lr branch condition" () 12 1 UINT #f #f)
- (df f-hint "2 bit branch prediction hint" () 17 2 UINT #f #f)
- (df f-LI "link indicator" () 25 1 UINT #f #f)
- (df f-lock "cache lock indicator" () 25 1 UINT #f #f)
- (df f-debug "debug mode indicator" () 25 1 UINT #f #f)
- (df f-A "all accumulator bit" () 17 1 UINT #f #f)
- (df f-ae "cache all entries indicator" () 25 1 UINT #f #f)
- (dnf f-spr-h "upper 6 bits of spr" () 30 6)
- (dnf f-spr-l "lower 6 bits of spr" () 17 6)
- (dnmf f-spr "special purpose register" () UINT
- (f-spr-h f-spr-l)
- (sequence () ; insert
- (set (ifield f-spr-h) (srl (ifield f-spr) (const 6)))
- (set (ifield f-spr-l) (and (ifield f-spr) (const #x3f)))
- )
- (sequence () ; extract
- (set (ifield f-spr) (or (sll (ifield f-spr-h) (const 6))
- (ifield f-spr-l)))
- )
- )
- (df f-label16 "18 bit pc relative signed offset" (PCREL-ADDR) 15 16 INT
- ((value pc) (sra WI (sub WI value pc) (const 2)))
- ((value pc) (add WI (mul WI value (const 4)) pc))
- )
- (df f-labelH6 "upper 6 bits of label24" () 30 6 INT #f #f)
- (dnf f-labelL18 "lower 18 bits of label24" () 17 18)
- (dnmf f-label24 "26 bit signed offset" (PCREL-ADDR) INT
- (f-labelH6 f-labelL18)
- ; insert
- (sequence ()
- (set (ifield f-labelH6)
- (sra WI (sub (ifield f-label24) pc) (const 20)))
- (set (ifield f-labelL18)
- (and (srl (sub (ifield f-label24) pc) (const 2))
- (const #x3ffff)))
- )
- ; extract
- (sequence ()
- (set (ifield f-label24)
- (add (mul (or (mul (ifield f-labelH6) (sll 1 18))
- (ifield f-labelL18))
- (const 4))
- pc)))
- )
- (dnf f-LRAE "Load Real Address E flag" () 5 1)
- (dnf f-LRAD "Load Real Address D flag" () 4 1)
- (dnf f-LRAS "Load Real Address S flag" () 3 1)
- (dnf f-TLBPRopx "TLB Probe operation number" () 28 3)
- (dnf f-TLBPRL "TLB Probe L flag" () 25 1)
- (dnf f-ICCi_1-null "null field" (RESERVED) 11 2)
- (dnf f-ICCi_2-null "null field" (RESERVED) 26 2)
- (dnf f-ICCi_3-null "null field" (RESERVED) 1 2)
- (dnf f-FCCi_1-null "null field" (RESERVED) 11 2)
- (dnf f-FCCi_2-null "null field" (RESERVED) 26 2)
- (dnf f-FCCi_3-null "null field" (RESERVED) 1 2)
- (dnf f-rs-null "null field" (RESERVED) 17 6)
- (dnf f-GRi-null "null field" (RESERVED) 17 6)
- (dnf f-GRj-null "null field" (RESERVED) 5 6)
- (dnf f-GRk-null "null field" (RESERVED) 30 6)
- (dnf f-FRi-null "null field" (RESERVED) 17 6)
- (dnf f-FRj-null "null field" (RESERVED) 5 6)
- (dnf f-ACCj-null "null field" (RESERVED) 5 6)
- (dnf f-rd-null "null field" (RESERVED) 30 6)
- (dnf f-cond-null "null field" (RESERVED) 30 4)
- (dnf f-ccond-null "null field" (RESERVED) 12 1)
- (dnf f-s12-null "null field" (RESERVED) 11 12)
- (dnf f-label16-null "null field" (RESERVED) 15 16)
- (dnf f-misc-null-1 "null field" (RESERVED) 30 5)
- (dnf f-misc-null-2 "null field" (RESERVED) 11 6)
- (dnf f-misc-null-3 "null field" (RESERVED) 11 4)
- (dnf f-misc-null-4 "null field" (RESERVED) 17 2)
- (dnf f-misc-null-5 "null field" (RESERVED) 17 16)
- (dnf f-misc-null-6 "null field" (RESERVED) 30 3)
- (dnf f-misc-null-7 "null field" (RESERVED) 17 3)
- (dnf f-misc-null-8 "null field" (RESERVED) 5 3)
- (dnf f-misc-null-9 "null field" (RESERVED) 5 4)
- (dnf f-misc-null-10 "null field" (RESERVED) 16 5)
- (dnf f-misc-null-11 "null field" (RESERVED) 5 1)
- (dnf f-LRA-null "null field" (RESERVED) 2 3)
- (dnf f-TLBPR-null "null field" (RESERVED) 30 2)
- (dnf f-LI-off "null field" (RESERVED) 25 1)
- (dnf f-LI-on "null field" (RESERVED) 25 1)
- ; Relocation annotations.
- (dsh h-reloc-ann "relocation annotation" () (register BI))
- (dnf f-reloc-ann "relocation annotation" () 0 0)
- (define-pmacro (dann xname xcomment xmode xparse xprint)
- (define-operand
- (name xname)
- (comment xcomment)
- (type h-reloc-ann)
- (index f-reloc-ann)
- (mode xmode)
- (handlers (parse xparse) (print xprint))
- )
- )
- ; Enums.
- ; insn-op:
- ; FIXME: should use die macro or some such
- (define-normal-insn-enum insn-op "insn op enums" () OP_ f-op
- (
- "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
- "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F"
- "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F"
- "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F"
- "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F"
- "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "5A" "5B" "5C" "5D" "5E" "5F"
- "60" "61" "62" "63" "64" "65" "66" "67" "68" "69" "6A" "6B" "6C" "6D" "6E" "6F"
- "70" "71" "72" "73" "74" "75" "76" "77" "78" "79" "7A" "7B" "7C" "7D" "7E" "7F"
- )
- )
- (define-normal-insn-enum insn-ope1 "insn ope enums" () OPE1_ f-ope1
- (
- "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
- "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F"
- "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F"
- "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F"
- )
- )
- (define-normal-insn-enum insn-ope2 "insn ope enums" () OPE2_ f-ope2
- (
- "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
- )
- )
- (define-normal-insn-enum insn-ope3 "insn ope enums" () OPE3_ f-ope3
- (
- "00" "01" "02" "03" "04" "05" "06" "07"
- )
- )
- (define-normal-insn-enum insn-ope4 "insn ope enums" () OPE4_ f-ope4
- (
- "0" "1" "2" "3"
- )
- )
- ; int-cc: integer branch conditions
- ; FIXME: should use die macro or some such
- (define-normal-insn-enum int-cc "integer branch cond enums" () ICC_ f-int-cc
- (
- "nev" "c" "v" "lt" "eq" "ls" "n" "le"
- "ra" "nc" "nv" "ge" "ne" "hi" "p" "gt"
- )
- )
- ; flt-cc: floating-point/media branch conditions
- ; FIXME: should use die macro or some such
- (define-normal-insn-enum flt-cc "float branch cond enums" () FCC_ f-flt-cc
- ("nev" "u" "gt" "ug" "lt" "ul" "lg" "ne"
- "eq" "ue" "ge" "uge" "le" "ule" "o" "ra")
- )
- ; Hardware pieces.
- ; These entries list the elements of the raw hardware.
- ; They're also used to provide tables and other elements of the assembly
- ; language.
- (dnh h-pc "program counter" (PC PROFILE) (pc) () () ())
- ; The PSR. The individual fields are referenced more than the entire
- ; register, so reference them directly. We can assemble the
- ; entire register contents when necessary.
- ;
- (dsh h-psr_imple "PSR.IMPLE" () (register UQI))
- (dsh h-psr_ver "PSR.VER" () (register UQI))
- (dsh h-psr_ice "PSR.ICE bit" () (register BI))
- (dsh h-psr_nem "PSR.NEM bit" () (register BI))
- (dsh h-psr_cm "PSR.CM bit" () (register BI))
- (dsh h-psr_be "PSR.BE bit" () (register BI))
- (dsh h-psr_esr "PSR.ESR bit" () (register BI))
- (dsh h-psr_ef "PSR.EF bit" () (register BI))
- (dsh h-psr_em "PSR.EM bit" () (register BI))
- (dsh h-psr_pil "PSR.PIL " () (register UQI))
- (dsh h-psr_ps "PSR.PS bit" () (register BI))
- (dsh h-psr_et "PSR.ET bit" () (register BI))
- ; PSR.S requires special handling because the shadow registers (SR0-SR4) must
- ; be switched with GR4-GR7 when changing from user to supervisor mode or
- ; vice-versa.
- (define-hardware
- (name h-psr_s)
- (comment "PSR.S bit")
- (attrs)
- (type register BI)
- (get)
- (set (newval) (c-call VOID "@cpu@_h_psr_s_set_handler" newval))
- )
- ; The TBR. The individual bits are referenced more than the entire
- ; register, so reference them directly. We can assemble the
- ; entire register contents when necessary.
- ;
- (dsh h-tbr_tba "TBR.TBA" () (register UWI))
- (dsh h-tbr_tt "TBR.TT" () (register UQI))
- ; The BPSR. The individual bits are referenced more than the entire
- ; register, so reference them directly. We can assemble the
- ; entire register contents when necessary.
- ;
- (dsh h-bpsr_bs "PSR.S bit" () (register BI))
- (dsh h-bpsr_bet "PSR.ET bit" () (register BI))
- ; General registers
- ;
- (define-keyword
- (name gr-names)
- (print-name h-gr)
- (prefix "")
- (values
- (sp 1) (fp 2)
- (gr0 0)(gr1 1)(gr2 2)(gr3 3)(gr4 4)(gr5 5)(gr6 6)(gr7 7)
- (gr8 8)(gr9 9)(gr10 10)(gr11 11)(gr12 12)(gr13 13)(gr14 14)(gr15 15)
- (gr16 16)(gr17 17)(gr18 18)(gr19 19)(gr20 20)(gr21 21)(gr22 22)(gr23 23)
- (gr24 24)(gr25 25)(gr26 26)(gr27 27)(gr28 28)(gr29 29)(gr30 30)(gr31 31)
- (gr32 32)(gr33 33)(gr34 34)(gr35 35)(gr36 36)(gr37 37)(gr38 38)(gr39 39)
- (gr40 40)(gr41 41)(gr42 42)(gr43 43)(gr44 44)(gr45 45)(gr46 46)(gr47 47)
- (gr48 48)(gr49 49)(gr50 50)(gr51 51)(gr52 52)(gr53 53)(gr54 54)(gr55 55)
- (gr56 56)(gr57 57)(gr58 58)(gr59 59)(gr60 60)(gr61 61)(gr62 62)(gr63 63)
- )
- )
- (define-hardware
- (name h-gr)
- (comment "general registers")
- (attrs PROFILE)
- (type register USI (64))
- (indices extern-keyword gr-names)
- (get (index) (c-call WI "@cpu@_h_gr_get_handler" index))
- (set (index newval) (c-call VOID "@cpu@_h_gr_set_handler" index newval))
- )
- ; General Registers as double words
- ; These registers are shadowed onto h-gr
- (define-hardware
- (name h-gr_double)
- (comment "general registers as double words")
- (attrs PROFILE VIRTUAL)
- (type register DI (32))
- ; FIXME: Need constraint to prohibit odd numbers.
- (indices extern-keyword gr-names)
- (get (index)
- (c-call DI "@cpu@_h_gr_double_get_handler" index))
- (set (index newval)
- (c-call VOID "@cpu@_h_gr_double_set_handler" index newval))
- )
- ; General Registers as high and low half words
- ; These registers are shadowed onto h-gr
- (define-hardware
- (name h-gr_hi)
- (comment "general registers as high half word")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword gr-names)
- (get (index) (c-call UHI "@cpu@_h_gr_hi_get_handler" index))
- (set (index newval) (c-call VOID "@cpu@_h_gr_hi_set_handler" index newval))
- )
- (define-hardware
- (name h-gr_lo)
- (comment "general registers as low half word")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword gr-names)
- (get (index) (c-call UHI "@cpu@_h_gr_lo_get_handler" index))
- (set (index newval) (c-call VOID "@cpu@_h_gr_lo_set_handler" index newval))
- )
- ; Floating Point Registers
- (define-keyword
- (name fr-names)
- (print-name h-fr)
- (prefix "")
- (values
- (fr0 0)(fr1 1)(fr2 2)(fr3 3)(fr4 4)(fr5 5)(fr6 6)(fr7 7)
- (fr8 8)(fr9 9)(fr10 10)(fr11 11)(fr12 12)(fr13 13)(fr14 14)(fr15 15)
- (fr16 16)(fr17 17)(fr18 18)(fr19 19)(fr20 20)(fr21 21)(fr22 22)(fr23 23)
- (fr24 24)(fr25 25)(fr26 26)(fr27 27)(fr28 28)(fr29 29)(fr30 30)(fr31 31)
- (fr32 32)(fr33 33)(fr34 34)(fr35 35)(fr36 36)(fr37 37)(fr38 38)(fr39 39)
- (fr40 40)(fr41 41)(fr42 42)(fr43 43)(fr44 44)(fr45 45)(fr46 46)(fr47 47)
- (fr48 48)(fr49 49)(fr50 50)(fr51 51)(fr52 52)(fr53 53)(fr54 54)(fr55 55)
- (fr56 56)(fr57 57)(fr58 58)(fr59 59)(fr60 60)(fr61 61)(fr62 62)(fr63 63)
- )
- )
- (define-hardware
- (name h-fr)
- (comment "floating point registers")
- (attrs PROFILE)
- (type register SF (64))
- (indices extern-keyword fr-names)
- (get (index) (c-call SF "@cpu@_h_fr_get_handler" index))
- (set (index newval) (c-call VOID "@cpu@_h_fr_set_handler" index newval))
- )
- ; Floating Point Registers as double precision
- ; These registers are shadowed onto h-fr
- (define-hardware
- (name h-fr_double)
- (comment "floating point registers as double precision")
- (attrs PROFILE VIRTUAL)
- (type register DF (32))
- ; FIXME: Need constraint to prohibit odd numbers.
- (indices extern-keyword fr-names)
- (get (index)
- (c-call DF "@cpu@_h_fr_double_get_handler" index))
- (set (index newval)
- (c-call VOID "@cpu@_h_fr_double_set_handler" index newval))
- )
- ; Floating Point Registers as integer words.
- ; These registers are shadowed onto h-fr
- (define-hardware
- (name h-fr_int)
- (comment "floating point registers as integers")
- (attrs PROFILE VIRTUAL)
- (type register USI (64))
- (indices extern-keyword fr-names)
- (get (index)
- (c-call USI "@cpu@_h_fr_int_get_handler" index))
- (set (index newval)
- (c-call VOID "@cpu@_h_fr_int_set_handler" index newval))
- )
- ; Floating Point Registers as high and low half words
- ; These registers are shadowed onto h-fr
- (define-hardware
- (name h-fr_hi)
- (comment "floating point registers as unsigned high half word")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (srl (reg h-fr_int regno) 16))
- (set (regno newval) (set (reg h-fr_int regno)
- (or (and (reg h-fr_int regno) #xffff)
- (sll newval 16))))
- )
- (define-hardware
- (name h-fr_lo)
- (comment "floating point registers as unsigned low half word")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (and (reg h-fr_int regno) #xffff))
- (set (regno newval) (set (reg h-fr_int regno)
- (or (and (reg h-fr_int regno) #xffff0000)
- (and newval #xffff))))
- )
- ; Floating Point Registers as unsigned bytes
- ; These registers are shadowed onto h-fr
- (define-hardware
- (name h-fr_0)
- (comment "floating point registers as unsigned byte 0")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (and (reg h-fr_int regno) #xff))
- (set (regno newval)
- (sequence ()
- (if (gt USI newval #xff)
- (set newval #xff))
- (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffffff00)
- newval))))
- )
- (define-hardware
- (name h-fr_1)
- (comment "floating point registers as unsigned byte 1")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (and (srl (reg h-fr_int regno) 8) #xff))
- (set (regno newval)
- (sequence ()
- (if (gt USI newval #xff)
- (set newval #xff))
- (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffff00ff)
- (sll newval 8)))))
- )
- (define-hardware
- (name h-fr_2)
- (comment "floating point registers as unsigned byte 2")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (and (srl (reg h-fr_int regno) 16) #xff))
- (set (regno newval)
- (sequence ()
- (if (gt USI newval #xff)
- (set newval #xff))
- (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xff00ffff)
- (sll newval 16)))))
- )
- (define-hardware
- (name h-fr_3)
- (comment "floating point registers as unsigned byte 3")
- (attrs PROFILE VIRTUAL)
- (type register UHI (64))
- (indices extern-keyword fr-names)
- (get (regno) (and (srl (reg h-fr_int regno) 24) #xff))
- (set (regno newval)
- (sequence ()
- (if (gt USI newval #xff)
- (set newval #xff))
- (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #x00ffffff)
- (sll newval 24)))))
- )
- ; Coprocessor Registers
- ;
- (define-keyword
- (name cpr-names)
- (print-name h-cpr)
- (prefix "")
- (values
- (cpr0 0)(cpr1 1)(cpr2 2)(cpr3 3)(cpr4 4)(cpr5 5)(cpr6 6)(cpr7 7)
- (cpr8 8)(cpr9 9)(cpr10 10)(cpr11 11)(cpr12 12)(cpr13 13)(cpr14 14)(cpr15 15)
- (cpr16 16)(cpr17 17)(cpr18 18)(cpr19 19)(cpr20 20)(cpr21 21)(cpr22 22)(cpr23 23)
- (cpr24 24)(cpr25 25)(cpr26 26)(cpr27 27)(cpr28 28)(cpr29 29)(cpr30 30)(cpr31 31)
- (cpr32 32)(cpr33 33)(cpr34 34)(cpr35 35)(cpr36 36)(cpr37 37)(cpr38 38)(cpr39 39)
- (cpr40 40)(cpr41 41)(cpr42 42)(cpr43 43)(cpr44 44)(cpr45 45)(cpr46 46)(cpr47 47)
- (cpr48 48)(cpr49 49)(cpr50 50)(cpr51 51)(cpr52 52)(cpr53 53)(cpr54 54)(cpr55 55)
- (cpr56 56)(cpr57 57)(cpr58 58)(cpr59 59)(cpr60 60)(cpr61 61)(cpr62 62)(cpr63 63)
- )
- )
- (define-hardware
- (name h-cpr)
- (comment "coprocessor registers")
- (attrs PROFILE (MACH frv))
- (type register WI (64))
- (indices extern-keyword cpr-names)
- )
- ; Coprocessor Registers as double words
- ; These registers are shadowed onto h-cpr
- (define-hardware
- (name h-cpr_double)
- (comment "coprocessor registers as double words")
- (attrs PROFILE VIRTUAL (MACH frv))
- (type register DI (32))
- ; FIXME: Need constraint to prohibit odd numbers.
- (indices extern-keyword cpr-names)
- (get (index)
- (c-call DI "@cpu@_h_cpr_double_get_handler" index))
- (set (index newval)
- (c-call VOID "@cpu@_h_cpr_double_set_handler" index newval))
- )
- ; Special Purpose Registers
- ;
- (define-keyword
- (name spr-names)
- (print-name h-spr)
- (prefix "")
- (values
- (psr 0) (pcsr 1) (bpcsr 2) (tbr 3) (bpsr 4)
- (hsr0 16) (hsr1 17) (hsr2 18) (hsr3 19)
- (hsr4 20) (hsr5 21) (hsr6 22) (hsr7 23)
- (hsr8 24) (hsr9 25) (hsr10 26) (hsr11 27)
- (hsr12 28) (hsr13 29) (hsr14 30) (hsr15 31)
- (hsr16 32) (hsr17 33) (hsr18 34) (hsr19 35)
- (hsr20 36) (hsr21 37) (hsr22 38) (hsr23 39)
- (hsr24 40) (hsr25 41) (hsr26 42) (hsr27 43)
- (hsr28 44) (hsr29 45) (hsr30 46) (hsr31 47)
- (hsr32 48) (hsr33 49) (hsr34 50) (hsr35 51)
- (hsr36 52) (hsr37 53) (hsr38 54) (hsr39 55)
- (hsr40 56) (hsr41 57) (hsr42 58) (hsr43 59)
- (hsr44 60) (hsr45 61) (hsr46 62) (hsr47 63)
- (hsr48 64) (hsr49 65) (hsr50 66) (hsr51 67)
- (hsr52 68) (hsr53 69) (hsr54 70) (hsr55 71)
- (hsr56 72) (hsr57 73) (hsr58 74) (hsr59 75)
- (hsr60 76) (hsr61 77) (hsr62 78) (hsr63 79)
- (ccr 256) (cccr 263) (lr 272) (lcr 273) (iacc0h 280) (iacc0l 281) (isr 288)
- (neear0 352) (neear1 353) (neear2 354) (neear3 355)
- (neear4 356) (neear5 357) (neear6 358) (neear7 359)
- (neear8 360) (neear9 361) (neear10 362) (neear11 363)
- (neear12 364) (neear13 365) (neear14 366) (neear15 367)
- (neear16 368) (neear17 369) (neear18 370) (neear19 371)
- (neear20 372) (neear21 373) (neear22 374) (neear23 375)
- (neear24 376) (neear25 377) (neear26 378) (neear27 379)
- (neear28 380) (neear29 381) (neear30 382) (neear31 383)
- (nesr0 384) (nesr1 385) (nesr2 386) (nesr3 387)
- (nesr4 388) (nesr5 389) (nesr6 390) (nesr7 391)
- (nesr8 392) (nesr9 393) (nesr10 394) (nesr11 395)
- (nesr12 396) (nesr13 397) (nesr14 398) (nesr15 399)
- (nesr16 400) (nesr17 401) (nesr18 402) (nesr19 403)
- (nesr20 404) (nesr21 405) (nesr22 406) (nesr23 407)
- (nesr24 408) (nesr25 409) (nesr26 410) (nesr27 411)
- (nesr28 412) (nesr29 413) (nesr30 414) (nesr31 415)
- (necr 416)
- (gner0 432) (gner1 433)
- (fner0 434) (fner1 435)
- (epcr0 512) (epcr1 513) (epcr2 514) (epcr3 515)
- (epcr4 516) (epcr5 517) (epcr6 518) (epcr7 519)
- (epcr8 520) (epcr9 521) (epcr10 522) (epcr11 523)
- (epcr12 524) (epcr13 525) (epcr14 526) (epcr15 527)
- (epcr16 528) (epcr17 529) (epcr18 530) (epcr19 531)
- (epcr20 532) (epcr21 533) (epcr22 534) (epcr23 535)
- (epcr24 536) (epcr25 537) (epcr26 538) (epcr27 539)
- (epcr28 540) (epcr29 541) (epcr30 542) (epcr31 543)
- (epcr32 544) (epcr33 545) (epcr34 546) (epcr35 547)
- (epcr36 548) (epcr37 549) (epcr38 550) (epcr39 551)
- (epcr40 552) (epcr41 553) (epcr42 554) (epcr43 555)
- (epcr44 556) (epcr45 557) (epcr46 558) (epcr47 559)
- (epcr48 560) (epcr49 561) (epcr50 562) (epcr51 563)
- (epcr52 564) (epcr53 565) (epcr54 566) (epcr55 567)
- (epcr56 568) (epcr57 569) (epcr58 570) (epcr59 571)
- (epcr60 572) (epcr61 573) (epcr62 574) (epcr63 575)
- (esr0 576) (esr1 577) (esr2 578) (esr3 579)
- (esr4 580) (esr5 581) (esr6 582) (esr7 583)
- (esr8 584) (esr9 585) (esr10 586) (esr11 587)
- (esr12 588) (esr13 589) (esr14 590) (esr15 591)
- (esr16 592) (esr17 593) (esr18 594) (esr19 595)
- (esr20 596) (esr21 597) (esr22 598) (esr23 599)
- (esr24 600) (esr25 601) (esr26 602) (esr27 603)
- (esr28 604) (esr29 605) (esr30 606) (esr31 607)
- (esr32 608) (esr33 609) (esr34 610) (esr35 611)
- (esr36 612) (esr37 613) (esr38 614) (esr39 615)
- (esr40 616) (esr41 617) (esr42 618) (esr43 619)
- (esr44 620) (esr45 621) (esr46 622) (esr47 623)
- (esr48 624) (esr49 625) (esr50 626) (esr51 627)
- (esr52 628) (esr53 629) (esr54 630) (esr55 631)
- (esr56 632) (esr57 633) (esr58 634) (esr59 635)
- (esr60 636) (esr61 637) (esr62 638) (esr63 639)
- (eir0 640) (eir1 641) (eir2 642) (eir3 643)
- (eir4 644) (eir5 645) (eir6 646) (eir7 647)
- (eir8 648) (eir9 649) (eir10 650) (eir11 651)
- (eir12 652) (eir13 653) (eir14 654) (eir15 655)
- (eir16 656) (eir17 657) (eir18 658) (eir19 659)
- (eir20 660) (eir21 661) (eir22 662) (eir23 663)
- (eir24 664) (eir25 665) (eir26 666) (eir27 667)
- (eir28 668) (eir29 669) (eir30 670) (eir31 671)
- (esfr0 672) (esfr1 673)
- (sr0 768) (sr1 769) (sr2 770) (sr3 771)
- (scr0 832) (scr1 833) (scr2 834) (scr3 835)
- (fsr0 1024) (fsr1 1025) (fsr2 1026) (fsr3 1027)
- (fsr4 1028) (fsr5 1029) (fsr6 1030) (fsr7 1031)
- (fsr8 1032) (fsr9 1033) (fsr10 1034) (fsr11 1035)
- (fsr12 1036) (fsr13 1037) (fsr14 1038) (fsr15 1039)
- (fsr16 1040) (fsr17 1041) (fsr18 1042) (fsr19 1043)
- (fsr20 1044) (fsr21 1045) (fsr22 1046) (fsr23 1047)
- (fsr24 1048) (fsr25 1049) (fsr26 1050) (fsr27 1051)
- (fsr28 1052) (fsr29 1053) (fsr30 1054) (fsr31 1055)
- (fsr32 1056) (fsr33 1057) (fsr34 1058) (fsr35 1059)
- (fsr36 1060) (fsr37 1061) (fsr38 1062) (fsr39 1063)
- (fsr40 1064) (fsr41 1065) (fsr42 1066) (fsr43 1067)
- (fsr44 1068) (fsr45 1069) (fsr46 1070) (fsr47 1071)
- (fsr48 1072) (fsr49 1073) (fsr50 1074) (fsr51 1075)
- (fsr52 1076) (fsr53 1077) (fsr54 1078) (fsr55 1079)
- (fsr56 1080) (fsr57 1081) (fsr58 1082) (fsr59 1083)
- (fsr60 1084) (fsr61 1085) (fsr62 1086) (fsr63 1087)
- ; FQ0-FQ31 are 64 bit registers.
- ; These names allow access to the upper 32 bits of the FQ registers.
- (fqop0 1088) (fqop1 1090) (fqop2 1092) (fqop3 1094)
- (fqop4 1096) (fqop5 1098) (fqop6 1100) (fqop7 1102)
- (fqop8 1104) (fqop9 1106) (fqop10 1108) (fqop11 1110)
- (fqop12 1112) (fqop13 1114) (fqop14 1116) (fqop15 1118)
- (fqop16 1120) (fqop17 1122) (fqop18 1124) (fqop19 1126)
- (fqop20 1128) (fqop21 1130) (fqop22 1132) (fqop23 1134)
- (fqop24 1136) (fqop25 1138) (fqop26 1140) (fqop27 1142)
- (fqop28 1144) (fqop29 1146) (fqop30 1148) (fqop31 1150)
- ; These names allow access to the lower 32 bits of the FQ registers.
- (fqst0 1089) (fqst1 1091) (fqst2 1093) (fqst3 1095)
- (fqst4 1097) (fqst5 1099) (fqst6 1101) (fqst7 1103)
- (fqst8 1105) (fqst9 1107) (fqst10 1109) (fqst11 1111)
- (fqst12 1113) (fqst13 1115) (fqst14 1117) (fqst15 1119)
- (fqst16 1121) (fqst17 1123) (fqst18 1125) (fqst19 1127)
- (fqst20 1129) (fqst21 1131) (fqst22 1133) (fqst23 1135)
- (fqst24 1137) (fqst25 1139) (fqst26 1141) (fqst27 1143)
- (fqst28 1145) (fqst29 1147) (fqst30 1149) (fqst31 1151)
- ; These also access the lower 32 bits of the FQ registers.
- ; These are not accessible as spr registers (see LSI appendix - section 13.4)
- ; (fq0 1089) (fq1 1091) (fq2 1093) (fq3 1095)
- ; (fq4 1097) (fq5 1099) (fq6 1101) (fq7 1103)
- ; (fq8 1105) (fq9 1107) (fq10 1109) (fq11 1111)
- ; (fq12 1113) (fq13 1115) (fq14 1117) (fq15 1119)
- ; (fq16 1121) (fq17 1123) (fq18 1125) (fq19 1127)
- ; (fq20 1129) (fq21 1131) (fq22 1133) (fq23 1135)
- ; (fq24 1137) (fq25 1139) (fq26 1141) (fq27 1143)
- ; (fq28 1145) (fq29 1147) (fq30 1149) (fq31 1151)
- (mcilr0 1272) (mcilr1 1273)
- (msr0 1280) (msr1 1281) (msr2 1282) (msr3 1283)
- (msr4 1284) (msr5 1285) (msr6 1286) (msr7 1287)
- (msr8 1288) (msr9 1289) (msr10 1290) (msr11 1291)
- (msr12 1292) (msr13 1293) (msr14 1294) (msr15 1295)
- (msr16 1296) (msr17 1297) (msr18 1298) (msr19 1299)
- (msr20 1300) (msr21 1301) (msr22 1302) (msr23 1303)
- (msr24 1304) (msr25 1305) (msr26 1306) (msr27 1307)
- (msr28 1308) (msr29 1309) (msr30 1310) (msr31 1311)
- (msr32 1312) (msr33 1313) (msr34 1314) (msr35 1315)
- (msr36 1316) (msr37 1317) (msr38 1318) (msr39 1319)
- (msr40 1320) (msr41 1321) (msr42 1322) (msr43 1323)
- (msr44 1324) (msr45 1325) (msr46 1326) (msr47 1327)
- (msr48 1328) (msr49 1329) (msr50 1330) (msr51 1331)
- (msr52 1332) (msr53 1333) (msr54 1334) (msr55 1335)
- (msr56 1336) (msr57 1337) (msr58 1338) (msr59 1339)
- (msr60 1340) (msr61 1341) (msr62 1342) (msr63 1343)
- ; MQ0-MQ31 are 64 bit registers.
- ; These names allow access to the upper 32 bits of the MQ registers.
- (mqop0 1344) (mqop1 1346) (mqop2 1348) (mqop3 1350)
- (mqop4 1352) (mqop5 1354) (mqop6 1356) (mqop7 1358)
- (mqop8 1360) (mqop9 1362) (mqop10 1364) (mqop11 1366)
- (mqop12 1368) (mqop13 1370) (mqop14 1372) (mqop15 1374)
- (mqop16 1376) (mqop17 1378) (mqop18 1380) (mqop19 1382)
- (mqop20 1384) (mqop21 1386) (mqop22 1388) (mqop23 1390)
- (mqop24 1392) (mqop25 1394) (mqop26 1396) (mqop27 1398)
- (mqop28 1400) (mqop29 1402) (mqop30 1404) (mqop31 1406)
- ; These names allow access to the lower 32 bits of the MQ registers.
- (mqst0 1345) (mqst1 1347) (mqst2 1349) (mqst3 1351)
- (mqst4 1353) (mqst5 1355) (mqst6 1357) (mqst7 1359)
- (mqst8 1361) (mqst9 1363) (mqst10 1365) (mqst11 1367)
- (mqst12 1369) (mqst13 1371) (mqst14 1373) (mqst15 1375)
- (mqst16 1377) (mqst17 1379) (mqst18 1381) (mqst19 1383)
- (mqst20 1385) (mqst21 1387) (mqst22 1389) (mqst23 1391)
- (mqst24 1393) (mqst25 1395) (mqst26 1397) (mqst27 1399)
- (mqst28 1401) (mqst29 1403) (mqst30 1405) (mqst31 1407)
- ; These also access the lower 32 bits of the MQ registers.
- ; These are not accessible as spr registers (see LSI appendix - section 13.4)
- ; (mq0 1345) (mq1 1347) (mq2 1349) (mq3 1351)
- ; (mq4 1353) (mq5 1355) (mq6 1357) (mq7 1359)
- ; (mq8 1361) (mq9 1363) (mq10 1365) (mq11 1367)
- ; (mq12 1369) (mq13 1371) (mq14 1373) (mq15 1375)
- ; (mq16 1377) (mq17 1379) (mq18 1381) (mq19 1383)
- ; (mq20 1385) (mq21 1387) (mq22 1389) (mq23 1391)
- ; (mq24 1393) (mq25 1395) (mq26 1397) (mq27 1399)
- ; (mq28 1401) (mq29 1403) (mq30 1405) (mq31 1407)
- ; These are not accessible as spr registers (see LSI appendix - section 13.4)
- ; (acc0 1408) (acc1 1409) (acc2 1410) (acc3 1411)
- ; (acc4 1412) (acc5 1413) (acc6 1414) (acc7 1415)
- ; (acc8 1416) (acc9 1417) (acc10 1418) (acc11 1419)
- ; (acc12 1420) (acc13 1421) (acc14 1422) (acc15 1423)
- ; (acc16 1424) (acc17 1425) (acc18 1426) (acc19 1427)
- ; (acc20 1428) (acc21 1429) (acc22 1430) (acc23 1431)
- ; (acc24 1432) (acc25 1433) (acc26 1434) (acc27 1435)
- ; (acc28 1436) (acc29 1437) (acc30 1438) (acc31 1439)
- ; (acc32 1440) (acc33 1441) (acc34 1442) (acc35 1443)
- ; (acc36 1444) (acc37 1445) (acc38 1446) (acc39 1447)
- ; (acc40 1448) (acc41 1449) (acc42 1450) (acc43 1451)
- ; (acc44 1452) (acc45 1453) (acc46 1454) (acc47 1455)
- ; (acc48 1456) (acc49 1457) (acc50 1458) (acc51 1459)
- ; (acc52 1460) (acc53 1461) (acc54 1462) (acc55 1463)
- ; (acc56 1464) (acc57 1465) (acc58 1466) (acc59 1467)
- ; (acc60 1468) (acc61 1469) (acc62 1470) (acc63 1471)
- ; (accg0 1472) (accg1 1473) (accg2 1474) (accg3 1475)
- ; (accg4 1476) (accg5 1477) (accg6 1478) (accg7 1479)
- ; (accg8 1480) (accg9 1481) (accg10 1482) (accg11 1483)
- ; (accg12 1484) (accg13 1485) (accg14 1486) (accg15 1487)
- ; (accg16 1488) (accg17 1489) (accg18 1490) (accg19 1491)
- ; (accg20 1492) (accg21 1493) (accg22 1494) (accg23 1495)
- ; (accg24 1496) (accg25 1497) (accg26 1498) (accg27 1499)
- ; (accg28 1500) (accg29 1501) (accg30 1502) (accg31 1503)
- ; (accg32 1504) (accg33 1505) (accg34 1506) (accg35 1507)
- ; (accg36 1508) (accg37 1509) (accg38 1510) (accg39 1511)
- ; (accg40 1512) (accg41 1513) (accg42 1514) (accg43 1515)
- ; (accg44 1516) (accg45 1517) (accg46 1518) (accg47 1519)
- ; (accg48 1520) (accg49 1521) (accg50 1522) (accg51 1523)
- ; (accg52 1524) (accg53 1525) (accg54 1526) (accg55 1527)
- ; (accg56 1528) (accg57 1529) (accg58 1530) (accg59 1531)
- ; (accg60 1532) (accg61 1533) (accg62 1534) (accg63 1535)
- (ear0 1536) (ear1 1537) (ear2 1538) (ear3 1539)
- (ear4 1540) (ear5 1541) (ear6 1542) (ear7 1543)
- (ear8 1544) (ear9 1545) (ear10 1546) (ear11 1547)
- (ear12 1548) (ear13 1549) (ear14 1550) (ear15 1551)
- (ear16 1552) (ear17 1553) (ear18 1554) (ear19 1555)
- (ear20 1556) (ear21 1557) (ear22 1558) (ear23 1559)
- (ear24 1560) (ear25 1561) (ear26 1562) (ear27 1563)
- (ear28 1564) (ear29 1565) (ear30 1566) (ear31 1567)
- (ear32 1568) (ear33 1569) (ear34 1570) (ear35 1571)
- (ear36 1572) (ear37 1573) (ear38 1574) (ear39 1575)
- (ear40 1576) (ear41 1577) (ear42 1578) (ear43 1579)
- (ear44 1580) (ear45 1581) (ear46 1582) (ear47 1583)
- (ear48 1584) (ear49 1585) (ear50 1586) (ear51 1587)
- (ear52 1588) (ear53 1589) (ear54 1590) (ear55 1591)
- (ear56 1592) (ear57 1593) (ear58 1594) (ear59 1595)
- (ear60 1596) (ear61 1597) (ear62 1598) (ear63 1599)
- (edr0 1600) (edr1 1601) (edr2 1602) (edr3 1603)
- (edr4 1604) (edr5 1605) (edr6 1606) (edr7 1607)
- (edr8 1608) (edr9 1609) (edr10 1610) (edr11 1611)
- (edr12 1612) (edr13 1613) (edr14 1614) (edr15 1615)
- (edr16 1616) (edr17 1617) (edr18 1618) (edr19 1619)
- (edr20 1620) (edr21 1621) (edr22 1622) (edr23 1623)
- (edr24 1624) (edr25 1625) (edr26 1626) (edr27 1627)
- (edr28 1628) (edr29 1629) (edr30 1630) (edr31 1631)
- (edr32 1632) (edr33 1636) (edr34 1634) (edr35 1635)
- (edr36 1636) (edr37 1637) (edr38 1638) (edr39 1639)
- (edr40 1640) (edr41 1641) (edr42 1642) (edr43 1643)
- (edr44 1644) (edr45 1645) (edr46 1646) (edr47 1647)
- (edr48 1648) (edr49 1649) (edr50 1650) (edr51 1651)
- (edr52 1652) (edr53 1653) (edr54 1654) (edr55 1655)
- (edr56 1656) (edr57 1657) (edr58 1658) (edr59 1659)
- (edr60 1660) (edr61 1661) (edr62 1662) (edr63 1663)
- (iamlr0 1664) (iamlr1 1665) (iamlr2 1666) (iamlr3 1667)
- (iamlr4 1668) (iamlr5 1669) (iamlr6 1670) (iamlr7 1671)
- (iamlr8 1672) (iamlr9 1673) (iamlr10 1674) (iamlr11 1675)
- (iamlr12 1676) (iamlr13 1677) (iamlr14 1678) (iamlr15 1679)
- (iamlr16 1680) (iamlr17 1681) (iamlr18 1682) (iamlr19 1683)
- (iamlr20 1684) (iamlr21 1685) (iamlr22 1686) (iamlr23 1687)
- (iamlr24 1688) (iamlr25 1689) (iamlr26 1690) (iamlr27 1691)
- (iamlr28 1692) (iamlr29 1693) (iamlr30 1694) (iamlr31 1695)
- (iamlr32 1696) (iamlr33 1697) (iamlr34 1698) (iamlr35 1699)
- (iamlr36 1700) (iamlr37 1701) (iamlr38 1702) (iamlr39 1703)
- (iamlr40 1704) (iamlr41 1705) (iamlr42 1706) (iamlr43 1707)
- (iamlr44 1708) (iamlr45 1709) (iamlr46 1710) (iamlr47 1711)
- (iamlr48 1712) (iamlr49 1713) (iamlr50 1714) (iamlr51 1715)
- (iamlr52 1716) (iamlr53 1717) (iamlr54 1718) (iamlr55 1719)
- (iamlr56 1720) (iamlr57 1721) (iamlr58 1722) (iamlr59 1723)
- (iamlr60 1724) (iamlr61 1725) (iamlr62 1726) (iamlr63 1727)
- (iampr0 1728) (iampr1 1729) (iampr2 1730) (iampr3 1731)
- (iampr4 1732) (iampr5 1733) (iampr6 1734) (iampr7 1735)
- (iampr8 1736) (iampr9 1737) (iampr10 1738) (iampr11 1739)
- (iampr12 1740) (iampr13 1741) (iampr14 1742) (iampr15 1743)
- (iampr16 1744) (iampr17 1745) (iampr18 1746) (iampr19 1747)
- (iampr20 1748) (iampr21 1749) (iampr22 1750) (iampr23 1751)
- (iampr24 1752) (iampr25 1753) (iampr26 1754) (iampr27 1755)
- (iampr28 1756) (iampr29 1757) (iampr30 1758) (iampr31 1759)
- (iampr32 1760) (iampr33 1761) (iampr34 1762) (iampr35 1763)
- (iampr36 1764) (iampr37 1765) (iampr38 1766) (iampr39 1767)
- (iampr40 1768) (iampr41 1769) (iampr42 1770) (iampr43 1771)
- (iampr44 1772) (iampr45 1773) (iampr46 1774) (iampr47 1775)
- (iampr48 1776) (iampr49 1777) (iampr50 1778) (iampr51 1779)
- (iampr52 1780) (iampr53 1781) (iampr54 1782) (iampr55 1783)
- (iampr56 1784) (iampr57 1785) (iampr58 1786) (iampr59 1787)
- (iampr60 1788) (iampr61 1789) (iampr62 1790) (iampr63 1791)
- (damlr0 1792) (damlr1 1793) (damlr2 1794) (damlr3 1795)
- (damlr4 1796) (damlr5 1797) (damlr6 1798) (damlr7 1799)
- (damlr8 1800) (damlr9 1801) (damlr10 1802) (damlr11 1803)
- (damlr12 1804) (damlr13 1805) (damlr14 1806) (damlr15 1807)
- (damlr16 1808) (damlr17 1809) (damlr18 1810) (damlr19 1811)
- (damlr20 1812) (damlr21 1813) (damlr22 1814) (damlr23 1815)
- (damlr24 1816) (damlr25 1817) (damlr26 1818) (damlr27 1819)
- (damlr28 1820) (damlr29 1821) (damlr30 1822) (damlr31 1823)
- (damlr32 1824) (damlr33 1825) (damlr34 1826) (damlr35 1827)
- (damlr36 1828) (damlr37 1829) (damlr38 1830) (damlr39 1831)
- (damlr40 1832) (damlr41 1833) (damlr42 1834) (damlr43 1835)
- (damlr44 1836) (damlr45 1837) (damlr46 1838) (damlr47 1839)
- (damlr48 1840) (damlr49 1841) (damlr50 1842) (damlr51 1843)
- (damlr52 1844) (damlr53 1845) (damlr54 1846) (damlr55 1847)
- (damlr56 1848) (damlr57 1849) (damlr58 1850) (damlr59 1851)
- (damlr60 1852) (damlr61 1853) (damlr62 1854) (damlr63 1855)
- (dampr0 1856) (dampr1 1857) (dampr2 1858) (dampr3 1859)
- (dampr4 1860) (dampr5 1861) (dampr6 1862) (dampr7 1863)
- (dampr8 1864) (dampr9 1865) (dampr10 1866) (dampr11 1867)
- (dampr12 1868) (dampr13 1869) (dampr14 1870) (dampr15 1871)
- (dampr16 1872) (dampr17 1873) (dampr18 1874) (dampr19 1875)
- (dampr20 1876) (dampr21 1877) (dampr22 1878) (dampr23 1879)
- (dampr24 1880) (dampr25 1881) (dampr26 1882) (dampr27 1883)
- (dampr28 1884) (dampr29 1885) (dampr30 1886) (dampr31 1887)
- (dampr32 1888) (dampr33 1889) (dampr34 1890) (dampr35 1891)
- (dampr36 1892) (dampr37 1893) (dampr38 1894) (dampr39 1895)
- (dampr40 1896) (dampr41 1897) (dampr42 1898) (dampr43 1899)
- (dampr44 1900) (dampr45 1901) (dampr46 1902) (dampr47 1903)
- (dampr48 1904) (dampr49 1905) (dampr50 1906) (dampr51 1907)
- (dampr52 1908) (dampr53 1909) (dampr54 1910) (dampr55 1911)
- (dampr56 1912) (dampr57 1913) (dampr58 1914) (dampr59 1915)
- (dampr60 1916) (dampr61 1917) (dampr62 1918) (dampr63 1919)
- (amcr 1920) (stbar 1921) (mmcr 1922)
- (iamvr1 1925) (damvr1 1927)
- (cxnr 1936) (ttbr 1937) (tplr 1938) (tppr 1939)
- (tpxr 1940)
- (timerh 1952) (timerl 1953) (timerd 1954)
- (dcr 2048) (brr 2049) (nmar 2050) (btbr 2051)
- (ibar0 2052) (ibar1 2053) (ibar2 2054) (ibar3 2055)
- (dbar0 2056) (dbar1 2057) (dbar2 2058) (dbar3 2059)
- (dbdr00 2060) (dbdr01 2061) (dbdr02 2062) (dbdr03 2063)
- (dbdr10 2064) (dbdr11 2065) (dbdr12 2066) (dbdr13 2067)
- (dbdr20 2068) (dbdr21 2069) (dbdr22 2070) (dbdr23 2071)
- (dbdr30 2072) (dbdr31 2073) (dbdr32 2074) (dbdr33 2075)
- (dbmr00 2076) (dbmr01 2077) (dbmr02 2078) (dbmr03 2079)
- (dbmr10 2080) (dbmr11 2081) (dbmr12 2082) (dbmr13 2083)
- (dbmr20 2084) (dbmr21 2085) (dbmr22 2086) (dbmr23 2087)
- (dbmr30 2088) (dbmr31 2089) (dbmr32 2090) (dbmr33 2091)
- (cpcfr 2304) (cpcr 2305) (cpsr 2306) (cptr 2307)
- (cphsr0 2308) (cphsr1 2309) (cpesr0 2320) (cpesr1 2321)
- (cpemr0 2322) (cpemr1 2323)
- (iperr0 2324) (iperr1 2325) (ipjsr 2326) (ipjrr 2327)
- (ipcsr0 2336) (ipcsr1 2337) (ipcwer0 2338) (ipcwer1 2339)
- (ipcwr 2340)
- (mbhsr 2352) (mbssr 2353) (mbrsr 2354) (mbsdr 2355)
- (mbrdr 2356) (mbsmr 2357) (mbstr0 2359) (mbstr1 2360)
- (slpr 2368) (sldr 2369) (slhsr 2370) (sltr 2371)
- (slwr 2372)
- (ihsr8 3848) (ihsr9 3849) (ihsr10 3850)
- )
- )
- (define-hardware
- (name h-spr)
- (comment "special purpose registers")
- (attrs PROFILE)
- (type register UWI (4096))
- (indices extern-keyword spr-names)
- (get (index) (c-call UWI "@cpu@_h_spr_get_handler" index))
- (set (index newval) (c-call VOID "@cpu@_h_spr_set_handler" index newval))
- )
- (define-pmacro (spr-pcsr) (reg h-spr 1))
- (define-pmacro (spr-bpcsr) (reg h-spr 2))
- (define-pmacro (spr-lr) (reg h-spr 272))
- (define-pmacro (spr-lcr) (reg h-spr 273))
- (define-pmacro (spr-iacc0h) (reg h-spr 280))
- (define-pmacro (spr-iacc0l) (reg h-spr 281))
- (define-pmacro (spr-sr0) (reg h-spr 768))
- (define-pmacro (spr-sr1) (reg h-spr 769))
- (define-pmacro (spr-sr2) (reg h-spr 770))
- (define-pmacro (spr-sr3) (reg h-spr 771))
- ; Accumulator guard. Actually a subset of the SPR registers, but those SPRs
- ; are read-only in most insns. This hardware element is used by those insns
- ; which have direct access (mwtaccg, mrdaccg).
- (define-keyword
- (name accg-names)
- (print-name h-accg)
- (prefix "")
- (values
- (accg0 0)(accg1 1)(accg2 2)(accg3 3)
- (accg4 4)(accg5 5)(accg6 6)(accg7 7)
- (accg8 8)(accg9 9)(accg10 10)(accg11 11)
- (accg12 12)(accg13 13)(accg14 14)(accg15 15)
- (accg16 16)(accg17 17)(accg18 18)(accg19 19)
- (accg20 20)(accg21 21)(accg22 22)(accg23 23)
- (accg24 24)(accg25 25)(accg26 26)(accg27 27)
- (accg28 28)(accg29 29)(accg30 30)(accg31 31)
- (accg32 32)(accg33 33)(accg34 34)(accg35 35)
- (accg36 36)(accg37 37)(accg38 38)(accg39 39)
- (accg40 40)(accg41 41)(accg42 42)(accg43 43)
- (accg44 44)(accg45 45)(accg46 46)(accg47 47)
- (accg48 48)(accg49 49)(accg50 50)(accg51 51)
- (accg52 52)(accg53 53)(accg54 54)(accg55 55)
- (accg56 56)(accg57 57)(accg58 58)(accg59 59)
- (accg60 60)(accg61 61)(accg62 62)(accg63 63)
- )
- )
- (define-hardware
- (name h-accg)
- (comment "accumulator guard")
- (attrs PROFILE VIRTUAL)
- (type register UWI (64))
- (indices extern-keyword accg-names)
- (get (index)
- (and (reg h-spr (add index 1472)) #xff))
- (set (index newval)
- (set (raw-reg UWI h-spr (add index 1472)) (and newval #xff)))
- )
- ; 40 bit accumulator. Composed of ACCG and ACC registers concatenated, but
- ; referenced more often as the composed 40 bits.
- (define-keyword
- (name acc-names)
- (print-name h-acc40)
- (prefix "")
- (values
- (acc0 0)(acc1 1)(acc2 2)(acc3 3)(acc4 4)(acc5 5)(acc6 6)(acc7 7)
- (acc8 8)(acc9 9)(acc10 10)(acc11 11)(acc12 12)(acc13 13)(acc14 14)(acc15 15)
- (acc16 16)(acc17 17)(acc18 18)(acc19 19)(acc20 20)(acc21 21)(acc22 22)(acc23 23)
- (acc24 24)(acc25 25)(acc26 26)(acc27 27)(acc28 28)(acc29 29)(acc30 30)(acc31 31)
- (acc32 32)(acc33 33)(acc34 34)(acc35 35)(acc36 36)(acc37 37)(acc38 38)(acc39 39)
- (acc40 40)(acc41 41)(acc42 42)(acc43 43)(acc44 44)(acc45 45)(acc46 46)(acc47 47)
- (acc48 48)(acc49 49)(acc50 50)(acc51 51)(acc52 52)(acc53 53)(acc54 54)(acc55 55)
- (acc56 56)(acc57 57)(acc58 58)(acc59 59)(acc60 60)(acc61 61)(acc62 62)(acc63 63)
- )
- )
- (define-hardware
- (name h-acc40S)
- (comment "40 bit signed accumulator")
- (attrs PROFILE VIRTUAL)
- (type register DI (64))
- (indices extern-keyword acc-names)
- ; The accumlator is made up of two 32 bit registers, accgi/acci.
- ; We want to extract this as a combined 40 signed bits
- (get (index)
- (or DI
- (sll DI (ext DI (trunc QI (reg h-spr (add index 1472))))
- 32)
- (zext DI (reg h-spr (add index 1408)))))
- ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions
- ; on ACC and ACCG registers
- (set (index newval)
- (sequence ()
- (c-call VOID "frv_check_spr_write_access" (add index 1408))
- (set (raw-reg UWI h-spr
- (add index 1472)) (and (srl newval 32) #xff))
- (set (raw-reg UWI h-spr
- (add index 1408)) (trunc USI newval))))
- )
- (define-hardware
- (name h-acc40U)
- (comment "40 bit unsigned accumulator")
- (attrs PROFILE VIRTUAL)
- (type register UDI (64))
- (indices extern-keyword acc-names)
- ; The accumlator is made up of two 32 bit registers, accgi/acci.
- ; We want to extract this as a combined 40 unsigned bits
- (get (index)
- (or DI
- (sll DI (zext DI (reg h-spr (add index 1472))) 32)
- (zext DI (reg h-spr (add index 1408)))))
- ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions
- ; on ACC and ACCG registers
- (set (index newval)
- (sequence ()
- (c-call VOID "frv_check_spr_write_access" (add index 1408))
- (set (raw-reg UWI h-spr
- (add index 1472)) (and (srl newval 32) #xff))
- (set (raw-reg UWI h-spr
- (add index 1408)) (trunc USI newval))))
- )
- ; 64-bit signed accumulator. Composed of iacc0h and iacc0l registers
- ; concatenated, but referenced more often as the composed 64 bits.
- (define-keyword
- ; This is totally hokey -- I have to have an index!
- (name iacc0-names)
- (print-name h-iacc0)
- (prefix "")
- (values (iacc0 0))
- )
- (define-hardware
- (name h-iacc0)
- (comment "64 bit signed accumulator")
- (attrs PROFILE VIRTUAL (MACH fr400,fr450))
- (type register DI (1))
- (indices extern-keyword iacc0-names)
- ; The single 64-bit integer accumulator is made up of two 32 bit
- ; registers, iacc0h and iacc0l. We want to extract this as a
- ; combined 64 signed bits.
- (get (idx) (or DI (sll DI (ext DI (spr-iacc0h)) 32) (zext DI (spr-iacc0l))))
- (set (idx newval)
- (sequence ()
- (set (spr-iacc0h) (trunc SI (srl newval 32)))
- (set (spr-iacc0l) (trunc SI newval))))
- )
- ; Integer condition code registers (CCR)
- ;
- ; The individual sub registers bits of the CCR are referenced more often than
- ; the entire register so set them directly. We can assemble the
- ; entire register when necessary.
- ;
- (define-keyword
- (name iccr-names)
- (print-name h-iccr)
- (prefix "")
- (values (icc0 0) (icc1 1) (icc2 2) (icc3 3))
- )
- (define-hardware
- (name h-iccr)
- (comment "Integer condition code registers")
- (attrs PROFILE)
- (type register UQI (4))
- (indices extern-keyword iccr-names)
- )
- ; Floating point condition code registers (CCR)
- ;
- ; The individual sub registers bits of the CCR are referenced more often than
- ; the entire register so set them directly. We can assemble the
- ; entire register when necessary.
- ;
- (define-keyword
- (name fccr-names)
- (print-name h-fccr)
- (prefix "")
- (values (fcc0 0) (fcc1 1) (fcc2 2) (fcc3 3))
- )
- (define-hardware
- (name h-fccr)
- (comment "Floating point condition code registers")
- (attrs PROFILE)
- (type register UQI (4))
- (indices extern-keyword fccr-names)
- )
- ; C condition code registers (CCCR)
- ;
- (define-keyword
- (name cccr-names)
- (print-name h-cccr)
- (prefix "")
- (values (cc0 0) (cc1 1) (cc2 2) (cc3 3) (cc4 4) (cc5 5) (cc6 6) (cc7 7))
- )
- (define-hardware
- (name h-cccr)
- (comment "Condition code registers")
- (attrs PROFILE)
- (type register UQI (8))
- (indices extern-keyword cccr-names)
- )
- ; Dummy hardware used to define packing bit on insns
- ;
- (define-hardware
- (name h-pack)
- (comment "Packing bit dummy hardware")
- (type immediate (UINT 1))
- (values keyword "" (("" 1) (".p" 0) (".P" 0)))
- )
- ; Dummy hardware used to define hint field for branches always taken
- ;
- (define-hardware
- (name h-hint-taken)
- (comment "Branch taken hint dummy hardware")
- (type immediate (UINT 1))
- ; The order of these is important. We want '2' to get written by default,
- ; but we also want the docoder/disassembler to allow the values '0', '1' and
- ; '3'.
- (values keyword "" (("" 2) ("" 0) ("" 1) ("" 3)))
- )
- ; Dummy hardware used to define hint field for branches never taken
- ;
- (define-hardware
- (name h-hint-not-taken)
- (comment "Branch not taken hint dummy hardware")
- (type immediate (UINT 1))
- ; The order of these is important. We want '0' to get written by default,
- ; but we also want the docoder/disassembler to allow the values '1', '2' and
- ; '3'.
- (values keyword "" (("" 0) ("" 1) ("" 2) ("" 3)))
- )
- ; Instruction Operands.
- ; These entries provide a layer between the assembler and the raw hardware
- ; description, and are used to refer to hardware elements in the semantic
- ; code. Usually there's a bit of over-specification, but in more complicated
- ; instruction sets there isn't.
- ; FRV specific operand attributes:
- (define-attr
- (for operand)
- (type boolean)
- (name HASH-PREFIX)
- (comment "immediates have an optional '#' prefix")
- )
- ; ??? Convention says this should be o-sr, but then the insn definitions
- ; should refer to o-sr which is clumsy. The "o-" could be implicit, but
- ; then it should be implicit for all the symbols here, but then there would
- ; be confusion between (f-)simm8 and (h-)simm8.
- ; So for now the rule is exactly as it appears here.
- ; dnmop: define-normal-mode-operand: temporary, pending potential removal
- ; of modes from h/w.
- (define-pmacro (dnmop xname xcomment xattrs xtype xindex xmode)
- (define-operand
- (name xname)
- (comment xcomment)
- (.splice attrs (.unsplice xattrs))
- (type xtype)
- (index xindex)
- (mode xmode)
- )
- )
- ; dnpmop: define-normal-parsed-mode-operand: Normal mode operand with parse handler
- (define-pmacro (dnpmop xname xcomment xattrs xtype xindex xmode xparse)
- (define-operand
- (name xname)
- (comment xcomment)
- (.splice attrs (.unsplice xattrs))
- (type xtype)
- (index xindex)
- (mode xmode)
- (handlers (parse xparse))
- )
- )
- (dnop pack "packing bit" () h-pack f-pack)
- (dnmop GRi "source register 1" () h-gr f-GRi SI)
- (dnmop GRj "source register 2" () h-gr f-GRj SI)
- (dnmop GRk "destination register" () h-gr f-GRk SI)
- (dnmop GRkhi "destination register" () h-gr_hi f-GRk UHI)
- (dnmop GRklo "destination register" () h-gr_lo f-GRk UHI)
- (dnpmop GRdoublek "destination register" () h-gr_double f-GRk DI "even_register")
- (dnmop ACC40Si "signed accumulator" () h-acc40S f-ACC40Si DI)
- (dnmop ACC40Ui "unsigned accumulator" () h-acc40U f-ACC40Ui UDI)
- (dnmop ACC40Sk "target accumulator" () h-acc40S f-ACC40Sk DI)
- (dnmop ACC40Uk "target accumulator" () h-acc40U f-ACC40Uk UDI)
- (dnmop ACCGi "source register" () h-accg f-ACCGi UWI)
- (dnmop ACCGk "target register" () h-accg f-ACCGk UWI)
- (dnmop CPRi "source register" ((MACH frv)) h-cpr f-CPRi SI)
- (dnmop CPRj "source register" ((MACH frv)) h-cpr f-CPRj SI)
- (dnmop CPRk "destination register" ((MACH frv)) h-cpr f-CPRk SI)
- (dnpmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI "even_register")
- ; floating point operands
- (dnmop FRinti "source register 1" () h-fr_int f-FRi SI)
- (dnmop FRintj "source register 2" () h-fr_int f-FRj SI)
- (dnmop FRintk "target register" () h-fr_int f-FRk SI)
- (dnmop FRi "source register 1" () h-fr f-FRi SF)
- (dnmop FRj "source register 2" () h-fr f-FRj SF)
- (dnmop FRk "destination register" () h-fr f-FRk SF)
- (dnmop FRkhi "destination register" () h-fr_hi f-FRk UHI)
- (dnmop FRklo "destination register" () h-fr_lo f-FRk UHI)
- (dnpmop FRdoublei "source register 1" () h-fr_double f-FRi DF "even_register")
- (dnpmop FRdoublej "source register 2" () h-fr_double f-FRj DF "even_register")
- (dnpmop FRdoublek "target register" () h-fr_double f-FRk DF "even_register")
- (dnop CRi "source register 1" () h-cccr f-CRi)
- (dnop CRj "source register 2" () h-cccr f-CRj)
- (dnop CRj_int "destination register" () h-cccr f-CRj_int)
- (dnop CRj_float "destination register" () h-cccr f-CRj_float)
- (dnop CRk "destination register" () h-cccr f-CRk)
- (dnop CCi "condition register" () h-cccr f-CCi)
- (dnop ICCi_1 "condition register" () h-iccr f-ICCi_1)
- (dnop ICCi_2 "condition register" () h-iccr f-ICCi_2)
- (dnop ICCi_3 "condition register" () h-iccr f-ICCi_3)
- (dnop FCCi_1 "condition register" () h-fccr f-FCCi_1)
- (dnop FCCi_2 "condition register" () h-fccr f-FCCi_2)
- (dnop FCCi_3 "condition register" () h-fccr f-FCCi_3)
- (dnop FCCk "condition register" () h-fccr f-FCCk)
- (dnop eir "exception insn reg" () h-uint f-eir)
- (dnop s10 "10 bit signed immediate" (HASH-PREFIX) h-sint f-s10)
- (dnop u16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-u16)
- (dnop s16 "16 bit signed immediate" (HASH-PREFIX) h-sint f-s16)
- (dnop s6 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6)
- (dnop s6_1 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6_1)
- (dnop u6 "6 bit unsigned immediate" (HASH-PREFIX) h-uint f-u6)
- (dnop s5 "5 bit signed immediate" (HASH-PREFIX) h-sint f-s5)
- (dnop cond "conditional arithmetic" (HASH-PREFIX) h-uint f-cond)
- (dnop ccond "lr branch condition" (HASH-PREFIX) h-uint f-ccond)
- (dnop hint "2 bit branch predictor" (HASH-PREFIX) h-uint f-hint)
- (dnop hint_taken "2 bit branch predictor" () h-hint-taken f-hint)
- (dnop hint_not_taken "2 bit branch predictor" () h-hint-not-taken f-hint)
- (dnop LI "link indicator" () h-uint f-LI)
- (dnop lock "cache lock indicator" (HASH-PREFIX) h-uint f-lock)
- (dnop debug "debug mode indicator" (HASH-PREFIX) h-uint f-debug)
- (dnop ae "all entries indicator" (HASH-PREFIX) h-uint f-ae)
- (dnop label16 "18 bit pc relative address" () h-iaddr f-label16)
- (dnop LRAE "Load Real Address E flag" () h-uint f-LRAE)
- (dnop LRAD "Load Real Address D flag" () h-uint f-LRAD)
- (dnop LRAS "Load Real Address S flag" () h-uint f-LRAS)
- (dnop TLBPRopx "TLB Probe operation number" () h-uint f-TLBPRopx)
- (dnop TLBPRL "TLB Probe L flag" () h-uint f-TLBPRL)
- (define-operand
- (name A0)
- (comment "A==0 operand of mclracc")
- (attrs)
- (type h-uint)
- (index f-A)
- (mode USI)
- (handlers (parse "A0"))
- )
- (define-operand
- (name A1)
- (comment "A==1 operand of mclracc")
- (attrs)
- (type h-uint)
- (index f-A)
- (mode USI)
- (handlers (parse "A1"))
- )
- (define-operand
- (name FRintieven)
- (comment "(even) source register 1")
- (attrs)
- (type h-fr_int)
- (index f-FRi)
- (mode SI)
- (handlers (parse "even_register"))
- )
- (define-operand
- (name FRintjeven)
- (comment "(even) source register 2")
- (attrs)
- (type h-fr_int)
- (index f-FRj)
- (mode SI)
- (handlers (parse "even_register"))
- )
- (define-operand
- (name FRintkeven)
- (comment "(even) target register")
- (attrs)
- (type h-fr_int)
- (index f-FRk)
- (mode SI)
- (handlers (parse "even_register"))
- )
- (define-operand
- (name d12)
- (comment "12 bit signed immediate")
- (attrs)
- (type h-sint)
- (index f-d12)
- (handlers (parse "d12"))
- )
- (define-operand
- (name s12)
- (comment "12 bit signed immediate")
- (attrs HASH-PREFIX)
- (type h-sint)
- (index f-d12)
- (handlers (parse "s12"))
- )
- (define-operand
- (name u12)
- (comment "12 bit signed immediate")
- (attrs HASH-PREFIX)
- (type h-sint)
- (index f-u12)
- (handlers (parse "u12"))
- )
- (define-operand
- (name spr)
- (comment "special purpose register")
- (attrs)
- (type h-spr)
- (index f-spr)
- (handlers (parse "spr") (print "spr"))
- )
- (define-operand
- (name ulo16)
- (comment "16 bit unsigned immediate, for #lo()")
- (attrs)
- (type h-uint)
- (index f-u16)
- (handlers (parse "ulo16") (print "lo"))
- )
- (define-operand
- (name slo16)
- (comment "16 bit unsigned immediate, for #lo()")
- (attrs)
- (type h-sint)
- (index f-s16)
- (handlers (parse "uslo16") (print "lo"))
- )
- (define-operand
- (name uhi16)
- (comment "16 bit unsigned immediate, for #hi()")
- (attrs)
- (type h-uint)
- (index f-u16)
- (handlers (parse "uhi16") (print "hi"))
- )
- (define-operand
- (name label24)
- (comment "26 bit pc relative address")
- (attrs)
- (type h-iaddr)
- (index f-label24)
- (mode SI)
- (handlers (parse "call_label"))
- )
- ; operands representing hardware
- ;
- (dnop psr_esr "PSR.ESR bit" (SEM-ONLY) h-psr_esr f-nil)
- (dnop psr_s "PSR.S bit" (SEM-ONLY) h-psr_s f-nil)
- (dnop psr_ps "PSR.PS bit" (SEM-ONLY) h-psr_ps f-nil)
- (dnop psr_et "PSR.ET bit" (SEM-ONLY) h-psr_et f-nil)
- (dnop bpsr_bs "BPSR.BS bit" (SEM-ONLY) h-bpsr_bs f-nil)
- (dnop bpsr_bet "BPSR.BET bit" (SEM-ONLY) h-bpsr_bet f-nil)
- (dnop tbr_tba "TBR.TBA" (SEM-ONLY) h-tbr_tba f-nil)
- (dnop tbr_tt "TBR.TT" (SEM-ONLY) h-tbr_tt f-nil)
- ; Null operands
- ;
- (define-pmacro (ICCi_1-null) (f-ICCi_1-null 0))
- (define-pmacro (ICCi_2-null) (f-ICCi_2-null 0))
- (define-pmacro (ICCi_3-null) (f-ICCi_3-null 0))
- (define-pmacro (FCCi_1-null) (f-FCCi_1-null 0))
- (define-pmacro (FCCi_2-null) (f-FCCi_2-null 0))
- (define-pmacro (FCCi_3-null) (f-FCCi_3-null 0))
- (define-pmacro (rs-null) (f-rs-null 0))
- (define-pmacro (GRi-null) (f-GRi-null 0))
- (define-pmacro (GRj-null) (f-GRj-null 0))
- (define-pmacro (GRk-null) (f-GRk-null 0))
- (define-pmacro (FRi-null) (f-FRi-null 0))
- (define-pmacro (FRj-null) (f-FRj-null 0))
- (define-pmacro (ACCj-null) (f-ACCj-null 0))
- (define-pmacro (rd-null) (f-rd-null 0))
- (define-pmacro (cond-null) (f-cond-null 0))
- (define-pmacro (ccond-null) (f-ccond-null 0))
- (define-pmacro (s12-null) (f-s12-null 0))
- (define-pmacro (label16-null) (f-label16-null 0))
- (define-pmacro (misc-null-1) (f-misc-null-1 0))
- (define-pmacro (misc-null-2) (f-misc-null-2 0))
- (define-pmacro (misc-null-3) (f-misc-null-3 0))
- (define-pmacro (misc-null-4) (f-misc-null-4 0))
- (define-pmacro (misc-null-5) (f-misc-null-5 0))
- (define-pmacro (misc-null-6) (f-misc-null-6 0))
- (define-pmacro (misc-null-7) (f-misc-null-7 0))
- (define-pmacro (misc-null-8) (f-misc-null-8 0))
- (define-pmacro (misc-null-9) (f-misc-null-9 0))
- (define-pmacro (misc-null-10) (f-misc-null-10 0))
- (define-pmacro (misc-null-11) (f-misc-null-11 0))
- (define-pmacro (LRA-null) (f-LRA-null 0))
- (define-pmacro (TLBPR-null) (f-TLBPR-null 0))
- (define-pmacro (LI-on) (f-LI-on 1))
- (define-pmacro (LI-off) (f-LI-off 0))
- ; Instruction definitions.
- ;
- ; Notes:
- ; - dni is short for "define-normal-instruction"
- ; - Macros are used to represent each insn format. These should be used as much
- ; as possible unless an insn has exceptional behaviour
- ;
- ; Commonly used Macros
- ;
- ; Specific registers
- ;
- ; Integer condition code manipulation
- ;
- (define-pmacro (set-z-and-n icc x)
- (if (eq x 0)
- (set icc (or (and icc #x7) #x4))
- (if (lt x 0)
- (set icc (or (and icc #xb) #x8))
- (set icc (and icc #x3))))
- )
- (define-pmacro (set-n icc val)
- (if (eq val 0)
- (set icc (and icc #x7))
- (set icc (or icc #x8)))
- )
- (define-pmacro (set-z icc val)
- (if (eq val 0)
- (set icc (and icc #xb))
- (set icc (or icc #x4)))
- )
- (define-pmacro (set-v icc val)
- (if (eq val 0)
- (set icc (and icc #xd))
- (set icc (or icc #x2)))
- )
- (define-pmacro (set-c icc val)
- (if (eq val 0)
- (set icc (and icc #xe))
- (set icc (or icc #x1)))
- )
- (define-pmacro (nbit icc)
- (trunc BI (srl (and icc #x8) 3))
- )
- (define-pmacro (zbit icc)
- (trunc BI (srl (and icc #x4) 2))
- )
- (define-pmacro (vbit icc)
- (trunc BI (srl (and icc #x2) 1))
- )
- (define-pmacro (cbit icc)
- (trunc BI (and icc #x1))
- )
- (define-pmacro (ebit icc)
- (trunc BI (srl (and icc #x8) 3))
- )
- (define-pmacro (lbit icc)
- (trunc BI (srl (and icc #x4) 2))
- )
- (define-pmacro (gbit icc)
- (trunc BI (srl (and icc #x2) 1))
- )
- (define-pmacro (ubit icc)
- (trunc BI (and icc #x1))
- )
- ; FRV insns
- ;
- ;
- ; Format: INT, Logic, Shift r-r
- ;
- (define-pmacro (int-logic-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRk")
- (+ pack GRk op GRi (ICCi_1-null) ope GRj)
- (set GRk (operation GRi GRj))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-logic-r-r add add OP_00 OPE2_00 "add reg/reg")
- (int-logic-r-r sub sub OP_00 OPE2_04 "sub reg/reg")
- (int-logic-r-r and and OP_01 OPE2_00 "and reg/reg")
- (int-logic-r-r or or OP_01 OPE2_02 "or reg/reg")
- (int-logic-r-r xor xor OP_01 OPE2_04 "xor reg/reg")
- (dni not
- ("not")
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- ("not$pack $GRj,$GRk")
- (+ pack GRk OP_01 (rs-null) (ICCi_1-null) OPE2_06 GRj)
- (set GRk (inv GRj))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- (dni sdiv
- "signed division"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "sdiv$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0E GRj)
- (sequence ()
- (c-call VOID "@cpu@_signed_integer_divide"
- GRi GRj (index-of GRk) 0)
- (clobber GRk))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni nsdiv
- "non excepting signed division"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- "nsdiv$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0E GRj)
- (sequence ()
- (c-call VOID "@cpu@_signed_integer_divide"
- GRi GRj (index-of GRk) 1)
- (clobber GRk))
- ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni udiv
- "unsigned division reg/reg"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "udiv$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0F GRj)
- (sequence ()
- (c-call VOID "@cpu@_unsigned_integer_divide"
- GRi GRj (index-of GRk) 0)
- (clobber GRk))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni nudiv
- "non excepting unsigned division"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- "nudiv$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0F GRj)
- (sequence ()
- (c-call VOID "@cpu@_unsigned_integer_divide"
- GRi GRj (index-of GRk) 1)
- (clobber GRk))
- ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- ; Multiplication
- ;
- (define-pmacro (multiply-r-r name signop op ope comment)
- (dni name
- (comment)
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRdoublek")
- (+ pack GRdoublek op GRi (ICCi_1-null) ope GRj)
- (set GRdoublek (mul DI (signop DI GRi) (signop DI GRj)))
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- )
- (multiply-r-r smul ext OP_00 OPE2_08 "signed multiply reg/reg")
- (multiply-r-r umul zext OP_00 OPE2_0A "unsigned multiply reg/reg")
- ; Multiplication with integer accumulator IACC
- ;
- (define-pmacro (iacc-set value)
- (set (reg h-iacc0 0) value))
- (define-pmacro (iacc-add value)
- (set (reg h-iacc0 0)
- (cond DI
- ((andif (andif (gt value 0) (gt (reg h-iacc0 0) 0))
- (lt (sub DI #x7fffffffffffffff value) (reg h-iacc0 0)))
- ; Positive overflow
- (const DI #x7fffffffffffffff))
- ((andif (andif (lt value 0) (lt (reg h-iacc0 0) 0))
- (gt (sub DI #x8000000000000000 value) (reg h-iacc0 0)))
- ; Negative overflow
- (const DI #x8000000000000000))
- (else
- (add DI (reg h-iacc0 0) value))))
- )
- (define-pmacro (iacc-sub value)
- (set (reg h-iacc0 0)
- (cond DI
- ((andif (andif (lt value 0) (gt (reg h-iacc0 0) 0))
- (lt (add DI #x7fffffffffffffff value) (reg h-iacc0 0)))
- ; Positive overflow
- (const DI #x7fffffffffffffff))
- ((andif (andif (gt value 0) (lt (reg h-iacc0 0) 0))
- (gt (add DI #x8000000000000000 value) (reg h-iacc0 0)))
- ; Negative overflow
- (const DI #x8000000000000000))
- (else
- (sub DI (reg h-iacc0 0) value))))
- )
- (define-pmacro (iacc-multiply-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IACC) (MACH fr400,fr450)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
- (.str name "$pack $GRi,$GRj")
- (+ pack (rd-null) op GRi ope GRj)
- ((.sym iacc- operation) (mul DI (ext DI GRi) (ext DI GRj)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
- )
- )
- (iacc-multiply-r-r smu set OP_46 OPE1_05 "Signed multiply reg/reg/iacc")
- (iacc-multiply-r-r smass add OP_46 OPE1_06 "Signed multiply/add reg/reg/iacc")
- (iacc-multiply-r-r smsss sub OP_46 OPE1_07 "Signed multiply/sub reg/reg/iacc")
- (define-pmacro (int-shift-r-r name op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRk")
- (+ pack GRk op GRi (ICCi_1-null) ope GRj)
- (set GRk (name GRi (and GRj #x1f)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-shift-r-r sll OP_01 OPE2_08 "shift left logical reg/reg")
- (int-shift-r-r srl OP_01 OPE2_0A "shift right logical reg/reg")
- (int-shift-r-r sra OP_01 OPE2_0C "shift right arith reg/reg")
- (dni slass
- "shift left arith reg/reg with saturation"
- ((UNIT IALL) (MACH fr400,fr450)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
- "slass$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_46 GRi OPE1_02 GRj)
- (set GRk (c-call SI "@cpu@_shift_left_arith_saturate" GRi GRj))
- ()
- )
- (dni scutss
- "Integer accumulator cut with saturation"
- ((UNIT I0) (MACH fr400,fr450)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
- "scutss$pack $GRj,$GRk"
- (+ pack GRk OP_46 (rs-null) OPE1_04 GRj)
- (set GRk (c-call SI "@cpu@_iacc_cut" (reg h-iacc0 0) GRj))
- ()
- )
- (define-pmacro (scan-semantics arg1 arg2 targ)
- (sequence ((WI tmp1) (WI tmp2))
- (set tmp1 arg1)
- (set tmp2 (sra arg2 1))
- (set targ (c-call WI "@cpu@_scan_result" (xor tmp1 tmp2))))
- )
- (dni scan
- "scan"
- ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "scan$pack $GRi,$GRj,$GRk"
- (+ pack GRk OP_0B GRi (ICCi_1-null) OPE2_00 GRj)
- (scan-semantics GRi GRj GRk)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- ; Format: conditional INT, Logic, Shift r-r
- ;
- (define-pmacro (conditional-int-logic name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (set GRk (operation GRi GRj)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (conditional-int-logic cadd add OP_58 OPE4_0 "conditional add")
- (conditional-int-logic csub sub OP_58 OPE4_1 "conditional sub")
- (conditional-int-logic cand and OP_5A OPE4_0 "conditional and")
- (conditional-int-logic cor or OP_5A OPE4_1 "conditional or")
- (conditional-int-logic cxor xor OP_5A OPE4_2 "conditional xor")
- (dni cnot
- "conditional not"
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "cnot$pack $GRj,$GRk,$CCi,$cond"
- (+ pack GRk OP_5A (rs-null) CCi cond OPE4_3 GRj)
- (if (eq CCi (or cond 2))
- (set GRk (inv GRj)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- (dni csmul
- "conditional signed multiply"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "csmul$pack $GRi,$GRj,$GRdoublek,$CCi,$cond"
- (+ pack GRdoublek OP_58 GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (set GRdoublek (mul DI (ext DI GRi) (ext DI GRj))))
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- (dni csdiv
- "conditional signed division"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "csdiv$pack $GRi,$GRj,$GRk,$CCi,$cond"
- (+ pack GRk OP_58 GRi CCi cond OPE4_3 GRj)
- (if (eq CCi (or cond 2))
- (sequence ()
- (c-call VOID "@cpu@_signed_integer_divide"
- GRi GRj (index-of GRk) 0)
- (clobber GRk)))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni cudiv
- "conditional unsigned division"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "cudiv$pack $GRi,$GRj,$GRk,$CCi,$cond"
- (+ pack GRk OP_59 GRi CCi cond OPE4_3 GRj)
- (if (eq CCi (or cond 2))
- (sequence ()
- (c-call VOID "@cpu@_unsigned_integer_divide"
- GRi GRj (index-of GRk) 0)
- (clobber GRk)))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (define-pmacro (conditional-shift name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (set GRk (operation GRi (and GRj #x1f))))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (conditional-shift csll sll OP_5C OPE4_0 "conditional shift left logical")
- (conditional-shift csrl srl OP_5C OPE4_1 "conditional shift right logical")
- (conditional-shift csra sra OP_5C OPE4_2 "conditional shift right arith")
- (dni cscan
- "conditional scan"
- ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "cscan$pack $GRi,$GRj,$GRk,$CCi,$cond"
- (+ pack GRk OP_65 GRi CCi cond OPE4_3 GRj)
- (if (eq CCi (or cond 2))
- (scan-semantics GRi GRj GRk))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- ; Format: INT, Logic, Shift, cc r-r
- ;
- (define-pmacro (int-arith-cc-semantics operation icc)
- (sequence ((BI tmp) (QI cc) (SI result))
- (set cc icc)
- (set tmp ((.sym operation -oflag) GRi GRj (const 0)))
- (set-v cc tmp)
- (set tmp ((.sym operation -cflag) GRi GRj (const 0)))
- (set-c cc tmp)
- (set result (operation GRi GRj))
- (set-z-and-n cc result)
- (set GRk result)
- (set icc cc))
- )
- (define-pmacro (int-arith-cc-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 ope GRj)
- (int-arith-cc-semantics operation ICCi_1)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-cc-r-r addcc add OP_00 OPE2_01 "add reg/reg, set icc")
- (int-arith-cc-r-r subcc sub OP_00 OPE2_05 "sub reg/reg, set icc")
- (define-pmacro (int-logic-cc-semantics op icc)
- (sequence ((SI tmp))
- (set tmp (op GRi GRj))
- (set GRk tmp)
- (set-z-and-n icc tmp))
- )
- (define-pmacro (int-logic-cc-r-r name op ope comment)
- (dni (.sym name cc)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 ope GRj)
- (int-logic-cc-semantics name ICCi_1)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-logic-cc-r-r and OP_01 OPE2_01 "and reg/reg, set icc")
- (int-logic-cc-r-r or OP_01 OPE2_03 "or reg/reg, set icc")
- (int-logic-cc-r-r xor OP_01 OPE2_05 "xor reg/reg, set icc")
- (define-pmacro (int-shift-cc-semantics op l-r icc)
- (sequence ((WI shift) (SI tmp) (QI cc))
- (set shift (and GRj #x1f))
- (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r)
- GRi shift icc))
- (set tmp (op GRi shift))
- (set GRk tmp)
- (set-z-and-n cc tmp)
- (set icc cc))
- )
- (define-pmacro (int-shift-cc-r-r name l-r op ope comment)
- (dni (.sym name cc)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 ope GRj)
- (int-shift-cc-semantics name l-r ICCi_1)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-shift-cc-r-r sll left OP_01 OPE2_09 "shift left logical reg/reg,set icc")
- (int-shift-cc-r-r srl right OP_01 OPE2_0B "shift right logical reg/reg,set icc")
- (int-shift-cc-r-r sra right OP_01 OPE2_0D "shift right arith reg/reg,set icc")
- (define-pmacro (multiply-cc-semantics signop arg1 arg2 targ icc)
- (sequence ((DI tmp) (QI cc))
- (set cc icc)
- (set tmp (mul DI (signop DI arg1) (signop DI arg2)))
- (set-n cc (srl DI tmp 63))
- (set-z cc (eq tmp 0))
- (set targ tmp)
- (set icc cc))
- )
- (define-pmacro (multiply-cc-r-r name signop op ope comment)
- (dni name
- (comment)
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRdoublek,$ICCi_1")
- (+ pack GRdoublek op GRi ICCi_1 ope GRj)
- (multiply-cc-semantics signop GRi GRj GRdoublek ICCi_1)
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- )
- (multiply-cc-r-r smulcc ext OP_00 OPE2_09 "signed multiply reg/reg")
- (multiply-cc-r-r umulcc zext OP_00 OPE2_0B "unsigned multiply reg/reg")
- ; Format: conditional INT, Logic, Shift, cc r-r
- ;
- (define-pmacro (conditional-int-arith-cc name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (int-arith-cc-semantics operation
- (reg h-iccr (and (index-of CCi) 3))))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (conditional-int-arith-cc caddcc add OP_59 OPE4_0 "add, set icc")
- (conditional-int-arith-cc csubcc sub OP_59 OPE4_1 "sub, set icc")
- (dni csmulcc
- "conditional signed multiply and set condition code"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "csmulcc$pack $GRi,$GRj,$GRdoublek,$CCi,$cond"
- (+ pack GRdoublek OP_59 GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (multiply-cc-semantics ext GRi GRj GRdoublek
- (reg h-iccr (and (index-of CCi) 3))))
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- (define-pmacro (conditional-int-logic-cc name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (int-logic-cc-semantics operation
- (reg h-iccr (and (index-of CCi) 3))))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (conditional-int-logic-cc candcc and OP_5B OPE4_0 "conditional and, set icc")
- (conditional-int-logic-cc corcc or OP_5B OPE4_1 "conditional or , set icc")
- (conditional-int-logic-cc cxorcc xor OP_5B OPE4_2 "conditional xor, set icc")
- (define-pmacro (conditional-int-shift-cc name l-r op ope comment)
- (dni (.sym c name cc)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- (.str (.sym c name cc) "$pack $GRi,$GRj,$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (int-shift-cc-semantics name l-r
- (reg h-iccr (and (index-of CCi) 3))))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (conditional-int-shift-cc sll left OP_5D OPE4_0 "shift left logical, set icc")
- (conditional-int-shift-cc srl right OP_5D OPE4_1 "shift right logical, set icc")
- (conditional-int-shift-cc sra right OP_5D OPE4_2 "shift right arith , set icc")
- ; Add and subtract with carry
- ;
- (define-pmacro (int-arith-x-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 ope GRj)
- (set GRk ((.sym operation c) GRi GRj (cbit ICCi_1)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-x-r-r addx add OP_00 OPE2_02 "Add reg/reg, with carry")
- (int-arith-x-r-r subx sub OP_00 OPE2_06 "Sub reg/reg, with carry")
- (define-pmacro (int-arith-x-cc-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 ope GRj)
- (sequence ((WI tmp) (QI cc))
- (set cc ICCi_1)
- (set tmp ((.sym operation c) GRi GRj (cbit cc)))
- (set-v cc ((.sym operation -oflag) GRi GRj (cbit cc)))
- (set-c cc ((.sym operation -cflag) GRi GRj (cbit cc)))
- (set-z-and-n cc tmp)
- (set GRk tmp)
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-x-cc-r-r addxcc add OP_00 OPE2_03 "Add reg/reg, use/set carry")
- (int-arith-x-cc-r-r subxcc sub OP_00 OPE2_07 "Sub reg/reg, use/set carry")
- ; Add and subtract with saturation
- ;
- (define-pmacro (int-arith-ss-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT IALL) (MACH fr400,fr450)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
- (.str name "$pack $GRi,$GRj,$GRk")
- (+ pack GRk op GRi ope GRj)
- (sequence ()
- (set GRk (operation GRi GRj))
- (if ((.sym operation -oflag) GRi GRj (const 0))
- ; Overflow, saturate.
- ; Sign of result will be
- ; same as sign of first operand.
- (set GRk
- (cond SI
- ((gt GRi 0) (const #x7fffffff))
- ((lt GRi 0) (const #x80000000))
- (else (const 0)))))
- )
- ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
- )
- )
- (int-arith-ss-r-r addss add OP_46 OPE1_00 "add reg/reg, with saturation")
- (int-arith-ss-r-r subss sub OP_46 OPE1_01 "sub reg/reg, with saturation")
- ; Format: INT, Logic, Shift r-simm
- ;
- (define-pmacro (int-logic-r-simm name operation op comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s12,$GRk")
- (+ pack GRk op GRi s12)
- (set GRk (operation GRi s12))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-logic-r-simm addi add OP_10 "add reg/immed")
- (int-logic-r-simm subi sub OP_14 "sub reg/immed")
- (int-logic-r-simm andi and OP_20 "and reg/immed")
- (int-logic-r-simm ori or OP_22 "or reg/immed")
- (int-logic-r-simm xori xor OP_24 "xor reg/immed")
- (dni sdivi
- "signed division reg/immed"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "sdivi$pack $GRi,$s12,$GRk"
- (+ pack GRk OP_1E GRi s12)
- (sequence ()
- (c-call VOID "@cpu@_signed_integer_divide"
- GRi s12 (index-of GRk) 0)
- (clobber GRk))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni nsdivi
- "non excepting signed division reg/immed"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- "nsdivi$pack $GRi,$s12,$GRk"
- (+ pack GRk OP_2E GRi s12)
- (sequence ()
- (c-call VOID "@cpu@_signed_integer_divide"
- GRi s12 (index-of GRk) 1)
- (clobber GRk))
- ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni udivi
- "unsigned division reg/immed"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "udivi$pack $GRi,$s12,$GRk"
- (+ pack GRk OP_1F GRi s12)
- (sequence ()
- (c-call VOID "@cpu@_unsigned_integer_divide"
- GRi s12 (index-of GRk) 0)
- (clobber GRk))
- ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
- (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (dni nudivi
- "non excepting unsigned division reg/immed"
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- "nudivi$pack $GRi,$s12,$GRk"
- (+ pack GRk OP_2F GRi s12)
- (sequence ()
- (c-call VOID "@cpu@_unsigned_integer_divide"
- GRi s12 (index-of GRk) 1)
- (clobber GRk))
- ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
- )
- (define-pmacro (multiply-r-simm name signop op comment)
- (dni name
- (comment)
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s12,$GRdoublek")
- (+ pack GRdoublek op GRi s12)
- (set GRdoublek (mul DI (signop DI GRi) (signop DI s12)))
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- )
- (multiply-r-simm smuli ext OP_18 "signed multiply reg/immed")
- (multiply-r-simm umuli zext OP_1A "unsigned multiply reg/immed")
- (define-pmacro (int-shift-r-simm name op comment)
- (dni (.sym name i)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str (.sym name i) "$pack $GRi,$s12,$GRk")
- (+ pack GRk op GRi s12)
- (set GRk (name GRi (and s12 #x1f)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-shift-r-simm sll OP_28 "shift left logical reg/immed")
- (int-shift-r-simm srl OP_2A "shift right logical reg/immed")
- (int-shift-r-simm sra OP_2C "shift right arith reg/immed")
- (dni scani
- "scan immediate"
- ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "scani$pack $GRi,$s12,$GRk"
- (+ pack GRk OP_47 GRi s12)
- (scan-semantics GRi s12 GRk)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- ; Format: INT, Logic, Shift cc r-simm
- ;
- (define-pmacro (int-arith-cc-r-simm name operation op comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 s10)
- (sequence ((BI tmp) (QI cc) (SI result))
- (set cc ICCi_1)
- (set tmp ((.sym operation -oflag) GRi s10 (const 0)))
- (set-v cc tmp)
- (set tmp ((.sym operation -cflag) GRi s10 (const 0)))
- (set-c cc tmp)
- (set result (operation GRi s10))
- (set-z-and-n cc result)
- (set GRk result)
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-cc-r-simm addicc add OP_11 "add reg/immed, set icc")
- (int-arith-cc-r-simm subicc sub OP_15 "sub reg/immed, set icc")
- (define-pmacro (int-logic-cc-r-simm name op comment)
- (dni (.sym name icc)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 s10)
- (sequence ((SI tmp))
- (set tmp (name GRi s10))
- (set GRk tmp)
- (set-z-and-n ICCi_1 tmp))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-logic-cc-r-simm and OP_21 "and reg/immed, set icc")
- (int-logic-cc-r-simm or OP_23 "or reg/immed, set icc")
- (int-logic-cc-r-simm xor OP_25 "xor reg/immed, set icc")
- (define-pmacro (multiply-cc-r-simm name signop op comment)
- (dni name
- (comment)
- ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s10,$GRdoublek,$ICCi_1")
- (+ pack GRdoublek op GRi ICCi_1 s10)
- (multiply-cc-semantics signop GRi s10 GRdoublek ICCi_1)
- ((fr400 (unit u-imul)) (fr450 (unit u-imul))
- (fr500 (unit u-imul)) (fr550 (unit u-imul)))
- )
- )
- (multiply-cc-r-simm smulicc ext OP_19 "signed multiply reg/immed")
- (multiply-cc-r-simm umulicc zext OP_1B "unsigned multiply reg/immed")
- (define-pmacro (int-shift-cc-r-simm name l-r op comment)
- (dni (.sym name icc)
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 s10)
- (sequence ((WI shift) (SI tmp) (QI cc))
- (set shift (and s10 #x1f))
- (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r)
- GRi shift ICCi_1))
- (set tmp (name GRi shift))
- (set GRk tmp)
- (set-z-and-n cc tmp)
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-shift-cc-r-simm sll left OP_29 "shift left logical reg/immed, set icc")
- (int-shift-cc-r-simm srl right OP_2B "shift right logical reg/immed, set icc")
- (int-shift-cc-r-simm sra right OP_2D "shift right arith reg/immed, set icc")
- (define-pmacro (int-arith-x-r-simm name operation op comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 s10)
- (set GRk ((.sym operation c) GRi s10 (cbit ICCi_1)))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-x-r-simm addxi add OP_12 "Add reg/immed, with carry")
- (int-arith-x-r-simm subxi sub OP_16 "Sub reg/immed, with carry")
- (define-pmacro (int-arith-x-cc-r-simm name operation op comment)
- (dni name
- (comment)
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
- (+ pack GRk op GRi ICCi_1 s10)
- (sequence ((WI tmp) (QI cc))
- (set cc ICCi_1)
- (set tmp ((.sym operation c) GRi s10 (cbit cc)))
- (set-v cc ((.sym operation -oflag) GRi s10 (cbit cc)))
- (set-c cc ((.sym operation -cflag) GRi s10 (cbit cc)))
- (set-z-and-n cc tmp)
- (set GRk tmp)
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- )
- (int-arith-x-cc-r-simm addxicc add OP_13 "Add reg/immed, with carry")
- (int-arith-x-cc-r-simm subxicc sub OP_17 "Sub reg/immed, with carry")
- ; Byte compare insns
- (dni cmpb
- "Compare bytes"
- ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "cmpb$pack $GRi,$GRj,$ICCi_1"
- (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0C GRj)
- (sequence ((QI cc))
- (set-n cc (eq (and GRi #xff000000) (and GRj #xff000000)))
- (set-z cc (eq (and GRi #x00ff0000) (and GRj #x00ff0000)))
- (set-v cc (eq (and GRi #x0000ff00) (and GRj #x0000ff00)))
- (set-c cc (eq (and GRi #x000000ff) (and GRj #x000000ff)))
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr550 (unit u-integer)))
- )
- (dni cmpba
- "OR of Compare bytes"
- ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "cmpba$pack $GRi,$GRj,$ICCi_1"
- (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0D GRj)
- (sequence ((QI cc))
- (set cc 0)
- (set-c cc
- (orif (eq (and GRi #xff000000) (and GRj #xff000000))
- (orif (eq (and GRi #x00ff0000) (and GRj #x00ff0000))
- (orif (eq (and GRi #x0000ff00)
- (and GRj #x0000ff00))
- (eq (and GRi #x000000ff)
- (and GRj #x000000ff))))))
- (set ICCi_1 cc))
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr550 (unit u-integer)))
- )
- ; Format: Load immediate
- ;
- (dni setlo
- "set low order bits"
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "setlo$pack $ulo16,$GRklo"
- (+ pack GRk OP_3D (misc-null-4) u16)
- (set GRklo u16)
- ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
- (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
- )
- (dni sethi
- "set high order bits"
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "sethi$pack $uhi16,$GRkhi"
- (+ pack GRkhi OP_3E (misc-null-4) u16)
- (set GRkhi u16)
- ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
- (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
- )
- (dni setlos
- "set low order bits and extend sign"
- ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "setlos$pack $slo16,$GRk"
- (+ pack GRk OP_3F (misc-null-4) s16)
- (set GRk s16)
- ((fr400 (unit u-integer)) (fr450 (unit u-integer))
- (fr500 (unit u-integer)) (fr550 (unit u-integer)))
- )
- (define-pmacro (load-gr-r name mode op ope comment ann)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2))
- (.str name "$pack " ann "($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (dann ldann "ld annotation" SI "ld_annotation" "at")
- (load-gr-r ldsb QI OP_02 OPE1_00 "Load signed byte" "@")
- (load-gr-r ldub UQI OP_02 OPE1_01 "Load unsigned byte" "@")
- (load-gr-r ldsh HI OP_02 OPE1_02 "Load signed half" "@")
- (load-gr-r lduh UHI OP_02 OPE1_03 "Load unsigned half" "@")
- (load-gr-r ld SI OP_02 OPE1_04 "Load word" "$ldann")
- (define-pmacro (load-fr-r name mode op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
- (.str name "$pack @($GRi,$GRj),$FRintk")
- (+ pack FRintk op GRi ope GRj)
- (set FRintk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (load-fr-r ldbf UQI OP_02 OPE1_08 "Load byte float")
- (load-fr-r ldhf UHI OP_02 OPE1_09 "Load half float")
- (load-fr-r ldf SI OP_02 OPE1_0A "Load word float")
- (define-pmacro (load-cpr-r name mode op ope reg attr comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) attr)
- (.str name "$pack @($GRi,$GRj),$" reg "k")
- (+ pack (.sym reg k) op GRi ope GRj)
- (set (.sym reg k)
- (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
- ()
- )
- )
- (load-cpr-r ldc SI OP_02 OPE1_0D CPR (MACH frv) "Load coprocessor word")
- ; These correspond to enumerators in frv-sim.h
- (define-pmacro (ne-UQI-size) 0)
- (define-pmacro (ne-QI-size) 1)
- (define-pmacro (ne-UHI-size) 2)
- (define-pmacro (ne-HI-size) 3)
- (define-pmacro (ne-SI-size) 4)
- (define-pmacro (ne-DI-size) 5)
- (define-pmacro (ne-XI-size) 6)
- (define-pmacro (ne-load-semantics base dispix targ idisp size is_float action)
- (sequence ((BI do_op))
- (set do_op
- (c-call BI "@cpu@_check_non_excepting_load"
- (index-of base) dispix (index-of targ)
- idisp size is_float))
- (if do_op action))
- )
- (define-pmacro (ne-load-gr-r name mode op ope size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
- (set GRk
- (c-call mode (.str "@cpu@_read_mem_" mode)
- pc (add GRi GRj))))
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (ne-load-gr-r nldsb QI OP_02 OPE1_20 (ne-QI-size) "Load signed byte")
- (ne-load-gr-r nldub UQI OP_02 OPE1_21 (ne-UQI-size) "Load unsigned byte")
- (ne-load-gr-r nldsh HI OP_02 OPE1_22 (ne-HI-size) "Load signed half")
- (ne-load-gr-r nlduh UHI OP_02 OPE1_23 (ne-UHI-size) "Load unsigned half")
- (ne-load-gr-r nld SI OP_02 OPE1_24 (ne-SI-size) "Load word")
- (define-pmacro (ne-load-fr-r name mode op ope size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$FRintk")
- (+ pack FRintk op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) FRintk 0 size 1
- (set FRintk
- (c-call mode (.str "@cpu@_read_mem_" mode)
- pc (add GRi GRj))))
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (ne-load-fr-r nldbf UQI OP_02 OPE1_28 (ne-UQI-size) "Load byte float")
- (ne-load-fr-r nldhf UHI OP_02 OPE1_29 (ne-UHI-size) "Load half float")
- (ne-load-fr-r nldf SI OP_02 OPE1_2A (ne-SI-size) "Load word float")
- ; Semantics for a load-double insn
- ;
- (define-pmacro (load-double-semantics not_gr mode regtype address arg)
- (if (orif not_gr (ne (index-of (.sym regtype doublek)) 0))
- (sequence ()
- (set address (add GRi arg))
- (set (.sym regtype doublek)
- (c-call mode (.str "@cpu@_read_mem_" mode) pc address))))
- )
- (define-pmacro (load-double-r-r
- name not_gr mode op ope regtype attr profile comment ann)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
- (.str name "$pack " ann "($GRi,$GRj),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (sequence ((WI address))
- (load-double-semantics not_gr mode regtype address GRj))
- profile
- )
- )
- (dann lddann "ldd annotation" SI "ldd_annotation" "at")
- (load-double-r-r ldd 0 DI OP_02 OPE1_05 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load double word" "$lddann")
- (load-double-r-r lddf 1 DF OP_02 OPE1_0B FR FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load double float" "@")
- (load-double-r-r lddc 1 DI OP_02 OPE1_0E CPR (MACH frv) ()
- "Load coprocessor double" "@")
- (define-pmacro (ne-load-double-r-r
- name not_gr mode op ope regtype size is_float attr profile
- comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (sequence ((WI address))
- (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek)
- 0 size is_float
- (load-double-semantics not_gr mode
- regtype
- address GRj)))
- profile
- )
- )
- (ne-load-double-r-r nldd 0 DI OP_02 OPE1_25 GR (ne-DI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
- (ne-load-double-r-r nlddf 1 DF OP_02 OPE1_2B FR (ne-DI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
- ; Semantics for a load-quad insn
- ;
- (define-pmacro (load-quad-semantics regtype address arg)
- (sequence ()
- (set address (add GRi arg))
- (c-call VOID (.str "@cpu@_load_quad_" regtype)
- pc address (index-of (.sym regtype k))))
- )
- (define-pmacro (load-quad-r-r name op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
- (.str name "$pack @($GRi,$GRj),$" regtype "k")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (sequence ((WI address))
- (load-quad-semantics regtype address GRj))
- ; TODO regtype-k not referenced for profiling
- profile
- )
- )
- (load-quad-r-r ldq OP_02 OPE1_06 GR NA ((fr500 (unit u-gr-load)))
- "Load quad word")
- (load-quad-r-r ldqf OP_02 OPE1_0C FRint FR-ACCESS ((fr500 (unit u-fr-load)))
- "Load quad float")
- (load-quad-r-r ldqc OP_02 OPE1_0F CPR NA () "Load coprocessor quad")
- (define-pmacro (ne-load-quad-r-r
- name op ope regtype size is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
- (.str name "$pack @($GRi,$GRj),$" regtype "k")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (sequence ((WI address))
- (ne-load-semantics GRi (index-of GRj) (.sym regtype k)
- 0 size is_float
- (load-quad-semantics regtype address GRj)))
- ; TODO regtype-k not referenced for profiling
- profile
- )
- )
- (ne-load-quad-r-r nldq OP_02 OPE1_26 GR (ne-XI-size) 0 NA
- ((fr500 (unit u-gr-load))) "Load quad word")
- (ne-load-quad-r-r nldqf OP_02 OPE1_2C FRint (ne-XI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load))) "Load quad float")
- (define-pmacro (load-gr-u-semantics mode)
- (sequence ((UWI address))
- (set address (add GRi GRj))
- (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
- (if (ne (index-of GRi) (index-of GRk))
- (sequence ()
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))))
- )
- (define-pmacro (load-gr-u name mode op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2))
- (.str name "$pack @($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (load-gr-u-semantics mode)
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (load-gr-u ldsbu QI OP_02 OPE1_10 "Load signed byte, update index")
- (load-gr-u ldubu UQI OP_02 OPE1_11 "Load unsigned byte, update index")
- (load-gr-u ldshu HI OP_02 OPE1_12 "Load signed half, update index")
- (load-gr-u lduhu UHI OP_02 OPE1_13 "Load unsigned half, update index")
- (load-gr-u ldu SI OP_02 OPE1_14 "Load word, update index")
- (define-pmacro (ne-load-gr-u name mode op ope size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 (load-gr-u-semantics mode))
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (ne-load-gr-u nldsbu QI OP_02 OPE1_30 (ne-QI-size) "Load signed byte, update index")
- (ne-load-gr-u nldubu UQI OP_02 OPE1_31 (ne-UQI-size) "Load unsigned byte, update index")
- (ne-load-gr-u nldshu HI OP_02 OPE1_32 (ne-HI-size) "Load signed half, update index")
- (ne-load-gr-u nlduhu UHI OP_02 OPE1_33 (ne-UHI-size) "Load unsigned half, update index")
- (ne-load-gr-u nldu SI OP_02 OPE1_34 (ne-SI-size) "Load word, update index")
- (define-pmacro (load-non-gr-u-semantics mode regtype)
- (sequence ((UWI address))
- (set address (add GRi GRj))
- (set (.sym regtype k)
- (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))
- )
- (define-pmacro (load-fr-u name mode op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
- (.str name "$pack @($GRi,$GRj),$FRintk")
- (+ pack FRintk op GRi ope GRj)
- (load-non-gr-u-semantics mode FRint)
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (load-fr-u ldbfu UQI OP_02 OPE1_18 "Load byte float, update index")
- (load-fr-u ldhfu UHI OP_02 OPE1_19 "Load half float, update index")
- (load-fr-u ldfu SI OP_02 OPE1_1A "Load word float, update index")
- (define-pmacro (load-cpr-u name mode op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
- (.str name "$pack @($GRi,$GRj),$CPRk")
- (+ pack CPRk op GRi ope GRj)
- (load-non-gr-u-semantics mode CPR)
- ()
- )
- )
- (load-cpr-u ldcu SI OP_02 OPE1_1D "Load coprocessor word float,update index")
- (define-pmacro (ne-load-non-gr-u name mode op ope regtype size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$" regtype "k")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
- (load-non-gr-u-semantics mode regtype))
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (ne-load-non-gr-u nldbfu UQI OP_02 OPE1_38 FRint (ne-UQI-size) "Load byte float, update index")
- (ne-load-non-gr-u nldhfu UHI OP_02 OPE1_39 FRint (ne-UHI-size) "Load half float, update index")
- (ne-load-non-gr-u nldfu SI OP_02 OPE1_3A FRint (ne-SI-size) "Load word float, update index")
- (define-pmacro (load-double-gr-u-semantics)
- (sequence ((WI address))
- (load-double-semantics 0 DI GR address GRj)
- (if (ne (index-of GRi) (index-of GRdoublek))
- (sequence ()
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))))
- )
- (define-pmacro (load-double-gr-u name op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2))
- (.str name "$pack @($GRi,$GRj),$GRdoublek")
- (+ pack GRdoublek op GRi ope GRj)
- (load-double-gr-u-semantics)
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (load-double-gr-u lddu OP_02 OPE1_15 "Load double word, update index")
- (define-pmacro (ne-load-double-gr-u name op ope size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$GRdoublek")
- (+ pack GRdoublek op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) GRdoublek 0 size 0
- (load-double-gr-u-semantics))
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (ne-load-double-gr-u nlddu OP_02 OPE1_35 (ne-DI-size) "Load double word, update index")
- (define-pmacro (load-double-non-gr-u-semantics mode regtype)
- (sequence ((WI address))
- (load-double-semantics 1 mode regtype address GRj)
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))
- )
- (define-pmacro (load-double-non-gr-u
- name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
- (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (load-double-non-gr-u-semantics mode regtype)
- profile
- )
- )
- (load-double-non-gr-u lddfu DF OP_02 OPE1_1B FR FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load double float, update index")
- (load-double-non-gr-u lddcu DI OP_02 OPE1_1E CPR (MACH frv)
- () "Load coprocessor double float, update index")
- (define-pmacro (ne-load-double-non-gr-u name mode op ope regtype size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek) 0 size 1
- (load-double-non-gr-u-semantics mode regtype))
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (ne-load-double-non-gr-u nlddfu DF OP_02 OPE1_3B FR (ne-DI-size) "Load double float, update index")
- (define-pmacro (load-quad-gr-u-semantics)
- (sequence ((WI address))
- (load-quad-semantics GR address GRj)
- (if (ne (index-of GRi) (index-of GRk))
- (sequence ()
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))))
- )
- (define-pmacro (load-quad-gr-u name op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
- (.str name "$pack @($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (load-quad-gr-u-semantics)
- ; TODO - GRk not referenced here for profiling
- ((fr500 (unit u-gr-load)))
- )
- )
- (load-quad-gr-u ldqu OP_02 OPE1_16 "Load quad word, update index")
- (define-pmacro (ne-load-quad-gr-u name op ope size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING)
- (.str name "$pack @($GRi,$GRj),$GRk")
- (+ pack GRk op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
- (load-quad-gr-u-semantics))
- ; TODO - GRk not referenced here for profiling
- ((fr500 (unit u-gr-load)))
- )
- )
- (ne-load-quad-gr-u nldqu OP_02 OPE1_36 (ne-XI-size) "Load quad word, update index")
- (define-pmacro (load-quad-non-gr-u-semantics regtype)
- (sequence ((WI address))
- (load-quad-semantics regtype address GRj)
- (set GRi address)
- (c-call VOID "@cpu@_force_update"))
- )
- (define-pmacro (load-quad-non-gr-u name op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
- (.str name "$pack @($GRi,$GRj),$" regtype "k")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (load-quad-non-gr-u-semantics regtype)
- profile
- )
- )
- (load-quad-non-gr-u ldqfu OP_02 OPE1_1C FRint FR-ACCESS
- ((fr500 (unit u-fr-load))) "Load quad float, update index")
- (load-quad-non-gr-u ldqcu OP_02 OPE1_1F CPR NA
- () "Load coprocessor quad word, update index")
- (define-pmacro (ne-load-quad-non-gr-u name op ope regtype size comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING FR-ACCESS)
- (.str name "$pack @($GRi,$GRj),$" regtype "k")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
- (load-quad-non-gr-u-semantics regtype))
- ((fr500 (unit u-fr-load)))
- )
- )
- (ne-load-quad-non-gr-u nldqfu OP_02 OPE1_3C FRint (ne-XI-size) "Load quad float,update index")
- (define-pmacro (load-r-simm name mode op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
- (.str name "$pack @($GRi,$d12),$" regtype "k")
- (+ pack (.sym regtype k) op GRi d12)
- (set (.sym regtype k)
- (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi d12)))
- profile
- )
- )
- (load-r-simm ldsbi QI OP_30 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load signed byte")
- (load-r-simm ldshi HI OP_31 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load signed half")
- (load-r-simm ldi SI OP_32 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load word")
- (load-r-simm ldubi UQI OP_35 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load unsigned byte")
- (load-r-simm lduhi UHI OP_36 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load unsigned half")
- (load-r-simm ldbfi UQI OP_38 FRint FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load byte float")
- (load-r-simm ldhfi UHI OP_39 FRint FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load half float")
- (load-r-simm ldfi SI OP_3A FRint FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load word float")
- (define-pmacro (ne-load-r-simm
- name mode op regtype size is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$d12),$" regtype "k")
- (+ pack (.sym regtype k) op GRi d12)
- (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
- (set (.sym regtype k)
- (c-call mode (.str "@cpu@_read_mem_" mode)
- pc (add GRi d12))))
- profile
- )
- )
- (ne-load-r-simm nldsbi QI OP_40 GR (ne-QI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed byte")
- (ne-load-r-simm nldubi UQI OP_41 GR (ne-UQI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned byte")
- (ne-load-r-simm nldshi HI OP_42 GR (ne-HI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed half")
- (ne-load-r-simm nlduhi UHI OP_43 GR (ne-UHI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned half")
- (ne-load-r-simm nldi SI OP_44 GR (ne-SI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load word")
- (ne-load-r-simm nldbfi UQI OP_48 FRint (ne-UQI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load byte float")
- (ne-load-r-simm nldhfi UHI OP_49 FRint (ne-UHI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load half float")
- (ne-load-r-simm nldfi SI OP_4A FRint (ne-SI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load word float")
- (define-pmacro (load-double-r-simm
- name not_gr mode op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
- (.str name "$pack @($GRi,$d12),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi d12)
- (sequence ((WI address))
- (load-double-semantics not_gr mode regtype address d12))
- profile
- )
- )
- (load-double-r-simm lddi 0 DI OP_33 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load double word")
- (load-double-r-simm lddfi 1 DF OP_3B FR FR-ACCESS
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load double float")
- (define-pmacro (ne-load-double-r-simm
- name not_gr mode op regtype size is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
- (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack @($GRi,$d12),$" regtype "doublek")
- (+ pack (.sym regtype doublek) op GRi d12)
- (sequence ((WI address))
- (ne-load-semantics GRi -1 (.sym regtype doublek)
- d12 size is_float
- (load-double-semantics not_gr mode
- regtype
- address d12)))
- profile
- )
- )
- (ne-load-double-r-simm nlddi 0 DI OP_45 GR (ne-DI-size) 0 NA
- ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
- (ne-load-double-r-simm nlddfi 1 DF OP_4B FR (ne-DI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
- (define-pmacro (load-quad-r-simm name op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
- (.str name "$pack @($GRi,$d12),$" regtype "k")
- (+ pack (.sym regtype k) op GRi d12)
- (sequence ((WI address))
- (load-quad-semantics regtype address d12))
- profile
- )
- )
- (load-quad-r-simm ldqi OP_34 GR NA
- ((fr500 (unit u-gr-load))) "Load quad word")
- (load-quad-r-simm ldqfi OP_3C FRint FR-ACCESS
- ((fr500 (unit u-fr-load))) "Load quad float")
- (define-pmacro (ne-load-quad-r-simm
- name op regtype size is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
- (.str name "$pack @($GRi,$d12),$" regtype "k")
- (+ pack (.sym regtype k) op GRi d12)
- (sequence ((WI address))
- (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
- (load-quad-semantics regtype address d12)))
- profile
- )
- )
- (ne-load-quad-r-simm nldqfi OP_4C FRint (ne-XI-size) 1 FR-ACCESS
- ((fr500 (unit u-fr-load))) "Load quad float")
- (define-pmacro (store-r-r name mode op ope reg attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" reg "k,@($GRi,$GRj)")
- (+ pack (.sym reg k) op GRi ope GRj)
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc (add GRi GRj) (.sym reg k))
- profile
- )
- )
- (store-r-r stb QI OP_03 OPE1_00 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned byte")
- (store-r-r sth HI OP_03 OPE1_01 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned half")
- (store-r-r st SI OP_03 OPE1_02 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store word")
- (store-r-r stbf QI OP_03 OPE1_08 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store byte float")
- (store-r-r sthf HI OP_03 OPE1_09 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store half float")
- (store-r-r stf SI OP_03 OPE1_0A FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store word float")
- (store-r-r stc SI OP_03 OPE1_25 CPR (MACH frv) () "Store coprocessor word")
- ; Semantics for a store-double insn
- ;
- (define-pmacro (store-double-semantics mode regtype address arg)
- (sequence ()
- (set address (add GRi arg))
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc address (.sym regtype doublek)))
- )
- (define-pmacro (store-double-r-r name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (sequence ((WI address))
- (store-double-semantics mode regtype address GRj))
- profile
- )
- )
- (store-double-r-r std DI OP_03 OPE1_03 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store double word")
- (store-double-r-r stdf DF OP_03 OPE1_0B FR FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store double float")
- (store-double-r-r stdc DI OP_03 OPE1_26 CPR (MACH frv)
- () "Store coprocessor double word")
- ; Semantics for a store-quad insn
- ;
- (define-pmacro (store-quad-semantics regtype address arg)
- (sequence ()
- (set address (add GRi arg))
- (c-call VOID (.str "@cpu@_store_quad_" regtype)
- pc address (index-of (.sym regtype k))))
- )
- (define-pmacro (store-quad-r-r name op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
- (.str name "$pack $" regtype "k,@($GRi,$GRj)")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (sequence ((WI address))
- (store-quad-semantics regtype address GRj))
- profile
- )
- )
- (store-quad-r-r stq OP_03 OPE1_04 GR NA
- ((fr500 (unit u-gr-store))) "Store quad word")
- (store-quad-r-r stqf OP_03 OPE1_0C FRint FR-ACCESS
- ((fr500 (unit u-fr-store)))
- "Store quad float")
- (store-quad-r-r stqc OP_03 OPE1_27 CPR NA
- () "Store coprocessor quad word")
- (define-pmacro (store-r-r-u name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" regtype "k,@($GRi,$GRj)")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (sequence ((UWI address))
- (set address (add GRi GRj))
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc address (.sym regtype k))
- (set GRi address))
- profile
- )
- )
- (store-r-r-u stbu QI OP_03 OPE1_10 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned byte, update index")
- (store-r-r-u sthu HI OP_03 OPE1_11 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned half, update index")
- (store-r-r-u stu WI OP_03 OPE1_12 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store word, update index")
- (store-r-r-u stbfu QI OP_03 OPE1_18 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store byte float, update index")
- (store-r-r-u sthfu HI OP_03 OPE1_19 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store half float, update index")
- (store-r-r-u stfu SI OP_03 OPE1_1A FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store word float, update index")
- (store-r-r-u stcu SI OP_03 OPE1_2D CPR (MACH frv) ()
- "Store coprocessor word, update index")
- (define-pmacro (store-double-r-r-u
- name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
- (+ pack (.sym regtype doublek) op GRi ope GRj)
- (sequence ((WI address))
- (store-double-semantics mode regtype address GRj)
- (set GRi address))
- profile
- )
- )
- (store-double-r-r-u stdu DI OP_03 OPE1_13 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store double word, update index")
- (store-double-r-r-u stdfu DF OP_03 OPE1_1B FR FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store double float,update index")
- (store-double-r-r-u stdcu DI OP_03 OPE1_2E CPR (MACH frv) ()
- "Store coprocessor double word, update index")
- (define-pmacro (store-quad-r-r-u name op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
- (.str name "$pack $" regtype "k,@($GRi,$GRj)")
- (+ pack (.sym regtype k) op GRi ope GRj)
- (sequence ((WI address))
- (store-quad-semantics regtype address GRj)
- (set GRi address))
- profile
- )
- )
- (store-quad-r-r-u stqu OP_03 OPE1_14 GR NA
- ((fr500 (unit u-gr-store)))
- "Store quad word, update index")
- (store-quad-r-r-u stqfu OP_03 OPE1_1C FRint FR-ACCESS
- ((fr500 (unit u-fr-store)))
- "Store quad float, update index")
- (store-quad-r-r-u stqcu OP_03 OPE1_2F CPR NA ()
- "Store coprocessor quad word, update index")
- (define-pmacro (conditional-load name mode op ope regtype profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
- (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
- (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (set (.sym regtype k)
- (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))))
- profile
- )
- )
- (conditional-load cldsb QI OP_5E OPE4_0 GR
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load signed byte")
- (conditional-load cldub UQI OP_5E OPE4_1 GR
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load unsigned byte")
- (conditional-load cldsh HI OP_5E OPE4_2 GR
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load signed half")
- (conditional-load clduh UHI OP_5E OPE4_3 GR
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load unsigned half")
- (conditional-load cld SI OP_5F OPE4_0 GR
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load word")
- (conditional-load cldbf UQI OP_60 OPE4_0 FRint
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load byte float")
- (conditional-load cldhf UHI OP_60 OPE4_1 FRint
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load half float")
- (conditional-load cldf SI OP_60 OPE4_2 FRint
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- "Load word float")
- (define-pmacro (conditional-load-double
- name not_gr mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL attr)
- (.str name "$pack @($GRi,$GRj),$" regtype "doublek,$CCi,$cond")
- (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (load-double-semantics not_gr mode regtype address GRj)))
- profile
- )
- )
- (conditional-load-double cldd 0 DI OP_5F OPE4_1 GR NA
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- "Load double word")
- (conditional-load-double clddf 1 DF OP_60 OPE4_3 FR FR-ACCESS
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-fr-load)))
- "Load double float")
- (dni cldq
- "conditional load quad integer"
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
- "cldq$pack @($GRi,$GRj),$GRk,$CCi,$cond"
- (+ pack GRk OP_5F GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (load-quad-semantics GR address GRj)))
- ((fr500 (unit u-gr-load)))
- )
- (define-pmacro (conditional-load-gr-u name mode op ope comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
- (.str name "$pack @($GRi,$GRj),$GRk,$CCi,$cond")
- (+ pack GRk op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (set address (add GRi GRj))
- (set GRk
- (c-call mode (.str "@cpu@_read_mem_" mode)
- pc address))
- (if (ne (index-of GRi) (index-of GRk))
- (set GRi address))))
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- )
- (conditional-load-gr-u cldsbu QI OP_61 OPE4_0 "Load signed byte, update")
- (conditional-load-gr-u cldubu UQI OP_61 OPE4_1 "Load unsigned byte, update")
- (conditional-load-gr-u cldshu HI OP_61 OPE4_2 "Load signed half, update")
- (conditional-load-gr-u clduhu UHI OP_61 OPE4_3 "Load unsigned half, update")
- (conditional-load-gr-u cldu SI OP_62 OPE4_0 "Load word, update")
- (define-pmacro (conditional-load-non-gr-u name mode op ope regtype comment)
- (dni name
- (comment)
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
- (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
- (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (set address (add GRi GRj))
- (set (.sym regtype k)
- (c-call mode (.str "@cpu@_read_mem_" mode)
- pc address))
- (set GRi address)))
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- )
- (conditional-load-non-gr-u cldbfu UQI OP_63 OPE4_0 FRint "Load byte float, update")
- (conditional-load-non-gr-u cldhfu UHI OP_63 OPE4_1 FRint "Load half float, update")
- (conditional-load-non-gr-u cldfu SI OP_63 OPE4_2 FRint "Load word float, update")
- (dni clddu
- "Load double word, update"
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
- "clddu$pack @($GRi,$GRj),$GRdoublek,$CCi,$cond"
- (+ pack GRdoublek OP_62 GRi CCi cond OPE4_1 GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (load-double-semantics 0 DI GR address GRj)
- (if (ne (index-of GRi) (index-of GRdoublek))
- (set GRi address))))
- ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
- (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
- )
- (dni clddfu
- "Load double float, update"
- ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
- (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
- "clddfu$pack @($GRi,$GRj),$FRdoublek,$CCi,$cond"
- (+ pack FRdoublek OP_63 GRi CCi cond OPE4_3 GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (load-double-semantics 1 DF FR address GRj)
- (set GRi address)))
- ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
- (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
- )
- (dni cldqu
- "conditional load quad integer and update index"
- ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
- "cldqu$pack @($GRi,$GRj),$GRk,$CCi,$cond"
- (+ pack GRk OP_62 GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (load-quad-semantics GR address GRj)
- (if (ne (index-of GRi) (index-of GRk))
- (set GRi address))))
- ((fr500 (unit u-gr-load)))
- )
- (define-pmacro (conditional-store name mode op ope regtype profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL)
- (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
- (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc (add GRi GRj) (.sym regtype k)))
- profile
- )
- )
- (conditional-store cstb QI OP_64 OPE4_0 GR
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned byte")
- (conditional-store csth HI OP_64 OPE4_1 GR
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned half")
- (conditional-store cst SI OP_64 OPE4_2 GR
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store word")
- (conditional-store cstbf QI OP_66 OPE4_0 FRint
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store byte float")
- (conditional-store csthf HI OP_66 OPE4_1 FRint
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store half float")
- (conditional-store cstf SI OP_66 OPE4_2 FRint
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store word float")
- (define-pmacro (conditional-store-double
- name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
- (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
- (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (store-double-semantics mode regtype address GRj)))
- profile
- )
- )
- (conditional-store-double cstd DI OP_64 OPE4_3 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store double word")
- (conditional-store-double cstdf DF OP_66 OPE4_3 FR FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store double float")
- (dni cstq
- "conditionally store quad word"
- ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) CONDITIONAL)
- "cstq$pack $GRk,@($GRi,$GRj),$CCi,$cond"
- (+ pack GRk OP_65 GRi CCi cond OPE4_0 GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (store-quad-semantics GR address GRj)))
- ((fr500 (unit u-gr-store)))
- )
- (define-pmacro (conditional-store-u
- name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
- (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
- (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (set address (add GRi GRj))
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc address (.sym regtype k))
- (set GRi address)))
- profile
- )
- )
- (conditional-store-u cstbu QI OP_67 OPE4_0 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned byte, update index")
- (conditional-store-u csthu HI OP_67 OPE4_1 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned half, update index")
- (conditional-store-u cstu SI OP_67 OPE4_2 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store word, update index")
- (conditional-store-u cstbfu QI OP_68 OPE4_0 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store byte float, update index")
- (conditional-store-u csthfu HI OP_68 OPE4_1 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store half float, update index")
- (conditional-store-u cstfu SI OP_68 OPE4_2 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store word float, update index")
- (define-pmacro (conditional-store-double-u
- name mode op ope regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
- (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
- (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
- (if (eq CCi (or cond 2))
- (sequence ((WI address))
- (store-double-semantics mode regtype address GRj)
- (set GRi address)))
- profile
- )
- )
- (conditional-store-double-u cstdu DI OP_67 OPE4_3 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store double word, update index")
- (conditional-store-double-u cstdfu DF OP_68 OPE4_3 FR FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store double float, update index")
- (define-pmacro (store-r-simm name mode op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" regtype "k,@($GRi,$d12)")
- (+ pack (.sym regtype k) op GRi d12)
- (c-call VOID (.str "@cpu@_write_mem_" mode)
- pc (add GRi d12) (.sym regtype k))
- profile
- )
- )
- (store-r-simm stbi QI OP_50 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned byte")
- (store-r-simm sthi HI OP_51 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store unsigned half")
- (store-r-simm sti SI OP_52 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store word")
- (store-r-simm stbfi QI OP_4E FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store byte float")
- (store-r-simm sthfi HI OP_4F FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store half float")
- (store-r-simm stfi SI OP_55 FRint FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store word float")
- (define-pmacro (store-double-r-simm name mode op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
- (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
- (.str name "$pack $" regtype "doublek,@($GRi,$d12)")
- (+ pack (.sym regtype doublek) op GRi d12)
- (sequence ((WI address))
- (store-double-semantics mode regtype address d12))
- profile
- )
- )
- (store-double-r-simm stdi DI OP_53 GR NA
- ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
- (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
- "Store double word")
- (store-double-r-simm stdfi DF OP_56 FR FR-ACCESS
- ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
- (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
- "Store double float")
- (define-pmacro (store-quad-r-simm name op regtype attr profile comment)
- (dni name
- (comment)
- ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
- (.str name "$pack $" regtype "k,@($GRi,$d12)")
- (+ pack (.sym regtype k) op GRi d12)
- (sequence ((WI address))
- (store-quad-semantics regtype address d12))
- profile
- )
- )
- (store-quad-r-simm stqi OP_54 GR NA ((fr500 (unit u-gr-store)))
- "Store quad word")
- (store-quad-r-simm stqfi OP_57 FRint FR-ACCESS ()
- "Store quad float")
- (define-pmacro (swap-semantics base offset arg)
- (sequence ((WI tmp) (WI address))
- (set tmp arg)
- (set address (add base offset))
- (c-call VOID "@cpu@_check_swap_address" address)
- (set arg (c-call WI "@cpu@_read_mem_WI" pc address))
- (c-call VOID "@cpu@_write_mem_WI" pc address tmp))
- )
- (dni swap
- "Swap contents of memory with GR"
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- "swap$pack @($GRi,$GRj),$GRk"
- (+ pack GRk OP_03 GRi OPE1_05 GRj)
- (swap-semantics GRi GRj GRk)
- ((fr400 (unit u-swap)) (fr450 (unit u-swap))
- (fr500 (unit u-swap)) (fr550 (unit u-swap)))
- )
- (dni "swapi"
- "Swap contents of memory with GR"
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- ("swapi$pack @($GRi,$d12),$GRk")
- (+ pack GRk OP_4D GRi d12)
- (swap-semantics GRi d12 GRk)
- ((fr400 (unit u-swap)) (fr450 (unit u-swap))
- (fr500 (unit u-swap)) (fr550 (unit u-swap)))
- )
- (dni cswap
- "Conditionally swap contents of memory with GR"
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2) CONDITIONAL)
- "cswap$pack @($GRi,$GRj),$GRk,$CCi,$cond"
- (+ pack GRk OP_65 GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (swap-semantics GRi GRj GRk))
- ((fr400 (unit u-swap)) (fr450 (unit u-swap))
- (fr500 (unit u-swap)) (fr550 (unit u-swap)))
- )
- (define-pmacro (register-transfer
- name op ope reg_src reg_targ pipe attrs profile comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) (.unsplice attrs))
- (.str name "$pack $" reg_src ",$" reg_targ)
- (+ pack reg_targ op (rs-null) ope reg_src)
- (set reg_targ reg_src)
- profile
- )
- )
- (register-transfer movgf OP_03 OPE1_15
- GRj FRintk I0
- ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
- ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
- (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
- "transfer gr to fr")
- (register-transfer movfg OP_03 OPE1_0D
- FRintk GRj I0
- ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
- ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
- (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
- "transfer fr to gr")
- (define-pmacro (nextreg hw r offset) (reg hw (add (index-of r) offset)))
- (define-pmacro (register-transfer-double-from-gr-semantics cond)
- (if cond
- (if (eq (index-of GRj) 0)
- (sequence ()
- (set FRintk 0)
- (set (nextreg h-fr_int FRintk 1) 0))
- (sequence ()
- (set FRintk GRj)
- (set (nextreg h-fr_int FRintk 1) (nextreg h-gr GRj 1)))))
- )
- (dni movgfd
- "move GR for FR double"
- ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
- "movgfd$pack $GRj,$FRintk"
- (+ pack FRintk OP_03 (rs-null) OPE1_16 GRj)
- (register-transfer-double-from-gr-semantics 1)
- ; TODO -- doesn't handle second register in the pair
- ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
- (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
- )
- (define-pmacro (register-transfer-double-to-gr-semantics cond)
- (if (andif (ne (index-of GRj) 0) cond)
- (sequence ()
- (set GRj FRintk)
- (set (nextreg h-gr GRj 1) (nextreg h-fr_int FRintk 1))))
- )
- (dni movfgd
- "move FR for GR double"
- ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
- "movfgd$pack $FRintk,$GRj"
- (+ pack FRintk OP_03 (rs-null) OPE1_0E GRj)
- (register-transfer-double-to-gr-semantics 1)
- ; TODO -- doesn't handle second register in the pair
- ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
- (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
- )
- (dni movgfq
- "move GR for FR quad"
- ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
- "movgfq$pack $GRj,$FRintk"
- (+ pack FRintk OP_03 (rs-null) OPE1_17 GRj)
- (if (eq (index-of GRj) 0)
- (sequence ()
- (set FRintk 0)
- (set (reg h-fr_int (add (index-of FRintk) 1)) 0)
- (set (reg h-fr_int (add (index-of FRintk) 2)) 0)
- (set (reg h-fr_int (add (index-of FRintk) 3)) 0))
- (sequence ()
- (set FRintk GRj)
- (set (reg h-fr_int (add (index-of FRintk) 1))
- (reg h-gr (add (index-of GRj) 1)))
- (set (reg h-fr_int (add (index-of FRintk) 2))
- (reg h-gr (add (index-of GRj) 2)))
- (set (reg h-fr_int (add (index-of FRintk) 3))
- (reg h-gr (add (index-of GRj) 3)))))
- ()
- )
- (dni movfgq
- "move FR for GR quad"
- ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
- "movfgq$pack $FRintk,$GRj"
- (+ pack FRintk OP_03 (rs-null) OPE1_0F GRj)
- (if (ne (index-of GRj) 0)
- (sequence ()
- (set GRj FRintk)
- (set (reg h-gr (add (index-of GRj) 1))
- (reg h-fr_int (add (index-of FRintk) 1)))
- (set (reg h-gr (add (index-of GRj) 2))
- (reg h-fr_int (add (index-of FRintk) 2)))
- (set (reg h-gr (add (index-of GRj) 3))
- (reg h-fr_int (add (index-of FRintk) 3)))))
- ()
- )
- (define-pmacro (conditional-register-transfer
- name op ope reg_src reg_targ pipe attrs profile comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) CONDITIONAL FR-ACCESS (.unsplice attrs))
- (.str name "$pack $" reg_src ",$" reg_targ ",$CCi,$cond")
- (+ pack reg_targ op (rs-null) CCi cond ope reg_src)
- (if (eq CCi (or cond 2))
- (set reg_targ reg_src))
- profile
- )
- )
- (conditional-register-transfer cmovgf OP_69 OPE4_0 GRj FRintk I0
- ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4))
- ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
- (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
- "transfer gr to fr")
- (conditional-register-transfer cmovfg OP_69 OPE4_2 FRintk GRj I0
- ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4))
- ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
- (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
- "transfer fr to gr")
- (dni cmovgfd
- "Conditional move GR to FR double"
- ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
- "cmovgfd$pack $GRj,$FRintk,$CCi,$cond"
- (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_1 GRj)
- (register-transfer-double-from-gr-semantics (eq CCi (or cond 2)))
- ; TODO -- doesn't handle extra registers in double
- ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
- (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
- )
- (dni cmovfgd
- "Conditional move FR to GR double"
- ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
- (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
- "cmovfgd$pack $FRintk,$GRj,$CCi,$cond"
- (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_3 GRj)
- (register-transfer-double-to-gr-semantics (eq CCi (or cond 2)))
- ; TODO -- doesn't handle second register in the pair
- ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
- (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
- )
- (define-pmacro (register-transfer-spr
- name op ope reg_src reg_targ unitname comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- (.str name "$pack $" reg_src ",$" reg_targ)
- (+ pack reg_targ op ope reg_src)
- (set reg_targ reg_src)
- ((fr400 (unit unitname)) (fr450 (unit unitname))
- (fr500 (unit unitname)) (fr550 (unit unitname)))
- )
- )
- (register-transfer-spr movgs OP_03 OPE1_06 GRj spr u-gr2spr "transfer gr->spr")
- (register-transfer-spr movsg OP_03 OPE1_07 spr GRj u-spr2gr "transfer spr->gr")
- ; Integer Branch Conditions
- (define-pmacro (Inev cc) (const BI 0))
- (define-pmacro (Ira cc) (const BI 1))
- (define-pmacro (Ieq cc) ( zbit cc))
- (define-pmacro (Ine cc) (not (zbit cc)))
- (define-pmacro (Ile cc) ( orif (zbit cc) (xor (nbit cc) (vbit cc))))
- (define-pmacro (Igt cc) (not (orif (zbit cc) (xor (nbit cc) (vbit cc)))))
- (define-pmacro (Ilt cc) ( xor (nbit cc) (vbit cc)))
- (define-pmacro (Ige cc) (not (xor (nbit cc) (vbit cc))))
- (define-pmacro (Ils cc) ( orif (cbit cc) (zbit cc)))
- (define-pmacro (Ihi cc) (not (orif (cbit cc) (zbit cc))))
- (define-pmacro (Ic cc) ( cbit cc))
- (define-pmacro (Inc cc) (not (cbit cc)))
- (define-pmacro (In cc) ( nbit cc))
- (define-pmacro (Ip cc) (not (nbit cc)))
- (define-pmacro (Iv cc) ( vbit cc))
- (define-pmacro (Inv cc) (not (vbit cc)))
- ; Float Branch Conditions
- (define-pmacro (Fnev cc) (const BI 0))
- (define-pmacro (Fra cc) (const BI 1))
- (define-pmacro (Fne cc) (orif (lbit cc) (orif (gbit cc) (ubit cc))))
- (define-pmacro (Feq cc) (ebit cc))
- (define-pmacro (Flg cc) (orif (lbit cc) (gbit cc)))
- (define-pmacro (Fue cc) (orif (ebit cc) (ubit cc)))
- (define-pmacro (Ful cc) (orif (lbit cc) (ubit cc)))
- (define-pmacro (Fge cc) (orif (ebit cc) (gbit cc)))
- (define-pmacro (Flt cc) (lbit cc))
- (define-pmacro (Fuge cc) (orif (ebit cc) (orif (gbit cc) (ubit cc))))
- (define-pmacro (Fug cc) (orif (gbit cc) (ubit cc)))
- (define-pmacro (Fle cc) (orif (ebit cc) (lbit cc)))
- (define-pmacro (Fgt cc) (gbit cc))
- (define-pmacro (Fule cc) (orif (ebit cc) (orif (lbit cc) (ubit cc))))
- (define-pmacro (Fu cc) (ubit cc))
- (define-pmacro (Fo cc) (orif (ebit cc) (orif (lbit cc) (gbit cc))))
- (define-pmacro (conditional-branch-i prefix cc op cond comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1))
- (.str (.sym prefix cc) "$pack $ICCi_2,$hint,$label16")
- (+ pack (.sym ICC_ cc) ICCi_2 op hint label16)
- (sequence ()
- (c-call VOID "@cpu@_model_branch" label16 hint)
- (if (cond ICCi_2)
- (set pc label16)))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- )
- (dni bra
- "integer branch equal"
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1))
- "bra$pack $hint_taken$label16"
- (+ pack ICC_ra (ICCi_2-null) OP_06 hint_taken label16)
- (sequence ()
- (c-call VOID "@cpu@_model_branch" label16 hint_taken)
- (set pc label16))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni bno
- "integer branch never"
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1))
- "bno$pack$hint_not_taken"
- (+ pack ICC_nev (ICCi_2-null) OP_06 hint_not_taken (label16-null))
- (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-i b eq OP_06 Ieq "integer branch equal")
- (conditional-branch-i b ne OP_06 Ine "integer branch not equal")
- (conditional-branch-i b le OP_06 Ile "integer branch less or equal")
- (conditional-branch-i b gt OP_06 Igt "integer branch greater")
- (conditional-branch-i b lt OP_06 Ilt "integer branch less")
- (conditional-branch-i b ge OP_06 Ige "integer branch greater or equal")
- (conditional-branch-i b ls OP_06 Ils "integer branch less or equal unsigned")
- (conditional-branch-i b hi OP_06 Ihi "integer branch greater unsigned")
- (conditional-branch-i b c OP_06 Ic "integer branch carry set")
- (conditional-branch-i b nc OP_06 Inc "integer branch carry clear")
- (conditional-branch-i b n OP_06 In "integer branch negative")
- (conditional-branch-i b p OP_06 Ip "integer branch positive")
- (conditional-branch-i b v OP_06 Iv "integer branch overflow set")
- (conditional-branch-i b nv OP_06 Inv "integer branch overflow clear")
- (define-pmacro (conditional-branch-f prefix cc op cond comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
- (.str (.sym prefix cc) "$pack $FCCi_2,$hint,$label16")
- (+ pack (.sym FCC_ cc) FCCi_2 op hint label16)
- (sequence ()
- (c-call VOID "@cpu@_model_branch" label16 hint)
- (if (cond FCCi_2) (set pc label16)))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- )
- (dni fbra
- "float branch equal"
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
- "fbra$pack $hint_taken$label16"
- (+ pack FCC_ra (FCCi_2-null) OP_07 hint_taken label16)
- (sequence ()
- (c-call VOID "@cpu@_model_branch" label16 hint_taken)
- (set pc label16))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni fbno
- "float branch never"
- ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
- (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
- "fbno$pack$hint_not_taken"
- (+ pack FCC_nev (FCCi_2-null) OP_07 hint_not_taken (label16-null))
- (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-f fb ne OP_07 Fne "float branch not equal")
- (conditional-branch-f fb eq OP_07 Feq "float branch equal")
- (conditional-branch-f fb lg OP_07 Flg "float branch less or greater")
- (conditional-branch-f fb ue OP_07 Fue "float branch unordered or equal")
- (conditional-branch-f fb ul OP_07 Ful "float branch unordered or less")
- (conditional-branch-f fb ge OP_07 Fge "float branch greater or equal")
- (conditional-branch-f fb lt OP_07 Flt "float branch less")
- (conditional-branch-f fb uge OP_07 Fuge "float branch unordered, greater,equal")
- (conditional-branch-f fb ug OP_07 Fug "float branch unordered or greater")
- (conditional-branch-f fb le OP_07 Fle "float branch less or equal")
- (conditional-branch-f fb gt OP_07 Fgt "float branch greater")
- (conditional-branch-f fb ule OP_07 Fule "float branch unordered, less or equal")
- (conditional-branch-f fb u OP_07 Fu "float branch unordered")
- (conditional-branch-f fb o OP_07 Fo "float branch ordered")
- (define-pmacro (ctrlr-branch-semantics cond ccond)
- (sequence ((SI tmp))
- (set tmp (sub (spr-lcr) 1))
- (set (spr-lcr) tmp)
- (if cond
- (if (eq ccond 0)
- (if (ne tmp 0)
- (set pc (spr-lr)))
- (if (eq tmp 0)
- (set pc (spr-lr))))))
- )
- (dni bctrlr
- "LCR conditional branch to lr"
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2))
- ("bctrlr$pack $ccond,$hint")
- (+ pack (cond-null) (ICCi_2-null) OP_0E hint OPE3_01 ccond (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
- (ctrlr-branch-semantics (const BI 1) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (define-pmacro (conditional-branch-cclr prefix cc i-f op ope cond attr comment)
- (dni (.sym prefix cc lr)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3) attr)
- (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$hint")
- (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope
- (ccond-null) (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
- (if (cond (.sym i-f CCi_2)) (set pc (spr-lr))))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- )
- (dni bralr
- "integer cclr branch always"
- ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3))
- "bralr$pack$hint_taken"
- (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_02 (ccond-null) (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
- (set pc (spr-lr)))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni bnolr
- "integer cclr branch never"
- ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3))
- "bnolr$pack$hint_not_taken"
- (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_02 (ccond-null) (s12-null))
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-cclr b eq I OP_0E OPE3_02 Ieq NA "integer cclr branch equal")
- (conditional-branch-cclr b ne I OP_0E OPE3_02 Ine NA "integer cclr branch not equal")
- (conditional-branch-cclr b le I OP_0E OPE3_02 Ile NA "integer cclr branch less or equal")
- (conditional-branch-cclr b gt I OP_0E OPE3_02 Igt NA "integer cclr branch greater")
- (conditional-branch-cclr b lt I OP_0E OPE3_02 Ilt NA "integer cclr branch less")
- (conditional-branch-cclr b ge I OP_0E OPE3_02 Ige NA "integer cclr branch greater or equal")
- (conditional-branch-cclr b ls I OP_0E OPE3_02 Ils NA "integer cclr branch less or equal unsigned")
- (conditional-branch-cclr b hi I OP_0E OPE3_02 Ihi NA "integer cclr branch greater unsigned")
- (conditional-branch-cclr b c I OP_0E OPE3_02 Ic NA "integer cclr branch carry set")
- (conditional-branch-cclr b nc I OP_0E OPE3_02 Inc NA "integer cclr branch carry clear")
- (conditional-branch-cclr b n I OP_0E OPE3_02 In NA "integer cclr branch negative")
- (conditional-branch-cclr b p I OP_0E OPE3_02 Ip NA "integer cclr branch positive")
- (conditional-branch-cclr b v I OP_0E OPE3_02 Iv NA "integer cclr branch overflow set")
- (conditional-branch-cclr b nv I OP_0E OPE3_02 Inv NA "integer cclr branch overflow clear")
- (dni fbralr
- "float cclr branch always"
- ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
- "fbralr$pack$hint_taken"
- (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_06 (ccond-null) (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
- (set pc (spr-lr)))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni fbnolr
- "float cclr branch never"
- ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
- "fbnolr$pack$hint_not_taken"
- (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_06 (ccond-null) (s12-null))
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-cclr fb eq F OP_0E OPE3_06 Feq FR-ACCESS "float cclr branch equal")
- (conditional-branch-cclr fb ne F OP_0E OPE3_06 Fne FR-ACCESS "float cclr branch not equal")
- (conditional-branch-cclr fb lg F OP_0E OPE3_06 Flg FR-ACCESS "float branch less or greater")
- (conditional-branch-cclr fb ue F OP_0E OPE3_06 Fue FR-ACCESS "float branch unordered or equal")
- (conditional-branch-cclr fb ul F OP_0E OPE3_06 Ful FR-ACCESS "float branch unordered or less")
- (conditional-branch-cclr fb ge F OP_0E OPE3_06 Fge FR-ACCESS "float branch greater or equal")
- (conditional-branch-cclr fb lt F OP_0E OPE3_06 Flt FR-ACCESS "float branch less")
- (conditional-branch-cclr fb uge F OP_0E OPE3_06 Fuge FR-ACCESS "float branch unordered, greater, equal")
- (conditional-branch-cclr fb ug F OP_0E OPE3_06 Fug FR-ACCESS "float branch unordered or greater")
- (conditional-branch-cclr fb le F OP_0E OPE3_06 Fle FR-ACCESS "float branch less or equal")
- (conditional-branch-cclr fb gt F OP_0E OPE3_06 Fgt FR-ACCESS "float branch greater")
- (conditional-branch-cclr fb ule F OP_0E OPE3_06 Fule FR-ACCESS "float branch unordered, less or equal")
- (conditional-branch-cclr fb u F OP_0E OPE3_06 Fu FR-ACCESS "float branch unordered")
- (conditional-branch-cclr fb o F OP_0E OPE3_06 Fo FR-ACCESS "float branch ordered")
- (define-pmacro (conditional-branch-ctrlr prefix cc i-f op ope cond attr comment)
- (dni (.sym prefix cc lr)
- (comment)
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2) attr)
- (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$ccond,$hint")
- (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope ccond (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
- (ctrlr-branch-semantics (cond (.sym i-f CCi_2)) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- )
- (dni bcralr
- "integer ctrlr branch always"
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2))
- "bcralr$pack $ccond$hint_taken"
- (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_03 ccond (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
- (ctrlr-branch-semantics (const BI 1) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni bcnolr
- "integer ctrlr branch never"
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2))
- "bcnolr$pack$hint_not_taken"
- (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_03 (ccond-null) (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
- (ctrlr-branch-semantics (const BI 0) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-ctrlr bc eq I OP_0E OPE3_03 Ieq NA "integer ctrlr branch equal")
- (conditional-branch-ctrlr bc ne I OP_0E OPE3_03 Ine NA "integer ctrlr branch not equal")
- (conditional-branch-ctrlr bc le I OP_0E OPE3_03 Ile NA "integer ctrlr branch less equal")
- (conditional-branch-ctrlr bc gt I OP_0E OPE3_03 Igt NA "integer ctrlr branch greater")
- (conditional-branch-ctrlr bc lt I OP_0E OPE3_03 Ilt NA "integer ctrlr branch less")
- (conditional-branch-ctrlr bc ge I OP_0E OPE3_03 Ige NA "integer ctrlr branch greater equal")
- (conditional-branch-ctrlr bc ls I OP_0E OPE3_03 Ils NA "integer ctrlr branch less equal unsigned")
- (conditional-branch-ctrlr bc hi I OP_0E OPE3_03 Ihi NA "integer ctrlr branch greater unsigned")
- (conditional-branch-ctrlr bc c I OP_0E OPE3_03 Ic NA "integer ctrlr branch carry set")
- (conditional-branch-ctrlr bc nc I OP_0E OPE3_03 Inc NA "integer ctrlr branch carry clear")
- (conditional-branch-ctrlr bc n I OP_0E OPE3_03 In NA "integer ctrlr branch negative")
- (conditional-branch-ctrlr bc p I OP_0E OPE3_03 Ip NA "integer ctrlr branch positive")
- (conditional-branch-ctrlr bc v I OP_0E OPE3_03 Iv NA "integer ctrlr branch overflow set")
- (conditional-branch-ctrlr bc nv I OP_0E OPE3_03 Inv NA "integer ctrlr branch overflow clear")
- (dni fcbralr
- "float ctrlr branch always"
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
- "fcbralr$pack $ccond$hint_taken"
- (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_07 ccond (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
- (ctrlr-branch-semantics (const BI 1) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni fcbnolr
- "float ctrlr branch never"
- ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
- (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
- "fcbnolr$pack$hint_not_taken"
- (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_07 (ccond-null) (s12-null))
- (sequence ()
- (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
- (ctrlr-branch-semantics (const BI 0) ccond))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (conditional-branch-ctrlr fcb eq F OP_0E OPE3_07 Feq FR-ACCESS "float cclr branch equal")
- (conditional-branch-ctrlr fcb ne F OP_0E OPE3_07 Fne FR-ACCESS "float cclr branch not equal")
- (conditional-branch-ctrlr fcb lg F OP_0E OPE3_07 Flg FR-ACCESS "float branch less or greater")
- (conditional-branch-ctrlr fcb ue F OP_0E OPE3_07 Fue FR-ACCESS "float branch unordered or equal")
- (conditional-branch-ctrlr fcb ul F OP_0E OPE3_07 Ful FR-ACCESS "float branch unordered or less")
- (conditional-branch-ctrlr fcb ge F OP_0E OPE3_07 Fge FR-ACCESS "float branch greater or equal")
- (conditional-branch-ctrlr fcb lt F OP_0E OPE3_07 Flt FR-ACCESS "float branch less")
- (conditional-branch-ctrlr fcb uge F OP_0E OPE3_07 Fuge FR-ACCESS "float branch unordered, greater, equal")
- (conditional-branch-ctrlr fcb ug F OP_0E OPE3_07 Fug FR-ACCESS "float branch unordered or greater")
- (conditional-branch-ctrlr fcb le F OP_0E OPE3_07 Fle FR-ACCESS "float branch less or equal")
- (conditional-branch-ctrlr fcb gt F OP_0E OPE3_07 Fgt FR-ACCESS "float branch greater")
- (conditional-branch-ctrlr fcb ule F OP_0E OPE3_07 Fule FR-ACCESS "float branch unordered, less or equal")
- (conditional-branch-ctrlr fcb u F OP_0E OPE3_07 Fu FR-ACCESS "float branch unordered")
- (conditional-branch-ctrlr fcb o F OP_0E OPE3_07 Fo FR-ACCESS "float branch ordered")
- (define-pmacro (jump-and-link-semantics base offset LI)
- (sequence ()
- (if (eq LI 1)
- (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1))
- ; Target address gets aligned here
- (set pc (and (add base offset) #xfffffffc))
- (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
- )
- (dni jmpl
- "jump and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5))
- "jmpl$pack @($GRi,$GRj)"
- (+ pack (misc-null-1) (LI-off) OP_0C GRi (misc-null-2) GRj)
- (jump-and-link-semantics GRi GRj LI)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dann callann "call annotation" SI "call_annotation" "at")
- (dni calll
- "call and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5))
- "calll$pack $callann($GRi,$GRj)"
- (+ pack (misc-null-1) (LI-on) OP_0C GRi (misc-null-2) GRj)
- (jump-and-link-semantics GRi GRj LI)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni jmpil
- "jump immediate and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5))
- "jmpil$pack @($GRi,$s12)"
- (+ pack (misc-null-1) (LI-off) OP_0D GRi s12)
- (jump-and-link-semantics GRi s12 LI)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni callil
- "call immediate and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5))
- "callil$pack @($GRi,$s12)"
- (+ pack (misc-null-1) (LI-on) OP_0D GRi s12)
- (jump-and-link-semantics GRi s12 LI)
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni call
- "call and link"
- ((UNIT B0) (FR500-MAJOR B-4) (FR550-MAJOR B-4)
- (FR400-MAJOR B-4) (FR450-MAJOR B-4))
- "call$pack $label24"
- (+ pack OP_0F label24)
- (sequence ()
- (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1)
- (set pc label24)
- (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni rett
- "return from trap"
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2) PRIVILEGED)
- "rett$pack $debug"
- (+ pack (misc-null-1) debug OP_05 (rs-null) (s12-null))
- ; frv_rett handles operating vs user mode
- (sequence ()
- (set pc (c-call UWI "frv_rett" pc debug))
- (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
- ()
- )
- (dni rei
- "run exception instruction"
- ((UNIT C) (FR500-MAJOR C-1) (MACH frv) PRIVILEGED)
- "rei$pack $eir"
- (+ pack (rd-null) OP_37 eir (s12-null))
- (nop) ; for now
- ()
- )
- (define-pmacro (trap-semantics cond base offset)
- (if cond
- (sequence ()
- ; This is defered to frv_itrap because for the breakpoint
- ; case we want to change as little of the machine state as
- ; possible.
- ;
- ; PCSR=PC
- ; PSR.PS=PSR.S
- ; PSR.ET=0
- ; if PSR.ESR==1
- ; SR0 through SR3=GR4 through GR7
- ; TBR.TT=0x80 + ((GRi + s12) & 0x7f)
- ; PC=TBR
- ; We still should indicate what is modified by this insn.
- (clobber (spr-pcsr))
- (clobber psr_ps)
- (clobber psr_et)
- (clobber tbr_tt)
- (if (ne psr_esr (const 0))
- (sequence ()
- (clobber (spr-sr0))
- (clobber (spr-sr1))
- (clobber (spr-sr2))
- (clobber (spr-sr3))))
- ; frv_itrap handles operating vs user mode
- (c-call VOID "frv_itrap" pc base offset)))
- )
- (define-pmacro (trap-r prefix cc i-f op ope cond attr comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
- (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$GRj")
- (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi (misc-null-3) ope GRj)
- (trap-semantics (cond (.sym i-f CCi_2)) GRi GRj)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- )
- (dni tra
- "integer trap always"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1))
- "tra$pack $GRi,$GRj"
- (+ pack ICC_ra (ICCi_2-null) OP_04 GRi (misc-null-3) OPE4_0 GRj)
- (trap-semantics (const BI 1) GRi GRj)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (dni tno
- "integer trap never"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1))
- "tno$pack"
- (+ pack ICC_nev (ICCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_0 (GRj-null))
- (trap-semantics (const BI 0) GRi GRj)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (trap-r t eq I OP_04 OPE4_0 Ieq NA "integer trap equal")
- (trap-r t ne I OP_04 OPE4_0 Ine NA "integer trap not equal")
- (trap-r t le I OP_04 OPE4_0 Ile NA "integer trap less or equal")
- (trap-r t gt I OP_04 OPE4_0 Igt NA "integer trap greater")
- (trap-r t lt I OP_04 OPE4_0 Ilt NA "integer trap less")
- (trap-r t ge I OP_04 OPE4_0 Ige NA "integer trap greater or equal")
- (trap-r t ls I OP_04 OPE4_0 Ils NA "integer trap less or equal unsigned")
- (trap-r t hi I OP_04 OPE4_0 Ihi NA "integer trap greater unsigned")
- (trap-r t c I OP_04 OPE4_0 Ic NA "integer trap carry set")
- (trap-r t nc I OP_04 OPE4_0 Inc NA "integer trap carry clear")
- (trap-r t n I OP_04 OPE4_0 In NA "integer trap negative")
- (trap-r t p I OP_04 OPE4_0 Ip NA "integer trap positive")
- (trap-r t v I OP_04 OPE4_0 Iv NA "integer trap overflow set")
- (trap-r t nv I OP_04 OPE4_0 Inv NA "integer trap overflow clear")
- (dni ftra
- "float trap always"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
- "ftra$pack $GRi,$GRj"
- (+ pack FCC_ra (FCCi_2-null) OP_04 GRi (misc-null-3) OPE4_1 GRj)
- (trap-semantics (const BI 1) GRi GRj)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (dni ftno
- "flost trap never"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
- "ftno$pack"
- (+ pack FCC_nev (FCCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_1 (GRj-null))
- (trap-semantics (const BI 0) GRi GRj)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (trap-r ft ne F OP_04 OPE4_1 Fne FR-ACCESS "float trap not equal")
- (trap-r ft eq F OP_04 OPE4_1 Feq FR-ACCESS "float trap equal")
- (trap-r ft lg F OP_04 OPE4_1 Flg FR-ACCESS "float trap greater or less")
- (trap-r ft ue F OP_04 OPE4_1 Fue FR-ACCESS "float trap unordered or equal")
- (trap-r ft ul F OP_04 OPE4_1 Ful FR-ACCESS "float trap unordered or less")
- (trap-r ft ge F OP_04 OPE4_1 Fge FR-ACCESS "float trap greater or equal")
- (trap-r ft lt F OP_04 OPE4_1 Flt FR-ACCESS "float trap less")
- (trap-r ft uge F OP_04 OPE4_1 Fuge FR-ACCESS "float trap unordered greater or equal")
- (trap-r ft ug F OP_04 OPE4_1 Fug FR-ACCESS "float trap unordered or greater")
- (trap-r ft le F OP_04 OPE4_1 Fle FR-ACCESS "float trap less or equal")
- (trap-r ft gt F OP_04 OPE4_1 Fgt FR-ACCESS "float trap greater")
- (trap-r ft ule F OP_04 OPE4_1 Fule FR-ACCESS "float trap unordered less or equal")
- (trap-r ft u F OP_04 OPE4_1 Fu FR-ACCESS "float trap unordered")
- (trap-r ft o F OP_04 OPE4_1 Fo FR-ACCESS "float trap ordered")
- (define-pmacro (trap-immed prefix cc i-f op cond attr comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
- (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$s12")
- (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi s12)
- (trap-semantics (cond (.sym i-f CCi_2)) GRi s12)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- )
- (dni tira
- "integer trap always"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1))
- "tira$pack $GRi,$s12"
- (+ pack ICC_ra (ICCi_2-null) OP_1C GRi s12)
- (trap-semantics (const BI 1) GRi s12)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (dni tino
- "integer trap never"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1))
- "tino$pack"
- (+ pack ICC_nev (ICCi_2-null) OP_1C (GRi-null) (s12-null))
- (trap-semantics (const BI 0) GRi s12)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (trap-immed ti eq I OP_1C Ieq NA "integer trap equal")
- (trap-immed ti ne I OP_1C Ine NA "integer trap not equal")
- (trap-immed ti le I OP_1C Ile NA "integer trap less or equal")
- (trap-immed ti gt I OP_1C Igt NA "integer trap greater")
- (trap-immed ti lt I OP_1C Ilt NA "integer trap less")
- (trap-immed ti ge I OP_1C Ige NA "integer trap greater or equal")
- (trap-immed ti ls I OP_1C Ils NA "integer trap less or equal unsigned")
- (trap-immed ti hi I OP_1C Ihi NA "integer trap greater unsigned")
- (trap-immed ti c I OP_1C Ic NA "integer trap carry set")
- (trap-immed ti nc I OP_1C Inc NA "integer trap carry clear")
- (trap-immed ti n I OP_1C In NA "integer trap negative")
- (trap-immed ti p I OP_1C Ip NA "integer trap positive")
- (trap-immed ti v I OP_1C Iv NA "integer trap overflow set")
- (trap-immed ti nv I OP_1C Inv NA "integer trap overflow clear")
- (dni ftira
- "float trap always"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
- "ftira$pack $GRi,$s12"
- (+ pack FCC_ra (ICCi_2-null) OP_1D GRi s12)
- (trap-semantics (const BI 1) GRi s12)
- ((fr400 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (dni ftino
- "float trap never"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
- "ftino$pack"
- (+ pack FCC_nev (FCCi_2-null) OP_1D (GRi-null) (s12-null))
- (trap-semantics (const BI 0) GRi s12)
- ((fr400 (unit u-trap)) (fr450 (unit u-trap))
- (fr500 (unit u-trap)) (fr550 (unit u-trap)))
- )
- (trap-immed fti ne F OP_1D Fne FR-ACCESS "float trap not equal")
- (trap-immed fti eq F OP_1D Feq FR-ACCESS "float trap equal")
- (trap-immed fti lg F OP_1D Flg FR-ACCESS "float trap greater or less")
- (trap-immed fti ue F OP_1D Fue FR-ACCESS "float trap unordered or equal")
- (trap-immed fti ul F OP_1D Ful FR-ACCESS "float trap unordered or less")
- (trap-immed fti ge F OP_1D Fge FR-ACCESS "float trap greater or equal")
- (trap-immed fti lt F OP_1D Flt FR-ACCESS "float trap less")
- (trap-immed fti uge F OP_1D Fuge FR-ACCESS "float trap unordered greater or equal")
- (trap-immed fti ug F OP_1D Fug FR-ACCESS "float trap unordered or greater")
- (trap-immed fti le F OP_1D Fle FR-ACCESS "float trap less or equal")
- (trap-immed fti gt F OP_1D Fgt FR-ACCESS "float trap greater")
- (trap-immed fti ule F OP_1D Fule FR-ACCESS "float trap unordered less or equal")
- (trap-immed fti u F OP_1D Fu FR-ACCESS "float trap unordered")
- (trap-immed fti o F OP_1D Fo FR-ACCESS "float trap ordered")
- (dni break
- "break trap"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1))
- "break$pack"
- (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_3 (GRj-null))
- (sequence ()
- ; This is defered to frv_break because for the breakpoint
- ; case we want to change as little of the machine state as
- ; possible.
- ;
- ; BPCSR=PC
- ; BPSR.BS=PSR.S
- ; BPSR.BET=PSR.ET
- ; PSR.S=1
- ; PSR.ET=0
- ; TBR.TT=0xff
- ; PC=TBR
- ; We still should indicate what is modified by this insn.
- (clobber (spr-bpcsr))
- (clobber bpsr_bs)
- (clobber bpsr_bet)
- (clobber psr_s)
- (clobber psr_et)
- (clobber tbr_tt)
- (c-call VOID "frv_break"))
- ()
- )
- (dni mtrap
- "media trap"
- ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
- (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
- "mtrap$pack"
- (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_2 (GRj-null))
- (c-call VOID "frv_mtrap")
- ()
- )
- (define-pmacro (condition-code-logic name operation ope comment)
- (dni name
- (comment)
- ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
- (FR400-MAJOR B-6) (FR450-MAJOR B-6))
- (.str name "$pack $CRi,$CRj,$CRk")
- (+ pack (misc-null-6) CRk OP_0A (misc-null-7) CRi ope (misc-null-8) CRj)
- (set CRk (c-call UQI "@cpu@_cr_logic" operation CRi CRj))
- ()
- )
- )
- (define-pmacro (op-andcr) 0)
- (define-pmacro (op-orcr) 1)
- (define-pmacro (op-xorcr) 2)
- (define-pmacro (op-nandcr) 3)
- (define-pmacro (op-norcr) 4)
- (define-pmacro (op-andncr) 5)
- (define-pmacro (op-orncr) 6)
- (define-pmacro (op-nandncr) 7)
- (define-pmacro (op-norncr) 8)
- (define-pmacro (cr-true) 3)
- (define-pmacro (cr-false) 2)
- (define-pmacro (cr-undefined) 0)
- (condition-code-logic andcr (op-andcr) OPE1_08 "and condition code regs")
- (condition-code-logic orcr (op-orcr) OPE1_09 "or condition code regs")
- (condition-code-logic xorcr (op-xorcr) OPE1_0A "xor condition code regs")
- (condition-code-logic nandcr (op-nandcr) OPE1_0C "nand condition code regs")
- (condition-code-logic norcr (op-norcr) OPE1_0D "nor condition code regs")
- (condition-code-logic andncr (op-andncr) OPE1_10 "andn condition code regs")
- (condition-code-logic orncr (op-orncr) OPE1_11 "orn condition code regs")
- (condition-code-logic nandncr (op-nandncr) OPE1_14 "nandn condition code regs")
- (condition-code-logic norncr (op-norncr) OPE1_15 "norn condition code regs")
- (dni notcr
- ("not cccr register")
- ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
- (FR400-MAJOR B-6) (FR450-MAJOR B-6))
- (.str notcr "$pack $CRj,$CRk")
- (+ pack (misc-null-6) CRk OP_0A (rs-null) OPE1_0B (misc-null-8) CRj)
- (set CRk (xor CRj 1))
- ()
- )
- (define-pmacro (check-semantics cond cr)
- (if cond (set cr (cr-true)) (set cr (cr-false)))
- )
- (define-pmacro (check-int-condition-code prefix cc op cond comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5))
- (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int")
- (+ pack (.sym ICC_ cc) CRj_int op (misc-null-5) ICCi_3)
- (check-semantics (cond ICCi_3) CRj_int)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- )
- (dni ckra
- "check integer cc always"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5))
- "ckra$pack $CRj_int"
- (+ pack ICC_ra CRj_int OP_08 (misc-null-5) (ICCi_3-null))
- (check-semantics (const BI 1) CRj_int)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (dni ckno
- "check integer cc never"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5))
- "ckno$pack $CRj_int"
- (+ pack ICC_nev CRj_int OP_08 (misc-null-5) (ICCi_3-null))
- (check-semantics (const BI 0) CRj_int)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (check-int-condition-code ck eq OP_08 Ieq "check integer cc equal")
- (check-int-condition-code ck ne OP_08 Ine "check integer cc not equal")
- (check-int-condition-code ck le OP_08 Ile "check integer cc less or equal")
- (check-int-condition-code ck gt OP_08 Igt "check integer cc greater")
- (check-int-condition-code ck lt OP_08 Ilt "check integer cc less")
- (check-int-condition-code ck ge OP_08 Ige "check integer cc greater or equal")
- (check-int-condition-code ck ls OP_08 Ils "check integer cc less or equal unsigned")
- (check-int-condition-code ck hi OP_08 Ihi "check integer cc greater unsigned")
- (check-int-condition-code ck c OP_08 Ic "check integer cc carry set")
- (check-int-condition-code ck nc OP_08 Inc "check integer cc carry clear")
- (check-int-condition-code ck n OP_08 In "check integer cc negative")
- (check-int-condition-code ck p OP_08 Ip "check integer cc positive")
- (check-int-condition-code ck v OP_08 Iv "check integer cc overflow set")
- (check-int-condition-code ck nv OP_08 Inv "check integer cc overflow clear")
- (define-pmacro (check-float-condition-code prefix cc op cond comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
- (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float")
- (+ pack (.sym FCC_ cc) CRj_float op (misc-null-5) FCCi_3)
- (check-semantics (cond FCCi_3) CRj_float)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- )
- (dni fckra
- "check float cc always"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
- "fckra$pack $CRj_float"
- (+ pack FCC_ra CRj_float OP_09 (misc-null-5) FCCi_3)
- (check-semantics (const BI 1) CRj_float)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (dni fckno
- "check float cc never"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
- "fckno$pack $CRj_float"
- (+ pack FCC_nev CRj_float OP_09 (misc-null-5) FCCi_3)
- (check-semantics (const BI 0) CRj_float)
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (check-float-condition-code fck ne OP_09 Fne "check float cc not equal")
- (check-float-condition-code fck eq OP_09 Feq "check float cc equal")
- (check-float-condition-code fck lg OP_09 Flg "check float cc greater or less")
- (check-float-condition-code fck ue OP_09 Fue "check float cc unordered or equal")
- (check-float-condition-code fck ul OP_09 Ful "check float cc unordered or less")
- (check-float-condition-code fck ge OP_09 Fge "check float cc greater or equal")
- (check-float-condition-code fck lt OP_09 Flt "check float cc less")
- (check-float-condition-code fck uge OP_09 Fuge "check float cc unordered greater or equal")
- (check-float-condition-code fck ug OP_09 Fug "check float cc unordered or greater")
- (check-float-condition-code fck le OP_09 Fle "check float cc less or equal")
- (check-float-condition-code fck gt OP_09 Fgt "check float cc greater")
- (check-float-condition-code fck ule OP_09 Fule "check float cc unordered less or equal")
- (check-float-condition-code fck u OP_09 Fu "check float cc unordered")
- (check-float-condition-code fck o OP_09 Fo "check float cc ordered")
- (define-pmacro (conditional-check-int-condition-code prefix cc op ope test comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
- (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int,$CCi,$cond")
- (+ pack (.sym ICC_ cc) CRj_int op (rs-null) CCi cond ope
- (misc-null-9) ICCi_3)
- (if (eq CCi (or cond 2))
- (check-semantics (test ICCi_3) CRj_int)
- (set CRj_int (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- )
- (dni cckra
- "conditional check integer cc always"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
- "cckra$pack $CRj_int,$CCi,$cond"
- (+ pack ICC_ra CRj_int OP_6A (rs-null) CCi cond OPE4_0
- (misc-null-9) (ICCi_3-null))
- (if (eq CCi (or cond 2))
- (check-semantics (const BI 1) CRj_int)
- (set CRj_int (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (dni cckno
- "conditional check integer cc never"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
- "cckno$pack $CRj_int,$CCi,$cond"
- (+ pack ICC_nev CRj_int OP_6A (rs-null) CCi cond OPE4_0
- (misc-null-9) (ICCi_3-null))
- (if (eq CCi (or cond 2))
- (check-semantics (const BI 0) CRj_int)
- (set CRj_int (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (conditional-check-int-condition-code cck eq OP_6A OPE4_0 Ieq "check integer cc equal")
- (conditional-check-int-condition-code cck ne OP_6A OPE4_0 Ine "check integer cc not equal")
- (conditional-check-int-condition-code cck le OP_6A OPE4_0 Ile "check integer cc less or equal")
- (conditional-check-int-condition-code cck gt OP_6A OPE4_0 Igt "check integer cc greater")
- (conditional-check-int-condition-code cck lt OP_6A OPE4_0 Ilt "check integer cc less")
- (conditional-check-int-condition-code cck ge OP_6A OPE4_0 Ige "check integer cc greater or equal")
- (conditional-check-int-condition-code cck ls OP_6A OPE4_0 Ils "check integer cc less or equal unsigned")
- (conditional-check-int-condition-code cck hi OP_6A OPE4_0 Ihi "check integer cc greater unsigned")
- (conditional-check-int-condition-code cck c OP_6A OPE4_0 Ic "check integer cc carry set")
- (conditional-check-int-condition-code cck nc OP_6A OPE4_0 Inc "check integer cc carry clear")
- (conditional-check-int-condition-code cck n OP_6A OPE4_0 In "check integer cc negative")
- (conditional-check-int-condition-code cck p OP_6A OPE4_0 Ip "check integer cc positive")
- (conditional-check-int-condition-code cck v OP_6A OPE4_0 Iv "check integer cc overflow set")
- (conditional-check-int-condition-code cck nv OP_6A OPE4_0 Inv "check integer cc overflow clear")
- (define-pmacro (conditional-check-float-condition-code prefix cc op ope test comment)
- (dni (.sym prefix cc)
- (comment)
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
- (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float,$CCi,$cond")
- (+ pack (.sym FCC_ cc) CRj_float op (rs-null) CCi cond ope
- (misc-null-9) FCCi_3)
- (if (eq CCi (or cond 2))
- (check-semantics (test FCCi_3) CRj_float)
- (set CRj_float (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- )
- (dni cfckra
- "conditional check float cc always"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
- "cfckra$pack $CRj_float,$CCi,$cond"
- (+ pack FCC_ra CRj_float OP_6A (rs-null) CCi cond OPE4_1
- (misc-null-9) (FCCi_3-null))
- (if (eq CCi (or cond 2))
- (check-semantics (const BI 1) CRj_float)
- (set CRj_float (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (dni cfckno
- "conditional check float cc never"
- ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
- (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
- "cfckno$pack $CRj_float,$CCi,$cond"
- (+ pack FCC_nev CRj_float OP_6A (rs-null) CCi cond OPE4_1
- (misc-null-9) (FCCi_3-null))
- (if (eq CCi (or cond 2))
- (check-semantics (const BI 0) CRj_float)
- (set CRj_float (cr-undefined)))
- ((fr400 (unit u-check)) (fr450 (unit u-check))
- (fr500 (unit u-check)) (fr550 (unit u-check)))
- )
- (conditional-check-float-condition-code cfck ne OP_6A OPE4_1 Fne "check float cc not equal")
- (conditional-check-float-condition-code cfck eq OP_6A OPE4_1 Feq "check float cc equal")
- (conditional-check-float-condition-code cfck lg OP_6A OPE4_1 Flg "check float cc greater or less")
- (conditional-check-float-condition-code cfck ue OP_6A OPE4_1 Fue "check float cc unordered or equal")
- (conditional-check-float-condition-code cfck ul OP_6A OPE4_1 Ful "check float cc unordered or less")
- (conditional-check-float-condition-code cfck ge OP_6A OPE4_1 Fge "check float cc greater or equal")
- (conditional-check-float-condition-code cfck lt OP_6A OPE4_1 Flt "check float cc less")
- (conditional-check-float-condition-code cfck uge OP_6A OPE4_1 Fuge "check float cc unordered greater or equal")
- (conditional-check-float-condition-code cfck ug OP_6A OPE4_1 Fug "check float cc unordered or greater")
- (conditional-check-float-condition-code cfck le OP_6A OPE4_1 Fle "check float cc less or equal")
- (conditional-check-float-condition-code cfck gt OP_6A OPE4_1 Fgt "check float cc greater")
- (conditional-check-float-condition-code cfck ule OP_6A OPE4_1 Fule "check float cc unordered less or equal")
- (conditional-check-float-condition-code cfck u OP_6A OPE4_1 Fu "check float cc unordered")
- (conditional-check-float-condition-code cfck o OP_6A OPE4_1 Fo "check float cc ordered")
- (dni cjmpl
- "conditional jump and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
- "cjmpl$pack @($GRi,$GRj),$CCi,$cond"
- (+ pack (misc-null-1) (LI-off) OP_6A GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (jump-and-link-semantics GRi GRj LI))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (dni ccalll
- "conditional call and link"
- ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
- (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
- "ccalll$pack @($GRi,$GRj),$CCi,$cond"
- (+ pack (misc-null-1) (LI-on) OP_6A GRi CCi cond OPE4_2 GRj)
- (if (eq CCi (or cond 2))
- (jump-and-link-semantics GRi GRj LI))
- ((fr400 (unit u-branch)) (fr450 (unit u-branch))
- (fr500 (unit u-branch)) (fr550 (unit u-branch)))
- )
- (define-pmacro (cache-invalidate name cache all op ope profile comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- (.str name "$pack @($GRi,$GRj)")
- (+ pack (rd-null) op GRi ope GRj)
- (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) all)
- profile
- )
- )
- (cache-invalidate ici insn 0 OP_03 OPE1_38
- ((fr400 (unit u-ici)) (fr450 (unit u-ici))
- (fr500 (unit u-ici)) (fr550 (unit u-ici)))
- "invalidate insn cache")
- (cache-invalidate dci data 0 OP_03 OPE1_3C
- ((fr400 (unit u-dci)) (fr450 (unit u-dci))
- (fr500 (unit u-dci)) (fr550 (unit u-dci)))
- "invalidate data cache")
- (define-pmacro (cache-invalidate-entry name cache op ope profile comment)
- (dni name
- (comment)
- ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- (.str name "$pack @($GRi,$GRj),$ae")
- (+ pack (misc-null-1) ae op GRi ope GRj)
- (if (eq ae 0)
- (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) -1) ; Invalid ae setting for this insn
- (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) ae))
- profile
- )
- )
- (cache-invalidate-entry icei insn OP_03 OPE1_39
- ((fr400 (unit u-ici)) (fr450 (unit u-ici))
- (fr550 (unit u-ici)))
- "invalidate insn cache entry")
- (cache-invalidate-entry dcei data OP_03 OPE1_3A
- ((fr400 (unit u-dci)) (fr450 (unit u-dci))
- (fr550 (unit u-dci)))
- "invalidate data cache entry")
- (dni dcf
- "Data cache flush"
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- "dcf$pack @($GRi,$GRj)"
- (+ pack (rd-null) OP_03 GRi OPE1_3D GRj)
- (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) 0)
- ((fr400 (unit u-dcf)) (fr450 (unit u-dcf))
- (fr500 (unit u-dcf)) (fr550 (unit u-dcf)))
- )
- (dni dcef
- "Data cache entry flush"
- ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- "dcef$pack @($GRi,$GRj),$ae"
- (+ pack (misc-null-1) ae OP_03 GRi OPE1_3B GRj)
- (if (eq ae 0)
- (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) -1)
- (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) ae))
- ((fr400 (unit u-dcf)) (fr450 (unit u-dcf)) (fr550 (unit u-dcf)))
- )
- (define-pmacro (write-TLB name insn op ope comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
- (.str insn "$pack $GRk,@($GRi,$GRj)")
- (+ pack GRk op GRi ope GRj)
- (nop) ; for now
- ()
- )
- )
- (write-TLB witlb witlb OP_03 OPE1_32 "write for insn TLB")
- (write-TLB wdtlb wdtlb OP_03 OPE1_36 "write for data TLB")
- (define-pmacro (invalidate-TLB name insn op ope comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
- (.str insn "$pack @($GRi,$GRj)")
- (+ pack (rd-null) op GRi ope GRj)
- (nop) ; for now
- ()
- )
- )
- (invalidate-TLB itlbi itlbi OP_03 OPE1_33 "invalidate insn TLB")
- (invalidate-TLB dtlbi dtlbi OP_03 OPE1_37 "invalidate data TLB")
- (define-pmacro (cache-preload name cache pipe attrs op ope profile comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) (FR500-MAJOR C-2)
- (FR400-MAJOR C-2) (.unsplice attrs))
- (.str name "$pack $GRi,$GRj,$lock")
- (+ pack (misc-null-1) lock op GRi ope GRj)
- (c-call VOID (.str "@cpu@_" cache "_cache_preload") GRi GRj lock)
- profile
- )
- )
- (cache-preload icpl insn C ((FR550-MAJOR C-2) (FR450-MAJOR C-2)) OP_03 OPE1_30
- ((fr400 (unit u-icpl)) (fr450 (unit u-icpl))
- (fr500 (unit u-icpl)) (fr550 (unit u-icpl)))
- "preload insn cache")
- (cache-preload dcpl data DCPL ((FR550-MAJOR I-8) (FR450-MAJOR I-2)) OP_03 OPE1_34
- ((fr400 (unit u-dcpl)) (fr450 (unit u-dcpl))
- (fr500 (unit u-dcpl)) (fr550 (unit u-dcpl)))
- "preload data cache")
- (define-pmacro (cache-unlock name cache op ope profile comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- (.str name "$pack $GRi")
- (+ pack (rd-null) op GRi ope (GRj-null))
- (c-call VOID (.str "@cpu@_" cache "_cache_unlock") GRi)
- profile
- )
- )
- (cache-unlock icul insn OP_03 OPE1_31
- ((fr400 (unit u-icul)) (fr450 (unit u-icul))
- (fr500 (unit u-icul)) (fr550 (unit u-icul)))
- "unlock insn cache")
- (cache-unlock dcul data OP_03 OPE1_35
- ((fr400 (unit u-dcul)) (fr450 (unit u-dcul))
- (fr500 (unit u-dcul)) (fr550 (unit u-dcul)))
- "unlock data cache")
- (define-pmacro (barrier name insn op ope profile comment)
- (dni name
- (comment)
- ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
- (FR400-MAJOR C-2) (FR450-MAJOR C-2))
- (.str insn "$pack")
- (+ pack (rd-null) op (rs-null) ope (GRj-null))
- (nop) ; sufficient implementation
- profile
- )
- )
- (barrier bar bar OP_03 OPE1_3E
- ((fr400 (unit u-barrier)) (fr450 (unit u-barrier))
- (fr500 (unit u-barrier)))
- "barrier")
- (barrier membar membar OP_03 OPE1_3F
- ((fr400 (unit u-membar)) (fr450 (unit u-membar))
- (fr500 (unit u-membar)))
- "memory barrier")
- ; Load real address instructions
- (define-pmacro (load-real-address name insn what op ope)
- (dni name
- (.str "Load real address of " what)
- ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
- (.str insn "$pack $GRi,$GRk,$LRAE,$LRAD,$LRAS")
- (+ pack GRk op GRi ope LRAE LRAD LRAS (LRA-null))
- (nop) ; not simulated
- ()
- )
- )
- (load-real-address lrai "lrai" "instruction" OP_03 OPE1_20)
- (load-real-address lrad "lrad" "data" OP_03 OPE1_21)
- (dni tlbpr
- "TLB Probe"
- ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
- "tlbpr$pack $GRi,$GRj,$TLBPRopx,$TLBPRL"
- (+ pack (TLBPR-null) TLBPRopx TLBPRL OP_03 GRi OPE1_24 GRj)
- (nop) ; not simulated
- ()
- )
- ; Coprocessor operations
- (define-pmacro (cop-op num op)
- (dni (.sym cop num)
- "Coprocessor operation"
- ((UNIT C) (FR500-MAJOR C-2) (MACH frv))
- (.str "cop" num "$pack $s6_1,$CPRi,$CPRj,$CPRk")
- (+ pack CPRk op CPRi s6_1 CPRj)
- (nop) ; sufficient implementation
- ()
- )
- )
- (cop-op 1 OP_7E)
- (cop-op 2 OP_7F)
- (define-pmacro (clear-ne-flag-semantics target_index is_float)
- (c-call VOID "@cpu@_clear_ne_flags" target_index is_float)
- )
- (define-pmacro (clear-ne-flag-r name op ope reg is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
- (.str name "$pack $" reg "k")
- (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
- (sequence ()
- ; hack to get this referenced for profiling
- (c-raw-call VOID "frv_ref_SI" (.sym reg k))
- (clear-ne-flag-semantics (index-of (.sym reg k)) is_float))
- profile
- )
- )
- (clear-ne-flag-r clrgr OP_0A OPE1_00 GR 0 NA
- ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
- "Clear GR NE flag")
- (clear-ne-flag-r clrfr OP_0A OPE1_02 FR 1 FR-ACCESS
- ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
- "Clear FR NE flag")
- (define-pmacro (clear-ne-flag-all name op ope is_float attr profile comment)
- (dni name
- (comment)
- ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
- (.str name "$pack")
- (+ pack (rd-null) op (rs-null) ope (GRj-null))
- (clear-ne-flag-semantics -1 is_float)
- profile
- )
- )
- (clear-ne-flag-all clrga OP_0A OPE1_01 0 NA
- ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
- "Clear GR NE flag ALL")
- (clear-ne-flag-all clrfa OP_0A OPE1_03 1 FR-ACCESS
- ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
- "Clear FR NE flag ALL")
- (define-pmacro (commit-semantics target_index is_float)
- (c-call VOID "@cpu@_commit" target_index is_float)
- )
- (define-pmacro (commit-r name op ope reg is_float attr comment)
- (dni name
- (comment)
- ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
- (.str name "$pack $" reg "k")
- (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
- (commit-semantics (index-of (.sym reg k)) is_float)
- ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
- )
- )
- (commit-r commitgr OP_0A OPE1_04 GR 0 NA "commit exceptions, specific GR")
- (commit-r commitfr OP_0A OPE1_06 FR 1 FR-ACCESS "commit exceptions, specific FR")
- (define-pmacro (commit name op ope is_float attr comment)
- (dni name
- (comment)
- ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
- (.str name "$pack")
- (+ pack (rd-null) op (rs-null) ope (GRj-null))
- (commit-semantics -1 is_float)
- ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
- )
- )
- (commit commitga OP_0A OPE1_05 0 NA "commit exceptions, any GR")
- (commit commitfa OP_0A OPE1_07 1 FR-ACCESS "commit exceptions, any FR")
- (define-pmacro (floating-point-conversion
- name op ope conv mode src targ attr comment)
- (dni name
- (comment)
- (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
- (.str name "$pack $" src ",$" targ)
- (+ pack targ op (rs-null) ope src)
- (set targ (conv mode FPCONV-DEFAULT src))
- ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
- )
- )
- (floating-point-conversion fitos OP_79 OPE1_00 float SF FRintj FRk
- ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "Convert Integer to Single")
- (floating-point-conversion fstoi OP_79 OPE1_01 fix SI FRj FRintk
- ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "Convert Single to Integer")
- (floating-point-conversion fitod OP_7A OPE1_00 float DF FRintj FRdoublek
- ((MACH frv))
- "Convert Integer to Double")
- (floating-point-conversion fdtoi OP_7A OPE1_01 fix SI FRdoublej FRintk
- ((MACH frv))
- "Convert Double to Integer")
- (define-pmacro (floating-point-dual-conversion
- name op ope conv mode src src_hw targ targ_hw attr comment)
- (dni name
- (comment)
- ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) attr)
- (.str name "$pack $" src ",$" targ)
- (+ pack targ op (rs-null) ope src)
- (sequence ()
- (set targ (conv mode FPCONV-DEFAULT src))
- (set (nextreg targ_hw targ 1)
- (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
- ((fr500 (unit u-float-dual-convert)))
- )
- )
- (floating-point-dual-conversion fditos OP_79 OPE1_10 float SF FRintj h-fr_int FRk h-fr NA "Dual Convert Integer to Single")
- (floating-point-dual-conversion fdstoi OP_79 OPE1_11 fix SI FRj h-fr FRintk h-fr_int NA "Dual Convert Single to Integer")
- (define-pmacro (ne-floating-point-dual-conversion
- name op ope conv mode src src_hw targ targ_hw attr comment)
- (dni name
- (comment)
- ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) NON-EXCEPTING attr)
- (.str name "$pack $" src ",$" targ)
- (+ pack targ op (rs-null) ope src)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of targ))
- (set targ (conv mode FPCONV-DEFAULT src))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
- (set (nextreg targ_hw targ 1)
- (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
- ((fr500 (unit u-float-dual-convert)))
- )
- )
- (ne-floating-point-dual-conversion nfditos OP_79 OPE1_30 float SF FRintj h-fr_int FRk h-fr NA "Non excepting dual Convert Integer to Single")
- (ne-floating-point-dual-conversion nfdstoi OP_79 OPE1_31 fix SI FRj h-fr FRintk h-fr_int NA "Non excepting dual Convert Single to Integer")
- (define-pmacro (conditional-floating-point-conversion
- name op ope conv mode src targ comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack $" src ",$" targ ",$CCi,$cond")
- (+ pack targ op (rs-null) CCi cond ope src)
- (if (eq CCi (or cond 2))
- (set targ (conv mode FPCONV-DEFAULT src)))
- ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
- )
- )
- (conditional-floating-point-conversion cfitos OP_6B OPE4_0 float SF FRintj FRk "Conditional convert Integer to Single")
- (conditional-floating-point-conversion cfstoi OP_6B OPE4_1 fix SI FRj FRintk "Conditional convert Single to Integer")
- (define-pmacro (ne-floating-point-conversion
- name op ope conv mode src targ comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack $" src ",$" targ)
- (+ pack targ op (rs-null) ope src)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of targ))
- (set targ (conv mode FPCONV-DEFAULT src)))
- ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
- )
- )
- (ne-floating-point-conversion nfitos OP_79 OPE1_20 float SF FRintj FRk "NE convert Integer to Single")
- (ne-floating-point-conversion nfstoi OP_79 OPE1_21 fix SI FRj FRintk "NE convert Single to Integer")
- (register-transfer fmovs OP_79 OPE1_02
- FRj FRk FMALL
- ((FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- ((fr500 (unit u-fr2fr)))
- "Move Single Float")
- (register-transfer fmovd OP_7A OPE1_02
- ; TODO -- unit doesn't handle extra register
- FRdoublej FRdoublek FM01
- ((FR500-MAJOR F-1) (MACH frv))
- ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
- "Move Double Float")
- (dni fdmovs
- "Dual move single float"
- ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
- "fdmovs$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_12 FRj)
- (sequence ()
- (set FRk FRj)
- (set (nextreg h-fr FRk 1) (nextreg h-fr FRj 1)))
- ; TODO -- unit doesn't handle extra register
- ((fr500 (unit u-fr2fr)))
- )
- (conditional-register-transfer cfmovs OP_6C OPE4_0 FRj FRk FMALL
- ((FR500-MAJOR F-1) (FR550-MAJOR F-2)
- (MACH simple,tomcat,fr500,fr550,frv))
- ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
- "Conditional move Single Float")
- (define-pmacro (floating-point-neg name src targ op ope attr comment)
- (dni name
- (comment)
- (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
- (.str name "$pack $" src ",$" targ)
- (+ pack src op (rs-null) ope targ)
- (set targ (neg src))
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- )
- )
- (floating-point-neg fnegs FRj FRk OP_79 OPE1_03 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Floating point negate, single")
- (floating-point-neg fnegd FRdoublej FRdoublek OP_7A OPE1_03 ((MACH frv)) "Floating point negate, double")
- (dni fdnegs
- "Floating point dual negate, single"
- ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
- "fdnegs$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_13 FRj)
- (sequence ()
- (set FRk (neg FRj))
- (set (nextreg h-fr FRk 1) (neg (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-arith)))
- )
- (dni cfnegs
- "Conditional floating point negate, single"
- ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "cfnegs$pack $FRj,$FRk,$CCi,$cond"
- (+ pack FRj OP_6C (rs-null) CCi cond OPE4_1 FRk)
- (if (eq CCi (or cond 2))
- (set FRk (neg FRj)))
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- )
- (define-pmacro (float-abs name src targ op ope attr comment)
- (dni name
- (comment)
- (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
- (.str name "$pack $" src ",$" targ )
- (+ pack targ op (rs-null) ope src)
- (set targ (abs src))
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- )
- )
- (float-abs fabss FRj FRk OP_79 OPE1_04 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Float absolute value, single")
- (float-abs fabsd FRdoublej FRdoublek OP_7A OPE1_04 ((MACH frv)) "Float absolute value, double")
- (dni fdabss
- "Floating point dual absolute value, single"
- ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
- "fdabss$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_14 FRj)
- (sequence ()
- (set FRk (abs FRj))
- (set (nextreg h-fr FRk 1) (abs (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-arith)))
- )
- (dni cfabss
- "Conditional floating point absolute value, single"
- ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "cfabss$pack $FRj,$FRk,$CCi,$cond"
- (+ pack FRj OP_6C (rs-null) CCi cond OPE4_2 FRk)
- (if (eq CCi (or cond 2))
- (set FRk (abs FRj)))
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- )
- (dni fsqrts
- "Square root single"
- ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
- "fsqrts$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_05 FRj)
- (set FRk (sqrt SF FRj))
- ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
- )
- (dni fdsqrts
- "Dual square root single"
- ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4))
- "fdsqrts$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_15 FRj)
- (sequence ()
- (set FRk (sqrt SF FRj))
- (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-sqrt)))
- )
- (dni nfdsqrts
- "Non excepting Dual square root single"
- ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4) NON-EXCEPTING)
- "nfdsqrts$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_35 FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (sqrt SF FRj))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-sqrt)))
- )
- (dni fsqrtd
- "Square root double"
- ((UNIT FM01) (FR500-MAJOR F-4) (MACH frv))
- "fsqrtd$pack $FRdoublej,$FRdoublek"
- (+ pack FRdoublek OP_7A (rs-null) OPE1_05 FRdoublej)
- (set FRdoublek (sqrt DF FRdoublej))
- ((fr500 (unit u-float-sqrt)))
- )
- (dni cfsqrts
- "Conditional square root single"
- ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
- "cfsqrts$pack $FRj,$FRk,$CCi,$cond"
- (+ pack FRk OP_6E (rs-null) CCi cond OPE4_2 FRj)
- (if (eq CCi (or cond 2))
- (set FRk (sqrt SF FRj)))
- ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
- )
- (dni nfsqrts
- "Non exception square root, single"
- ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
- "nfsqrts$pack $FRj,$FRk"
- (+ pack FRk OP_79 (rs-null) OPE1_25 FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (sqrt SF FRj)))
- ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
- )
- (define-pmacro (float-binary-op-s name pipe attr operation op ope comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) (.unsplice attr))
- (.str name "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi ope FRj)
- (set FRk (operation FRi FRj))
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- )
- )
- (float-binary-op-s fadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_06 "add single float")
- (float-binary-op-s fsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_07 "sub single float")
- (float-binary-op-s fmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_08 "mul single float")
- (dni fdivs
- "div single float"
- ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
- "fdivs$pack $FRi,$FRj,$FRk"
- (+ pack FRk OP_79 FRi OPE1_09 FRj)
- (set FRk (div FRi FRj))
- ((fr500 (unit u-float-div))
- (fr550 (unit u-float-div)))
- )
- (define-pmacro (float-binary-op-d name operation op ope major comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR major) (MACH frv))
- (.str name "$pack $FRdoublei,$FRdoublej,$FRdoublek")
- (+ pack FRdoublek op FRdoublei ope FRdoublej)
- (set FRdoublek (operation FRdoublei FRdoublej))
- ((fr500 (unit u-float-arith)))
- )
- )
- (float-binary-op-d faddd add OP_7A OPE1_06 F-2 "add double float")
- (float-binary-op-d fsubd sub OP_7A OPE1_07 F-2 "sub double float")
- (float-binary-op-d fmuld mul OP_7A OPE1_08 F-3 "mul double float")
- (float-binary-op-d fdivd div OP_7A OPE1_09 F-4 "div double float")
- (define-pmacro (conditional-float-binary-op name pipe attr operation op ope profile comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
- (.unsplice attr))
- (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
- (+ pack FRk op FRi CCi cond ope FRj)
- (if (eq CCi (or cond 2))
- (set FRk (operation FRi FRj)))
- profile
- )
- )
- (conditional-float-binary-op cfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_6D OPE4_0
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "cond add single")
- (conditional-float-binary-op cfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_6D OPE4_1
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "cond sub single")
- (conditional-float-binary-op cfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_6E OPE4_0
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "cond mul single")
- (conditional-float-binary-op cfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_6E OPE4_1
- ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
- "cond div single")
- (define-pmacro (ne-float-binary-op name pipe attr operation op ope profile comment)
- (dni name
- (comment)
- (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
- (.unsplice attr))
- (.str name "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi ope FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (operation FRi FRj)))
- profile
- )
- )
- (ne-float-binary-op nfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_26
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "ne add single")
- (ne-float-binary-op nfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_27
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "ne sub single")
- (ne-float-binary-op nfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_28
- ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
- "ne mul single")
- (ne-float-binary-op nfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_79 OPE1_29
- ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
- "ne div single")
- (define-pmacro (fcc-eq) 8)
- (define-pmacro (fcc-lt) 4)
- (define-pmacro (fcc-gt) 2)
- (define-pmacro (fcc-uo) 1)
- (define-pmacro (compare-and-set-fcc arg1 arg2 fcc)
- (if (gt arg1 arg2)
- (set fcc (fcc-gt))
- (if (eq arg1 arg2)
- (set fcc (fcc-eq))
- (if (lt arg1 arg2)
- (set fcc (fcc-lt))
- (set fcc (fcc-uo)))))
- )
- (dni fcmps
- "compare single float"
- ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "fcmps$pack $FRi,$FRj,$FCCi_2"
- (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_0A FRj)
- (compare-and-set-fcc FRi FRj FCCi_2)
- ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
- )
- (dni fcmpd
- "compare double float"
- ((UNIT FMALL) (FR500-MAJOR F-2) (MACH frv))
- "fcmpd$pack $FRdoublei,$FRdoublej,$FCCi_2"
- (+ pack (cond-null) FCCi_2 OP_7A FRdoublei OPE1_0A FRdoublej)
- (compare-and-set-fcc FRdoublei FRdoublej FCCi_2)
- ((fr500 (unit u-float-compare)))
- )
- (dni cfcmps
- "Conditional compare single, float"
- ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
- "cfcmps$pack $FRi,$FRj,$FCCi_2,$CCi,$cond"
- (+ pack (cond-null) FCCi_2 OP_6D FRi CCi cond OPE4_2 FRj)
- (if (eq CCi (or cond 2))
- (compare-and-set-fcc FRi FRj FCCi_2))
- ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
- )
- (dni fdcmps
- "float dual compare single"
- ((UNIT FMALL) (FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
- "fdcmps$pack $FRi,$FRj,$FCCi_2"
- (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_1A FRj)
- (sequence ()
- (compare-and-set-fcc FRi FRj FCCi_2)
- (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
- (nextreg h-fccr FCCi_2 1)))
- ((fr500 (unit u-float-dual-compare)) (fr550 (unit u-float-dual-compare)))
- )
- (define-pmacro (float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (set targ (add_sub (mul arg1 arg2) targ))
- ((fr500 (unit u-float-dual-arith)))
- )
- )
- (float-mul-with-add fmadds add FRi FRj FRk OP_79 OPE1_0B "mul with add, single")
- (float-mul-with-add fmsubs sub FRi FRj FRk OP_79 OPE1_0C "mul with sub, single")
- (float-mul-with-add fmaddd add FRdoublei FRdoublej FRdoublek OP_7A OPE1_0B "mul with add, double")
- (float-mul-with-add fmsubd sub FRdoublei FRdoublej FRdoublek OP_7A OPE1_0C "mul with sub, double")
- (dni fdmadds
- "Float dual multiply with add"
- ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
- "fdmadds$pack $FRi,$FRj,$FRk"
- (+ pack FRk OP_79 FRi OPE1_1B FRj)
- (sequence ()
- (set FRk (add (mul FRi FRj) FRk))
- (set (nextreg h-fr FRk 1)
- (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
- (nextreg h-fr FRk 1))))
- ; TODO dual registers not referenced for profiling
- ((fr500 (unit u-float-dual-arith)))
- )
- (dni nfdmadds
- "Non excepting float dual multiply with add"
- ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
- "nfdmadds$pack $FRi,$FRj,$FRk"
- (+ pack FRk OP_79 FRi OPE1_3B FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (add (mul FRi FRj) FRk))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (set (nextreg h-fr FRk 1)
- (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
- (nextreg h-fr FRk 1))))
- ; TODO dual registers not referenced for profiling
- ((fr500 (unit u-float-dual-arith)))
- )
- (define-pmacro (conditional-float-mul-with-add
- name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) CONDITIONAL)
- (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
- (+ pack FRk op FRi CCi cond ope FRj)
- (if (eq CCi (or cond 2))
- (set targ (add_sub (mul arg1 arg2) targ)))
- ((fr500 (unit u-float-dual-arith)))
- )
- )
- (conditional-float-mul-with-add cfmadds add FRi FRj FRk OP_6F OPE4_0 "conditional mul with add, single")
- (conditional-float-mul-with-add cfmsubs sub FRi FRj FRk OP_6F OPE4_1 "conditional mul with sub, single")
- (define-pmacro (ne-float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) NON-EXCEPTING)
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of targ))
- (set targ (add_sub (mul arg1 arg2) targ)))
- ((fr500 (unit u-float-dual-arith)))
- )
- )
- (ne-float-mul-with-add nfmadds add FRi FRj FRk OP_79 OPE1_2B "non excepting mul with add, single")
- (ne-float-mul-with-add nfmsubs sub FRi FRj FRk OP_79 OPE1_2C "non excepting mul with sub, single")
- (define-pmacro (float-parallel-mul-add-semantics cond add_sub arg1 arg2 targ)
- (if cond
- (sequence ()
- (set targ (mul arg1 arg2))
- (set (nextreg h-fr targ 1)
- (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))))
- )
- (define-pmacro (float-parallel-mul-add
- name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (float-parallel-mul-add-semantics 1 add_sub arg1 arg2 targ)
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- )
- (float-parallel-mul-add fmas add FRi FRj FRk OP_79 OPE1_0E "parallel mul/add, single")
- (float-parallel-mul-add fmss sub FRi FRj FRk OP_79 OPE1_0F "parallel mul/sub, single")
- (define-pmacro (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
- (sequence ()
- (set targ (mul arg1 arg2))
- (set (nextreg h-fr targ 1)
- (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
- (set (nextreg h-fr targ 2)
- (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
- (set (nextreg h-fr targ 3)
- (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
- )
- (define-pmacro (float-dual-parallel-mul-add
- name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
- ()
- )
- )
- (float-dual-parallel-mul-add fdmas add FRi FRj FRk OP_79 OPE1_1C "dual parallel mul/add, single")
- (float-dual-parallel-mul-add fdmss sub FRi FRj FRk OP_79 OPE1_1D "dual parallel mul/sub, single")
- (define-pmacro (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of targ))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 2))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 3))
- (set targ (mul arg1 arg2))
- (set (nextreg h-fr targ 1)
- (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
- (set (nextreg h-fr targ 2)
- (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
- (set (nextreg h-fr targ 3)
- (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
- )
- (define-pmacro (ne-float-dual-parallel-mul-add
- name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
- ()
- )
- )
- (ne-float-dual-parallel-mul-add nfdmas add FRi FRj FRk OP_79 OPE1_3C "non excepting dual parallel mul/add, single")
- (ne-float-dual-parallel-mul-add nfdmss sub FRi FRj FRk OP_79 OPE1_3D "non excepting dual parallel mul/sub, single")
- (define-pmacro (conditional-float-parallel-mul-add name add_sub op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) CONDITIONAL (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
- (+ pack FRk op FRi CCi cond ope FRj)
- (float-parallel-mul-add-semantics (eq CCi (or cond 2))
- add_sub FRi FRj FRk)
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- )
- (conditional-float-parallel-mul-add cfmas add OP_6F OPE4_2 "conditional parallel mul/add, single")
- (conditional-float-parallel-mul-add cfmss sub OP_6F OPE4_3 "conditional parallel mul/sub, single")
- (define-pmacro (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
- (sequence ()
- (set targ (ftrunc SF FPCONV-DEFAULT
- (mul DF
- (fext DF FPCONV-DEFAULT arg1)
- (fext DF FPCONV-DEFAULT arg2))))
- (set (nextreg h-fr targ 1)
- (ftrunc SF FPCONV-DEFAULT
- (add_sub DF
- (fext DF FPCONV-DEFAULT (nextreg h-fr arg1 1))
- (fext DF FPCONV-DEFAULT (nextreg h-fr arg2 1))))))
- )
- (define-pmacro (float-parallel-mul-add-double
- name add_sub arg1 arg2 targ op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
- (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
- (+ pack targ op arg1 ope arg2)
- (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
- ()
- )
- )
- (float-parallel-mul-add-double fmad add FRi FRj FRk OP_7A OPE1_0E "parallel mul/add, double")
- (float-parallel-mul-add-double fmsd sub FRi FRj FRk OP_7A OPE1_0F "parallel mul/sub, double")
- (define-pmacro (ne-float-parallel-mul-add name add_sub op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
- (.str name "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi ope FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (mul FRi FRj))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (set (nextreg h-fr FRk 1)
- (add_sub (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- )
- (ne-float-parallel-mul-add nfmas add OP_79 OPE1_2E "ne parallel mul/add,single")
- (ne-float-parallel-mul-add nfmss sub OP_79 OPE1_2F "ne parallel mul/sub,single")
- (define-pmacro (float-dual-arith name attr oper1 oper2 op ope comment)
- (dni name
- (comment)
- (.splice (UNIT FM01) (.unsplice attr))
- (.str name "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi ope FRj)
- (sequence ()
- (set FRk (oper1 FRi FRj))
- (set (nextreg h-fr FRk 1)
- (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- )
- (float-dual-arith fdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_16 "dual add, single")
- (float-dual-arith fdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_17 "dual sub, single")
- (float-dual-arith fdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_18 "dual mul, single")
- (float-dual-arith fddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_19 "dual div,single")
- (float-dual-arith fdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_1E "dual add/sub, single")
- (dni fdmulcs
- "Float dual cross multiply single"
- ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
- "fdmulcs$pack $FRi,$FRj,$FRk"
- (+ pack FRk OP_79 FRi OPE1_1F FRj)
- (sequence ()
- (set FRk (mul FRi (nextreg h-fr FRj 1)))
- (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- (dni nfdmulcs
- "NE float dual cross multiply single"
- ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
- "nfdmulcs$pack $FRi,$FRj,$FRk"
- (+ pack FRk OP_79 FRi OPE1_3F FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (mul FRi (nextreg h-fr FRj 1)))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- (define-pmacro (ne-float-dual-arith name attr oper1 oper2 op ope comment)
- (dni name
- (comment)
- (.splice (UNIT FM01) (.unsplice attr))
- (.str name "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi ope FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (set FRk (oper1 FRi FRj))
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (set (nextreg h-fr FRk 1)
- (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
- ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
- )
- )
- (ne-float-dual-arith nfdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_36 "ne dual add, single")
- (ne-float-dual-arith nfdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_37 "ne dual sub, single")
- (ne-float-dual-arith nfdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_38 "ne dual mul, single")
- (ne-float-dual-arith nfddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_39 "ne dual div,single")
- (ne-float-dual-arith nfdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_3E "ne dual add/sub, single")
- (dni nfdcmps
- "non-excepting dual float compare"
- ((UNIT FM01) (FR500-MAJOR F-6) (MACH simple,tomcat,frv))
- "nfdcmps$pack $FRi,$FRj,$FCCi_2"
- (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_3A FRj)
- (sequence ()
- (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
- (compare-and-set-fcc FRi FRj FCCi_2)
- (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
- (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
- (nextreg h-fccr FCCi_2 1)))
- ((fr500 (unit u-float-dual-compare)))
- )
- ; Media Instructions
- ;
- (define-pmacro (halfword hilo arg offset)
- (reg (.sym h-fr_ hilo) (add (index-of arg) offset)))
- (dni mhsetlos
- "Media set lower signed 12 bits"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mhsetlos$pack $u12,$FRklo"
- (+ pack FRklo OP_78 OPE1_20 u12)
- (set FRklo u12)
- ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
- (fr550 (unit u-media-set (out FRintk FRklo))))
- )
- (dni mhsethis
- "Media set upper signed 12 bits"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mhsethis$pack $u12,$FRkhi"
- (+ pack FRkhi OP_78 OPE1_22 u12)
- (set FRkhi u12)
- ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
- (fr550 (unit u-media-set (out FRintk FRkhi))))
- )
- (dni mhdsets
- "Media dual set halfword signed 12 bits"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mhdsets$pack $u12,$FRintk"
- (+ pack FRintk OP_78 OPE1_24 u12)
- (sequence ()
- ; hack to get FRintk passed to modelling functions
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (set (halfword hi FRintk 0) u12)
- (set (halfword lo FRintk 0) u12))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr550 (unit u-media-set)))
- )
- (define-pmacro (set-5-semantics target value)
- (sequence ((HI tmp))
- (set tmp target)
- (set tmp (and tmp #x07ff))
- (set tmp (or tmp (sll (and s5 #x1f) 11)))
- (set target tmp))
- )
- (define-pmacro (media-set-5 name hilo op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $s5,$FRk" hilo)
- (+ pack (.sym FRk hilo) op (FRi-null) ope (misc-null-11) s5)
- (set-5-semantics (.sym FRk hilo) s5)
- ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
- (fr550 (unit u-media-set (out FRintk (.sym FRk hilo)))))
- )
- )
- (media-set-5 mhsetloh lo OP_78 OPE1_21 "Media set upper 5 bits lo")
- (media-set-5 mhsethih hi OP_78 OPE1_23 "Media set upper 5 bits hi")
- (dni mhdseth
- "Media dual set halfword upper 5 bits"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mhdseth$pack $s5,$FRintk"
- (+ pack FRintk OP_78 (FRi-null) OPE1_25 (misc-null-11) s5)
- (sequence ()
- ; hack to get FRintk passed to modelling functions
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (set-5-semantics (halfword hi FRintk 0) s5)
- (set-5-semantics (halfword lo FRintk 0) s5))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr550 (unit u-media-set)))
- )
- (define-pmacro (media-logic-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $FRinti,$FRintj,$FRintk")
- (+ pack FRintk op FRinti ope FRintj)
- (set FRintk (operation FRinti FRintj))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (media-logic-r-r mand and OP_7B OPE1_00 "and reg/reg")
- (media-logic-r-r mor or OP_7B OPE1_01 "or reg/reg")
- (media-logic-r-r mxor xor OP_7B OPE1_02 "xor reg/reg")
- (define-pmacro (conditional-media-logic name operation op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
- (+ pack FRintk op FRinti CCi cond ope FRintj)
- (if (eq CCi (or cond 2))
- (set FRintk (operation FRinti FRintj)))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (conditional-media-logic cmand and OP_70 OPE4_0 "conditional and reg/reg")
- (conditional-media-logic cmor or OP_70 OPE4_1 "conditional or reg/reg")
- (conditional-media-logic cmxor xor OP_70 OPE4_2 "conditional xor reg/reg")
- (dni mnot
- ("mnot")
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- ("mnot$pack $FRintj,$FRintk")
- (+ pack FRintk OP_7B (rs-null) OPE1_03 FRintj)
- (set FRintk (inv FRintj))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (dni cmnot
- ("cmnot")
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
- ("cmnot$pack $FRintj,$FRintk,$CCi,$cond")
- (+ pack FRintk OP_70 (rs-null) CCi cond OPE4_3 FRintj)
- (if (eq CCi (or cond 2))
- (set FRintk (inv FRintj)))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (define-pmacro (media-rotate-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $FRinti,$u6,$FRintk")
- (+ pack FRintk op FRinti ope u6)
- (set FRintk (operation FRinti (and u6 #x1f)))
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (media-rotate-r-r mrotli rol OP_7B OPE1_04 "rotate left reg/reg")
- (media-rotate-r-r mrotri ror OP_7B OPE1_05 "rotate right reg/reg")
- (define-pmacro (media-cut-r-r name arg op ope comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- (.str name "$pack $FRinti,$" arg ",$FRintk")
- (+ pack FRintk op FRinti ope arg)
- (set FRintk (c-call SI "@cpu@_cut" FRinti (nextreg h-fr_int FRinti 1) arg))
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (media-cut-r-r mwcut FRintj OP_7B OPE1_06 "media cut")
- (media-cut-r-r mwcuti u6 OP_7B OPE1_07 "media cut")
- (define-pmacro (media-cut-acc name arg op ope fr450-major comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
- (.str name "$pack $ACC40Si,$" arg ",$FRintk")
- (+ pack FRintk op ACC40Si ope arg)
- (set FRintk (c-call SI "@cpu@_media_cut" ACC40Si arg))
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
- )
- )
- (media-cut-acc mcut FRintj OP_7B OPE1_2C M-1 "media accumulator cut reg")
- (media-cut-acc mcuti s6 OP_7B OPE1_2E M-5 "media accumulator cut immed")
- (define-pmacro (media-cut-acc-ss name arg op ope fr450-major comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
- (.str name "$pack $ACC40Si,$" arg ",$FRintk")
- (+ pack FRintk op ACC40Si ope arg)
- (set FRintk (c-call SI "@cpu@_media_cut_ss" ACC40Si arg))
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
- )
- )
- (media-cut-acc-ss mcutss FRintj OP_7B OPE1_2D M-1 "media accumulator cut reg with saturation")
- (media-cut-acc-ss mcutssi s6 OP_7B OPE1_2F M-5 "media accumulator cut immed with saturation")
- ; Dual Media Instructions
- ;
- (define-pmacro (register-unaligned register alignment)
- (and (index-of register) (sub alignment 1))
- )
- (dni mdcutssi
- "Media dual cut with signed saturation"
- ((UNIT MDCUTSSI) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-6))
- "mdcutssi$pack $ACC40Si,$s6,$FRintkeven"
- (+ pack FRintkeven OP_78 ACC40Si OPE1_0E s6)
- (if (register-unaligned ACC40Si 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (register-unaligned FRintkeven 2)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- (set FRintkeven (c-call SI "@cpu@_media_cut_ss" ACC40Si s6))
- (set (nextreg h-fr_int FRintkeven 1)
- (c-call SI "@cpu@_media_cut_ss"
- (nextreg h-acc40S ACC40Si 1) s6)))))
- ((fr400 (unit u-media-4-acc-dual
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-4-acc-dual
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-3-acc-dual)))
- )
- ; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated
- ; so it will be passed to the unit modelers. YUCK!!!!!
- (define-pmacro (extract-hilo reg1 off1 reg2 off2 arg1hi arg1lo arg2hi arg2lo)
- (sequence ()
- (set arg1hi (add (halfword hi reg1 off1) (mul reg1 0)))
- (set arg1lo (add (halfword lo reg1 off1) (mul reg1 0)))
- (set arg2hi (add (halfword hi reg2 off2) (mul reg2 0)))
- (set arg2lo (add (halfword lo reg2 off2) (mul reg2 0))))
- )
- (dni maveh
- "Media dual average"
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "maveh$pack $FRinti,$FRintj,$FRintk"
- (+ pack FRintk OP_7B FRinti OPE1_08 FRintj)
- (set FRintk (c-call SI "@cpu@_media_average" FRinti FRintj))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (define-pmacro (media-dual-shift name operation op ope profile comment)
- (dni name
- (comment)
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $FRinti,$u6,$FRintk")
- (+ pack FRintk op FRinti ope u6)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (set (halfword hi FRintk 0)
- (operation (halfword hi FRinti 0) (and u6 #xf)))
- (set (halfword lo FRintk 0)
- (operation (halfword lo FRinti 0) (and u6 #xf))))
- profile
- )
- )
- (media-dual-shift msllhi sll OP_7B OPE1_09
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- "Media dual shift left logical")
- (media-dual-shift msrlhi srl OP_7B OPE1_0A
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- "Media dual shift right logical")
- (media-dual-shift msrahi sra OP_7B OPE1_0B
- ((fr400 (unit u-media-6)) (fr450 (unit u-media-6))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- "Media dual shift right arithmetic")
- (define-pmacro (media-dual-word-rotate-r-r name operation op ope comment)
- (dni name
- (comment)
- ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- (.str name "$pack $FRintieven,$s6,$FRintkeven")
- (+ pack FRintkeven op FRintieven ope s6)
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintkeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- (set FRintkeven (operation FRintieven (and s6 #x1f)))
- (set (nextreg h-fr_int FRintkeven 1)
- (operation (nextreg h-fr_int FRintieven 1)
- (and s6 #x1f)))))
- ((fr400 (unit u-media-3-quad
- (in FRinti FRintieven)
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-3-quad
- (in FRinti FRintieven)
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-quad)))
- )
- )
- (media-dual-word-rotate-r-r mdrotli rol OP_78 OPE1_0B "rotate left reg/reg")
- (dni mcplhi
- "Media bit concatenate, halfword"
- ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mcplhi$pack $FRinti,$u6,$FRintk"
- (+ pack FRintk OP_78 FRinti OPE1_0C u6)
- (sequence ((HI arg1) (HI arg2) (HI shift))
- (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (set shift (and u6 #xf))
- (set arg1 (sll (halfword hi FRinti 0) shift))
- (if (ne shift 0)
- (sequence ()
- (set arg2 (halfword hi FRinti 1))
- (set arg2 (srl HI (sll HI arg2 (sub 15 shift))
- (sub 15 shift)))
- (set arg1 (or HI arg1 arg2))))
- (set (halfword hi FRintk 0) arg1))
- ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
- (fr550 (unit u-media-3-dual)))
- )
- (dni mcpli
- "Media bit concatenate, word"
- ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mcpli$pack $FRinti,$u6,$FRintk"
- (+ pack FRintk OP_78 FRinti OPE1_0D u6)
- (sequence ((SI tmp) (SI shift))
- (set shift (and u6 #x1f))
- (set tmp (sll FRinti shift))
- (if (ne shift 0)
- (sequence ((SI tmp1))
- (set tmp1 (srl (sll (nextreg h-fr_int FRinti 1)
- (sub 31 shift))
- (sub 31 shift)))
- (set tmp (or tmp tmp1))))
- (set FRintk tmp))
- ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
- (fr550 (unit u-media-3-dual)))
- )
- (define-pmacro (saturate arg max min result)
- (if (gt arg max)
- (set result max)
- (if (lt arg min)
- (set result min)
- (set result arg)))
- )
- (dni msaths
- "Media dual saturation signed"
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "msaths$pack $FRinti,$FRintj,$FRintk"
- (+ pack FRintk OP_7B FRinti OPE1_0C FRintj)
- (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
- (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
- (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 0))
- (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 0)))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (dni mqsaths
- "Media quad saturation signed"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven"
- (+ pack FRintkeven OP_78 FRintieven OPE1_0F FRintjeven)
- (if (orif (register-unaligned FRintieven 2)
- (orif (register-unaligned FRintjeven 2)
- (register-unaligned FRintkeven 2)))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
- ; hack to get FRintkeven referenced as a target for profiling
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (extract-hilo FRintieven 0 FRintjeven 0 argihi argilo argjhi argjlo)
- (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 0))
- (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 0))
- (extract-hilo FRintieven 1 FRintjeven 1 argihi argilo argjhi argjlo)
- (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 1))
- (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 1))))
- ((fr400 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-quad)))
- )
- (define-pmacro (saturate-unsigned arg max result)
- (if (gt arg max)
- (set result max)
- (set result arg))
- )
- (dni msathu
- "Media dual saturation unsigned"
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "msathu$pack $FRinti,$FRintj,$FRintk"
- (+ pack FRintk OP_7B FRinti OPE1_0D FRintj)
- (sequence ((UHI argihi) (UHI argilo) (UHI argjhi) (UHI argjlo))
- (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
- (saturate-unsigned argihi argjhi (halfword hi FRintk 0))
- (saturate-unsigned argilo argjlo (halfword lo FRintk 0)))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (define-pmacro (media-dual-compare name mode op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $FRinti,$FRintj,$FCCk")
- (+ pack (cond-null) FCCk op FRinti ope FRintj)
- (if (register-unaligned FCCk 2)
- (c-call VOID "@cpu@_media_cr_not_aligned")
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0
- argihi argilo argjhi argjlo)
- (compare-and-set-fcc argihi argjhi FCCk)
- (compare-and-set-fcc argilo argjlo (nextreg h-fccr FCCk 1))))
- ; TODO - doesn't handle second FCC
- ((fr400 (unit u-media-7)) (fr450 (unit u-media-7))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (media-dual-compare mcmpsh HI OP_7B OPE1_0E "Media dual compare signed")
- (media-dual-compare mcmpuh UHI OP_7B OPE1_0F "Media dual compare unsigned")
- ; Bits for the MSR.SIE field
- (define-pmacro (msr-sie-nil) 0)
- (define-pmacro (msr-sie-fri-hi) 8)
- (define-pmacro (msr-sie-fri-lo) 4)
- (define-pmacro (msr-sie-fri-1-hi) 2)
- (define-pmacro (msr-sie-fri-1-lo) 1)
- (define-pmacro (msr-sie-acci) 8)
- (define-pmacro (msr-sie-acci-1) 4)
- (define-pmacro (msr-sie-acci-2) 2)
- (define-pmacro (msr-sie-acci-3) 1)
- (define-pmacro (saturate-v arg max min sie result)
- (if (gt DI arg max)
- (sequence ()
- (set result max)
- (c-call VOID "@cpu@_media_overflow" sie))
- (if (lt DI arg min)
- (sequence ()
- (set result min)
- (c-call VOID "@cpu@_media_overflow" sie))
- (set result arg)))
- )
- (dni mabshs
- "Media dual absolute value, halfword"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mabshs$pack $FRintj,$FRintk"
- (+ pack FRintk OP_78 (FRi-null) OPE1_0A FRintj)
- (sequence ((HI arghi) (HI arglo))
- (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (set arghi (halfword hi FRintj 0))
- (set arglo (halfword lo FRintj 0))
- ; We extend the argument before the abs operation so we can
- ; notice -32768 overflowing as 32768.
- (saturate-v (abs (ext DI arghi)) 32767 -32768 (msr-sie-fri-hi)
- (halfword hi FRintk 0))
- (saturate-v (abs (ext DI arglo)) 32767 -32768 (msr-sie-fri-lo)
- (halfword lo FRintk 0)))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr550 (unit u-media)))
- )
- ; How to extend from a mode to get the intended signedness.
- (define-pmacro (DI-ext-HI x) (ext DI x))
- (define-pmacro (DI-ext-UHI x) (zext DI x))
- (define-pmacro (DI-ext-DI x) x)
- (define-pmacro (media-arith-sat-semantics
- operation arg1 arg2 res mode max min sie)
- (sequence ((DI tmp))
- ; Make sure we saturate at max/min against a value that is
- ; sign- or zero-extended appropriately from "mode".
- (set tmp (operation DI
- ((.sym DI-ext- mode) arg1) ((.sym DI-ext- mode) arg2)))
- (saturate-v tmp max min sie res))
- )
- (define-pmacro (media-dual-arith-sat-semantics operation mode max min)
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
- (media-arith-sat-semantics operation argihi argjhi
- (halfword hi FRintk 0) mode max min
- (msr-sie-fri-hi))
- (media-arith-sat-semantics operation argilo argjlo
- (halfword lo FRintk 0) mode max min
- (msr-sie-fri-lo)))
- )
- (define-pmacro (media-dual-arith-sat name operation mode max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- (.str name "$pack $FRinti,$FRintj,$FRintk")
- (+ pack FRintk op FRinti ope FRintj)
- (media-dual-arith-sat-semantics operation mode max min)
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (media-dual-arith-sat maddhss add HI 32767 -32768 OP_7B OPE1_10 "Media dual add signed with saturation")
- (media-dual-arith-sat maddhus add UHI 65535 0 OP_7B OPE1_11 "Media dual add unsigned with saturation")
- (media-dual-arith-sat msubhss sub HI 32767 -32768 OP_7B OPE1_12 "Media dual sub signed with saturation")
- (media-dual-arith-sat msubhus sub UHI 65535 0 OP_7B OPE1_13 "Media dual sub unsigned with saturation")
- (define-pmacro (conditional-media-dual-arith-sat
- name operation mode max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
- (+ pack FRintk op FRinti CCi cond ope FRintj)
- (if (eq CCi (or cond 2))
- (media-dual-arith-sat-semantics operation mode max min))
- ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- )
- (conditional-media-dual-arith-sat cmaddhss add HI 32767 -32768 OP_71 OPE4_0 "Conditional Media dual add signed with saturation")
- (conditional-media-dual-arith-sat cmaddhus add UHI 65535 0 OP_71 OPE4_1 "Conditional Media dual add unsigned with saturation")
- (conditional-media-dual-arith-sat cmsubhss sub HI 32767 -32768 OP_71 OPE4_2 "Conditional Media dual sub signed with saturation")
- (conditional-media-dual-arith-sat cmsubhus sub UHI 65535 0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation")
- (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min)
- (if (orif (register-unaligned FRintieven 2)
- (orif (register-unaligned FRintjeven 2)
- (register-unaligned FRintkeven 2)))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- ; hack to get FRintkeven referenced as a target for profiling
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-arith-sat-semantics operation argihi argjhi
- (halfword hi FRintkeven 0) mode
- max min (msr-sie-fri-hi))
- (media-arith-sat-semantics operation argilo argjlo
- (halfword lo FRintkeven 0) mode
- max min (msr-sie-fri-lo))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-arith-sat-semantics operation argihi argjhi
- (halfword hi FRintkeven 1) mode
- max min (msr-sie-fri-1-hi))
- (media-arith-sat-semantics operation argilo argjlo
- (halfword lo FRintkeven 1) mode
- max min (msr-sie-fri-1-lo)))))
- )
- (define-pmacro (media-quad-arith-sat name operation mode max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
- (+ pack FRintkeven op FRintieven ope FRintjeven)
- (media-quad-arith-sat-semantics 1 operation mode max min)
- ((fr400 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-quad-arith
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
- )
- )
- (media-quad-arith-sat mqaddhss add HI 32767 -32768 OP_7B OPE1_18 "Media quad add signed with saturation")
- (media-quad-arith-sat mqaddhus add UHI 65535 0 OP_7B OPE1_19 "Media quad add unsigned with saturation")
- (media-quad-arith-sat mqsubhss sub HI 32767 -32768 OP_7B OPE1_1A "Media quad sub signed with saturation")
- (media-quad-arith-sat mqsubhus sub UHI 65535 0 OP_7B OPE1_1B "Media quad sub unsigned with saturation")
- (define-pmacro (conditional-media-quad-arith-sat
- name operation mode max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
- (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond")
- (+ pack FRintkeven op FRintieven CCi cond ope FRintjeven)
- (media-quad-arith-sat-semantics (eq CCi (or cond 2))
- operation mode max min)
- ((fr400 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-quad-arith
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
- )
- )
- (conditional-media-quad-arith-sat cmqaddhss add HI 32767 -32768 OP_73 OPE4_0 "Conditional Media quad add signed with saturation")
- (conditional-media-quad-arith-sat cmqaddhus add UHI 65535 0 OP_73 OPE4_1 "Conditional Media quad add unsigned with saturation")
- (conditional-media-quad-arith-sat cmqsubhss sub HI 32767 -32768 OP_73 OPE4_2 "Conditional Media quad sub signed with saturation")
- (conditional-media-quad-arith-sat cmqsubhus sub UHI 65535 0 OP_73 OPE4_3 "Conditional Media quad sub unsigned with saturation")
- ;; Return A if |A| > |B| and B is positive. Return -A if |A| > |B| and
- ;; B is negative, saturating 0x8000 as 0x7fff. Return 0 otherwise.
- (define-pmacro (media-low-clear-semantics a b)
- (cond HI
- ((le UHI (abs a) (abs b)) 0)
- ((le HI 0 b) a)
- ((eq HI a -32768) 32767)
- (else (neg a))))
- ;; Return A if -|B| < A < |B|. Return -B if A <= -|B|, saturating 0x8000
- ;; as 0x7fff. Return B if A >= |B|.
- (define-pmacro (media-scope-limit-semantics a b)
- (cond HI
- ((andif (gt HI b -32768)
- (ge HI a (abs b))) b)
- ((gt HI a (neg (abs b))) a)
- ((eq HI b -32768) 32767)
- (else (neg b))))
- (define-pmacro (media-quad-limit name operation op ope comment)
- (dni name
- comment
- ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
- (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
- (+ pack FRintkeven op FRintieven ope FRintjeven)
- (if (orif (register-unaligned FRintieven 2)
- (orif (register-unaligned FRintjeven 2)
- (register-unaligned FRintkeven 2)))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ((HI a1) (HI a2) (HI a3) (HI a4)
- (HI b1) (HI b2) (HI b3) (HI b4))
- ; hack to get FRintkeven referenced as a target
- ; for profiling
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (extract-hilo FRintieven 0 FRintjeven 0 a1 a2 b1 b2)
- (extract-hilo FRintieven 1 FRintjeven 1 a3 a4 b3 b4)
- (set (halfword hi FRintkeven 0) (operation a1 b1))
- (set (halfword lo FRintkeven 0) (operation a2 b2))
- (set (halfword hi FRintkeven 1) (operation a3 b3))
- (set (halfword lo FRintkeven 1) (operation a4 b4))))
- ((fr450 (unit u-media-1-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven))))
- )
- )
- (media-quad-limit mqlclrhs media-low-clear-semantics OP_78 OPE1_10
- "Media quad low clear")
- (media-quad-limit mqlmths media-scope-limit-semantics OP_78 OPE1_14
- "Media quad scope limitation")
- (define-pmacro (media-quad-shift name operation op ope comment)
- (dni name
- (comment)
- ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
- (.str name "$pack $FRintieven,$u6,$FRintkeven")
- (+ pack FRintkeven op FRintieven ope u6)
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintkeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (set (halfword hi FRintkeven 0)
- (operation HI (halfword hi FRintieven 0)
- (and u6 #xf)))
- (set (halfword lo FRintkeven 0)
- (operation HI (halfword lo FRintieven 0)
- (and u6 #xf)))
- (set (halfword hi FRintkeven 1)
- (operation HI (halfword hi FRintieven 1)
- (and u6 #xf)))
- (set (halfword lo FRintkeven 1)
- (operation HI (halfword lo FRintieven 1)
- (and u6 #xf)))))
- ((fr450 (unit u-media-3-quad
- (in FRinti FRintieven)
- (in FRintj FRintieven)
- (out FRintk FRintkeven))))
- )
- )
- (media-quad-shift mqsllhi sll OP_78 OPE1_11 "Media quad left shift")
- (media-quad-shift mqsrahi sra OP_78 OPE1_13 "Media quad right shift")
- (define-pmacro (media-acc-arith-sat name operation mode max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- (.str name "$pack $ACC40Si,$ACC40Sk")
- (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Si 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (media-arith-sat-semantics operation ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- ACC40Sk mode max min (msr-sie-acci)))))
- ((fr400 (unit u-media-2-acc)) (fr450 (unit u-media-2-acc))
- (fr550 (unit u-media-4-acc)))
- )
- )
- (media-acc-arith-sat maddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
- OP_78 OPE1_04 "Media accumulator addition")
- (media-acc-arith-sat msubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
- OP_78 OPE1_05 "Media accumulator subtraction")
- (define-pmacro (media-dual-acc-arith-sat name operation mode max min op ope
- comment)
- (dni name
- (comment)
- ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $ACC40Si,$ACC40Sk")
- (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Si 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (register-unaligned ACC40Sk 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (sequence ()
- (media-arith-sat-semantics operation ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- ACC40Sk mode max min
- (msr-sie-acci))
- (media-arith-sat-semantics operation
- (nextreg h-acc40S ACC40Si 2)
- (nextreg h-acc40S ACC40Si 3)
- (nextreg h-acc40S ACC40Sk 1)
- mode max min
- (msr-sie-acci-1)))))))
- ((fr400 (unit u-media-2-acc-dual)) (fr450 (unit u-media-2-acc-dual))
- (fr550 (unit u-media-4-acc-dual)))
- )
- )
- (media-dual-acc-arith-sat mdaddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
- OP_78 OPE1_06 "Media accumulator addition")
- (media-dual-acc-arith-sat mdsubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
- OP_78 OPE1_07 "Media accumulator subtraction")
- (dni masaccs
- "Media add and subtract signed accumulator with saturation"
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- "masaccs$pack $ACC40Si,$ACC40Sk"
- (+ pack ACC40Sk OP_78 ACC40Si OPE1_08 (ACCj-null))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Si 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (register-unaligned ACC40Sk 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (sequence ()
- (media-arith-sat-semantics add ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- ACC40Sk DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci))
- (media-arith-sat-semantics sub ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- (nextreg h-acc40S ACC40Sk 1)
- DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci-1)))))))
- ((fr400 (unit u-media-2-add-sub)) (fr450 (unit u-media-2-add-sub))
- (fr550 (unit u-media-4-add-sub)))
- )
- (dni mdasaccs
- "Media add and subtract signed accumulator with saturation"
- ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- "mdasaccs$pack $ACC40Si,$ACC40Sk"
- (+ pack ACC40Sk OP_78 ACC40Si OPE1_09 (ACCj-null))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Si 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (register-unaligned ACC40Sk 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (sequence ()
- (media-arith-sat-semantics add ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- ACC40Sk DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci))
- (media-arith-sat-semantics sub ACC40Si
- (nextreg h-acc40S ACC40Si 1)
- (nextreg h-acc40S ACC40Sk 1)
- DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci-1))
- (media-arith-sat-semantics add
- (nextreg h-acc40S ACC40Si 2)
- (nextreg h-acc40S ACC40Si 3)
- (nextreg h-acc40S ACC40Sk 2)
- DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci-2))
- (media-arith-sat-semantics sub
- (nextreg h-acc40S ACC40Si 2)
- (nextreg h-acc40S ACC40Si 3)
- (nextreg h-acc40S ACC40Sk 3)
- DI
- #x7fffffffff
- (inv DI #x7fffffffff)
- (msr-sie-acci-3)))))))
- ((fr400 (unit u-media-2-add-sub-dual))
- (fr450 (unit u-media-2-add-sub-dual))
- (fr550 (unit u-media-4-add-sub-dual)))
- )
- (define-pmacro (media-multiply-semantics conv arg1 arg2 res)
- (set res (mul DI (conv DI arg1) (conv DI arg2)))
- )
- (define-pmacro (media-dual-multiply-semantics cond mode conv rhs1 rhs2)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Sk 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0
- argihi argilo argjhi argjlo)
- (media-multiply-semantics conv argihi rhs1 ACC40Sk)
- (media-multiply-semantics conv argilo rhs2
- (nextreg h-acc40S ACC40Sk 1))))))
- )
- (define-pmacro (media-dual-multiply name mode conv rhs1 rhs2 op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3) PRESERVE-OVF)
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
- (+ pack ACC40Sk op FRinti ope FRintj)
- (media-dual-multiply-semantics 1 mode conv rhs1 rhs2)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (media-dual-multiply mmulhs HI ext argjhi argjlo OP_7B OPE1_14 "Media dual multiply signed")
- (media-dual-multiply mmulhu UHI zext argjhi argjlo OP_7B OPE1_15 "Media dual multiply unsigned")
- (media-dual-multiply mmulxhs HI ext argjlo argjhi OP_7B OPE1_28 "Media dual cross multiply signed")
- (media-dual-multiply mmulxhu UHI zext argjlo argjhi OP_7B OPE1_29 "Media dual cross multiply unsigned")
- (define-pmacro (conditional-media-dual-multiply
- name mode conv rhs1 rhs2 op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3)
- PRESERVE-OVF CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
- (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
- (media-dual-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (conditional-media-dual-multiply cmmulhs HI ext argjhi argjlo OP_72 OPE4_0 "Conditional Media dual multiply signed")
- (conditional-media-dual-multiply cmmulhu UHI zext argjhi argjlo OP_72 OPE4_1 "Conditional Media dual multiply unsigned")
- (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Sk 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-multiply-semantics conv argihi rhs1 ACC40Sk)
- (media-multiply-semantics conv argilo rhs2
- (nextreg h-acc40S ACC40Sk 1))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-multiply-semantics conv argihi rhs1
- (nextreg h-acc40S ACC40Sk 2))
- (media-multiply-semantics conv argilo rhs2
- (nextreg h-acc40S ACC40Sk 3)))))))
- )
- (define-pmacro (media-quad-multiply name mode conv rhs1 rhs2 op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4) PRESERVE-OVF)
- (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
- (+ pack ACC40Sk op FRintieven ope FRintjeven)
- (media-quad-multiply-semantics 1 mode conv rhs1 rhs2)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-mul
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-multiply mqmulhs HI ext argjhi argjlo OP_7B OPE1_1C "Media quad multiply signed")
- (media-quad-multiply mqmulhu UHI zext argjhi argjlo OP_7B OPE1_1D "Media quad multiply unsigned")
- (media-quad-multiply mqmulxhs HI ext argjlo argjhi OP_7B OPE1_2A "Media quad cross multiply signed")
- (media-quad-multiply mqmulxhu UHI zext argjlo argjhi OP_7B OPE1_2B "Media quad cross multiply unsigned")
- (define-pmacro (conditional-media-quad-multiply
- name mode conv rhs1 rhs2 op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4)
- PRESERVE-OVF CONDITIONAL)
- (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond")
- (+ pack ACC40Sk op FRintieven CCi cond ope FRintjeven)
- (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-mul
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (conditional-media-quad-multiply cmqmulhs HI ext argjhi argjlo OP_74 OPE4_0 "Conditional Media quad multiply signed")
- (conditional-media-quad-multiply cmqmulhu UHI zext argjhi argjlo OP_74 OPE4_1 "Conditional Media quad multiply unsigned")
- (define-pmacro (media-multiply-acc-semantics
- conv arg1 addop arg2 res max min sie)
- (sequence ((DI tmp))
- (set tmp (addop res (mul DI (conv DI arg1) (conv DI arg2))))
- (saturate-v tmp max min sie res))
- )
- (define-pmacro (media-dual-multiply-acc-semantics
- cond mode conv addop rhw res max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of res))
- (if (register-unaligned res 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjhi
- res
- max min (msr-sie-acci))
- (media-multiply-acc-semantics conv argilo addop argjlo
- (nextreg rhw res 1)
- max min (msr-sie-acci-1))))))
- )
- (define-pmacro (media-dual-multiply-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- (.str name "$pack $FRinti,$FRintj,$" res)
- (+ pack res op FRinti ope FRintj)
- (media-dual-multiply-acc-semantics 1 mode conv addop rhw res max min)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (media-dual-multiply-acc mmachs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_16
- "Media dual multiply and accumulate signed")
- (media-dual-multiply-acc mmachu UHI zext add h-acc40U ACC40Uk
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_17
- "Media dual multiply and accumulate unsigned")
- (media-dual-multiply-acc mmrdhs HI ext sub h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_30
- "Media dual multiply and reduce signed")
- (media-dual-multiply-acc mmrdhu UHI zext sub h-acc40U ACC40Uk
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_31
- "Media dual multiply and reduce unsigned")
- (define-pmacro (conditional-media-dual-multiply-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$" res ",$CCi,$cond")
- (+ pack res op FRinti CCi cond ope FRintj)
- (media-dual-multiply-acc-semantics (eq CCi (or cond 2))
- mode conv addop rhw res max min)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (conditional-media-dual-multiply-acc cmmachs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_72 OPE4_2
- "Conditional Media dual multiply and accumulate signed")
- (conditional-media-dual-multiply-acc cmmachu UHI zext add h-acc40U ACC40Uk
- (const DI #xffffffffff) (const DI 0)
- OP_72 OPE4_3
- "Conditional Media dual multiply and accumulate unsigned")
- (define-pmacro (media-quad-multiply-acc-semantics
- cond mode conv addop rhw res max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of res))
- (if (register-unaligned res 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjhi
- res
- max min (msr-sie-acci))
- (media-multiply-acc-semantics conv argilo addop argjlo
- (nextreg rhw res 1)
- max min (msr-sie-acci-1))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjhi
- (nextreg rhw res 2)
- max min (msr-sie-acci-2))
- (media-multiply-acc-semantics conv argilo addop argjlo
- (nextreg rhw res 3)
- max min
- (msr-sie-acci-3)))))))
- )
- (define-pmacro (media-quad-multiply-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$" res)
- (+ pack res op FRintieven ope FRintjeven)
- (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-mul
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-multiply-acc mqmachs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_1E
- "Media quad multiply and accumulate signed")
- (media-quad-multiply-acc mqmachu UHI zext add h-acc40U ACC40Uk
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_1F
- "Media quad multiply and accumulate unsigned")
- (define-pmacro (conditional-media-quad-multiply-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4) CONDITIONAL)
- (.str name "$pack $FRintieven,$FRintjeven,$" res ",$CCi,$cond")
- (+ pack res op FRintieven CCi cond ope FRintjeven)
- (media-quad-multiply-acc-semantics (eq CCi (or cond 2))
- mode conv addop rhw res max min)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-mul
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (conditional-media-quad-multiply-acc cmqmachs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_74 OPE4_2
- "Conditional Media quad multiply and accumulate signed")
- (conditional-media-quad-multiply-acc cmqmachu UHI zext add h-acc40U ACC40Uk
- (const DI #xffffffffff) (const DI 0)
- OP_74 OPE4_3
- "Conditional media quad multiply and accumulate unsigned")
- (define-pmacro (media-quad-multiply-cross-acc-semantics
- cond mode conv addop rhw res max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of res))
- (if (register-unaligned res 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjhi
- (nextreg rhw res 2)
- max min (msr-sie-acci-2))
- (media-multiply-acc-semantics conv argilo addop argjlo
- (nextreg rhw res 3)
- max min (msr-sie-acci-3))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjhi
- res
- max min (msr-sie-acci))
- (media-multiply-acc-semantics conv argilo addop argjlo
- (nextreg rhw res 1)
- max min
- (msr-sie-acci-1)))))))
- )
- (define-pmacro (media-quad-multiply-cross-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$" res)
- (+ pack res op FRintieven ope FRintjeven)
- (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res
- max min)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-multiply-cross-acc mqxmachs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_78 OPE1_00
- "Media quad multiply and cross accumulate signed")
- (define-pmacro (media-quad-cross-multiply-cross-acc-semantics
- cond mode conv addop rhw res max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of res))
- (if (register-unaligned res 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjlo
- (nextreg rhw res 2)
- max min (msr-sie-acci-2))
- (media-multiply-acc-semantics conv argilo addop argjhi
- (nextreg rhw res 3)
- max min (msr-sie-acci-3))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjlo
- res
- max min (msr-sie-acci))
- (media-multiply-acc-semantics conv argilo addop argjhi
- (nextreg rhw res 1)
- max min
- (msr-sie-acci-1)))))))
- )
- (define-pmacro (media-quad-cross-multiply-cross-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$" res)
- (+ pack res op FRintieven ope FRintjeven)
- (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res
- max min)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-cross-multiply-cross-acc mqxmacxhs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_78 OPE1_01
- "Media quad cross multiply and cross accumulate signed")
- (define-pmacro (media-quad-cross-multiply-acc-semantics
- cond mode conv addop rhw res max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of res))
- (if (register-unaligned res 4)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjlo
- res
- max min (msr-sie-acci))
- (media-multiply-acc-semantics conv argilo addop argjhi
- (nextreg rhw res 1)
- max min (msr-sie-acci-1))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-multiply-acc-semantics conv argihi addop argjlo
- (nextreg rhw res 2)
- max min (msr-sie-acci-2))
- (media-multiply-acc-semantics conv argilo addop argjhi
- (nextreg rhw res 3)
- max min
- (msr-sie-acci-3)))))))
- )
- (define-pmacro (media-quad-cross-multiply-acc
- name mode conv addop rhw res max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$" res)
- (+ pack res op FRintieven ope FRintjeven)
- (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res
- max min)
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-cross-multiply-acc mqmacxhs HI ext add h-acc40S ACC40Sk
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_78 OPE1_02
- "Media quad cross multiply and accumulate signed")
- (define-pmacro (media-complex-semantics
- conv lhs1 rhs1 lhs2 rhs2 res max min sie)
- (sequence ((DI tmp1) (DI tmp2))
- (media-multiply-semantics conv lhs1 rhs1 tmp1)
- (media-multiply-semantics conv lhs2 rhs2 tmp2)
- (set tmp1 (sub tmp1 tmp2))
- (saturate-v tmp1 max min sie res))
- )
- (define-pmacro (media-complex-semantics-i
- conv lhs1 rhs1 lhs2 rhs2 res max min sie)
- (sequence ((DI tmp1) (DI tmp2))
- (media-multiply-semantics conv lhs1 rhs1 tmp1)
- (media-multiply-semantics conv lhs2 rhs2 tmp2)
- (set tmp1 (add tmp1 tmp2))
- (saturate-v tmp1 max min sie res))
- )
- (define-pmacro (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
- (media-complex-semantics conv argihi rhs1 argilo rhs2 ACC40Sk
- max min (msr-sie-acci))))
- )
- (define-pmacro (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
- (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
- (media-complex-semantics-i conv argihi rhs1 argilo rhs2 ACC40Sk
- max min (msr-sie-acci))))
- )
- (define-pmacro (media-dual-complex
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
- (+ pack ACC40Sk op FRinti ope FRintj)
- (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (define-pmacro (media-dual-complex-i
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
- (+ pack ACC40Sk op FRinti ope FRintj)
- (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (media-dual-complex mcpxrs HI ext argjhi argjlo
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_20
- "Media dual complex real signed with saturation")
- (media-dual-complex mcpxru UHI zext argjhi argjlo
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_21
- "Media dual complex real unsigned with saturation")
- (media-dual-complex-i mcpxis HI ext argjlo argjhi
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_22
- "Media dual complex imaginary signed with saturation")
- (media-dual-complex-i mcpxiu UHI zext argjlo argjhi
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_23
- "Media dual complex imaginary unsigned with saturation")
- (define-pmacro (conditional-media-dual-complex
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
- (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
- (if (eq CCi (or cond 2))
- (media-dual-complex-semantics mode conv rhs1 rhs2 max min))
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (define-pmacro (conditional-media-dual-complex-i
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
- (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
- (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
- (if (eq CCi (or cond 2))
- (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min))
- ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
- (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
- )
- )
- (conditional-media-dual-complex cmcpxrs HI ext argjhi argjlo
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_75 OPE4_0
- "Conditional Media dual complex real signed with saturation")
- (conditional-media-dual-complex cmcpxru UHI zext argjhi argjlo
- (const DI #xffffffffff) (const DI 0)
- OP_75 OPE4_1
- "Conditional Media dual complex real unsigned with saturation")
- (conditional-media-dual-complex-i cmcpxis HI ext argjlo argjhi
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_75 OPE4_2
- "Conditional Media dual complex imaginary signed with saturation")
- (conditional-media-dual-complex-i cmcpxiu UHI zext argjlo argjhi
- (const DI #xffffffffff) (const DI 0)
- OP_75 OPE4_3
- "Conditional Media dual complex imaginary unsigned with saturation")
- (define-pmacro (media-quad-complex
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
- (+ pack ACC40Sk op FRintieven ope FRintjeven)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Sk 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-complex-semantics conv argihi rhs1 argilo rhs2
- ACC40Sk
- max min (msr-sie-acci))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-complex-semantics conv argihi rhs1 argilo rhs2
- (nextreg h-acc40S ACC40Sk 1)
- max min (msr-sie-acci-1))))))
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-complex
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (define-pmacro (media-quad-complex-i
- name mode conv rhs1 rhs2 max min op ope comment)
- (dni name
- (comment)
- ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
- (+ pack ACC40Sk op FRintieven ope FRintjeven)
- (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
- (if (register-unaligned ACC40Sk 2)
- (c-call VOID "@cpu@_media_acc_not_aligned")
- (if (orif (register-unaligned FRintieven 2)
- (register-unaligned FRintjeven 2))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ((mode argihi) (mode argilo)
- (mode argjhi) (mode argjlo))
- (extract-hilo FRintieven 0 FRintjeven 0
- argihi argilo argjhi argjlo)
- (media-complex-semantics-i conv argihi rhs1 argilo rhs2
- ACC40Sk
- max min (msr-sie-acci))
- (extract-hilo FRintieven 1 FRintjeven 1
- argihi argilo argjhi argjlo)
- (media-complex-semantics-i conv argihi rhs1 argilo rhs2
- (nextreg h-acc40S ACC40Sk 1)
- max min (msr-sie-acci-1))))))
- ((fr400 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-2-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-quad-complex
- (in FRinti FRintieven)
- (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
- )
- )
- (media-quad-complex mqcpxrs HI ext argjhi argjlo
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_24
- "Media quad complex real signed with saturation")
- (media-quad-complex mqcpxru UHI zext argjhi argjlo
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_25
- "Media quad complex real unsigned with saturation")
- (media-quad-complex-i mqcpxis HI ext argjlo argjhi
- (const DI #x7fffffffff) (const DI #xffffff8000000000)
- OP_7B OPE1_26
- "Media quad complex imaginary signed with saturation")
- (media-quad-complex-i mqcpxiu UHI zext argjlo argjhi
- (const DI #xffffffffff) (const DI 0)
- OP_7B OPE1_27
- "Media quad complex imaginary unsigned with saturation")
- (define-pmacro (media-pack src1 src2 targ offset)
- (sequence ()
- (set (halfword hi targ offset) (halfword lo src1 offset))
- (set (halfword lo targ offset) (halfword lo src2 offset)))
- )
- (define-pmacro (media-expand-halfword-to-word-semantics cond)
- (if cond
- (sequence ((UHI tmp))
- (if (and u6 1)
- (set tmp (halfword lo FRinti 0))
- (set tmp (halfword hi FRinti 0)))
- (set (halfword hi FRintk 0) tmp)
- (set (halfword lo FRintk 0) tmp)))
- )
- (dni mexpdhw
- "Media expand halfword to word"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mexpdhw$pack $FRinti,$u6,$FRintk"
- (+ pack FRintk OP_7B FRinti OPE1_32 u6)
- (media-expand-halfword-to-word-semantics 1)
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (dni cmexpdhw
- "Conditional media expand halfword to word"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
- "cmexpdhw$pack $FRinti,$u6,$FRintk,$CCi,$cond"
- (+ pack FRintk OP_76 FRinti CCi cond OPE4_2 u6)
- (media-expand-halfword-to-word-semantics (eq CCi (or cond 2)))
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (define-pmacro (media-expand-halfword-to-double-semantics cond)
- (if (register-unaligned FRintkeven 2)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ((UHI tmp))
- ; a hack to get FRintkeven referenced for profiling
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (if (and u6 1)
- (set tmp (halfword lo FRinti 0))
- (set tmp (halfword hi FRinti 0)))
- (set (halfword hi FRintkeven 0) tmp)
- (set (halfword lo FRintkeven 0) tmp)
- (set (halfword hi FRintkeven 1) tmp)
- (set (halfword lo FRintkeven 1) tmp))))
- )
- (dni mexpdhd
- "Media expand halfword to double"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mexpdhd$pack $FRinti,$u6,$FRintkeven"
- (+ pack FRintkeven OP_7B FRinti OPE1_33 u6)
- (media-expand-halfword-to-double-semantics 1)
- ((fr400 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-dual-expand)))
- )
- (dni cmexpdhd
- "Conditional media expand halfword to double"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
- "cmexpdhd$pack $FRinti,$u6,$FRintkeven,$CCi,$cond"
- (+ pack FRintkeven OP_76 FRinti CCi cond OPE4_3 u6)
- (media-expand-halfword-to-double-semantics (eq CCi (or cond 2)))
- ((fr400 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-dual-expand)))
- )
- (dni mpackh
- "Media halfword pack"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mpackh$pack $FRinti,$FRintj,$FRintk"
- (+ pack FRintk OP_7B FRinti OPE1_34 FRintj)
- (media-pack FRinti FRintj FRintk 0)
- ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
- (fr500 (unit u-media)) (fr550 (unit u-media)))
- )
- (dni mdpackh
- "Media dual pack"
- ((UNIT FM01) (FR500-MAJOR M-5) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mdpackh$pack $FRintieven,$FRintjeven,$FRintkeven"
- (+ pack FRintkeven OP_7B FRintieven OPE1_36 FRintjeven)
- (if (orif (register-unaligned FRintieven 2)
- (orif (register-unaligned FRintjeven 2)
- (register-unaligned FRintkeven 2)))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
- (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (media-pack FRintieven FRintjeven FRintkeven 0)
- (media-pack FRintieven FRintjeven FRintkeven 1)))
- ((fr400 (unit u-media-3-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-3-quad
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-quad-arith
- (in FRinti FRintieven)
- (in FRintj FRintjeven)
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-quad)))
- )
- (define-pmacro (media-unpack src soff targ toff)
- (sequence ()
- (set (halfword hi targ toff) (halfword hi src soff))
- (set (halfword lo targ toff) (halfword hi src soff))
- (set (halfword hi targ (add toff 1)) (halfword lo src soff))
- (set (halfword lo targ (add toff 1)) (halfword lo src soff)))
- )
- (dni munpackh
- "Media halfword unpack"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "munpackh$pack $FRinti,$FRintkeven"
- (+ pack FRintkeven OP_7B FRinti OPE1_35 (FRj-null))
- (if (register-unaligned FRintkeven 2)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (media-unpack FRinti 0 FRintkeven 0)))
- ((fr400 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-dual-expand)))
- )
- (dni mdunpackh
- "Media dual unpack"
- ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
- "mdunpackh$pack $FRintieven,$FRintk"
- (+ pack FRintk OP_7B FRintieven OPE1_37 (FRj-null))
- (if (orif (register-unaligned FRintieven 2) (register-unaligned FRintk 4))
- (c-call VOID "@cpu@_media_register_not_aligned")
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (media-unpack FRintieven 0 FRintk 0)
- (media-unpack FRintieven 1 FRintk 2)))
- ((fr500 (unit u-media-dual-unpack
- (in FRinti FRintieven))))
- )
- (define-pmacro (ubyte num arg offset)
- (reg (.sym h-fr_ num) (add (index-of arg) offset)))
- (define-pmacro (mbtoh-semantics cond)
- (if (register-unaligned FRintkeven 2)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ()
- (set (halfword hi FRintkeven 0) (ubyte 3 FRintj 0))
- (set (halfword lo FRintkeven 0) (ubyte 2 FRintj 0))
- (set (halfword hi FRintkeven 1) (ubyte 1 FRintj 0))
- (set (halfword lo FRintkeven 1) (ubyte 0 FRintj 0)))))
- )
- (dni mbtoh
- "Media convert byte to halfword"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mbtoh$pack $FRintj,$FRintkeven"
- (+ pack FRintkeven OP_7B (FRi-null) OPE1_38 FRintj)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (mbtoh-semantics 1))
- ((fr400 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-dual-btoh
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-dual-expand)))
- )
- (dni cmbtoh
- "Conditional media convert byte to halfword"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
- "cmbtoh$pack $FRintj,$FRintkeven,$CCi,$cond"
- (+ pack FRintkeven OP_77 (FRi-null) CCi cond OPE4_0 FRintj)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
- (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
- (mbtoh-semantics (eq CCi (or cond 2))))
- ((fr400 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr450 (unit u-media-dual-expand
- (out FRintk FRintkeven)))
- (fr500 (unit u-media-dual-btoh
- (out FRintk FRintkeven)))
- (fr550 (unit u-media-dual-expand
- (in FRinti FRintj))))
- )
- (define-pmacro (mhtob-semantics cond)
- (if (register-unaligned FRintjeven 2)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ()
- (set (ubyte 3 FRintk 0) (halfword hi FRintjeven 0))
- (set (ubyte 2 FRintk 0) (halfword lo FRintjeven 0))
- (set (ubyte 1 FRintk 0) (halfword hi FRintjeven 1))
- (set (ubyte 0 FRintk 0) (halfword lo FRintjeven 1)))))
- )
- (dni mhtob
- "Media convert halfword to byte"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2))
- "mhtob$pack $FRintjeven,$FRintk"
- (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintjeven)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (mhtob-semantics 1))
- ((fr400 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr550 (unit u-media-3-dual
- (in FRinti FRintjeven))))
- )
- (dni cmhtob
- "Conditional media convert halfword to byte"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
- "cmhtob$pack $FRintjeven,$FRintk,$CCi,$cond"
- (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintjeven)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (mhtob-semantics (eq CCi (or cond 2))))
- ((fr400 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr450 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr500 (unit u-media-dual-htob
- (in FRintj FRintjeven)))
- (fr550 (unit u-media-3-dual
- (in FRinti FRintjeven))))
- )
- (define-pmacro (mbtohe-semantics cond)
- (if (register-unaligned FRintk 4)
- (c-call VOID "@cpu@_media_register_not_aligned")
- (if cond
- (sequence ()
- (set (halfword hi FRintk 0) (ubyte 3 FRintj 0))
- (set (halfword lo FRintk 0) (ubyte 3 FRintj 0))
- (set (halfword hi FRintk 1) (ubyte 2 FRintj 0))
- (set (halfword lo FRintk 1) (ubyte 2 FRintj 0))
- (set (halfword hi FRintk 2) (ubyte 1 FRintj 0))
- (set (halfword lo FRintk 2) (ubyte 1 FRintj 0))
- (set (halfword hi FRintk 3) (ubyte 0 FRintj 0))
- (set (halfword lo FRintk 3) (ubyte 0 FRintj 0)))))
- )
- (dni mbtohe
- "Media convert byte to halfword extended"
- ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
- "mbtohe$pack $FRintj,$FRintk"
- (+ pack FRintk OP_7B (FRi-null) OPE1_3A FRintj)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (mbtohe-semantics 1))
- ((fr500 (unit u-media-dual-btohe)))
- )
- (dni cmbtohe
- "Conditional media convert byte to halfword extended"
- ((UNIT FM01) (FR500-MAJOR M-7) CONDITIONAL (MACH simple,tomcat,frv))
- "cmbtohe$pack $FRintj,$FRintk,$CCi,$cond"
- (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_2 FRintj)
- (sequence ()
- ; hack to get these referenced for profiling
- (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
- (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
- (mbtohe-semantics (eq CCi (or cond 2))))
- ((fr500 (unit u-media-dual-btohe)))
- )
- ; Media NOP
- ; A special case of mclracc
- (dni mnop "Media nop"
- ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-1)
- (FR400-MAJOR M-1) (FR450-MAJOR M-1))
- "mnop$pack"
- (+ pack (f-ACC40Sk 63) OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
- (nop)
- ()
- )
- ; mclracc with #A==0
- (dni mclracc-0
- "Media clear accumulator(s)"
- ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- "mclracc$pack $ACC40Sk,$A0"
- (+ pack ACC40Sk OP_7B (f-A 0) (misc-null-10) OPE1_3B (FRj-null))
- (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 0)
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
- )
- ; mclracc with #A==1
- (dni mclracc-1
- "Media clear accumulator(s)"
- ((UNIT MCLRACC-1) (FR500-MAJOR M-6) (FR550-MAJOR M-3)
- (FR400-MAJOR M-2) (FR450-MAJOR M-4))
- "mclracc$pack $ACC40Sk,$A1"
- (+ pack ACC40Sk OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
- (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 1)
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4-mclracca))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
- )
- (dni mrdacc
- "Media read accumulator"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-5))
- "mrdacc$pack $ACC40Si,$FRintk"
- (+ pack FRintk OP_7B ACC40Si OPE1_3C (FRj-null))
- (set FRintk ACC40Si)
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
- )
- (dni mrdaccg
- "Media read accumulator guard"
- ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-5))
- "mrdaccg$pack $ACCGi,$FRintk"
- (+ pack FRintk OP_7B ACCGi OPE1_3E (FRj-null))
- (set FRintk ACCGi)
- ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-acc (in ACC40Si ACCGi))))
- )
- (dni mwtacc
- "Media write accumulator"
- ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- "mwtacc$pack $FRinti,$ACC40Sk"
- (+ pack ACC40Sk OP_7B FRinti OPE1_3D (FRj-null))
- (set ACC40Sk (or (and ACC40Sk (const DI #xffffffff00000000))
- FRinti))
- ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc)))
- )
- (dni mwtaccg
- "Media write accumulator guard"
- ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
- (FR400-MAJOR M-1) (FR450-MAJOR M-3))
- "mwtaccg$pack $FRinti,$ACCGk"
- (+ pack ACCGk OP_7B FRinti OPE1_3F (FRj-null))
- (sequence ()
- ; hack to get these referenced for profiling
- (c-raw-call VOID "frv_ref_SI" ACCGk)
- (set ACCGk FRinti))
- ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
- (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc (in ACC40Sk ACCGk))))
- )
- (define-pmacro (media-cop num op)
- (dni (.sym mcop num)
- "Media custom instruction"
- ((UNIT FM01) (FR500-MAJOR M-1) (MACH frv))
- (.str "mcop" num "$pack $FRi,$FRj,$FRk")
- (+ pack FRk op FRi OPE1_00 FRj)
- (c-call VOID "@cpu@_media_cop" num)
- ()
- )
- )
- (media-cop 1 OP_7C)
- (media-cop 2 OP_7D)
- ; nop
- ; A nop is defined to be a "ori gr0,0,gr0"
- ; This needn't be a macro-insn, but making it one greatly simplifies decode.c
- ; On the other hand spending a little time in the decoder is often worth it.
- ;
- (dnmi nop "nop"
- ((UNIT IALL) (FR500-MAJOR I-1) (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "nop$pack"
- (emit ori pack (GRi 0) (s12 0) (GRk 0))
- )
- ; Floating point NOP
- (dni fnop
- "Floating point nop"
- ((UNIT FMALL) (FR500-MAJOR F-8) (FR550-MAJOR F-1) (MACH simple,tomcat,fr500,fr550,frv))
- "fnop$pack"
- (+ pack (rd-null) OP_79 (FRi-null) OPE1_0D (FRj-null))
- (nop)
- ()
- )
- ; A return instruction
- (dnmi ret "return"
- (NO-DIS (UNIT B01) (FR500-MAJOR B-3)
- (FR400-MAJOR B-3) (FR450-MAJOR B-3))
- "ret$pack"
- (emit bralr pack (hint_taken 2))
- )
- (dnmi cmp "compare"
- (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "cmp$pack $GRi,$GRj,$ICCi_1"
- (emit subcc pack GRi GRj (GRk 0) ICCi_1)
- )
- (dnmi cmpi "compare immediate"
- (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "cmpi$pack $GRi,$s10,$ICCi_1"
- (emit subicc pack GRi s10 (GRk 0) ICCi_1)
- )
- (dnmi ccmp "conditional compare"
- (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "ccmp$pack $GRi,$GRj,$CCi,$cond"
- (emit csubcc pack GRi GRj (GRk 0) CCi cond)
- )
- (dnmi mov "move"
- (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1))
- "mov$pack $GRi,$GRk"
- (emit ori pack GRi (s12 0) GRk)
- )
- (dnmi cmov "conditional move"
- (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
- (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
- "cmov$pack $GRi,$GRk,$CCi,$cond"
- (emit cor pack GRi (GRj 0) GRk CCi cond)
- )
|