target.def 299 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724
  1. /* Target hook definitions.
  2. Copyright (C) 2001-2019 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by the
  5. Free Software Foundation; either version 3, or (at your option) any
  6. later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; see the file COPYING3. If not see
  13. <http://www.gnu.org/licenses/>.
  14. In other words, you are welcome to use, share and improve this program.
  15. You are forbidden to forbid anyone else to use, share and improve
  16. what you give them. Help stamp out software-hoarding! */
  17. /* See target-hooks-macros.h for details of macros that should be
  18. provided by the including file, and how to use them here. */
  19. #include "target-hooks-macros.h"
  20. #undef HOOK_TYPE
  21. #define HOOK_TYPE "Target Hook"
  22. HOOK_VECTOR (TARGET_INITIALIZER, gcc_target)
  23. /* Functions that output assembler for the target. */
  24. #define HOOK_PREFIX "TARGET_ASM_"
  25. HOOK_VECTOR (TARGET_ASM_OUT, asm_out)
  26. /* Opening and closing parentheses for asm expression grouping. */
  27. DEFHOOKPOD
  28. (open_paren,
  29. "These target hooks are C string constants, describing the syntax in the\n\
  30. assembler for grouping arithmetic expressions. If not overridden, they\n\
  31. default to normal parentheses, which is correct for most assemblers.",
  32. const char *, "(")
  33. DEFHOOKPODX (close_paren, const char *, ")")
  34. /* Assembler instructions for creating various kinds of integer object. */
  35. DEFHOOKPOD
  36. (byte_op,
  37. "@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP\n\
  38. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PSI_OP\n\
  39. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP\n\
  40. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PDI_OP\n\
  41. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP\n\
  42. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PTI_OP\n\
  43. @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP\n\
  44. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP\n\
  45. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PSI_OP\n\
  46. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP\n\
  47. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PDI_OP\n\
  48. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP\n\
  49. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PTI_OP\n\
  50. @deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP\n\
  51. These hooks specify assembly directives for creating certain kinds\n\
  52. of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a\n\
  53. byte-sized object, the @code{TARGET_ASM_ALIGNED_HI_OP} one creates an\n\
  54. aligned two-byte object, and so on. Any of the hooks may be\n\
  55. @code{NULL}, indicating that no suitable directive is available.\n\
  56. \n\
  57. The compiler will print these strings at the start of a new line,\n\
  58. followed immediately by the object's initial value. In most cases,\n\
  59. the string should contain a tab, a pseudo-op, and then another tab.",
  60. const char *, "\t.byte\t")
  61. DEFHOOKPOD (aligned_op, "*", struct asm_int_op, TARGET_ASM_ALIGNED_INT_OP)
  62. DEFHOOKPOD (unaligned_op, "*", struct asm_int_op, TARGET_ASM_UNALIGNED_INT_OP)
  63. /* Try to output the assembler code for an integer object whose
  64. value is given by X. SIZE is the size of the object in bytes and
  65. ALIGNED_P indicates whether it is aligned. Return true if
  66. successful. Only handles cases for which BYTE_OP, ALIGNED_OP
  67. and UNALIGNED_OP are NULL. */
  68. DEFHOOK
  69. (integer,
  70. "The @code{assemble_integer} function uses this hook to output an\n\
  71. integer object. @var{x} is the object's value, @var{size} is its size\n\
  72. in bytes and @var{aligned_p} indicates whether it is aligned. The\n\
  73. function should return @code{true} if it was able to output the\n\
  74. object. If it returns false, @code{assemble_integer} will try to\n\
  75. split the object into smaller parts.\n\
  76. \n\
  77. The default implementation of this hook will use the\n\
  78. @code{TARGET_ASM_BYTE_OP} family of strings, returning @code{false}\n\
  79. when the relevant string is @code{NULL}.",
  80. /* Only handles cases for which BYTE_OP, ALIGNED_OP and UNALIGNED_OP are
  81. NULL. */
  82. bool, (rtx x, unsigned int size, int aligned_p),
  83. default_assemble_integer)
  84. /* Assembly strings required after the .cfi_startproc label. */
  85. DEFHOOK
  86. (post_cfi_startproc,
  87. "This target hook is used to emit assembly strings required by the target\n\
  88. after the .cfi_startproc directive. The first argument is the file stream to\n\
  89. write the strings to and the second argument is the function\'s declaration. The\n\
  90. expected use is to add more .cfi_* directives.\n\
  91. \n\
  92. The default is to not output any assembly strings.",
  93. void, (FILE *, tree),
  94. hook_void_FILEptr_tree)
  95. /* Notify the backend that we have completed emitting the data for a
  96. decl. */
  97. DEFHOOK
  98. (decl_end,
  99. "Define this hook if the target assembler requires a special marker to\n\
  100. terminate an initialized variable declaration.",
  101. void, (void),
  102. hook_void_void)
  103. /* Output code that will globalize a label. */
  104. DEFHOOK
  105. (globalize_label,
  106. "This target hook is a function to output to the stdio stream\n\
  107. @var{stream} some commands that will make the label @var{name} global;\n\
  108. that is, available for reference from other files.\n\
  109. \n\
  110. The default implementation relies on a proper definition of\n\
  111. @code{GLOBAL_ASM_OP}.",
  112. void, (FILE *stream, const char *name),
  113. default_globalize_label)
  114. /* Output code that will globalize a declaration. */
  115. DEFHOOK
  116. (globalize_decl_name,
  117. "This target hook is a function to output to the stdio stream\n\
  118. @var{stream} some commands that will make the name associated with @var{decl}\n\
  119. global; that is, available for reference from other files.\n\
  120. \n\
  121. The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.",
  122. void, (FILE *stream, tree decl), default_globalize_decl_name)
  123. /* Output code that will declare an external variable. */
  124. DEFHOOK
  125. (assemble_undefined_decl,
  126. "This target hook is a function to output to the stdio stream\n\
  127. @var{stream} some commands that will declare the name associated with\n\
  128. @var{decl} which is not defined in the current translation unit. Most\n\
  129. assemblers do not require anything to be output in this case.",
  130. void, (FILE *stream, const char *name, const_tree decl),
  131. hook_void_FILEptr_constcharptr_const_tree)
  132. /* Output code that will emit a label for unwind info, if this
  133. target requires such labels. Second argument is the decl the
  134. unwind info is associated with, third is a boolean: true if
  135. this is for exception handling, fourth is a boolean: true if
  136. this is only a placeholder for an omitted FDE. */
  137. DEFHOOK
  138. (emit_unwind_label,
  139. "This target hook emits a label at the beginning of each FDE@. It\n\
  140. should be defined on targets where FDEs need special labels, and it\n\
  141. should write the appropriate label, for the FDE associated with the\n\
  142. function declaration @var{decl}, to the stdio stream @var{stream}.\n\
  143. The third argument, @var{for_eh}, is a boolean: true if this is for an\n\
  144. exception table. The fourth argument, @var{empty}, is a boolean:\n\
  145. true if this is a placeholder label for an omitted FDE@.\n\
  146. \n\
  147. The default is that FDEs are not given nonlocal labels.",
  148. void, (FILE *stream, tree decl, int for_eh, int empty),
  149. default_emit_unwind_label)
  150. /* Output code that will emit a label to divide up the exception table. */
  151. DEFHOOK
  152. (emit_except_table_label,
  153. "This target hook emits a label at the beginning of the exception table.\n\
  154. It should be defined on targets where it is desirable for the table\n\
  155. to be broken up according to function.\n\
  156. \n\
  157. The default is that no label is emitted.",
  158. void, (FILE *stream),
  159. default_emit_except_table_label)
  160. /* Emit a directive for setting the personality for the function. */
  161. DEFHOOK
  162. (emit_except_personality,
  163. "If the target implements @code{TARGET_ASM_UNWIND_EMIT}, this hook may be\
  164. used to emit a directive to install a personality hook into the unwind\
  165. info. This hook should not be used if dwarf2 unwind info is used.",
  166. void, (rtx personality),
  167. NULL)
  168. /* Emit any directives required to unwind this instruction. */
  169. DEFHOOK
  170. (unwind_emit,
  171. "This target hook emits assembly directives required to unwind the\n\
  172. given instruction. This is only used when @code{TARGET_EXCEPT_UNWIND_INFO}\n\
  173. returns @code{UI_TARGET}.",
  174. void, (FILE *stream, rtx_insn *insn),
  175. NULL)
  176. DEFHOOKPOD
  177. (unwind_emit_before_insn,
  178. "True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before\
  179. the assembly for @var{insn} has been emitted, false if the hook should\
  180. be called afterward.",
  181. bool, true)
  182. /* Generate an internal label.
  183. For now this is just a wrapper for ASM_GENERATE_INTERNAL_LABEL. */
  184. DEFHOOK_UNDOC
  185. (generate_internal_label,
  186. "",
  187. void, (char *buf, const char *prefix, unsigned long labelno),
  188. default_generate_internal_label)
  189. /* Output an internal label. */
  190. DEFHOOK
  191. (internal_label,
  192. "A function to output to the stdio stream @var{stream} a label whose\n\
  193. name is made from the string @var{prefix} and the number @var{labelno}.\n\
  194. \n\
  195. It is absolutely essential that these labels be distinct from the labels\n\
  196. used for user-level functions and variables. Otherwise, certain programs\n\
  197. will have name conflicts with internal labels.\n\
  198. \n\
  199. It is desirable to exclude internal labels from the symbol table of the\n\
  200. object file. Most assemblers have a naming convention for labels that\n\
  201. should be excluded; on many systems, the letter @samp{L} at the\n\
  202. beginning of a label has this effect. You should find out what\n\
  203. convention your system uses, and follow it.\n\
  204. \n\
  205. The default version of this function utilizes @code{ASM_GENERATE_INTERNAL_LABEL}.",
  206. void, (FILE *stream, const char *prefix, unsigned long labelno),
  207. default_internal_label)
  208. /* Output label for the constant. */
  209. DEFHOOK
  210. (declare_constant_name,
  211. "A target hook to output to the stdio stream @var{file} any text necessary\n\
  212. for declaring the name @var{name} of a constant which is being defined. This\n\
  213. target hook is responsible for outputting the label definition (perhaps using\n\
  214. @code{assemble_label}). The argument @var{exp} is the value of the constant,\n\
  215. and @var{size} is the size of the constant in bytes. The @var{name}\n\
  216. will be an internal label.\n\
  217. \n\
  218. The default version of this target hook, define the @var{name} in the\n\
  219. usual manner as a label (by means of @code{assemble_label}).\n\
  220. \n\
  221. You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in this target hook.",
  222. void, (FILE *file, const char *name, const_tree expr, HOST_WIDE_INT size),
  223. default_asm_declare_constant_name)
  224. /* Emit a ttype table reference to a typeinfo object. */
  225. DEFHOOK
  226. (ttype,
  227. "This hook is used to output a reference from a frame unwinding table to\n\
  228. the type_info object identified by @var{sym}. It should return @code{true}\n\
  229. if the reference was output. Returning @code{false} will cause the\n\
  230. reference to be output using the normal Dwarf2 routines.",
  231. bool, (rtx sym),
  232. hook_bool_rtx_false)
  233. /* Emit an assembler directive to set visibility for the symbol
  234. associated with the tree decl. */
  235. DEFHOOK
  236. (assemble_visibility,
  237. "This target hook is a function to output to @var{asm_out_file} some\n\
  238. commands that will make the symbol(s) associated with @var{decl} have\n\
  239. hidden, protected or internal visibility as specified by @var{visibility}.",
  240. void, (tree decl, int visibility),
  241. default_assemble_visibility)
  242. DEFHOOK
  243. (print_patchable_function_entry,
  244. "Generate a patchable area at the function start, consisting of\n\
  245. @var{patch_area_size} NOP instructions. If the target supports named\n\
  246. sections and if @var{record_p} is true, insert a pointer to the current\n\
  247. location in the table of patchable functions. The default implementation\n\
  248. of the hook places the table of pointers in the special section named\n\
  249. @code{__patchable_function_entries}.",
  250. void, (FILE *file, unsigned HOST_WIDE_INT patch_area_size, bool record_p),
  251. default_print_patchable_function_entry)
  252. /* Output the assembler code for entry to a function. */
  253. DEFHOOK
  254. (function_prologue,
  255. "If defined, a function that outputs the assembler code for entry to a\n\
  256. function. The prologue is responsible for setting up the stack frame,\n\
  257. initializing the frame pointer register, saving registers that must be\n\
  258. saved, and allocating @var{size} additional bytes of storage for the\n\
  259. local variables. @var{file} is a stdio stream to which the assembler\n\
  260. code should be output.\n\
  261. \n\
  262. The label for the beginning of the function need not be output by this\n\
  263. macro. That has already been done when the macro is run.\n\
  264. \n\
  265. @findex regs_ever_live\n\
  266. To determine which registers to save, the macro can refer to the array\n\
  267. @code{regs_ever_live}: element @var{r} is nonzero if hard register\n\
  268. @var{r} is used anywhere within the function. This implies the function\n\
  269. prologue should save register @var{r}, provided it is not one of the\n\
  270. call-used registers. (@code{TARGET_ASM_FUNCTION_EPILOGUE} must likewise use\n\
  271. @code{regs_ever_live}.)\n\
  272. \n\
  273. On machines that have ``register windows'', the function entry code does\n\
  274. not save on the stack the registers that are in the windows, even if\n\
  275. they are supposed to be preserved by function calls; instead it takes\n\
  276. appropriate steps to ``push'' the register stack, if any non-call-used\n\
  277. registers are used in the function.\n\
  278. \n\
  279. @findex frame_pointer_needed\n\
  280. On machines where functions may or may not have frame-pointers, the\n\
  281. function entry code must vary accordingly; it must set up the frame\n\
  282. pointer if one is wanted, and not otherwise. To determine whether a\n\
  283. frame pointer is in wanted, the macro can refer to the variable\n\
  284. @code{frame_pointer_needed}. The variable's value will be 1 at run\n\
  285. time in a function that needs a frame pointer. @xref{Elimination}.\n\
  286. \n\
  287. The function entry code is responsible for allocating any stack space\n\
  288. required for the function. This stack space consists of the regions\n\
  289. listed below. In most cases, these regions are allocated in the\n\
  290. order listed, with the last listed region closest to the top of the\n\
  291. stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and\n\
  292. the highest address if it is not defined). You can use a different order\n\
  293. for a machine if doing so is more convenient or required for\n\
  294. compatibility reasons. Except in cases where required by standard\n\
  295. or by a debugger, there is no reason why the stack layout used by GCC\n\
  296. need agree with that used by other compilers for a machine.",
  297. void, (FILE *file),
  298. default_function_pro_epilogue)
  299. /* Output the assembler code for end of prologue. */
  300. DEFHOOK
  301. (function_end_prologue,
  302. "If defined, a function that outputs assembler code at the end of a\n\
  303. prologue. This should be used when the function prologue is being\n\
  304. emitted as RTL, and you have some extra assembler that needs to be\n\
  305. emitted. @xref{prologue instruction pattern}.",
  306. void, (FILE *file),
  307. no_asm_to_stream)
  308. /* Output the assembler code for start of epilogue. */
  309. DEFHOOK
  310. (function_begin_epilogue,
  311. "If defined, a function that outputs assembler code at the start of an\n\
  312. epilogue. This should be used when the function epilogue is being\n\
  313. emitted as RTL, and you have some extra assembler that needs to be\n\
  314. emitted. @xref{epilogue instruction pattern}.",
  315. void, (FILE *file),
  316. no_asm_to_stream)
  317. /* Output the assembler code for function exit. */
  318. DEFHOOK
  319. (function_epilogue,
  320. "If defined, a function that outputs the assembler code for exit from a\n\
  321. function. The epilogue is responsible for restoring the saved\n\
  322. registers and stack pointer to their values when the function was\n\
  323. called, and returning control to the caller. This macro takes the\n\
  324. same argument as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the\n\
  325. registers to restore are determined from @code{regs_ever_live} and\n\
  326. @code{CALL_USED_REGISTERS} in the same way.\n\
  327. \n\
  328. On some machines, there is a single instruction that does all the work\n\
  329. of returning from the function. On these machines, give that\n\
  330. instruction the name @samp{return} and do not define the macro\n\
  331. @code{TARGET_ASM_FUNCTION_EPILOGUE} at all.\n\
  332. \n\
  333. Do not define a pattern named @samp{return} if you want the\n\
  334. @code{TARGET_ASM_FUNCTION_EPILOGUE} to be used. If you want the target\n\
  335. switches to control whether return instructions or epilogues are used,\n\
  336. define a @samp{return} pattern with a validity condition that tests the\n\
  337. target switches appropriately. If the @samp{return} pattern's validity\n\
  338. condition is false, epilogues will be used.\n\
  339. \n\
  340. On machines where functions may or may not have frame-pointers, the\n\
  341. function exit code must vary accordingly. Sometimes the code for these\n\
  342. two cases is completely different. To determine whether a frame pointer\n\
  343. is wanted, the macro can refer to the variable\n\
  344. @code{frame_pointer_needed}. The variable's value will be 1 when compiling\n\
  345. a function that needs a frame pointer.\n\
  346. \n\
  347. Normally, @code{TARGET_ASM_FUNCTION_PROLOGUE} and\n\
  348. @code{TARGET_ASM_FUNCTION_EPILOGUE} must treat leaf functions specially.\n\
  349. The C variable @code{current_function_is_leaf} is nonzero for such a\n\
  350. function. @xref{Leaf Functions}.\n\
  351. \n\
  352. On some machines, some functions pop their arguments on exit while\n\
  353. others leave that for the caller to do. For example, the 68020 when\n\
  354. given @option{-mrtd} pops arguments in functions that take a fixed\n\
  355. number of arguments.\n\
  356. \n\
  357. @findex pops_args\n\
  358. @findex crtl->args.pops_args\n\
  359. Your definition of the macro @code{RETURN_POPS_ARGS} decides which\n\
  360. functions pop their own arguments. @code{TARGET_ASM_FUNCTION_EPILOGUE}\n\
  361. needs to know what was decided. The number of bytes of the current\n\
  362. function's arguments that this function should pop is available in\n\
  363. @code{crtl->args.pops_args}. @xref{Scalar Return}.",
  364. void, (FILE *file),
  365. default_function_pro_epilogue)
  366. /* Initialize target-specific sections. */
  367. DEFHOOK
  368. (init_sections,
  369. "Define this hook if you need to do something special to set up the\n\
  370. @file{varasm.c} sections, or if your target has some special sections\n\
  371. of its own that you need to create.\n\
  372. \n\
  373. GCC calls this hook after processing the command line, but before writing\n\
  374. any assembly code, and before calling any of the section-returning hooks\n\
  375. described below.",
  376. void, (void),
  377. hook_void_void)
  378. /* Tell assembler to change to section NAME with attributes FLAGS.
  379. If DECL is non-NULL, it is the VAR_DECL or FUNCTION_DECL with
  380. which this section is associated. */
  381. DEFHOOK
  382. (named_section,
  383. "Output assembly directives to switch to section @var{name}. The section\n\
  384. should have attributes as specified by @var{flags}, which is a bit mask\n\
  385. of the @code{SECTION_*} flags defined in @file{output.h}. If @var{decl}\n\
  386. is non-NULL, it is the @code{VAR_DECL} or @code{FUNCTION_DECL} with which\n\
  387. this section is associated.",
  388. void, (const char *name, unsigned int flags, tree decl),
  389. default_no_named_section)
  390. /* Tell assembler what section attributes to assign this elf section
  391. declaration, using their numerical value. */
  392. DEFHOOK
  393. (elf_flags_numeric,
  394. "This hook can be used to encode ELF section flags for which no letter\n\
  395. code has been defined in the assembler. It is called by\n\
  396. @code{default_asm_named_section} whenever the section flags need to be\n\
  397. emitted in the assembler output. If the hook returns true, then the\n\
  398. numerical value for ELF section flags should be calculated from\n\
  399. @var{flags} and saved in @var{*num}; the value is printed out instead of the\n\
  400. normal sequence of letter codes. If the hook is not defined, or if it\n\
  401. returns false, then @var{num} is ignored and the traditional letter sequence\n\
  402. is emitted.",
  403. bool, (unsigned int flags, unsigned int *num),
  404. hook_bool_uint_uintp_false)
  405. /* Return preferred text (sub)section for function DECL.
  406. Main purpose of this function is to separate cold, normal and hot
  407. functions. STARTUP is true when function is known to be used only
  408. at startup (from static constructors or it is main()).
  409. EXIT is true when function is known to be used only at exit
  410. (from static destructors).
  411. Return NULL if function should go to default text section. */
  412. DEFHOOK
  413. (function_section,
  414. "Return preferred text (sub)section for function @var{decl}.\n\
  415. Main purpose of this function is to separate cold, normal and hot\n\
  416. functions. @var{startup} is true when function is known to be used only\n\
  417. at startup (from static constructors or it is @code{main()}).\n\
  418. @var{exit} is true when function is known to be used only at exit\n\
  419. (from static destructors).\n\
  420. Return NULL if function should go to default text section.",
  421. section *, (tree decl, enum node_frequency freq, bool startup, bool exit),
  422. default_function_section)
  423. /* Output the assembler code for function exit. */
  424. DEFHOOK
  425. (function_switched_text_sections,
  426. "Used by the target to emit any assembler directives or additional\
  427. labels needed when a function is partitioned between different\
  428. sections. Output should be written to @var{file}. The function\
  429. decl is available as @var{decl} and the new section is `cold' if\
  430. @var{new_is_cold} is @code{true}.",
  431. void, (FILE *file, tree decl, bool new_is_cold),
  432. default_function_switched_text_sections)
  433. /* Return a mask describing how relocations should be treated when
  434. selecting sections. Bit 1 should be set if global relocations
  435. should be placed in a read-write section; bit 0 should be set if
  436. local relocations should be placed in a read-write section. */
  437. DEFHOOK
  438. (reloc_rw_mask,
  439. "Return a mask describing how relocations should be treated when\n\
  440. selecting sections. Bit 1 should be set if global relocations\n\
  441. should be placed in a read-write section; bit 0 should be set if\n\
  442. local relocations should be placed in a read-write section.\n\
  443. \n\
  444. The default version of this function returns 3 when @option{-fpic}\n\
  445. is in effect, and 0 otherwise. The hook is typically redefined\n\
  446. when the target cannot support (some kinds of) dynamic relocations\n\
  447. in read-only sections even in executables.",
  448. int, (void),
  449. default_reloc_rw_mask)
  450. /* Return a flag for either generating ADDR_DIF_VEC table
  451. or ADDR_VEC table for jumps in case of -fPIC/-fPIE. */
  452. DEFHOOK
  453. (generate_pic_addr_diff_vec,
  454. "Return true to generate ADDR_DIF_VEC table\n\
  455. or false to generate ADDR_VEC table for jumps in case of -fPIC.\n\
  456. \n\
  457. The default version of this function returns true if flag_pic\n\
  458. equals true and false otherwise",
  459. bool, (void),
  460. default_generate_pic_addr_diff_vec)
  461. /* Return a section for EXP. It may be a DECL or a constant. RELOC
  462. is nonzero if runtime relocations must be applied; bit 1 will be
  463. set if the runtime relocations require non-local name resolution.
  464. ALIGN is the required alignment of the data. */
  465. DEFHOOK
  466. (select_section,
  467. "Return the section into which @var{exp} should be placed. You can\n\
  468. assume that @var{exp} is either a @code{VAR_DECL} node or a constant of\n\
  469. some sort. @var{reloc} indicates whether the initial value of @var{exp}\n\
  470. requires link-time relocations. Bit 0 is set when variable contains\n\
  471. local relocations only, while bit 1 is set for global relocations.\n\
  472. @var{align} is the constant alignment in bits.\n\
  473. \n\
  474. The default version of this function takes care of putting read-only\n\
  475. variables in @code{readonly_data_section}.\n\
  476. \n\
  477. See also @var{USE_SELECT_SECTION_FOR_FUNCTIONS}.",
  478. section *, (tree exp, int reloc, unsigned HOST_WIDE_INT align),
  479. default_select_section)
  480. /* Return a section for X. MODE is X's mode and ALIGN is its
  481. alignment in bits. */
  482. DEFHOOK
  483. (select_rtx_section,
  484. "Return the section into which a constant @var{x}, of mode @var{mode},\n\
  485. should be placed. You can assume that @var{x} is some kind of\n\
  486. constant in RTL@. The argument @var{mode} is redundant except in the\n\
  487. case of a @code{const_int} rtx. @var{align} is the constant alignment\n\
  488. in bits.\n\
  489. \n\
  490. The default version of this function takes care of putting symbolic\n\
  491. constants in @code{flag_pic} mode in @code{data_section} and everything\n\
  492. else in @code{readonly_data_section}.",
  493. section *, (machine_mode mode, rtx x, unsigned HOST_WIDE_INT align),
  494. default_select_rtx_section)
  495. /* Select a unique section name for DECL. RELOC is the same as
  496. for SELECT_SECTION. */
  497. DEFHOOK
  498. (unique_section,
  499. "Build up a unique section name, expressed as a @code{STRING_CST} node,\n\
  500. and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.\n\
  501. As with @code{TARGET_ASM_SELECT_SECTION}, @var{reloc} indicates whether\n\
  502. the initial value of @var{exp} requires link-time relocations.\n\
  503. \n\
  504. The default version of this function appends the symbol name to the\n\
  505. ELF section name that would normally be used for the symbol. For\n\
  506. example, the function @code{foo} would be placed in @code{.text.foo}.\n\
  507. Whatever the actual target object format, this is often good enough.",
  508. void, (tree decl, int reloc),
  509. default_unique_section)
  510. /* Return the readonly data section associated with function DECL. */
  511. DEFHOOK
  512. (function_rodata_section,
  513. "Return the readonly data section associated with\n\
  514. @samp{DECL_SECTION_NAME (@var{decl})}.\n\
  515. The default version of this function selects @code{.gnu.linkonce.r.name} if\n\
  516. the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name}\n\
  517. if function is in @code{.text.name}, and the normal readonly-data section\n\
  518. otherwise.",
  519. section *, (tree decl),
  520. default_function_rodata_section)
  521. /* Nonnull if the target wants to override the default ".rodata" prefix
  522. for mergeable data sections. */
  523. DEFHOOKPOD
  524. (mergeable_rodata_prefix,
  525. "Usually, the compiler uses the prefix @code{\".rodata\"} to construct\n\
  526. section names for mergeable constant data. Define this macro to override\n\
  527. the string if a different section name should be used.",
  528. const char *, ".rodata")
  529. /* Return the section to be used for transactional memory clone tables. */
  530. DEFHOOK
  531. (tm_clone_table_section,
  532. "Return the section that should be used for transactional memory clone\
  533. tables.",
  534. section *, (void), default_clone_table_section)
  535. /* Output a constructor for a symbol with a given priority. */
  536. DEFHOOK
  537. (constructor,
  538. "If defined, a function that outputs assembler code to arrange to call\n\
  539. the function referenced by @var{symbol} at initialization time.\n\
  540. \n\
  541. Assume that @var{symbol} is a @code{SYMBOL_REF} for a function taking\n\
  542. no arguments and with no return value. If the target supports initialization\n\
  543. priorities, @var{priority} is a value between 0 and @code{MAX_INIT_PRIORITY};\n\
  544. otherwise it must be @code{DEFAULT_INIT_PRIORITY}.\n\
  545. \n\
  546. If this macro is not defined by the target, a suitable default will\n\
  547. be chosen if (1) the target supports arbitrary section names, (2) the\n\
  548. target defines @code{CTORS_SECTION_ASM_OP}, or (3) @code{USE_COLLECT2}\n\
  549. is not defined.",
  550. void, (rtx symbol, int priority), NULL)
  551. /* Output a destructor for a symbol with a given priority. */
  552. DEFHOOK
  553. (destructor,
  554. "This is like @code{TARGET_ASM_CONSTRUCTOR} but used for termination\n\
  555. functions rather than initialization functions.",
  556. void, (rtx symbol, int priority), NULL)
  557. /* Output the assembler code for a thunk function. THUNK_DECL is the
  558. declaration for the thunk function itself, FUNCTION is the decl for
  559. the target function. DELTA is an immediate constant offset to be
  560. added to THIS. If VCALL_OFFSET is nonzero, the word at
  561. *(*this + vcall_offset) should be added to THIS. */
  562. DEFHOOK
  563. (output_mi_thunk,
  564. "A function that outputs the assembler code for a thunk\n\
  565. function, used to implement C++ virtual function calls with multiple\n\
  566. inheritance. The thunk acts as a wrapper around a virtual function,\n\
  567. adjusting the implicit object parameter before handing control off to\n\
  568. the real function.\n\
  569. \n\
  570. First, emit code to add the integer @var{delta} to the location that\n\
  571. contains the incoming first argument. Assume that this argument\n\
  572. contains a pointer, and is the one used to pass the @code{this} pointer\n\
  573. in C++. This is the incoming argument @emph{before} the function prologue,\n\
  574. e.g.@: @samp{%o0} on a sparc. The addition must preserve the values of\n\
  575. all other incoming arguments.\n\
  576. \n\
  577. Then, if @var{vcall_offset} is nonzero, an additional adjustment should be\n\
  578. made after adding @code{delta}. In particular, if @var{p} is the\n\
  579. adjusted pointer, the following adjustment should be made:\n\
  580. \n\
  581. @smallexample\n\
  582. p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]\n\
  583. @end smallexample\n\
  584. \n\
  585. After the additions, emit code to jump to @var{function}, which is a\n\
  586. @code{FUNCTION_DECL}. This is a direct pure jump, not a call, and does\n\
  587. not touch the return address. Hence returning from @var{FUNCTION} will\n\
  588. return to whoever called the current @samp{thunk}.\n\
  589. \n\
  590. The effect must be as if @var{function} had been called directly with\n\
  591. the adjusted first argument. This macro is responsible for emitting all\n\
  592. of the code for a thunk function; @code{TARGET_ASM_FUNCTION_PROLOGUE}\n\
  593. and @code{TARGET_ASM_FUNCTION_EPILOGUE} are not invoked.\n\
  594. \n\
  595. The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function}\n\
  596. have already been extracted from it.) It might possibly be useful on\n\
  597. some targets, but probably not.\n\
  598. \n\
  599. If you do not define this macro, the target-independent code in the C++\n\
  600. front end will generate a less efficient heavyweight thunk that calls\n\
  601. @var{function} instead of jumping to it. The generic approach does\n\
  602. not support varargs.",
  603. void, (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
  604. HOST_WIDE_INT vcall_offset, tree function),
  605. NULL)
  606. /* Determine whether output_mi_thunk would succeed. */
  607. /* ??? Ideally, this hook would not exist, and success or failure
  608. would be returned from output_mi_thunk directly. But there's
  609. too much undo-able setup involved in invoking output_mi_thunk.
  610. Could be fixed by making output_mi_thunk emit rtl instead of
  611. text to the output file. */
  612. DEFHOOK
  613. (can_output_mi_thunk,
  614. "A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would be able\n\
  615. to output the assembler code for the thunk function specified by the\n\
  616. arguments it is passed, and false otherwise. In the latter case, the\n\
  617. generic approach will be used by the C++ front end, with the limitations\n\
  618. previously exposed.",
  619. bool, (const_tree thunk_fndecl, HOST_WIDE_INT delta,
  620. HOST_WIDE_INT vcall_offset, const_tree function),
  621. hook_bool_const_tree_hwi_hwi_const_tree_false)
  622. /* Output any boilerplate text needed at the beginning of a
  623. translation unit. */
  624. DEFHOOK
  625. (file_start,
  626. "Output to @code{asm_out_file} any text which the assembler expects to\n\
  627. find at the beginning of a file. The default behavior is controlled\n\
  628. by two flags, documented below. Unless your target's assembler is\n\
  629. quite unusual, if you override the default, you should call\n\
  630. @code{default_file_start} at some point in your target hook. This\n\
  631. lets other target files rely on these variables.",
  632. void, (void),
  633. default_file_start)
  634. /* Output any boilerplate text needed at the end of a translation unit. */
  635. DEFHOOK
  636. (file_end,
  637. "Output to @code{asm_out_file} any text which the assembler expects\n\
  638. to find at the end of a file. The default is to output nothing.",
  639. void, (void),
  640. hook_void_void)
  641. /* Output any boilerplate text needed at the beginning of an
  642. LTO output stream. */
  643. DEFHOOK
  644. (lto_start,
  645. "Output to @code{asm_out_file} any text which the assembler expects\n\
  646. to find at the start of an LTO section. The default is to output\n\
  647. nothing.",
  648. void, (void),
  649. hook_void_void)
  650. /* Output any boilerplate text needed at the end of an
  651. LTO output stream. */
  652. DEFHOOK
  653. (lto_end,
  654. "Output to @code{asm_out_file} any text which the assembler expects\n\
  655. to find at the end of an LTO section. The default is to output\n\
  656. nothing.",
  657. void, (void),
  658. hook_void_void)
  659. /* Output any boilerplace text needed at the end of a
  660. translation unit before debug and unwind info is emitted. */
  661. DEFHOOK
  662. (code_end,
  663. "Output to @code{asm_out_file} any text which is needed before emitting\n\
  664. unwind info and debug info at the end of a file. Some targets emit\n\
  665. here PIC setup thunks that cannot be emitted at the end of file,\n\
  666. because they couldn't have unwind info then. The default is to output\n\
  667. nothing.",
  668. void, (void),
  669. hook_void_void)
  670. /* Output an assembler pseudo-op to declare a library function name
  671. external. */
  672. DEFHOOK
  673. (external_libcall,
  674. "This target hook is a function to output to @var{asm_out_file} an assembler\n\
  675. pseudo-op to declare a library function name external. The name of the\n\
  676. library function is given by @var{symref}, which is a @code{symbol_ref}.",
  677. void, (rtx symref),
  678. default_external_libcall)
  679. /* Output an assembler directive to mark decl live. This instructs
  680. linker to not dead code strip this symbol. */
  681. DEFHOOK
  682. (mark_decl_preserved,
  683. "This target hook is a function to output to @var{asm_out_file} an assembler\n\
  684. directive to annotate @var{symbol} as used. The Darwin target uses the\n\
  685. .no_dead_code_strip directive.",
  686. void, (const char *symbol),
  687. hook_void_constcharptr)
  688. /* Output a record of the command line switches that have been passed. */
  689. DEFHOOK
  690. (record_gcc_switches,
  691. "Provides the target with the ability to record the gcc command line\n\
  692. switches that have been passed to the compiler, and options that are\n\
  693. enabled. The @var{type} argument specifies what is being recorded.\n\
  694. It can take the following values:\n\
  695. \n\
  696. @table @gcctabopt\n\
  697. @item SWITCH_TYPE_PASSED\n\
  698. @var{text} is a command line switch that has been set by the user.\n\
  699. \n\
  700. @item SWITCH_TYPE_ENABLED\n\
  701. @var{text} is an option which has been enabled. This might be as a\n\
  702. direct result of a command line switch, or because it is enabled by\n\
  703. default or because it has been enabled as a side effect of a different\n\
  704. command line switch. For example, the @option{-O2} switch enables\n\
  705. various different individual optimization passes.\n\
  706. \n\
  707. @item SWITCH_TYPE_DESCRIPTIVE\n\
  708. @var{text} is either NULL or some descriptive text which should be\n\
  709. ignored. If @var{text} is NULL then it is being used to warn the\n\
  710. target hook that either recording is starting or ending. The first\n\
  711. time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the\n\
  712. warning is for start up and the second time the warning is for\n\
  713. wind down. This feature is to allow the target hook to make any\n\
  714. necessary preparations before it starts to record switches and to\n\
  715. perform any necessary tidying up after it has finished recording\n\
  716. switches.\n\
  717. \n\
  718. @item SWITCH_TYPE_LINE_START\n\
  719. This option can be ignored by this target hook.\n\
  720. \n\
  721. @item SWITCH_TYPE_LINE_END\n\
  722. This option can be ignored by this target hook.\n\
  723. @end table\n\
  724. \n\
  725. The hook's return value must be zero. Other return values may be\n\
  726. supported in the future.\n\
  727. \n\
  728. By default this hook is set to NULL, but an example implementation is\n\
  729. provided for ELF based targets. Called @var{elf_record_gcc_switches},\n\
  730. it records the switches as ASCII text inside a new, string mergeable\n\
  731. section in the assembler output file. The name of the new section is\n\
  732. provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target\n\
  733. hook.",
  734. int, (print_switch_type type, const char *text),
  735. NULL)
  736. /* The name of the section that the example ELF implementation of
  737. record_gcc_switches will use to store the information. Target
  738. specific versions of record_gcc_switches may or may not use
  739. this information. */
  740. DEFHOOKPOD
  741. (record_gcc_switches_section,
  742. "This is the name of the section that will be created by the example\n\
  743. ELF implementation of the @code{TARGET_ASM_RECORD_GCC_SWITCHES} target\n\
  744. hook.",
  745. const char *, ".GCC.command.line")
  746. /* Output the definition of a section anchor. */
  747. DEFHOOK
  748. (output_anchor,
  749. "Write the assembly code to define section anchor @var{x}, which is a\n\
  750. @code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true.\n\
  751. The hook is called with the assembly output position set to the beginning\n\
  752. of @code{SYMBOL_REF_BLOCK (@var{x})}.\n\
  753. \n\
  754. If @code{ASM_OUTPUT_DEF} is available, the hook's default definition uses\n\
  755. it to define the symbol as @samp{. + SYMBOL_REF_BLOCK_OFFSET (@var{x})}.\n\
  756. If @code{ASM_OUTPUT_DEF} is not available, the hook's default definition\n\
  757. is @code{NULL}, which disables the use of section anchors altogether.",
  758. void, (rtx x),
  759. default_asm_output_anchor)
  760. DEFHOOK
  761. (output_ident,
  762. "Output a string based on @var{name}, suitable for the @samp{#ident} \
  763. directive, or the equivalent directive or pragma in non-C-family languages. \
  764. If this hook is not defined, nothing is output for the @samp{#ident} \
  765. directive.",
  766. void, (const char *name),
  767. hook_void_constcharptr)
  768. /* Output a DTP-relative reference to a TLS symbol. */
  769. DEFHOOK
  770. (output_dwarf_dtprel,
  771. "If defined, this target hook is a function which outputs a DTP-relative\n\
  772. reference to the given TLS symbol of the specified size.",
  773. void, (FILE *file, int size, rtx x),
  774. NULL)
  775. /* Some target machines need to postscan each insn after it is output. */
  776. DEFHOOK
  777. (final_postscan_insn,
  778. "If defined, this target hook is a function which is executed just after the\n\
  779. output of assembler code for @var{insn}, to change the mode of the assembler\n\
  780. if necessary.\n\
  781. \n\
  782. Here the argument @var{opvec} is the vector containing the operands\n\
  783. extracted from @var{insn}, and @var{noperands} is the number of\n\
  784. elements of the vector which contain meaningful data for this insn.\n\
  785. The contents of this vector are what was used to convert the insn\n\
  786. template into assembler code, so you can change the assembler mode\n\
  787. by checking the contents of the vector.",
  788. void, (FILE *file, rtx_insn *insn, rtx *opvec, int noperands),
  789. NULL)
  790. /* Emit the trampoline template. This hook may be NULL. */
  791. DEFHOOK
  792. (trampoline_template,
  793. "This hook is called by @code{assemble_trampoline_template} to output,\n\
  794. on the stream @var{f}, assembler code for a block of data that contains\n\
  795. the constant parts of a trampoline. This code should not include a\n\
  796. label---the label is taken care of automatically.\n\
  797. \n\
  798. If you do not define this hook, it means no template is needed\n\
  799. for the target. Do not define this hook on systems where the block move\n\
  800. code to copy the trampoline into place would be larger than the code\n\
  801. to generate it on the spot.",
  802. void, (FILE *f),
  803. NULL)
  804. DEFHOOK
  805. (output_source_filename,
  806. "Output DWARF debugging information which indicates that filename\
  807. @var{name} is the current source file to the stdio stream @var{file}.\n\
  808. \n\
  809. This target hook need not be defined if the standard form of output\
  810. for the file format in use is appropriate.",
  811. void ,(FILE *file, const char *name),
  812. default_asm_output_source_filename)
  813. DEFHOOK
  814. (output_addr_const_extra,
  815. "A target hook to recognize @var{rtx} patterns that @code{output_addr_const}\n\
  816. can't deal with, and output assembly code to @var{file} corresponding to\n\
  817. the pattern @var{x}. This may be used to allow machine-dependent\n\
  818. @code{UNSPEC}s to appear within constants.\n\
  819. \n\
  820. If target hook fails to recognize a pattern, it must return @code{false},\n\
  821. so that a standard error message is printed. If it prints an error message\n\
  822. itself, by calling, for example, @code{output_operand_lossage}, it may just\n\
  823. return @code{true}.",
  824. bool, (FILE *file, rtx x),
  825. hook_bool_FILEptr_rtx_false)
  826. /* ??? The TARGET_PRINT_OPERAND* hooks are part of the asm_out struct,
  827. even though that is not reflected in the macro name to override their
  828. initializers. */
  829. #undef HOOK_PREFIX
  830. #define HOOK_PREFIX "TARGET_"
  831. /* Emit a machine-specific insn operand. */
  832. /* ??? tm.texi only documents the old macro PRINT_OPERAND,
  833. not this hook, and uses a different name for the argument FILE. */
  834. DEFHOOK_UNDOC
  835. (print_operand,
  836. "",
  837. void, (FILE *file, rtx x, int code),
  838. default_print_operand)
  839. /* Emit a machine-specific memory address. */
  840. /* ??? tm.texi only documents the old macro PRINT_OPERAND_ADDRESS,
  841. not this hook, and uses different argument names. */
  842. DEFHOOK_UNDOC
  843. (print_operand_address,
  844. "",
  845. void, (FILE *file, machine_mode mode, rtx addr),
  846. default_print_operand_address)
  847. /* Determine whether CODE is a valid punctuation character for the
  848. `print_operand' hook. */
  849. /* ??? tm.texi only documents the old macro PRINT_OPERAND_PUNCT_VALID_P,
  850. not this hook. */
  851. DEFHOOK_UNDOC
  852. (print_operand_punct_valid_p,
  853. "",
  854. bool ,(unsigned char code),
  855. default_print_operand_punct_valid_p)
  856. /* Given a symbol name, perform same mangling as assemble_name and
  857. ASM_OUTPUT_LABELREF, returning result as an IDENTIFIER_NODE. */
  858. DEFHOOK
  859. (mangle_assembler_name,
  860. "Given a symbol @var{name}, perform same mangling as @code{varasm.c}'s\
  861. @code{assemble_name}, but in memory rather than to a file stream, returning\
  862. result as an @code{IDENTIFIER_NODE}. Required for correct LTO symtabs. The\
  863. default implementation calls the @code{TARGET_STRIP_NAME_ENCODING} hook and\
  864. then prepends the @code{USER_LABEL_PREFIX}, if any.",
  865. tree, (const char *name),
  866. default_mangle_assembler_name)
  867. HOOK_VECTOR_END (asm_out)
  868. /* Functions relating to instruction scheduling. All of these
  869. default to null pointers, which haifa-sched.c looks for and handles. */
  870. #undef HOOK_PREFIX
  871. #define HOOK_PREFIX "TARGET_SCHED_"
  872. HOOK_VECTOR (TARGET_SCHED, sched)
  873. /* Given the current cost, COST, of an insn, INSN, calculate and
  874. return a new cost based on its relationship to DEP_INSN through
  875. the dependence LINK. The default is to make no adjustment. */
  876. DEFHOOK
  877. (adjust_cost,
  878. "This function corrects the value of @var{cost} based on the\n\
  879. relationship between @var{insn} and @var{dep_insn} through a\n\
  880. dependence of type dep_type, and strength @var{dw}. It should return the new\n\
  881. value. The default is to make no adjustment to @var{cost}. This can be\n\
  882. used for example to specify to the scheduler using the traditional pipeline\n\
  883. description that an output- or anti-dependence does not incur the same cost\n\
  884. as a data-dependence. If the scheduler using the automaton based pipeline\n\
  885. description, the cost of anti-dependence is zero and the cost of\n\
  886. output-dependence is maximum of one and the difference of latency\n\
  887. times of the first and the second insns. If these values are not\n\
  888. acceptable, you could use the hook to modify them too. See also\n\
  889. @pxref{Processor pipeline description}.",
  890. int, (rtx_insn *insn, int dep_type1, rtx_insn *dep_insn, int cost,
  891. unsigned int dw),
  892. NULL)
  893. /* Adjust the priority of an insn as you see fit. Returns the new priority. */
  894. DEFHOOK
  895. (adjust_priority,
  896. "This hook adjusts the integer scheduling priority @var{priority} of\n\
  897. @var{insn}. It should return the new priority. Increase the priority to\n\
  898. execute @var{insn} earlier, reduce the priority to execute @var{insn}\n\
  899. later. Do not define this hook if you do not need to adjust the\n\
  900. scheduling priorities of insns.",
  901. int, (rtx_insn *insn, int priority), NULL)
  902. /* Function which returns the maximum number of insns that can be
  903. scheduled in the same machine cycle. This must be constant
  904. over an entire compilation. The default is 1. */
  905. DEFHOOK
  906. (issue_rate,
  907. "This hook returns the maximum number of instructions that can ever\n\
  908. issue at the same time on the target machine. The default is one.\n\
  909. Although the insn scheduler can define itself the possibility of issue\n\
  910. an insn on the same cycle, the value can serve as an additional\n\
  911. constraint to issue insns on the same simulated processor cycle (see\n\
  912. hooks @samp{TARGET_SCHED_REORDER} and @samp{TARGET_SCHED_REORDER2}).\n\
  913. This value must be constant over the entire compilation. If you need\n\
  914. it to vary depending on what the instructions are, you must use\n\
  915. @samp{TARGET_SCHED_VARIABLE_ISSUE}.",
  916. int, (void), NULL)
  917. /* Calculate how much this insn affects how many more insns we
  918. can emit this cycle. Default is they all cost the same. */
  919. DEFHOOK
  920. (variable_issue,
  921. "This hook is executed by the scheduler after it has scheduled an insn\n\
  922. from the ready list. It should return the number of insns which can\n\
  923. still be issued in the current cycle. The default is\n\
  924. @samp{@w{@var{more} - 1}} for insns other than @code{CLOBBER} and\n\
  925. @code{USE}, which normally are not counted against the issue rate.\n\
  926. You should define this hook if some insns take more machine resources\n\
  927. than others, so that fewer insns can follow them in the same cycle.\n\
  928. @var{file} is either a null pointer, or a stdio stream to write any\n\
  929. debug output to. @var{verbose} is the verbose level provided by\n\
  930. @option{-fsched-verbose-@var{n}}. @var{insn} is the instruction that\n\
  931. was scheduled.",
  932. int, (FILE *file, int verbose, rtx_insn *insn, int more), NULL)
  933. /* Initialize machine-dependent scheduling code. */
  934. DEFHOOK
  935. (init,
  936. "This hook is executed by the scheduler at the beginning of each block of\n\
  937. instructions that are to be scheduled. @var{file} is either a null\n\
  938. pointer, or a stdio stream to write any debug output to. @var{verbose}\n\
  939. is the verbose level provided by @option{-fsched-verbose-@var{n}}.\n\
  940. @var{max_ready} is the maximum number of insns in the current scheduling\n\
  941. region that can be live at the same time. This can be used to allocate\n\
  942. scratch space if it is needed, e.g.@: by @samp{TARGET_SCHED_REORDER}.",
  943. void, (FILE *file, int verbose, int max_ready), NULL)
  944. /* Finalize machine-dependent scheduling code. */
  945. DEFHOOK
  946. (finish,
  947. "This hook is executed by the scheduler at the end of each block of\n\
  948. instructions that are to be scheduled. It can be used to perform\n\
  949. cleanup of any actions done by the other scheduling hooks. @var{file}\n\
  950. is either a null pointer, or a stdio stream to write any debug output\n\
  951. to. @var{verbose} is the verbose level provided by\n\
  952. @option{-fsched-verbose-@var{n}}.",
  953. void, (FILE *file, int verbose), NULL)
  954. /* Initialize machine-dependent function wide scheduling code. */
  955. DEFHOOK
  956. (init_global,
  957. "This hook is executed by the scheduler after function level initializations.\n\
  958. @var{file} is either a null pointer, or a stdio stream to write any debug output to.\n\
  959. @var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.\n\
  960. @var{old_max_uid} is the maximum insn uid when scheduling begins.",
  961. void, (FILE *file, int verbose, int old_max_uid), NULL)
  962. /* Finalize machine-dependent function wide scheduling code. */
  963. DEFHOOK
  964. (finish_global,
  965. "This is the cleanup hook corresponding to @code{TARGET_SCHED_INIT_GLOBAL}.\n\
  966. @var{file} is either a null pointer, or a stdio stream to write any debug output to.\n\
  967. @var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.",
  968. void, (FILE *file, int verbose), NULL)
  969. /* Reorder insns in a machine-dependent fashion, in two different
  970. places. Default does nothing. */
  971. DEFHOOK
  972. (reorder,
  973. "This hook is executed by the scheduler after it has scheduled the ready\n\
  974. list, to allow the machine description to reorder it (for example to\n\
  975. combine two small instructions together on @samp{VLIW} machines).\n\
  976. @var{file} is either a null pointer, or a stdio stream to write any\n\
  977. debug output to. @var{verbose} is the verbose level provided by\n\
  978. @option{-fsched-verbose-@var{n}}. @var{ready} is a pointer to the ready\n\
  979. list of instructions that are ready to be scheduled. @var{n_readyp} is\n\
  980. a pointer to the number of elements in the ready list. The scheduler\n\
  981. reads the ready list in reverse order, starting with\n\
  982. @var{ready}[@var{*n_readyp} @minus{} 1] and going to @var{ready}[0]. @var{clock}\n\
  983. is the timer tick of the scheduler. You may modify the ready list and\n\
  984. the number of ready insns. The return value is the number of insns that\n\
  985. can issue this cycle; normally this is just @code{issue_rate}. See also\n\
  986. @samp{TARGET_SCHED_REORDER2}.",
  987. int, (FILE *file, int verbose, rtx_insn **ready, int *n_readyp, int clock), NULL)
  988. DEFHOOK
  989. (reorder2,
  990. "Like @samp{TARGET_SCHED_REORDER}, but called at a different time. That\n\
  991. function is called whenever the scheduler starts a new cycle. This one\n\
  992. is called once per iteration over a cycle, immediately after\n\
  993. @samp{TARGET_SCHED_VARIABLE_ISSUE}; it can reorder the ready list and\n\
  994. return the number of insns to be scheduled in the same cycle. Defining\n\
  995. this hook can be useful if there are frequent situations where\n\
  996. scheduling one insn causes other insns to become ready in the same\n\
  997. cycle. These other insns can then be taken into account properly.",
  998. int, (FILE *file, int verbose, rtx_insn **ready, int *n_readyp, int clock), NULL)
  999. DEFHOOK
  1000. (macro_fusion_p,
  1001. "This hook is used to check whether target platform supports macro fusion.",
  1002. bool, (void), NULL)
  1003. DEFHOOK
  1004. (macro_fusion_pair_p,
  1005. "This hook is used to check whether two insns should be macro fused for\n\
  1006. a target microarchitecture. If this hook returns true for the given insn pair\n\
  1007. (@var{prev} and @var{curr}), the scheduler will put them into a sched\n\
  1008. group, and they will not be scheduled apart. The two insns will be either\n\
  1009. two SET insns or a compare and a conditional jump and this hook should\n\
  1010. validate any dependencies needed to fuse the two insns together.",
  1011. bool, (rtx_insn *prev, rtx_insn *curr), NULL)
  1012. /* The following member value is a pointer to a function called
  1013. after evaluation forward dependencies of insns in chain given
  1014. by two parameter values (head and tail correspondingly). */
  1015. DEFHOOK
  1016. (dependencies_evaluation_hook,
  1017. "This hook is called after evaluation forward dependencies of insns in\n\
  1018. chain given by two parameter values (@var{head} and @var{tail}\n\
  1019. correspondingly) but before insns scheduling of the insn chain. For\n\
  1020. example, it can be used for better insn classification if it requires\n\
  1021. analysis of dependencies. This hook can use backward and forward\n\
  1022. dependencies of the insn scheduler because they are already\n\
  1023. calculated.",
  1024. void, (rtx_insn *head, rtx_insn *tail), NULL)
  1025. /* The values of the following four members are pointers to functions
  1026. used to simplify the automaton descriptions. dfa_pre_cycle_insn and
  1027. dfa_post_cycle_insn give functions returning insns which are used to
  1028. change the pipeline hazard recognizer state when the new simulated
  1029. processor cycle correspondingly starts and finishes. The function
  1030. defined by init_dfa_pre_cycle_insn and init_dfa_post_cycle_insn are
  1031. used to initialize the corresponding insns. The default values of
  1032. the members result in not changing the automaton state when the
  1033. new simulated processor cycle correspondingly starts and finishes. */
  1034. DEFHOOK
  1035. (init_dfa_pre_cycle_insn,
  1036. "The hook can be used to initialize data used by the previous hook.",
  1037. void, (void), NULL)
  1038. DEFHOOK
  1039. (dfa_pre_cycle_insn,
  1040. "The hook returns an RTL insn. The automaton state used in the\n\
  1041. pipeline hazard recognizer is changed as if the insn were scheduled\n\
  1042. when the new simulated processor cycle starts. Usage of the hook may\n\
  1043. simplify the automaton pipeline description for some @acronym{VLIW}\n\
  1044. processors. If the hook is defined, it is used only for the automaton\n\
  1045. based pipeline description. The default is not to change the state\n\
  1046. when the new simulated processor cycle starts.",
  1047. rtx, (void), NULL)
  1048. DEFHOOK
  1049. (init_dfa_post_cycle_insn,
  1050. "The hook is analogous to @samp{TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN} but\n\
  1051. used to initialize data used by the previous hook.",
  1052. void, (void), NULL)
  1053. DEFHOOK
  1054. (dfa_post_cycle_insn,
  1055. "The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used\n\
  1056. to changed the state as if the insn were scheduled when the new\n\
  1057. simulated processor cycle finishes.",
  1058. rtx_insn *, (void), NULL)
  1059. /* The values of the following two members are pointers to
  1060. functions used to simplify the automaton descriptions.
  1061. dfa_pre_advance_cycle and dfa_post_advance_cycle are getting called
  1062. immediately before and after cycle is advanced. */
  1063. DEFHOOK
  1064. (dfa_pre_advance_cycle,
  1065. "The hook to notify target that the current simulated cycle is about to finish.\n\
  1066. The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used\n\
  1067. to change the state in more complicated situations - e.g., when advancing\n\
  1068. state on a single insn is not enough.",
  1069. void, (void), NULL)
  1070. DEFHOOK
  1071. (dfa_post_advance_cycle,
  1072. "The hook to notify target that new simulated cycle has just started.\n\
  1073. The hook is analogous to @samp{TARGET_SCHED_DFA_POST_CYCLE_INSN} but used\n\
  1074. to change the state in more complicated situations - e.g., when advancing\n\
  1075. state on a single insn is not enough.",
  1076. void, (void), NULL)
  1077. /* The following member value is a pointer to a function returning value
  1078. which defines how many insns in queue `ready' will we try for
  1079. multi-pass scheduling. If the member value is nonzero and the
  1080. function returns positive value, the DFA based scheduler will make
  1081. multi-pass scheduling for the first cycle. In other words, we will
  1082. try to choose ready insn which permits to start maximum number of
  1083. insns on the same cycle. */
  1084. DEFHOOK
  1085. (first_cycle_multipass_dfa_lookahead,
  1086. "This hook controls better choosing an insn from the ready insn queue\n\
  1087. for the @acronym{DFA}-based insn scheduler. Usually the scheduler\n\
  1088. chooses the first insn from the queue. If the hook returns a positive\n\
  1089. value, an additional scheduler code tries all permutations of\n\
  1090. @samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ()}\n\
  1091. subsequent ready insns to choose an insn whose issue will result in\n\
  1092. maximal number of issued insns on the same cycle. For the\n\
  1093. @acronym{VLIW} processor, the code could actually solve the problem of\n\
  1094. packing simple insns into the @acronym{VLIW} insn. Of course, if the\n\
  1095. rules of @acronym{VLIW} packing are described in the automaton.\n\
  1096. \n\
  1097. This code also could be used for superscalar @acronym{RISC}\n\
  1098. processors. Let us consider a superscalar @acronym{RISC} processor\n\
  1099. with 3 pipelines. Some insns can be executed in pipelines @var{A} or\n\
  1100. @var{B}, some insns can be executed only in pipelines @var{B} or\n\
  1101. @var{C}, and one insn can be executed in pipeline @var{B}. The\n\
  1102. processor may issue the 1st insn into @var{A} and the 2nd one into\n\
  1103. @var{B}. In this case, the 3rd insn will wait for freeing @var{B}\n\
  1104. until the next cycle. If the scheduler issues the 3rd insn the first,\n\
  1105. the processor could issue all 3 insns per cycle.\n\
  1106. \n\
  1107. Actually this code demonstrates advantages of the automaton based\n\
  1108. pipeline hazard recognizer. We try quickly and easy many insn\n\
  1109. schedules to choose the best one.\n\
  1110. \n\
  1111. The default is no multipass scheduling.",
  1112. int, (void), NULL)
  1113. /* The following member value is pointer to a function controlling
  1114. what insns from the ready insn queue will be considered for the
  1115. multipass insn scheduling. If the hook returns zero for insn
  1116. passed as the parameter, the insn will be not chosen to be issued. */
  1117. DEFHOOK
  1118. (first_cycle_multipass_dfa_lookahead_guard,
  1119. "\n\
  1120. This hook controls what insns from the ready insn queue will be\n\
  1121. considered for the multipass insn scheduling. If the hook returns\n\
  1122. zero for @var{insn}, the insn will be considered in multipass scheduling.\n\
  1123. Positive return values will remove @var{insn} from consideration on\n\
  1124. the current round of multipass scheduling.\n\
  1125. Negative return values will remove @var{insn} from consideration for given\n\
  1126. number of cycles.\n\
  1127. Backends should be careful about returning non-zero for highest priority\n\
  1128. instruction at position 0 in the ready list. @var{ready_index} is passed\n\
  1129. to allow backends make correct judgements.\n\
  1130. \n\
  1131. The default is that any ready insns can be chosen to be issued.",
  1132. int, (rtx_insn *insn, int ready_index), NULL)
  1133. /* This hook prepares the target for a new round of multipass
  1134. scheduling.
  1135. DATA is a pointer to target-specific data used for multipass scheduling.
  1136. READY_TRY and N_READY represent the current state of search in the
  1137. optimization space. The target can filter out instructions that
  1138. should not be tried during current round by setting corresponding
  1139. elements in READY_TRY to non-zero.
  1140. FIRST_CYCLE_INSN_P is true if this is the first round of multipass
  1141. scheduling on current cycle. */
  1142. DEFHOOK
  1143. (first_cycle_multipass_begin,
  1144. "This hook prepares the target backend for a new round of multipass\n\
  1145. scheduling.",
  1146. void, (void *data, signed char *ready_try, int n_ready, bool first_cycle_insn_p),
  1147. NULL)
  1148. /* This hook is called when multipass scheduling evaluates instruction INSN.
  1149. DATA is a pointer to target-specific data that can be used to record effects
  1150. of INSN on CPU that are not described in DFA.
  1151. READY_TRY and N_READY represent the current state of search in the
  1152. optimization space. The target can filter out instructions that
  1153. should not be tried after issuing INSN by setting corresponding
  1154. elements in READY_TRY to non-zero.
  1155. INSN is the instruction being evaluated.
  1156. PREV_DATA is a pointer to target-specific data corresponding
  1157. to a state before issuing INSN. */
  1158. DEFHOOK
  1159. (first_cycle_multipass_issue,
  1160. "This hook is called when multipass scheduling evaluates instruction INSN.",
  1161. void, (void *data, signed char *ready_try, int n_ready, rtx_insn *insn,
  1162. const void *prev_data), NULL)
  1163. /* This hook is called when multipass scheduling backtracks from evaluation of
  1164. instruction corresponding to DATA.
  1165. DATA is a pointer to target-specific data that stores the effects
  1166. of instruction from which the algorithm backtracks on CPU that are not
  1167. described in DFA.
  1168. READY_TRY and N_READY represent the current state of search in the
  1169. optimization space. The target can filter out instructions that
  1170. should not be tried after issuing INSN by setting corresponding
  1171. elements in READY_TRY to non-zero. */
  1172. DEFHOOK
  1173. (first_cycle_multipass_backtrack,
  1174. "This is called when multipass scheduling backtracks from evaluation of\n\
  1175. an instruction.",
  1176. void, (const void *data, signed char *ready_try, int n_ready), NULL)
  1177. /* This hook notifies the target about the result of the concluded current
  1178. round of multipass scheduling.
  1179. DATA is a pointer.
  1180. If DATA is non-NULL it points to target-specific data used for multipass
  1181. scheduling which corresponds to instruction at the start of the chain of
  1182. the winning solution. DATA is NULL when multipass scheduling cannot find
  1183. a good enough solution on current cycle and decides to retry later,
  1184. usually after advancing the cycle count. */
  1185. DEFHOOK
  1186. (first_cycle_multipass_end,
  1187. "This hook notifies the target about the result of the concluded current\n\
  1188. round of multipass scheduling.",
  1189. void, (const void *data), NULL)
  1190. /* This hook is called to initialize target-specific data for multipass
  1191. scheduling after it has been allocated.
  1192. DATA is a pointer to target-specific data that stores the effects
  1193. of instruction from which the algorithm backtracks on CPU that are not
  1194. described in DFA. */
  1195. DEFHOOK
  1196. (first_cycle_multipass_init,
  1197. "This hook initializes target-specific data used in multipass scheduling.",
  1198. void, (void *data), NULL)
  1199. /* This hook is called to finalize target-specific data for multipass
  1200. scheduling before it is deallocated.
  1201. DATA is a pointer to target-specific data that stores the effects
  1202. of instruction from which the algorithm backtracks on CPU that are not
  1203. described in DFA. */
  1204. DEFHOOK
  1205. (first_cycle_multipass_fini,
  1206. "This hook finalizes target-specific data used in multipass scheduling.",
  1207. void, (void *data), NULL)
  1208. /* The following member value is pointer to a function called by
  1209. the insn scheduler before issuing insn passed as the third
  1210. parameter on given cycle. If the hook returns nonzero, the
  1211. insn is not issued on given processors cycle. Instead of that,
  1212. the processor cycle is advanced. If the value passed through
  1213. the last parameter is zero, the insn ready queue is not sorted
  1214. on the new cycle start as usually. The first parameter passes
  1215. file for debugging output. The second one passes the scheduler
  1216. verbose level of the debugging output. The forth and the fifth
  1217. parameter values are correspondingly processor cycle on which
  1218. the previous insn has been issued and the current processor cycle. */
  1219. DEFHOOK
  1220. (dfa_new_cycle,
  1221. "This hook is called by the insn scheduler before issuing @var{insn}\n\
  1222. on cycle @var{clock}. If the hook returns nonzero,\n\
  1223. @var{insn} is not issued on this processor cycle. Instead,\n\
  1224. the processor cycle is advanced. If *@var{sort_p}\n\
  1225. is zero, the insn ready queue is not sorted on the new cycle\n\
  1226. start as usually. @var{dump} and @var{verbose} specify the file and\n\
  1227. verbosity level to use for debugging output.\n\
  1228. @var{last_clock} and @var{clock} are, respectively, the\n\
  1229. processor cycle on which the previous insn has been issued,\n\
  1230. and the current processor cycle.",
  1231. int, (FILE *dump, int verbose, rtx_insn *insn, int last_clock,
  1232. int clock, int *sort_p),
  1233. NULL)
  1234. /* The following member value is a pointer to a function called by the
  1235. insn scheduler. It should return true if there exists a dependence
  1236. which is considered costly by the target, between the insn
  1237. DEP_PRO (&_DEP), and the insn DEP_CON (&_DEP). The first parameter is
  1238. the dep that represents the dependence between the two insns. The
  1239. second argument is the cost of the dependence as estimated by
  1240. the scheduler. The last argument is the distance in cycles
  1241. between the already scheduled insn (first parameter) and the
  1242. second insn (second parameter). */
  1243. DEFHOOK
  1244. (is_costly_dependence,
  1245. "This hook is used to define which dependences are considered costly by\n\
  1246. the target, so costly that it is not advisable to schedule the insns that\n\
  1247. are involved in the dependence too close to one another. The parameters\n\
  1248. to this hook are as follows: The first parameter @var{_dep} is the dependence\n\
  1249. being evaluated. The second parameter @var{cost} is the cost of the\n\
  1250. dependence as estimated by the scheduler, and the third\n\
  1251. parameter @var{distance} is the distance in cycles between the two insns.\n\
  1252. The hook returns @code{true} if considering the distance between the two\n\
  1253. insns the dependence between them is considered costly by the target,\n\
  1254. and @code{false} otherwise.\n\
  1255. \n\
  1256. Defining this hook can be useful in multiple-issue out-of-order machines,\n\
  1257. where (a) it's practically hopeless to predict the actual data/resource\n\
  1258. delays, however: (b) there's a better chance to predict the actual grouping\n\
  1259. that will be formed, and (c) correctly emulating the grouping can be very\n\
  1260. important. In such targets one may want to allow issuing dependent insns\n\
  1261. closer to one another---i.e., closer than the dependence distance; however,\n\
  1262. not in cases of ``costly dependences'', which this hooks allows to define.",
  1263. bool, (struct _dep *_dep, int cost, int distance), NULL)
  1264. /* The following member value is a pointer to a function called
  1265. by the insn scheduler. This hook is called to notify the backend
  1266. that new instructions were emitted. */
  1267. DEFHOOK
  1268. (h_i_d_extended,
  1269. "This hook is called by the insn scheduler after emitting a new instruction to\n\
  1270. the instruction stream. The hook notifies a target backend to extend its\n\
  1271. per instruction data structures.",
  1272. void, (void), NULL)
  1273. /* Next 5 functions are for multi-point scheduling. */
  1274. /* Allocate memory for scheduler context. */
  1275. DEFHOOK
  1276. (alloc_sched_context,
  1277. "Return a pointer to a store large enough to hold target scheduling context.",
  1278. void *, (void), NULL)
  1279. /* Fills the context from the local machine scheduler context. */
  1280. DEFHOOK
  1281. (init_sched_context,
  1282. "Initialize store pointed to by @var{tc} to hold target scheduling context.\n\
  1283. It @var{clean_p} is true then initialize @var{tc} as if scheduler is at the\n\
  1284. beginning of the block. Otherwise, copy the current context into @var{tc}.",
  1285. void, (void *tc, bool clean_p), NULL)
  1286. /* Sets local machine scheduler context to a saved value. */
  1287. DEFHOOK
  1288. (set_sched_context,
  1289. "Copy target scheduling context pointed to by @var{tc} to the current context.",
  1290. void, (void *tc), NULL)
  1291. /* Clears a scheduler context so it becomes like after init. */
  1292. DEFHOOK
  1293. (clear_sched_context,
  1294. "Deallocate internal data in target scheduling context pointed to by @var{tc}.",
  1295. void, (void *tc), NULL)
  1296. /* Frees the scheduler context. */
  1297. DEFHOOK
  1298. (free_sched_context,
  1299. "Deallocate a store for target scheduling context pointed to by @var{tc}.",
  1300. void, (void *tc), NULL)
  1301. /* The following member value is a pointer to a function called
  1302. by the insn scheduler.
  1303. The first parameter is an instruction, the second parameter is the type
  1304. of the requested speculation, and the third parameter is a pointer to the
  1305. speculative pattern of the corresponding type (set if return value == 1).
  1306. It should return
  1307. -1, if there is no pattern, that will satisfy the requested speculation type,
  1308. 0, if current pattern satisfies the requested speculation type,
  1309. 1, if pattern of the instruction should be changed to the newly
  1310. generated one. */
  1311. DEFHOOK
  1312. (speculate_insn,
  1313. "This hook is called by the insn scheduler when @var{insn} has only\n\
  1314. speculative dependencies and therefore can be scheduled speculatively.\n\
  1315. The hook is used to check if the pattern of @var{insn} has a speculative\n\
  1316. version and, in case of successful check, to generate that speculative\n\
  1317. pattern. The hook should return 1, if the instruction has a speculative form,\n\
  1318. or @minus{}1, if it doesn't. @var{request} describes the type of requested\n\
  1319. speculation. If the return value equals 1 then @var{new_pat} is assigned\n\
  1320. the generated speculative pattern.",
  1321. int, (rtx_insn *insn, unsigned int dep_status, rtx *new_pat), NULL)
  1322. /* The following member value is a pointer to a function called
  1323. by the insn scheduler. It should return true if the check instruction
  1324. passed as the parameter needs a recovery block. */
  1325. DEFHOOK
  1326. (needs_block_p,
  1327. "This hook is called by the insn scheduler during generation of recovery code\n\
  1328. for @var{insn}. It should return @code{true}, if the corresponding check\n\
  1329. instruction should branch to recovery code, or @code{false} otherwise.",
  1330. bool, (unsigned int dep_status), NULL)
  1331. /* The following member value is a pointer to a function called
  1332. by the insn scheduler. It should return a pattern for the check
  1333. instruction.
  1334. The first parameter is a speculative instruction, the second parameter
  1335. is the label of the corresponding recovery block (or null, if it is a
  1336. simple check). The third parameter is the kind of speculation that
  1337. is being performed. */
  1338. DEFHOOK
  1339. (gen_spec_check,
  1340. "This hook is called by the insn scheduler to generate a pattern for recovery\n\
  1341. check instruction. If @var{mutate_p} is zero, then @var{insn} is a\n\
  1342. speculative instruction for which the check should be generated.\n\
  1343. @var{label} is either a label of a basic block, where recovery code should\n\
  1344. be emitted, or a null pointer, when requested check doesn't branch to\n\
  1345. recovery code (a simple check). If @var{mutate_p} is nonzero, then\n\
  1346. a pattern for a branchy check corresponding to a simple check denoted by\n\
  1347. @var{insn} should be generated. In this case @var{label} can't be null.",
  1348. rtx, (rtx_insn *insn, rtx_insn *label, unsigned int ds), NULL)
  1349. /* The following member value is a pointer to a function that provides
  1350. information about the speculation capabilities of the target.
  1351. The parameter is a pointer to spec_info variable. */
  1352. DEFHOOK
  1353. (set_sched_flags,
  1354. "This hook is used by the insn scheduler to find out what features should be\n\
  1355. enabled/used.\n\
  1356. The structure *@var{spec_info} should be filled in by the target.\n\
  1357. The structure describes speculation types that can be used in the scheduler.",
  1358. void, (struct spec_info_def *spec_info), NULL)
  1359. DEFHOOK_UNDOC
  1360. (get_insn_spec_ds,
  1361. "Return speculation types of instruction @var{insn}.",
  1362. unsigned int, (rtx_insn *insn), NULL)
  1363. DEFHOOK_UNDOC
  1364. (get_insn_checked_ds,
  1365. "Return speculation types that are checked for instruction @var{insn}",
  1366. unsigned int, (rtx_insn *insn), NULL)
  1367. DEFHOOK
  1368. (can_speculate_insn,
  1369. "Some instructions should never be speculated by the schedulers, usually\n\
  1370. because the instruction is too expensive to get this wrong. Often such\n\
  1371. instructions have long latency, and often they are not fully modeled in the\n\
  1372. pipeline descriptions. This hook should return @code{false} if @var{insn}\n\
  1373. should not be speculated.",
  1374. bool, (rtx_insn *insn), hook_bool_rtx_insn_true)
  1375. DEFHOOK_UNDOC
  1376. (skip_rtx_p,
  1377. "Return bool if rtx scanning should just skip current layer and\
  1378. advance to the inner rtxes.",
  1379. bool, (const_rtx x), NULL)
  1380. /* The following member value is a pointer to a function that provides
  1381. information about the target resource-based lower bound which is
  1382. used by the swing modulo scheduler. The parameter is a pointer
  1383. to ddg variable. */
  1384. DEFHOOK
  1385. (sms_res_mii,
  1386. "This hook is called by the swing modulo scheduler to calculate a\n\
  1387. resource-based lower bound which is based on the resources available in\n\
  1388. the machine and the resources required by each instruction. The target\n\
  1389. backend can use @var{g} to calculate such bound. A very simple lower\n\
  1390. bound will be used in case this hook is not implemented: the total number\n\
  1391. of instructions divided by the issue rate.",
  1392. int, (struct ddg *g), NULL)
  1393. /* The following member value is a function that initializes dispatch
  1394. schedling and adds instructions to dispatch window according to its
  1395. parameters. */
  1396. DEFHOOK
  1397. (dispatch_do,
  1398. "This hook is called by Haifa Scheduler. It performs the operation specified\n\
  1399. in its second parameter.",
  1400. void, (rtx_insn *insn, int x),
  1401. hook_void_rtx_insn_int)
  1402. /* The following member value is a a function that returns true is
  1403. dispatch schedling is supported in hardware and condition passed
  1404. as the second parameter is true. */
  1405. DEFHOOK
  1406. (dispatch,
  1407. "This hook is called by Haifa Scheduler. It returns true if dispatch scheduling\n\
  1408. is supported in hardware and the condition specified in the parameter is true.",
  1409. bool, (rtx_insn *insn, int x),
  1410. hook_bool_rtx_insn_int_false)
  1411. DEFHOOKPOD
  1412. (exposed_pipeline,
  1413. "True if the processor has an exposed pipeline, which means that not just\n\
  1414. the order of instructions is important for correctness when scheduling, but\n\
  1415. also the latencies of operations.",
  1416. bool, false)
  1417. /* The following member value is a function that returns number
  1418. of operations reassociator should try to put in parallel for
  1419. statements of the given type. By default 1 is used. */
  1420. DEFHOOK
  1421. (reassociation_width,
  1422. "This hook is called by tree reassociator to determine a level of\n\
  1423. parallelism required in output calculations chain.",
  1424. int, (unsigned int opc, machine_mode mode),
  1425. hook_int_uint_mode_1)
  1426. /* The following member value is a function that returns priority for
  1427. fusion of each instruction via pointer parameters. */
  1428. DEFHOOK
  1429. (fusion_priority,
  1430. "This hook is called by scheduling fusion pass. It calculates fusion\n\
  1431. priorities for each instruction passed in by parameter. The priorities\n\
  1432. are returned via pointer parameters.\n\
  1433. \n\
  1434. @var{insn} is the instruction whose priorities need to be calculated.\n\
  1435. @var{max_pri} is the maximum priority can be returned in any cases.\n\
  1436. @var{fusion_pri} is the pointer parameter through which @var{insn}'s\n\
  1437. fusion priority should be calculated and returned.\n\
  1438. @var{pri} is the pointer parameter through which @var{insn}'s priority\n\
  1439. should be calculated and returned.\n\
  1440. \n\
  1441. Same @var{fusion_pri} should be returned for instructions which should\n\
  1442. be scheduled together. Different @var{pri} should be returned for\n\
  1443. instructions with same @var{fusion_pri}. @var{fusion_pri} is the major\n\
  1444. sort key, @var{pri} is the minor sort key. All instructions will be\n\
  1445. scheduled according to the two priorities. All priorities calculated\n\
  1446. should be between 0 (exclusive) and @var{max_pri} (inclusive). To avoid\n\
  1447. false dependencies, @var{fusion_pri} of instructions which need to be\n\
  1448. scheduled together should be smaller than @var{fusion_pri} of irrelevant\n\
  1449. instructions.\n\
  1450. \n\
  1451. Given below example:\n\
  1452. \n\
  1453. @smallexample\n\
  1454. ldr r10, [r1, 4]\n\
  1455. add r4, r4, r10\n\
  1456. ldr r15, [r2, 8]\n\
  1457. sub r5, r5, r15\n\
  1458. ldr r11, [r1, 0]\n\
  1459. add r4, r4, r11\n\
  1460. ldr r16, [r2, 12]\n\
  1461. sub r5, r5, r16\n\
  1462. @end smallexample\n\
  1463. \n\
  1464. On targets like ARM/AArch64, the two pairs of consecutive loads should be\n\
  1465. merged. Since peephole2 pass can't help in this case unless consecutive\n\
  1466. loads are actually next to each other in instruction flow. That's where\n\
  1467. this scheduling fusion pass works. This hook calculates priority for each\n\
  1468. instruction based on its fustion type, like:\n\
  1469. \n\
  1470. @smallexample\n\
  1471. ldr r10, [r1, 4] ; fusion_pri=99, pri=96\n\
  1472. add r4, r4, r10 ; fusion_pri=100, pri=100\n\
  1473. ldr r15, [r2, 8] ; fusion_pri=98, pri=92\n\
  1474. sub r5, r5, r15 ; fusion_pri=100, pri=100\n\
  1475. ldr r11, [r1, 0] ; fusion_pri=99, pri=100\n\
  1476. add r4, r4, r11 ; fusion_pri=100, pri=100\n\
  1477. ldr r16, [r2, 12] ; fusion_pri=98, pri=88\n\
  1478. sub r5, r5, r16 ; fusion_pri=100, pri=100\n\
  1479. @end smallexample\n\
  1480. \n\
  1481. Scheduling fusion pass then sorts all ready to issue instructions according\n\
  1482. to the priorities. As a result, instructions of same fusion type will be\n\
  1483. pushed together in instruction flow, like:\n\
  1484. \n\
  1485. @smallexample\n\
  1486. ldr r11, [r1, 0]\n\
  1487. ldr r10, [r1, 4]\n\
  1488. ldr r15, [r2, 8]\n\
  1489. ldr r16, [r2, 12]\n\
  1490. add r4, r4, r10\n\
  1491. sub r5, r5, r15\n\
  1492. add r4, r4, r11\n\
  1493. sub r5, r5, r16\n\
  1494. @end smallexample\n\
  1495. \n\
  1496. Now peephole2 pass can simply merge the two pairs of loads.\n\
  1497. \n\
  1498. Since scheduling fusion pass relies on peephole2 to do real fusion\n\
  1499. work, it is only enabled by default when peephole2 is in effect.\n\
  1500. \n\
  1501. This is firstly introduced on ARM/AArch64 targets, please refer to\n\
  1502. the hook implementation for how different fusion types are supported.",
  1503. void, (rtx_insn *insn, int max_pri, int *fusion_pri, int *pri), NULL)
  1504. HOOK_VECTOR_END (sched)
  1505. /* Functions relating to OpenMP SIMD and __attribute__((simd)) clones. */
  1506. #undef HOOK_PREFIX
  1507. #define HOOK_PREFIX "TARGET_SIMD_CLONE_"
  1508. HOOK_VECTOR (TARGET_SIMD_CLONE, simd_clone)
  1509. DEFHOOK
  1510. (compute_vecsize_and_simdlen,
  1511. "This hook should set @var{vecsize_mangle}, @var{vecsize_int}, @var{vecsize_float}\n\
  1512. fields in @var{simd_clone} structure pointed by @var{clone_info} argument and also\n\
  1513. @var{simdlen} field if it was previously 0.\n\
  1514. The hook should return 0 if SIMD clones shouldn't be emitted,\n\
  1515. or number of @var{vecsize_mangle} variants that should be emitted.",
  1516. int, (struct cgraph_node *, struct cgraph_simd_clone *, tree, int), NULL)
  1517. DEFHOOK
  1518. (adjust,
  1519. "This hook should add implicit @code{attribute(target(\"...\"))} attribute\n\
  1520. to SIMD clone @var{node} if needed.",
  1521. void, (struct cgraph_node *), NULL)
  1522. DEFHOOK
  1523. (usable,
  1524. "This hook should return -1 if SIMD clone @var{node} shouldn't be used\n\
  1525. in vectorized loops in current function, or non-negative number if it is\n\
  1526. usable. In that case, the smaller the number is, the more desirable it is\n\
  1527. to use it.",
  1528. int, (struct cgraph_node *), NULL)
  1529. HOOK_VECTOR_END (simd_clone)
  1530. /* Functions relating to OpenMP SIMT vectorization transform. */
  1531. #undef HOOK_PREFIX
  1532. #define HOOK_PREFIX "TARGET_SIMT_"
  1533. HOOK_VECTOR (TARGET_SIMT, simt)
  1534. DEFHOOK
  1535. (vf,
  1536. "Return number of threads in SIMT thread group on the target.",
  1537. int, (void), NULL)
  1538. HOOK_VECTOR_END (simt)
  1539. /* Functions relating to openacc. */
  1540. #undef HOOK_PREFIX
  1541. #define HOOK_PREFIX "TARGET_GOACC_"
  1542. HOOK_VECTOR (TARGET_GOACC, goacc)
  1543. DEFHOOK
  1544. (validate_dims,
  1545. "This hook should check the launch dimensions provided for an OpenACC\n\
  1546. compute region, or routine. Defaulted values are represented as -1\n\
  1547. and non-constant values as 0. The @var{fn_level} is negative for the\n\
  1548. function corresponding to the compute region. For a routine is is the\n\
  1549. outermost level at which partitioned execution may be spawned. The hook\n\
  1550. should verify non-default values. If DECL is NULL, global defaults\n\
  1551. are being validated and unspecified defaults should be filled in.\n\
  1552. Diagnostics should be issued as appropriate. Return\n\
  1553. true, if changes have been made. You must override this hook to\n\
  1554. provide dimensions larger than 1.",
  1555. bool, (tree decl, int *dims, int fn_level, unsigned used),
  1556. default_goacc_validate_dims)
  1557. DEFHOOK
  1558. (dim_limit,
  1559. "This hook should return the maximum size of a particular dimension,\n\
  1560. or zero if unbounded.",
  1561. int, (int axis),
  1562. default_goacc_dim_limit)
  1563. DEFHOOK
  1564. (fork_join,
  1565. "This hook can be used to convert IFN_GOACC_FORK and IFN_GOACC_JOIN\n\
  1566. function calls to target-specific gimple, or indicate whether they\n\
  1567. should be retained. It is executed during the oacc_device_lower pass.\n\
  1568. It should return true, if the call should be retained. It should\n\
  1569. return false, if it is to be deleted (either because target-specific\n\
  1570. gimple has been inserted before it, or there is no need for it).\n\
  1571. The default hook returns false, if there are no RTL expanders for them.",
  1572. bool, (gcall *call, const int *dims, bool is_fork),
  1573. default_goacc_fork_join)
  1574. DEFHOOK
  1575. (reduction,
  1576. "This hook is used by the oacc_transform pass to expand calls to the\n\
  1577. @var{GOACC_REDUCTION} internal function, into a sequence of gimple\n\
  1578. instructions. @var{call} is gimple statement containing the call to\n\
  1579. the function. This hook removes statement @var{call} after the\n\
  1580. expanded sequence has been inserted. This hook is also responsible\n\
  1581. for allocating any storage for reductions when necessary.",
  1582. void, (gcall *call),
  1583. default_goacc_reduction)
  1584. HOOK_VECTOR_END (goacc)
  1585. /* Functions relating to vectorization. */
  1586. #undef HOOK_PREFIX
  1587. #define HOOK_PREFIX "TARGET_VECTORIZE_"
  1588. HOOK_VECTOR (TARGET_VECTORIZE, vectorize)
  1589. /* The following member value is a pointer to a function called
  1590. by the vectorizer, and return the decl of the target builtin
  1591. function. */
  1592. DEFHOOK
  1593. (builtin_mask_for_load,
  1594. "This hook should return the DECL of a function @var{f} that given an\n\
  1595. address @var{addr} as an argument returns a mask @var{m} that can be\n\
  1596. used to extract from two vectors the relevant data that resides in\n\
  1597. @var{addr} in case @var{addr} is not properly aligned.\n\
  1598. \n\
  1599. The autovectorizer, when vectorizing a load operation from an address\n\
  1600. @var{addr} that may be unaligned, will generate two vector loads from\n\
  1601. the two aligned addresses around @var{addr}. It then generates a\n\
  1602. @code{REALIGN_LOAD} operation to extract the relevant data from the\n\
  1603. two loaded vectors. The first two arguments to @code{REALIGN_LOAD},\n\
  1604. @var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and\n\
  1605. the third argument, @var{OFF}, defines how the data will be extracted\n\
  1606. from these two vectors: if @var{OFF} is 0, then the returned vector is\n\
  1607. @var{v2}; otherwise, the returned vector is composed from the last\n\
  1608. @var{VS}-@var{OFF} elements of @var{v1} concatenated to the first\n\
  1609. @var{OFF} elements of @var{v2}.\n\
  1610. \n\
  1611. If this hook is defined, the autovectorizer will generate a call\n\
  1612. to @var{f} (using the DECL tree that this hook returns) and will\n\
  1613. use the return value of @var{f} as the argument @var{OFF} to\n\
  1614. @code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}\n\
  1615. should comply with the semantics expected by @code{REALIGN_LOAD}\n\
  1616. described above.\n\
  1617. If this hook is not defined, then @var{addr} will be used as\n\
  1618. the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low\n\
  1619. log2(@var{VS}) @minus{} 1 bits of @var{addr} will be considered.",
  1620. tree, (void), NULL)
  1621. /* Returns a built-in function that realizes the vectorized version of
  1622. a target-independent function, or NULL_TREE if not available. */
  1623. DEFHOOK
  1624. (builtin_vectorized_function,
  1625. "This hook should return the decl of a function that implements the\n\
  1626. vectorized variant of the function with the @code{combined_fn} code\n\
  1627. @var{code} or @code{NULL_TREE} if such a function is not available.\n\
  1628. The return type of the vectorized function shall be of vector type\n\
  1629. @var{vec_type_out} and the argument types should be @var{vec_type_in}.",
  1630. tree, (unsigned code, tree vec_type_out, tree vec_type_in),
  1631. default_builtin_vectorized_function)
  1632. /* Returns a built-in function that realizes the vectorized version of
  1633. a target-specific function, or NULL_TREE if not available. */
  1634. DEFHOOK
  1635. (builtin_md_vectorized_function,
  1636. "This hook should return the decl of a function that implements the\n\
  1637. vectorized variant of target built-in function @code{fndecl}. The\n\
  1638. return type of the vectorized function shall be of vector type\n\
  1639. @var{vec_type_out} and the argument types should be @var{vec_type_in}.",
  1640. tree, (tree fndecl, tree vec_type_out, tree vec_type_in),
  1641. default_builtin_md_vectorized_function)
  1642. /* Returns a function declaration for a builtin that realizes the
  1643. vector conversion, or NULL_TREE if not available. */
  1644. DEFHOOK
  1645. (builtin_conversion,
  1646. "This hook should return the DECL of a function that implements conversion of the\n\
  1647. input vector of type @var{src_type} to type @var{dest_type}.\n\
  1648. The value of @var{code} is one of the enumerators in @code{enum tree_code} and\n\
  1649. specifies how the conversion is to be applied\n\
  1650. (truncation, rounding, etc.).\n\
  1651. \n\
  1652. If this hook is defined, the autovectorizer will use the\n\
  1653. @code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing\n\
  1654. conversion. Otherwise, it will return @code{NULL_TREE}.",
  1655. tree, (unsigned code, tree dest_type, tree src_type),
  1656. default_builtin_vectorized_conversion)
  1657. /* Cost of different vector/scalar statements in vectorization cost
  1658. model. In case of misaligned vector loads and stores the cost depends
  1659. on the data type and misalignment value. */
  1660. DEFHOOK
  1661. (builtin_vectorization_cost,
  1662. "Returns cost of different scalar or vector statements for vectorization cost model.\n\
  1663. For vector memory operations the cost may depend on type (@var{vectype}) and\n\
  1664. misalignment value (@var{misalign}).",
  1665. int, (enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign),
  1666. default_builtin_vectorization_cost)
  1667. DEFHOOK
  1668. (preferred_vector_alignment,
  1669. "This hook returns the preferred alignment in bits for accesses to\n\
  1670. vectors of type @var{type} in vectorized code. This might be less than\n\
  1671. or greater than the ABI-defined value returned by\n\
  1672. @code{TARGET_VECTOR_ALIGNMENT}. It can be equal to the alignment of\n\
  1673. a single element, in which case the vectorizer will not try to optimize\n\
  1674. for alignment.\n\
  1675. \n\
  1676. The default hook returns @code{TYPE_ALIGN (@var{type})}, which is\n\
  1677. correct for most targets.",
  1678. poly_uint64, (const_tree type),
  1679. default_preferred_vector_alignment)
  1680. /* Return true if vector alignment is reachable (by peeling N
  1681. iterations) for the given scalar type. */
  1682. DEFHOOK
  1683. (vector_alignment_reachable,
  1684. "Return true if vector alignment is reachable (by peeling N iterations) for the given scalar type @var{type}. @var{is_packed} is false if the scalar access using @var{type} is known to be naturally aligned.",
  1685. bool, (const_tree type, bool is_packed),
  1686. default_builtin_vector_alignment_reachable)
  1687. DEFHOOK
  1688. (vec_perm_const,
  1689. "This hook is used to test whether the target can permute up to two\n\
  1690. vectors of mode @var{mode} using the permutation vector @code{sel}, and\n\
  1691. also to emit such a permutation. In the former case @var{in0}, @var{in1}\n\
  1692. and @var{out} are all null. In the latter case @var{in0} and @var{in1} are\n\
  1693. the source vectors and @var{out} is the destination vector; all three are\n\
  1694. registers of mode @var{mode}. @var{in1} is the same as @var{in0} if\n\
  1695. @var{sel} describes a permutation on one vector instead of two.\n\
  1696. \n\
  1697. Return true if the operation is possible, emitting instructions for it\n\
  1698. if rtxes are provided.\n\
  1699. \n\
  1700. @cindex @code{vec_perm@var{m}} instruction pattern\n\
  1701. If the hook returns false for a mode with multibyte elements, GCC will\n\
  1702. try the equivalent byte operation. If that also fails, it will try forcing\n\
  1703. the selector into a register and using the @var{vec_perm@var{mode}}\n\
  1704. instruction pattern. There is no need for the hook to handle these two\n\
  1705. implementation approaches itself.",
  1706. bool, (machine_mode mode, rtx output, rtx in0, rtx in1,
  1707. const vec_perm_indices &sel),
  1708. NULL)
  1709. /* Return true if the target supports misaligned store/load of a
  1710. specific factor denoted in the third parameter. The last parameter
  1711. is true if the access is defined in a packed struct. */
  1712. DEFHOOK
  1713. (support_vector_misalignment,
  1714. "This hook should return true if the target supports misaligned vector\n\
  1715. store/load of a specific factor denoted in the @var{misalignment}\n\
  1716. parameter. The vector store/load should be of machine mode @var{mode} and\n\
  1717. the elements in the vectors should be of type @var{type}. @var{is_packed}\n\
  1718. parameter is true if the memory access is defined in a packed struct.",
  1719. bool,
  1720. (machine_mode mode, const_tree type, int misalignment, bool is_packed),
  1721. default_builtin_support_vector_misalignment)
  1722. /* Returns the preferred mode for SIMD operations for the specified
  1723. scalar mode. */
  1724. DEFHOOK
  1725. (preferred_simd_mode,
  1726. "This hook should return the preferred mode for vectorizing scalar\n\
  1727. mode @var{mode}. The default is\n\
  1728. equal to @code{word_mode}, because the vectorizer can do some\n\
  1729. transformations even in absence of specialized @acronym{SIMD} hardware.",
  1730. machine_mode,
  1731. (scalar_mode mode),
  1732. default_preferred_simd_mode)
  1733. /* Returns the preferred mode for splitting SIMD reductions to. */
  1734. DEFHOOK
  1735. (split_reduction,
  1736. "This hook should return the preferred mode to split the final reduction\n\
  1737. step on @var{mode} to. The reduction is then carried out reducing upper\n\
  1738. against lower halves of vectors recursively until the specified mode is\n\
  1739. reached. The default is @var{mode} which means no splitting.",
  1740. machine_mode,
  1741. (machine_mode),
  1742. default_split_reduction)
  1743. /* Returns a mask of vector sizes to iterate over when auto-vectorizing
  1744. after processing the preferred one derived from preferred_simd_mode. */
  1745. DEFHOOK
  1746. (autovectorize_vector_sizes,
  1747. "If the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is not\n\
  1748. the only one that is worth considering, this hook should add all suitable\n\
  1749. vector sizes to @var{sizes}, in order of decreasing preference. The first\n\
  1750. one should be the size of @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}.\n\
  1751. \n\
  1752. The hook does not need to do anything if the vector returned by\n\
  1753. @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is the only one relevant\n\
  1754. for autovectorization. The default implementation does nothing.",
  1755. void,
  1756. (vector_sizes *sizes),
  1757. default_autovectorize_vector_sizes)
  1758. /* Function to get a target mode for a vector mask. */
  1759. DEFHOOK
  1760. (get_mask_mode,
  1761. "A vector mask is a value that holds one boolean result for every element\n\
  1762. in a vector. This hook returns the machine mode that should be used to\n\
  1763. represent such a mask when the vector in question is @var{length} bytes\n\
  1764. long and contains @var{nunits} elements. The hook returns an empty\n\
  1765. @code{opt_machine_mode} if no such mode exists.\n\
  1766. \n\
  1767. The default implementation returns the mode of an integer vector that\n\
  1768. is @var{length} bytes long and that contains @var{nunits} elements,\n\
  1769. if such a mode exists.",
  1770. opt_machine_mode,
  1771. (poly_uint64 nunits, poly_uint64 length),
  1772. default_get_mask_mode)
  1773. /* Function to say whether a masked operation is expensive when the
  1774. mask is all zeros. */
  1775. DEFHOOK
  1776. (empty_mask_is_expensive,
  1777. "This hook returns true if masked internal function @var{ifn} (really of\n\
  1778. type @code{internal_fn}) should be considered expensive when the mask is\n\
  1779. all zeros. GCC can then try to branch around the instruction instead.",
  1780. bool,
  1781. (unsigned ifn),
  1782. default_empty_mask_is_expensive)
  1783. /* Target builtin that implements vector gather operation. */
  1784. DEFHOOK
  1785. (builtin_gather,
  1786. "Target builtin that implements vector gather operation. @var{mem_vectype}\n\
  1787. is the vector type of the load and @var{index_type} is scalar type of\n\
  1788. the index, scaled by @var{scale}.\n\
  1789. The default is @code{NULL_TREE} which means to not vectorize gather\n\
  1790. loads.",
  1791. tree,
  1792. (const_tree mem_vectype, const_tree index_type, int scale),
  1793. NULL)
  1794. /* Target builtin that implements vector scatter operation. */
  1795. DEFHOOK
  1796. (builtin_scatter,
  1797. "Target builtin that implements vector scatter operation. @var{vectype}\n\
  1798. is the vector type of the store and @var{index_type} is scalar type of\n\
  1799. the index, scaled by @var{scale}.\n\
  1800. The default is @code{NULL_TREE} which means to not vectorize scatter\n\
  1801. stores.",
  1802. tree,
  1803. (const_tree vectype, const_tree index_type, int scale),
  1804. NULL)
  1805. /* Target function to initialize the cost model for a loop or block. */
  1806. DEFHOOK
  1807. (init_cost,
  1808. "This hook should initialize target-specific data structures in preparation "
  1809. "for modeling the costs of vectorizing a loop or basic block. The default "
  1810. "allocates three unsigned integers for accumulating costs for the prologue, "
  1811. "body, and epilogue of the loop or basic block. If @var{loop_info} is "
  1812. "non-NULL, it identifies the loop being vectorized; otherwise a single block "
  1813. "is being vectorized.",
  1814. void *,
  1815. (struct loop *loop_info),
  1816. default_init_cost)
  1817. /* Target function to record N statements of the given kind using the
  1818. given vector type within the cost model data for the current loop or
  1819. block. */
  1820. DEFHOOK
  1821. (add_stmt_cost,
  1822. "This hook should update the target-specific @var{data} in response to "
  1823. "adding @var{count} copies of the given @var{kind} of statement to a "
  1824. "loop or basic block. The default adds the builtin vectorizer cost for "
  1825. "the copies of the statement to the accumulator specified by @var{where}, "
  1826. "(the prologue, body, or epilogue) and returns the amount added. The "
  1827. "return value should be viewed as a tentative cost that may later be "
  1828. "revised.",
  1829. unsigned,
  1830. (void *data, int count, enum vect_cost_for_stmt kind,
  1831. struct _stmt_vec_info *stmt_info, int misalign,
  1832. enum vect_cost_model_location where),
  1833. default_add_stmt_cost)
  1834. /* Target function to calculate the total cost of the current vectorized
  1835. loop or block. */
  1836. DEFHOOK
  1837. (finish_cost,
  1838. "This hook should complete calculations of the cost of vectorizing a loop "
  1839. "or basic block based on @var{data}, and return the prologue, body, and "
  1840. "epilogue costs as unsigned integers. The default returns the value of "
  1841. "the three accumulators.",
  1842. void,
  1843. (void *data, unsigned *prologue_cost, unsigned *body_cost,
  1844. unsigned *epilogue_cost),
  1845. default_finish_cost)
  1846. /* Function to delete target-specific cost modeling data. */
  1847. DEFHOOK
  1848. (destroy_cost_data,
  1849. "This hook should release @var{data} and any related data structures "
  1850. "allocated by TARGET_VECTORIZE_INIT_COST. The default releases the "
  1851. "accumulator.",
  1852. void,
  1853. (void *data),
  1854. default_destroy_cost_data)
  1855. HOOK_VECTOR_END (vectorize)
  1856. #undef HOOK_PREFIX
  1857. #define HOOK_PREFIX "TARGET_"
  1858. DEFHOOK
  1859. (preferred_else_value,
  1860. "This hook returns the target's preferred final argument for a call\n\
  1861. to conditional internal function @var{ifn} (really of type\n\
  1862. @code{internal_fn}). @var{type} specifies the return type of the\n\
  1863. function and @var{ops} are the operands to the conditional operation,\n\
  1864. of which there are @var{nops}.\n\
  1865. \n\
  1866. For example, if @var{ifn} is @code{IFN_COND_ADD}, the hook returns\n\
  1867. a value of type @var{type} that should be used when @samp{@var{ops}[0]}\n\
  1868. and @samp{@var{ops}[1]} are conditionally added together.\n\
  1869. \n\
  1870. This hook is only relevant if the target supports conditional patterns\n\
  1871. like @code{cond_add@var{m}}. The default implementation returns a zero\n\
  1872. constant of type @var{type}.",
  1873. tree,
  1874. (unsigned ifn, tree type, unsigned nops, tree *ops),
  1875. default_preferred_else_value)
  1876. DEFHOOK
  1877. (record_offload_symbol,
  1878. "Used when offloaded functions are seen in the compilation unit and no named\n\
  1879. sections are available. It is called once for each symbol that must be\n\
  1880. recorded in the offload function and variable table.",
  1881. void, (tree),
  1882. hook_void_tree)
  1883. DEFHOOKPOD
  1884. (absolute_biggest_alignment,
  1885. "If defined, this target hook specifies the absolute biggest alignment\n\
  1886. that a type or variable can have on this machine, otherwise,\n\
  1887. @code{BIGGEST_ALIGNMENT} is used.",
  1888. HOST_WIDE_INT, BIGGEST_ALIGNMENT)
  1889. /* Allow target specific overriding of option settings after options have
  1890. been changed by an attribute or pragma or when it is reset at the
  1891. end of the code affected by an attribute or pragma. */
  1892. DEFHOOK
  1893. (override_options_after_change,
  1894. "This target function is similar to the hook @code{TARGET_OPTION_OVERRIDE}\n\
  1895. but is called when the optimize level is changed via an attribute or\n\
  1896. pragma or when it is reset at the end of the code affected by the\n\
  1897. attribute or pragma. It is not called at the beginning of compilation\n\
  1898. when @code{TARGET_OPTION_OVERRIDE} is called so if you want to perform these\n\
  1899. actions then, you should have @code{TARGET_OPTION_OVERRIDE} call\n\
  1900. @code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}.",
  1901. void, (void),
  1902. hook_void_void)
  1903. DEFHOOK
  1904. (offload_options,
  1905. "Used when writing out the list of options into an LTO file. It should\n\
  1906. translate any relevant target-specific options (such as the ABI in use)\n\
  1907. into one of the @option{-foffload} options that exist as a common interface\n\
  1908. to express such options. It should return a string containing these options,\n\
  1909. separated by spaces, which the caller will free.\n",
  1910. char *, (void), hook_charptr_void_null)
  1911. DEFHOOK_UNDOC
  1912. (eh_return_filter_mode,
  1913. "Return machine mode for filter value.",
  1914. scalar_int_mode, (void),
  1915. default_eh_return_filter_mode)
  1916. /* Return machine mode for libgcc expanded cmp instructions. */
  1917. DEFHOOK
  1918. (libgcc_cmp_return_mode,
  1919. "This target hook should return the mode to be used for the return value\n\
  1920. of compare instructions expanded to libgcc calls. If not defined\n\
  1921. @code{word_mode} is returned which is the right choice for a majority of\n\
  1922. targets.",
  1923. scalar_int_mode, (void),
  1924. default_libgcc_cmp_return_mode)
  1925. /* Return machine mode for libgcc expanded shift instructions. */
  1926. DEFHOOK
  1927. (libgcc_shift_count_mode,
  1928. "This target hook should return the mode to be used for the shift count operand\n\
  1929. of shift instructions expanded to libgcc calls. If not defined\n\
  1930. @code{word_mode} is returned which is the right choice for a majority of\n\
  1931. targets.",
  1932. scalar_int_mode, (void),
  1933. default_libgcc_shift_count_mode)
  1934. /* Return machine mode to be used for _Unwind_Word type. */
  1935. DEFHOOK
  1936. (unwind_word_mode,
  1937. "Return machine mode to be used for @code{_Unwind_Word} type.\n\
  1938. The default is to use @code{word_mode}.",
  1939. scalar_int_mode, (void),
  1940. default_unwind_word_mode)
  1941. /* Given two decls, merge their attributes and return the result. */
  1942. DEFHOOK
  1943. (merge_decl_attributes,
  1944. "Define this target hook if the merging of decl attributes needs special\n\
  1945. handling. If defined, the result is a list of the combined\n\
  1946. @code{DECL_ATTRIBUTES} of @var{olddecl} and @var{newdecl}.\n\
  1947. @var{newdecl} is a duplicate declaration of @var{olddecl}. Examples of\n\
  1948. when this is needed are when one attribute overrides another, or when an\n\
  1949. attribute is nullified by a subsequent definition. This function may\n\
  1950. call @code{merge_attributes} to handle machine-independent merging.\n\
  1951. \n\
  1952. @findex TARGET_DLLIMPORT_DECL_ATTRIBUTES\n\
  1953. If the only target-specific handling you require is @samp{dllimport}\n\
  1954. for Microsoft Windows targets, you should define the macro\n\
  1955. @code{TARGET_DLLIMPORT_DECL_ATTRIBUTES} to @code{1}. The compiler\n\
  1956. will then define a function called\n\
  1957. @code{merge_dllimport_decl_attributes} which can then be defined as\n\
  1958. the expansion of @code{TARGET_MERGE_DECL_ATTRIBUTES}. You can also\n\
  1959. add @code{handle_dll_attribute} in the attribute table for your port\n\
  1960. to perform initial processing of the @samp{dllimport} and\n\
  1961. @samp{dllexport} attributes. This is done in @file{i386/cygwin.h} and\n\
  1962. @file{i386/i386.c}, for example.",
  1963. tree, (tree olddecl, tree newdecl),
  1964. merge_decl_attributes)
  1965. /* Given two types, merge their attributes and return the result. */
  1966. DEFHOOK
  1967. (merge_type_attributes,
  1968. "Define this target hook if the merging of type attributes needs special\n\
  1969. handling. If defined, the result is a list of the combined\n\
  1970. @code{TYPE_ATTRIBUTES} of @var{type1} and @var{type2}. It is assumed\n\
  1971. that @code{comptypes} has already been called and returned 1. This\n\
  1972. function may call @code{merge_attributes} to handle machine-independent\n\
  1973. merging.",
  1974. tree, (tree type1, tree type2),
  1975. merge_type_attributes)
  1976. /* Table of machine attributes and functions to handle them.
  1977. Ignored if NULL. */
  1978. DEFHOOKPOD
  1979. (attribute_table,
  1980. "If defined, this target hook points to an array of @samp{struct\n\
  1981. attribute_spec} (defined in @file{tree-core.h}) specifying the machine\n\
  1982. specific attributes for this target and some of the restrictions on the\n\
  1983. entities to which these attributes are applied and the arguments they\n\
  1984. take.",
  1985. const struct attribute_spec *, NULL)
  1986. /* Return true iff attribute NAME expects a plain identifier as its first
  1987. argument. */
  1988. DEFHOOK
  1989. (attribute_takes_identifier_p,
  1990. "If defined, this target hook is a function which returns true if the\n\
  1991. machine-specific attribute named @var{name} expects an identifier\n\
  1992. given as its first argument to be passed on as a plain identifier, not\n\
  1993. subjected to name lookup. If this is not defined, the default is\n\
  1994. false for all machine-specific attributes.",
  1995. bool, (const_tree name),
  1996. hook_bool_const_tree_false)
  1997. /* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
  1998. one if they are compatible and two if they are nearly compatible
  1999. (which causes a warning to be generated). */
  2000. DEFHOOK
  2001. (comp_type_attributes,
  2002. "If defined, this target hook is a function which returns zero if the attributes on\n\
  2003. @var{type1} and @var{type2} are incompatible, one if they are compatible,\n\
  2004. and two if they are nearly compatible (which causes a warning to be\n\
  2005. generated). If this is not defined, machine-specific attributes are\n\
  2006. supposed always to be compatible.",
  2007. int, (const_tree type1, const_tree type2),
  2008. hook_int_const_tree_const_tree_1)
  2009. /* Assign default attributes to the newly defined TYPE. */
  2010. DEFHOOK
  2011. (set_default_type_attributes,
  2012. "If defined, this target hook is a function which assigns default attributes to\n\
  2013. the newly defined @var{type}.",
  2014. void, (tree type),
  2015. hook_void_tree)
  2016. /* Insert attributes on the newly created DECL. */
  2017. DEFHOOK
  2018. (insert_attributes,
  2019. "Define this target hook if you want to be able to add attributes to a decl\n\
  2020. when it is being created. This is normally useful for back ends which\n\
  2021. wish to implement a pragma by using the attributes which correspond to\n\
  2022. the pragma's effect. The @var{node} argument is the decl which is being\n\
  2023. created. The @var{attr_ptr} argument is a pointer to the attribute list\n\
  2024. for this decl. The list itself should not be modified, since it may be\n\
  2025. shared with other decls, but attributes may be chained on the head of\n\
  2026. the list and @code{*@var{attr_ptr}} modified to point to the new\n\
  2027. attributes, or a copy of the list may be made if further changes are\n\
  2028. needed.",
  2029. void, (tree node, tree *attr_ptr),
  2030. hook_void_tree_treeptr)
  2031. /* Return true if FNDECL (which has at least one machine attribute)
  2032. can be inlined despite its machine attributes, false otherwise. */
  2033. DEFHOOK
  2034. (function_attribute_inlinable_p,
  2035. "@cindex inlining\n\
  2036. This target hook returns @code{true} if it is OK to inline @var{fndecl}\n\
  2037. into the current function, despite its having target-specific\n\
  2038. attributes, @code{false} otherwise. By default, if a function has a\n\
  2039. target specific attribute attached to it, it will not be inlined.",
  2040. bool, (const_tree fndecl),
  2041. hook_bool_const_tree_false)
  2042. /* Return true if bitfields in RECORD_TYPE should follow the
  2043. Microsoft Visual C++ bitfield layout rules. */
  2044. DEFHOOK
  2045. (ms_bitfield_layout_p,
  2046. "This target hook returns @code{true} if bit-fields in the given\n\
  2047. @var{record_type} are to be laid out following the rules of Microsoft\n\
  2048. Visual C/C++, namely: (i) a bit-field won't share the same storage\n\
  2049. unit with the previous bit-field if their underlying types have\n\
  2050. different sizes, and the bit-field will be aligned to the highest\n\
  2051. alignment of the underlying types of itself and of the previous\n\
  2052. bit-field; (ii) a zero-sized bit-field will affect the alignment of\n\
  2053. the whole enclosing structure, even if it is unnamed; except that\n\
  2054. (iii) a zero-sized bit-field will be disregarded unless it follows\n\
  2055. another bit-field of nonzero size. If this hook returns @code{true},\n\
  2056. other macros that control bit-field layout are ignored.\n\
  2057. \n\
  2058. When a bit-field is inserted into a packed record, the whole size\n\
  2059. of the underlying type is used by one or more same-size adjacent\n\
  2060. bit-fields (that is, if its long:3, 32 bits is used in the record,\n\
  2061. and any additional adjacent long bit-fields are packed into the same\n\
  2062. chunk of 32 bits. However, if the size changes, a new field of that\n\
  2063. size is allocated). In an unpacked record, this is the same as using\n\
  2064. alignment, but not equivalent when packing.\n\
  2065. \n\
  2066. If both MS bit-fields and @samp{__attribute__((packed))} are used,\n\
  2067. the latter will take precedence. If @samp{__attribute__((packed))} is\n\
  2068. used on a single field when MS bit-fields are in use, it will take\n\
  2069. precedence for that field, but the alignment of the rest of the structure\n\
  2070. may affect its placement.",
  2071. bool, (const_tree record_type),
  2072. hook_bool_const_tree_false)
  2073. /* For now this is only an interface to WORDS_BIG_ENDIAN for
  2074. target-independent code like the front ends, need performance testing
  2075. before switching completely to the target hook. */
  2076. DEFHOOK_UNDOC
  2077. (words_big_endian,
  2078. "",
  2079. bool, (void),
  2080. targhook_words_big_endian)
  2081. /* Likewise for FLOAT_WORDS_BIG_ENDIAN. */
  2082. DEFHOOK_UNDOC
  2083. (float_words_big_endian,
  2084. "",
  2085. bool, (void),
  2086. targhook_float_words_big_endian)
  2087. DEFHOOK
  2088. (float_exceptions_rounding_supported_p,
  2089. "Returns true if the target supports IEEE 754 floating-point exceptions\
  2090. and rounding modes, false otherwise. This is intended to relate to the\
  2091. @code{float} and @code{double} types, but not necessarily @code{long double}.\
  2092. By default, returns true if the @code{adddf3} instruction pattern is\
  2093. available and false otherwise, on the assumption that hardware floating\
  2094. point supports exceptions and rounding modes but software floating point\
  2095. does not.",
  2096. bool, (void),
  2097. default_float_exceptions_rounding_supported_p)
  2098. /* True if the target supports decimal floating point. */
  2099. DEFHOOK
  2100. (decimal_float_supported_p,
  2101. "Returns true if the target supports decimal floating point.",
  2102. bool, (void),
  2103. default_decimal_float_supported_p)
  2104. /* True if the target supports fixed-point. */
  2105. DEFHOOK
  2106. (fixed_point_supported_p,
  2107. "Returns true if the target supports fixed-point arithmetic.",
  2108. bool, (void),
  2109. default_fixed_point_supported_p)
  2110. /* Return true if anonymous bitfields affect structure alignment. */
  2111. DEFHOOK
  2112. (align_anon_bitfield,
  2113. "When @code{PCC_BITFIELD_TYPE_MATTERS} is true this hook will determine\n\
  2114. whether unnamed bitfields affect the alignment of the containing\n\
  2115. structure. The hook should return true if the structure should inherit\n\
  2116. the alignment requirements of an unnamed bitfield's type.",
  2117. bool, (void),
  2118. hook_bool_void_false)
  2119. /* Return true if volatile bitfields should use the narrowest type possible.
  2120. Return false if they should use the container type. */
  2121. DEFHOOK
  2122. (narrow_volatile_bitfield,
  2123. "This target hook should return @code{true} if accesses to volatile bitfields\n\
  2124. should use the narrowest mode possible. It should return @code{false} if\n\
  2125. these accesses should use the bitfield container type.\n\
  2126. \n\
  2127. The default is @code{false}.",
  2128. bool, (void),
  2129. hook_bool_void_false)
  2130. /* Set up target-specific built-in functions. */
  2131. DEFHOOK
  2132. (init_builtins,
  2133. "Define this hook if you have any machine-specific built-in functions\n\
  2134. that need to be defined. It should be a function that performs the\n\
  2135. necessary setup.\n\
  2136. \n\
  2137. Machine specific built-in functions can be useful to expand special machine\n\
  2138. instructions that would otherwise not normally be generated because\n\
  2139. they have no equivalent in the source language (for example, SIMD vector\n\
  2140. instructions or prefetch instructions).\n\
  2141. \n\
  2142. To create a built-in function, call the function\n\
  2143. @code{lang_hooks.builtin_function}\n\
  2144. which is defined by the language front end. You can use any type nodes set\n\
  2145. up by @code{build_common_tree_nodes};\n\
  2146. only language front ends that use those two functions will call\n\
  2147. @samp{TARGET_INIT_BUILTINS}.",
  2148. void, (void),
  2149. hook_void_void)
  2150. /* Initialize (if INITIALIZE_P is true) and return the target-specific
  2151. built-in function decl for CODE.
  2152. Return NULL if that is not possible. Return error_mark_node if CODE
  2153. is outside of the range of valid target builtin function codes. */
  2154. DEFHOOK
  2155. (builtin_decl,
  2156. "Define this hook if you have any machine-specific built-in functions\n\
  2157. that need to be defined. It should be a function that returns the\n\
  2158. builtin function declaration for the builtin function code @var{code}.\n\
  2159. If there is no such builtin and it cannot be initialized at this time\n\
  2160. if @var{initialize_p} is true the function should return @code{NULL_TREE}.\n\
  2161. If @var{code} is out of range the function should return\n\
  2162. @code{error_mark_node}.",
  2163. tree, (unsigned code, bool initialize_p), NULL)
  2164. /* Expand a target-specific builtin. */
  2165. DEFHOOK
  2166. (expand_builtin,
  2167. "\n\
  2168. Expand a call to a machine specific built-in function that was set up by\n\
  2169. @samp{TARGET_INIT_BUILTINS}. @var{exp} is the expression for the\n\
  2170. function call; the result should go to @var{target} if that is\n\
  2171. convenient, and have mode @var{mode} if that is convenient.\n\
  2172. @var{subtarget} may be used as the target for computing one of\n\
  2173. @var{exp}'s operands. @var{ignore} is nonzero if the value is to be\n\
  2174. ignored. This function should return the result of the call to the\n\
  2175. built-in function.",
  2176. rtx,
  2177. (tree exp, rtx target, rtx subtarget, machine_mode mode, int ignore),
  2178. default_expand_builtin)
  2179. /* Select a replacement for a target-specific builtin. This is done
  2180. *before* regular type checking, and so allows the target to
  2181. implement a crude form of function overloading. The result is a
  2182. complete expression that implements the operation. PARAMS really
  2183. has type VEC(tree,gc)*, but we don't want to include tree.h here. */
  2184. DEFHOOK
  2185. (resolve_overloaded_builtin,
  2186. "Select a replacement for a machine specific built-in function that\n\
  2187. was set up by @samp{TARGET_INIT_BUILTINS}. This is done\n\
  2188. @emph{before} regular type checking, and so allows the target to\n\
  2189. implement a crude form of function overloading. @var{fndecl} is the\n\
  2190. declaration of the built-in function. @var{arglist} is the list of\n\
  2191. arguments passed to the built-in function. The result is a\n\
  2192. complete expression that implements the operation, usually\n\
  2193. another @code{CALL_EXPR}.\n\
  2194. @var{arglist} really has type @samp{VEC(tree,gc)*}",
  2195. tree, (unsigned int /*location_t*/ loc, tree fndecl, void *arglist), NULL)
  2196. /* Fold a target-specific builtin to a tree valid for both GIMPLE
  2197. and GENERIC. */
  2198. DEFHOOK
  2199. (fold_builtin,
  2200. "Fold a call to a machine specific built-in function that was set up by\n\
  2201. @samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the\n\
  2202. built-in function. @var{n_args} is the number of arguments passed to\n\
  2203. the function; the arguments themselves are pointed to by @var{argp}.\n\
  2204. The result is another tree, valid for both GIMPLE and GENERIC,\n\
  2205. containing a simplified expression for the call's result. If\n\
  2206. @var{ignore} is true the value will be ignored.",
  2207. tree, (tree fndecl, int n_args, tree *argp, bool ignore),
  2208. hook_tree_tree_int_treep_bool_null)
  2209. /* Fold a target-specific builtin to a valid GIMPLE tree. */
  2210. DEFHOOK
  2211. (gimple_fold_builtin,
  2212. "Fold a call to a machine specific built-in function that was set up\n\
  2213. by @samp{TARGET_INIT_BUILTINS}. @var{gsi} points to the gimple\n\
  2214. statement holding the function call. Returns true if any change\n\
  2215. was made to the GIMPLE stream.",
  2216. bool, (gimple_stmt_iterator *gsi),
  2217. hook_bool_gsiptr_false)
  2218. /* Target hook is used to compare the target attributes in two functions to
  2219. determine which function's features get higher priority. This is used
  2220. during function multi-versioning to figure out the order in which two
  2221. versions must be dispatched. A function version with a higher priority
  2222. is checked for dispatching earlier. DECL1 and DECL2 are
  2223. the two function decls that will be compared. It returns positive value
  2224. if DECL1 is higher priority, negative value if DECL2 is higher priority
  2225. and 0 if they are the same. */
  2226. DEFHOOK
  2227. (compare_version_priority,
  2228. "This hook is used to compare the target attributes in two functions to\n\
  2229. determine which function's features get higher priority. This is used\n\
  2230. during function multi-versioning to figure out the order in which two\n\
  2231. versions must be dispatched. A function version with a higher priority\n\
  2232. is checked for dispatching earlier. @var{decl1} and @var{decl2} are\n\
  2233. the two function decls that will be compared.",
  2234. int, (tree decl1, tree decl2), NULL)
  2235. /* Target hook is used to generate the dispatcher logic to invoke the right
  2236. function version at run-time for a given set of function versions.
  2237. ARG points to the callgraph node of the dispatcher function whose body
  2238. must be generated. */
  2239. DEFHOOK
  2240. (generate_version_dispatcher_body,
  2241. "This hook is used to generate the dispatcher logic to invoke the right\n\
  2242. function version at run-time for a given set of function versions.\n\
  2243. @var{arg} points to the callgraph node of the dispatcher function whose\n\
  2244. body must be generated.",
  2245. tree, (void *arg), NULL)
  2246. /* Target hook is used to get the dispatcher function for a set of function
  2247. versions. The dispatcher function is called to invoke the right function
  2248. version at run-time. DECL is one version from a set of semantically
  2249. identical versions. */
  2250. DEFHOOK
  2251. (get_function_versions_dispatcher,
  2252. "This hook is used to get the dispatcher function for a set of function\n\
  2253. versions. The dispatcher function is called to invoke the right function\n\
  2254. version at run-time. @var{decl} is one version from a set of semantically\n\
  2255. identical versions.",
  2256. tree, (void *decl), NULL)
  2257. /* Returns a code for a target-specific builtin that implements
  2258. reciprocal of a target-specific function, or NULL_TREE if not available. */
  2259. DEFHOOK
  2260. (builtin_reciprocal,
  2261. "This hook should return the DECL of a function that implements the\n\
  2262. reciprocal of the machine-specific builtin function @var{fndecl}, or\n\
  2263. @code{NULL_TREE} if such a function is not available.",
  2264. tree, (tree fndecl),
  2265. default_builtin_reciprocal)
  2266. /* For a vendor-specific TYPE, return a pointer to a statically-allocated
  2267. string containing the C++ mangling for TYPE. In all other cases, return
  2268. NULL. */
  2269. DEFHOOK
  2270. (mangle_type,
  2271. "If your target defines any fundamental types, or any types your target\n\
  2272. uses should be mangled differently from the default, define this hook\n\
  2273. to return the appropriate encoding for these types as part of a C++\n\
  2274. mangled name. The @var{type} argument is the tree structure representing\n\
  2275. the type to be mangled. The hook may be applied to trees which are\n\
  2276. not target-specific fundamental types; it should return @code{NULL}\n\
  2277. for all such types, as well as arguments it does not recognize. If the\n\
  2278. return value is not @code{NULL}, it must point to a statically-allocated\n\
  2279. string constant.\n\
  2280. \n\
  2281. Target-specific fundamental types might be new fundamental types or\n\
  2282. qualified versions of ordinary fundamental types. Encode new\n\
  2283. fundamental types as @samp{@w{u @var{n} @var{name}}}, where @var{name}\n\
  2284. is the name used for the type in source code, and @var{n} is the\n\
  2285. length of @var{name} in decimal. Encode qualified versions of\n\
  2286. ordinary types as @samp{@w{U @var{n} @var{name} @var{code}}}, where\n\
  2287. @var{name} is the name used for the type qualifier in source code,\n\
  2288. @var{n} is the length of @var{name} as above, and @var{code} is the\n\
  2289. code used to represent the unqualified version of this type. (See\n\
  2290. @code{write_builtin_type} in @file{cp/mangle.c} for the list of\n\
  2291. codes.) In both cases the spaces are for clarity; do not include any\n\
  2292. spaces in your string.\n\
  2293. \n\
  2294. This hook is applied to types prior to typedef resolution. If the mangled\n\
  2295. name for a particular type depends only on that type's main variant, you\n\
  2296. can perform typedef resolution yourself using @code{TYPE_MAIN_VARIANT}\n\
  2297. before mangling.\n\
  2298. \n\
  2299. The default version of this hook always returns @code{NULL}, which is\n\
  2300. appropriate for a target that does not define any new fundamental\n\
  2301. types.",
  2302. const char *, (const_tree type),
  2303. hook_constcharptr_const_tree_null)
  2304. /* Make any adjustments to libfunc names needed for this target. */
  2305. DEFHOOK
  2306. (init_libfuncs,
  2307. "This hook should declare additional library routines or rename\n\
  2308. existing ones, using the functions @code{set_optab_libfunc} and\n\
  2309. @code{init_one_libfunc} defined in @file{optabs.c}.\n\
  2310. @code{init_optabs} calls this macro after initializing all the normal\n\
  2311. library routines.\n\
  2312. \n\
  2313. The default is to do nothing. Most ports don't need to define this hook.",
  2314. void, (void),
  2315. hook_void_void)
  2316. /* Add a __gnu_ prefix to library functions rather than just __. */
  2317. DEFHOOKPOD
  2318. (libfunc_gnu_prefix,
  2319. "If false (the default), internal library routines start with two\n\
  2320. underscores. If set to true, these routines start with @code{__gnu_}\n\
  2321. instead. E.g., @code{__muldi3} changes to @code{__gnu_muldi3}. This\n\
  2322. currently only affects functions defined in @file{libgcc2.c}. If this\n\
  2323. is set to true, the @file{tm.h} file must also\n\
  2324. @code{#define LIBGCC2_GNU_PREFIX}.",
  2325. bool, false)
  2326. /* Given a decl, a section name, and whether the decl initializer
  2327. has relocs, choose attributes for the section. */
  2328. /* ??? Should be merged with SELECT_SECTION and UNIQUE_SECTION. */
  2329. DEFHOOK
  2330. (section_type_flags,
  2331. "Choose a set of section attributes for use by @code{TARGET_ASM_NAMED_SECTION}\n\
  2332. based on a variable or function decl, a section name, and whether or not the\n\
  2333. declaration's initializer may contain runtime relocations. @var{decl} may be\n\
  2334. null, in which case read-write data should be assumed.\n\
  2335. \n\
  2336. The default version of this function handles choosing code vs data,\n\
  2337. read-only vs read-write data, and @code{flag_pic}. You should only\n\
  2338. need to override this if your target has special flags that might be\n\
  2339. set via @code{__attribute__}.",
  2340. unsigned int, (tree decl, const char *name, int reloc),
  2341. default_section_type_flags)
  2342. DEFHOOK
  2343. (libc_has_function,
  2344. "This hook determines whether a function from a class of functions\n\
  2345. @var{fn_class} is present at the runtime.",
  2346. bool, (enum function_class fn_class),
  2347. default_libc_has_function)
  2348. /* True if new jumps cannot be created, to replace existing ones or
  2349. not, at the current point in the compilation. */
  2350. DEFHOOK
  2351. (cannot_modify_jumps_p,
  2352. "This target hook returns @code{true} past the point in which new jump\n\
  2353. instructions could be created. On machines that require a register for\n\
  2354. every jump such as the SHmedia ISA of SH5, this point would typically be\n\
  2355. reload, so this target hook should be defined to a function such as:\n\
  2356. \n\
  2357. @smallexample\n\
  2358. static bool\n\
  2359. cannot_modify_jumps_past_reload_p ()\n\
  2360. @{\n\
  2361. return (reload_completed || reload_in_progress);\n\
  2362. @}\n\
  2363. @end smallexample",
  2364. bool, (void),
  2365. hook_bool_void_false)
  2366. /* True if FOLLOWER may be modified to follow FOLLOWEE. */
  2367. DEFHOOK
  2368. (can_follow_jump,
  2369. "FOLLOWER and FOLLOWEE are JUMP_INSN instructions;\
  2370. return true if FOLLOWER may be modified to follow FOLLOWEE;\
  2371. false, if it can't.\
  2372. For example, on some targets, certain kinds of branches can't be made to\
  2373. follow through a hot/cold partitioning.",
  2374. bool, (const rtx_insn *follower, const rtx_insn *followee),
  2375. hook_bool_const_rtx_insn_const_rtx_insn_true)
  2376. /* Return a register class for which branch target register
  2377. optimizations should be applied. */
  2378. DEFHOOK
  2379. (branch_target_register_class,
  2380. "This target hook returns a register class for which branch target register\n\
  2381. optimizations should be applied. All registers in this class should be\n\
  2382. usable interchangeably. After reload, registers in this class will be\n\
  2383. re-allocated and loads will be hoisted out of loops and be subjected\n\
  2384. to inter-block scheduling.",
  2385. reg_class_t, (void),
  2386. default_branch_target_register_class)
  2387. /* Return true if branch target register optimizations should include
  2388. callee-saved registers that are not already live during the current
  2389. function. AFTER_PE_GEN is true if prologues and epilogues have
  2390. already been generated. */
  2391. DEFHOOK
  2392. (branch_target_register_callee_saved,
  2393. "Branch target register optimization will by default exclude callee-saved\n\
  2394. registers\n\
  2395. that are not already live during the current function; if this target hook\n\
  2396. returns true, they will be included. The target code must than make sure\n\
  2397. that all target registers in the class returned by\n\
  2398. @samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are\n\
  2399. saved. @var{after_prologue_epilogue_gen} indicates if prologues and\n\
  2400. epilogues have already been generated. Note, even if you only return\n\
  2401. true when @var{after_prologue_epilogue_gen} is false, you still are likely\n\
  2402. to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}\n\
  2403. to reserve space for caller-saved target registers.",
  2404. bool, (bool after_prologue_epilogue_gen),
  2405. hook_bool_bool_false)
  2406. /* Return true if the target supports conditional execution. */
  2407. DEFHOOK
  2408. (have_conditional_execution,
  2409. "This target hook returns true if the target supports conditional execution.\n\
  2410. This target hook is required only when the target has several different\n\
  2411. modes and they have different conditional execution capability, such as ARM.",
  2412. bool, (void),
  2413. default_have_conditional_execution)
  2414. DEFHOOK
  2415. (gen_ccmp_first,
  2416. "This function prepares to emit a comparison insn for the first compare in a\n\
  2417. sequence of conditional comparisions. It returns an appropriate comparison\n\
  2418. with @code{CC} for passing to @code{gen_ccmp_next} or @code{cbranch_optab}.\n\
  2419. The insns to prepare the compare are saved in @var{prep_seq} and the compare\n\
  2420. insns are saved in @var{gen_seq}. They will be emitted when all the\n\
  2421. compares in the the conditional comparision are generated without error.\n\
  2422. @var{code} is the @code{rtx_code} of the compare for @var{op0} and @var{op1}.",
  2423. rtx, (rtx_insn **prep_seq, rtx_insn **gen_seq, int code, tree op0, tree op1),
  2424. NULL)
  2425. DEFHOOK
  2426. (gen_ccmp_next,
  2427. "This function prepares to emit a conditional comparison within a sequence\n\
  2428. of conditional comparisons. It returns an appropriate comparison with\n\
  2429. @code{CC} for passing to @code{gen_ccmp_next} or @code{cbranch_optab}.\n\
  2430. The insns to prepare the compare are saved in @var{prep_seq} and the compare\n\
  2431. insns are saved in @var{gen_seq}. They will be emitted when all the\n\
  2432. compares in the conditional comparision are generated without error. The\n\
  2433. @var{prev} expression is the result of a prior call to @code{gen_ccmp_first}\n\
  2434. or @code{gen_ccmp_next}. It may return @code{NULL} if the combination of\n\
  2435. @var{prev} and this comparison is not supported, otherwise the result must\n\
  2436. be appropriate for passing to @code{gen_ccmp_next} or @code{cbranch_optab}.\n\
  2437. @var{code} is the @code{rtx_code} of the compare for @var{op0} and @var{op1}.\n\
  2438. @var{bit_code} is @code{AND} or @code{IOR}, which is the op on the compares.",
  2439. rtx, (rtx_insn **prep_seq, rtx_insn **gen_seq, rtx prev, int cmp_code, tree op0, tree op1, int bit_code),
  2440. NULL)
  2441. /* Return a new value for loop unroll size. */
  2442. DEFHOOK
  2443. (loop_unroll_adjust,
  2444. "This target hook returns a new value for the number of times @var{loop}\n\
  2445. should be unrolled. The parameter @var{nunroll} is the number of times\n\
  2446. the loop is to be unrolled. The parameter @var{loop} is a pointer to\n\
  2447. the loop, which is going to be checked for unrolling. This target hook\n\
  2448. is required only when the target has special constraints like maximum\n\
  2449. number of memory accesses.",
  2450. unsigned, (unsigned nunroll, struct loop *loop),
  2451. NULL)
  2452. /* True if X is a legitimate MODE-mode immediate operand. */
  2453. DEFHOOK
  2454. (legitimate_constant_p,
  2455. "This hook returns true if @var{x} is a legitimate constant for a\n\
  2456. @var{mode}-mode immediate operand on the target machine. You can assume that\n\
  2457. @var{x} satisfies @code{CONSTANT_P}, so you need not check this.\n\
  2458. \n\
  2459. The default definition returns true.",
  2460. bool, (machine_mode mode, rtx x),
  2461. hook_bool_mode_rtx_true)
  2462. /* True if the constant X cannot be placed in the constant pool. */
  2463. DEFHOOK
  2464. (cannot_force_const_mem,
  2465. "This hook should return true if @var{x} is of a form that cannot (or\n\
  2466. should not) be spilled to the constant pool. @var{mode} is the mode\n\
  2467. of @var{x}.\n\
  2468. \n\
  2469. The default version of this hook returns false.\n\
  2470. \n\
  2471. The primary reason to define this hook is to prevent reload from\n\
  2472. deciding that a non-legitimate constant would be better reloaded\n\
  2473. from the constant pool instead of spilling and reloading a register\n\
  2474. holding the constant. This restriction is often true of addresses\n\
  2475. of TLS symbols for various targets.",
  2476. bool, (machine_mode mode, rtx x),
  2477. hook_bool_mode_rtx_false)
  2478. DEFHOOK_UNDOC
  2479. (cannot_copy_insn_p,
  2480. "True if the insn @var{x} cannot be duplicated.",
  2481. bool, (rtx_insn *), NULL)
  2482. /* True if X is considered to be commutative. */
  2483. DEFHOOK
  2484. (commutative_p,
  2485. "This target hook returns @code{true} if @var{x} is considered to be commutative.\n\
  2486. Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider\n\
  2487. PLUS to be commutative inside a MEM@. @var{outer_code} is the rtx code\n\
  2488. of the enclosing rtl, if known, otherwise it is UNKNOWN.",
  2489. bool, (const_rtx x, int outer_code),
  2490. hook_bool_const_rtx_commutative_p)
  2491. /* True if ADDR is an address-expression whose effect depends
  2492. on the mode of the memory reference it is used in. */
  2493. DEFHOOK
  2494. (mode_dependent_address_p,
  2495. "This hook returns @code{true} if memory address @var{addr} in address\n\
  2496. space @var{addrspace} can have\n\
  2497. different meanings depending on the machine mode of the memory\n\
  2498. reference it is used for or if the address is valid for some modes\n\
  2499. but not others.\n\
  2500. \n\
  2501. Autoincrement and autodecrement addresses typically have mode-dependent\n\
  2502. effects because the amount of the increment or decrement is the size\n\
  2503. of the operand being addressed. Some machines have other mode-dependent\n\
  2504. addresses. Many RISC machines have no mode-dependent addresses.\n\
  2505. \n\
  2506. You may assume that @var{addr} is a valid address for the machine.\n\
  2507. \n\
  2508. The default version of this hook returns @code{false}.",
  2509. bool, (const_rtx addr, addr_space_t addrspace),
  2510. default_mode_dependent_address_p)
  2511. /* Given an invalid address X for a given machine mode, try machine-specific
  2512. ways to make it legitimate. Return X or an invalid address on failure. */
  2513. DEFHOOK
  2514. (legitimize_address,
  2515. "This hook is given an invalid memory address @var{x} for an\n\
  2516. operand of mode @var{mode} and should try to return a valid memory\n\
  2517. address.\n\
  2518. \n\
  2519. @findex break_out_memory_refs\n\
  2520. @var{x} will always be the result of a call to @code{break_out_memory_refs},\n\
  2521. and @var{oldx} will be the operand that was given to that function to produce\n\
  2522. @var{x}.\n\
  2523. \n\
  2524. The code of the hook should not alter the substructure of\n\
  2525. @var{x}. If it transforms @var{x} into a more legitimate form, it\n\
  2526. should return the new @var{x}.\n\
  2527. \n\
  2528. It is not necessary for this hook to come up with a legitimate address,\n\
  2529. with the exception of native TLS addresses (@pxref{Emulated TLS}).\n\
  2530. The compiler has standard ways of doing so in all cases. In fact, if\n\
  2531. the target supports only emulated TLS, it\n\
  2532. is safe to omit this hook or make it return @var{x} if it cannot find\n\
  2533. a valid way to legitimize the address. But often a machine-dependent\n\
  2534. strategy can generate better code.",
  2535. rtx, (rtx x, rtx oldx, machine_mode mode),
  2536. default_legitimize_address)
  2537. /* Given an address RTX, undo the effects of LEGITIMIZE_ADDRESS. */
  2538. DEFHOOK
  2539. (delegitimize_address,
  2540. "This hook is used to undo the possibly obfuscating effects of the\n\
  2541. @code{LEGITIMIZE_ADDRESS} and @code{LEGITIMIZE_RELOAD_ADDRESS} target\n\
  2542. macros. Some backend implementations of these macros wrap symbol\n\
  2543. references inside an @code{UNSPEC} rtx to represent PIC or similar\n\
  2544. addressing modes. This target hook allows GCC's optimizers to understand\n\
  2545. the semantics of these opaque @code{UNSPEC}s by converting them back\n\
  2546. into their original form.",
  2547. rtx, (rtx x),
  2548. delegitimize_mem_from_attrs)
  2549. /* Given an RTX, return true if it is not ok to emit it into debug info
  2550. section. */
  2551. DEFHOOK
  2552. (const_not_ok_for_debug_p,
  2553. "This hook should return true if @var{x} should not be emitted into\n\
  2554. debug sections.",
  2555. bool, (rtx x),
  2556. default_const_not_ok_for_debug_p)
  2557. /* Given an address RTX, say whether it is valid. */
  2558. DEFHOOK
  2559. (legitimate_address_p,
  2560. "A function that returns whether @var{x} (an RTX) is a legitimate memory\n\
  2561. address on the target machine for a memory operand of mode @var{mode}.\n\
  2562. \n\
  2563. Legitimate addresses are defined in two variants: a strict variant and a\n\
  2564. non-strict one. The @var{strict} parameter chooses which variant is\n\
  2565. desired by the caller.\n\
  2566. \n\
  2567. The strict variant is used in the reload pass. It must be defined so\n\
  2568. that any pseudo-register that has not been allocated a hard register is\n\
  2569. considered a memory reference. This is because in contexts where some\n\
  2570. kind of register is required, a pseudo-register with no hard register\n\
  2571. must be rejected. For non-hard registers, the strict variant should look\n\
  2572. up the @code{reg_renumber} array; it should then proceed using the hard\n\
  2573. register number in the array, or treat the pseudo as a memory reference\n\
  2574. if the array holds @code{-1}.\n\
  2575. \n\
  2576. The non-strict variant is used in other passes. It must be defined to\n\
  2577. accept all pseudo-registers in every context where some kind of\n\
  2578. register is required.\n\
  2579. \n\
  2580. Normally, constant addresses which are the sum of a @code{symbol_ref}\n\
  2581. and an integer are stored inside a @code{const} RTX to mark them as\n\
  2582. constant. Therefore, there is no need to recognize such sums\n\
  2583. specifically as legitimate addresses. Normally you would simply\n\
  2584. recognize any @code{const} as legitimate.\n\
  2585. \n\
  2586. Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant\n\
  2587. sums that are not marked with @code{const}. It assumes that a naked\n\
  2588. @code{plus} indicates indexing. If so, then you @emph{must} reject such\n\
  2589. naked constant sums as illegitimate addresses, so that none of them will\n\
  2590. be given to @code{PRINT_OPERAND_ADDRESS}.\n\
  2591. \n\
  2592. @cindex @code{TARGET_ENCODE_SECTION_INFO} and address validation\n\
  2593. On some machines, whether a symbolic address is legitimate depends on\n\
  2594. the section that the address refers to. On these machines, define the\n\
  2595. target hook @code{TARGET_ENCODE_SECTION_INFO} to store the information\n\
  2596. into the @code{symbol_ref}, and then check for it here. When you see a\n\
  2597. @code{const}, you will have to look inside it to find the\n\
  2598. @code{symbol_ref} in order to determine the section. @xref{Assembler\n\
  2599. Format}.\n\
  2600. \n\
  2601. @cindex @code{GO_IF_LEGITIMATE_ADDRESS}\n\
  2602. Some ports are still using a deprecated legacy substitute for\n\
  2603. this hook, the @code{GO_IF_LEGITIMATE_ADDRESS} macro. This macro\n\
  2604. has this syntax:\n\
  2605. \n\
  2606. @example\n\
  2607. #define GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})\n\
  2608. @end example\n\
  2609. \n\
  2610. @noindent\n\
  2611. and should @code{goto @var{label}} if the address @var{x} is a valid\n\
  2612. address on the target machine for a memory operand of mode @var{mode}.\n\
  2613. \n\
  2614. @findex REG_OK_STRICT\n\
  2615. Compiler source files that want to use the strict variant of this\n\
  2616. macro define the macro @code{REG_OK_STRICT}. You should use an\n\
  2617. @code{#ifdef REG_OK_STRICT} conditional to define the strict variant in\n\
  2618. that case and the non-strict variant otherwise.\n\
  2619. \n\
  2620. Using the hook is usually simpler because it limits the number of\n\
  2621. files that are recompiled when changes are made.",
  2622. bool, (machine_mode mode, rtx x, bool strict),
  2623. default_legitimate_address_p)
  2624. /* True if the given constant can be put into an object_block. */
  2625. DEFHOOK
  2626. (use_blocks_for_constant_p,
  2627. "This hook should return true if pool entries for constant @var{x} can\n\
  2628. be placed in an @code{object_block} structure. @var{mode} is the mode\n\
  2629. of @var{x}.\n\
  2630. \n\
  2631. The default version returns false for all constants.",
  2632. bool, (machine_mode mode, const_rtx x),
  2633. hook_bool_mode_const_rtx_false)
  2634. /* True if the given decl can be put into an object_block. */
  2635. DEFHOOK
  2636. (use_blocks_for_decl_p,
  2637. "This hook should return true if pool entries for @var{decl} should\n\
  2638. be placed in an @code{object_block} structure.\n\
  2639. \n\
  2640. The default version returns true for all decls.",
  2641. bool, (const_tree decl),
  2642. hook_bool_const_tree_true)
  2643. /* The minimum and maximum byte offsets for anchored addresses. */
  2644. DEFHOOKPOD
  2645. (min_anchor_offset,
  2646. "The minimum offset that should be applied to a section anchor.\n\
  2647. On most targets, it should be the smallest offset that can be\n\
  2648. applied to a base register while still giving a legitimate address\n\
  2649. for every mode. The default value is 0.",
  2650. HOST_WIDE_INT, 0)
  2651. DEFHOOKPOD
  2652. (max_anchor_offset,
  2653. "Like @code{TARGET_MIN_ANCHOR_OFFSET}, but the maximum (inclusive)\n\
  2654. offset that should be applied to section anchors. The default\n\
  2655. value is 0.",
  2656. HOST_WIDE_INT, 0)
  2657. /* True if section anchors can be used to access the given symbol. */
  2658. DEFHOOK
  2659. (use_anchors_for_symbol_p,
  2660. "Return true if GCC should attempt to use anchors to access @code{SYMBOL_REF}\n\
  2661. @var{x}. You can assume @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})} and\n\
  2662. @samp{!SYMBOL_REF_ANCHOR_P (@var{x})}.\n\
  2663. \n\
  2664. The default version is correct for most targets, but you might need to\n\
  2665. intercept this hook to handle things like target-specific attributes\n\
  2666. or target-specific sections.",
  2667. bool, (const_rtx x),
  2668. default_use_anchors_for_symbol_p)
  2669. /* True if target supports indirect functions. */
  2670. DEFHOOK
  2671. (has_ifunc_p,
  2672. "It returns true if the target supports GNU indirect functions.\n\
  2673. The support includes the assembler, linker and dynamic linker.\n\
  2674. The default value of this hook is based on target's libc.",
  2675. bool, (void),
  2676. default_has_ifunc_p)
  2677. /* True if it is OK to do sibling call optimization for the specified
  2678. call expression EXP. DECL will be the called function, or NULL if
  2679. this is an indirect call. */
  2680. DEFHOOK
  2681. (function_ok_for_sibcall,
  2682. "True if it is OK to do sibling call optimization for the specified\n\
  2683. call expression @var{exp}. @var{decl} will be the called function,\n\
  2684. or @code{NULL} if this is an indirect call.\n\
  2685. \n\
  2686. It is not uncommon for limitations of calling conventions to prevent\n\
  2687. tail calls to functions outside the current unit of translation, or\n\
  2688. during PIC compilation. The hook is used to enforce these restrictions,\n\
  2689. as the @code{sibcall} md pattern cannot fail, or fall over to a\n\
  2690. ``normal'' call. The criteria for successful sibling call optimization\n\
  2691. may vary greatly between different architectures.",
  2692. bool, (tree decl, tree exp),
  2693. hook_bool_tree_tree_false)
  2694. /* Establish appropriate back-end context for processing the function
  2695. FNDECL. The argument might be NULL to indicate processing at top
  2696. level, outside of any function scope. */
  2697. DEFHOOK
  2698. (set_current_function,
  2699. "The compiler invokes this hook whenever it changes its current function\n\
  2700. context (@code{cfun}). You can define this function if\n\
  2701. the back end needs to perform any initialization or reset actions on a\n\
  2702. per-function basis. For example, it may be used to implement function\n\
  2703. attributes that affect register usage or code generation patterns.\n\
  2704. The argument @var{decl} is the declaration for the new function context,\n\
  2705. and may be null to indicate that the compiler has left a function context\n\
  2706. and is returning to processing at the top level.\n\
  2707. The default hook function does nothing.\n\
  2708. \n\
  2709. GCC sets @code{cfun} to a dummy function context during initialization of\n\
  2710. some parts of the back end. The hook function is not invoked in this\n\
  2711. situation; you need not worry about the hook being invoked recursively,\n\
  2712. or when the back end is in a partially-initialized state.\n\
  2713. @code{cfun} might be @code{NULL} to indicate processing at top level,\n\
  2714. outside of any function scope.",
  2715. void, (tree decl), hook_void_tree)
  2716. /* True if EXP should be placed in a "small data" section. */
  2717. DEFHOOK
  2718. (in_small_data_p,
  2719. "Returns true if @var{exp} should be placed into a ``small data'' section.\n\
  2720. The default version of this hook always returns false.",
  2721. bool, (const_tree exp),
  2722. hook_bool_const_tree_false)
  2723. /* True if EXP names an object for which name resolution must resolve
  2724. to the current executable or shared library. */
  2725. DEFHOOK
  2726. (binds_local_p,
  2727. "Returns true if @var{exp} names an object for which name resolution\n\
  2728. rules must resolve to the current ``module'' (dynamic shared library\n\
  2729. or executable image).\n\
  2730. \n\
  2731. The default version of this hook implements the name resolution rules\n\
  2732. for ELF, which has a looser model of global name binding than other\n\
  2733. currently supported object file formats.",
  2734. bool, (const_tree exp),
  2735. default_binds_local_p)
  2736. /* Check if profiling code is before or after prologue. */
  2737. DEFHOOK
  2738. (profile_before_prologue,
  2739. "It returns true if target wants profile code emitted before prologue.\n\n\
  2740. The default version of this hook use the target macro\n\
  2741. @code{PROFILE_BEFORE_PROLOGUE}.",
  2742. bool, (void),
  2743. default_profile_before_prologue)
  2744. /* Return true if a leaf function should stay leaf even with profiling
  2745. enabled. */
  2746. DEFHOOK
  2747. (keep_leaf_when_profiled,
  2748. "This target hook returns true if the target wants the leaf flag for\
  2749. the current function to stay true even if it calls mcount. This might\
  2750. make sense for targets using the leaf flag only to determine whether a\
  2751. stack frame needs to be generated or not and for which the call to\
  2752. mcount is generated before the function prologue.",
  2753. bool, (void),
  2754. default_keep_leaf_when_profiled)
  2755. /* Modify and return the identifier of a DECL's external name,
  2756. originally identified by ID, as required by the target,
  2757. (eg, append @nn to windows32 stdcall function names).
  2758. The default is to return ID without modification. */
  2759. DEFHOOK
  2760. (mangle_decl_assembler_name,
  2761. "Define this hook if you need to postprocess the assembler name generated\n\
  2762. by target-independent code. The @var{id} provided to this hook will be\n\
  2763. the computed name (e.g., the macro @code{DECL_NAME} of the @var{decl} in C,\n\
  2764. or the mangled name of the @var{decl} in C++). The return value of the\n\
  2765. hook is an @code{IDENTIFIER_NODE} for the appropriate mangled name on\n\
  2766. your target system. The default implementation of this hook just\n\
  2767. returns the @var{id} provided.",
  2768. tree, (tree decl, tree id),
  2769. default_mangle_decl_assembler_name)
  2770. /* Do something target-specific to record properties of the DECL into
  2771. the associated SYMBOL_REF. */
  2772. DEFHOOK
  2773. (encode_section_info,
  2774. "Define this hook if references to a symbol or a constant must be\n\
  2775. treated differently depending on something about the variable or\n\
  2776. function named by the symbol (such as what section it is in).\n\
  2777. \n\
  2778. The hook is executed immediately after rtl has been created for\n\
  2779. @var{decl}, which may be a variable or function declaration or\n\
  2780. an entry in the constant pool. In either case, @var{rtl} is the\n\
  2781. rtl in question. Do @emph{not} use @code{DECL_RTL (@var{decl})}\n\
  2782. in this hook; that field may not have been initialized yet.\n\
  2783. \n\
  2784. In the case of a constant, it is safe to assume that the rtl is\n\
  2785. a @code{mem} whose address is a @code{symbol_ref}. Most decls\n\
  2786. will also have this form, but that is not guaranteed. Global\n\
  2787. register variables, for instance, will have a @code{reg} for their\n\
  2788. rtl. (Normally the right thing to do with such unusual rtl is\n\
  2789. leave it alone.)\n\
  2790. \n\
  2791. The @var{new_decl_p} argument will be true if this is the first time\n\
  2792. that @code{TARGET_ENCODE_SECTION_INFO} has been invoked on this decl. It will\n\
  2793. be false for subsequent invocations, which will happen for duplicate\n\
  2794. declarations. Whether or not anything must be done for the duplicate\n\
  2795. declaration depends on whether the hook examines @code{DECL_ATTRIBUTES}.\n\
  2796. @var{new_decl_p} is always true when the hook is called for a constant.\n\
  2797. \n\
  2798. @cindex @code{SYMBOL_REF_FLAG}, in @code{TARGET_ENCODE_SECTION_INFO}\n\
  2799. The usual thing for this hook to do is to record flags in the\n\
  2800. @code{symbol_ref}, using @code{SYMBOL_REF_FLAG} or @code{SYMBOL_REF_FLAGS}.\n\
  2801. Historically, the name string was modified if it was necessary to\n\
  2802. encode more than one bit of information, but this practice is now\n\
  2803. discouraged; use @code{SYMBOL_REF_FLAGS}.\n\
  2804. \n\
  2805. The default definition of this hook, @code{default_encode_section_info}\n\
  2806. in @file{varasm.c}, sets a number of commonly-useful bits in\n\
  2807. @code{SYMBOL_REF_FLAGS}. Check whether the default does what you need\n\
  2808. before overriding it.",
  2809. void, (tree decl, rtx rtl, int new_decl_p),
  2810. default_encode_section_info)
  2811. /* Undo the effects of encode_section_info on the symbol string. */
  2812. DEFHOOK
  2813. (strip_name_encoding,
  2814. "Decode @var{name} and return the real name part, sans\n\
  2815. the characters that @code{TARGET_ENCODE_SECTION_INFO}\n\
  2816. may have added.",
  2817. const char *, (const char *name),
  2818. default_strip_name_encoding)
  2819. /* If shift optabs for MODE are known to always truncate the shift count,
  2820. return the mask that they apply. Return 0 otherwise. */
  2821. DEFHOOK
  2822. (shift_truncation_mask,
  2823. "This function describes how the standard shift patterns for @var{mode}\n\
  2824. deal with shifts by negative amounts or by more than the width of the mode.\n\
  2825. @xref{shift patterns}.\n\
  2826. \n\
  2827. On many machines, the shift patterns will apply a mask @var{m} to the\n\
  2828. shift count, meaning that a fixed-width shift of @var{x} by @var{y} is\n\
  2829. equivalent to an arbitrary-width shift of @var{x} by @var{y & m}. If\n\
  2830. this is true for mode @var{mode}, the function should return @var{m},\n\
  2831. otherwise it should return 0. A return value of 0 indicates that no\n\
  2832. particular behavior is guaranteed.\n\
  2833. \n\
  2834. Note that, unlike @code{SHIFT_COUNT_TRUNCATED}, this function does\n\
  2835. @emph{not} apply to general shift rtxes; it applies only to instructions\n\
  2836. that are generated by the named shift patterns.\n\
  2837. \n\
  2838. The default implementation of this function returns\n\
  2839. @code{GET_MODE_BITSIZE (@var{mode}) - 1} if @code{SHIFT_COUNT_TRUNCATED}\n\
  2840. and 0 otherwise. This definition is always safe, but if\n\
  2841. @code{SHIFT_COUNT_TRUNCATED} is false, and some shift patterns\n\
  2842. nevertheless truncate the shift count, you may get better code\n\
  2843. by overriding it.",
  2844. unsigned HOST_WIDE_INT, (machine_mode mode),
  2845. default_shift_truncation_mask)
  2846. /* Return the number of divisions in the given MODE that should be present,
  2847. so that it is profitable to turn the division into a multiplication by
  2848. the reciprocal. */
  2849. DEFHOOK
  2850. (min_divisions_for_recip_mul,
  2851. "When @option{-ffast-math} is in effect, GCC tries to optimize\n\
  2852. divisions by the same divisor, by turning them into multiplications by\n\
  2853. the reciprocal. This target hook specifies the minimum number of divisions\n\
  2854. that should be there for GCC to perform the optimization for a variable\n\
  2855. of mode @var{mode}. The default implementation returns 3 if the machine\n\
  2856. has an instruction for the division, and 2 if it does not.",
  2857. unsigned int, (machine_mode mode),
  2858. default_min_divisions_for_recip_mul)
  2859. DEFHOOK
  2860. (truly_noop_truncation,
  2861. "This hook returns true if it is safe to ``convert'' a value of\n\
  2862. @var{inprec} bits to one of @var{outprec} bits (where @var{outprec} is\n\
  2863. smaller than @var{inprec}) by merely operating on it as if it had only\n\
  2864. @var{outprec} bits. The default returns true unconditionally, which\n\
  2865. is correct for most machines.\n\
  2866. \n\
  2867. If @code{TARGET_MODES_TIEABLE_P} returns false for a pair of modes,\n\
  2868. suboptimal code can result if this hook returns true for the corresponding\n\
  2869. mode sizes. Making this hook return false in such cases may improve things.",
  2870. bool, (poly_uint64 outprec, poly_uint64 inprec),
  2871. hook_bool_puint64_puint64_true)
  2872. /* If the representation of integral MODE is such that values are
  2873. always sign-extended to a wider mode MODE_REP then return
  2874. SIGN_EXTEND. Return UNKNOWN otherwise. */
  2875. /* Note that the return type ought to be RTX_CODE, but that's not
  2876. necessarily defined at this point. */
  2877. DEFHOOK
  2878. (mode_rep_extended,
  2879. "The representation of an integral mode can be such that the values\n\
  2880. are always extended to a wider integral mode. Return\n\
  2881. @code{SIGN_EXTEND} if values of @var{mode} are represented in\n\
  2882. sign-extended form to @var{rep_mode}. Return @code{UNKNOWN}\n\
  2883. otherwise. (Currently, none of the targets use zero-extended\n\
  2884. representation this way so unlike @code{LOAD_EXTEND_OP},\n\
  2885. @code{TARGET_MODE_REP_EXTENDED} is expected to return either\n\
  2886. @code{SIGN_EXTEND} or @code{UNKNOWN}. Also no target extends\n\
  2887. @var{mode} to @var{rep_mode} so that @var{rep_mode} is not the next\n\
  2888. widest integral mode and currently we take advantage of this fact.)\n\
  2889. \n\
  2890. Similarly to @code{LOAD_EXTEND_OP} you may return a non-@code{UNKNOWN}\n\
  2891. value even if the extension is not performed on certain hard registers\n\
  2892. as long as for the @code{REGNO_REG_CLASS} of these hard registers\n\
  2893. @code{TARGET_CAN_CHANGE_MODE_CLASS} returns false.\n\
  2894. \n\
  2895. Note that @code{TARGET_MODE_REP_EXTENDED} and @code{LOAD_EXTEND_OP}\n\
  2896. describe two related properties. If you define\n\
  2897. @code{TARGET_MODE_REP_EXTENDED (mode, word_mode)} you probably also want\n\
  2898. to define @code{LOAD_EXTEND_OP (mode)} to return the same type of\n\
  2899. extension.\n\
  2900. \n\
  2901. In order to enforce the representation of @code{mode},\n\
  2902. @code{TARGET_TRULY_NOOP_TRUNCATION} should return false when truncating to\n\
  2903. @code{mode}.",
  2904. int, (scalar_int_mode mode, scalar_int_mode rep_mode),
  2905. default_mode_rep_extended)
  2906. DEFHOOK
  2907. (setjmp_preserves_nonvolatile_regs_p,
  2908. "On some targets, it is assumed that the compiler will spill all pseudos\n\
  2909. that are live across a call to @code{setjmp}, while other targets treat\n\
  2910. @code{setjmp} calls as normal function calls.\n\
  2911. \n\
  2912. This hook returns false if @code{setjmp} calls do not preserve all\n\
  2913. non-volatile registers so that gcc that must spill all pseudos that are\n\
  2914. live across @code{setjmp} calls. Define this to return true if the\n\
  2915. target does not need to spill all pseudos live across @code{setjmp} calls.\n\
  2916. The default implementation conservatively assumes all pseudos must be\n\
  2917. spilled across @code{setjmp} calls.",
  2918. bool, (void),
  2919. hook_bool_void_false)
  2920. /* True if MODE is valid for a pointer in __attribute__((mode("MODE"))). */
  2921. DEFHOOK
  2922. (valid_pointer_mode,
  2923. "Define this to return nonzero if the port can handle pointers\n\
  2924. with machine mode @var{mode}. The default version of this\n\
  2925. hook returns true for both @code{ptr_mode} and @code{Pmode}.",
  2926. bool, (scalar_int_mode mode),
  2927. default_valid_pointer_mode)
  2928. /* Disambiguate with errno. */
  2929. DEFHOOK
  2930. (ref_may_alias_errno,
  2931. "Define this to return nonzero if the memory reference @var{ref}\
  2932. may alias with the system C library errno location. The default\
  2933. version of this hook assumes the system C library errno location\
  2934. is either a declaration of type int or accessed by dereferencing\
  2935. a pointer to int.",
  2936. bool, (struct ao_ref *ref),
  2937. default_ref_may_alias_errno)
  2938. /* Support for named address spaces. */
  2939. #undef HOOK_PREFIX
  2940. #define HOOK_PREFIX "TARGET_ADDR_SPACE_"
  2941. HOOK_VECTOR (TARGET_ADDR_SPACE_HOOKS, addr_space)
  2942. /* MODE to use for a pointer into another address space. */
  2943. DEFHOOK
  2944. (pointer_mode,
  2945. "Define this to return the machine mode to use for pointers to\n\
  2946. @var{address_space} if the target supports named address spaces.\n\
  2947. The default version of this hook returns @code{ptr_mode}.",
  2948. scalar_int_mode, (addr_space_t address_space),
  2949. default_addr_space_pointer_mode)
  2950. /* MODE to use for an address in another address space. */
  2951. DEFHOOK
  2952. (address_mode,
  2953. "Define this to return the machine mode to use for addresses in\n\
  2954. @var{address_space} if the target supports named address spaces.\n\
  2955. The default version of this hook returns @code{Pmode}.",
  2956. scalar_int_mode, (addr_space_t address_space),
  2957. default_addr_space_address_mode)
  2958. /* True if MODE is valid for a pointer in __attribute__((mode("MODE")))
  2959. in another address space. */
  2960. DEFHOOK
  2961. (valid_pointer_mode,
  2962. "Define this to return nonzero if the port can handle pointers\n\
  2963. with machine mode @var{mode} to address space @var{as}. This target\n\
  2964. hook is the same as the @code{TARGET_VALID_POINTER_MODE} target hook,\n\
  2965. except that it includes explicit named address space support. The default\n\
  2966. version of this hook returns true for the modes returned by either the\n\
  2967. @code{TARGET_ADDR_SPACE_POINTER_MODE} or @code{TARGET_ADDR_SPACE_ADDRESS_MODE}\n\
  2968. target hooks for the given address space.",
  2969. bool, (scalar_int_mode mode, addr_space_t as),
  2970. default_addr_space_valid_pointer_mode)
  2971. /* True if an address is a valid memory address to a given named address
  2972. space for a given mode. */
  2973. DEFHOOK
  2974. (legitimate_address_p,
  2975. "Define this to return true if @var{exp} is a valid address for mode\n\
  2976. @var{mode} in the named address space @var{as}. The @var{strict}\n\
  2977. parameter says whether strict addressing is in effect after reload has\n\
  2978. finished. This target hook is the same as the\n\
  2979. @code{TARGET_LEGITIMATE_ADDRESS_P} target hook, except that it includes\n\
  2980. explicit named address space support.",
  2981. bool, (machine_mode mode, rtx exp, bool strict, addr_space_t as),
  2982. default_addr_space_legitimate_address_p)
  2983. /* Return an updated address to convert an invalid pointer to a named
  2984. address space to a valid one. If NULL_RTX is returned use machine
  2985. independent methods to make the address valid. */
  2986. DEFHOOK
  2987. (legitimize_address,
  2988. "Define this to modify an invalid address @var{x} to be a valid address\n\
  2989. with mode @var{mode} in the named address space @var{as}. This target\n\
  2990. hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook,\n\
  2991. except that it includes explicit named address space support.",
  2992. rtx, (rtx x, rtx oldx, machine_mode mode, addr_space_t as),
  2993. default_addr_space_legitimize_address)
  2994. /* True if one named address space is a subset of another named address. */
  2995. DEFHOOK
  2996. (subset_p,
  2997. "Define this to return whether the @var{subset} named address space is\n\
  2998. contained within the @var{superset} named address space. Pointers to\n\
  2999. a named address space that is a subset of another named address space\n\
  3000. will be converted automatically without a cast if used together in\n\
  3001. arithmetic operations. Pointers to a superset address space can be\n\
  3002. converted to pointers to a subset address space via explicit casts.",
  3003. bool, (addr_space_t subset, addr_space_t superset),
  3004. default_addr_space_subset_p)
  3005. /* True if 0 is a valid address in the address space, or false if
  3006. 0 is a NULL in the address space. */
  3007. DEFHOOK
  3008. (zero_address_valid,
  3009. "Define this to modify the default handling of address 0 for the\n\
  3010. address space. Return true if 0 should be considered a valid address.",
  3011. bool, (addr_space_t as),
  3012. default_addr_space_zero_address_valid)
  3013. /* Function to convert an rtl expression from one address space to another. */
  3014. DEFHOOK
  3015. (convert,
  3016. "Define this to convert the pointer expression represented by the RTL\n\
  3017. @var{op} with type @var{from_type} that points to a named address\n\
  3018. space to a new pointer expression with type @var{to_type} that points\n\
  3019. to a different named address space. When this hook it called, it is\n\
  3020. guaranteed that one of the two address spaces is a subset of the other,\n\
  3021. as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook.",
  3022. rtx, (rtx op, tree from_type, tree to_type),
  3023. default_addr_space_convert)
  3024. /* Function to encode an address space into dwarf. */
  3025. DEFHOOK
  3026. (debug,
  3027. "Define this to define how the address space is encoded in dwarf.\n\
  3028. The result is the value to be used with @code{DW_AT_address_class}.",
  3029. int, (addr_space_t as),
  3030. default_addr_space_debug)
  3031. /* Function to emit custom diagnostic if an address space is used. */
  3032. DEFHOOK
  3033. (diagnose_usage,
  3034. "Define this hook if the availability of an address space depends on\n\
  3035. command line options and some diagnostics should be printed when the\n\
  3036. address space is used. This hook is called during parsing and allows\n\
  3037. to emit a better diagnostic compared to the case where the address space\n\
  3038. was not registered with @code{c_register_addr_space}. @var{as} is\n\
  3039. the address space as registered with @code{c_register_addr_space}.\n\
  3040. @var{loc} is the location of the address space qualifier token.\n\
  3041. The default implementation does nothing.",
  3042. void, (addr_space_t as, location_t loc),
  3043. default_addr_space_diagnose_usage)
  3044. HOOK_VECTOR_END (addr_space)
  3045. #undef HOOK_PREFIX
  3046. #define HOOK_PREFIX "TARGET_"
  3047. DEFHOOK
  3048. (static_rtx_alignment,
  3049. "This hook returns the preferred alignment in bits for a\n\
  3050. statically-allocated rtx, such as a constant pool entry. @var{mode}\n\
  3051. is the mode of the rtx. The default implementation returns\n\
  3052. @samp{GET_MODE_ALIGNMENT (@var{mode})}.",
  3053. HOST_WIDE_INT, (machine_mode mode),
  3054. default_static_rtx_alignment)
  3055. DEFHOOK
  3056. (constant_alignment,
  3057. "This hook returns the alignment in bits of a constant that is being\n\
  3058. placed in memory. @var{constant} is the constant and @var{basic_align}\n\
  3059. is the alignment that the object would ordinarily have.\n\
  3060. \n\
  3061. The default definition just returns @var{basic_align}.\n\
  3062. \n\
  3063. The typical use of this hook is to increase alignment for string\n\
  3064. constants to be word aligned so that @code{strcpy} calls that copy\n\
  3065. constants can be done inline. The function\n\
  3066. @code{constant_alignment_word_strings} provides such a definition.",
  3067. HOST_WIDE_INT, (const_tree constant, HOST_WIDE_INT basic_align),
  3068. default_constant_alignment)
  3069. DEFHOOK
  3070. (translate_mode_attribute,
  3071. "Define this hook if during mode attribute processing, the port should\n\
  3072. translate machine_mode @var{mode} to another mode. For example, rs6000's\n\
  3073. @code{KFmode}, when it is the same as @code{TFmode}.\n\
  3074. \n\
  3075. The default version of the hook returns that mode that was passed in.",
  3076. machine_mode, (machine_mode mode),
  3077. default_translate_mode_attribute)
  3078. /* True if MODE is valid for the target. By "valid", we mean able to
  3079. be manipulated in non-trivial ways. In particular, this means all
  3080. the arithmetic is supported. */
  3081. DEFHOOK
  3082. (scalar_mode_supported_p,
  3083. "Define this to return nonzero if the port is prepared to handle\n\
  3084. insns involving scalar mode @var{mode}. For a scalar mode to be\n\
  3085. considered supported, all the basic arithmetic and comparisons\n\
  3086. must work.\n\
  3087. \n\
  3088. The default version of this hook returns true for any mode\n\
  3089. required to handle the basic C types (as defined by the port).\n\
  3090. Included here are the double-word arithmetic supported by the\n\
  3091. code in @file{optabs.c}.",
  3092. bool, (scalar_mode mode),
  3093. default_scalar_mode_supported_p)
  3094. /* Similarly for vector modes. "Supported" here is less strict. At
  3095. least some operations are supported; need to check optabs or builtins
  3096. for further details. */
  3097. DEFHOOK
  3098. (vector_mode_supported_p,
  3099. "Define this to return nonzero if the port is prepared to handle\n\
  3100. insns involving vector mode @var{mode}. At the very least, it\n\
  3101. must have move patterns for this mode.",
  3102. bool, (machine_mode mode),
  3103. hook_bool_mode_false)
  3104. DEFHOOK
  3105. (vector_alignment,
  3106. "This hook can be used to define the alignment for a vector of type\n\
  3107. @var{type}, in order to comply with a platform ABI. The default is to\n\
  3108. require natural alignment for vector types. The alignment returned by\n\
  3109. this hook must be a power-of-two multiple of the default alignment of\n\
  3110. the vector element type.",
  3111. HOST_WIDE_INT, (const_tree type),
  3112. default_vector_alignment)
  3113. DEFHOOK
  3114. (array_mode,
  3115. "Return the mode that GCC should use for an array that has\n\
  3116. @var{nelems} elements, with each element having mode @var{mode}.\n\
  3117. Return no mode if the target has no special requirements. In the\n\
  3118. latter case, GCC looks for an integer mode of the appropriate size\n\
  3119. if available and uses BLKmode otherwise. Usually the search for the\n\
  3120. integer mode is limited to @code{MAX_FIXED_MODE_SIZE}, but the\n\
  3121. @code{TARGET_ARRAY_MODE_SUPPORTED_P} hook allows a larger mode to be\n\
  3122. used in specific cases.\n\
  3123. \n\
  3124. The main use of this hook is to specify that an array of vectors should\n\
  3125. also have a vector mode. The default implementation returns no mode.",
  3126. opt_machine_mode, (machine_mode mode, unsigned HOST_WIDE_INT nelems),
  3127. hook_optmode_mode_uhwi_none)
  3128. /* True if we should try to use a scalar mode to represent an array,
  3129. overriding the usual MAX_FIXED_MODE limit. */
  3130. DEFHOOK
  3131. (array_mode_supported_p,
  3132. "Return true if GCC should try to use a scalar mode to store an array\n\
  3133. of @var{nelems} elements, given that each element has mode @var{mode}.\n\
  3134. Returning true here overrides the usual @code{MAX_FIXED_MODE} limit\n\
  3135. and allows GCC to use any defined integer mode.\n\
  3136. \n\
  3137. One use of this hook is to support vector load and store operations\n\
  3138. that operate on several homogeneous vectors. For example, ARM NEON\n\
  3139. has operations like:\n\
  3140. \n\
  3141. @smallexample\n\
  3142. int8x8x3_t vld3_s8 (const int8_t *)\n\
  3143. @end smallexample\n\
  3144. \n\
  3145. where the return type is defined as:\n\
  3146. \n\
  3147. @smallexample\n\
  3148. typedef struct int8x8x3_t\n\
  3149. @{\n\
  3150. int8x8_t val[3];\n\
  3151. @} int8x8x3_t;\n\
  3152. @end smallexample\n\
  3153. \n\
  3154. If this hook allows @code{val} to have a scalar mode, then\n\
  3155. @code{int8x8x3_t} can have the same mode. GCC can then store\n\
  3156. @code{int8x8x3_t}s in registers rather than forcing them onto the stack.",
  3157. bool, (machine_mode mode, unsigned HOST_WIDE_INT nelems),
  3158. hook_bool_mode_uhwi_false)
  3159. DEFHOOK
  3160. (libgcc_floating_mode_supported_p,
  3161. "Define this to return nonzero if libgcc provides support for the \n\
  3162. floating-point mode @var{mode}, which is known to pass \n\
  3163. @code{TARGET_SCALAR_MODE_SUPPORTED_P}. The default version of this \n\
  3164. hook returns true for all of @code{SFmode}, @code{DFmode}, \n\
  3165. @code{XFmode} and @code{TFmode}, if such modes exist.",
  3166. bool, (scalar_float_mode mode),
  3167. default_libgcc_floating_mode_supported_p)
  3168. DEFHOOK
  3169. (floatn_mode,
  3170. "Define this to return the machine mode to use for the type \n\
  3171. @code{_Float@var{n}}, if @var{extended} is false, or the type \n\
  3172. @code{_Float@var{n}x}, if @var{extended} is true. If such a type is not\n\
  3173. supported, return @code{opt_scalar_float_mode ()}. The default version of\n\
  3174. this hook returns @code{SFmode} for @code{_Float32}, @code{DFmode} for\n\
  3175. @code{_Float64} and @code{_Float32x} and @code{TFmode} for \n\
  3176. @code{_Float128}, if those modes exist and satisfy the requirements for \n\
  3177. those types and pass @code{TARGET_SCALAR_MODE_SUPPORTED_P} and \n\
  3178. @code{TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P}; for @code{_Float64x}, it \n\
  3179. returns the first of @code{XFmode} and @code{TFmode} that exists and \n\
  3180. satisfies the same requirements; for other types, it returns \n\
  3181. @code{opt_scalar_float_mode ()}. The hook is only called for values\n\
  3182. of @var{n} and @var{extended} that are valid according to\n\
  3183. ISO/IEC TS 18661-3:2015; that is, @var{n} is one of 32, 64, 128, or,\n\
  3184. if @var{extended} is false, 16 or greater than 128 and a multiple of 32.",
  3185. opt_scalar_float_mode, (int n, bool extended),
  3186. default_floatn_mode)
  3187. DEFHOOK
  3188. (floatn_builtin_p,
  3189. "Define this to return true if the @code{_Float@var{n}} and\n\
  3190. @code{_Float@var{n}x} built-in functions should implicitly enable the\n\
  3191. built-in function without the @code{__builtin_} prefix in addition to the\n\
  3192. normal built-in function with the @code{__builtin_} prefix. The default is\n\
  3193. to only enable built-in functions without the @code{__builtin_} prefix for\n\
  3194. the GNU C langauge. In strict ANSI/ISO mode, the built-in function without\n\
  3195. the @code{__builtin_} prefix is not enabled. The argument @code{FUNC} is the\n\
  3196. @code{enum built_in_function} id of the function to be enabled.",
  3197. bool, (int func),
  3198. default_floatn_builtin_p)
  3199. /* Compute cost of moving data from a register of class FROM to one of
  3200. TO, using MODE. */
  3201. DEFHOOK
  3202. (register_move_cost,
  3203. "This target hook should return the cost of moving data of mode @var{mode}\n\
  3204. from a register in class @var{from} to one in class @var{to}. The classes\n\
  3205. are expressed using the enumeration values such as @code{GENERAL_REGS}.\n\
  3206. A value of 2 is the default; other values are interpreted relative to\n\
  3207. that.\n\
  3208. \n\
  3209. It is not required that the cost always equal 2 when @var{from} is the\n\
  3210. same as @var{to}; on some machines it is expensive to move between\n\
  3211. registers if they are not general registers.\n\
  3212. \n\
  3213. If reload sees an insn consisting of a single @code{set} between two\n\
  3214. hard registers, and if @code{TARGET_REGISTER_MOVE_COST} applied to their\n\
  3215. classes returns a value of 2, reload does not check to ensure that the\n\
  3216. constraints of the insn are met. Setting a cost of other than 2 will\n\
  3217. allow reload to verify that the constraints are met. You should do this\n\
  3218. if the @samp{mov@var{m}} pattern's constraints do not allow such copying.\n\
  3219. \n\
  3220. The default version of this function returns 2.",
  3221. int, (machine_mode mode, reg_class_t from, reg_class_t to),
  3222. default_register_move_cost)
  3223. /* Compute cost of moving registers to/from memory. */
  3224. /* ??? Documenting the argument types for this hook requires a GFDL
  3225. license grant. Also, the documentation uses a different name for RCLASS. */
  3226. DEFHOOK
  3227. (memory_move_cost,
  3228. "This target hook should return the cost of moving data of mode @var{mode}\n\
  3229. between a register of class @var{rclass} and memory; @var{in} is @code{false}\n\
  3230. if the value is to be written to memory, @code{true} if it is to be read in.\n\
  3231. This cost is relative to those in @code{TARGET_REGISTER_MOVE_COST}.\n\
  3232. If moving between registers and memory is more expensive than between two\n\
  3233. registers, you should add this target hook to express the relative cost.\n\
  3234. \n\
  3235. If you do not add this target hook, GCC uses a default cost of 4 plus\n\
  3236. the cost of copying via a secondary reload register, if one is\n\
  3237. needed. If your machine requires a secondary reload register to copy\n\
  3238. between memory and a register of @var{rclass} but the reload mechanism is\n\
  3239. more complex than copying via an intermediate, use this target hook to\n\
  3240. reflect the actual cost of the move.\n\
  3241. \n\
  3242. GCC defines the function @code{memory_move_secondary_cost} if\n\
  3243. secondary reloads are needed. It computes the costs due to copying via\n\
  3244. a secondary register. If your machine copies from memory using a\n\
  3245. secondary register in the conventional way but the default base value of\n\
  3246. 4 is not correct for your machine, use this target hook to add some other\n\
  3247. value to the result of that function. The arguments to that function\n\
  3248. are the same as to this target hook.",
  3249. int, (machine_mode mode, reg_class_t rclass, bool in),
  3250. default_memory_move_cost)
  3251. DEFHOOK
  3252. (use_by_pieces_infrastructure_p,
  3253. "GCC will attempt several strategies when asked to copy between\n\
  3254. two areas of memory, or to set, clear or store to memory, for example\n\
  3255. when copying a @code{struct}. The @code{by_pieces} infrastructure\n\
  3256. implements such memory operations as a sequence of load, store or move\n\
  3257. insns. Alternate strategies are to expand the\n\
  3258. @code{movmem} or @code{setmem} optabs, to emit a library call, or to emit\n\
  3259. unit-by-unit, loop-based operations.\n\
  3260. \n\
  3261. This target hook should return true if, for a memory operation with a\n\
  3262. given @var{size} and @var{alignment}, using the @code{by_pieces}\n\
  3263. infrastructure is expected to result in better code generation.\n\
  3264. Both @var{size} and @var{alignment} are measured in terms of storage\n\
  3265. units.\n\
  3266. \n\
  3267. The parameter @var{op} is one of: @code{CLEAR_BY_PIECES},\n\
  3268. @code{MOVE_BY_PIECES}, @code{SET_BY_PIECES}, @code{STORE_BY_PIECES} or\n\
  3269. @code{COMPARE_BY_PIECES}. These describe the type of memory operation\n\
  3270. under consideration.\n\
  3271. \n\
  3272. The parameter @var{speed_p} is true if the code is currently being\n\
  3273. optimized for speed rather than size.\n\
  3274. \n\
  3275. Returning true for higher values of @var{size} can improve code generation\n\
  3276. for speed if the target does not provide an implementation of the\n\
  3277. @code{movmem} or @code{setmem} standard names, if the @code{movmem} or\n\
  3278. @code{setmem} implementation would be more expensive than a sequence of\n\
  3279. insns, or if the overhead of a library call would dominate that of\n\
  3280. the body of the memory operation.\n\
  3281. \n\
  3282. Returning true for higher values of @code{size} may also cause an increase\n\
  3283. in code size, for example where the number of insns emitted to perform a\n\
  3284. move would be greater than that of a library call.",
  3285. bool, (unsigned HOST_WIDE_INT size, unsigned int alignment,
  3286. enum by_pieces_operation op, bool speed_p),
  3287. default_use_by_pieces_infrastructure_p)
  3288. DEFHOOK
  3289. (compare_by_pieces_branch_ratio,
  3290. "When expanding a block comparison in MODE, gcc can try to reduce the\n\
  3291. number of branches at the expense of more memory operations. This hook\n\
  3292. allows the target to override the default choice. It should return the\n\
  3293. factor by which branches should be reduced over the plain expansion with\n\
  3294. one comparison per @var{mode}-sized piece. A port can also prevent a\n\
  3295. particular mode from being used for block comparisons by returning a\n\
  3296. negative number from this hook.",
  3297. int, (machine_mode mode),
  3298. default_compare_by_pieces_branch_ratio)
  3299. DEFHOOK
  3300. (slow_unaligned_access,
  3301. "This hook returns true if memory accesses described by the\n\
  3302. @var{mode} and @var{alignment} parameters have a cost many times greater\n\
  3303. than aligned accesses, for example if they are emulated in a trap handler.\n\
  3304. This hook is invoked only for unaligned accesses, i.e.@: when\n\
  3305. @code{@var{alignment} < GET_MODE_ALIGNMENT (@var{mode})}.\n\
  3306. \n\
  3307. When this hook returns true, the compiler will act as if\n\
  3308. @code{STRICT_ALIGNMENT} were true when generating code for block\n\
  3309. moves. This can cause significantly more instructions to be produced.\n\
  3310. Therefore, do not make this hook return true if unaligned accesses only\n\
  3311. add a cycle or two to the time for a memory access.\n\
  3312. \n\
  3313. The hook must return true whenever @code{STRICT_ALIGNMENT} is true.\n\
  3314. The default implementation returns @code{STRICT_ALIGNMENT}.",
  3315. bool, (machine_mode mode, unsigned int align),
  3316. default_slow_unaligned_access)
  3317. DEFHOOK
  3318. (optab_supported_p,
  3319. "Return true if the optimizers should use optab @var{op} with\n\
  3320. modes @var{mode1} and @var{mode2} for optimization type @var{opt_type}.\n\
  3321. The optab is known to have an associated @file{.md} instruction\n\
  3322. whose C condition is true. @var{mode2} is only meaningful for conversion\n\
  3323. optabs; for direct optabs it is a copy of @var{mode1}.\n\
  3324. \n\
  3325. For example, when called with @var{op} equal to @code{rint_optab} and\n\
  3326. @var{mode1} equal to @code{DFmode}, the hook should say whether the\n\
  3327. optimizers should use optab @code{rintdf2}.\n\
  3328. \n\
  3329. The default hook returns true for all inputs.",
  3330. bool, (int op, machine_mode mode1, machine_mode mode2,
  3331. optimization_type opt_type),
  3332. default_optab_supported_p)
  3333. /* True for MODE if the target expects that registers in this mode will
  3334. be allocated to registers in a small register class. The compiler is
  3335. allowed to use registers explicitly used in the rtl as spill registers
  3336. but it should prevent extending the lifetime of these registers. */
  3337. DEFHOOK
  3338. (small_register_classes_for_mode_p,
  3339. "Define this to return nonzero for machine modes for which the port has\n\
  3340. small register classes. If this target hook returns nonzero for a given\n\
  3341. @var{mode}, the compiler will try to minimize the lifetime of registers\n\
  3342. in @var{mode}. The hook may be called with @code{VOIDmode} as argument.\n\
  3343. In this case, the hook is expected to return nonzero if it returns nonzero\n\
  3344. for any mode.\n\
  3345. \n\
  3346. On some machines, it is risky to let hard registers live across arbitrary\n\
  3347. insns. Typically, these machines have instructions that require values\n\
  3348. to be in specific registers (like an accumulator), and reload will fail\n\
  3349. if the required hard register is used for another purpose across such an\n\
  3350. insn.\n\
  3351. \n\
  3352. Passes before reload do not know which hard registers will be used\n\
  3353. in an instruction, but the machine modes of the registers set or used in\n\
  3354. the instruction are already known. And for some machines, register\n\
  3355. classes are small for, say, integer registers but not for floating point\n\
  3356. registers. For example, the AMD x86-64 architecture requires specific\n\
  3357. registers for the legacy x86 integer instructions, but there are many\n\
  3358. SSE registers for floating point operations. On such targets, a good\n\
  3359. strategy may be to return nonzero from this hook for @code{INTEGRAL_MODE_P}\n\
  3360. machine modes but zero for the SSE register classes.\n\
  3361. \n\
  3362. The default version of this hook returns false for any mode. It is always\n\
  3363. safe to redefine this hook to return with a nonzero value. But if you\n\
  3364. unnecessarily define it, you will reduce the amount of optimizations\n\
  3365. that can be performed in some cases. If you do not define this hook\n\
  3366. to return a nonzero value when it is required, the compiler will run out\n\
  3367. of spill registers and print a fatal error message.",
  3368. bool, (machine_mode mode),
  3369. hook_bool_mode_false)
  3370. /* Register number for a flags register. Only needs to be defined if the
  3371. target is constrainted to use post-reload comparison elimination. */
  3372. DEFHOOKPOD
  3373. (flags_regnum,
  3374. "If the target has a dedicated flags register, and it needs to use the\
  3375. post-reload comparison elimination pass, then this value should be set\
  3376. appropriately.",
  3377. unsigned int, INVALID_REGNUM)
  3378. /* Compute a (partial) cost for rtx X. Return true if the complete
  3379. cost has been computed, and false if subexpressions should be
  3380. scanned. In either case, *TOTAL contains the cost result. */
  3381. /* Note that OUTER_CODE ought to be RTX_CODE, but that's
  3382. not necessarily defined at this point. */
  3383. DEFHOOK
  3384. (rtx_costs,
  3385. "This target hook describes the relative costs of RTL expressions.\n\
  3386. \n\
  3387. The cost may depend on the precise form of the expression, which is\n\
  3388. available for examination in @var{x}, and the fact that @var{x} appears\n\
  3389. as operand @var{opno} of an expression with rtx code @var{outer_code}.\n\
  3390. That is, the hook can assume that there is some rtx @var{y} such\n\
  3391. that @samp{GET_CODE (@var{y}) == @var{outer_code}} and such that\n\
  3392. either (a) @samp{XEXP (@var{y}, @var{opno}) == @var{x}} or\n\
  3393. (b) @samp{XVEC (@var{y}, @var{opno})} contains @var{x}.\n\
  3394. \n\
  3395. @var{mode} is @var{x}'s machine mode, or for cases like @code{const_int} that\n\
  3396. do not have a mode, the mode in which @var{x} is used.\n\
  3397. \n\
  3398. In implementing this hook, you can use the construct\n\
  3399. @code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast\n\
  3400. instructions.\n\
  3401. \n\
  3402. On entry to the hook, @code{*@var{total}} contains a default estimate\n\
  3403. for the cost of the expression. The hook should modify this value as\n\
  3404. necessary. Traditionally, the default costs are @code{COSTS_N_INSNS (5)}\n\
  3405. for multiplications, @code{COSTS_N_INSNS (7)} for division and modulus\n\
  3406. operations, and @code{COSTS_N_INSNS (1)} for all other operations.\n\
  3407. \n\
  3408. When optimizing for code size, i.e.@: when @code{speed} is\n\
  3409. false, this target hook should be used to estimate the relative\n\
  3410. size cost of an expression, again relative to @code{COSTS_N_INSNS}.\n\
  3411. \n\
  3412. The hook returns true when all subexpressions of @var{x} have been\n\
  3413. processed, and false when @code{rtx_cost} should recurse.",
  3414. bool, (rtx x, machine_mode mode, int outer_code, int opno, int *total, bool speed),
  3415. hook_bool_rtx_mode_int_int_intp_bool_false)
  3416. /* Compute the cost of X, used as an address. Never called with
  3417. invalid addresses. */
  3418. DEFHOOK
  3419. (address_cost,
  3420. "This hook computes the cost of an addressing mode that contains\n\
  3421. @var{address}. If not defined, the cost is computed from\n\
  3422. the @var{address} expression and the @code{TARGET_RTX_COST} hook.\n\
  3423. \n\
  3424. For most CISC machines, the default cost is a good approximation of the\n\
  3425. true cost of the addressing mode. However, on RISC machines, all\n\
  3426. instructions normally have the same length and execution time. Hence\n\
  3427. all addresses will have equal costs.\n\
  3428. \n\
  3429. In cases where more than one form of an address is known, the form with\n\
  3430. the lowest cost will be used. If multiple forms have the same, lowest,\n\
  3431. cost, the one that is the most complex will be used.\n\
  3432. \n\
  3433. For example, suppose an address that is equal to the sum of a register\n\
  3434. and a constant is used twice in the same basic block. When this macro\n\
  3435. is not defined, the address will be computed in a register and memory\n\
  3436. references will be indirect through that register. On machines where\n\
  3437. the cost of the addressing mode containing the sum is no higher than\n\
  3438. that of a simple indirect reference, this will produce an additional\n\
  3439. instruction and possibly require an additional register. Proper\n\
  3440. specification of this macro eliminates this overhead for such machines.\n\
  3441. \n\
  3442. This hook is never called with an invalid address.\n\
  3443. \n\
  3444. On machines where an address involving more than one register is as\n\
  3445. cheap as an address computation involving only one register, defining\n\
  3446. @code{TARGET_ADDRESS_COST} to reflect this can cause two registers to\n\
  3447. be live over a region of code where only one would have been if\n\
  3448. @code{TARGET_ADDRESS_COST} were not defined in that manner. This effect\n\
  3449. should be considered in the definition of this macro. Equivalent costs\n\
  3450. should probably only be given to addresses with different numbers of\n\
  3451. registers on machines with lots of registers.",
  3452. int, (rtx address, machine_mode mode, addr_space_t as, bool speed),
  3453. default_address_cost)
  3454. /* Compute a cost for INSN. */
  3455. DEFHOOK
  3456. (insn_cost,
  3457. "This target hook describes the relative costs of RTL instructions.\n\
  3458. \n\
  3459. In implementing this hook, you can use the construct\n\
  3460. @code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast\n\
  3461. instructions.\n\
  3462. \n\
  3463. When optimizing for code size, i.e.@: when @code{speed} is\n\
  3464. false, this target hook should be used to estimate the relative\n\
  3465. size cost of an expression, again relative to @code{COSTS_N_INSNS}.",
  3466. int, (rtx_insn *insn, bool speed), NULL)
  3467. /* Give a cost, in RTX Costs units, for an edge. Like BRANCH_COST, but with
  3468. well defined units. */
  3469. DEFHOOK
  3470. (max_noce_ifcvt_seq_cost,
  3471. "This hook returns a value in the same units as @code{TARGET_RTX_COSTS},\n\
  3472. giving the maximum acceptable cost for a sequence generated by the RTL\n\
  3473. if-conversion pass when conditional execution is not available.\n\
  3474. The RTL if-conversion pass attempts to convert conditional operations\n\
  3475. that would require a branch to a series of unconditional operations and\n\
  3476. @code{mov@var{mode}cc} insns. This hook returns the maximum cost of the\n\
  3477. unconditional instructions and the @code{mov@var{mode}cc} insns.\n\
  3478. RTL if-conversion is cancelled if the cost of the converted sequence\n\
  3479. is greater than the value returned by this hook.\n\
  3480. \n\
  3481. @code{e} is the edge between the basic block containing the conditional\n\
  3482. branch to the basic block which would be executed if the condition\n\
  3483. were true.\n\
  3484. \n\
  3485. The default implementation of this hook uses the\n\
  3486. @code{max-rtl-if-conversion-[un]predictable} parameters if they are set,\n\
  3487. and uses a multiple of @code{BRANCH_COST} otherwise.",
  3488. unsigned int, (edge e),
  3489. default_max_noce_ifcvt_seq_cost)
  3490. /* Return true if the given instruction sequence is a good candidate
  3491. as a replacement for the if-convertible sequence. */
  3492. DEFHOOK
  3493. (noce_conversion_profitable_p,
  3494. "This hook returns true if the instruction sequence @code{seq} is a good\n\
  3495. candidate as a replacement for the if-convertible sequence described in\n\
  3496. @code{if_info}.",
  3497. bool, (rtx_insn *seq, struct noce_if_info *if_info),
  3498. default_noce_conversion_profitable_p)
  3499. DEFHOOK
  3500. (estimated_poly_value,
  3501. "Return an estimate of the runtime value of @var{val}, for use in\n\
  3502. things like cost calculations or profiling frequencies. The default\n\
  3503. implementation returns the lowest possible value of @var{val}.",
  3504. HOST_WIDE_INT, (poly_int64 val),
  3505. default_estimated_poly_value)
  3506. /* Permit speculative instructions in delay slots during delayed-branch
  3507. scheduling. */
  3508. DEFHOOK
  3509. (no_speculation_in_delay_slots_p,
  3510. "This predicate controls the use of the eager delay slot filler to disallow\n\
  3511. speculatively executed instructions being placed in delay slots. Targets\n\
  3512. such as certain MIPS architectures possess both branches with and without\n\
  3513. delay slots. As the eager delay slot filler can decrease performance,\n\
  3514. disabling it is beneficial when ordinary branches are available. Use of\n\
  3515. delay slot branches filled using the basic filler is often still desirable\n\
  3516. as the delay slot can hide a pipeline bubble.", bool, (void),
  3517. hook_bool_void_false)
  3518. /* Return where to allocate pseudo for a given hard register initial value. */
  3519. DEFHOOK
  3520. (allocate_initial_value,
  3521. "\n\
  3522. When the initial value of a hard register has been copied in a pseudo\n\
  3523. register, it is often not necessary to actually allocate another register\n\
  3524. to this pseudo register, because the original hard register or a stack slot\n\
  3525. it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE}\n\
  3526. is called at the start of register allocation once for each hard register\n\
  3527. that had its initial value copied by using\n\
  3528. @code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}.\n\
  3529. Possible values are @code{NULL_RTX}, if you don't want\n\
  3530. to do any special allocation, a @code{REG} rtx---that would typically be\n\
  3531. the hard register itself, if it is known not to be clobbered---or a\n\
  3532. @code{MEM}.\n\
  3533. If you are returning a @code{MEM}, this is only a hint for the allocator;\n\
  3534. it might decide to use another register anyways.\n\
  3535. You may use @code{current_function_is_leaf} or \n\
  3536. @code{REG_N_SETS} in the hook to determine if the hard\n\
  3537. register in question will not be clobbered.\n\
  3538. The default value of this hook is @code{NULL}, which disables any special\n\
  3539. allocation.",
  3540. rtx, (rtx hard_reg), NULL)
  3541. /* Return nonzero if evaluating UNSPEC X might cause a trap.
  3542. FLAGS has the same meaning as in rtlanal.c: may_trap_p_1. */
  3543. DEFHOOK
  3544. (unspec_may_trap_p,
  3545. "This target hook returns nonzero if @var{x}, an @code{unspec} or\n\
  3546. @code{unspec_volatile} operation, might cause a trap. Targets can use\n\
  3547. this hook to enhance precision of analysis for @code{unspec} and\n\
  3548. @code{unspec_volatile} operations. You may call @code{may_trap_p_1}\n\
  3549. to analyze inner elements of @var{x} in which case @var{flags} should be\n\
  3550. passed along.",
  3551. int, (const_rtx x, unsigned flags),
  3552. default_unspec_may_trap_p)
  3553. /* Given a register, this hook should return a parallel of registers
  3554. to represent where to find the register pieces. Define this hook
  3555. if the register and its mode are represented in Dwarf in
  3556. non-contiguous locations, or if the register should be
  3557. represented in more than one register in Dwarf. Otherwise, this
  3558. hook should return NULL_RTX. */
  3559. DEFHOOK
  3560. (dwarf_register_span,
  3561. "Given a register, this hook should return a parallel of registers to\n\
  3562. represent where to find the register pieces. Define this hook if the\n\
  3563. register and its mode are represented in Dwarf in non-contiguous\n\
  3564. locations, or if the register should be represented in more than one\n\
  3565. register in Dwarf. Otherwise, this hook should return @code{NULL_RTX}.\n\
  3566. If not defined, the default is to return @code{NULL_RTX}.",
  3567. rtx, (rtx reg),
  3568. hook_rtx_rtx_null)
  3569. /* Given a register return the mode of the corresponding DWARF frame
  3570. register. */
  3571. DEFHOOK
  3572. (dwarf_frame_reg_mode,
  3573. "Given a register, this hook should return the mode which the\n\
  3574. corresponding Dwarf frame register should have. This is normally\n\
  3575. used to return a smaller mode than the raw mode to prevent call\n\
  3576. clobbered parts of a register altering the frame register size",
  3577. machine_mode, (int regno),
  3578. default_dwarf_frame_reg_mode)
  3579. /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
  3580. entries not corresponding directly to registers below
  3581. FIRST_PSEUDO_REGISTER, this hook should generate the necessary
  3582. code, given the address of the table. */
  3583. DEFHOOK
  3584. (init_dwarf_reg_sizes_extra,
  3585. "If some registers are represented in Dwarf-2 unwind information in\n\
  3586. multiple pieces, define this hook to fill in information about the\n\
  3587. sizes of those pieces in the table used by the unwinder at runtime.\n\
  3588. It will be called by @code{expand_builtin_init_dwarf_reg_sizes} after\n\
  3589. filling in a single size corresponding to each hard register;\n\
  3590. @var{address} is the address of the table.",
  3591. void, (tree address),
  3592. hook_void_tree)
  3593. /* Fetch the fixed register(s) which hold condition codes, for
  3594. targets where it makes sense to look for duplicate assignments to
  3595. the condition codes. This should return true if there is such a
  3596. register, false otherwise. The arguments should be set to the
  3597. fixed register numbers. Up to two condition code registers are
  3598. supported. If there is only one for this target, the int pointed
  3599. at by the second argument should be set to -1. */
  3600. DEFHOOK
  3601. (fixed_condition_code_regs,
  3602. "On targets which do not use @code{(cc0)}, and which use a hard\n\
  3603. register rather than a pseudo-register to hold condition codes, the\n\
  3604. regular CSE passes are often not able to identify cases in which the\n\
  3605. hard register is set to a common value. Use this hook to enable a\n\
  3606. small pass which optimizes such cases. This hook should return true\n\
  3607. to enable this pass, and it should set the integers to which its\n\
  3608. arguments point to the hard register numbers used for condition codes.\n\
  3609. When there is only one such register, as is true on most systems, the\n\
  3610. integer pointed to by @var{p2} should be set to\n\
  3611. @code{INVALID_REGNUM}.\n\
  3612. \n\
  3613. The default version of this hook returns false.",
  3614. bool, (unsigned int *p1, unsigned int *p2),
  3615. hook_bool_uintp_uintp_false)
  3616. /* If two condition code modes are compatible, return a condition
  3617. code mode which is compatible with both, such that a comparison
  3618. done in the returned mode will work for both of the original
  3619. modes. If the condition code modes are not compatible, return
  3620. VOIDmode. */
  3621. DEFHOOK
  3622. (cc_modes_compatible,
  3623. "On targets which use multiple condition code modes in class\n\
  3624. @code{MODE_CC}, it is sometimes the case that a comparison can be\n\
  3625. validly done in more than one mode. On such a system, define this\n\
  3626. target hook to take two mode arguments and to return a mode in which\n\
  3627. both comparisons may be validly done. If there is no such mode,\n\
  3628. return @code{VOIDmode}.\n\
  3629. \n\
  3630. The default version of this hook checks whether the modes are the\n\
  3631. same. If they are, it returns that mode. If they are different, it\n\
  3632. returns @code{VOIDmode}.",
  3633. machine_mode, (machine_mode m1, machine_mode m2),
  3634. default_cc_modes_compatible)
  3635. /* Do machine-dependent code transformations. Called just before
  3636. delayed-branch scheduling. */
  3637. DEFHOOK
  3638. (machine_dependent_reorg,
  3639. "If non-null, this hook performs a target-specific pass over the\n\
  3640. instruction stream. The compiler will run it at all optimization levels,\n\
  3641. just before the point at which it normally does delayed-branch scheduling.\n\
  3642. \n\
  3643. The exact purpose of the hook varies from target to target. Some use\n\
  3644. it to do transformations that are necessary for correctness, such as\n\
  3645. laying out in-function constant pools or avoiding hardware hazards.\n\
  3646. Others use it as an opportunity to do some machine-dependent optimizations.\n\
  3647. \n\
  3648. You need not implement the hook if it has nothing to do. The default\n\
  3649. definition is null.",
  3650. void, (void), NULL)
  3651. /* Create the __builtin_va_list type. */
  3652. DEFHOOK
  3653. (build_builtin_va_list,
  3654. "This hook returns a type node for @code{va_list} for the target.\n\
  3655. The default version of the hook returns @code{void*}.",
  3656. tree, (void),
  3657. std_build_builtin_va_list)
  3658. /* Enumerate the va list variants. */
  3659. DEFHOOK
  3660. (enum_va_list_p,
  3661. "This target hook is used in function @code{c_common_nodes_and_builtins}\n\
  3662. to iterate through the target specific builtin types for va_list. The\n\
  3663. variable @var{idx} is used as iterator. @var{pname} has to be a pointer\n\
  3664. to a @code{const char *} and @var{ptree} a pointer to a @code{tree} typed\n\
  3665. variable.\n\
  3666. The arguments @var{pname} and @var{ptree} are used to store the result of\n\
  3667. this macro and are set to the name of the va_list builtin type and its\n\
  3668. internal type.\n\
  3669. If the return value of this macro is zero, then there is no more element.\n\
  3670. Otherwise the @var{IDX} should be increased for the next call of this\n\
  3671. macro to iterate through all types.",
  3672. int, (int idx, const char **pname, tree *ptree),
  3673. NULL)
  3674. /* Get the cfun/fndecl calling abi __builtin_va_list type. */
  3675. DEFHOOK
  3676. (fn_abi_va_list,
  3677. "This hook returns the va_list type of the calling convention specified by\n\
  3678. @var{fndecl}.\n\
  3679. The default version of this hook returns @code{va_list_type_node}.",
  3680. tree, (tree fndecl),
  3681. std_fn_abi_va_list)
  3682. /* Get the __builtin_va_list type dependent on input type. */
  3683. DEFHOOK
  3684. (canonical_va_list_type,
  3685. "This hook returns the va_list type of the calling convention specified by the\n\
  3686. type of @var{type}. If @var{type} is not a valid va_list type, it returns\n\
  3687. @code{NULL_TREE}.",
  3688. tree, (tree type),
  3689. std_canonical_va_list_type)
  3690. /* ??? Documenting this hook requires a GFDL license grant. */
  3691. DEFHOOK_UNDOC
  3692. (expand_builtin_va_start,
  3693. "Expand the @code{__builtin_va_start} builtin.",
  3694. void, (tree valist, rtx nextarg), NULL)
  3695. /* Gimplifies a VA_ARG_EXPR. */
  3696. DEFHOOK
  3697. (gimplify_va_arg_expr,
  3698. "This hook performs target-specific gimplification of\n\
  3699. @code{VA_ARG_EXPR}. The first two parameters correspond to the\n\
  3700. arguments to @code{va_arg}; the latter two are as in\n\
  3701. @code{gimplify.c:gimplify_expr}.",
  3702. tree, (tree valist, tree type, gimple_seq *pre_p, gimple_seq *post_p),
  3703. std_gimplify_va_arg_expr)
  3704. /* Validity-checking routines for PCH files, target-specific.
  3705. get_pch_validity returns a pointer to the data to be stored,
  3706. and stores the size in its argument. pch_valid_p gets the same
  3707. information back and returns NULL if the PCH is valid,
  3708. or an error message if not. */
  3709. DEFHOOK
  3710. (get_pch_validity,
  3711. "This hook returns a pointer to the data needed by\n\
  3712. @code{TARGET_PCH_VALID_P} and sets\n\
  3713. @samp{*@var{sz}} to the size of the data in bytes.",
  3714. void *, (size_t *sz),
  3715. default_get_pch_validity)
  3716. DEFHOOK
  3717. (pch_valid_p,
  3718. "This hook checks whether the options used to create a PCH file are\n\
  3719. compatible with the current settings. It returns @code{NULL}\n\
  3720. if so and a suitable error message if not. Error messages will\n\
  3721. be presented to the user and must be localized using @samp{_(@var{msg})}.\n\
  3722. \n\
  3723. @var{data} is the data that was returned by @code{TARGET_GET_PCH_VALIDITY}\n\
  3724. when the PCH file was created and @var{sz} is the size of that data in bytes.\n\
  3725. It's safe to assume that the data was created by the same version of the\n\
  3726. compiler, so no format checking is needed.\n\
  3727. \n\
  3728. The default definition of @code{default_pch_valid_p} should be\n\
  3729. suitable for most targets.",
  3730. const char *, (const void *data, size_t sz),
  3731. default_pch_valid_p)
  3732. DEFHOOK
  3733. (prepare_pch_save,
  3734. "Called before writing out a PCH file. If the target has some\n\
  3735. garbage-collected data that needs to be in a particular state on PCH loads,\n\
  3736. it can use this hook to enforce that state. Very few targets need\n\
  3737. to do anything here.",
  3738. void, (void),
  3739. hook_void_void)
  3740. /* If nonnull, this function checks whether a PCH file with the
  3741. given set of target flags can be used. It returns NULL if so,
  3742. otherwise it returns an error message. */
  3743. DEFHOOK
  3744. (check_pch_target_flags,
  3745. "If this hook is nonnull, the default implementation of\n\
  3746. @code{TARGET_PCH_VALID_P} will use it to check for compatible values\n\
  3747. of @code{target_flags}. @var{pch_flags} specifies the value that\n\
  3748. @code{target_flags} had when the PCH file was created. The return\n\
  3749. value is the same as for @code{TARGET_PCH_VALID_P}.",
  3750. const char *, (int pch_flags), NULL)
  3751. /* True if the compiler should give an enum type only as many
  3752. bytes as it takes to represent the range of possible values of
  3753. that type. */
  3754. DEFHOOK
  3755. (default_short_enums,
  3756. "This target hook should return true if the compiler should give an\n\
  3757. @code{enum} type only as many bytes as it takes to represent the range\n\
  3758. of possible values of that type. It should return false if all\n\
  3759. @code{enum} types should be allocated like @code{int}.\n\
  3760. \n\
  3761. The default is to return false.",
  3762. bool, (void),
  3763. hook_bool_void_false)
  3764. /* This target hook returns an rtx that is used to store the address
  3765. of the current frame into the built-in setjmp buffer. */
  3766. DEFHOOK
  3767. (builtin_setjmp_frame_value,
  3768. "This target hook should return an rtx that is used to store\n\
  3769. the address of the current frame into the built in @code{setjmp} buffer.\n\
  3770. The default value, @code{virtual_stack_vars_rtx}, is correct for most\n\
  3771. machines. One reason you may need to define this target hook is if\n\
  3772. @code{hard_frame_pointer_rtx} is the appropriate value on your machine.",
  3773. rtx, (void),
  3774. default_builtin_setjmp_frame_value)
  3775. /* This target hook should manipulate the outputs, inputs, constraints,
  3776. and clobbers the port wishes for pre-processing the asm. */
  3777. DEFHOOK
  3778. (md_asm_adjust,
  3779. "This target hook may add @dfn{clobbers} to @var{clobbers} and\n\
  3780. @var{clobbered_regs} for any hard regs the port wishes to automatically\n\
  3781. clobber for an asm. The @var{outputs} and @var{inputs} may be inspected\n\
  3782. to avoid clobbering a register that is already used by the asm.\n\
  3783. \n\
  3784. It may modify the @var{outputs}, @var{inputs}, and @var{constraints}\n\
  3785. as necessary for other pre-processing. In this case the return value is\n\
  3786. a sequence of insns to emit after the asm.",
  3787. rtx_insn *,
  3788. (vec<rtx>& outputs, vec<rtx>& inputs, vec<const char *>& constraints,
  3789. vec<rtx>& clobbers, HARD_REG_SET& clobbered_regs),
  3790. NULL)
  3791. /* This target hook allows the backend to specify a calling convention
  3792. in the debug information. This function actually returns an
  3793. enum dwarf_calling_convention, but because of forward declarations
  3794. and not wanting to include dwarf2.h everywhere target.h is included
  3795. the function is being declared as an int. */
  3796. DEFHOOK
  3797. (dwarf_calling_convention,
  3798. "Define this to enable the dwarf attribute @code{DW_AT_calling_convention} to\n\
  3799. be emitted for each function. Instead of an integer return the enum\n\
  3800. value for the @code{DW_CC_} tag.",
  3801. int, (const_tree function),
  3802. hook_int_const_tree_0)
  3803. /* This target hook allows the backend to emit frame-related insns that
  3804. contain UNSPECs or UNSPEC_VOLATILEs. The call frame debugging info
  3805. engine will invoke it on insns of the form
  3806. (set (reg) (unspec [...] UNSPEC_INDEX))
  3807. and
  3808. (set (reg) (unspec_volatile [...] UNSPECV_INDEX))
  3809. to let the backend emit the call frame instructions. */
  3810. DEFHOOK
  3811. (dwarf_handle_frame_unspec,
  3812. "This target hook allows the backend to emit frame-related insns that\n\
  3813. contain UNSPECs or UNSPEC_VOLATILEs. The DWARF 2 call frame debugging\n\
  3814. info engine will invoke it on insns of the form\n\
  3815. @smallexample\n\
  3816. (set (reg) (unspec [@dots{}] UNSPEC_INDEX))\n\
  3817. @end smallexample\n\
  3818. and\n\
  3819. @smallexample\n\
  3820. (set (reg) (unspec_volatile [@dots{}] UNSPECV_INDEX)).\n\
  3821. @end smallexample\n\
  3822. to let the backend emit the call frame instructions. @var{label} is\n\
  3823. the CFI label attached to the insn, @var{pattern} is the pattern of\n\
  3824. the insn and @var{index} is @code{UNSPEC_INDEX} or @code{UNSPECV_INDEX}.",
  3825. void, (const char *label, rtx pattern, int index), NULL)
  3826. DEFHOOK
  3827. (dwarf_poly_indeterminate_value,
  3828. "Express the value of @code{poly_int} indeterminate @var{i} as a DWARF\n\
  3829. expression, with @var{i} counting from 1. Return the number of a DWARF\n\
  3830. register @var{R} and set @samp{*@var{factor}} and @samp{*@var{offset}} such\n\
  3831. that the value of the indeterminate is:\n\
  3832. @smallexample\n\
  3833. value_of(@var{R}) / @var{factor} - @var{offset}\n\
  3834. @end smallexample\n\
  3835. \n\
  3836. A target only needs to define this hook if it sets\n\
  3837. @samp{NUM_POLY_INT_COEFFS} to a value greater than 1.",
  3838. unsigned int, (unsigned int i, unsigned int *factor, int *offset),
  3839. default_dwarf_poly_indeterminate_value)
  3840. /* ??? Documenting this hook requires a GFDL license grant. */
  3841. DEFHOOK_UNDOC
  3842. (stdarg_optimize_hook,
  3843. "Perform architecture specific checking of statements gimplified\
  3844. from @code{VA_ARG_EXPR}. @var{stmt} is the statement. Returns true if\
  3845. the statement doesn't need to be checked for @code{va_list} references.",
  3846. bool, (struct stdarg_info *ai, const gimple *stmt), NULL)
  3847. /* This target hook allows the operating system to override the DECL
  3848. that represents the external variable that contains the stack
  3849. protection guard variable. The type of this DECL is ptr_type_node. */
  3850. DEFHOOK
  3851. (stack_protect_guard,
  3852. "This hook returns a @code{DECL} node for the external variable to use\n\
  3853. for the stack protection guard. This variable is initialized by the\n\
  3854. runtime to some random value and is used to initialize the guard value\n\
  3855. that is placed at the top of the local stack frame. The type of this\n\
  3856. variable must be @code{ptr_type_node}.\n\
  3857. \n\
  3858. The default version of this hook creates a variable called\n\
  3859. @samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.",
  3860. tree, (void),
  3861. default_stack_protect_guard)
  3862. /* This target hook allows the operating system to override the CALL_EXPR
  3863. that is invoked when a check vs the guard variable fails. */
  3864. DEFHOOK
  3865. (stack_protect_fail,
  3866. "This hook returns a @code{CALL_EXPR} that alerts the runtime that the\n\
  3867. stack protect guard variable has been modified. This expression should\n\
  3868. involve a call to a @code{noreturn} function.\n\
  3869. \n\
  3870. The default version of this hook invokes a function called\n\
  3871. @samp{__stack_chk_fail}, taking no arguments. This function is\n\
  3872. normally defined in @file{libgcc2.c}.",
  3873. tree, (void),
  3874. default_external_stack_protect_fail)
  3875. /* This target hook allows the operating system to disable the default stack
  3876. protector runtime support. */
  3877. DEFHOOK
  3878. (stack_protect_runtime_enabled_p,
  3879. "Returns true if the target wants GCC's default stack protect runtime support,\
  3880. otherwise return false. The default implementation always returns true.",
  3881. bool, (void),
  3882. hook_bool_void_true)
  3883. DEFHOOK
  3884. (have_speculation_safe_value,
  3885. "This hook is used to determine the level of target support for\n\
  3886. @code{__builtin_speculation_safe_value}. If called with an argument\n\
  3887. of false, it returns true if the target has been modified to support\n\
  3888. this builtin. If called with an argument of true, it returns true\n\
  3889. if the target requires active mitigation execution might be speculative.\n\
  3890. \n\
  3891. The default implementation returns false if the target does not define\n\
  3892. a pattern named @code{speculation_barrier}. Else it returns true\n\
  3893. for the first case and whether the pattern is enabled for the current\n\
  3894. compilation for the second case.\n\
  3895. \n\
  3896. For targets that have no processors that can execute instructions\n\
  3897. speculatively an alternative implemenation of this hook is available:\n\
  3898. simply redefine this hook to @code{speculation_safe_value_not_needed}\n\
  3899. along with your other target hooks.",
  3900. bool, (bool active), default_have_speculation_safe_value)
  3901. DEFHOOK
  3902. (speculation_safe_value,
  3903. "This target hook can be used to generate a target-specific code\n\
  3904. sequence that implements the @code{__builtin_speculation_safe_value}\n\
  3905. built-in function. The function must always return @var{val} in\n\
  3906. @var{result} in mode @var{mode} when the cpu is not executing\n\
  3907. speculatively, but must never return that when speculating until it\n\
  3908. is known that the speculation will not be unwound. The hook supports\n\
  3909. two primary mechanisms for implementing the requirements. The first\n\
  3910. is to emit a speculation barrier which forces the processor to wait\n\
  3911. until all prior speculative operations have been resolved; the second\n\
  3912. is to use a target-specific mechanism that can track the speculation\n\
  3913. state and to return @var{failval} if it can determine that\n\
  3914. speculation must be unwound at a later time.\n\
  3915. \n\
  3916. The default implementation simply copies @var{val} to @var{result} and\n\
  3917. emits a @code{speculation_barrier} instruction if that is defined.",
  3918. rtx, (machine_mode mode, rtx result, rtx val, rtx failval),
  3919. default_speculation_safe_value)
  3920. DEFHOOK
  3921. (can_use_doloop_p,
  3922. "Return true if it is possible to use low-overhead loops (@code{doloop_end}\n\
  3923. and @code{doloop_begin}) for a particular loop. @var{iterations} gives the\n\
  3924. exact number of iterations, or 0 if not known. @var{iterations_max} gives\n\
  3925. the maximum number of iterations, or 0 if not known. @var{loop_depth} is\n\
  3926. the nesting depth of the loop, with 1 for innermost loops, 2 for loops that\n\
  3927. contain innermost loops, and so on. @var{entered_at_top} is true if the\n\
  3928. loop is only entered from the top.\n\
  3929. \n\
  3930. This hook is only used if @code{doloop_end} is available. The default\n\
  3931. implementation returns true. You can use @code{can_use_doloop_if_innermost}\n\
  3932. if the loop must be the innermost, and if there are no other restrictions.",
  3933. bool, (const widest_int &iterations, const widest_int &iterations_max,
  3934. unsigned int loop_depth, bool entered_at_top),
  3935. hook_bool_wint_wint_uint_bool_true)
  3936. /* Returns NULL if target supports the insn within a doloop block,
  3937. otherwise it returns an error message. */
  3938. DEFHOOK
  3939. (invalid_within_doloop,
  3940. "\n\
  3941. Take an instruction in @var{insn} and return NULL if it is valid within a\n\
  3942. low-overhead loop, otherwise return a string explaining why doloop\n\
  3943. could not be applied.\n\
  3944. \n\
  3945. Many targets use special registers for low-overhead looping. For any\n\
  3946. instruction that clobbers these this function should return a string indicating\n\
  3947. the reason why the doloop could not be applied.\n\
  3948. By default, the RTL loop optimizer does not use a present doloop pattern for\n\
  3949. loops containing function calls or branch on table instructions.",
  3950. const char *, (const rtx_insn *insn),
  3951. default_invalid_within_doloop)
  3952. /* Returns true for a legitimate combined insn. */
  3953. DEFHOOK
  3954. (legitimate_combined_insn,
  3955. "Take an instruction in @var{insn} and return @code{false} if the instruction\
  3956. is not appropriate as a combination of two or more instructions. The\
  3957. default is to accept all instructions.",
  3958. bool, (rtx_insn *insn),
  3959. hook_bool_rtx_insn_true)
  3960. DEFHOOK
  3961. (valid_dllimport_attribute_p,
  3962. "@var{decl} is a variable or function with @code{__attribute__((dllimport))}\
  3963. specified. Use this hook if the target needs to add extra validation\
  3964. checks to @code{handle_dll_attribute}.",
  3965. bool, (const_tree decl),
  3966. hook_bool_const_tree_true)
  3967. /* If non-zero, align constant anchors in CSE to a multiple of this
  3968. value. */
  3969. DEFHOOKPOD
  3970. (const_anchor,
  3971. "On some architectures it can take multiple instructions to synthesize\n\
  3972. a constant. If there is another constant already in a register that\n\
  3973. is close enough in value then it is preferable that the new constant\n\
  3974. is computed from this register using immediate addition or\n\
  3975. subtraction. We accomplish this through CSE. Besides the value of\n\
  3976. the constant we also add a lower and an upper constant anchor to the\n\
  3977. available expressions. These are then queried when encountering new\n\
  3978. constants. The anchors are computed by rounding the constant up and\n\
  3979. down to a multiple of the value of @code{TARGET_CONST_ANCHOR}.\n\
  3980. @code{TARGET_CONST_ANCHOR} should be the maximum positive value\n\
  3981. accepted by immediate-add plus one. We currently assume that the\n\
  3982. value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on\n\
  3983. MIPS, where add-immediate takes a 16-bit signed value,\n\
  3984. @code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value\n\
  3985. is zero, which disables this optimization.",
  3986. unsigned HOST_WIDE_INT, 0)
  3987. /* Defines, which target-dependent bits (upper 16) are used by port */
  3988. DEFHOOK
  3989. (memmodel_check,
  3990. "Validate target specific memory model mask bits. When NULL no target specific\n\
  3991. memory model bits are allowed.",
  3992. unsigned HOST_WIDE_INT, (unsigned HOST_WIDE_INT val), NULL)
  3993. /* Defines an offset bitwise ored into shifted address to get corresponding
  3994. Address Sanitizer shadow address, or -1 if Address Sanitizer is not
  3995. supported by the target. */
  3996. DEFHOOK
  3997. (asan_shadow_offset,
  3998. "Return the offset bitwise ored into shifted address to get corresponding\n\
  3999. Address Sanitizer shadow memory address. NULL if Address Sanitizer is not\n\
  4000. supported by the target.",
  4001. unsigned HOST_WIDE_INT, (void),
  4002. NULL)
  4003. /* Functions relating to calls - argument passing, returns, etc. */
  4004. /* Members of struct call have no special macro prefix. */
  4005. HOOK_VECTOR (TARGET_CALLS, calls)
  4006. DEFHOOK
  4007. (promote_function_mode,
  4008. "Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or\n\
  4009. function return values. The target hook should return the new mode\n\
  4010. and possibly change @code{*@var{punsignedp}} if the promotion should\n\
  4011. change signedness. This function is called only for scalar @emph{or\n\
  4012. pointer} types.\n\
  4013. \n\
  4014. @var{for_return} allows to distinguish the promotion of arguments and\n\
  4015. return values. If it is @code{1}, a return value is being promoted and\n\
  4016. @code{TARGET_FUNCTION_VALUE} must perform the same promotions done here.\n\
  4017. If it is @code{2}, the returned mode should be that of the register in\n\
  4018. which an incoming parameter is copied, or the outgoing result is computed;\n\
  4019. then the hook should return the same mode as @code{promote_mode}, though\n\
  4020. the signedness may be different.\n\
  4021. \n\
  4022. @var{type} can be NULL when promoting function arguments of libcalls.\n\
  4023. \n\
  4024. The default is to not promote arguments and return values. You can\n\
  4025. also define the hook to @code{default_promote_function_mode_always_promote}\n\
  4026. if you would like to apply the same rules given by @code{PROMOTE_MODE}.",
  4027. machine_mode, (const_tree type, machine_mode mode, int *punsignedp,
  4028. const_tree funtype, int for_return),
  4029. default_promote_function_mode)
  4030. DEFHOOK
  4031. (promote_prototypes,
  4032. "This target hook returns @code{true} if an argument declared in a\n\
  4033. prototype as an integral type smaller than @code{int} should actually be\n\
  4034. passed as an @code{int}. In addition to avoiding errors in certain\n\
  4035. cases of mismatch, it also makes for better code on certain machines.\n\
  4036. The default is to not promote prototypes.",
  4037. bool, (const_tree fntype),
  4038. hook_bool_const_tree_false)
  4039. DEFHOOK
  4040. (struct_value_rtx,
  4041. "This target hook should return the location of the structure value\n\
  4042. address (normally a @code{mem} or @code{reg}), or 0 if the address is\n\
  4043. passed as an ``invisible'' first argument. Note that @var{fndecl} may\n\
  4044. be @code{NULL}, for libcalls. You do not need to define this target\n\
  4045. hook if the address is always passed as an ``invisible'' first\n\
  4046. argument.\n\
  4047. \n\
  4048. On some architectures the place where the structure value address\n\
  4049. is found by the called function is not the same place that the\n\
  4050. caller put it. This can be due to register windows, or it could\n\
  4051. be because the function prologue moves it to a different place.\n\
  4052. @var{incoming} is @code{1} or @code{2} when the location is needed in\n\
  4053. the context of the called function, and @code{0} in the context of\n\
  4054. the caller.\n\
  4055. \n\
  4056. If @var{incoming} is nonzero and the address is to be found on the\n\
  4057. stack, return a @code{mem} which refers to the frame pointer. If\n\
  4058. @var{incoming} is @code{2}, the result is being used to fetch the\n\
  4059. structure value address at the beginning of a function. If you need\n\
  4060. to emit adjusting code, you should do it at this point.",
  4061. rtx, (tree fndecl, int incoming),
  4062. hook_rtx_tree_int_null)
  4063. DEFHOOKPOD
  4064. (omit_struct_return_reg,
  4065. "Normally, when a function returns a structure by memory, the address\n\
  4066. is passed as an invisible pointer argument, but the compiler also\n\
  4067. arranges to return the address from the function like it would a normal\n\
  4068. pointer return value. Define this to true if that behavior is\n\
  4069. undesirable on your target.",
  4070. bool, false)
  4071. DEFHOOK
  4072. (return_in_memory,
  4073. "This target hook should return a nonzero value to say to return the\n\
  4074. function value in memory, just as large structures are always returned.\n\
  4075. Here @var{type} will be the data type of the value, and @var{fntype}\n\
  4076. will be the type of the function doing the returning, or @code{NULL} for\n\
  4077. libcalls.\n\
  4078. \n\
  4079. Note that values of mode @code{BLKmode} must be explicitly handled\n\
  4080. by this function. Also, the option @option{-fpcc-struct-return}\n\
  4081. takes effect regardless of this macro. On most systems, it is\n\
  4082. possible to leave the hook undefined; this causes a default\n\
  4083. definition to be used, whose value is the constant 1 for @code{BLKmode}\n\
  4084. values, and 0 otherwise.\n\
  4085. \n\
  4086. Do not use this hook to indicate that structures and unions should always\n\
  4087. be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}\n\
  4088. to indicate this.",
  4089. bool, (const_tree type, const_tree fntype),
  4090. default_return_in_memory)
  4091. DEFHOOK
  4092. (return_in_msb,
  4093. "This hook should return true if values of type @var{type} are returned\n\
  4094. at the most significant end of a register (in other words, if they are\n\
  4095. padded at the least significant end). You can assume that @var{type}\n\
  4096. is returned in a register; the caller is required to check this.\n\
  4097. \n\
  4098. Note that the register provided by @code{TARGET_FUNCTION_VALUE} must\n\
  4099. be able to hold the complete return value. For example, if a 1-, 2-\n\
  4100. or 3-byte structure is returned at the most significant end of a\n\
  4101. 4-byte register, @code{TARGET_FUNCTION_VALUE} should provide an\n\
  4102. @code{SImode} rtx.",
  4103. bool, (const_tree type),
  4104. hook_bool_const_tree_false)
  4105. /* Return true if a parameter must be passed by reference. TYPE may
  4106. be null if this is a libcall. CA may be null if this query is
  4107. from __builtin_va_arg. */
  4108. DEFHOOK
  4109. (pass_by_reference,
  4110. "This target hook should return @code{true} if an argument at the\n\
  4111. position indicated by @var{cum} should be passed by reference. This\n\
  4112. predicate is queried after target independent reasons for being\n\
  4113. passed by reference, such as @code{TREE_ADDRESSABLE (type)}.\n\
  4114. \n\
  4115. If the hook returns true, a copy of that argument is made in memory and a\n\
  4116. pointer to the argument is passed instead of the argument itself.\n\
  4117. The pointer is passed in whatever way is appropriate for passing a pointer\n\
  4118. to that type.",
  4119. bool,
  4120. (cumulative_args_t cum, machine_mode mode, const_tree type, bool named),
  4121. hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false)
  4122. DEFHOOK
  4123. (expand_builtin_saveregs,
  4124. "If defined, this hook produces the machine-specific code for a call to\n\
  4125. @code{__builtin_saveregs}. This code will be moved to the very\n\
  4126. beginning of the function, before any parameter access are made. The\n\
  4127. return value of this function should be an RTX that contains the value\n\
  4128. to use as the return of @code{__builtin_saveregs}.",
  4129. rtx, (void),
  4130. default_expand_builtin_saveregs)
  4131. /* Returns pretend_argument_size. */
  4132. DEFHOOK
  4133. (setup_incoming_varargs,
  4134. "This target hook offers an alternative to using\n\
  4135. @code{__builtin_saveregs} and defining the hook\n\
  4136. @code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous\n\
  4137. register arguments into the stack so that all the arguments appear to\n\
  4138. have been passed consecutively on the stack. Once this is done, you can\n\
  4139. use the standard implementation of varargs that works for machines that\n\
  4140. pass all their arguments on the stack.\n\
  4141. \n\
  4142. The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data\n\
  4143. structure, containing the values that are obtained after processing the\n\
  4144. named arguments. The arguments @var{mode} and @var{type} describe the\n\
  4145. last named argument---its machine mode and its data type as a tree node.\n\
  4146. \n\
  4147. The target hook should do two things: first, push onto the stack all the\n\
  4148. argument registers @emph{not} used for the named arguments, and second,\n\
  4149. store the size of the data thus pushed into the @code{int}-valued\n\
  4150. variable pointed to by @var{pretend_args_size}. The value that you\n\
  4151. store here will serve as additional offset for setting up the stack\n\
  4152. frame.\n\
  4153. \n\
  4154. Because you must generate code to push the anonymous arguments at\n\
  4155. compile time without knowing their data types,\n\
  4156. @code{TARGET_SETUP_INCOMING_VARARGS} is only useful on machines that\n\
  4157. have just a single category of argument register and use it uniformly\n\
  4158. for all data types.\n\
  4159. \n\
  4160. If the argument @var{second_time} is nonzero, it means that the\n\
  4161. arguments of the function are being analyzed for the second time. This\n\
  4162. happens for an inline function, which is not actually compiled until the\n\
  4163. end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should\n\
  4164. not generate any instructions in this case.",
  4165. void, (cumulative_args_t args_so_far, machine_mode mode, tree type,
  4166. int *pretend_args_size, int second_time),
  4167. default_setup_incoming_varargs)
  4168. DEFHOOK
  4169. (load_bounds_for_arg,
  4170. "This hook is used by expand pass to emit insn to load bounds of\n\
  4171. @var{arg} passed in @var{slot}. Expand pass uses this hook in case\n\
  4172. bounds of @var{arg} are not passed in register. If @var{slot} is a\n\
  4173. memory, then bounds are loaded as for regular pointer loaded from\n\
  4174. memory. If @var{slot} is not a memory then @var{slot_no} is an integer\n\
  4175. constant holding number of the target dependent special slot which\n\
  4176. should be used to obtain bounds. Hook returns RTX holding loaded bounds.",
  4177. rtx, (rtx slot, rtx arg, rtx slot_no),
  4178. default_load_bounds_for_arg)
  4179. DEFHOOK
  4180. (store_bounds_for_arg,
  4181. "This hook is used by expand pass to emit insns to store @var{bounds} of\n\
  4182. @var{arg} passed in @var{slot}. Expand pass uses this hook in case\n\
  4183. @var{bounds} of @var{arg} are not passed in register. If @var{slot} is a\n\
  4184. memory, then @var{bounds} are stored as for regular pointer stored in\n\
  4185. memory. If @var{slot} is not a memory then @var{slot_no} is an integer\n\
  4186. constant holding number of the target dependent special slot which\n\
  4187. should be used to store @var{bounds}.",
  4188. void, (rtx arg, rtx slot, rtx bounds, rtx slot_no),
  4189. default_store_bounds_for_arg)
  4190. DEFHOOK
  4191. (load_returned_bounds,
  4192. "This hook is used by expand pass to emit insn to load bounds\n\
  4193. returned by function call in @var{slot}. Hook returns RTX holding\n\
  4194. loaded bounds.",
  4195. rtx, (rtx slot),
  4196. default_load_returned_bounds)
  4197. DEFHOOK
  4198. (store_returned_bounds,
  4199. "This hook is used by expand pass to emit insn to store @var{bounds}\n\
  4200. returned by function call into @var{slot}.",
  4201. void, (rtx slot, rtx bounds),
  4202. default_store_returned_bounds)
  4203. DEFHOOK
  4204. (setup_incoming_vararg_bounds,
  4205. "Use it to store bounds for anonymous register arguments stored\n\
  4206. into the stack. Arguments meaning is similar to\n\
  4207. @code{TARGET_SETUP_INCOMING_VARARGS}.",
  4208. void, (cumulative_args_t args_so_far, machine_mode mode, tree type,
  4209. int *pretend_args_size, int second_time),
  4210. default_setup_incoming_vararg_bounds)
  4211. DEFHOOK
  4212. (call_args,
  4213. "While generating RTL for a function call, this target hook is invoked once\n\
  4214. for each argument passed to the function, either a register returned by\n\
  4215. @code{TARGET_FUNCTION_ARG} or a memory location. It is called just\n\
  4216. before the point where argument registers are stored. The type of the\n\
  4217. function to be called is also passed as the second argument; it is\n\
  4218. @code{NULL_TREE} for libcalls. The @code{TARGET_END_CALL_ARGS} hook is\n\
  4219. invoked just after the code to copy the return reg has been emitted.\n\
  4220. This functionality can be used to perform special setup of call argument\n\
  4221. registers if a target needs it.\n\
  4222. For functions without arguments, the hook is called once with @code{pc_rtx}\n\
  4223. passed instead of an argument register.\n\
  4224. Most ports do not need to implement anything for this hook.",
  4225. void, (rtx, tree),
  4226. hook_void_rtx_tree)
  4227. DEFHOOK
  4228. (end_call_args,
  4229. "This target hook is invoked while generating RTL for a function call,\n\
  4230. just after the point where the return reg is copied into a pseudo. It\n\
  4231. signals that all the call argument and return registers for the just\n\
  4232. emitted call are now no longer in use.\n\
  4233. Most ports do not need to implement anything for this hook.",
  4234. void, (void),
  4235. hook_void_void)
  4236. DEFHOOK
  4237. (strict_argument_naming,
  4238. "Define this hook to return @code{true} if the location where a function\n\
  4239. argument is passed depends on whether or not it is a named argument.\n\
  4240. \n\
  4241. This hook controls how the @var{named} argument to @code{TARGET_FUNCTION_ARG}\n\
  4242. is set for varargs and stdarg functions. If this hook returns\n\
  4243. @code{true}, the @var{named} argument is always true for named\n\
  4244. arguments, and false for unnamed arguments. If it returns @code{false},\n\
  4245. but @code{TARGET_PRETEND_OUTGOING_VARARGS_NAMED} returns @code{true},\n\
  4246. then all arguments are treated as named. Otherwise, all named arguments\n\
  4247. except the last are treated as named.\n\
  4248. \n\
  4249. You need not define this hook if it always returns @code{false}.",
  4250. bool, (cumulative_args_t ca),
  4251. hook_bool_CUMULATIVE_ARGS_false)
  4252. /* Returns true if we should use
  4253. targetm.calls.setup_incoming_varargs() and/or
  4254. targetm.calls.strict_argument_naming(). */
  4255. DEFHOOK
  4256. (pretend_outgoing_varargs_named,
  4257. "If you need to conditionally change ABIs so that one works with\n\
  4258. @code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither\n\
  4259. @code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was\n\
  4260. defined, then define this hook to return @code{true} if\n\
  4261. @code{TARGET_SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.\n\
  4262. Otherwise, you should not define this hook.",
  4263. bool, (cumulative_args_t ca),
  4264. default_pretend_outgoing_varargs_named)
  4265. /* Given a complex type T, return true if a parameter of type T
  4266. should be passed as two scalars. */
  4267. DEFHOOK
  4268. (split_complex_arg,
  4269. "This hook should return true if parameter of type @var{type} are passed\n\
  4270. as two scalar parameters. By default, GCC will attempt to pack complex\n\
  4271. arguments into the target's word size. Some ABIs require complex arguments\n\
  4272. to be split and treated as their individual components. For example, on\n\
  4273. AIX64, complex floats should be passed in a pair of floating point\n\
  4274. registers, even though a complex float would fit in one 64-bit floating\n\
  4275. point register.\n\
  4276. \n\
  4277. The default value of this hook is @code{NULL}, which is treated as always\n\
  4278. false.",
  4279. bool, (const_tree type), NULL)
  4280. /* Return true if type T, mode MODE, may not be passed in registers,
  4281. but must be passed on the stack. */
  4282. /* ??? This predicate should be applied strictly after pass-by-reference.
  4283. Need audit to verify that this is the case. */
  4284. DEFHOOK
  4285. (must_pass_in_stack,
  4286. "This target hook should return @code{true} if we should not pass @var{type}\n\
  4287. solely in registers. The file @file{expr.h} defines a\n\
  4288. definition that is usually appropriate, refer to @file{expr.h} for additional\n\
  4289. documentation.",
  4290. bool, (machine_mode mode, const_tree type),
  4291. must_pass_in_stack_var_size_or_pad)
  4292. /* Return true if type TYPE, mode MODE, which is passed by reference,
  4293. should have the object copy generated by the callee rather than
  4294. the caller. It is never called for TYPE requiring constructors. */
  4295. DEFHOOK
  4296. (callee_copies,
  4297. "The function argument described by the parameters to this hook is\n\
  4298. known to be passed by reference. The hook should return true if the\n\
  4299. function argument should be copied by the callee instead of copied\n\
  4300. by the caller.\n\
  4301. \n\
  4302. For any argument for which the hook returns true, if it can be\n\
  4303. determined that the argument is not modified, then a copy need\n\
  4304. not be generated.\n\
  4305. \n\
  4306. The default version of this hook always returns false.",
  4307. bool,
  4308. (cumulative_args_t cum, machine_mode mode, const_tree type, bool named),
  4309. hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false)
  4310. /* Return zero for arguments passed entirely on the stack or entirely
  4311. in registers. If passed in both, return the number of bytes passed
  4312. in registers; the balance is therefore passed on the stack. */
  4313. DEFHOOK
  4314. (arg_partial_bytes,
  4315. "This target hook returns the number of bytes at the beginning of an\n\
  4316. argument that must be put in registers. The value must be zero for\n\
  4317. arguments that are passed entirely in registers or that are entirely\n\
  4318. pushed on the stack.\n\
  4319. \n\
  4320. On some machines, certain arguments must be passed partially in\n\
  4321. registers and partially in memory. On these machines, typically the\n\
  4322. first few words of arguments are passed in registers, and the rest\n\
  4323. on the stack. If a multi-word argument (a @code{double} or a\n\
  4324. structure) crosses that boundary, its first few words must be passed\n\
  4325. in registers and the rest must be pushed. This macro tells the\n\
  4326. compiler when this occurs, and how many bytes should go in registers.\n\
  4327. \n\
  4328. @code{TARGET_FUNCTION_ARG} for these arguments should return the first\n\
  4329. register to be used by the caller for this argument; likewise\n\
  4330. @code{TARGET_FUNCTION_INCOMING_ARG}, for the called function.",
  4331. int, (cumulative_args_t cum, machine_mode mode, tree type, bool named),
  4332. hook_int_CUMULATIVE_ARGS_mode_tree_bool_0)
  4333. /* Update the state in CA to advance past an argument in the
  4334. argument list. The values MODE, TYPE, and NAMED describe that
  4335. argument. */
  4336. DEFHOOK
  4337. (function_arg_advance,
  4338. "This hook updates the summarizer variable pointed to by @var{ca} to\n\
  4339. advance past an argument in the argument list. The values @var{mode},\n\
  4340. @var{type} and @var{named} describe that argument. Once this is done,\n\
  4341. the variable @var{cum} is suitable for analyzing the @emph{following}\n\
  4342. argument with @code{TARGET_FUNCTION_ARG}, etc.\n\
  4343. \n\
  4344. This hook need not do anything if the argument in question was passed\n\
  4345. on the stack. The compiler knows how to track the amount of stack space\n\
  4346. used for arguments without any special help.",
  4347. void,
  4348. (cumulative_args_t ca, machine_mode mode, const_tree type, bool named),
  4349. default_function_arg_advance)
  4350. DEFHOOK
  4351. (function_arg_offset,
  4352. "This hook returns the number of bytes to add to the offset of an\n\
  4353. argument of type @var{type} and mode @var{mode} when passed in memory.\n\
  4354. This is needed for the SPU, which passes @code{char} and @code{short}\n\
  4355. arguments in the preferred slot that is in the middle of the quad word\n\
  4356. instead of starting at the top. The default implementation returns 0.",
  4357. HOST_WIDE_INT, (machine_mode mode, const_tree type),
  4358. default_function_arg_offset)
  4359. DEFHOOK
  4360. (function_arg_padding,
  4361. "This hook determines whether, and in which direction, to pad out\n\
  4362. an argument of mode @var{mode} and type @var{type}. It returns\n\
  4363. @code{PAD_UPWARD} to insert padding above the argument, @code{PAD_DOWNWARD}\n\
  4364. to insert padding below the argument, or @code{PAD_NONE} to inhibit padding.\n\
  4365. \n\
  4366. The @emph{amount} of padding is not controlled by this hook, but by\n\
  4367. @code{TARGET_FUNCTION_ARG_ROUND_BOUNDARY}. It is always just enough\n\
  4368. to reach the next multiple of that boundary.\n\
  4369. \n\
  4370. This hook has a default definition that is right for most systems.\n\
  4371. For little-endian machines, the default is to pad upward. For\n\
  4372. big-endian machines, the default is to pad downward for an argument of\n\
  4373. constant size shorter than an @code{int}, and upward otherwise.",
  4374. pad_direction, (machine_mode mode, const_tree type),
  4375. default_function_arg_padding)
  4376. /* Return zero if the argument described by the state of CA should
  4377. be placed on a stack, or a hard register in which to store the
  4378. argument. The values MODE, TYPE, and NAMED describe that
  4379. argument. */
  4380. DEFHOOK
  4381. (function_arg,
  4382. "Return an RTX indicating whether a function argument is passed in a\n\
  4383. register and if so, which register.\n\
  4384. \n\
  4385. The arguments are @var{ca}, which summarizes all the previous\n\
  4386. arguments; @var{mode}, the machine mode of the argument; @var{type},\n\
  4387. the data type of the argument as a tree node or 0 if that is not known\n\
  4388. (which happens for C support library functions); and @var{named},\n\
  4389. which is @code{true} for an ordinary argument and @code{false} for\n\
  4390. nameless arguments that correspond to @samp{@dots{}} in the called\n\
  4391. function's prototype. @var{type} can be an incomplete type if a\n\
  4392. syntax error has previously occurred.\n\
  4393. \n\
  4394. The return value is usually either a @code{reg} RTX for the hard\n\
  4395. register in which to pass the argument, or zero to pass the argument\n\
  4396. on the stack.\n\
  4397. \n\
  4398. The return value can be a @code{const_int} which means argument is\n\
  4399. passed in a target specific slot with specified number. Target hooks\n\
  4400. should be used to store or load argument in such case. See\n\
  4401. @code{TARGET_STORE_BOUNDS_FOR_ARG} and @code{TARGET_LOAD_BOUNDS_FOR_ARG}\n\
  4402. for more information.\n\
  4403. \n\
  4404. The value of the expression can also be a @code{parallel} RTX@. This is\n\
  4405. used when an argument is passed in multiple locations. The mode of the\n\
  4406. @code{parallel} should be the mode of the entire argument. The\n\
  4407. @code{parallel} holds any number of @code{expr_list} pairs; each one\n\
  4408. describes where part of the argument is passed. In each\n\
  4409. @code{expr_list} the first operand must be a @code{reg} RTX for the hard\n\
  4410. register in which to pass this part of the argument, and the mode of the\n\
  4411. register RTX indicates how large this part of the argument is. The\n\
  4412. second operand of the @code{expr_list} is a @code{const_int} which gives\n\
  4413. the offset in bytes into the entire argument of where this part starts.\n\
  4414. As a special exception the first @code{expr_list} in the @code{parallel}\n\
  4415. RTX may have a first operand of zero. This indicates that the entire\n\
  4416. argument is also stored on the stack.\n\
  4417. \n\
  4418. The last time this hook is called, it is called with @code{MODE ==\n\
  4419. VOIDmode}, and its result is passed to the @code{call} or @code{call_value}\n\
  4420. pattern as operands 2 and 3 respectively.\n\
  4421. \n\
  4422. @cindex @file{stdarg.h} and register arguments\n\
  4423. The usual way to make the ISO library @file{stdarg.h} work on a\n\
  4424. machine where some arguments are usually passed in registers, is to\n\
  4425. cause nameless arguments to be passed on the stack instead. This is\n\
  4426. done by making @code{TARGET_FUNCTION_ARG} return 0 whenever\n\
  4427. @var{named} is @code{false}.\n\
  4428. \n\
  4429. @cindex @code{TARGET_MUST_PASS_IN_STACK}, and @code{TARGET_FUNCTION_ARG}\n\
  4430. @cindex @code{REG_PARM_STACK_SPACE}, and @code{TARGET_FUNCTION_ARG}\n\
  4431. You may use the hook @code{targetm.calls.must_pass_in_stack}\n\
  4432. in the definition of this macro to determine if this argument is of a\n\
  4433. type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE}\n\
  4434. is not defined and @code{TARGET_FUNCTION_ARG} returns nonzero for such an\n\
  4435. argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is\n\
  4436. defined, the argument will be computed in the stack and then loaded into\n\
  4437. a register.",
  4438. rtx, (cumulative_args_t ca, machine_mode mode, const_tree type,
  4439. bool named),
  4440. default_function_arg)
  4441. DEFHOOK
  4442. (function_incoming_arg,
  4443. "Define this hook if the caller and callee on the target have different\n\
  4444. views of where arguments are passed. Also define this hook if there are\n\
  4445. functions that are never directly called, but are invoked by the hardware\n\
  4446. and which have nonstandard calling conventions.\n\
  4447. \n\
  4448. In this case @code{TARGET_FUNCTION_ARG} computes the register in\n\
  4449. which the caller passes the value, and\n\
  4450. @code{TARGET_FUNCTION_INCOMING_ARG} should be defined in a similar\n\
  4451. fashion to tell the function being called where the arguments will\n\
  4452. arrive.\n\
  4453. \n\
  4454. @code{TARGET_FUNCTION_INCOMING_ARG} can also return arbitrary address\n\
  4455. computation using hard register, which can be forced into a register,\n\
  4456. so that it can be used to pass special arguments.\n\
  4457. \n\
  4458. If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined,\n\
  4459. @code{TARGET_FUNCTION_ARG} serves both purposes.",
  4460. rtx, (cumulative_args_t ca, machine_mode mode, const_tree type,
  4461. bool named),
  4462. default_function_incoming_arg)
  4463. DEFHOOK
  4464. (function_arg_boundary,
  4465. "This hook returns the alignment boundary, in bits, of an argument\n\
  4466. with the specified mode and type. The default hook returns\n\
  4467. @code{PARM_BOUNDARY} for all arguments.",
  4468. unsigned int, (machine_mode mode, const_tree type),
  4469. default_function_arg_boundary)
  4470. DEFHOOK
  4471. (function_arg_round_boundary,
  4472. "Normally, the size of an argument is rounded up to @code{PARM_BOUNDARY},\n\
  4473. which is the default value for this hook. You can define this hook to\n\
  4474. return a different value if an argument size must be rounded to a larger\n\
  4475. value.",
  4476. unsigned int, (machine_mode mode, const_tree type),
  4477. default_function_arg_round_boundary)
  4478. /* Return the diagnostic message string if function without a prototype
  4479. is not allowed for this 'val' argument; NULL otherwise. */
  4480. DEFHOOK
  4481. (invalid_arg_for_unprototyped_fn,
  4482. "If defined, this macro returns the diagnostic message when it is\n\
  4483. illegal to pass argument @var{val} to function @var{funcdecl}\n\
  4484. with prototype @var{typelist}.",
  4485. const char *, (const_tree typelist, const_tree funcdecl, const_tree val),
  4486. hook_invalid_arg_for_unprototyped_fn)
  4487. /* Return an rtx for the return value location of the function
  4488. specified by FN_DECL_OR_TYPE with a return type of RET_TYPE. */
  4489. DEFHOOK
  4490. (function_value,
  4491. "\n\
  4492. Define this to return an RTX representing the place where a function\n\
  4493. returns or receives a value of data type @var{ret_type}, a tree node\n\
  4494. representing a data type. @var{fn_decl_or_type} is a tree node\n\
  4495. representing @code{FUNCTION_DECL} or @code{FUNCTION_TYPE} of a\n\
  4496. function being called. If @var{outgoing} is false, the hook should\n\
  4497. compute the register in which the caller will see the return value.\n\
  4498. Otherwise, the hook should return an RTX representing the place where\n\
  4499. a function returns a value.\n\
  4500. \n\
  4501. On many machines, only @code{TYPE_MODE (@var{ret_type})} is relevant.\n\
  4502. (Actually, on most machines, scalar values are returned in the same\n\
  4503. place regardless of mode.) The value of the expression is usually a\n\
  4504. @code{reg} RTX for the hard register where the return value is stored.\n\
  4505. The value can also be a @code{parallel} RTX, if the return value is in\n\
  4506. multiple places. See @code{TARGET_FUNCTION_ARG} for an explanation of the\n\
  4507. @code{parallel} form. Note that the callee will populate every\n\
  4508. location specified in the @code{parallel}, but if the first element of\n\
  4509. the @code{parallel} contains the whole return value, callers will use\n\
  4510. that element as the canonical location and ignore the others. The m68k\n\
  4511. port uses this type of @code{parallel} to return pointers in both\n\
  4512. @samp{%a0} (the canonical location) and @samp{%d0}.\n\
  4513. \n\
  4514. If @code{TARGET_PROMOTE_FUNCTION_RETURN} returns true, you must apply\n\
  4515. the same promotion rules specified in @code{PROMOTE_MODE} if\n\
  4516. @var{valtype} is a scalar type.\n\
  4517. \n\
  4518. If the precise function being called is known, @var{func} is a tree\n\
  4519. node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null\n\
  4520. pointer. This makes it possible to use a different value-returning\n\
  4521. convention for specific functions when all their calls are\n\
  4522. known.\n\
  4523. \n\
  4524. Some target machines have ``register windows'' so that the register in\n\
  4525. which a function returns its value is not the same as the one in which\n\
  4526. the caller sees the value. For such machines, you should return\n\
  4527. different RTX depending on @var{outgoing}.\n\
  4528. \n\
  4529. @code{TARGET_FUNCTION_VALUE} is not used for return values with\n\
  4530. aggregate data types, because these are returned in another way. See\n\
  4531. @code{TARGET_STRUCT_VALUE_RTX} and related macros, below.",
  4532. rtx, (const_tree ret_type, const_tree fn_decl_or_type, bool outgoing),
  4533. default_function_value)
  4534. /* Return the rtx for the result of a libcall of mode MODE,
  4535. calling the function FN_NAME. */
  4536. DEFHOOK
  4537. (libcall_value,
  4538. "Define this hook if the back-end needs to know the name of the libcall\n\
  4539. function in order to determine where the result should be returned.\n\
  4540. \n\
  4541. The mode of the result is given by @var{mode} and the name of the called\n\
  4542. library function is given by @var{fun}. The hook should return an RTX\n\
  4543. representing the place where the library function result will be returned.\n\
  4544. \n\
  4545. If this hook is not defined, then LIBCALL_VALUE will be used.",
  4546. rtx, (machine_mode mode, const_rtx fun),
  4547. default_libcall_value)
  4548. /* Return true if REGNO is a possible register number for
  4549. a function value as seen by the caller. */
  4550. DEFHOOK
  4551. (function_value_regno_p,
  4552. "A target hook that return @code{true} if @var{regno} is the number of a hard\n\
  4553. register in which the values of called function may come back.\n\
  4554. \n\
  4555. A register whose use for returning values is limited to serving as the\n\
  4556. second of a pair (for a value of type @code{double}, say) need not be\n\
  4557. recognized by this target hook.\n\
  4558. \n\
  4559. If the machine has register windows, so that the caller and the called\n\
  4560. function use different registers for the return value, this target hook\n\
  4561. should recognize only the caller's register numbers.\n\
  4562. \n\
  4563. If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.",
  4564. bool, (const unsigned int regno),
  4565. default_function_value_regno_p)
  4566. /* ??? Documenting this hook requires a GFDL license grant. */
  4567. DEFHOOK_UNDOC
  4568. (internal_arg_pointer,
  4569. "Return an rtx for the argument pointer incoming to the\
  4570. current function.",
  4571. rtx, (void),
  4572. default_internal_arg_pointer)
  4573. /* Update the current function stack boundary if needed. */
  4574. DEFHOOK
  4575. (update_stack_boundary,
  4576. "Define this macro to update the current function stack boundary if\n\
  4577. necessary.",
  4578. void, (void), NULL)
  4579. /* Handle stack alignment and return an rtx for Dynamic Realign
  4580. Argument Pointer if necessary. */
  4581. DEFHOOK
  4582. (get_drap_rtx,
  4583. "This hook should return an rtx for Dynamic Realign Argument Pointer (DRAP) if a\n\
  4584. different argument pointer register is needed to access the function's\n\
  4585. argument list due to stack realignment. Return @code{NULL} if no DRAP\n\
  4586. is needed.",
  4587. rtx, (void), NULL)
  4588. /* Return true if all function parameters should be spilled to the
  4589. stack. */
  4590. DEFHOOK
  4591. (allocate_stack_slots_for_args,
  4592. "When optimization is disabled, this hook indicates whether or not\n\
  4593. arguments should be allocated to stack slots. Normally, GCC allocates\n\
  4594. stacks slots for arguments when not optimizing in order to make\n\
  4595. debugging easier. However, when a function is declared with\n\
  4596. @code{__attribute__((naked))}, there is no stack frame, and the compiler\n\
  4597. cannot safely move arguments from the registers in which they are passed\n\
  4598. to the stack. Therefore, this hook should return true in general, but\n\
  4599. false for naked functions. The default implementation always returns true.",
  4600. bool, (void),
  4601. hook_bool_void_true)
  4602. /* Return an rtx for the static chain for FNDECL_OR_TYPE. If INCOMING_P
  4603. is true, then it should be for the callee; otherwise for the caller. */
  4604. DEFHOOK
  4605. (static_chain,
  4606. "This hook replaces the use of @code{STATIC_CHAIN_REGNUM} et al for\n\
  4607. targets that may use different static chain locations for different\n\
  4608. nested functions. This may be required if the target has function\n\
  4609. attributes that affect the calling conventions of the function and\n\
  4610. those calling conventions use different static chain locations.\n\
  4611. \n\
  4612. The default version of this hook uses @code{STATIC_CHAIN_REGNUM} et al.\n\
  4613. \n\
  4614. If the static chain is passed in memory, this hook should be used to\n\
  4615. provide rtx giving @code{mem} expressions that denote where they are stored.\n\
  4616. Often the @code{mem} expression as seen by the caller will be at an offset\n\
  4617. from the stack pointer and the @code{mem} expression as seen by the callee\n\
  4618. will be at an offset from the frame pointer.\n\
  4619. @findex stack_pointer_rtx\n\
  4620. @findex frame_pointer_rtx\n\
  4621. @findex arg_pointer_rtx\n\
  4622. The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and\n\
  4623. @code{arg_pointer_rtx} will have been initialized and should be used\n\
  4624. to refer to those items.",
  4625. rtx, (const_tree fndecl_or_type, bool incoming_p),
  4626. default_static_chain)
  4627. /* Fill in the trampoline at MEM with a call to FNDECL and a
  4628. static chain value of CHAIN. */
  4629. DEFHOOK
  4630. (trampoline_init,
  4631. "This hook is called to initialize a trampoline.\n\
  4632. @var{m_tramp} is an RTX for the memory block for the trampoline; @var{fndecl}\n\
  4633. is the @code{FUNCTION_DECL} for the nested function; @var{static_chain} is an\n\
  4634. RTX for the static chain value that should be passed to the function\n\
  4635. when it is called.\n\
  4636. \n\
  4637. If the target defines @code{TARGET_ASM_TRAMPOLINE_TEMPLATE}, then the\n\
  4638. first thing this hook should do is emit a block move into @var{m_tramp}\n\
  4639. from the memory block returned by @code{assemble_trampoline_template}.\n\
  4640. Note that the block move need only cover the constant parts of the\n\
  4641. trampoline. If the target isolates the variable parts of the trampoline\n\
  4642. to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied.\n\
  4643. \n\
  4644. If the target requires any other actions, such as flushing caches or\n\
  4645. enabling stack execution, these actions should be performed after\n\
  4646. initializing the trampoline proper.",
  4647. void, (rtx m_tramp, tree fndecl, rtx static_chain),
  4648. default_trampoline_init)
  4649. /* Adjust the address of the trampoline in a target-specific way. */
  4650. DEFHOOK
  4651. (trampoline_adjust_address,
  4652. "This hook should perform any machine-specific adjustment in\n\
  4653. the address of the trampoline. Its argument contains the address of the\n\
  4654. memory block that was passed to @code{TARGET_TRAMPOLINE_INIT}. In case\n\
  4655. the address to be used for a function call should be different from the\n\
  4656. address at which the template was stored, the different address should\n\
  4657. be returned; otherwise @var{addr} should be returned unchanged.\n\
  4658. If this hook is not defined, @var{addr} will be used for function calls.",
  4659. rtx, (rtx addr), NULL)
  4660. DEFHOOKPOD
  4661. (custom_function_descriptors,
  4662. "If the target can use GCC's generic descriptor mechanism for nested\n\
  4663. functions, define this hook to a power of 2 representing an unused bit\n\
  4664. in function pointers which can be used to differentiate descriptors at\n\
  4665. run time. This value gives the number of bytes by which descriptor\n\
  4666. pointers are misaligned compared to function pointers. For example, on\n\
  4667. targets that require functions to be aligned to a 4-byte boundary, a\n\
  4668. value of either 1 or 2 is appropriate unless the architecture already\n\
  4669. reserves the bit for another purpose, such as on ARM.\n\
  4670. \n\
  4671. Define this hook to 0 if the target implements ABI support for\n\
  4672. function descriptors in its standard calling sequence, like for example\n\
  4673. HPPA or IA-64.\n\
  4674. \n\
  4675. Using descriptors for nested functions\n\
  4676. eliminates the need for trampolines that reside on the stack and require\n\
  4677. it to be made executable.",\
  4678. int, -1)
  4679. /* Return the number of bytes of its own arguments that a function
  4680. pops on returning, or 0 if the function pops no arguments and the
  4681. caller must therefore pop them all after the function returns. */
  4682. /* ??? tm.texi has no types for the parameters. */
  4683. DEFHOOK
  4684. (return_pops_args,
  4685. "This target hook returns the number of bytes of its own arguments that\n\
  4686. a function pops on returning, or 0 if the function pops no arguments\n\
  4687. and the caller must therefore pop them all after the function returns.\n\
  4688. \n\
  4689. @var{fundecl} is a C variable whose value is a tree node that describes\n\
  4690. the function in question. Normally it is a node of type\n\
  4691. @code{FUNCTION_DECL} that describes the declaration of the function.\n\
  4692. From this you can obtain the @code{DECL_ATTRIBUTES} of the function.\n\
  4693. \n\
  4694. @var{funtype} is a C variable whose value is a tree node that\n\
  4695. describes the function in question. Normally it is a node of type\n\
  4696. @code{FUNCTION_TYPE} that describes the data type of the function.\n\
  4697. From this it is possible to obtain the data types of the value and\n\
  4698. arguments (if known).\n\
  4699. \n\
  4700. When a call to a library function is being considered, @var{fundecl}\n\
  4701. will contain an identifier node for the library function. Thus, if\n\
  4702. you need to distinguish among various library functions, you can do so\n\
  4703. by their names. Note that ``library function'' in this context means\n\
  4704. a function used to perform arithmetic, whose name is known specially\n\
  4705. in the compiler and was not mentioned in the C code being compiled.\n\
  4706. \n\
  4707. @var{size} is the number of bytes of arguments passed on the\n\
  4708. stack. If a variable number of bytes is passed, it is zero, and\n\
  4709. argument popping will always be the responsibility of the calling function.\n\
  4710. \n\
  4711. On the VAX, all functions always pop their arguments, so the definition\n\
  4712. of this macro is @var{size}. On the 68000, using the standard\n\
  4713. calling convention, no functions pop their arguments, so the value of\n\
  4714. the macro is always 0 in this case. But an alternative calling\n\
  4715. convention is available in which functions that take a fixed number of\n\
  4716. arguments pop them but other functions (such as @code{printf}) pop\n\
  4717. nothing (the caller pops all). When this convention is in use,\n\
  4718. @var{funtype} is examined to determine whether a function takes a fixed\n\
  4719. number of arguments.",
  4720. poly_int64, (tree fundecl, tree funtype, poly_int64 size),
  4721. default_return_pops_args)
  4722. /* Return a mode wide enough to copy any function value that might be
  4723. returned. */
  4724. DEFHOOK
  4725. (get_raw_result_mode,
  4726. "This target hook returns the mode to be used when accessing raw return\
  4727. registers in @code{__builtin_return}. Define this macro if the value\
  4728. in @var{reg_raw_mode} is not correct.",
  4729. fixed_size_mode, (int regno),
  4730. default_get_reg_raw_mode)
  4731. /* Return a mode wide enough to copy any argument value that might be
  4732. passed. */
  4733. DEFHOOK
  4734. (get_raw_arg_mode,
  4735. "This target hook returns the mode to be used when accessing raw argument\
  4736. registers in @code{__builtin_apply_args}. Define this macro if the value\
  4737. in @var{reg_raw_mode} is not correct.",
  4738. fixed_size_mode, (int regno),
  4739. default_get_reg_raw_mode)
  4740. /* Return true if a type is an empty record. */
  4741. DEFHOOK
  4742. (empty_record_p,
  4743. "This target hook returns true if the type is an empty record. The default\n\
  4744. is to return @code{false}.",
  4745. bool, (const_tree type),
  4746. hook_bool_const_tree_false)
  4747. /* Warn about the change in empty class parameter passing ABI. */
  4748. DEFHOOK
  4749. (warn_parameter_passing_abi,
  4750. "This target hook warns about the change in empty class parameter passing\n\
  4751. ABI.",
  4752. void, (cumulative_args_t ca, tree type),
  4753. hook_void_CUMULATIVE_ARGS_tree)
  4754. HOOK_VECTOR_END (calls)
  4755. DEFHOOK
  4756. (use_pseudo_pic_reg,
  4757. "This hook should return 1 in case pseudo register should be created\n\
  4758. for pic_offset_table_rtx during function expand.",
  4759. bool, (void),
  4760. hook_bool_void_false)
  4761. DEFHOOK
  4762. (init_pic_reg,
  4763. "Perform a target dependent initialization of pic_offset_table_rtx.\n\
  4764. This hook is called at the start of register allocation.",
  4765. void, (void),
  4766. hook_void_void)
  4767. /* Return the diagnostic message string if conversion from FROMTYPE
  4768. to TOTYPE is not allowed, NULL otherwise. */
  4769. DEFHOOK
  4770. (invalid_conversion,
  4771. "If defined, this macro returns the diagnostic message when it is\n\
  4772. invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL}\n\
  4773. if validity should be determined by the front end.",
  4774. const char *, (const_tree fromtype, const_tree totype),
  4775. hook_constcharptr_const_tree_const_tree_null)
  4776. /* Return the diagnostic message string if the unary operation OP is
  4777. not permitted on TYPE, NULL otherwise. */
  4778. DEFHOOK
  4779. (invalid_unary_op,
  4780. "If defined, this macro returns the diagnostic message when it is\n\
  4781. invalid to apply operation @var{op} (where unary plus is denoted by\n\
  4782. @code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL}\n\
  4783. if validity should be determined by the front end.",
  4784. const char *, (int op, const_tree type),
  4785. hook_constcharptr_int_const_tree_null)
  4786. /* Return the diagnostic message string if the binary operation OP
  4787. is not permitted on TYPE1 and TYPE2, NULL otherwise. */
  4788. DEFHOOK
  4789. (invalid_binary_op,
  4790. "If defined, this macro returns the diagnostic message when it is\n\
  4791. invalid to apply operation @var{op} to operands of types @var{type1}\n\
  4792. and @var{type2}, or @code{NULL} if validity should be determined by\n\
  4793. the front end.",
  4794. const char *, (int op, const_tree type1, const_tree type2),
  4795. hook_constcharptr_int_const_tree_const_tree_null)
  4796. /* If values of TYPE are promoted to some other type when used in
  4797. expressions (analogous to the integer promotions), return that type,
  4798. or NULL_TREE otherwise. */
  4799. DEFHOOK
  4800. (promoted_type,
  4801. "If defined, this target hook returns the type to which values of\n\
  4802. @var{type} should be promoted when they appear in expressions,\n\
  4803. analogous to the integer promotions, or @code{NULL_TREE} to use the\n\
  4804. front end's normal promotion rules. This hook is useful when there are\n\
  4805. target-specific types with special promotion rules.\n\
  4806. This is currently used only by the C and C++ front ends.",
  4807. tree, (const_tree type),
  4808. hook_tree_const_tree_null)
  4809. /* Convert EXPR to TYPE, if target-specific types with special conversion
  4810. rules are involved. Return the converted expression, or NULL to apply
  4811. the standard conversion rules. */
  4812. DEFHOOK
  4813. (convert_to_type,
  4814. "If defined, this hook returns the result of converting @var{expr} to\n\
  4815. @var{type}. It should return the converted expression,\n\
  4816. or @code{NULL_TREE} to apply the front end's normal conversion rules.\n\
  4817. This hook is useful when there are target-specific types with special\n\
  4818. conversion rules.\n\
  4819. This is currently used only by the C and C++ front ends.",
  4820. tree, (tree type, tree expr),
  4821. hook_tree_tree_tree_null)
  4822. DEFHOOK
  4823. (can_change_mode_class,
  4824. "This hook returns true if it is possible to bitcast values held in\n\
  4825. registers of class @var{rclass} from mode @var{from} to mode @var{to}\n\
  4826. and if doing so preserves the low-order bits that are common to both modes.\n\
  4827. The result is only meaningful if @var{rclass} has registers that can hold\n\
  4828. both @code{from} and @code{to}. The default implementation returns true.\n\
  4829. \n\
  4830. As an example of when such bitcasting is invalid, loading 32-bit integer or\n\
  4831. floating-point objects into floating-point registers on Alpha extends them\n\
  4832. to 64 bits. Therefore loading a 64-bit object and then storing it as a\n\
  4833. 32-bit object does not store the low-order 32 bits, as would be the case\n\
  4834. for a normal register. Therefore, @file{alpha.h} defines\n\
  4835. @code{TARGET_CAN_CHANGE_MODE_CLASS} to return:\n\
  4836. \n\
  4837. @smallexample\n\
  4838. (GET_MODE_SIZE (from) == GET_MODE_SIZE (to)\n\
  4839. || !reg_classes_intersect_p (FLOAT_REGS, rclass))\n\
  4840. @end smallexample\n\
  4841. \n\
  4842. Even if storing from a register in mode @var{to} would be valid,\n\
  4843. if both @var{from} and @code{raw_reg_mode} for @var{rclass} are wider\n\
  4844. than @code{word_mode}, then we must prevent @var{to} narrowing the\n\
  4845. mode. This happens when the middle-end assumes that it can load\n\
  4846. or store pieces of an @var{N}-word pseudo, and that the pseudo will\n\
  4847. eventually be allocated to @var{N} @code{word_mode} hard registers.\n\
  4848. Failure to prevent this kind of mode change will result in the\n\
  4849. entire @code{raw_reg_mode} being modified instead of the partial\n\
  4850. value that the middle-end intended.",
  4851. bool, (machine_mode from, machine_mode to, reg_class_t rclass),
  4852. hook_bool_mode_mode_reg_class_t_true)
  4853. /* Change pseudo allocno class calculated by IRA. */
  4854. DEFHOOK
  4855. (ira_change_pseudo_allocno_class,
  4856. "A target hook which can change allocno class for given pseudo from\n\
  4857. allocno and best class calculated by IRA.\n\
  4858. \n\
  4859. The default version of this target hook always returns given class.",
  4860. reg_class_t, (int, reg_class_t, reg_class_t),
  4861. default_ira_change_pseudo_allocno_class)
  4862. /* Return true if we use LRA instead of reload. */
  4863. DEFHOOK
  4864. (lra_p,
  4865. "A target hook which returns true if we use LRA instead of reload pass.\
  4866. \
  4867. The default version of this target hook returns true. New ports\
  4868. should use LRA, and existing ports are encouraged to convert.",
  4869. bool, (void),
  4870. default_lra_p)
  4871. /* Return register priority of given hard regno for the current target. */
  4872. DEFHOOK
  4873. (register_priority,
  4874. "A target hook which returns the register priority number to which the\
  4875. register @var{hard_regno} belongs to. The bigger the number, the\
  4876. more preferable the hard register usage (when all other conditions are\
  4877. the same). This hook can be used to prefer some hard register over\
  4878. others in LRA. For example, some x86-64 register usage needs\
  4879. additional prefix which makes instructions longer. The hook can\
  4880. return lower priority number for such registers make them less favorable\
  4881. and as result making the generated code smaller.\
  4882. \
  4883. The default version of this target hook returns always zero.",
  4884. int, (int),
  4885. default_register_priority)
  4886. /* Return true if we need register usage leveling. */
  4887. DEFHOOK
  4888. (register_usage_leveling_p,
  4889. "A target hook which returns true if we need register usage leveling.\
  4890. That means if a few hard registers are equally good for the\
  4891. assignment, we choose the least used hard register. The register\
  4892. usage leveling may be profitable for some targets. Don't use the\
  4893. usage leveling for targets with conditional execution or targets\
  4894. with big register files as it hurts if-conversion and cross-jumping\
  4895. optimizations.\
  4896. \
  4897. The default version of this target hook returns always false.",
  4898. bool, (void),
  4899. default_register_usage_leveling_p)
  4900. /* Return true if maximal address displacement can be different. */
  4901. DEFHOOK
  4902. (different_addr_displacement_p,
  4903. "A target hook which returns true if an address with the same structure\
  4904. can have different maximal legitimate displacement. For example, the\
  4905. displacement can depend on memory mode or on operand combinations in\
  4906. the insn.\
  4907. \
  4908. The default version of this target hook returns always false.",
  4909. bool, (void),
  4910. default_different_addr_displacement_p)
  4911. /* Determine class for spilling pseudos of given mode into registers
  4912. instead of memory. */
  4913. DEFHOOK
  4914. (spill_class,
  4915. "This hook defines a class of registers which could be used for spilling\
  4916. pseudos of the given mode and class, or @code{NO_REGS} if only memory\
  4917. should be used. Not defining this hook is equivalent to returning\
  4918. @code{NO_REGS} for all inputs.",
  4919. reg_class_t, (reg_class_t, machine_mode),
  4920. NULL)
  4921. /* Determine an additional allocno class. */
  4922. DEFHOOK
  4923. (additional_allocno_class_p,
  4924. "This hook should return @code{true} if given class of registers should\
  4925. be an allocno class in any way. Usually RA uses only one register\
  4926. class from all classes containing the same register set. In some\
  4927. complicated cases, you need to have two or more such classes as\
  4928. allocno ones for RA correct work. Not defining this hook is\
  4929. equivalent to returning @code{false} for all inputs.",
  4930. bool, (reg_class_t),
  4931. hook_bool_reg_class_t_false)
  4932. DEFHOOK
  4933. (cstore_mode,
  4934. "This hook defines the machine mode to use for the boolean result of\
  4935. conditional store patterns. The ICODE argument is the instruction code\
  4936. for the cstore being performed. Not definiting this hook is the same\
  4937. as accepting the mode encoded into operand 0 of the cstore expander\
  4938. patterns.",
  4939. scalar_int_mode, (enum insn_code icode),
  4940. default_cstore_mode)
  4941. /* This target hook allows the backend to compute the register pressure
  4942. classes to use. */
  4943. DEFHOOK
  4944. (compute_pressure_classes,
  4945. "A target hook which lets a backend compute the set of pressure classes to\
  4946. be used by those optimization passes which take register pressure into\
  4947. account, as opposed to letting IRA compute them. It returns the number of\
  4948. register classes stored in the array @var{pressure_classes}.",
  4949. int, (enum reg_class *pressure_classes), NULL)
  4950. /* True if a structure, union or array with MODE containing FIELD should
  4951. be accessed using BLKmode. */
  4952. DEFHOOK
  4953. (member_type_forces_blk,
  4954. "Return true if a structure, union or array containing @var{field} should\n\
  4955. be accessed using @code{BLKMODE}.\n\
  4956. \n\
  4957. If @var{field} is the only field in the structure, @var{mode} is its\n\
  4958. mode, otherwise @var{mode} is VOIDmode. @var{mode} is provided in the\n\
  4959. case where structures of one field would require the structure's mode to\n\
  4960. retain the field's mode.\n\
  4961. \n\
  4962. Normally, this is not needed.",
  4963. bool, (const_tree field, machine_mode mode),
  4964. default_member_type_forces_blk)
  4965. /* See tree-ssa-math-opts.c:divmod_candidate_p for conditions
  4966. that gate the divod transform. */
  4967. DEFHOOK
  4968. (expand_divmod_libfunc,
  4969. "Define this hook for enabling divmod transform if the port does not have\n\
  4970. hardware divmod insn but defines target-specific divmod libfuncs.",
  4971. void, (rtx libfunc, machine_mode mode, rtx op0, rtx op1, rtx *quot, rtx *rem),
  4972. NULL)
  4973. /* Return the class for a secondary reload, and fill in extra information. */
  4974. DEFHOOK
  4975. (secondary_reload,
  4976. "Many machines have some registers that cannot be copied directly to or\n\
  4977. from memory or even from other types of registers. An example is the\n\
  4978. @samp{MQ} register, which on most machines, can only be copied to or\n\
  4979. from general registers, but not memory. Below, we shall be using the\n\
  4980. term 'intermediate register' when a move operation cannot be performed\n\
  4981. directly, but has to be done by copying the source into the intermediate\n\
  4982. register first, and then copying the intermediate register to the\n\
  4983. destination. An intermediate register always has the same mode as\n\
  4984. source and destination. Since it holds the actual value being copied,\n\
  4985. reload might apply optimizations to re-use an intermediate register\n\
  4986. and eliding the copy from the source when it can determine that the\n\
  4987. intermediate register still holds the required value.\n\
  4988. \n\
  4989. Another kind of secondary reload is required on some machines which\n\
  4990. allow copying all registers to and from memory, but require a scratch\n\
  4991. register for stores to some memory locations (e.g., those with symbolic\n\
  4992. address on the RT, and those with certain symbolic address on the SPARC\n\
  4993. when compiling PIC)@. Scratch registers need not have the same mode\n\
  4994. as the value being copied, and usually hold a different value than\n\
  4995. that being copied. Special patterns in the md file are needed to\n\
  4996. describe how the copy is performed with the help of the scratch register;\n\
  4997. these patterns also describe the number, register class(es) and mode(s)\n\
  4998. of the scratch register(s).\n\
  4999. \n\
  5000. In some cases, both an intermediate and a scratch register are required.\n\
  5001. \n\
  5002. For input reloads, this target hook is called with nonzero @var{in_p},\n\
  5003. and @var{x} is an rtx that needs to be copied to a register of class\n\
  5004. @var{reload_class} in @var{reload_mode}. For output reloads, this target\n\
  5005. hook is called with zero @var{in_p}, and a register of class @var{reload_class}\n\
  5006. needs to be copied to rtx @var{x} in @var{reload_mode}.\n\
  5007. \n\
  5008. If copying a register of @var{reload_class} from/to @var{x} requires\n\
  5009. an intermediate register, the hook @code{secondary_reload} should\n\
  5010. return the register class required for this intermediate register.\n\
  5011. If no intermediate register is required, it should return NO_REGS.\n\
  5012. If more than one intermediate register is required, describe the one\n\
  5013. that is closest in the copy chain to the reload register.\n\
  5014. \n\
  5015. If scratch registers are needed, you also have to describe how to\n\
  5016. perform the copy from/to the reload register to/from this\n\
  5017. closest intermediate register. Or if no intermediate register is\n\
  5018. required, but still a scratch register is needed, describe the\n\
  5019. copy from/to the reload register to/from the reload operand @var{x}.\n\
  5020. \n\
  5021. You do this by setting @code{sri->icode} to the instruction code of a pattern\n\
  5022. in the md file which performs the move. Operands 0 and 1 are the output\n\
  5023. and input of this copy, respectively. Operands from operand 2 onward are\n\
  5024. for scratch operands. These scratch operands must have a mode, and a\n\
  5025. single-register-class\n\
  5026. @c [later: or memory]\n\
  5027. output constraint.\n\
  5028. \n\
  5029. When an intermediate register is used, the @code{secondary_reload}\n\
  5030. hook will be called again to determine how to copy the intermediate\n\
  5031. register to/from the reload operand @var{x}, so your hook must also\n\
  5032. have code to handle the register class of the intermediate operand.\n\
  5033. \n\
  5034. @c [For later: maybe we'll allow multi-alternative reload patterns -\n\
  5035. @c the port maintainer could name a mov<mode> pattern that has clobbers -\n\
  5036. @c and match the constraints of input and output to determine the required\n\
  5037. @c alternative. A restriction would be that constraints used to match\n\
  5038. @c against reloads registers would have to be written as register class\n\
  5039. @c constraints, or we need a new target macro / hook that tells us if an\n\
  5040. @c arbitrary constraint can match an unknown register of a given class.\n\
  5041. @c Such a macro / hook would also be useful in other places.]\n\
  5042. \n\
  5043. \n\
  5044. @var{x} might be a pseudo-register or a @code{subreg} of a\n\
  5045. pseudo-register, which could either be in a hard register or in memory.\n\
  5046. Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is\n\
  5047. in memory and the hard register number if it is in a register.\n\
  5048. \n\
  5049. Scratch operands in memory (constraint @code{\"=m\"} / @code{\"=&m\"}) are\n\
  5050. currently not supported. For the time being, you will have to continue\n\
  5051. to use @code{TARGET_SECONDARY_MEMORY_NEEDED} for that purpose.\n\
  5052. \n\
  5053. @code{copy_cost} also uses this target hook to find out how values are\n\
  5054. copied. If you want it to include some extra cost for the need to allocate\n\
  5055. (a) scratch register(s), set @code{sri->extra_cost} to the additional cost.\n\
  5056. Or if two dependent moves are supposed to have a lower cost than the sum\n\
  5057. of the individual moves due to expected fortuitous scheduling and/or special\n\
  5058. forwarding logic, you can set @code{sri->extra_cost} to a negative amount.",
  5059. reg_class_t,
  5060. (bool in_p, rtx x, reg_class_t reload_class, machine_mode reload_mode,
  5061. secondary_reload_info *sri),
  5062. default_secondary_reload)
  5063. DEFHOOK
  5064. (secondary_memory_needed,
  5065. "Certain machines have the property that some registers cannot be copied\n\
  5066. to some other registers without using memory. Define this hook on\n\
  5067. those machines to return true if objects of mode @var{m} in registers\n\
  5068. of @var{class1} can only be copied to registers of class @var{class2} by\n\
  5069. storing a register of @var{class1} into memory and loading that memory\n\
  5070. location into a register of @var{class2}. The default definition returns\n\
  5071. false for all inputs.",
  5072. bool, (machine_mode mode, reg_class_t class1, reg_class_t class2),
  5073. hook_bool_mode_reg_class_t_reg_class_t_false)
  5074. DEFHOOK
  5075. (secondary_memory_needed_mode,
  5076. "If @code{TARGET_SECONDARY_MEMORY_NEEDED} tells the compiler to use memory\n\
  5077. when moving between two particular registers of mode @var{mode},\n\
  5078. this hook specifies the mode that the memory should have.\n\
  5079. \n\
  5080. The default depends on @code{TARGET_LRA_P}. Without LRA, the default\n\
  5081. is to use a word-sized mode for integral modes that are smaller than a\n\
  5082. a word. This is right thing to do on most machines because it ensures\n\
  5083. that all bits of the register are copied and prevents accesses to the\n\
  5084. registers in a narrower mode, which some machines prohibit for\n\
  5085. floating-point registers.\n\
  5086. \n\
  5087. However, this default behavior is not correct on some machines, such as\n\
  5088. the DEC Alpha, that store short integers in floating-point registers\n\
  5089. differently than in integer registers. On those machines, the default\n\
  5090. widening will not work correctly and you must define this hook to\n\
  5091. suppress that widening in some cases. See the file @file{alpha.c} for\n\
  5092. details.\n\
  5093. \n\
  5094. With LRA, the default is to use @var{mode} unmodified.",
  5095. machine_mode, (machine_mode mode),
  5096. default_secondary_memory_needed_mode)
  5097. /* Given an rtx X being reloaded into a reg required to be in class CLASS,
  5098. return the class of reg to actually use. */
  5099. DEFHOOK
  5100. (preferred_reload_class,
  5101. "A target hook that places additional restrictions on the register class\n\
  5102. to use when it is necessary to copy value @var{x} into a register in class\n\
  5103. @var{rclass}. The value is a register class; perhaps @var{rclass}, or perhaps\n\
  5104. another, smaller class.\n\
  5105. \n\
  5106. The default version of this hook always returns value of @code{rclass} argument.\n\
  5107. \n\
  5108. Sometimes returning a more restrictive class makes better code. For\n\
  5109. example, on the 68000, when @var{x} is an integer constant that is in range\n\
  5110. for a @samp{moveq} instruction, the value of this macro is always\n\
  5111. @code{DATA_REGS} as long as @var{rclass} includes the data registers.\n\
  5112. Requiring a data register guarantees that a @samp{moveq} will be used.\n\
  5113. \n\
  5114. One case where @code{TARGET_PREFERRED_RELOAD_CLASS} must not return\n\
  5115. @var{rclass} is if @var{x} is a legitimate constant which cannot be\n\
  5116. loaded into some register class. By returning @code{NO_REGS} you can\n\
  5117. force @var{x} into a memory location. For example, rs6000 can load\n\
  5118. immediate values into general-purpose registers, but does not have an\n\
  5119. instruction for loading an immediate value into a floating-point\n\
  5120. register, so @code{TARGET_PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when\n\
  5121. @var{x} is a floating-point constant. If the constant can't be loaded\n\
  5122. into any kind of register, code generation will be better if\n\
  5123. @code{TARGET_LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead\n\
  5124. of using @code{TARGET_PREFERRED_RELOAD_CLASS}.\n\
  5125. \n\
  5126. If an insn has pseudos in it after register allocation, reload will go\n\
  5127. through the alternatives and call repeatedly @code{TARGET_PREFERRED_RELOAD_CLASS}\n\
  5128. to find the best one. Returning @code{NO_REGS}, in this case, makes\n\
  5129. reload add a @code{!} in front of the constraint: the x86 back-end uses\n\
  5130. this feature to discourage usage of 387 registers when math is done in\n\
  5131. the SSE registers (and vice versa).",
  5132. reg_class_t,
  5133. (rtx x, reg_class_t rclass),
  5134. default_preferred_reload_class)
  5135. /* Like TARGET_PREFERRED_RELOAD_CLASS, but for output reloads instead of
  5136. input reloads. */
  5137. DEFHOOK
  5138. (preferred_output_reload_class,
  5139. "Like @code{TARGET_PREFERRED_RELOAD_CLASS}, but for output reloads instead of\n\
  5140. input reloads.\n\
  5141. \n\
  5142. The default version of this hook always returns value of @code{rclass}\n\
  5143. argument.\n\
  5144. \n\
  5145. You can also use @code{TARGET_PREFERRED_OUTPUT_RELOAD_CLASS} to discourage\n\
  5146. reload from using some alternatives, like @code{TARGET_PREFERRED_RELOAD_CLASS}.",
  5147. reg_class_t,
  5148. (rtx x, reg_class_t rclass),
  5149. default_preferred_output_reload_class)
  5150. DEFHOOK
  5151. (select_early_remat_modes,
  5152. "On some targets, certain modes cannot be held in registers around a\n\
  5153. standard ABI call and are relatively expensive to spill to the stack.\n\
  5154. The early rematerialization pass can help in such cases by aggressively\n\
  5155. recomputing values after calls, so that they don't need to be spilled.\n\
  5156. \n\
  5157. This hook returns the set of such modes by setting the associated bits\n\
  5158. in @var{modes}. The default implementation selects no modes, which has\n\
  5159. the effect of disabling the early rematerialization pass.",
  5160. void, (sbitmap modes),
  5161. default_select_early_remat_modes)
  5162. DEFHOOK
  5163. (class_likely_spilled_p,
  5164. "A target hook which returns @code{true} if pseudos that have been assigned\n\
  5165. to registers of class @var{rclass} would likely be spilled because\n\
  5166. registers of @var{rclass} are needed for spill registers.\n\
  5167. \n\
  5168. The default version of this target hook returns @code{true} if @var{rclass}\n\
  5169. has exactly one register and @code{false} otherwise. On most machines, this\n\
  5170. default should be used. For generally register-starved machines, such as\n\
  5171. i386, or machines with right register constraints, such as SH, this hook\n\
  5172. can be used to avoid excessive spilling.\n\
  5173. \n\
  5174. This hook is also used by some of the global intra-procedural code\n\
  5175. transformations to throtle code motion, to avoid increasing register\n\
  5176. pressure.",
  5177. bool, (reg_class_t rclass),
  5178. default_class_likely_spilled_p)
  5179. /* Return the maximum number of consecutive registers
  5180. needed to represent mode MODE in a register of class RCLASS. */
  5181. DEFHOOK
  5182. (class_max_nregs,
  5183. "A target hook returns the maximum number of consecutive registers\n\
  5184. of class @var{rclass} needed to hold a value of mode @var{mode}.\n\
  5185. \n\
  5186. This is closely related to the macro @code{TARGET_HARD_REGNO_NREGS}.\n\
  5187. In fact, the value returned by @code{TARGET_CLASS_MAX_NREGS (@var{rclass},\n\
  5188. @var{mode})} target hook should be the maximum value of\n\
  5189. @code{TARGET_HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}\n\
  5190. values in the class @var{rclass}.\n\
  5191. \n\
  5192. This target hook helps control the handling of multiple-word values\n\
  5193. in the reload pass.\n\
  5194. \n\
  5195. The default version of this target hook returns the size of @var{mode}\n\
  5196. in words.",
  5197. unsigned char, (reg_class_t rclass, machine_mode mode),
  5198. default_class_max_nregs)
  5199. DEFHOOK
  5200. (preferred_rename_class,
  5201. "A target hook that places additional preference on the register\
  5202. class to use when it is necessary to rename a register in class\
  5203. @var{rclass} to another class, or perhaps @var{NO_REGS}, if no\
  5204. preferred register class is found or hook @code{preferred_rename_class}\
  5205. is not implemented.\
  5206. Sometimes returning a more restrictive class makes better code. For\
  5207. example, on ARM, thumb-2 instructions using @code{LO_REGS} may be\
  5208. smaller than instructions using @code{GENERIC_REGS}. By returning\
  5209. @code{LO_REGS} from @code{preferred_rename_class}, code size can\
  5210. be reduced.",
  5211. reg_class_t, (reg_class_t rclass),
  5212. default_preferred_rename_class)
  5213. /* This target hook allows the backend to avoid unsafe substitution
  5214. during register allocation. */
  5215. DEFHOOK
  5216. (cannot_substitute_mem_equiv_p,
  5217. "A target hook which returns @code{true} if @var{subst} can't\n\
  5218. substitute safely pseudos with equivalent memory values during\n\
  5219. register allocation.\n\
  5220. The default version of this target hook returns @code{false}.\n\
  5221. On most machines, this default should be used. For generally\n\
  5222. machines with non orthogonal register usage for addressing, such\n\
  5223. as SH, this hook can be used to avoid excessive spilling.",
  5224. bool, (rtx subst),
  5225. hook_bool_rtx_false)
  5226. /* This target hook allows the backend to legitimize base plus
  5227. displacement addressing. */
  5228. DEFHOOK
  5229. (legitimize_address_displacement,
  5230. "This hook tries to split address offset @var{orig_offset} into\n\
  5231. two parts: one that should be added to the base address to create\n\
  5232. a local anchor point, and an additional offset that can be applied\n\
  5233. to the anchor to address a value of mode @var{mode}. The idea is that\n\
  5234. the local anchor could be shared by other accesses to nearby locations.\n\
  5235. \n\
  5236. The hook returns true if it succeeds, storing the offset of the\n\
  5237. anchor from the base in @var{offset1} and the offset of the final address\n\
  5238. from the anchor in @var{offset2}. The default implementation returns false.",
  5239. bool, (rtx *offset1, rtx *offset2, poly_int64 orig_offset, machine_mode mode),
  5240. default_legitimize_address_displacement)
  5241. /* This target hook allows the backend to perform additional
  5242. processing while initializing for variable expansion. */
  5243. DEFHOOK
  5244. (expand_to_rtl_hook,
  5245. "This hook is called just before expansion into rtl, allowing the target\n\
  5246. to perform additional initializations or analysis before the expansion.\n\
  5247. For example, the rs6000 port uses it to allocate a scratch stack slot\n\
  5248. for use in copying SDmode values between memory and floating point\n\
  5249. registers whenever the function being expanded has any SDmode\n\
  5250. usage.",
  5251. void, (void),
  5252. hook_void_void)
  5253. /* This target hook allows the backend to perform additional
  5254. instantiations on rtx that are not actually in insns yet,
  5255. but will be later. */
  5256. DEFHOOK
  5257. (instantiate_decls,
  5258. "This hook allows the backend to perform additional instantiations on rtl\n\
  5259. that are not actually in any insns yet, but will be later.",
  5260. void, (void),
  5261. hook_void_void)
  5262. DEFHOOK
  5263. (hard_regno_nregs,
  5264. "This hook returns the number of consecutive hard registers, starting\n\
  5265. at register number @var{regno}, required to hold a value of mode\n\
  5266. @var{mode}. This hook must never return zero, even if a register\n\
  5267. cannot hold the requested mode - indicate that with\n\
  5268. @code{TARGET_HARD_REGNO_MODE_OK} and/or\n\
  5269. @code{TARGET_CAN_CHANGE_MODE_CLASS} instead.\n\
  5270. \n\
  5271. The default definition returns the number of words in @var{mode}.",
  5272. unsigned int, (unsigned int regno, machine_mode mode),
  5273. default_hard_regno_nregs)
  5274. DEFHOOK
  5275. (hard_regno_mode_ok,
  5276. "This hook returns true if it is permissible to store a value\n\
  5277. of mode @var{mode} in hard register number @var{regno} (or in several\n\
  5278. registers starting with that one). The default definition returns true\n\
  5279. unconditionally.\n\
  5280. \n\
  5281. You need not include code to check for the numbers of fixed registers,\n\
  5282. because the allocation mechanism considers them to be always occupied.\n\
  5283. \n\
  5284. @cindex register pairs\n\
  5285. On some machines, double-precision values must be kept in even/odd\n\
  5286. register pairs. You can implement that by defining this hook to reject\n\
  5287. odd register numbers for such modes.\n\
  5288. \n\
  5289. The minimum requirement for a mode to be OK in a register is that the\n\
  5290. @samp{mov@var{mode}} instruction pattern support moves between the\n\
  5291. register and other hard register in the same class and that moving a\n\
  5292. value into the register and back out not alter it.\n\
  5293. \n\
  5294. Since the same instruction used to move @code{word_mode} will work for\n\
  5295. all narrower integer modes, it is not necessary on any machine for\n\
  5296. this hook to distinguish between these modes, provided you define\n\
  5297. patterns @samp{movhi}, etc., to take advantage of this. This is\n\
  5298. useful because of the interaction between @code{TARGET_HARD_REGNO_MODE_OK}\n\
  5299. and @code{TARGET_MODES_TIEABLE_P}; it is very desirable for all integer\n\
  5300. modes to be tieable.\n\
  5301. \n\
  5302. Many machines have special registers for floating point arithmetic.\n\
  5303. Often people assume that floating point machine modes are allowed only\n\
  5304. in floating point registers. This is not true. Any registers that\n\
  5305. can hold integers can safely @emph{hold} a floating point machine\n\
  5306. mode, whether or not floating arithmetic can be done on it in those\n\
  5307. registers. Integer move instructions can be used to move the values.\n\
  5308. \n\
  5309. On some machines, though, the converse is true: fixed-point machine\n\
  5310. modes may not go in floating registers. This is true if the floating\n\
  5311. registers normalize any value stored in them, because storing a\n\
  5312. non-floating value there would garble it. In this case,\n\
  5313. @code{TARGET_HARD_REGNO_MODE_OK} should reject fixed-point machine modes in\n\
  5314. floating registers. But if the floating registers do not automatically\n\
  5315. normalize, if you can store any bit pattern in one and retrieve it\n\
  5316. unchanged without a trap, then any machine mode may go in a floating\n\
  5317. register, so you can define this hook to say so.\n\
  5318. \n\
  5319. The primary significance of special floating registers is rather that\n\
  5320. they are the registers acceptable in floating point arithmetic\n\
  5321. instructions. However, this is of no concern to\n\
  5322. @code{TARGET_HARD_REGNO_MODE_OK}. You handle it by writing the proper\n\
  5323. constraints for those instructions.\n\
  5324. \n\
  5325. On some machines, the floating registers are especially slow to access,\n\
  5326. so that it is better to store a value in a stack frame than in such a\n\
  5327. register if floating point arithmetic is not being done. As long as the\n\
  5328. floating registers are not in class @code{GENERAL_REGS}, they will not\n\
  5329. be used unless some pattern's constraint asks for one.",
  5330. bool, (unsigned int regno, machine_mode mode),
  5331. hook_bool_uint_mode_true)
  5332. DEFHOOK
  5333. (modes_tieable_p,
  5334. "This hook returns true if a value of mode @var{mode1} is accessible\n\
  5335. in mode @var{mode2} without copying.\n\
  5336. \n\
  5337. If @code{TARGET_HARD_REGNO_MODE_OK (@var{r}, @var{mode1})} and\n\
  5338. @code{TARGET_HARD_REGNO_MODE_OK (@var{r}, @var{mode2})} are always\n\
  5339. the same for any @var{r}, then\n\
  5340. @code{TARGET_MODES_TIEABLE_P (@var{mode1}, @var{mode2})}\n\
  5341. should be true. If they differ for any @var{r}, you should define\n\
  5342. this hook to return false unless some other mechanism ensures the\n\
  5343. accessibility of the value in a narrower mode.\n\
  5344. \n\
  5345. You should define this hook to return true in as many cases as\n\
  5346. possible since doing so will allow GCC to perform better register\n\
  5347. allocation. The default definition returns true unconditionally.",
  5348. bool, (machine_mode mode1, machine_mode mode2),
  5349. hook_bool_mode_mode_true)
  5350. /* Return true if is OK to use a hard register REGNO as scratch register
  5351. in peephole2. */
  5352. DEFHOOK
  5353. (hard_regno_scratch_ok,
  5354. "This target hook should return @code{true} if it is OK to use a hard register\n\
  5355. @var{regno} as scratch reg in peephole2.\n\
  5356. \n\
  5357. One common use of this macro is to prevent using of a register that\n\
  5358. is not saved by a prologue in an interrupt handler.\n\
  5359. \n\
  5360. The default version of this hook always returns @code{true}.",
  5361. bool, (unsigned int regno),
  5362. default_hard_regno_scratch_ok)
  5363. DEFHOOK
  5364. (hard_regno_call_part_clobbered,
  5365. "This hook should return true if @var{regno} is partly call-saved and\n\
  5366. partly call-clobbered, and if a value of mode @var{mode} would be partly\n\
  5367. clobbered by call instruction @var{insn}. If @var{insn} is NULL then it\n\
  5368. should return true if any call could partly clobber the register.\n\
  5369. For example, if the low 32 bits of @var{regno} are preserved across a call\n\
  5370. but higher bits are clobbered, this hook should return true for a 64-bit\n\
  5371. mode but false for a 32-bit mode.\n\
  5372. \n\
  5373. The default implementation returns false, which is correct\n\
  5374. for targets that don't have partly call-clobbered registers.",
  5375. bool, (rtx_insn *insn, unsigned int regno, machine_mode mode),
  5376. hook_bool_insn_uint_mode_false)
  5377. DEFHOOK
  5378. (return_call_with_max_clobbers,
  5379. "This hook returns a pointer to the call that partially clobbers the\n\
  5380. most registers. If a platform supports multiple ABIs where the registers\n\
  5381. that are partially clobbered may vary, this function compares two\n\
  5382. calls and returns a pointer to the one that clobbers the most registers.\n\
  5383. If both calls clobber the same registers, @var{call_1} must be returned.\n\
  5384. \n\
  5385. The registers clobbered in different ABIs must be a proper subset or\n\
  5386. superset of all other ABIs. @var{call_1} must always be a call insn,\n\
  5387. call_2 may be NULL or a call insn.",
  5388. rtx_insn *, (rtx_insn *call_1, rtx_insn *call_2),
  5389. NULL)
  5390. DEFHOOK
  5391. (get_multilib_abi_name,
  5392. "This hook returns name of multilib ABI name.",
  5393. const char *, (void),
  5394. hook_constcharptr_void_null)
  5395. DEFHOOK
  5396. (remove_extra_call_preserved_regs,
  5397. "This hook removes registers from the set of call-clobbered registers\n\
  5398. in @var{used_regs} if, contrary to the default rules, something guarantees\n\
  5399. that @samp{insn} preserves those registers. For example, some targets\n\
  5400. support variant ABIs in which functions preserve more registers than\n\
  5401. normal functions would. Removing those extra registers from @var{used_regs}\n\
  5402. can lead to better register allocation.\n\
  5403. \n\
  5404. The default implementation does nothing, which is always safe.\n\
  5405. Defining the hook is purely an optimization.",
  5406. void, (rtx_insn *insn, HARD_REG_SET *used_regs),
  5407. default_remove_extra_call_preserved_regs)
  5408. /* Return the smallest number of different values for which it is best to
  5409. use a jump-table instead of a tree of conditional branches. */
  5410. DEFHOOK
  5411. (case_values_threshold,
  5412. "This function return the smallest number of different values for which it\n\
  5413. is best to use a jump-table instead of a tree of conditional branches.\n\
  5414. The default is four for machines with a @code{casesi} instruction and\n\
  5415. five otherwise. This is best for most machines.",
  5416. unsigned int, (void),
  5417. default_case_values_threshold)
  5418. DEFHOOK
  5419. (starting_frame_offset,
  5420. "This hook returns the offset from the frame pointer to the first local\n\
  5421. variable slot to be allocated. If @code{FRAME_GROWS_DOWNWARD}, it is the\n\
  5422. offset to @emph{end} of the first slot allocated, otherwise it is the\n\
  5423. offset to @emph{beginning} of the first slot allocated. The default\n\
  5424. implementation returns 0.",
  5425. HOST_WIDE_INT, (void),
  5426. hook_hwi_void_0)
  5427. /* Optional callback to advise the target to compute the frame layout. */
  5428. DEFHOOK
  5429. (compute_frame_layout,
  5430. "This target hook is called once each time the frame layout needs to be\n\
  5431. recalculated. The calculations can be cached by the target and can then\n\
  5432. be used by @code{INITIAL_ELIMINATION_OFFSET} instead of re-computing the\n\
  5433. layout on every invocation of that hook. This is particularly useful\n\
  5434. for targets that have an expensive frame layout function. Implementing\n\
  5435. this callback is optional.",
  5436. void, (void),
  5437. hook_void_void)
  5438. /* Return true if a function must have and use a frame pointer. */
  5439. DEFHOOK
  5440. (frame_pointer_required,
  5441. "This target hook should return @code{true} if a function must have and use\n\
  5442. a frame pointer. This target hook is called in the reload pass. If its return\n\
  5443. value is @code{true} the function will have a frame pointer.\n\
  5444. \n\
  5445. This target hook can in principle examine the current function and decide\n\
  5446. according to the facts, but on most machines the constant @code{false} or the\n\
  5447. constant @code{true} suffices. Use @code{false} when the machine allows code\n\
  5448. to be generated with no frame pointer, and doing so saves some time or space.\n\
  5449. Use @code{true} when there is no possible advantage to avoiding a frame\n\
  5450. pointer.\n\
  5451. \n\
  5452. In certain cases, the compiler does not know how to produce valid code\n\
  5453. without a frame pointer. The compiler recognizes those cases and\n\
  5454. automatically gives the function a frame pointer regardless of what\n\
  5455. @code{targetm.frame_pointer_required} returns. You don't need to worry about\n\
  5456. them.\n\
  5457. \n\
  5458. In a function that does not require a frame pointer, the frame pointer\n\
  5459. register can be allocated for ordinary usage, unless you mark it as a\n\
  5460. fixed register. See @code{FIXED_REGISTERS} for more information.\n\
  5461. \n\
  5462. Default return value is @code{false}.",
  5463. bool, (void),
  5464. hook_bool_void_false)
  5465. /* Returns true if the compiler is allowed to try to replace register number
  5466. from-reg with register number to-reg. */
  5467. DEFHOOK
  5468. (can_eliminate,
  5469. "This target hook should return @code{true} if the compiler is allowed to\n\
  5470. try to replace register number @var{from_reg} with register number\n\
  5471. @var{to_reg}. This target hook will usually be @code{true}, since most of the\n\
  5472. cases preventing register elimination are things that the compiler already\n\
  5473. knows about.\n\
  5474. \n\
  5475. Default return value is @code{true}.",
  5476. bool, (const int from_reg, const int to_reg),
  5477. hook_bool_const_int_const_int_true)
  5478. /* Modify any or all of fixed_regs, call_used_regs, global_regs,
  5479. reg_names, and reg_class_contents to account of the vagaries of the
  5480. target. */
  5481. DEFHOOK
  5482. (conditional_register_usage,
  5483. "This hook may conditionally modify five variables\n\
  5484. @code{fixed_regs}, @code{call_used_regs}, @code{global_regs},\n\
  5485. @code{reg_names}, and @code{reg_class_contents}, to take into account\n\
  5486. any dependence of these register sets on target flags. The first three\n\
  5487. of these are of type @code{char []} (interpreted as boolean vectors).\n\
  5488. @code{global_regs} is a @code{const char *[]}, and\n\
  5489. @code{reg_class_contents} is a @code{HARD_REG_SET}. Before the macro is\n\
  5490. called, @code{fixed_regs}, @code{call_used_regs},\n\
  5491. @code{reg_class_contents}, and @code{reg_names} have been initialized\n\
  5492. from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},\n\
  5493. @code{REG_CLASS_CONTENTS}, and @code{REGISTER_NAMES}, respectively.\n\
  5494. @code{global_regs} has been cleared, and any @option{-ffixed-@var{reg}},\n\
  5495. @option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}\n\
  5496. command options have been applied.\n\
  5497. \n\
  5498. @cindex disabling certain registers\n\
  5499. @cindex controlling register usage\n\
  5500. If the usage of an entire class of registers depends on the target\n\
  5501. flags, you may indicate this to GCC by using this macro to modify\n\
  5502. @code{fixed_regs} and @code{call_used_regs} to 1 for each of the\n\
  5503. registers in the classes which should not be used by GCC@. Also make\n\
  5504. @code{define_register_constraint}s return @code{NO_REGS} for constraints\n\
  5505. that shouldn't be used.\n\
  5506. \n\
  5507. (However, if this class is not included in @code{GENERAL_REGS} and all\n\
  5508. of the insn patterns whose constraints permit this class are\n\
  5509. controlled by target switches, then GCC will automatically avoid using\n\
  5510. these registers when the target switches are opposed to them.)",
  5511. void, (void),
  5512. hook_void_void)
  5513. DEFHOOK
  5514. (stack_clash_protection_alloca_probe_range,
  5515. "Some targets have an ABI defined interval for which no probing needs to be done.\n\
  5516. When a probe does need to be done this same interval is used as the probe distance \
  5517. up when doing stack clash protection for alloca.\n\
  5518. On such targets this value can be set to override the default probing up interval.\n\
  5519. Define this variable to return nonzero if such a probe range is required or zero otherwise. \
  5520. Defining this hook also requires your functions which make use of alloca to have at least 8 byes\
  5521. of outgoing arguments. If this is not the case the stack will be corrupted.\n\
  5522. You need not define this macro if it would always have the value zero.",
  5523. HOST_WIDE_INT, (void),
  5524. default_stack_clash_protection_alloca_probe_range)
  5525. /* Functions specific to the C family of frontends. */
  5526. #undef HOOK_PREFIX
  5527. #define HOOK_PREFIX "TARGET_C_"
  5528. HOOK_VECTOR (TARGET_C, c)
  5529. /* ??? Documenting this hook requires a GFDL license grant. */
  5530. DEFHOOK_UNDOC
  5531. (mode_for_suffix,
  5532. "Return machine mode for non-standard constant literal suffix @var{c},\
  5533. or VOIDmode if non-standard suffixes are unsupported.",
  5534. machine_mode, (char c),
  5535. default_mode_for_suffix)
  5536. DEFHOOK
  5537. (excess_precision,
  5538. "Return a value, with the same meaning as the C99 macro\
  5539. @code{FLT_EVAL_METHOD} that describes which excess precision should be\
  5540. applied. @var{type} is either @code{EXCESS_PRECISION_TYPE_IMPLICIT},\
  5541. @code{EXCESS_PRECISION_TYPE_FAST}, or\
  5542. @code{EXCESS_PRECISION_TYPE_STANDARD}. For\
  5543. @code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which\
  5544. precision and range operations will be implictly evaluated in regardless\
  5545. of the excess precision explicitly added. For\
  5546. @code{EXCESS_PRECISION_TYPE_STANDARD} and\
  5547. @code{EXCESS_PRECISION_TYPE_FAST}, the target should return the\
  5548. explicit excess precision that should be added depending on the\
  5549. value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}.\
  5550. Note that unpredictable explicit excess precision does not make sense,\
  5551. so a target should never return @code{FLT_EVAL_METHOD_UNPREDICTABLE}\
  5552. when @var{type} is @code{EXCESS_PRECISION_TYPE_STANDARD} or\
  5553. @code{EXCESS_PRECISION_TYPE_FAST}.",
  5554. enum flt_eval_method, (enum excess_precision_type type),
  5555. default_excess_precision)
  5556. HOOK_VECTOR_END (c)
  5557. /* Functions specific to the C++ frontend. */
  5558. #undef HOOK_PREFIX
  5559. #define HOOK_PREFIX "TARGET_CXX_"
  5560. HOOK_VECTOR (TARGET_CXX, cxx)
  5561. /* Return the integer type used for guard variables. */
  5562. DEFHOOK
  5563. (guard_type,
  5564. "Define this hook to override the integer type used for guard variables.\n\
  5565. These are used to implement one-time construction of static objects. The\n\
  5566. default is long_long_integer_type_node.",
  5567. tree, (void),
  5568. default_cxx_guard_type)
  5569. /* Return true if only the low bit of the guard should be tested. */
  5570. DEFHOOK
  5571. (guard_mask_bit,
  5572. "This hook determines how guard variables are used. It should return\n\
  5573. @code{false} (the default) if the first byte should be used. A return value of\n\
  5574. @code{true} indicates that only the least significant bit should be used.",
  5575. bool, (void),
  5576. hook_bool_void_false)
  5577. /* Returns the size of the array cookie for an array of type. */
  5578. DEFHOOK
  5579. (get_cookie_size,
  5580. "This hook returns the size of the cookie to use when allocating an array\n\
  5581. whose elements have the indicated @var{type}. Assumes that it is already\n\
  5582. known that a cookie is needed. The default is\n\
  5583. @code{max(sizeof (size_t), alignof(type))}, as defined in section 2.7 of the\n\
  5584. IA64/Generic C++ ABI@.",
  5585. tree, (tree type),
  5586. default_cxx_get_cookie_size)
  5587. /* Returns true if the element size should be stored in the array cookie. */
  5588. DEFHOOK
  5589. (cookie_has_size,
  5590. "This hook should return @code{true} if the element size should be stored in\n\
  5591. array cookies. The default is to return @code{false}.",
  5592. bool, (void),
  5593. hook_bool_void_false)
  5594. /* Allows backends to perform additional processing when
  5595. deciding if a class should be exported or imported. */
  5596. DEFHOOK
  5597. (import_export_class,
  5598. "If defined by a backend this hook allows the decision made to export\n\
  5599. class @var{type} to be overruled. Upon entry @var{import_export}\n\
  5600. will contain 1 if the class is going to be exported, @minus{}1 if it is going\n\
  5601. to be imported and 0 otherwise. This function should return the\n\
  5602. modified value and perform any other actions necessary to support the\n\
  5603. backend's targeted operating system.",
  5604. int, (tree type, int import_export), NULL)
  5605. /* Returns true if constructors and destructors return "this". */
  5606. DEFHOOK
  5607. (cdtor_returns_this,
  5608. "This hook should return @code{true} if constructors and destructors return\n\
  5609. the address of the object created/destroyed. The default is to return\n\
  5610. @code{false}.",
  5611. bool, (void),
  5612. hook_bool_void_false)
  5613. /* Returns true if the key method for a class can be an inline
  5614. function, so long as it is not declared inline in the class
  5615. itself. Returning true is the behavior required by the Itanium C++ ABI. */
  5616. DEFHOOK
  5617. (key_method_may_be_inline,
  5618. "This hook returns true if the key method for a class (i.e., the method\n\
  5619. which, if defined in the current translation unit, causes the virtual\n\
  5620. table to be emitted) may be an inline function. Under the standard\n\
  5621. Itanium C++ ABI the key method may be an inline function so long as\n\
  5622. the function is not declared inline in the class definition. Under\n\
  5623. some variants of the ABI, an inline function can never be the key\n\
  5624. method. The default is to return @code{true}.",
  5625. bool, (void),
  5626. hook_bool_void_true)
  5627. DEFHOOK
  5628. (determine_class_data_visibility,
  5629. "@var{decl} is a virtual table, virtual table table, typeinfo object,\
  5630. or other similar implicit class data object that will be emitted with\
  5631. external linkage in this translation unit. No ELF visibility has been\
  5632. explicitly specified. If the target needs to specify a visibility\
  5633. other than that of the containing class, use this hook to set\
  5634. @code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}.",
  5635. void, (tree decl),
  5636. hook_void_tree)
  5637. /* Returns true (the default) if virtual tables and other
  5638. similar implicit class data objects are always COMDAT if they
  5639. have external linkage. If this hook returns false, then
  5640. class data for classes whose virtual table will be emitted in
  5641. only one translation unit will not be COMDAT. */
  5642. DEFHOOK
  5643. (class_data_always_comdat,
  5644. "This hook returns true (the default) if virtual tables and other\n\
  5645. similar implicit class data objects are always COMDAT if they have\n\
  5646. external linkage. If this hook returns false, then class data for\n\
  5647. classes whose virtual table will be emitted in only one translation\n\
  5648. unit will not be COMDAT.",
  5649. bool, (void),
  5650. hook_bool_void_true)
  5651. /* Returns true (the default) if the RTTI for the basic types,
  5652. which is always defined in the C++ runtime, should be COMDAT;
  5653. false if it should not be COMDAT. */
  5654. DEFHOOK
  5655. (library_rtti_comdat,
  5656. "This hook returns true (the default) if the RTTI information for\n\
  5657. the basic types which is defined in the C++ runtime should always\n\
  5658. be COMDAT, false if it should not be COMDAT.",
  5659. bool, (void),
  5660. hook_bool_void_true)
  5661. /* Returns true if __aeabi_atexit should be used to register static
  5662. destructors. */
  5663. DEFHOOK
  5664. (use_aeabi_atexit,
  5665. "This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI)\n\
  5666. should be used to register static destructors when @option{-fuse-cxa-atexit}\n\
  5667. is in effect. The default is to return false to use @code{__cxa_atexit}.",
  5668. bool, (void),
  5669. hook_bool_void_false)
  5670. /* Returns true if target may use atexit in the same manner as
  5671. __cxa_atexit to register static destructors. */
  5672. DEFHOOK
  5673. (use_atexit_for_cxa_atexit,
  5674. "This hook returns true if the target @code{atexit} function can be used\n\
  5675. in the same manner as @code{__cxa_atexit} to register C++ static\n\
  5676. destructors. This requires that @code{atexit}-registered functions in\n\
  5677. shared libraries are run in the correct order when the libraries are\n\
  5678. unloaded. The default is to return false.",
  5679. bool, (void),
  5680. hook_bool_void_false)
  5681. DEFHOOK
  5682. (adjust_class_at_definition,
  5683. "@var{type} is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just\
  5684. been defined. Use this hook to make adjustments to the class (eg, tweak\
  5685. visibility or perform any other required target modifications).",
  5686. void, (tree type),
  5687. hook_void_tree)
  5688. DEFHOOK
  5689. (decl_mangling_context,
  5690. "Return target-specific mangling context of @var{decl} or @code{NULL_TREE}.",
  5691. tree, (const_tree decl),
  5692. hook_tree_const_tree_null)
  5693. HOOK_VECTOR_END (cxx)
  5694. /* Functions and data for emulated TLS support. */
  5695. #undef HOOK_PREFIX
  5696. #define HOOK_PREFIX "TARGET_EMUTLS_"
  5697. HOOK_VECTOR (TARGET_EMUTLS, emutls)
  5698. /* Name of the address and common functions. */
  5699. DEFHOOKPOD
  5700. (get_address,
  5701. "Contains the name of the helper function that uses a TLS control\n\
  5702. object to locate a TLS instance. The default causes libgcc's\n\
  5703. emulated TLS helper function to be used.",
  5704. const char *, "__builtin___emutls_get_address")
  5705. DEFHOOKPOD
  5706. (register_common,
  5707. "Contains the name of the helper function that should be used at\n\
  5708. program startup to register TLS objects that are implicitly\n\
  5709. initialized to zero. If this is @code{NULL}, all TLS objects will\n\
  5710. have explicit initializers. The default causes libgcc's emulated TLS\n\
  5711. registration function to be used.",
  5712. const char *, "__builtin___emutls_register_common")
  5713. /* Prefixes for proxy variable and template. */
  5714. DEFHOOKPOD
  5715. (var_section,
  5716. "Contains the name of the section in which TLS control variables should\n\
  5717. be placed. The default of @code{NULL} allows these to be placed in\n\
  5718. any section.",
  5719. const char *, NULL)
  5720. DEFHOOKPOD
  5721. (tmpl_section,
  5722. "Contains the name of the section in which TLS initializers should be\n\
  5723. placed. The default of @code{NULL} allows these to be placed in any\n\
  5724. section.",
  5725. const char *, NULL)
  5726. /* Prefixes for proxy variable and template. */
  5727. DEFHOOKPOD
  5728. (var_prefix,
  5729. "Contains the prefix to be prepended to TLS control variable names.\n\
  5730. The default of @code{NULL} uses a target-specific prefix.",
  5731. const char *, NULL)
  5732. DEFHOOKPOD
  5733. (tmpl_prefix,
  5734. "Contains the prefix to be prepended to TLS initializer objects. The\n\
  5735. default of @code{NULL} uses a target-specific prefix.",
  5736. const char *, NULL)
  5737. /* Function to generate field definitions of the proxy variable. */
  5738. DEFHOOK
  5739. (var_fields,
  5740. "Specifies a function that generates the FIELD_DECLs for a TLS control\n\
  5741. object type. @var{type} is the RECORD_TYPE the fields are for and\n\
  5742. @var{name} should be filled with the structure tag, if the default of\n\
  5743. @code{__emutls_object} is unsuitable. The default creates a type suitable\n\
  5744. for libgcc's emulated TLS function.",
  5745. tree, (tree type, tree *name),
  5746. default_emutls_var_fields)
  5747. /* Function to initialize a proxy variable. */
  5748. DEFHOOK
  5749. (var_init,
  5750. "Specifies a function that generates the CONSTRUCTOR to initialize a\n\
  5751. TLS control object. @var{var} is the TLS control object, @var{decl}\n\
  5752. is the TLS object and @var{tmpl_addr} is the address of the\n\
  5753. initializer. The default initializes libgcc's emulated TLS control object.",
  5754. tree, (tree var, tree decl, tree tmpl_addr),
  5755. default_emutls_var_init)
  5756. /* Whether we are allowed to alter the usual alignment of the
  5757. proxy variable. */
  5758. DEFHOOKPOD
  5759. (var_align_fixed,
  5760. "Specifies whether the alignment of TLS control variable objects is\n\
  5761. fixed and should not be increased as some backends may do to optimize\n\
  5762. single objects. The default is false.",
  5763. bool, false)
  5764. /* Whether we can emit debug information for TLS vars. */
  5765. DEFHOOKPOD
  5766. (debug_form_tls_address,
  5767. "Specifies whether a DWARF @code{DW_OP_form_tls_address} location descriptor\n\
  5768. may be used to describe emulated TLS control objects.",
  5769. bool, false)
  5770. HOOK_VECTOR_END (emutls)
  5771. #undef HOOK_PREFIX
  5772. #define HOOK_PREFIX "TARGET_OPTION_"
  5773. HOOK_VECTOR (TARGET_OPTION_HOOKS, target_option_hooks)
  5774. /* Function to validate the attribute((target(...))) strings. If
  5775. the option is validated, the hook should also fill in
  5776. DECL_FUNCTION_SPECIFIC_TARGET in the function decl node. */
  5777. DEFHOOK
  5778. (valid_attribute_p,
  5779. "This hook is called to parse @code{attribute(target(\"...\"))}, which\n\
  5780. allows setting target-specific options on individual functions.\n\
  5781. These function-specific options may differ\n\
  5782. from the options specified on the command line. The hook should return\n\
  5783. @code{true} if the options are valid.\n\
  5784. \n\
  5785. The hook should set the @code{DECL_FUNCTION_SPECIFIC_TARGET} field in\n\
  5786. the function declaration to hold a pointer to a target-specific\n\
  5787. @code{struct cl_target_option} structure.",
  5788. bool, (tree fndecl, tree name, tree args, int flags),
  5789. default_target_option_valid_attribute_p)
  5790. /* Function to save any extra target state in the target options structure. */
  5791. DEFHOOK
  5792. (save,
  5793. "This hook is called to save any additional target-specific information\n\
  5794. in the @code{struct cl_target_option} structure for function-specific\n\
  5795. options from the @code{struct gcc_options} structure.\n\
  5796. @xref{Option file format}.",
  5797. void, (struct cl_target_option *ptr, struct gcc_options *opts), NULL)
  5798. /* Function to restore any extra target state from the target options
  5799. structure. */
  5800. DEFHOOK
  5801. (restore,
  5802. "This hook is called to restore any additional target-specific\n\
  5803. information in the @code{struct cl_target_option} structure for\n\
  5804. function-specific options to the @code{struct gcc_options} structure.",
  5805. void, (struct gcc_options *opts, struct cl_target_option *ptr), NULL)
  5806. /* Function to update target-specific option information after being
  5807. streamed in. */
  5808. DEFHOOK
  5809. (post_stream_in,
  5810. "This hook is called to update target-specific information in the\n\
  5811. @code{struct cl_target_option} structure after it is streamed in from\n\
  5812. LTO bytecode.",
  5813. void, (struct cl_target_option *ptr), NULL)
  5814. /* Function to print any extra target state from the target options
  5815. structure. */
  5816. DEFHOOK
  5817. (print,
  5818. "This hook is called to print any additional target-specific\n\
  5819. information in the @code{struct cl_target_option} structure for\n\
  5820. function-specific options.",
  5821. void, (FILE *file, int indent, struct cl_target_option *ptr), NULL)
  5822. /* Function to parse arguments to be validated for #pragma target, and to
  5823. change the state if the options are valid. If the first argument is
  5824. NULL, the second argument specifies the default options to use. Return
  5825. true if the options are valid, and set the current state. */
  5826. DEFHOOK
  5827. (pragma_parse,
  5828. "This target hook parses the options for @code{#pragma GCC target}, which\n\
  5829. sets the target-specific options for functions that occur later in the\n\
  5830. input stream. The options accepted should be the same as those handled by the\n\
  5831. @code{TARGET_OPTION_VALID_ATTRIBUTE_P} hook.",
  5832. bool, (tree args, tree pop_target),
  5833. default_target_option_pragma_parse)
  5834. /* Do option overrides for the target. */
  5835. DEFHOOK
  5836. (override,
  5837. "Sometimes certain combinations of command options do not make sense on\n\
  5838. a particular target machine. You can override the hook\n\
  5839. @code{TARGET_OPTION_OVERRIDE} to take account of this. This hooks is called\n\
  5840. once just after all the command options have been parsed.\n\
  5841. \n\
  5842. Don't use this hook to turn on various extra optimizations for\n\
  5843. @option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for.\n\
  5844. \n\
  5845. If you need to do something whenever the optimization level is\n\
  5846. changed via the optimize attribute or pragma, see\n\
  5847. @code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}",
  5848. void, (void),
  5849. hook_void_void)
  5850. /* This function returns true if DECL1 and DECL2 are versions of the same
  5851. function. DECL1 and DECL2 are function versions if and only if they
  5852. have the same function signature and different target specific attributes,
  5853. that is, they are compiled for different target machines. */
  5854. DEFHOOK
  5855. (function_versions,
  5856. "This target hook returns @code{true} if @var{DECL1} and @var{DECL2} are\n\
  5857. versions of the same function. @var{DECL1} and @var{DECL2} are function\n\
  5858. versions if and only if they have the same function signature and\n\
  5859. different target specific attributes, that is, they are compiled for\n\
  5860. different target machines.",
  5861. bool, (tree decl1, tree decl2),
  5862. hook_bool_tree_tree_false)
  5863. /* Function to determine if one function can inline another function. */
  5864. #undef HOOK_PREFIX
  5865. #define HOOK_PREFIX "TARGET_"
  5866. DEFHOOK
  5867. (can_inline_p,
  5868. "This target hook returns @code{false} if the @var{caller} function\n\
  5869. cannot inline @var{callee}, based on target specific information. By\n\
  5870. default, inlining is not allowed if the callee function has function\n\
  5871. specific target options and the caller does not use the same options.",
  5872. bool, (tree caller, tree callee),
  5873. default_target_can_inline_p)
  5874. DEFHOOK
  5875. (relayout_function,
  5876. "This target hook fixes function @var{fndecl} after attributes are processed. Default does nothing. On ARM, the default function's alignment is updated with the attribute target.",
  5877. void, (tree fndecl),
  5878. hook_void_tree)
  5879. HOOK_VECTOR_END (target_option)
  5880. /* For targets that need to mark extra registers as live on entry to
  5881. the function, they should define this target hook and set their
  5882. bits in the bitmap passed in. */
  5883. DEFHOOK
  5884. (extra_live_on_entry,
  5885. "Add any hard registers to @var{regs} that are live on entry to the\n\
  5886. function. This hook only needs to be defined to provide registers that\n\
  5887. cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved\n\
  5888. registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM,\n\
  5889. TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,\n\
  5890. FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.",
  5891. void, (bitmap regs),
  5892. hook_void_bitmap)
  5893. /* Targets should define this target hook to mark that non-callee clobbers are
  5894. present in CALL_INSN_FUNCTION_USAGE for all the calls that bind to a local
  5895. definition. */
  5896. DEFHOOKPOD
  5897. (call_fusage_contains_non_callee_clobbers,
  5898. "Set to true if each call that binds to a local definition explicitly\n\
  5899. clobbers or sets all non-fixed registers modified by performing the call.\n\
  5900. That is, by the call pattern itself, or by code that might be inserted by the\n\
  5901. linker (e.g.@: stubs, veneers, branch islands), but not including those\n\
  5902. modifiable by the callee. The affected registers may be mentioned explicitly\n\
  5903. in the call pattern, or included as clobbers in CALL_INSN_FUNCTION_USAGE.\n\
  5904. The default version of this hook is set to false. The purpose of this hook\n\
  5905. is to enable the fipa-ra optimization.",
  5906. bool,
  5907. false)
  5908. /* Fill in additional registers set up by prologue into a regset. */
  5909. DEFHOOK
  5910. (set_up_by_prologue,
  5911. "This hook should add additional registers that are computed by the prologue\
  5912. to the hard regset for shrink-wrapping optimization purposes.",
  5913. void, (struct hard_reg_set_container *),
  5914. NULL)
  5915. /* For targets that have attributes that can affect whether a
  5916. function's return statements need checking. For instance a 'naked'
  5917. function attribute. */
  5918. DEFHOOK
  5919. (warn_func_return,
  5920. "True if a function's return statements should be checked for matching the function's return type. This includes checking for falling off the end of a non-void function. Return false if no such check should be made.",
  5921. bool, (tree),
  5922. hook_bool_tree_true)
  5923. #undef HOOK_PREFIX
  5924. #define HOOK_PREFIX "TARGET_SHRINK_WRAP_"
  5925. HOOK_VECTOR (TARGET_SHRINK_WRAP_HOOKS, shrink_wrap)
  5926. DEFHOOK
  5927. (get_separate_components,
  5928. "This hook should return an @code{sbitmap} with the bits set for those\n\
  5929. components that can be separately shrink-wrapped in the current function.\n\
  5930. Return @code{NULL} if the current function should not get any separate\n\
  5931. shrink-wrapping.\n\
  5932. Don't define this hook if it would always return @code{NULL}.\n\
  5933. If it is defined, the other hooks in this group have to be defined as well.",
  5934. sbitmap, (void),
  5935. NULL)
  5936. DEFHOOK
  5937. (components_for_bb,
  5938. "This hook should return an @code{sbitmap} with the bits set for those\n\
  5939. components where either the prologue component has to be executed before\n\
  5940. the @code{basic_block}, or the epilogue component after it, or both.",
  5941. sbitmap, (basic_block),
  5942. NULL)
  5943. DEFHOOK
  5944. (disqualify_components,
  5945. "This hook should clear the bits in the @var{components} bitmap for those\n\
  5946. components in @var{edge_components} that the target cannot handle on edge\n\
  5947. @var{e}, where @var{is_prologue} says if this is for a prologue or an\n\
  5948. epilogue instead.",
  5949. void, (sbitmap components, edge e, sbitmap edge_components, bool is_prologue),
  5950. NULL)
  5951. DEFHOOK
  5952. (emit_prologue_components,
  5953. "Emit prologue insns for the components indicated by the parameter.",
  5954. void, (sbitmap),
  5955. NULL)
  5956. DEFHOOK
  5957. (emit_epilogue_components,
  5958. "Emit epilogue insns for the components indicated by the parameter.",
  5959. void, (sbitmap),
  5960. NULL)
  5961. DEFHOOK
  5962. (set_handled_components,
  5963. "Mark the components in the parameter as handled, so that the\n\
  5964. @code{prologue} and @code{epilogue} named patterns know to ignore those\n\
  5965. components. The target code should not hang on to the @code{sbitmap}, it\n\
  5966. will be deleted after this call.",
  5967. void, (sbitmap),
  5968. NULL)
  5969. HOOK_VECTOR_END (shrink_wrap)
  5970. #undef HOOK_PREFIX
  5971. #define HOOK_PREFIX "TARGET_"
  5972. /* Determine the type of unwind info to emit for debugging. */
  5973. DEFHOOK
  5974. (debug_unwind_info,
  5975. "This hook defines the mechanism that will be used for describing frame\n\
  5976. unwind information to the debugger. Normally the hook will return\n\
  5977. @code{UI_DWARF2} if DWARF 2 debug information is enabled, and\n\
  5978. return @code{UI_NONE} otherwise.\n\
  5979. \n\
  5980. A target may return @code{UI_DWARF2} even when DWARF 2 debug information\n\
  5981. is disabled in order to always output DWARF 2 frame information.\n\
  5982. \n\
  5983. A target may return @code{UI_TARGET} if it has ABI specified unwind tables.\n\
  5984. This will suppress generation of the normal debug frame unwind information.",
  5985. enum unwind_info_type, (void),
  5986. default_debug_unwind_info)
  5987. DEFHOOK
  5988. (reset_location_view, "\
  5989. This hook, if defined, enables -ginternal-reset-location-views, and\n\
  5990. uses its result to override cases in which the estimated min insn\n\
  5991. length might be nonzero even when a PC advance (i.e., a view reset)\n\
  5992. cannot be taken for granted.\n\
  5993. \n\
  5994. If the hook is defined, it must return a positive value to indicate\n\
  5995. the insn definitely advances the PC, and so the view number can be\n\
  5996. safely assumed to be reset; a negative value to mean the insn\n\
  5997. definitely does not advance the PC, and os the view number must not\n\
  5998. be reset; or zero to decide based on the estimated insn length.\n\
  5999. \n\
  6000. If insn length is to be regarded as reliable, set the hook to\n\
  6001. @code{hook_int_rtx_insn_0}.",
  6002. int, (rtx_insn *), NULL)
  6003. /* The code parameter should be of type enum rtx_code but this is not
  6004. defined at this time. */
  6005. DEFHOOK
  6006. (canonicalize_comparison,
  6007. "On some machines not all possible comparisons are defined, but you can\n\
  6008. convert an invalid comparison into a valid one. For example, the Alpha\n\
  6009. does not have a @code{GT} comparison, but you can use an @code{LT}\n\
  6010. comparison instead and swap the order of the operands.\n\
  6011. \n\
  6012. On such machines, implement this hook to do any required conversions.\n\
  6013. @var{code} is the initial comparison code and @var{op0} and @var{op1}\n\
  6014. are the left and right operands of the comparison, respectively. If\n\
  6015. @var{op0_preserve_value} is @code{true} the implementation is not\n\
  6016. allowed to change the value of @var{op0} since the value might be used\n\
  6017. in RTXs which aren't comparisons. E.g. the implementation is not\n\
  6018. allowed to swap operands in that case.\n\
  6019. \n\
  6020. GCC will not assume that the comparison resulting from this macro is\n\
  6021. valid but will see if the resulting insn matches a pattern in the\n\
  6022. @file{md} file.\n\
  6023. \n\
  6024. You need not to implement this hook if it would never change the\n\
  6025. comparison code or operands.",
  6026. void, (int *code, rtx *op0, rtx *op1, bool op0_preserve_value),
  6027. default_canonicalize_comparison)
  6028. DEFHOOK
  6029. (min_arithmetic_precision,
  6030. "On some RISC architectures with 64-bit registers, the processor also\n\
  6031. maintains 32-bit condition codes that make it possible to do real 32-bit\n\
  6032. arithmetic, although the operations are performed on the full registers.\n\
  6033. \n\
  6034. On such architectures, defining this hook to 32 tells the compiler to try\n\
  6035. using 32-bit arithmetical operations setting the condition codes instead\n\
  6036. of doing full 64-bit arithmetic.\n\
  6037. \n\
  6038. More generally, define this hook on RISC architectures if you want the\n\
  6039. compiler to try using arithmetical operations setting the condition codes\n\
  6040. with a precision lower than the word precision.\n\
  6041. \n\
  6042. You need not define this hook if @code{WORD_REGISTER_OPERATIONS} is not\n\
  6043. defined to 1.",
  6044. unsigned int, (void), default_min_arithmetic_precision)
  6045. DEFHOOKPOD
  6046. (atomic_test_and_set_trueval,
  6047. "This value should be set if the result written by\
  6048. @code{atomic_test_and_set} is not exactly 1, i.e.@: the\
  6049. @code{bool} @code{true}.",
  6050. unsigned char, 1)
  6051. /* Return an unsigned int representing the alignment (in bits) of the atomic
  6052. type which maps to machine MODE. This allows alignment to be overridden
  6053. as needed. */
  6054. DEFHOOK
  6055. (atomic_align_for_mode,
  6056. "If defined, this function returns an appropriate alignment in bits for an\
  6057. atomic object of machine_mode @var{mode}. If 0 is returned then the\
  6058. default alignment for the specified mode is used. ",
  6059. unsigned int, (machine_mode mode),
  6060. hook_uint_mode_0)
  6061. DEFHOOK
  6062. (atomic_assign_expand_fenv,
  6063. "ISO C11 requires atomic compound assignments that may raise floating-point\
  6064. exceptions to raise exceptions corresponding to the arithmetic operation\
  6065. whose result was successfully stored in a compare-and-exchange sequence. \
  6066. This requires code equivalent to calls to @code{feholdexcept},\
  6067. @code{feclearexcept} and @code{feupdateenv} to be generated at\
  6068. appropriate points in the compare-and-exchange sequence. This hook should\
  6069. set @code{*@var{hold}} to an expression equivalent to the call to\
  6070. @code{feholdexcept}, @code{*@var{clear}} to an expression equivalent to\
  6071. the call to @code{feclearexcept} and @code{*@var{update}} to an expression\
  6072. equivalent to the call to @code{feupdateenv}. The three expressions are\
  6073. @code{NULL_TREE} on entry to the hook and may be left as @code{NULL_TREE}\
  6074. if no code is required in a particular place. The default implementation\
  6075. leaves all three expressions as @code{NULL_TREE}. The\
  6076. @code{__atomic_feraiseexcept} function from @code{libatomic} may be of use\
  6077. as part of the code generated in @code{*@var{update}}.",
  6078. void, (tree *hold, tree *clear, tree *update),
  6079. default_atomic_assign_expand_fenv)
  6080. /* Leave the boolean fields at the end. */
  6081. /* True if we can create zeroed data by switching to a BSS section
  6082. and then using ASM_OUTPUT_SKIP to allocate the space. */
  6083. DEFHOOKPOD
  6084. (have_switchable_bss_sections,
  6085. "This flag is true if we can create zeroed data by switching to a BSS\n\
  6086. section and then using @code{ASM_OUTPUT_SKIP} to allocate the space.\n\
  6087. This is true on most ELF targets.",
  6088. bool, false)
  6089. /* True if "native" constructors and destructors are supported,
  6090. false if we're using collect2 for the job. */
  6091. DEFHOOKPOD
  6092. (have_ctors_dtors,
  6093. "This value is true if the target supports some ``native'' method of\n\
  6094. collecting constructors and destructors to be run at startup and exit.\n\
  6095. It is false if we must use @command{collect2}.",
  6096. bool, false)
  6097. /* True if thread-local storage is supported. */
  6098. DEFHOOKPOD
  6099. (have_tls,
  6100. "Contains the value true if the target supports thread-local storage.\n\
  6101. The default value is false.",
  6102. bool, false)
  6103. /* True if a small readonly data section is supported. */
  6104. DEFHOOKPOD
  6105. (have_srodata_section,
  6106. "Contains the value true if the target places read-only\n\
  6107. ``small data'' into a separate section. The default value is false.",
  6108. bool, false)
  6109. /* True if EH frame info sections should be zero-terminated. */
  6110. DEFHOOKPOD
  6111. (terminate_dw2_eh_frame_info,
  6112. "Contains the value true if the target should add a zero word onto the\n\
  6113. end of a Dwarf-2 frame info section when used for exception handling.\n\
  6114. Default value is false if @code{EH_FRAME_SECTION_NAME} is defined, and\n\
  6115. true otherwise.",
  6116. bool, true)
  6117. /* True if #NO_APP should be emitted at the beginning of assembly output. */
  6118. DEFHOOKPOD
  6119. (asm_file_start_app_off,
  6120. "If this flag is true, the text of the macro @code{ASM_APP_OFF} will be\n\
  6121. printed as the very first line in the assembly file, unless\n\
  6122. @option{-fverbose-asm} is in effect. (If that macro has been defined\n\
  6123. to the empty string, this variable has no effect.) With the normal\n\
  6124. definition of @code{ASM_APP_OFF}, the effect is to notify the GNU\n\
  6125. assembler that it need not bother stripping comments or extra\n\
  6126. whitespace from its input. This allows it to work a bit faster.\n\
  6127. \n\
  6128. The default is false. You should not set it to true unless you have\n\
  6129. verified that your port does not generate any extra whitespace or\n\
  6130. comments that will cause GAS to issue errors in NO_APP mode.",
  6131. bool, false)
  6132. /* True if output_file_directive should be called for main_input_filename
  6133. at the beginning of assembly output. */
  6134. DEFHOOKPOD
  6135. (asm_file_start_file_directive,
  6136. "If this flag is true, @code{output_file_directive} will be called\n\
  6137. for the primary source file, immediately after printing\n\
  6138. @code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect\n\
  6139. this to be done. The default is false.",
  6140. bool, false)
  6141. /* Returns true if we should generate exception tables for use with the
  6142. ARM EABI. The effects the encoding of function exception specifications. */
  6143. DEFHOOKPOD
  6144. (arm_eabi_unwinder,
  6145. "This flag should be set to @code{true} on targets that use an ARM EABI\n\
  6146. based unwinding library, and @code{false} on other targets. This effects\n\
  6147. the format of unwinding tables, and how the unwinder in entered after\n\
  6148. running a cleanup. The default is @code{false}.",
  6149. bool, false)
  6150. DEFHOOKPOD
  6151. (want_debug_pub_sections,
  6152. "True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections\
  6153. should be emitted. These sections are not used on most platforms, and\
  6154. in particular GDB does not use them.",
  6155. bool, false)
  6156. DEFHOOKPOD
  6157. (delay_sched2, "True if sched2 is not to be run at its normal place.\n\
  6158. This usually means it will be run as part of machine-specific reorg.",
  6159. bool, false)
  6160. DEFHOOKPOD
  6161. (delay_vartrack, "True if vartrack is not to be run at its normal place.\n\
  6162. This usually means it will be run as part of machine-specific reorg.",
  6163. bool, false)
  6164. DEFHOOKPOD
  6165. (no_register_allocation, "True if register allocation and the passes\n\
  6166. following it should not be run. Usually true only for virtual assembler\n\
  6167. targets.",
  6168. bool, false)
  6169. /* Leave the boolean fields at the end. */
  6170. /* Functions related to mode switching. */
  6171. #undef HOOK_PREFIX
  6172. #define HOOK_PREFIX "TARGET_MODE_"
  6173. HOOK_VECTOR (TARGET_TOGGLE_, mode_switching)
  6174. DEFHOOK
  6175. (emit,
  6176. "Generate one or more insns to set @var{entity} to @var{mode}. @var{hard_reg_live} is the set of hard registers live at the point where the insn(s) are to be inserted. @var{prev_moxde} indicates the mode to switch from. Sets of a lower numbered entity will be emitted before sets of a higher numbered entity to a mode of the same or lower priority.",
  6177. void, (int entity, int mode, int prev_mode, HARD_REG_SET regs_live), NULL)
  6178. DEFHOOK
  6179. (needed,
  6180. "@var{entity} is an integer specifying a mode-switched entity. If @code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to return an integer value not larger than the corresponding element in @code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity} must be switched into prior to the execution of @var{insn}.",
  6181. int, (int entity, rtx_insn *insn), NULL)
  6182. DEFHOOK
  6183. (after,
  6184. "@var{entity} is an integer specifying a mode-switched entity. If this macro is defined, it is evaluated for every @var{insn} during mode switching. It determines the mode that an insn results in (if different from the incoming mode).",
  6185. int, (int entity, int mode, rtx_insn *insn), NULL)
  6186. DEFHOOK
  6187. (entry,
  6188. "If this macro is defined, it is evaluated for every @var{entity} that needs mode switching. It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function entry. If @code{TARGET_MODE_ENTRY} is defined then @code{TARGET_MODE_EXIT} must be defined.",
  6189. int, (int entity), NULL)
  6190. DEFHOOK
  6191. (exit,
  6192. "If this macro is defined, it is evaluated for every @var{entity} that needs mode switching. It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function exit. If @code{TARGET_MODE_EXIT} is defined then @code{TARGET_MODE_ENTRY} must be defined.",
  6193. int, (int entity), NULL)
  6194. DEFHOOK
  6195. (priority,
  6196. "This macro specifies the order in which modes for @var{entity} are processed. 0 is the highest priority, @code{NUM_MODES_FOR_MODE_SWITCHING[@var{entity}] - 1} the lowest. The value of the macro should be an integer designating a mode for @var{entity}. For any fixed @var{entity}, @code{mode_priority} (@var{entity}, @var{n}) shall be a bijection in 0 @dots{} @code{num_modes_for_mode_switching[@var{entity}] - 1}.",
  6197. int, (int entity, int n), NULL)
  6198. HOOK_VECTOR_END (mode_switching)
  6199. #undef HOOK_PREFIX
  6200. #define HOOK_PREFIX "TARGET_"
  6201. #define DEF_TARGET_INSN(NAME, PROTO) \
  6202. DEFHOOK_UNDOC (have_##NAME, "", bool, (void), false)
  6203. #include "target-insns.def"
  6204. #undef DEF_TARGET_INSN
  6205. #define DEF_TARGET_INSN(NAME, PROTO) \
  6206. DEFHOOK_UNDOC (gen_##NAME, "", rtx_insn *, PROTO, NULL)
  6207. #include "target-insns.def"
  6208. #undef DEF_TARGET_INSN
  6209. #define DEF_TARGET_INSN(NAME, PROTO) \
  6210. DEFHOOKPOD (code_for_##NAME, "*", enum insn_code, CODE_FOR_nothing)
  6211. #include "target-insns.def"
  6212. #undef DEF_TARGET_INSN
  6213. DEFHOOK
  6214. (run_target_selftests,
  6215. "If selftests are enabled, run any selftests for this target.",
  6216. void, (void),
  6217. NULL)
  6218. /* Close the 'struct gcc_target' definition. */
  6219. HOOK_VECTOR_END (C90_EMPTY_HACK)