12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666 |
- From b523318f205c88a1f9871b8acbda999150242e36 Mon Sep 17 00:00:00 2001
- From: Waldemar Brodkorb <wbx@openadk.org>
- Date: Sun, 31 Aug 2014 10:48:39 +0200
- Subject: [PATCH 4/5] sparc: remove sparc64/sparcv9 code
- The sparc64/sparcv9 code is incomplete. Furthermore there is
- no real embedded hardware for sparc64 available, so better remove
- it until someone comes up with a complete port.
- Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
- ---
- extra/Configs/Config.sparc | 6 -
- libc/string/sparc/sparc64/memchr.S | 258 ------
- libc/string/sparc/sparc64/memcpy.S | 922 ---------------------
- libc/string/sparc/sparc64/memset.S | 316 -------
- libc/string/sparc/sparc64/sparcv9b/memcpy.S | 611 --------------
- libc/string/sparc/sparc64/stpcpy.S | 270 ------
- libc/string/sparc/sparc64/strcat.S | 338 --------
- libc/string/sparc/sparc64/strchr.S | 485 -----------
- libc/string/sparc/sparc64/strcmp.S | 278 -------
- libc/string/sparc/sparc64/strcpy.S | 244 ------
- libc/string/sparc/sparc64/strlen.S | 172 ----
- libc/sysdeps/linux/sparc/bits/setjmp.h | 31 -
- libc/sysdeps/linux/sparc/bits/sigcontext.h | 35 -
- libc/sysdeps/linux/sparc/crt1.S | 11 -
- libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 25 +-
- libc/sysdeps/linux/sparc/qp_ops.c | 8 -
- libc/sysdeps/linux/sparc/sparcv9/clone.S | 101 ---
- libc/sysdeps/linux/sparc/sparcv9/rem.S | 20 -
- libc/sysdeps/linux/sparc/sparcv9/sdiv.S | 18 -
- libc/sysdeps/linux/sparc/sparcv9/udiv.S | 15 -
- libc/sysdeps/linux/sparc/sparcv9/umul.S | 15 -
- libc/sysdeps/linux/sparc/sparcv9/urem.S | 17 -
- libc/sysdeps/linux/sparc/sys/procfs.h | 88 --
- .../linuxthreads.old/sysdeps/sparc/pt-machine.h | 86 +-
- .../sysdeps/sparc/sparc32/pt-machine.h | 82 --
- .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
- libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 95 ++-
- libpthread/linuxthreads/sysdeps/sparc/pt-machine.h | 86 +-
- .../linuxthreads/sysdeps/sparc/sparc32/pspinlock.c | 87 --
- .../sysdeps/sparc/sparc32/pt-machine.h | 82 --
- .../sysdeps/sparc/sparc32/sparcv9/pspinlock.c | 93 ---
- .../linuxthreads/sysdeps/sparc/sparc64/pspinlock.c | 92 --
- .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
- .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 100 ---
- .../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 64 --
- .../unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c | 1 -
- .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 99 ---
- .../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 63 --
- .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 102 ++-
- .../sysdeps/unix/sysv/linux/sparc/vfork.S | 64 ++
- libpthread/nptl/sysdeps/jmpbuf-unwind.h | 27 +
- libpthread/nptl/sysdeps/pthread_spin_lock.c | 39 +
- libpthread/nptl/sysdeps/pthread_spin_trylock.c | 28 +
- libpthread/nptl/sysdeps/pthreaddef.h | 39 +
- libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 32 +-
- libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c | 44 +-
- .../nptl/sysdeps/sparc/pthread_spin_trylock.c | 33 +-
- libpthread/nptl/sysdeps/sparc/pthreaddef.h | 44 +-
- .../nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h | 27 -
- .../nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c | 39 -
- .../sysdeps/sparc/sparc32/pthread_spin_trylock.c | 28 -
- libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h | 39 -
- .../sparc/sparc32/sparcv9/pthread_spin_lock.c | 38 -
- .../sparc/sparc32/sparcv9/pthread_spin_trylock.c | 1 -
- .../sparc/sparc32/sparcv9/pthread_spin_unlock.c | 1 -
- .../nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h | 27 -
- .../nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c | 38 -
- .../sysdeps/sparc/sparc64/pthread_spin_trylock.c | 33 -
- .../sysdeps/sparc/sparc64/pthread_spin_unlock.c | 29 -
- libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h | 39 -
- .../nptl/sysdeps/unix/sysv/linux/sparc/clone.S | 7 +-
- .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 49 +-
- .../unix/sysv/linux/sparc/pthread_barrier_wait.c | 94 ++-
- .../nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c | 52 ++
- .../sysdeps/unix/sysv/linux/sparc/sem_timedwait.c | 147 ++++
- .../sysdeps/unix/sysv/linux/sparc/sem_trywait.c | 51 ++
- .../nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c | 124 +++
- .../sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 2 -
- .../unix/sysv/linux/sparc/sparc32/pt-vfork.S | 44 -
- .../linux/sparc/sparc32/pthread_barrier_wait.c | 93 ---
- .../unix/sysv/linux/sparc/sparc32/sem_post.c | 52 --
- .../unix/sysv/linux/sparc/sparc32/sem_timedwait.c | 147 ----
- .../unix/sysv/linux/sparc/sparc32/sem_trywait.c | 51 --
- .../unix/sysv/linux/sparc/sparc32/sem_wait.c | 124 ---
- .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 111 ---
- .../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 48 --
- .../sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 2 -
- .../unix/sysv/linux/sparc/sparc64/pt-vfork.S | 44 -
- .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 109 ---
- .../unix/sysv/linux/sparc/sparc64/timer_create.c | 1 -
- .../unix/sysv/linux/sparc/sparc64/timer_delete.c | 1 -
- .../unix/sysv/linux/sparc/sparc64/timer_getoverr.c | 1 -
- .../unix/sysv/linux/sparc/sparc64/timer_gettime.c | 1 -
- .../unix/sysv/linux/sparc/sparc64/timer_settime.c | 1 -
- .../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 48 --
- .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 114 ++-
- .../nptl/sysdeps/unix/sysv/linux/sparc/vfork.S | 53 +-
- 87 files changed, 1350 insertions(+), 6534 deletions(-)
- delete mode 100644 libc/string/sparc/sparc64/memchr.S
- delete mode 100644 libc/string/sparc/sparc64/memcpy.S
- delete mode 100644 libc/string/sparc/sparc64/memset.S
- delete mode 100644 libc/string/sparc/sparc64/sparcv9b/memcpy.S
- delete mode 100644 libc/string/sparc/sparc64/stpcpy.S
- delete mode 100644 libc/string/sparc/sparc64/strcat.S
- delete mode 100644 libc/string/sparc/sparc64/strchr.S
- delete mode 100644 libc/string/sparc/sparc64/strcmp.S
- delete mode 100644 libc/string/sparc/sparc64/strcpy.S
- delete mode 100644 libc/string/sparc/sparc64/strlen.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/clone.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/rem.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/sdiv.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/udiv.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/umul.S
- delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/urem.S
- delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
- delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
- delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
- delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
- delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
- delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
- delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
- delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
- delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
- create mode 100644 libpthread/nptl/sysdeps/jmpbuf-unwind.h
- create mode 100644 libpthread/nptl/sysdeps/pthread_spin_lock.c
- create mode 100644 libpthread/nptl/sysdeps/pthread_spin_trylock.c
- create mode 100644 libpthread/nptl/sysdeps/pthreaddef.h
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
- delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
- create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
- create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
- create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
- create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
- delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- diff --git a/extra/Configs/Config.sparc b/extra/Configs/Config.sparc
- index c6180c8..47c8ac2 100644
- --- a/extra/Configs/Config.sparc
- +++ b/extra/Configs/Config.sparc
- @@ -26,10 +26,4 @@ config CONFIG_SPARC_V7
- config CONFIG_SPARC_V8
- bool "SPARC v8"
-
- -config CONFIG_SPARC_V9
- - bool "SPARC v9"
- -
- -config CONFIG_SPARC_V9B
- - bool "SPARC v9b"
- -
- endchoice
- diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S
- deleted file mode 100644
- index 6467f7f..0000000
- --- a/libc/string/sparc/sparc64/memchr.S
- +++ /dev/null
- @@ -1,258 +0,0 @@
- -/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
- - than N.
- - For SPARC v9.
- - Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- - This version is developed using the same algorithm as the fast C
- - version which carries the following introduction:
- - Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
- - with help from Dan Sahlin (dan@sics.se) and
- - commentary by Jim Blandy (jimb@ai.mit.edu);
- - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
- - and implemented by Roland McGrath (roland@ai.mit.edu).
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -#ifndef XCC
- -#define XCC xcc
- -#define USE_BPR
- - .register %g2, #scratch
- - .register %g3, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(memchr)
- - and %o1, 0xff, %o1 /* IEU0 Group */
- -#ifdef USE_BPR
- - brz,pn %o2, 12f /* CTI+IEU1 */
- -#else
- - tst %o2 /* IEU1 */
- - be,pn %XCC, 12f /* CTI */
- -#endif
- - sll %o1, 8, %g3 /* IEU0 Group */
- - add %o0, %o2, %o2 /* IEU1 */
- -
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - or %g3, %o1, %g3 /* IEU1 */
- - ldub [%o0], %o3 /* Load */
- - sllx %g3, 16, %g5 /* IEU0 Group */
- -
- - or %g1, %lo(0x01010101), %g1 /* IEU1 */
- - sllx %g1, 32, %g2 /* IEU0 Group */
- - or %g3, %g5, %g3 /* IEU1 */
- - sllx %g3, 32, %g5 /* IEU0 Group */
- -
- - cmp %o3, %o1 /* IEU1 */
- - be,pn %xcc, 13f /* CTI */
- - or %g1, %g2, %g1 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- -
- - bne,a,pn %icc, 21f /* CTI */
- - add %o0, 1, %o0 /* IEU0 Group */
- - ldx [%o0], %o3 /* Load Group */
- - sllx %g1, 7, %g2 /* IEU0 */
- -
- - or %g3, %g5, %g3 /* IEU1 */
- -1: add %o0, 8, %o0 /* IEU0 Group */
- - xor %o3, %g3, %o4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080088080808080 *
- - * %g3 = c c c c c c c c *
- - * %o3 = value *
- - * %o4 = value XOR c */
- -2: cmp %o0, %o2 /* IEU1 Group */
- -
- - bg,pn %XCC, 11f /* CTI */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - sub %o4, %g1, %o5 /* IEU0 Group */
- - add %o0, 8, %o0 /* IEU1 */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o5, %o4, %o5 /* IEU0 Group */
- -#endif
- -
- - andcc %o5, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 2b /* CTI */
- - xor %o3, %g3, %o4 /* IEU0 */
- - srlx %o4, 56, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 3f /* CTI */
- - srlx %o4, 48, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- -
- - srlx %o4, 32, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 6f /* CTI */
- - srlx %o4, 24, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- - srlx %o4, 16, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 8f /* CTI */
- - srlx %o4, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 9f /* CTI */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - bne,pt %icc, 2b /* CTI */
- - xor %o3, %g3, %o4 /* IEU0 */
- - retl /* CTI+IEU1 Group */
- -
- - add %o0, -9, %o0 /* IEU0 */
- -
- - .align 16
- -3: retl /* CTI+IEU1 Group */
- - add %o0, -16, %o0 /* IEU0 */
- -4: retl /* CTI+IEU1 Group */
- - add %o0, -15, %o0 /* IEU0 */
- -
- -5: retl /* CTI+IEU1 Group */
- - add %o0, -14, %o0 /* IEU0 */
- -6: retl /* CTI+IEU1 Group */
- - add %o0, -13, %o0 /* IEU0 */
- -
- -7: retl /* CTI+IEU1 Group */
- - add %o0, -12, %o0 /* IEU0 */
- -8: retl /* CTI+IEU1 Group */
- - add %o0, -11, %o0 /* IEU0 */
- -
- -9: retl /* CTI+IEU1 Group */
- - add %o0, -10, %o0 /* IEU0 */
- -11: sub %o4, %g1, %o5 /* IEU0 Group */
- - sub %o0, 8, %o0 /* IEU1 */
- -
- - andcc %o5, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 12f /* CTI */
- - sub %o2, %o0, %o2 /* IEU0 */
- - tst %o2 /* IEU1 Group */
- -
- - be,pn %XCC, 12f /* CTI */
- - srlx %o4, 56, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 13f /* CTI */
- -
- - cmp %o2, 1 /* IEU0 */
- - be,pn %XCC, 12f /* CTI Group */
- - srlx %o4, 48, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 14f /* CTI */
- - cmp %o2, 2 /* IEU1 Group */
- - be,pn %XCC, 12f /* CTI */
- - srlx %o4, 40, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 15f /* CTI */
- - cmp %o2, 3 /* IEU1 Group */
- - be,pn %XCC, 12f /* CTI */
- -
- - srlx %o4, 32, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 16f /* CTI */
- - cmp %o2, 4 /* IEU1 Group */
- -
- - be,pn %XCC, 12f /* CTI */
- - srlx %o4, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 17f /* CTI */
- -
- - cmp %o2, 5 /* IEU1 Group */
- - be,pn %XCC, 12f /* CTI */
- - srlx %o4, 16, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 18f /* CTI */
- - cmp %o2, 6 /* IEU1 Group */
- - be,pn %XCC, 12f /* CTI */
- - srlx %o4, 8, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 19f /* CTI */
- - nop /* IEU0 */
- -12: retl /* CTI+IEU1 Group */
- -
- - clr %o0 /* IEU0 */
- - nop /* Stub */
- -13: retl /* CTI+IEU1 Group */
- - nop /* IEU0 */
- -
- -14: retl /* CTI+IEU1 Group */
- - add %o0, 1, %o0 /* IEU0 */
- -15: retl /* CTI+IEU1 Group */
- - add %o0, 2, %o0 /* IEU0 */
- -
- -16: retl /* CTI+IEU1 Group */
- - add %o0, 3, %o0 /* IEU0 */
- -17: retl /* CTI+IEU1 Group */
- - add %o0, 4, %o0 /* IEU0 */
- -
- -18: retl /* CTI+IEU1 Group */
- - add %o0, 5, %o0 /* IEU0 */
- -19: retl /* CTI+IEU1 Group */
- - add %o0, 6, %o0 /* IEU0 */
- -
- -21: cmp %o0, %o2 /* IEU1 */
- - be,pn %XCC, 12b /* CTI */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- - ldub [%o0], %o3 /* Load */
- -
- - or %g3, %g5, %g3 /* IEU1 */
- -22: andcc %o0, 7, %g0 /* IEU1 Group */
- - be,a,pn %icc, 1b /* CTI */
- - ldx [%o0], %o3 /* Load */
- -
- - cmp %o3, %o1 /* IEU1 Group */
- - be,pn %xcc, 23f /* CTI */
- - add %o0, 1, %o0 /* IEU0 */
- - cmp %o0, %o2 /* IEU1 Group */
- -
- - bne,a,pt %XCC, 22b /* CTI */
- - ldub [%o0], %o3 /* Load */
- - retl /* CTI+IEU1 Group */
- - clr %o0 /* IEU0 */
- -
- -23: retl /* CTI+IEU1 Group */
- - add %o0, -1, %o0 /* IEU0 */
- -END(memchr)
- -
- -libc_hidden_def(memchr)
- -weak_alias(memchr,__ubp_memchr)
- diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
- deleted file mode 100644
- index df3e2d3..0000000
- --- a/libc/string/sparc/sparc64/memcpy.S
- +++ /dev/null
- @@ -1,922 +0,0 @@
- -/* Copy SIZE bytes from SRC to DEST.
- - For UltraSPARC.
- - Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by David S. Miller (davem@caip.rutgers.edu) and
- - Jakub Jelinek (jakub@redhat.com).
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <features.h>
- -#include <asm/asi.h>
- -#ifndef XCC
- -#define USE_BPR
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#define XCC xcc
- -#endif
- -#define FPRS_FEF 4
- -
- -#define FREG_FROB(f1, f2, f3, f4, f5, f6, f7, f8, f9) \
- - faligndata %f1, %f2, %f48; \
- - faligndata %f2, %f3, %f50; \
- - faligndata %f3, %f4, %f52; \
- - faligndata %f4, %f5, %f54; \
- - faligndata %f5, %f6, %f56; \
- - faligndata %f6, %f7, %f58; \
- - faligndata %f7, %f8, %f60; \
- - faligndata %f8, %f9, %f62;
- -
- -#define MAIN_LOOP_CHUNK(src, dest, fdest, fsrc, len, jmptgt) \
- - ldda [%src] %asi, %fdest; \
- - add %src, 0x40, %src; \
- - add %dest, 0x40, %dest; \
- - subcc %len, 0x40, %len; \
- - be,pn %xcc, jmptgt; \
- - stda %fsrc, [%dest - 0x40] %asi;
- -
- -#define LOOP_CHUNK1(src, dest, len, branch_dest) \
- - MAIN_LOOP_CHUNK(src, dest, f0, f48, len, branch_dest)
- -#define LOOP_CHUNK2(src, dest, len, branch_dest) \
- - MAIN_LOOP_CHUNK(src, dest, f16, f48, len, branch_dest)
- -#define LOOP_CHUNK3(src, dest, len, branch_dest) \
- - MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest)
- -
- -#define STORE_SYNC(dest, fsrc) \
- - stda %fsrc, [%dest] %asi; \
- - add %dest, 0x40, %dest;
- -
- -#define STORE_JUMP(dest, fsrc, target) \
- - stda %fsrc, [%dest] %asi; \
- - add %dest, 0x40, %dest; \
- - ba,pt %xcc, target;
- -
- -#define VISLOOP_PAD nop; nop; nop; nop; \
- - nop; nop; nop; nop; \
- - nop; nop; nop; nop; \
- - nop; nop; nop;
- -
- -#define FINISH_VISCHUNK(dest, f0, f1, left) \
- - subcc %left, 8, %left; \
- - bl,pn %xcc, 205f; \
- - faligndata %f0, %f1, %f48; \
- - std %f48, [%dest]; \
- - add %dest, 8, %dest;
- -
- -#define UNEVEN_VISCHUNK(dest, f0, f1, left) \
- - subcc %left, 8, %left; \
- - bl,pn %xcc, 205f; \
- - fsrc1 %f0, %f1; \
- - ba,a,pt %xcc, 204f;
- -
- - /* Macros for non-VIS memcpy code. */
- -#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - ldx [%src + offset + 0x10], %t2; \
- - ldx [%src + offset + 0x18], %t3; \
- - stw %t0, [%dst + offset + 0x04]; \
- - srlx %t0, 32, %t0; \
- - stw %t0, [%dst + offset + 0x00]; \
- - stw %t1, [%dst + offset + 0x0c]; \
- - srlx %t1, 32, %t1; \
- - stw %t1, [%dst + offset + 0x08]; \
- - stw %t2, [%dst + offset + 0x14]; \
- - srlx %t2, 32, %t2; \
- - stw %t2, [%dst + offset + 0x10]; \
- - stw %t3, [%dst + offset + 0x1c]; \
- - srlx %t3, 32, %t3; \
- - stw %t3, [%dst + offset + 0x18];
- -
- -#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - ldx [%src + offset + 0x10], %t2; \
- - ldx [%src + offset + 0x18], %t3; \
- - stx %t0, [%dst + offset + 0x00]; \
- - stx %t1, [%dst + offset + 0x08]; \
- - stx %t2, [%dst + offset + 0x10]; \
- - stx %t3, [%dst + offset + 0x18]; \
- - ldx [%src + offset + 0x20], %t0; \
- - ldx [%src + offset + 0x28], %t1; \
- - ldx [%src + offset + 0x30], %t2; \
- - ldx [%src + offset + 0x38], %t3; \
- - stx %t0, [%dst + offset + 0x20]; \
- - stx %t1, [%dst + offset + 0x28]; \
- - stx %t2, [%dst + offset + 0x30]; \
- - stx %t3, [%dst + offset + 0x38];
- -
- -#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src - offset - 0x10], %t0; \
- - ldx [%src - offset - 0x08], %t1; \
- - stw %t0, [%dst - offset - 0x0c]; \
- - srlx %t0, 32, %t2; \
- - stw %t2, [%dst - offset - 0x10]; \
- - stw %t1, [%dst - offset - 0x04]; \
- - srlx %t1, 32, %t3; \
- - stw %t3, [%dst - offset - 0x08];
- -
- -#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- - ldx [%src - offset - 0x10], %t0; \
- - ldx [%src - offset - 0x08], %t1; \
- - stx %t0, [%dst - offset - 0x10]; \
- - stx %t1, [%dst - offset - 0x08];
- -
- - /* Macros for non-VIS memmove code. */
- -#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src - offset - 0x20], %t0; \
- - ldx [%src - offset - 0x18], %t1; \
- - ldx [%src - offset - 0x10], %t2; \
- - ldx [%src - offset - 0x08], %t3; \
- - stw %t0, [%dst - offset - 0x1c]; \
- - srlx %t0, 32, %t0; \
- - stw %t0, [%dst - offset - 0x20]; \
- - stw %t1, [%dst - offset - 0x14]; \
- - srlx %t1, 32, %t1; \
- - stw %t1, [%dst - offset - 0x18]; \
- - stw %t2, [%dst - offset - 0x0c]; \
- - srlx %t2, 32, %t2; \
- - stw %t2, [%dst - offset - 0x10]; \
- - stw %t3, [%dst - offset - 0x04]; \
- - srlx %t3, 32, %t3; \
- - stw %t3, [%dst - offset - 0x08];
- -
- -#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src - offset - 0x20], %t0; \
- - ldx [%src - offset - 0x18], %t1; \
- - ldx [%src - offset - 0x10], %t2; \
- - ldx [%src - offset - 0x08], %t3; \
- - stx %t0, [%dst - offset - 0x20]; \
- - stx %t1, [%dst - offset - 0x18]; \
- - stx %t2, [%dst - offset - 0x10]; \
- - stx %t3, [%dst - offset - 0x08]; \
- - ldx [%src - offset - 0x40], %t0; \
- - ldx [%src - offset - 0x38], %t1; \
- - ldx [%src - offset - 0x30], %t2; \
- - ldx [%src - offset - 0x28], %t3; \
- - stx %t0, [%dst - offset - 0x40]; \
- - stx %t1, [%dst - offset - 0x38]; \
- - stx %t2, [%dst - offset - 0x30]; \
- - stx %t3, [%dst - offset - 0x28];
- -
- -#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - stw %t0, [%dst + offset + 0x04]; \
- - srlx %t0, 32, %t2; \
- - stw %t2, [%dst + offset + 0x00]; \
- - stw %t1, [%dst + offset + 0x0c]; \
- - srlx %t1, 32, %t3; \
- - stw %t3, [%dst + offset + 0x08];
- -
- -#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - stx %t0, [%dst + offset + 0x00]; \
- - stx %t1, [%dst + offset + 0x08];
- -
- - .text
- - .align 32
- -
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -ENTRY(bcopy)
- - sub %o1, %o0, %o4 /* IEU0 Group */
- - mov %o0, %g3 /* IEU1 */
- - cmp %o4, %o2 /* IEU1 Group */
- - mov %o1, %o0 /* IEU0 */
- - bgeu,pt %XCC, 210f /* CTI */
- - mov %g3, %o1 /* IEU0 Group */
- -#ifndef USE_BPR
- - srl %o2, 0, %o2 /* IEU1 */
- -#endif
- - brnz,pn %o2, 220f /* CTI Group */
- - add %o0, %o2, %o0 /* IEU0 */
- - retl
- - nop
- -END(bcopy)
- -#endif
- -
- - .align 32
- -200: be,pt %xcc, 201f /* CTI */
- - andcc %o0, 0x38, %g5 /* IEU1 Group */
- - mov 8, %g1 /* IEU0 */
- - sub %g1, %g2, %g2 /* IEU0 Group */
- - andcc %o0, 1, %g0 /* IEU1 */
- - be,pt %icc, 2f /* CTI */
- - sub %o2, %g2, %o2 /* IEU0 Group */
- -1: ldub [%o1], %o5 /* Load Group */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - subcc %g2, 1, %g2 /* IEU1 Group */
- - be,pn %xcc, 3f /* CTI */
- - stb %o5, [%o0 - 1] /* Store */
- -2: ldub [%o1], %o5 /* Load Group */
- - add %o0, 2, %o0 /* IEU0 */
- - ldub [%o1 + 1], %g3 /* Load Group */
- - subcc %g2, 2, %g2 /* IEU1 Group */
- - stb %o5, [%o0 - 2] /* Store */
- - add %o1, 2, %o1 /* IEU0 */
- - bne,pt %xcc, 2b /* CTI Group */
- - stb %g3, [%o0 - 1] /* Store */
- -3: andcc %o0, 0x38, %g5 /* IEU1 Group */
- -201: be,pt %icc, 202f /* CTI */
- - mov 64, %g1 /* IEU0 */
- - fmovd %f0, %f2 /* FPU */
- - sub %g1, %g5, %g5 /* IEU0 Group */
- - alignaddr %o1, %g0, %g1 /* GRU Group */
- - ldd [%g1], %f4 /* Load Group */
- - sub %o2, %g5, %o2 /* IEU0 */
- -1: ldd [%g1 + 0x8], %f6 /* Load Group */
- - add %g1, 0x8, %g1 /* IEU0 Group */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f4, %f6, %f0 /* GRU Group */
- - std %f0, [%o0] /* Store */
- - add %o1, 8, %o1 /* IEU0 Group */
- - be,pn %xcc, 202f /* CTI */
- - add %o0, 8, %o0 /* IEU1 */
- - ldd [%g1 + 0x8], %f4 /* Load Group */
- - add %g1, 8, %g1 /* IEU0 */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f6, %f4, %f0 /* GRU Group */
- - std %f0, [%o0] /* Store */
- - add %o1, 8, %o1 /* IEU0 */
- - bne,pt %xcc, 1b /* CTI Group */
- - add %o0, 8, %o0 /* IEU0 */
- -202: membar #LoadStore | #StoreStore | #StoreLoad /* LSU Group */
- - wr %g0, ASI_BLK_P, %asi /* LSU Group */
- - subcc %o2, 0x40, %g6 /* IEU1 Group */
- - mov %o1, %g1 /* IEU0 */
- - andncc %g6, (0x40 - 1), %g6 /* IEU1 Group */
- - srl %g1, 3, %g2 /* IEU0 */
- - sub %o2, %g6, %g3 /* IEU0 Group */
- - andn %o1, (0x40 - 1), %o1 /* IEU1 */
- - and %g2, 7, %g2 /* IEU0 Group */
- - andncc %g3, 0x7, %g3 /* IEU1 */
- - fmovd %f0, %f2 /* FPU */
- - sub %g3, 0x10, %g3 /* IEU0 Group */
- - sub %o2, %g6, %o2 /* IEU1 */
- - alignaddr %g1, %g0, %g0 /* GRU Group */
- - add %g1, %g6, %g1 /* IEU0 Group */
- - subcc %o2, %g3, %o2 /* IEU1 */
- - ldda [%o1 + 0x00] %asi, %f0 /* LSU Group */
- - add %g1, %g3, %g1 /* IEU0 */
- - ldda [%o1 + 0x40] %asi, %f16 /* LSU Group */
- - sub %g6, 0x80, %g6 /* IEU0 */
- - ldda [%o1 + 0x80] %asi, %f32 /* LSU Group */
- - /* Clk1 Group 8-( */
- - /* Clk2 Group 8-( */
- - /* Clk3 Group 8-( */
- - /* Clk4 Group 8-( */
- -203: rd %pc, %g5 /* PDU Group 8-( */
- - addcc %g5, %lo(300f - 203b), %g5 /* IEU1 Group */
- - sll %g2, 9, %g2 /* IEU0 */
- - jmpl %g5 + %g2, %g0 /* CTI Group brk forced*/
- - addcc %o1, 0xc0, %o1 /* IEU1 Group */
- -
- - .align 512 /* OK, here comes the fun part... */
- -300: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) LOOP_CHUNK1(o1, o0, g6, 301f)
- - FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) LOOP_CHUNK2(o1, o0, g6, 302f)
- - FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) LOOP_CHUNK3(o1, o0, g6, 303f)
- - b,pt %xcc, 300b+4; faligndata %f0, %f2, %f48
- -301: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_JUMP(o0, f48, 400f) membar #Sync
- -302: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_JUMP(o0, f48, 416f) membar #Sync
- -303: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_JUMP(o0, f48, 432f) membar #Sync
- - VISLOOP_PAD
- -310: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) LOOP_CHUNK1(o1, o0, g6, 311f)
- - FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) LOOP_CHUNK2(o1, o0, g6, 312f)
- - FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) LOOP_CHUNK3(o1, o0, g6, 313f)
- - b,pt %xcc, 310b+4; faligndata %f2, %f4, %f48
- -311: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_JUMP(o0, f48, 402f) membar #Sync
- -312: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_JUMP(o0, f48, 418f) membar #Sync
- -313: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_JUMP(o0, f48, 434f) membar #Sync
- - VISLOOP_PAD
- -320: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) LOOP_CHUNK1(o1, o0, g6, 321f)
- - FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) LOOP_CHUNK2(o1, o0, g6, 322f)
- - FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) LOOP_CHUNK3(o1, o0, g6, 323f)
- - b,pt %xcc, 320b+4; faligndata %f4, %f6, %f48
- -321: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_JUMP(o0, f48, 404f) membar #Sync
- -322: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_JUMP(o0, f48, 420f) membar #Sync
- -323: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_JUMP(o0, f48, 436f) membar #Sync
- - VISLOOP_PAD
- -330: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) LOOP_CHUNK1(o1, o0, g6, 331f)
- - FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) LOOP_CHUNK2(o1, o0, g6, 332f)
- - FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) LOOP_CHUNK3(o1, o0, g6, 333f)
- - b,pt %xcc, 330b+4; faligndata %f6, %f8, %f48
- -331: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_JUMP(o0, f48, 406f) membar #Sync
- -332: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_JUMP(o0, f48, 422f) membar #Sync
- -333: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_JUMP(o0, f48, 438f) membar #Sync
- - VISLOOP_PAD
- -340: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) LOOP_CHUNK1(o1, o0, g6, 341f)
- - FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) LOOP_CHUNK2(o1, o0, g6, 342f)
- - FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) LOOP_CHUNK3(o1, o0, g6, 343f)
- - b,pt %xcc, 340b+4; faligndata %f8, %f10, %f48
- -341: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_JUMP(o0, f48, 408f) membar #Sync
- -342: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_JUMP(o0, f48, 424f) membar #Sync
- -343: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_JUMP(o0, f48, 440f) membar #Sync
- - VISLOOP_PAD
- -350: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) LOOP_CHUNK1(o1, o0, g6, 351f)
- - FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) LOOP_CHUNK2(o1, o0, g6, 352f)
- - FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) LOOP_CHUNK3(o1, o0, g6, 353f)
- - b,pt %xcc, 350b+4; faligndata %f10, %f12, %f48
- -351: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_JUMP(o0, f48, 410f) membar #Sync
- -352: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_JUMP(o0, f48, 426f) membar #Sync
- -353: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_JUMP(o0, f48, 442f) membar #Sync
- - VISLOOP_PAD
- -360: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) LOOP_CHUNK1(o1, o0, g6, 361f)
- - FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) LOOP_CHUNK2(o1, o0, g6, 362f)
- - FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) LOOP_CHUNK3(o1, o0, g6, 363f)
- - b,pt %xcc, 360b+4; faligndata %f12, %f14, %f48
- -361: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_JUMP(o0, f48, 412f) membar #Sync
- -362: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_JUMP(o0, f48, 428f) membar #Sync
- -363: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_JUMP(o0, f48, 444f) membar #Sync
- - VISLOOP_PAD
- -370: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) LOOP_CHUNK1(o1, o0, g6, 371f)
- - FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) LOOP_CHUNK2(o1, o0, g6, 372f)
- - FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) LOOP_CHUNK3(o1, o0, g6, 373f)
- - b,pt %xcc, 370b+4; faligndata %f14, %f16, %f48
- -371: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_JUMP(o0, f48, 414f) membar #Sync
- -372: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_JUMP(o0, f48, 430f) membar #Sync
- -373: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_SYNC(o0, f48) membar #Sync
- - FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_JUMP(o0, f48, 446f) membar #Sync
- - VISLOOP_PAD
- -400: FINISH_VISCHUNK(o0, f0, f2, g3)
- -402: FINISH_VISCHUNK(o0, f2, f4, g3)
- -404: FINISH_VISCHUNK(o0, f4, f6, g3)
- -406: FINISH_VISCHUNK(o0, f6, f8, g3)
- -408: FINISH_VISCHUNK(o0, f8, f10, g3)
- -410: FINISH_VISCHUNK(o0, f10, f12, g3)
- -412: FINISH_VISCHUNK(o0, f12, f14, g3)
- -414: UNEVEN_VISCHUNK(o0, f14, f0, g3)
- -416: FINISH_VISCHUNK(o0, f16, f18, g3)
- -418: FINISH_VISCHUNK(o0, f18, f20, g3)
- -420: FINISH_VISCHUNK(o0, f20, f22, g3)
- -422: FINISH_VISCHUNK(o0, f22, f24, g3)
- -424: FINISH_VISCHUNK(o0, f24, f26, g3)
- -426: FINISH_VISCHUNK(o0, f26, f28, g3)
- -428: FINISH_VISCHUNK(o0, f28, f30, g3)
- -430: UNEVEN_VISCHUNK(o0, f30, f0, g3)
- -432: FINISH_VISCHUNK(o0, f32, f34, g3)
- -434: FINISH_VISCHUNK(o0, f34, f36, g3)
- -436: FINISH_VISCHUNK(o0, f36, f38, g3)
- -438: FINISH_VISCHUNK(o0, f38, f40, g3)
- -440: FINISH_VISCHUNK(o0, f40, f42, g3)
- -442: FINISH_VISCHUNK(o0, f42, f44, g3)
- -444: FINISH_VISCHUNK(o0, f44, f46, g3)
- -446: UNEVEN_VISCHUNK(o0, f46, f0, g3)
- -204: ldd [%o1], %f2 /* Load Group */
- - add %o1, 8, %o1 /* IEU0 */
- - subcc %g3, 8, %g3 /* IEU1 */
- - faligndata %f0, %f2, %f8 /* GRU Group */
- - std %f8, [%o0] /* Store */
- - bl,pn %xcc, 205f /* CTI */
- - add %o0, 8, %o0 /* IEU0 Group */
- - ldd [%o1], %f0 /* Load Group */
- - add %o1, 8, %o1 /* IEU0 */
- - subcc %g3, 8, %g3 /* IEU1 */
- - faligndata %f2, %f0, %f8 /* GRU Group */
- - std %f8, [%o0] /* Store */
- - bge,pt %xcc, 204b /* CTI */
- - add %o0, 8, %o0 /* IEU0 Group */
- -205: brz,pt %o2, 207f /* CTI Group */
- - mov %g1, %o1 /* IEU0 */
- -206: ldub [%o1], %g5 /* LOAD */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 */
- - bne,pt %xcc, 206b /* CTI */
- - stb %g5, [%o0 - 1] /* Store Group */
- -207: membar #StoreLoad | #StoreStore /* LSU Group */
- - wr %g0, FPRS_FEF, %fprs
- - retl
- - mov %g4, %o0
- -
- -208: andcc %o2, 1, %g0 /* IEU1 Group */
- - be,pt %icc, 2f+4 /* CTI */
- -1: ldub [%o1], %g5 /* LOAD Group */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 Group */
- - be,pn %xcc, 209f /* CTI */
- - stb %g5, [%o0 - 1] /* Store */
- -2: ldub [%o1], %g5 /* LOAD Group */
- - add %o0, 2, %o0 /* IEU0 */
- - ldub [%o1 + 1], %o5 /* LOAD Group */
- - add %o1, 2, %o1 /* IEU0 */
- - subcc %o2, 2, %o2 /* IEU1 Group */
- - stb %g5, [%o0 - 2] /* Store */
- - bne,pt %xcc, 2b /* CTI */
- - stb %o5, [%o0 - 1] /* Store */
- -209: retl
- - mov %g4, %o0
- -
- -#ifdef USE_BPR
- -
- - /* void *__align_cpy_4(void *dest, void *src, size_t n)
- - * SPARC v9 SYSV ABI
- - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 3))
- - */
- -
- - .align 32
- -ENTRY(__align_cpy_4)
- - mov %o0, %g4 /* IEU0 Group */
- - cmp %o2, 15 /* IEU1 */
- - bleu,pn %xcc, 208b /* CTI */
- - cmp %o2, (64 * 6) /* IEU1 Group */
- - bgeu,pn %xcc, 200b /* CTI */
- - andcc %o0, 7, %g2 /* IEU1 Group */
- - ba,pt %xcc, 216f /* CTI */
- - andcc %o1, 4, %g0 /* IEU1 Group */
- -END(__align_cpy_4)
- -
- - /* void *__align_cpy_8(void *dest, void *src, size_t n)
- - * SPARC v9 SYSV ABI
- - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 7))
- - */
- -
- - .align 32
- -ENTRY(__align_cpy_8)
- - mov %o0, %g4 /* IEU0 Group */
- - cmp %o2, 15 /* IEU1 */
- - bleu,pn %xcc, 208b /* CTI */
- - cmp %o2, (64 * 6) /* IEU1 Group */
- - bgeu,pn %xcc, 201b /* CTI */
- - andcc %o0, 0x38, %g5 /* IEU1 Group */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- - bne,a,pt %xcc, 82f + 4 /* CTI */
- - ldx [%o1], %g1 /* Load */
- - ba,pt %xcc, 41f /* CTI Group */
- - andcc %o2, 0x70, %g6 /* IEU1 */
- -END(__align_cpy_8)
- -
- - /* void *__align_cpy_16(void *dest, void *src, size_t n)
- - * SPARC v9 SYSV ABI
- - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 15))
- - */
- -
- - .align 32
- -ENTRY(__align_cpy_16)
- - mov %o0, %g4 /* IEU0 Group */
- - cmp %o2, (64 * 6) /* IEU1 */
- - bgeu,pn %xcc, 201b /* CTI */
- - andcc %o0, 0x38, %g5 /* IEU1 Group */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- - bne,a,pt %xcc, 82f + 4 /* CTI */
- - ldx [%o1], %g1 /* Load */
- - ba,pt %xcc, 41f /* CTI Group */
- - andcc %o2, 0x70, %g6 /* IEU1 */
- -END(__align_cpy_16)
- -
- -#endif
- -
- - .align 32
- -ENTRY(memcpy)
- -210:
- -#ifndef USE_BPR
- - srl %o2, 0, %o2 /* IEU1 Group */
- -#endif
- - brz,pn %o2, 209b /* CTI Group */
- - mov %o0, %g4 /* IEU0 */
- -218: cmp %o2, 15 /* IEU1 Group */
- - bleu,pn %xcc, 208b /* CTI */
- - cmp %o2, (64 * 6) /* IEU1 Group */
- - bgeu,pn %xcc, 200b /* CTI */
- - andcc %o0, 7, %g2 /* IEU1 Group */
- - sub %o0, %o1, %g5 /* IEU0 */
- - andcc %g5, 3, %o5 /* IEU1 Group */
- - bne,pn %xcc, 212f /* CTI */
- - andcc %o1, 3, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 216f /* CTI */
- - andcc %o1, 4, %g0 /* IEU1 Group */
- - andcc %o1, 1, %g0 /* IEU1 Group */
- - be,pn %xcc, 4f /* CTI */
- - andcc %o1, 2, %g0 /* IEU1 Group */
- - ldub [%o1], %g2 /* Load Group */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - sub %o2, 1, %o2 /* IEU0 Group */
- - bne,pn %xcc, 5f /* CTI Group */
- - stb %g2, [%o0 - 1] /* Store */
- -4: lduh [%o1], %g2 /* Load Group */
- - add %o1, 2, %o1 /* IEU0 */
- - add %o0, 2, %o0 /* IEU1 */
- - sub %o2, 2, %o2 /* IEU0 */
- - sth %g2, [%o0 - 2] /* Store Group + bubble */
- -5: andcc %o1, 4, %g0 /* IEU1 */
- -216: be,a,pn %xcc, 2f /* CTI */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- - lduw [%o1], %g5 /* Load Group */
- - add %o1, 4, %o1 /* IEU0 */
- - add %o0, 4, %o0 /* IEU1 */
- - sub %o2, 4, %o2 /* IEU0 Group */
- - stw %g5, [%o0 - 4] /* Store */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- -2: be,pn %xcc, 215f /* CTI */
- - andcc %o0, 4, %g0 /* IEU1 Group */
- - be,pn %xcc, 82f + 4 /* CTI Group */
- -5: MOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - MOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- - MOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- - MOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- -35: subcc %g6, 128, %g6 /* IEU1 Group */
- - add %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 5b /* CTI */
- - add %o0, 128, %o0 /* IEU0 Group */
- -215: andcc %o2, 0x70, %g6 /* IEU1 Group */
- -41: be,pn %xcc, 80f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -79: rd %pc, %o5 /* PDU Group */
- - sll %g6, 1, %g5 /* IEU0 Group */
- - add %o1, %g6, %o1 /* IEU1 */
- - sub %o5, %g5, %o5 /* IEU0 Group */
- - jmpl %o5 + %lo(80f - 79b), %g0 /* CTI Group brk forced*/
- - add %o0, %g6, %o0 /* IEU0 Group */
- -36: MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- - MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
- -80: be,pt %xcc, 81f /* CTI */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1], %g2 /* Load Group */
- - add %o0, 8, %o0 /* IEU0 */
- - stw %g2, [%o0 - 0x4] /* Store Group */
- - add %o1, 8, %o1 /* IEU1 */
- - srlx %g2, 32, %g2 /* IEU0 Group */
- - stw %g2, [%o0 - 0x8] /* Store */
- -81: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1], %g2 /* Load Group */
- - add %o1, 4, %o1 /* IEU0 */
- - stw %g2, [%o0] /* Store Group */
- - add %o0, 4, %o0 /* IEU0 */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1], %g2 /* Load Group */
- - add %o1, 2, %o1 /* IEU0 */
- - sth %g2, [%o0] /* Store Group */
- - add %o0, 2, %o0 /* IEU0 */
- -1: be,pt %xcc, 211f /* CTI */
- - nop /* IEU1 */
- - ldub [%o1], %g2 /* Load Group */
- - stb %g2, [%o0] /* Store Group + bubble */
- -211: retl
- - mov %g4, %o0
- -
- -82: MOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - MOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- -37: subcc %g6, 128, %g6 /* IEU1 Group */
- - add %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 82b /* CTI */
- - add %o0, 128, %o0 /* IEU0 Group */
- - andcc %o2, 0x70, %g6 /* IEU1 */
- - be,pn %xcc, 84f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -83: rd %pc, %o5 /* PDU Group */
- - add %o1, %g6, %o1 /* IEU0 Group */
- - sub %o5, %g6, %o5 /* IEU1 */
- - jmpl %o5 + %lo(84f - 83b), %g0 /* CTI Group brk forced*/
- - add %o0, %g6, %o0 /* IEU0 Group */
- -38: MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- - MOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
- -84: be,pt %xcc, 85f /* CTI Group */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1], %g2 /* Load Group */
- - add %o0, 8, %o0 /* IEU0 */
- - add %o1, 8, %o1 /* IEU0 Group */
- - stx %g2, [%o0 - 0x8] /* Store */
- -85: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1], %g2 /* Load Group */
- - add %o0, 4, %o0 /* IEU0 */
- - add %o1, 4, %o1 /* IEU0 Group */
- - stw %g2, [%o0 - 0x4] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1], %g2 /* Load Group */
- - add %o0, 2, %o0 /* IEU0 */
- - add %o1, 2, %o1 /* IEU0 Group */
- - sth %g2, [%o0 - 0x2] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - nop /* IEU0 Group */
- - ldub [%o1], %g2 /* Load Group */
- - stb %g2, [%o0] /* Store Group + bubble */
- -1: retl
- - mov %g4, %o0
- -
- -212: brz,pt %g2, 2f /* CTI Group */
- - mov 8, %g1 /* IEU0 */
- - sub %g1, %g2, %g2 /* IEU0 Group */
- - sub %o2, %g2, %o2 /* IEU0 Group */
- -1: ldub [%o1], %g5 /* Load Group */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - subcc %g2, 1, %g2 /* IEU1 Group */
- - bne,pt %xcc, 1b /* CTI */
- - stb %g5, [%o0 - 1] /* Store */
- -2: andn %o2, 7, %g5 /* IEU0 Group */
- - and %o2, 7, %o2 /* IEU1 */
- - fmovd %f0, %f2 /* FPU */
- - alignaddr %o1, %g0, %g1 /* GRU Group */
- - ldd [%g1], %f4 /* Load Group */
- -1: ldd [%g1 + 0x8], %f6 /* Load Group */
- - add %g1, 0x8, %g1 /* IEU0 Group */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f4, %f6, %f0 /* GRU Group */
- - std %f0, [%o0] /* Store */
- - add %o1, 8, %o1 /* IEU0 Group */
- - be,pn %xcc, 213f /* CTI */
- - add %o0, 8, %o0 /* IEU1 */
- - ldd [%g1 + 0x8], %f4 /* Load Group */
- - add %g1, 8, %g1 /* IEU0 */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f6, %f4, %f0 /* GRU Group */
- - std %f0, [%o0] /* Store */
- - add %o1, 8, %o1 /* IEU0 */
- - bne,pn %xcc, 1b /* CTI Group */
- - add %o0, 8, %o0 /* IEU0 */
- -213: brz,pn %o2, 214f /* CTI Group */
- - nop /* IEU0 */
- - ldub [%o1], %g5 /* LOAD */
- - add %o1, 1, %o1 /* IEU0 */
- - add %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 */
- - bne,pt %xcc, 206b /* CTI */
- - stb %g5, [%o0 - 1] /* Store Group */
- -214: wr %g0, FPRS_FEF, %fprs
- - retl
- - mov %g4, %o0
- -END(memcpy)
- -libc_hidden_def(memcpy)
- -
- - .align 32
- -228: andcc %o2, 1, %g0 /* IEU1 Group */
- - be,pt %icc, 2f+4 /* CTI */
- -1: ldub [%o1 - 1], %o5 /* LOAD Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 Group */
- - be,pn %xcc, 229f /* CTI */
- - stb %o5, [%o0] /* Store */
- -2: ldub [%o1 - 1], %o5 /* LOAD Group */
- - sub %o0, 2, %o0 /* IEU0 */
- - ldub [%o1 - 2], %g5 /* LOAD Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - subcc %o2, 2, %o2 /* IEU1 Group */
- - stb %o5, [%o0 + 1] /* Store */
- - bne,pt %xcc, 2b /* CTI */
- - stb %g5, [%o0] /* Store */
- -229: retl
- - mov %g4, %o0
- -219: retl
- - nop
- -
- - .align 32
- -ENTRY(memmove)
- -#ifndef USE_BPR
- - srl %o2, 0, %o2 /* IEU1 Group */
- -#endif
- - brz,pn %o2, 219b /* CTI Group */
- - sub %o0, %o1, %o4 /* IEU0 */
- - cmp %o4, %o2 /* IEU1 Group */
- - bgeu,pt %XCC, 218b /* CTI */
- - mov %o0, %g4 /* IEU0 */
- - add %o0, %o2, %o0 /* IEU0 Group */
- -220: add %o1, %o2, %o1 /* IEU1 */
- - cmp %o2, 15 /* IEU1 Group */
- - bleu,pn %xcc, 228b /* CTI */
- - andcc %o0, 7, %g2 /* IEU1 Group */
- - sub %o0, %o1, %g5 /* IEU0 */
- - andcc %g5, 3, %o5 /* IEU1 Group */
- - bne,pn %xcc, 232f /* CTI */
- - andcc %o1, 3, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 236f /* CTI */
- - andcc %o1, 4, %g0 /* IEU1 Group */
- - andcc %o1, 1, %g0 /* IEU1 Group */
- - be,pn %xcc, 4f /* CTI */
- - andcc %o1, 2, %g0 /* IEU1 Group */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - sub %o2, 1, %o2 /* IEU0 Group */
- - be,pn %xcc, 5f /* CTI Group */
- - stb %g2, [%o0] /* Store */
- -4: lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - sub %o0, 2, %o0 /* IEU1 */
- - sub %o2, 2, %o2 /* IEU0 */
- - sth %g2, [%o0] /* Store Group + bubble */
- -5: andcc %o1, 4, %g0 /* IEU1 */
- -236: be,a,pn %xcc, 2f /* CTI */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- - lduw [%o1 - 4], %g5 /* Load Group */
- - sub %o1, 4, %o1 /* IEU0 */
- - sub %o0, 4, %o0 /* IEU1 */
- - sub %o2, 4, %o2 /* IEU0 Group */
- - stw %g5, [%o0] /* Store */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- -2: be,pn %xcc, 235f /* CTI */
- - andcc %o0, 4, %g0 /* IEU1 Group */
- - be,pn %xcc, 282f + 4 /* CTI Group */
- -5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- - subcc %g6, 128, %g6 /* IEU1 Group */
- - sub %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 5b /* CTI */
- - sub %o0, 128, %o0 /* IEU0 Group */
- -235: andcc %o2, 0x70, %g6 /* IEU1 Group */
- -41: be,pn %xcc, 280f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -279: rd %pc, %o5 /* PDU Group */
- - sll %g6, 1, %g5 /* IEU0 Group */
- - sub %o1, %g6, %o1 /* IEU1 */
- - sub %o5, %g5, %o5 /* IEU0 Group */
- - jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- - sub %o0, %g6, %o0 /* IEU0 Group */
- - RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
- -280: be,pt %xcc, 281f /* CTI */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1 - 8], %g2 /* Load Group */
- - sub %o0, 8, %o0 /* IEU0 */
- - stw %g2, [%o0 + 4] /* Store Group */
- - sub %o1, 8, %o1 /* IEU1 */
- - srlx %g2, 32, %g2 /* IEU0 Group */
- - stw %g2, [%o0] /* Store */
- -281: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1 - 4], %g2 /* Load Group */
- - sub %o1, 4, %o1 /* IEU0 */
- - stw %g2, [%o0 - 4] /* Store Group */
- - sub %o0, 4, %o0 /* IEU0 */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - sth %g2, [%o0 - 2] /* Store Group */
- - sub %o0, 2, %o0 /* IEU0 */
- -1: be,pt %xcc, 211f /* CTI */
- - nop /* IEU1 */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - stb %g2, [%o0 - 1] /* Store Group + bubble */
- -211: retl
- - mov %g4, %o0
- -
- -282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- - subcc %g6, 128, %g6 /* IEU1 Group */
- - sub %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 282b /* CTI */
- - sub %o0, 128, %o0 /* IEU0 Group */
- - andcc %o2, 0x70, %g6 /* IEU1 */
- - be,pn %xcc, 284f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -283: rd %pc, %o5 /* PDU Group */
- - sub %o1, %g6, %o1 /* IEU0 Group */
- - sub %o5, %g6, %o5 /* IEU1 */
- - jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- - sub %o0, %g6, %o0 /* IEU0 Group */
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
- -284: be,pt %xcc, 285f /* CTI Group */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1 - 8], %g2 /* Load Group */
- - sub %o0, 8, %o0 /* IEU0 */
- - sub %o1, 8, %o1 /* IEU0 Group */
- - stx %g2, [%o0] /* Store */
- -285: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1 - 4], %g2 /* Load Group */
- - sub %o0, 4, %o0 /* IEU0 */
- - sub %o1, 4, %o1 /* IEU0 Group */
- - stw %g2, [%o0] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o0, 2, %o0 /* IEU0 */
- - sub %o1, 2, %o1 /* IEU0 Group */
- - sth %g2, [%o0] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - nop /* IEU0 Group */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - stb %g2, [%o0 - 1] /* Store Group + bubble */
- -1: retl
- - mov %g4, %o0
- -
- -232: brz,pt %g2, 2f /* CTI Group */
- - sub %o2, %g2, %o2 /* IEU0 Group */
- -1: ldub [%o1 - 1], %g5 /* Load Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %g2, 1, %g2 /* IEU1 Group */
- - bne,pt %xcc, 1b /* CTI */
- - stb %g5, [%o0] /* Store */
- -2: andn %o2, 7, %g5 /* IEU0 Group */
- - and %o2, 7, %o2 /* IEU1 */
- - fmovd %f0, %f2 /* FPU */
- - alignaddr %o1, %g0, %g1 /* GRU Group */
- - ldd [%g1], %f4 /* Load Group */
- -1: ldd [%g1 - 8], %f6 /* Load Group */
- - sub %g1, 8, %g1 /* IEU0 Group */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f6, %f4, %f0 /* GRU Group */
- - std %f0, [%o0 - 8] /* Store */
- - sub %o1, 8, %o1 /* IEU0 Group */
- - be,pn %xcc, 233f /* CTI */
- - sub %o0, 8, %o0 /* IEU1 */
- - ldd [%g1 - 8], %f4 /* Load Group */
- - sub %g1, 8, %g1 /* IEU0 */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f4, %f6, %f0 /* GRU Group */
- - std %f0, [%o0 - 8] /* Store */
- - sub %o1, 8, %o1 /* IEU0 */
- - bne,pn %xcc, 1b /* CTI Group */
- - sub %o0, 8, %o0 /* IEU0 */
- -233: brz,pn %o2, 234f /* CTI Group */
- - nop /* IEU0 */
- -237: ldub [%o1 - 1], %g5 /* LOAD */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 */
- - bne,pt %xcc, 237b /* CTI */
- - stb %g5, [%o0] /* Store Group */
- -234: wr %g0, FPRS_FEF, %fprs
- - retl
- - mov %g4, %o0
- -END(memmove)
- -libc_hidden_def(memmove)
- -
- -#ifdef USE_BPR
- -weak_alias(memcpy,__align_cpy_1)
- -weak_alias(memcpy,__align_cpy_2)
- -#endif
- diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
- deleted file mode 100644
- index f76a637..0000000
- --- a/libc/string/sparc/sparc64/memset.S
- +++ /dev/null
- @@ -1,316 +0,0 @@
- -/* Set a block of memory to some byte value.
- - For UltraSPARC.
- - Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by David S. Miller (davem@caip.rutgers.edu) and
- - Jakub Jelinek (jj@ultra.linux.cz).
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <features.h>
- -#include <asm/asi.h>
- -#ifndef XCC
- -#define XCC xcc
- -#define USE_BPR
- -#endif
- -#define FPRS_FEF 4
- -
- -#define SET_BLOCKS(base, offset, source) \
- - stx source, [base - offset - 0x18]; \
- - stx source, [base - offset - 0x10]; \
- - stx source, [base - offset - 0x08]; \
- - stx source, [base - offset - 0x00];
- -
- - /* Well, memset is a lot easier to get right than bcopy... */
- - .text
- - .align 32
- -ENTRY(memset)
- - andcc %o1, 0xff, %o1
- - mov %o0, %o5
- - be,a,pt %icc, 50f
- -#ifndef USE_BPR
- - srl %o2, 0, %o1
- -#else
- - mov %o2, %o1
- -#endif
- - cmp %o2, 7
- -#ifndef USE_BPR
- - srl %o2, 0, %o2
- -#endif
- - bleu,pn %XCC, 17f
- - andcc %o0, 3, %g5
- - be,pt %xcc, 4f
- - and %o1, 0xff, %o1
- - cmp %g5, 3
- - be,pn %xcc, 2f
- - stb %o1, [%o0 + 0x00]
- - cmp %g5, 2
- - be,pt %xcc, 2f
- - stb %o1, [%o0 + 0x01]
- - stb %o1, [%o0 + 0x02]
- -2: sub %g5, 4, %g5
- - sub %o0, %g5, %o0
- - add %o2, %g5, %o2
- -4: sllx %o1, 8, %g1
- - andcc %o0, 4, %g0
- - or %o1, %g1, %o1
- - sllx %o1, 16, %g1
- - or %o1, %g1, %o1
- - be,pt %xcc, 2f
- - sllx %o1, 32, %g1
- - stw %o1, [%o0]
- - sub %o2, 4, %o2
- - add %o0, 4, %o0
- -2: cmp %o2, 128
- - or %o1, %g1, %o1
- - blu,pn %xcc, 9f
- - andcc %o0, 0x38, %g5
- - be,pn %icc, 6f
- - mov 64, %o4
- - andcc %o0, 8, %g0
- - be,pn %icc, 1f
- - sub %o4, %g5, %o4
- - stx %o1, [%o0]
- - add %o0, 8, %o0
- -1: andcc %o4, 16, %g0
- - be,pn %icc, 1f
- - sub %o2, %o4, %o2
- - stx %o1, [%o0]
- - stx %o1, [%o0 + 8]
- - add %o0, 16, %o0
- -1: andcc %o4, 32, %g0
- - be,pn %icc, 7f
- - andncc %o2, 0x3f, %o3
- - stw %o1, [%o0]
- - stw %o1, [%o0 + 4]
- - stw %o1, [%o0 + 8]
- - stw %o1, [%o0 + 12]
- - stw %o1, [%o0 + 16]
- - stw %o1, [%o0 + 20]
- - stw %o1, [%o0 + 24]
- - stw %o1, [%o0 + 28]
- - add %o0, 32, %o0
- -7: be,pn %xcc, 9f
- - nop
- - ldd [%o0 - 8], %f0
- -18: wr %g0, ASI_BLK_P, %asi
- - membar #StoreStore | #LoadStore
- - andcc %o3, 0xc0, %g5
- - and %o2, 0x3f, %o2
- - fmovd %f0, %f2
- - fmovd %f0, %f4
- - andn %o3, 0xff, %o3
- - fmovd %f0, %f6
- - cmp %g5, 64
- - fmovd %f0, %f8
- - fmovd %f0, %f10
- - fmovd %f0, %f12
- - brz,pn %g5, 10f
- - fmovd %f0, %f14
- - be,pn %icc, 2f
- - stda %f0, [%o0 + 0x00] %asi
- - cmp %g5, 128
- - be,pn %icc, 2f
- - stda %f0, [%o0 + 0x40] %asi
- - stda %f0, [%o0 + 0x80] %asi
- -2: brz,pn %o3, 12f
- - add %o0, %g5, %o0
- -10: stda %f0, [%o0 + 0x00] %asi
- - stda %f0, [%o0 + 0x40] %asi
- - stda %f0, [%o0 + 0x80] %asi
- - stda %f0, [%o0 + 0xc0] %asi
- -11: subcc %o3, 256, %o3
- - bne,pt %xcc, 10b
- - add %o0, 256, %o0
- -12: wr %g0, FPRS_FEF, %fprs
- - membar #StoreLoad | #StoreStore
- -9: andcc %o2, 0x78, %g5
- - be,pn %xcc, 13f
- - andcc %o2, 7, %o2
- -14: rd %pc, %o4
- - srl %g5, 1, %o3
- - sub %o4, %o3, %o4
- - jmpl %o4 + (13f - 14b), %g0
- - add %o0, %g5, %o0
- -12: SET_BLOCKS (%o0, 0x68, %o1)
- - SET_BLOCKS (%o0, 0x48, %o1)
- - SET_BLOCKS (%o0, 0x28, %o1)
- - SET_BLOCKS (%o0, 0x08, %o1)
- -13: be,pn %xcc, 8f
- - andcc %o2, 4, %g0
- - be,pn %xcc, 1f
- - andcc %o2, 2, %g0
- - stw %o1, [%o0]
- - add %o0, 4, %o0
- -1: be,pn %xcc, 1f
- - andcc %o2, 1, %g0
- - sth %o1, [%o0]
- - add %o0, 2, %o0
- -1: bne,a,pn %xcc, 8f
- - stb %o1, [%o0]
- -8: retl
- - mov %o5, %o0
- -17: brz,pn %o2, 0f
- -8: add %o0, 1, %o0
- - subcc %o2, 1, %o2
- - bne,pt %xcc, 8b
- - stb %o1, [%o0 - 1]
- -0: retl
- - mov %o5, %o0
- -
- -6: stx %o1, [%o0]
- - andncc %o2, 0x3f, %o3
- - be,pn %xcc, 9b
- - nop
- - ba,pt %xcc, 18b
- - ldd [%o0], %f0
- -END(memset)
- -libc_hidden_def(memset)
- -
- -#define ZERO_BLOCKS(base, offset, source) \
- - stx source, [base - offset - 0x38]; \
- - stx source, [base - offset - 0x30]; \
- - stx source, [base - offset - 0x28]; \
- - stx source, [base - offset - 0x20]; \
- - stx source, [base - offset - 0x18]; \
- - stx source, [base - offset - 0x10]; \
- - stx source, [base - offset - 0x08]; \
- - stx source, [base - offset - 0x00];
- -
- - .text
- - .align 32
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -ENTRY(bzero)
- -#ifndef USE_BPR
- - srl %o1, 0, %o1
- -#endif
- - mov %o0, %o5
- -#endif
- -50: cmp %o1, 7
- - bleu,pn %xcc, 17f
- - andcc %o0, 3, %o2
- - be,a,pt %xcc, 4f
- - andcc %o0, 4, %g0
- - cmp %o2, 3
- - be,pn %xcc, 2f
- - stb %g0, [%o0 + 0x00]
- - cmp %o2, 2
- - be,pt %xcc, 2f
- - stb %g0, [%o0 + 0x01]
- - stb %g0, [%o0 + 0x02]
- -2: sub %o2, 4, %o2
- - sub %o0, %o2, %o0
- - add %o1, %o2, %o1
- - andcc %o0, 4, %g0
- -4: be,pt %xcc, 2f
- - cmp %o1, 128
- - stw %g0, [%o0]
- - sub %o1, 4, %o1
- - add %o0, 4, %o0
- -2: blu,pn %xcc, 9f
- - andcc %o0, 0x38, %o2
- - be,pn %icc, 6f
- - mov 64, %o4
- - andcc %o0, 8, %g0
- - be,pn %icc, 1f
- - sub %o4, %o2, %o4
- - stx %g0, [%o0]
- - add %o0, 8, %o0
- -1: andcc %o4, 16, %g0
- - be,pn %icc, 1f
- - sub %o1, %o4, %o1
- - stx %g0, [%o0]
- - stx %g0, [%o0 + 8]
- - add %o0, 16, %o0
- -1: andcc %o4, 32, %g0
- - be,pn %icc, 7f
- - andncc %o1, 0x3f, %o3
- - stx %g0, [%o0]
- - stx %g0, [%o0 + 8]
- - stx %g0, [%o0 + 16]
- - stx %g0, [%o0 + 24]
- - add %o0, 32, %o0
- -6: andncc %o1, 0x3f, %o3
- -7: be,pn %xcc, 9f
- - wr %g0, ASI_BLK_P, %asi
- - membar #StoreLoad | #StoreStore | #LoadStore
- - fzero %f0
- - andcc %o3, 0xc0, %o2
- - and %o1, 0x3f, %o1
- - fzero %f2
- - andn %o3, 0xff, %o3
- - faddd %f0, %f2, %f4
- - fmuld %f0, %f2, %f6
- - cmp %o2, 64
- - faddd %f0, %f2, %f8
- - fmuld %f0, %f2, %f10
- - faddd %f0, %f2, %f12
- - brz,pn %o2, 10f
- - fmuld %f0, %f2, %f14
- - be,pn %icc, 2f
- - stda %f0, [%o0 + 0x00] %asi
- - cmp %o2, 128
- - be,pn %icc, 2f
- - stda %f0, [%o0 + 0x40] %asi
- - stda %f0, [%o0 + 0x80] %asi
- -2: brz,pn %o3, 12f
- - add %o0, %o2, %o0
- -10: stda %f0, [%o0 + 0x00] %asi
- - stda %f0, [%o0 + 0x40] %asi
- - stda %f0, [%o0 + 0x80] %asi
- - stda %f0, [%o0 + 0xc0] %asi
- -11: subcc %o3, 256, %o3
- - bne,pt %xcc, 10b
- - add %o0, 256, %o0
- -12: wr %g0, FPRS_FEF, %fprs
- - membar #StoreLoad | #StoreStore
- -9: andcc %o1, 0xf8, %o2
- - be,pn %xcc, 13f
- - andcc %o1, 7, %o1
- -14: rd %pc, %o4
- - srl %o2, 1, %o3
- - sub %o4, %o3, %o4
- - jmpl %o4 + (13f - 14b), %g0
- - add %o0, %o2, %o0
- -12: ZERO_BLOCKS (%o0, 0xc8, %g0)
- - ZERO_BLOCKS (%o0, 0x88, %g0)
- - ZERO_BLOCKS (%o0, 0x48, %g0)
- - ZERO_BLOCKS (%o0, 0x08, %g0)
- -13: be,pn %xcc, 8f
- - andcc %o1, 4, %g0
- - be,pn %xcc, 1f
- - andcc %o1, 2, %g0
- - stw %g0, [%o0]
- - add %o0, 4, %o0
- -1: be,pn %xcc, 1f
- - andcc %o1, 1, %g0
- - sth %g0, [%o0]
- - add %o0, 2, %o0
- -1: bne,a,pn %xcc, 8f
- - stb %g0, [%o0]
- -8: retl
- - mov %o5, %o0
- -17: be,pn %xcc, 13b
- - orcc %o1, 0, %g0
- - be,pn %xcc, 0f
- -8: add %o0, 1, %o0
- - subcc %o1, 1, %o1
- - bne,pt %xcc, 8b
- - stb %g0, [%o0 - 1]
- -0: retl
- - mov %o5, %o0
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -END(bzero)
- -#endif
- diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
- deleted file mode 100644
- index 8bbdc84..0000000
- --- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
- +++ /dev/null
- @@ -1,611 +0,0 @@
- -/* Copy SIZE bytes from SRC to DEST.
- - For UltraSPARC-III.
- - Copyright (C) 2001, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by David S. Miller (davem@redhat.com)
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <features.h>
- -
- -#define ASI_BLK_P 0xf0
- -#define FPRS_FEF 0x04
- -#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
- -#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
- -
- -#ifndef XCC
- -#define USE_BPR
- -#define XCC xcc
- -#endif
- -
- - .register %g2,#scratch
- - .register %g3,#scratch
- - .register %g6,#scratch
- -
- - .text
- - .align 32
- -
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -ENTRY(bcopy)
- - sub %o1, %o0, %o4
- - mov %o0, %g4
- - cmp %o4, %o2
- - mov %o1, %o0
- - bgeu,pt %XCC, 100f
- - mov %g4, %o1
- -#ifndef USE_BPR
- - srl %o2, 0, %o2
- -#endif
- - brnz,pn %o2, 220f
- - add %o0, %o2, %o0
- - retl
- - nop
- -END(bcopy)
- -#endif
- -
- - /* Special/non-trivial issues of this code:
- - *
- - * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
- - * 2) Only low 32 FPU registers are used so that only the
- - * lower half of the FPU register set is dirtied by this
- - * code. This is especially important in the kernel.
- - * 3) This code never prefetches cachelines past the end
- - * of the source buffer.
- - *
- - * The cheetah's flexible spine, oversized liver, enlarged heart,
- - * slender muscular body, and claws make it the swiftest hunter
- - * in Africa and the fastest animal on land. Can reach speeds
- - * of up to 2.4GB per second.
- - */
- - .align 32
- -ENTRY(memcpy)
- -
- -100: /* %o0=dst, %o1=src, %o2=len */
- - mov %o0, %g5
- - cmp %o2, 0
- - be,pn %XCC, out
- -218: or %o0, %o1, %o3
- - cmp %o2, 16
- - bleu,a,pn %XCC, small_copy
- - or %o3, %o2, %o3
- -
- - cmp %o2, 256
- - blu,pt %XCC, medium_copy
- - andcc %o3, 0x7, %g0
- -
- - ba,pt %xcc, enter
- - andcc %o0, 0x3f, %g2
- -
- - /* Here len >= 256 and condition codes reflect execution
- - * of "andcc %o0, 0x7, %g2", done by caller.
- - */
- - .align 64
- -enter:
- - /* Is 'dst' already aligned on an 64-byte boundary? */
- - be,pt %XCC, 2f
- -
- - /* Compute abs((dst & 0x3f) - 0x40) into %g2. This is the number
- - * of bytes to copy to make 'dst' 64-byte aligned. We pre-
- - * subtract this from 'len'.
- - */
- - sub %g2, 0x40, %g2
- - sub %g0, %g2, %g2
- - sub %o2, %g2, %o2
- -
- - /* Copy %g2 bytes from src to dst, one byte at a time. */
- -1: ldub [%o1 + 0x00], %o3
- - add %o1, 0x1, %o1
- - add %o0, 0x1, %o0
- - subcc %g2, 0x1, %g2
- -
- - bg,pt %XCC, 1b
- - stb %o3, [%o0 + -1]
- -
- -2: VISEntryHalf
- - and %o1, 0x7, %g1
- - ba,pt %xcc, begin
- - alignaddr %o1, %g0, %o1
- -
- - .align 64
- -begin:
- - prefetch [%o1 + 0x000], #one_read
- - prefetch [%o1 + 0x040], #one_read
- - andn %o2, (0x40 - 1), %o4
- - prefetch [%o1 + 0x080], #one_read
- - prefetch [%o1 + 0x0c0], #one_read
- - ldd [%o1 + 0x000], %f0
- - prefetch [%o1 + 0x100], #one_read
- - ldd [%o1 + 0x008], %f2
- - prefetch [%o1 + 0x140], #one_read
- - ldd [%o1 + 0x010], %f4
- - prefetch [%o1 + 0x180], #one_read
- - faligndata %f0, %f2, %f16
- - ldd [%o1 + 0x018], %f6
- - faligndata %f2, %f4, %f18
- - ldd [%o1 + 0x020], %f8
- - faligndata %f4, %f6, %f20
- - ldd [%o1 + 0x028], %f10
- - faligndata %f6, %f8, %f22
- -
- - ldd [%o1 + 0x030], %f12
- - faligndata %f8, %f10, %f24
- - ldd [%o1 + 0x038], %f14
- - faligndata %f10, %f12, %f26
- - ldd [%o1 + 0x040], %f0
- -
- - sub %o4, 0x80, %o4
- - add %o1, 0x40, %o1
- - ba,pt %xcc, loop
- - srl %o4, 6, %o3
- -
- - .align 64
- -loop:
- - ldd [%o1 + 0x008], %f2
- - faligndata %f12, %f14, %f28
- - ldd [%o1 + 0x010], %f4
- - faligndata %f14, %f0, %f30
- - stda %f16, [%o0] ASI_BLK_P
- - ldd [%o1 + 0x018], %f6
- - faligndata %f0, %f2, %f16
- -
- - ldd [%o1 + 0x020], %f8
- - faligndata %f2, %f4, %f18
- - ldd [%o1 + 0x028], %f10
- - faligndata %f4, %f6, %f20
- - ldd [%o1 + 0x030], %f12
- - faligndata %f6, %f8, %f22
- - ldd [%o1 + 0x038], %f14
- - faligndata %f8, %f10, %f24
- -
- - ldd [%o1 + 0x040], %f0
- - prefetch [%o1 + 0x180], #one_read
- - faligndata %f10, %f12, %f26
- - subcc %o3, 0x01, %o3
- - add %o1, 0x40, %o1
- - bg,pt %XCC, loop
- - add %o0, 0x40, %o0
- -
- - /* Finally we copy the last full 64-byte block. */
- -loopfini:
- - ldd [%o1 + 0x008], %f2
- - faligndata %f12, %f14, %f28
- - ldd [%o1 + 0x010], %f4
- - faligndata %f14, %f0, %f30
- - stda %f16, [%o0] ASI_BLK_P
- - ldd [%o1 + 0x018], %f6
- - faligndata %f0, %f2, %f16
- - ldd [%o1 + 0x020], %f8
- - faligndata %f2, %f4, %f18
- - ldd [%o1 + 0x028], %f10
- - faligndata %f4, %f6, %f20
- - ldd [%o1 + 0x030], %f12
- - faligndata %f6, %f8, %f22
- - ldd [%o1 + 0x038], %f14
- - faligndata %f8, %f10, %f24
- - cmp %g1, 0
- - be,pt %XCC, 1f
- - add %o0, 0x40, %o0
- - ldd [%o1 + 0x040], %f0
- -1: faligndata %f10, %f12, %f26
- - faligndata %f12, %f14, %f28
- - faligndata %f14, %f0, %f30
- - stda %f16, [%o0] ASI_BLK_P
- - add %o0, 0x40, %o0
- - add %o1, 0x40, %o1
- - membar #Sync
- -
- - /* Now we copy the (len modulo 64) bytes at the end.
- - * Note how we borrow the %f0 loaded above.
- - *
- - * Also notice how this code is careful not to perform a
- - * load past the end of the src buffer.
- - */
- -loopend:
- - and %o2, 0x3f, %o2
- - andcc %o2, 0x38, %g2
- - be,pn %XCC, endcruft
- - subcc %g2, 0x8, %g2
- - be,pn %XCC, endcruft
- - cmp %g1, 0
- -
- - be,a,pt %XCC, 1f
- - ldd [%o1 + 0x00], %f0
- -
- -1: ldd [%o1 + 0x08], %f2
- - add %o1, 0x8, %o1
- - sub %o2, 0x8, %o2
- - subcc %g2, 0x8, %g2
- - faligndata %f0, %f2, %f8
- - std %f8, [%o0 + 0x00]
- - be,pn %XCC, endcruft
- - add %o0, 0x8, %o0
- - ldd [%o1 + 0x08], %f0
- - add %o1, 0x8, %o1
- - sub %o2, 0x8, %o2
- - subcc %g2, 0x8, %g2
- - faligndata %f2, %f0, %f8
- - std %f8, [%o0 + 0x00]
- - bne,pn %XCC, 1b
- - add %o0, 0x8, %o0
- -
- - /* If anything is left, we copy it one byte at a time.
- - * Note that %g1 is (src & 0x3) saved above before the
- - * alignaddr was performed.
- - */
- -endcruft:
- - cmp %o2, 0
- - add %o1, %g1, %o1
- - VISExitHalf
- - be,pn %XCC, out
- - sub %o0, %o1, %o3
- -
- - andcc %g1, 0x7, %g0
- - bne,pn %icc, small_copy_unaligned
- - andcc %o2, 0x8, %g0
- - be,pt %icc, 1f
- - nop
- - ldx [%o1], %o5
- - stx %o5, [%o1 + %o3]
- - add %o1, 0x8, %o1
- -
- -1: andcc %o2, 0x4, %g0
- - be,pt %icc, 1f
- - nop
- - lduw [%o1], %o5
- - stw %o5, [%o1 + %o3]
- - add %o1, 0x4, %o1
- -
- -1: andcc %o2, 0x2, %g0
- - be,pt %icc, 1f
- - nop
- - lduh [%o1], %o5
- - sth %o5, [%o1 + %o3]
- - add %o1, 0x2, %o1
- -
- -1: andcc %o2, 0x1, %g0
- - be,pt %icc, out
- - nop
- - ldub [%o1], %o5
- - ba,pt %xcc, out
- - stb %o5, [%o1 + %o3]
- -
- -medium_copy: /* 16 < len <= 64 */
- - bne,pn %XCC, small_copy_unaligned
- - sub %o0, %o1, %o3
- -
- -medium_copy_aligned:
- - andn %o2, 0x7, %o4
- - and %o2, 0x7, %o2
- -1: subcc %o4, 0x8, %o4
- - ldx [%o1], %o5
- - stx %o5, [%o1 + %o3]
- - bgu,pt %XCC, 1b
- - add %o1, 0x8, %o1
- - andcc %o2, 0x4, %g0
- - be,pt %XCC, 1f
- - nop
- - sub %o2, 0x4, %o2
- - lduw [%o1], %o5
- - stw %o5, [%o1 + %o3]
- - add %o1, 0x4, %o1
- -1: cmp %o2, 0
- - be,pt %XCC, out
- - nop
- - ba,pt %xcc, small_copy_unaligned
- - nop
- -
- -small_copy: /* 0 < len <= 16 */
- - andcc %o3, 0x3, %g0
- - bne,pn %XCC, small_copy_unaligned
- - sub %o0, %o1, %o3
- -
- -small_copy_aligned:
- - subcc %o2, 4, %o2
- - lduw [%o1], %g1
- - stw %g1, [%o1 + %o3]
- - bgu,pt %XCC, small_copy_aligned
- - add %o1, 4, %o1
- -
- -out: retl
- - mov %g5, %o0
- -
- - .align 32
- -small_copy_unaligned:
- - subcc %o2, 1, %o2
- - ldub [%o1], %g1
- - stb %g1, [%o1 + %o3]
- - bgu,pt %XCC, small_copy_unaligned
- - add %o1, 1, %o1
- - retl
- - mov %g5, %o0
- -
- -END(memcpy)
- -libc_hidden_def(memcpy)
- -
- -#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src - offset - 0x20], %t0; \
- - ldx [%src - offset - 0x18], %t1; \
- - ldx [%src - offset - 0x10], %t2; \
- - ldx [%src - offset - 0x08], %t3; \
- - stw %t0, [%dst - offset - 0x1c]; \
- - srlx %t0, 32, %t0; \
- - stw %t0, [%dst - offset - 0x20]; \
- - stw %t1, [%dst - offset - 0x14]; \
- - srlx %t1, 32, %t1; \
- - stw %t1, [%dst - offset - 0x18]; \
- - stw %t2, [%dst - offset - 0x0c]; \
- - srlx %t2, 32, %t2; \
- - stw %t2, [%dst - offset - 0x10]; \
- - stw %t3, [%dst - offset - 0x04]; \
- - srlx %t3, 32, %t3; \
- - stw %t3, [%dst - offset - 0x08];
- -
- -#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src - offset - 0x20], %t0; \
- - ldx [%src - offset - 0x18], %t1; \
- - ldx [%src - offset - 0x10], %t2; \
- - ldx [%src - offset - 0x08], %t3; \
- - stx %t0, [%dst - offset - 0x20]; \
- - stx %t1, [%dst - offset - 0x18]; \
- - stx %t2, [%dst - offset - 0x10]; \
- - stx %t3, [%dst - offset - 0x08]; \
- - ldx [%src - offset - 0x40], %t0; \
- - ldx [%src - offset - 0x38], %t1; \
- - ldx [%src - offset - 0x30], %t2; \
- - ldx [%src - offset - 0x28], %t3; \
- - stx %t0, [%dst - offset - 0x40]; \
- - stx %t1, [%dst - offset - 0x38]; \
- - stx %t2, [%dst - offset - 0x30]; \
- - stx %t3, [%dst - offset - 0x28];
- -
- -#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - stw %t0, [%dst + offset + 0x04]; \
- - srlx %t0, 32, %t2; \
- - stw %t2, [%dst + offset + 0x00]; \
- - stw %t1, [%dst + offset + 0x0c]; \
- - srlx %t1, 32, %t3; \
- - stw %t3, [%dst + offset + 0x08];
- -
- -#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- - ldx [%src + offset + 0x00], %t0; \
- - ldx [%src + offset + 0x08], %t1; \
- - stx %t0, [%dst + offset + 0x00]; \
- - stx %t1, [%dst + offset + 0x08];
- -
- - .align 32
- -228: andcc %o2, 1, %g0 /* IEU1 Group */
- - be,pt %icc, 2f+4 /* CTI */
- -1: ldub [%o1 - 1], %o5 /* LOAD Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 Group */
- - be,pn %xcc, 229f /* CTI */
- - stb %o5, [%o0] /* Store */
- -2: ldub [%o1 - 1], %o5 /* LOAD Group */
- - sub %o0, 2, %o0 /* IEU0 */
- - ldub [%o1 - 2], %g5 /* LOAD Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - subcc %o2, 2, %o2 /* IEU1 Group */
- - stb %o5, [%o0 + 1] /* Store */
- - bne,pt %xcc, 2b /* CTI */
- - stb %g5, [%o0] /* Store */
- -229: retl
- - mov %g4, %o0
- -
- - .align 32
- -ENTRY(memmove)
- - mov %o0, %g5
- -#ifndef USE_BPR
- - srl %o2, 0, %o2 /* IEU1 Group */
- -#endif
- - brz,pn %o2, out /* CTI Group */
- - sub %o0, %o1, %o4 /* IEU0 */
- - cmp %o4, %o2 /* IEU1 Group */
- - bgeu,pt %XCC, 218b /* CTI */
- - mov %o0, %g4 /* IEU0 */
- - add %o0, %o2, %o0 /* IEU0 Group */
- -220: add %o1, %o2, %o1 /* IEU1 */
- - cmp %o2, 15 /* IEU1 Group */
- - bleu,pn %xcc, 228b /* CTI */
- - andcc %o0, 7, %g2 /* IEU1 Group */
- - sub %o0, %o1, %g5 /* IEU0 */
- - andcc %g5, 3, %o5 /* IEU1 Group */
- - bne,pn %xcc, 232f /* CTI */
- - andcc %o1, 3, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 236f /* CTI */
- - andcc %o1, 4, %g0 /* IEU1 Group */
- - andcc %o1, 1, %g0 /* IEU1 Group */
- - be,pn %xcc, 4f /* CTI */
- - andcc %o1, 2, %g0 /* IEU1 Group */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - sub %o2, 1, %o2 /* IEU0 Group */
- - be,pn %xcc, 5f /* CTI Group */
- - stb %g2, [%o0] /* Store */
- -4: lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - sub %o0, 2, %o0 /* IEU1 */
- - sub %o2, 2, %o2 /* IEU0 */
- - sth %g2, [%o0] /* Store Group + bubble */
- -5: andcc %o1, 4, %g0 /* IEU1 */
- -236: be,a,pn %xcc, 2f /* CTI */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- - lduw [%o1 - 4], %g5 /* Load Group */
- - sub %o1, 4, %o1 /* IEU0 */
- - sub %o0, 4, %o0 /* IEU1 */
- - sub %o2, 4, %o2 /* IEU0 Group */
- - stw %g5, [%o0] /* Store */
- - andcc %o2, -128, %g6 /* IEU1 Group */
- -2: be,pn %xcc, 235f /* CTI */
- - andcc %o0, 4, %g0 /* IEU1 Group */
- - be,pn %xcc, 282f + 4 /* CTI Group */
- -5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- - RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- - subcc %g6, 128, %g6 /* IEU1 Group */
- - sub %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 5b /* CTI */
- - sub %o0, 128, %o0 /* IEU0 Group */
- -235: andcc %o2, 0x70, %g6 /* IEU1 Group */
- -41: be,pn %xcc, 280f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -279: rd %pc, %o5 /* PDU Group */
- - sll %g6, 1, %g5 /* IEU0 Group */
- - sub %o1, %g6, %o1 /* IEU1 */
- - sub %o5, %g5, %o5 /* IEU0 Group */
- - jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- - sub %o0, %g6, %o0 /* IEU0 Group */
- - RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- - RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
- -280: be,pt %xcc, 281f /* CTI */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1 - 8], %g2 /* Load Group */
- - sub %o0, 8, %o0 /* IEU0 */
- - stw %g2, [%o0 + 4] /* Store Group */
- - sub %o1, 8, %o1 /* IEU1 */
- - srlx %g2, 32, %g2 /* IEU0 Group */
- - stw %g2, [%o0] /* Store */
- -281: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1 - 4], %g2 /* Load Group */
- - sub %o1, 4, %o1 /* IEU0 */
- - stw %g2, [%o0 - 4] /* Store Group */
- - sub %o0, 4, %o0 /* IEU0 */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o1, 2, %o1 /* IEU0 */
- - sth %g2, [%o0 - 2] /* Store Group */
- - sub %o0, 2, %o0 /* IEU0 */
- -1: be,pt %xcc, 211f /* CTI */
- - nop /* IEU1 */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - stb %g2, [%o0 - 1] /* Store Group + bubble */
- -211: retl
- - mov %g4, %o0
- -
- -282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- - RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- - subcc %g6, 128, %g6 /* IEU1 Group */
- - sub %o1, 128, %o1 /* IEU0 */
- - bne,pt %xcc, 282b /* CTI */
- - sub %o0, 128, %o0 /* IEU0 Group */
- - andcc %o2, 0x70, %g6 /* IEU1 */
- - be,pn %xcc, 284f /* CTI */
- - andcc %o2, 8, %g0 /* IEU1 Group */
- - /* Clk1 8-( */
- - /* Clk2 8-( */
- - /* Clk3 8-( */
- - /* Clk4 8-( */
- -283: rd %pc, %o5 /* PDU Group */
- - sub %o1, %g6, %o1 /* IEU0 Group */
- - sub %o5, %g6, %o5 /* IEU1 */
- - jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- - sub %o0, %g6, %o0 /* IEU0 Group */
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- - RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
- -284: be,pt %xcc, 285f /* CTI Group */
- - andcc %o2, 4, %g0 /* IEU1 */
- - ldx [%o1 - 8], %g2 /* Load Group */
- - sub %o0, 8, %o0 /* IEU0 */
- - sub %o1, 8, %o1 /* IEU0 Group */
- - stx %g2, [%o0] /* Store */
- -285: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 2, %g0 /* IEU1 Group */
- - lduw [%o1 - 4], %g2 /* Load Group */
- - sub %o0, 4, %o0 /* IEU0 */
- - sub %o1, 4, %o1 /* IEU0 Group */
- - stw %g2, [%o0] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - andcc %o2, 1, %g0 /* IEU1 Group */
- - lduh [%o1 - 2], %g2 /* Load Group */
- - sub %o0, 2, %o0 /* IEU0 */
- - sub %o1, 2, %o1 /* IEU0 Group */
- - sth %g2, [%o0] /* Store */
- -1: be,pt %xcc, 1f /* CTI */
- - nop /* IEU0 Group */
- - ldub [%o1 - 1], %g2 /* Load Group */
- - stb %g2, [%o0 - 1] /* Store Group + bubble */
- -1: retl
- - mov %g4, %o0
- -
- -232: brz,pt %g2, 2f /* CTI Group */
- - sub %o2, %g2, %o2 /* IEU0 Group */
- -1: ldub [%o1 - 1], %g5 /* Load Group */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %g2, 1, %g2 /* IEU1 Group */
- - bne,pt %xcc, 1b /* CTI */
- - stb %g5, [%o0] /* Store */
- -2: andn %o2, 7, %g5 /* IEU0 Group */
- - and %o2, 7, %o2 /* IEU1 */
- - fmovd %f0, %f2 /* FPU */
- - alignaddr %o1, %g0, %g1 /* GRU Group */
- - ldd [%g1], %f4 /* Load Group */
- -1: ldd [%g1 - 8], %f6 /* Load Group */
- - sub %g1, 8, %g1 /* IEU0 Group */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f6, %f4, %f0 /* GRU Group */
- - std %f0, [%o0 - 8] /* Store */
- - sub %o1, 8, %o1 /* IEU0 Group */
- - be,pn %xcc, 233f /* CTI */
- - sub %o0, 8, %o0 /* IEU1 */
- - ldd [%g1 - 8], %f4 /* Load Group */
- - sub %g1, 8, %g1 /* IEU0 */
- - subcc %g5, 8, %g5 /* IEU1 */
- - faligndata %f4, %f6, %f0 /* GRU Group */
- - std %f0, [%o0 - 8] /* Store */
- - sub %o1, 8, %o1 /* IEU0 */
- - bne,pn %xcc, 1b /* CTI Group */
- - sub %o0, 8, %o0 /* IEU0 */
- -233: brz,pn %o2, 234f /* CTI Group */
- - nop /* IEU0 */
- -237: ldub [%o1 - 1], %g5 /* LOAD */
- - sub %o1, 1, %o1 /* IEU0 */
- - sub %o0, 1, %o0 /* IEU1 */
- - subcc %o2, 1, %o2 /* IEU1 */
- - bne,pt %xcc, 237b /* CTI */
- - stb %g5, [%o0] /* Store Group */
- -234: wr %g0, FPRS_FEF, %fprs
- - retl
- - mov %g4, %o0
- -END(memmove)
- -libc_hidden_def(memmove)
- -
- -#ifdef USE_BPR
- -weak_alias(memcpy,__align_cpy_1)
- -weak_alias(memcpy,__align_cpy_2)
- -weak_alias(memcpy,__align_cpy_4)
- -weak_alias(memcpy,__align_cpy_8)
- -weak_alias(memcpy,__align_cpy_16)
- -#endif
- diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S
- deleted file mode 100644
- index 9af0d56..0000000
- --- a/libc/string/sparc/sparc64/stpcpy.S
- +++ /dev/null
- @@ -1,270 +0,0 @@
- -/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
- - For SPARC v9.
- - Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -#ifndef XCC
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(stpcpy)
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- - sllx %g1, 32, %g2 /* IEU0 Group */
- -
- - bne,pn %icc, 12f /* CTI */
- - andcc %o1, 7, %g3 /* IEU1 */
- - or %g1, %g2, %g1 /* IEU0 Group */
- - bne,pn %icc, 14f /* CTI */
- -
- - sllx %g1, 7, %g2 /* IEU0 Group */
- -1: ldx [%o1], %o3 /* Load */
- - add %o1, 8, %o1 /* IEU1 */
- -2: mov %o3, %g3 /* IEU0 Group */
- -
- - sub %o3, %g1, %o2 /* IEU1 */
- -3: ldxa [%o1] ASI_PNF, %o3 /* Load */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %g3, %o2 /* IEU0 Group */
- -#endif
- - add %o0, 8, %o0 /* IEU0 Group */
- - andcc %o2, %g2, %g0 /* IEU1 */
- -
- - add %o1, 8, %o1 /* IEU0 Group */
- - be,a,pt %xcc, 2b /* CTI */
- - stx %g3, [%o0 - 8] /* Store */
- - srlx %g3, 56, %g5 /* IEU0 Group */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 11f /* CTI */
- - srlx %g3, 48, %g4 /* IEU0 */
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 10f /* CTI */
- - srlx %g3, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 9f /* CTI */
- -
- - srlx %g3, 32, %g4 /* IEU0 */
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 8f /* CTI */
- - srlx %g3, 24, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- - srlx %g3, 16, %g4 /* IEU0 */
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 6f /* CTI */
- - srlx %g3, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- -
- - sub %o3, %g1, %o2 /* IEU0 */
- - stx %g3, [%o0 - 8] /* Store Group */
- - andcc %g3, 0xff, %g0 /* IEU1 */
- - bne,pt %icc, 3b /* CTI */
- -
- - mov %o3, %g3 /* IEU0 Group */
- -4: retl /* CTI+IEU1 Group */
- - sub %o0, 1, %o0 /* IEU0 */
- -
- - .align 16
- -6: ba,pt %xcc, 23f /* CTI Group */
- - sub %o0, 3, %g6 /* IEU0 */
- -5: sub %o0, 2, %g6 /* IEU0 Group */
- - stb %g5, [%o0 - 2] /* Store */
- -
- - srlx %g3, 16, %g4 /* IEU0 Group */
- -23: sth %g4, [%o0 - 4] /* Store */
- - srlx %g3, 32, %g4 /* IEU0 Group */
- - stw %g4, [%o0 - 8] /* Store */
- -
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -8: ba,pt %xcc, 24f /* CTI Group */
- - sub %o0, 5, %g6 /* IEU0 */
- -
- -7: sub %o0, 4, %g6 /* IEU0 Group */
- - stb %g5, [%o0 - 4] /* Store */
- - srlx %g3, 32, %g4 /* IEU0 Group */
- -24: stw %g4, [%o0 - 8] /* Store */
- -
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -10: ba,pt %xcc, 25f /* CTI Group */
- - sub %o0, 7, %g6 /* IEU0 */
- -
- -9: sub %o0, 6, %g6 /* IEU0 Group */
- - stb %g5, [%o0 - 6] /* Store */
- - srlx %g3, 48, %g4 /* IEU0 */
- -25: sth %g4, [%o0 - 8] /* Store Group */
- -
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -11: stb %g5, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- -
- - sub %o0, 8, %o0 /* IEU0 */
- -
- - .align 16
- -12: or %g1, %g2, %g1 /* IEU0 Group */
- - ldub [%o1], %o3 /* Load */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- - stb %o3, [%o0] /* Store Group */
- -
- -13: add %o0, 1, %o0 /* IEU0 */
- - add %o1, 1, %o1 /* IEU1 */
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- -
- - lduba [%o1] ASI_PNF, %o3 /* Load */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- - bne,a,pt %icc, 13b /* CTI */
- - stb %o3, [%o0] /* Store */
- -
- - andcc %o1, 7, %g3 /* IEU1 Group */
- - be,a,pt %icc, 1b /* CTI */
- - ldx [%o1], %o3 /* Load */
- -14: orcc %g0, 64, %g4 /* IEU1 Group */
- -
- - sllx %g3, 3, %g5 /* IEU0 */
- - sub %o1, %g3, %o1 /* IEU0 Group */
- - sub %g4, %g5, %g4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080808080808080 *
- - * %g3 = source alignment *
- - * %g5 = number of bits to shift left *
- - * %g4 = number of bits to shift right */
- - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
- -
- - addcc %o1, 8, %o1 /* IEU1 */
- -15: sllx %o5, %g5, %o3 /* IEU0 Group */
- - ldxa [%o1] ASI_PNF, %o5 /* Load */
- - srlx %o5, %g4, %o4 /* IEU0 Group */
- -
- - add %o0, 8, %o0 /* IEU1 */
- - or %o3, %o4, %o3 /* IEU0 Group */
- - add %o1, 8, %o1 /* IEU1 */
- - sub %o3, %g1, %o4 /* IEU0 Group */
- -
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o4, %o3, %o4 /* IEU0 Group */
- -#endif
- - andcc %o4, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - srlx %o3, 56, %o4 /* IEU0 Group */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 22f /* CTI */
- - srlx %o3, 48, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 21f /* CTI */
- - srlx %o3, 40, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 20f /* CTI */
- -
- - srlx %o3, 32, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 19f /* CTI */
- - srlx %o3, 24, %o4 /* IEU0 */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 18f /* CTI */
- - srlx %o3, 16, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 17f /* CTI */
- - srlx %o3, 8, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 16f /* CTI */
- -
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - bne,pn %icc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- -
- - sub %o0, 1, %o0 /* IEU0 */
- -
- - .align 16
- -17: ba,pt %xcc, 26f /* CTI Group */
- - subcc %o0, 3, %g6 /* IEU1 */
- -18: ba,pt %xcc, 27f /* CTI Group */
- - subcc %o0, 4, %g6 /* IEU1 */
- -
- -19: ba,pt %xcc, 28f /* CTI Group */
- - subcc %o0, 5, %g6 /* IEU1 */
- -16: subcc %o0, 2, %g6 /* IEU1 Group */
- - srlx %o3, 8, %o4 /* IEU0 */
- -
- - stb %o4, [%o0 - 2] /* Store */
- -26: srlx %o3, 16, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 3] /* Store */
- -27: srlx %o3, 24, %o4 /* IEU0 Group */
- -
- - stb %o4, [%o0 - 4] /* Store */
- -28: srlx %o3, 32, %o4 /* IEU0 Group */
- - stw %o4, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -21: ba,pt %xcc, 29f /* CTI Group */
- - subcc %o0, 7, %g6 /* IEU1 */
- -22: ba,pt %xcc, 30f /* CTI Group */
- - subcc %o0, 8, %g6 /* IEU1 */
- -
- -20: subcc %o0, 6, %g6 /* IEU1 Group */
- - srlx %o3, 40, %o4 /* IEU0 */
- - stb %o4, [%o0 - 6] /* Store */
- -29: srlx %o3, 48, %o4 /* IEU0 Group */
- -
- - stb %o4, [%o0 - 7] /* Store */
- -30: srlx %o3, 56, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -END(stpcpy)
- -libc_hidden_def(stpcpy)
- diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
- deleted file mode 100644
- index 56725cc..0000000
- --- a/libc/string/sparc/sparc64/strcat.S
- +++ /dev/null
- @@ -1,338 +0,0 @@
- -/* strcat (dest, src) -- Append SRC on the end of DEST.
- - For SPARC v9.
- - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
- - Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -#ifndef XCC
- -#define XCC xcc
- -#define USE_BPR
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(strcat)
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - ldub [%o0], %o3 /* Load */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- - mov %o0, %g6 /* IEU1 */
- -
- - sllx %g1, 32, %g2 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- - or %g1, %g2, %g1 /* IEU0 Group */
- - bne,pn %icc, 32f /* CTI */
- -
- - sllx %g1, 7, %g2 /* IEU0 Group */
- - brz,pn %o3, 30f /* CTI+IEU1 */
- - ldx [%o0], %o3 /* Load */
- -48: add %o0, 8, %o0 /* IEU0 Group */
- -
- -49: sub %o3, %g1, %o2 /* IEU0 Group */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %o3, %g5 /* IEU0 Group */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %g5, %g2, %g0 /* IEU1 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g2, %g0 /* IEU1 Group */
- -#endif
- - be,pt %xcc, 49b /* CTI */
- -
- - add %o0, 8, %o0 /* IEU0 */
- - addcc %o2, %g1, %g3 /* IEU1 Group */
- - srlx %o2, 32, %o2 /* IEU0 */
- -50: andcc %o2, %g2, %g0 /* IEU1 Group */
- -
- - be,pn %xcc, 51f /* CTI */
- - srlx %g3, 56, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 29f /* CTI */
- -
- - srlx %g3, 48, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 28f /* CTI */
- - srlx %g3, 40, %o2 /* IEU0 */
- -
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 27f /* CTI */
- - srlx %g3, 32, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 26f /* CTI */
- -51: srlx %g3, 24, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 25f /* CTI */
- -
- - srlx %g3, 16, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 24f /* CTI */
- - srlx %g3, 8, %o2 /* IEU0 */
- -
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 23f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 52f /* CTI */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 49b /* CTI */
- -
- - add %o0, 8, %o0 /* IEU0 */
- - addcc %o2, %g1, %g3 /* IEU1 Group */
- - ba,pt %xcc, 50b /* CTI */
- - srlx %o2, 32, %o2 /* IEU0 */
- -
- - .align 16
- -52: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -9, %o0 /* IEU0 */
- -23: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -10, %o0 /* IEU0 */
- -
- -24: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -11, %o0 /* IEU0 */
- -25: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -12, %o0 /* IEU0 */
- -
- -26: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -13, %o0 /* IEU0 */
- -27: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -14, %o0 /* IEU0 */
- -
- -28: ba,pt %xcc, 12f /* CTI Group */
- - add %o0, -15, %o0 /* IEU0 */
- -29: add %o0, -16, %o0 /* IEU0 Group */
- -30: andcc %o1, 7, %g3 /* IEU1 */
- -
- -31: bne,pn %icc, 14f /* CTI */
- - orcc %g0, 64, %g4 /* IEU1 Group */
- -1: ldx [%o1], %o3 /* Load */
- - add %o1, 8, %o1 /* IEU1 */
- -
- -2: mov %o3, %g3 /* IEU0 Group */
- -3: sub %o3, %g1, %o2 /* IEU1 */
- - ldxa [%o1] ASI_PNF, %o3 /* Load */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %g3, %o2 /* IEU0 Group */
- -#endif
- - add %o0, 8, %o0 /* IEU0 Group */
- -
- - andcc %o2, %g2, %g0 /* IEU1 */
- - add %o1, 8, %o1 /* IEU0 Group */
- - be,a,pt %xcc, 2b /* CTI */
- - stx %g3, [%o0 - 8] /* Store */
- -
- - srlx %g3, 56, %g5 /* IEU0 Group */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 11f /* CTI */
- - srlx %g3, 48, %g4 /* IEU0 */
- -
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 10f /* CTI */
- - srlx %g3, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 9f /* CTI */
- - srlx %g3, 32, %g4 /* IEU0 */
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 8f /* CTI */
- -
- - srlx %g3, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- - srlx %g3, 16, %g4 /* IEU0 */
- -
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 6f /* CTI */
- - srlx %g3, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 5f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- - stx %g3, [%o0 - 8] /* Store Group */
- - andcc %g3, 0xff, %g0 /* IEU1 */
- -
- - bne,pt %icc, 3b /* CTI */
- - mov %o3, %g3 /* IEU0 Group */
- -4: retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -5: stb %g5, [%o0 - 2] /* Store Group */
- - srlx %g3, 16, %g4 /* IEU0 */
- -6: sth %g4, [%o0 - 4] /* Store Group */
- - srlx %g3, 32, %g4 /* IEU0 */
- -
- - stw %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -7: stb %g5, [%o0 - 4] /* Store Group */
- -
- - srlx %g3, 32, %g4 /* IEU0 */
- -8: stw %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- -9: stb %g5, [%o0 - 6] /* Store Group */
- - srlx %g3, 48, %g4 /* IEU0 */
- -10: sth %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -11: stb %g5, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -32: andcc %o0, 7, %g0 /* IEU1 Group */
- - be,a,pn %icc, 48b /* CTI */
- - ldx [%o0], %o3 /* Load */
- - add %o0, 1, %o0 /* IEU0 Group */
- -
- - brnz,a,pt %o3, 32b /* CTI+IEU1 */
- - lduba [%o0] ASI_PNF, %o3 /* Load */
- - add %o0, -1, %o0 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- -
- - be,a,pn %icc, 31b /* CTI */
- - andcc %o1, 7, %g3 /* IEU1 Group */
- -12: ldub [%o1], %o3 /* Load */
- - stb %o3, [%o0] /* Store Group */
- -
- -13: add %o0, 1, %o0 /* IEU0 */
- - add %o1, 1, %o1 /* IEU1 */
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- -
- - lduba [%o1] ASI_PNF, %o3 /* Load */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- - bne,a,pt %icc, 13b /* CTI */
- - stb %o3, [%o0] /* Store */
- -
- - andcc %o1, 7, %g3 /* IEU1 Group */
- - be,a,pt %icc, 1b /* CTI */
- - ldx [%o1], %o3 /* Load */
- - orcc %g0, 64, %g4 /* IEU1 Group */
- -
- -14: sllx %g3, 3, %g5 /* IEU0 */
- - sub %o1, %g3, %o1 /* IEU0 Group */
- - sub %g4, %g5, %g4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080808080808080 *
- - * %g3 = source alignment *
- - * %g5 = number of bits to shift left *
- - * %g4 = number of bits to shift right */
- - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
- -
- - addcc %o1, 8, %o1 /* IEU1 */
- -15: sllx %o5, %g5, %o3 /* IEU0 Group */
- - ldxa [%o1] ASI_PNF, %o5 /* Load */
- - srlx %o5, %g4, %o4 /* IEU0 Group */
- -
- - add %o0, 8, %o0 /* IEU1 */
- - or %o3, %o4, %o3 /* IEU0 Group */
- - add %o1, 8, %o1 /* IEU1 */
- - sub %o3, %g1, %o4 /* IEU0 Group */
- -
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o4, %o3, %o4 /* IEU0 Group */
- -#endif
- - andcc %o4, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - srlx %o3, 56, %o4 /* IEU0 Group */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 22f /* CTI */
- - srlx %o3, 48, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 21f /* CTI */
- - srlx %o3, 40, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 20f /* CTI */
- -
- - srlx %o3, 32, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 19f /* CTI */
- - srlx %o3, 24, %o4 /* IEU0 */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 18f /* CTI */
- - srlx %o3, 16, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 17f /* CTI */
- - srlx %o3, 8, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 16f /* CTI */
- -
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - bne,pn %icc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -16: srlx %o3, 8, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 2] /* Store */
- -17: srlx %o3, 16, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 3] /* Store */
- -
- -18: srlx %o3, 24, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 4] /* Store */
- -19: srlx %o3, 32, %o4 /* IEU0 Group */
- - stw %o4, [%o0 - 8] /* Store */
- -
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- - nop
- - nop
- -
- -20: srlx %o3, 40, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 6] /* Store */
- -21: srlx %o3, 48, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 7] /* Store */
- -
- -22: srlx %o3, 56, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -END(strcat)
- -libc_hidden_def(strcat)
- diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
- deleted file mode 100644
- index 25810fd..0000000
- --- a/libc/string/sparc/sparc64/strchr.S
- +++ /dev/null
- @@ -1,485 +0,0 @@
- -/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
- - For SPARC v9.
- - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <features.h>
- -#include <asm/asi.h>
- -#ifndef XCC
- -#define XCC xcc
- -#define USE_BPR
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(strchr)
- - andcc %o1, 0xff, %o1 /* IEU1 Group */
- - be,pn %icc, 17f /* CTI */
- - sllx %o1, 8, %g3 /* IEU0 Group */
- - sethi %hi(0x01010101), %g1 /* IEU1 */
- -
- - or %g3, %o1, %g3 /* IEU0 Group */
- - ldub [%o0], %o3 /* Load */
- - sllx %g3, 16, %g5 /* IEU0 Group */
- - or %g1, %lo(0x01010101), %g1 /* IEU1 */
- -
- - sllx %g1, 32, %g2 /* IEU0 Group */
- - brz,pn %o3, 5f /* CTI+IEU1 */
- - orcc %g3, %g5, %g3 /* IEU1 Group */
- - sllx %g3, 32, %g5 /* IEU0 */
- -
- - cmp %o3, %o1 /* IEU1 Group */
- - be,pn %xcc, 14f /* CTI */
- - or %g1, %g2, %g1 /* IEU0 */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- -
- - bne,a,pn %icc, 15f /* CTI */
- - add %o0, 1, %o0 /* IEU0 */
- - ldx [%o0], %o3 /* Load Group */
- -1: sllx %g1, 7, %g2 /* IEU0 */
- -
- - or %g3, %g5, %g3 /* IEU1 */
- - add %o0, 8, %o0 /* IEU0 Group */
- - xor %o3, %g3, %o4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080088080808080 *
- - * %g3 = c c c c c c c c *
- - * %o3 = value *
- - * %o4 = value XOR c */
- -2: sub %o3, %g1, %o2 /* IEU0 Group */
- -
- - sub %o4, %g1, %o5 /* IEU1 */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %o3, %g6 /* IEU0 Group */
- - andn %o5, %o4, %o5 /* IEU1 */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - or %o5, %g6, %o5 /* IEU0 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - or %o5, %o2, %o5 /* IEU0 Group */
- -#endif
- - add %o0, 8, %o0 /* IEU1 */
- -
- - andcc %o5, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 2b /* CTI */
- - xor %o3, %g3, %o4 /* IEU0 */
- - srlx %o5, 32, %g5 /* IEU0 Group */
- -
- - add %o2, %g1, %o2 /* IEU1 */
- -3: andcc %g5, %g2, %g0 /* IEU1 Group */
- - be,pn %xcc, 4f /* CTI */
- - srlx %o2, 56, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - srlx %o4, 56, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 6f /* CTI */
- - srlx %o2, 48, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- -
- - srlx %o4, 48, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- - srlx %o2, 40, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - srlx %o4, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 8f /* CTI */
- - srlx %o2, 32, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- -
- - srlx %o4, 32, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 9f /* CTI */
- -4: srlx %o2, 24, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - srlx %o4, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 10f /* CTI */
- - srlx %o2, 16, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- -
- - srlx %o4, 16, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 11f /* CTI */
- - srlx %o2, 8, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - srlx %o4, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 12f /* CTI */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 13f /* CTI */
- - xor %o3, %g3, %o4 /* IEU0 */
- - ldxa [%o0] ASI_PNF, %o3 /* Load Group */
- -
- - sub %o4, %g1, %o5 /* IEU0 */
- - or %o5, %o2, %o5 /* IEU1 */
- - add %o0, 8, %o0 /* IEU0 Group */
- - andcc %o5, %g2, %g0 /* IEU1 */
- -
- - be,a,pt %xcc, 2b /* CTI */
- - xor %o3, %g3, %o4 /* IEU0 Group */
- - srlx %o5, 32, %g5 /* IEU0 Group */
- - ba,pt %xcc, 3b /* CTI */
- -
- - add %o2, %g1, %o2 /* IEU1 */
- -
- - .align 16
- -5: retl /* CTI+IEU1 Group */
- - clr %o0 /* IEU0 */
- -6: retl /* CTI+IEU1 Group */
- - add %o0, -16, %o0 /* IEU0 */
- -
- -7: retl /* CTI+IEU1 Group */
- - add %o0, -15, %o0 /* IEU0 */
- -8: retl /* CTI+IEU1 Group */
- - add %o0, -14, %o0 /* IEU0 */
- -
- -9: retl /* CTI+IEU1 Group */
- - add %o0, -13, %o0 /* IEU0 */
- -10: retl /* CTI+IEU1 Group */
- - add %o0, -12, %o0 /* IEU0 */
- -
- -11: retl /* CTI+IEU1 Group */
- - add %o0, -11, %o0 /* IEU0 */
- -12: retl /* CTI+IEU1 Group */
- - add %o0, -10, %o0 /* IEU0 */
- -
- -13: retl /* CTI+IEU1 Group */
- - add %o0, -9, %o0 /* IEU0 */
- -14: retl /* CTI+IEU1 Group */
- - nop /* IEU0 */
- -
- - .align 16
- -15: ldub [%o0], %o3 /* Load Group */
- -16: andcc %o0, 7, %g0 /* IEU1 */
- - be,a,pn %icc, 1b /* CTI */
- - ldx [%o0], %o3 /* Load Group */
- -
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5b /* CTI */
- - add %o0, 1, %o0 /* IEU0 */
- - cmp %o3, %o1 /* IEU1 Group */
- -
- - bne,a,pn %icc, 16b /* CTI */
- - ldub [%o0], %o3 /* Load */
- - retl /* CTI+IEU1 Group */
- - add %o0, -1, %o0 /* IEU0 */
- -
- - /* strchr (str, 0) */
- - .align 32
- - nop
- - .align 16
- -17: sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - ldub [%o0], %o3 /* Load */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- - sllx %g1, 32, %g2 /* IEU0 Group */
- -
- - andcc %o0, 7, %g0 /* IEU1 */
- - or %g1, %g2, %g1 /* IEU0 Group */
- - bne,pn %icc, 32f /* CTI */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- -
- - brz,pn %o3, 30f /* CTI+IEU1 */
- - ldx [%o0], %o3 /* Load */
- -18: add %o0, 8, %o0 /* IEU0 Group */
- -19: sub %o3, %g1, %o2 /* IEU0 Group */
- -
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %o3, %g6 /* IEU0 Group */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %g6, %g2, %g0 /* IEU1 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g2, %g0 /* IEU1 Group */
- -#endif
- - be,pt %xcc, 19b /* CTI */
- - add %o0, 8, %o0 /* IEU0 */
- -
- - addcc %o2, %g1, %g3 /* IEU1 Group */
- - srlx %o2, 32, %o2 /* IEU0 */
- -20: andcc %o2, %g2, %g0 /* IEU1 Group */
- - be,pn %xcc, 21f /* CTI */
- -
- - srlx %g3, 56, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 29f /* CTI */
- - srlx %g3, 48, %o2 /* IEU0 */
- -
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 28f /* CTI */
- - srlx %g3, 40, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 27f /* CTI */
- - srlx %g3, 32, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 26f /* CTI */
- -
- -21: srlx %g3, 24, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 25f /* CTI */
- - srlx %g3, 16, %o2 /* IEU0 */
- -
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 24f /* CTI */
- - srlx %g3, 8, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 23f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 22f /* CTI */
- -
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 19b /* CTI */
- - add %o0, 8, %o0 /* IEU0 */
- -
- - addcc %o2, %g1, %g3 /* IEU1 Group */
- - ba,pt %xcc, 20b /* CTI */
- - srlx %o2, 32, %o2 /* IEU0 */
- -
- - .align 16
- -22: retl /* CTI+IEU1 Group */
- - add %o0, -9, %o0 /* IEU0 */
- -23: retl /* CTI+IEU1 Group */
- - add %o0, -10, %o0 /* IEU0 */
- -
- -24: retl /* CTI+IEU1 Group */
- - add %o0, -11, %o0 /* IEU0 */
- -25: retl /* CTI+IEU1 Group */
- - add %o0, -12, %o0 /* IEU0 */
- -
- -26: retl /* CTI+IEU1 Group */
- - add %o0, -13, %o0 /* IEU0 */
- -27: retl /* CTI+IEU1 Group */
- - add %o0, -14, %o0 /* IEU0 */
- -
- -28: retl /* CTI+IEU1 Group */
- - add %o0, -15, %o0 /* IEU0 */
- -29: retl /* CTI+IEU1 Group */
- - add %o0, -16, %o0 /* IEU0 */
- -
- -30: retl /* CTI+IEU1 Group */
- - nop /* IEU0 */
- -
- - .align 16
- -32: andcc %o0, 7, %g0 /* IEU1 Group */
- - be,a,pn %icc, 18b /* CTI */
- - ldx [%o0], %o3 /* Load */
- - add %o0, 1, %o0 /* IEU0 Group */
- -
- - brnz,a,pt %o3, 32b /* CTI+IEU1 */
- - lduba [%o0] ASI_PNF, %o3 /* Load */
- - retl /* CTI+IEU1 Group */
- - add %o0, -1, %o0 /* IEU0 */
- -END(strchr)
- -libc_hidden_def(strchr)
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -strong_alias(strchr,index)
- -#endif
- -
- - .align 32
- -ENTRY(strrchr)
- - andcc %o1, 0xff, %o1 /* IEU1 Group */
- - be,pn %icc, 17b /* CTI */
- - clr %g4 /* IEU0 */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- -
- - bne,pn %icc, 13f /* CTI */
- - sllx %o1, 8, %g3 /* IEU0 */
- - ldx [%o0], %o3 /* Load Group */
- -1: sethi %hi(0x01010101), %g1 /* IEU0 */
- -
- - or %g3, %o1, %g3 /* IEU1 */
- - sllx %g3, 16, %g5 /* IEU0 Group */
- - or %g1, %lo(0x01010101), %g1 /* IEU1 */
- - sllx %g1, 32, %g2 /* IEU0 Group */
- -
- - or %g3, %g5, %g3 /* IEU1 */
- - sllx %g3, 32, %g5 /* IEU0 Group */
- - or %g1, %g2, %g1 /* IEU1 */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- -
- - or %g3, %g5, %g3 /* IEU1 */
- - add %o0, 8, %o0 /* IEU0 Group */
- - xor %o3, %g3, %o4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080088080808080 *
- - * %g3 = c c c c c c c c *
- - * %o3 = value *
- - * %o4 = value XOR c */
- -2: sub %o3, %g1, %o2 /* IEU0 Group */
- -
- -3: sub %o4, %g1, %o5 /* IEU1 */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %o3, %g6 /* IEU0 Group */
- - andn %o5, %o4, %o5 /* IEU1 */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- -
- - or %o5, %g6, %o5 /* IEU0 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- -
- - or %o5, %o2, %o5 /* IEU0 Group */
- -#endif
- - add %o0, 8, %o0 /* IEU1 */
- - andcc %o5, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 2b /* CTI */
- -
- - xor %o3, %g3, %o4 /* IEU0 */
- - srlx %o5, 32, %g5 /* IEU0 Group */
- - add %o2, %g1, %o2 /* IEU1 */
- - andcc %g5, %g2, %g0 /* IEU1 Group */
- -
- - be,pn %xcc, 7f /* CTI */
- - srlx %o2, 56, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- -
- - srlx %o4, 56, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - srlx %o2, 48, %g5 /* IEU0 */
- - be,a,pn %icc, 4f /* CTI */
- -
- - add %o0, -16, %g4 /* IEU0 Group */
- -4: andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- - srlx %o4, 48, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - srlx %o2, 40, %g5 /* IEU0 */
- - be,a,pn %icc, 5f /* CTI */
- - add %o0, -15, %g4 /* IEU0 Group */
- -
- -5: andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- - srlx %o4, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - srlx %o2, 32, %g5 /* IEU0 */
- - be,a,pn %icc, 6f /* CTI */
- - add %o0, -14, %g4 /* IEU0 Group */
- -6: andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 12f /* CTI */
- - srlx %o4, 32, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,a,pn %icc, 7f /* CTI */
- -
- - add %o0, -13, %g4 /* IEU0 */
- -7: srlx %o2, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- -
- - srlx %o4, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - srlx %o2, 16, %g5 /* IEU0 */
- - be,a,pn %icc, 8f /* CTI */
- -
- - add %o0, -12, %g4 /* IEU0 Group */
- -8: andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- - srlx %o4, 16, %g5 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - srlx %o2, 8, %g5 /* IEU0 */
- - be,a,pn %icc, 9f /* CTI */
- - add %o0, -11, %g4 /* IEU0 Group */
- -
- -9: andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- - srlx %o4, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,a,pn %icc, 10f /* CTI */
- - add %o0, -10, %g4 /* IEU0 */
- -10: andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12f /* CTI */
- -
- - sub %o3, %g1, %o2 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,a,pn %icc, 11f /* CTI */
- - add %o0, -9, %g4 /* IEU0 */
- -
- -11: ba,pt %xcc, 3b /* CTI Group */
- - xor %o3, %g3, %o4 /* IEU0 Group */
- -12: retl /* CTI+IEU1 Group */
- - mov %g4, %o0 /* IEU0 */
- -
- - .align 16
- -13: ldub [%o0], %o3 /* Load Group */
- - add %o0, 1, %o0 /* IEU0 */
- -14: andcc %o3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 12b /* CTI */
- -
- - cmp %o3, %o1 /* IEU1 Group */
- - ldub [%o0], %o3 /* Load */
- - be,a,pn %icc, 15f /* CTI */
- - add %o0, -1, %g4 /* IEU0 Group */
- -
- -15: andcc %o0, 7, %g0 /* IEU1 Group */
- - bne,a,pt %icc, 14b /* CTI */
- - add %o0, 1, %o0 /* IEU0 */
- - ba,pt %xcc, 1b /* CTI Group */
- -
- - ldx [%o0], %o3 /* Load */
- -END(strrchr)
- -libc_hidden_def(strrchr)
- -#ifdef __UCLIBC_SUSV3_LEGACY__
- -strong_alias(strrchr,rindex)
- -#endif
- diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
- deleted file mode 100644
- index 7b85007..0000000
- --- a/libc/string/sparc/sparc64/strcmp.S
- +++ /dev/null
- @@ -1,278 +0,0 @@
- -/* Compare two strings for differences.
- - For SPARC v9.
- - Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -#ifndef XCC
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(strcmp)
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- - bne,pn %icc, 7f /* CTI */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- -
- - andcc %o1, 7, %g3 /* IEU1 */
- - bne,pn %icc, 9f /* CTI */
- - sllx %g1, 32, %g2 /* IEU0 Group */
- - ldx [%o0], %o2 /* Load */
- -
- - or %g1, %g2, %g1 /* IEU0 Group */
- -1: ldx [%o1], %o3 /* Load */
- - sub %o1, %o0, %o1 /* IEU1 */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- -
- -2: add %o0, 8, %o0 /* IEU1 */
- - sub %o2, %g1, %g3 /* IEU0 Group */
- - subcc %o2, %o3, %g0 /* IEU1 */
- - bne,pn %xcc, 13f /* CTI */
- -
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %g3, %o2, %g4 /* IEU0 Group */
- - ldxa [%o0] ASI_PNF, %o2 /* Load */
- - andcc %g4, %g2, %g0 /* IEU1 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o2 /* Load Group */
- - andcc %g3, %g2, %g0 /* IEU1 */
- -#endif
- - be,a,pt %xcc, 2b /* CTI */
- - ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load Group */
- -
- - addcc %g3, %g1, %o4 /* IEU1 */
- - srlx %g3, 32, %g3 /* IEU0 */
- - andcc %g3, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 3f /* CTI */
- -
- - srlx %o4, 56, %o5 /* IEU0 */
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 48, %o5 /* IEU0 */
- -
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 40, %o5 /* IEU0 */
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 32, %o5 /* IEU0 */
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4f /* CTI */
- -
- -3: srlx %o4, 24, %o5 /* IEU0 */
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 16, %o5 /* IEU0 */
- -
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4f /* CTI */
- - srlx %o4, 8, %o5 /* IEU0 */
- - andcc %o5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 4f /* CTI */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - bne,a,pn %icc, 2b /* CTI */
- - ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load */
- -
- -4: retl /* CTI+IEU1 Group */
- - clr %o0 /* IEU0 */
- -
- - .align 32
- -13: mov 0xff, %g6 /* IEU0 Group */
- -#ifdef EIGHTBIT_NOT_RARE
- - andcc %g4, %g2, %g0 /* IEU1 */
- -#else
- - andcc %g3, %g2, %g0 /* IEU1 */
- -#endif
- - be,pt %xcc, 25f /* CTI */
- - addcc %g3, %g1, %o4 /* IEU1 Group */
- -
- - srlx %g3, 32, %g3 /* IEU0 */
- - andcc %g3, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 23f /* CTI */
- - sllx %g6, 56, %o5 /* IEU0 */
- -
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- - be,pn %xcc, 24f /* CTI */
- - sllx %g6, 48, %o5 /* IEU0 */
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- -
- - be,pn %xcc, 24f /* CTI */
- - sllx %g6, 40, %o5 /* IEU0 */
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- - be,pn %xcc, 24f /* CTI */
- -
- - sllx %g6, 32, %o5 /* IEU0 */
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- - be,pn %xcc, 24f /* CTI */
- -23: sllx %g6, 24, %o5 /* IEU0 */
- -
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- - be,pn %icc, 24f /* CTI */
- - sllx %g6, 16, %o5 /* IEU0 */
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 24f /* CTI */
- - sllx %g6, 8, %o5 /* IEU0 */
- - andcc %o4, %o5, %g0 /* IEU1 Group */
- - be,pn %icc, 24f /* CTI */
- -
- - mov %g6, %o5 /* IEU0 */
- -25: cmp %o4, %o3 /* IEU1 Group */
- -5: mov -1, %o0 /* IEU0 */
- - retl /* CTI+IEU1 Group */
- -
- - movgu %xcc, 1, %o0 /* Single Group */
- -
- - .align 16
- -24: sub %o5, 1, %g6 /* IEU0 Group */
- - clr %o0 /* IEU1 */
- - or %o5, %g6, %o5 /* IEU0 Group */
- - andn %o4, %o5, %o4 /* IEU0 Group */
- -
- - andn %o3, %o5, %o3 /* IEU1 */
- - cmp %o4, %o3 /* IEU1 Group */
- - movgu %xcc, 1, %o0 /* Single Group */
- - retl /* CTI+IEU1 Group */
- -
- - movlu %xcc, -1, %o0 /* Single Group */
- -6: retl /* CTI+IEU1 Group */
- - mov %o4, %o0 /* IEU0 */
- -
- - .align 16
- -7: ldub [%o0], %o2 /* Load */
- - add %o0, 1, %o0 /* IEU1 */
- - ldub [%o1], %o3 /* Load Group */
- - sllx %g1, 32, %g2 /* IEU0 */
- -
- -8: add %o1, 1, %o1 /* IEU1 */
- - subcc %o2, %o3, %o4 /* IEU1 Group */
- - bne,pn %xcc, 6b /* CTI */
- - lduba [%o0] ASI_PNF, %o2 /* Load */
- -
- - brz,pn %o3, 4b /* CTI+IEU1 Group */
- - lduba [%o1] ASI_PNF, %o3 /* Load */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- - bne,a,pn %icc, 8b /* CTI */
- -
- - add %o0, 1, %o0 /* IEU0 */
- - or %g1, %g2, %g1 /* IEU0 Group */
- - andcc %o1, 7, %g3 /* IEU1 */
- - be,a,pn %icc, 1b /* CTI */
- -
- - ldxa [%o0] ASI_PNF, %o2 /* Load Group */
- -9: sllx %g3, 3, %g5 /* IEU0 */
- - mov 64, %o5 /* IEU1 */
- - sub %o1, %g3, %o1 /* IEU0 Group */
- -
- - sub %o5, %g5, %o5 /* IEU1 */
- - ldxa [%o1] ASI_PNF, %g6 /* Load Group */
- - or %g1, %g2, %g1 /* IEU0 */
- - sub %o1, %o0, %o1 /* IEU1 */
- -
- - sllx %g1, 7, %g2 /* IEU0 Group */
- - add %o1, 8, %o1 /* IEU1 */
- - /* %g1 = 0101010101010101
- - * %g2 = 8080808080800880
- - * %g5 = number of bits to shift left
- - * %o5 = number of bits to shift right */
- -10: sllx %g6, %g5, %o3 /* IEU0 Group */
- - ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
- -
- -11: srlx %g6, %o5, %o4 /* IEU0 Group */
- - ldxa [%o0] ASI_PNF, %o2 /* Load */
- - or %o3, %o4, %o3 /* IEU1 */
- - add %o0, 8, %o0 /* IEU0 Group */
- -
- - subcc %o2, %o3, %g0 /* IEU1 */
- -#ifdef EIGHTBIT_NOT_RARE
- - sub %o2, %g1, %g3 /* IEU0 Group */
- - bne,pn %xcc, 13b /* CTI */
- - andn %g3, %o2, %g4 /* IEU0 Group */
- -
- - andcc %g4, %g2, %g0 /* IEU1 Group */
- - be,pt %xcc, 10b /* CTI */
- - srlx %g4, 32, %g4 /* IEU0 */
- - andcc %g4, %g2, %g0 /* IEU1 Group */
- -#else
- - bne,pn %xcc, 13b /* CTI */
- - sub %o2, %g1, %g3 /* IEU0 Group */
- - andcc %g3, %g2, %g0 /* IEU1 Group */
- -
- - be,pt %xcc, 10b /* CTI */
- - srlx %g3, 32, %g3 /* IEU0 */
- - andcc %g3, %g2, %g0 /* IEU1 Group */
- -#endif
- - be,pt %xcc, 12f /* CTI */
- -
- - srlx %o2, 56, %g3 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- - srlx %o2, 48, %g3 /* IEU0 */
- -
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- - srlx %o2, 40, %g3 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 4b /* CTI */
- - srlx %o2, 32, %g3 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- -
- -12: srlx %o2, 24, %g3 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- - srlx %o2, 16, %g3 /* IEU0 */
- -
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- - srlx %o2, 8, %g3 /* IEU0 */
- - andcc %g3, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 4b /* CTI */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- - sllx %g6, %g5, %o3 /* IEU0 */
- -
- - ba,pt %xcc, 11b /* CTI Group */
- - ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
- -END(strcmp)
- -libc_hidden_def(strcmp)
- diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
- deleted file mode 100644
- index 28799e4..0000000
- --- a/libc/string/sparc/sparc64/strcpy.S
- +++ /dev/null
- @@ -1,244 +0,0 @@
- -/* Copy SRC to DEST returning DEST.
- - For SPARC v9.
- - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -#ifndef XCC
- - .register %g2, #scratch
- - .register %g3, #scratch
- - .register %g6, #scratch
- -#endif
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(strcpy)
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - mov %o0, %g6 /* IEU1 */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- -
- - sllx %g1, 32, %g2 /* IEU0 Group */
- - bne,pn %icc, 12f /* CTI */
- - andcc %o1, 7, %g3 /* IEU1 */
- - or %g1, %g2, %g1 /* IEU0 Group */
- -
- - bne,pn %icc, 14f /* CTI */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- -1: ldx [%o1], %o3 /* Load */
- - add %o1, 8, %o1 /* IEU1 */
- -
- -2: mov %o3, %g3 /* IEU0 Group */
- -3: sub %o3, %g1, %o2 /* IEU1 */
- - ldxa [%o1] ASI_PNF, %o3 /* Load */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %g3, %o2 /* IEU0 Group */
- -#endif
- - add %o0, 8, %o0 /* IEU0 Group */
- -
- - andcc %o2, %g2, %g0 /* IEU1 */
- - add %o1, 8, %o1 /* IEU0 Group */
- - be,a,pt %xcc, 2b /* CTI */
- - stx %g3, [%o0 - 8] /* Store */
- -
- - srlx %g3, 56, %g5 /* IEU0 Group */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 11f /* CTI */
- - srlx %g3, 48, %g4 /* IEU0 */
- -
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 10f /* CTI */
- - srlx %g3, 40, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 9f /* CTI */
- - srlx %g3, 32, %g4 /* IEU0 */
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 8f /* CTI */
- -
- - srlx %g3, 24, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- - srlx %g3, 16, %g4 /* IEU0 */
- -
- - andcc %g4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 6f /* CTI */
- - srlx %g3, 8, %g5 /* IEU0 */
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 5f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- - stx %g3, [%o0 - 8] /* Store Group */
- - andcc %g3, 0xff, %g0 /* IEU1 */
- -
- - bne,pt %icc, 3b /* CTI */
- - mov %o3, %g3 /* IEU0 Group */
- -4: retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -5: stb %g5, [%o0 - 2] /* Store Group */
- - srlx %g3, 16, %g4 /* IEU0 */
- -6: sth %g4, [%o0 - 4] /* Store Group */
- - srlx %g3, 32, %g4 /* IEU0 */
- -
- - stw %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -7: stb %g5, [%o0 - 4] /* Store Group */
- -
- - srlx %g3, 32, %g4 /* IEU0 */
- -8: stw %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- -9: stb %g5, [%o0 - 6] /* Store Group */
- - srlx %g3, 48, %g4 /* IEU0 */
- -10: sth %g4, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -11: stb %g5, [%o0 - 8] /* Store Group */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -
- -12: or %g1, %g2, %g1 /* IEU0 Group */
- - ldub [%o1], %o3 /* Load */
- - sllx %g1, 7, %g2 /* IEU0 Group */
- - stb %o3, [%o0] /* Store Group */
- -
- -13: add %o0, 1, %o0 /* IEU0 */
- - add %o1, 1, %o1 /* IEU1 */
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 4b /* CTI */
- -
- - lduba [%o1] ASI_PNF, %o3 /* Load */
- - andcc %o0, 7, %g0 /* IEU1 Group */
- - bne,a,pt %icc, 13b /* CTI */
- - stb %o3, [%o0] /* Store */
- -
- - andcc %o1, 7, %g3 /* IEU1 Group */
- - be,a,pt %icc, 1b /* CTI */
- - ldx [%o1], %o3 /* Load */
- -14: orcc %g0, 64, %g4 /* IEU1 Group */
- -
- - sllx %g3, 3, %g5 /* IEU0 */
- - sub %o1, %g3, %o1 /* IEU0 Group */
- - sub %g4, %g5, %g4 /* IEU1 */
- - /* %g1 = 0101010101010101 *
- - * %g2 = 8080808080808080 *
- - * %g3 = source alignment *
- - * %g5 = number of bits to shift left *
- - * %g4 = number of bits to shift right */
- - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
- -
- - addcc %o1, 8, %o1 /* IEU1 */
- -15: sllx %o5, %g5, %o3 /* IEU0 Group */
- - ldxa [%o1] ASI_PNF, %o5 /* Load */
- - srlx %o5, %g4, %o4 /* IEU0 Group */
- -
- - add %o0, 8, %o0 /* IEU1 */
- - or %o3, %o4, %o3 /* IEU0 Group */
- - add %o1, 8, %o1 /* IEU1 */
- - sub %o3, %g1, %o4 /* IEU0 Group */
- -
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o4, %o3, %o4 /* IEU0 Group */
- -#endif
- - andcc %o4, %g2, %g0 /* IEU1 Group */
- - be,a,pt %xcc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - srlx %o3, 56, %o4 /* IEU0 Group */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 22f /* CTI */
- - srlx %o3, 48, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 21f /* CTI */
- - srlx %o3, 40, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 20f /* CTI */
- -
- - srlx %o3, 32, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 19f /* CTI */
- - srlx %o3, 24, %o4 /* IEU0 */
- -
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 18f /* CTI */
- - srlx %o3, 16, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 17f /* CTI */
- - srlx %o3, 8, %o4 /* IEU0 */
- - andcc %o4, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 16f /* CTI */
- -
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - bne,pn %icc, 15b /* CTI */
- - stx %o3, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- -
- - mov %g6, %o0 /* IEU0 */
- -
- - .align 16
- -16: srlx %o3, 8, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 2] /* Store */
- -17: srlx %o3, 16, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 3] /* Store */
- -
- -18: srlx %o3, 24, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 4] /* Store */
- -19: srlx %o3, 32, %o4 /* IEU0 Group */
- - stw %o4, [%o0 - 8] /* Store */
- -
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- - nop
- - nop
- -
- -20: srlx %o3, 40, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 6] /* Store */
- -21: srlx %o3, 48, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 7] /* Store */
- -
- -22: srlx %o3, 56, %o4 /* IEU0 Group */
- - stb %o4, [%o0 - 8] /* Store */
- - retl /* CTI+IEU1 Group */
- - mov %g6, %o0 /* IEU0 */
- -END(strcpy)
- -
- -libc_hidden_def(strcpy)
- diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
- deleted file mode 100644
- index f58c1c2..0000000
- --- a/libc/string/sparc/sparc64/strlen.S
- +++ /dev/null
- @@ -1,172 +0,0 @@
- -/* Determine the length of a string. For SPARC v9.
- - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
- - Jakub Jelinek <jj@ultra.linux.cz>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <asm/asi.h>
- -
- - /* Normally, this uses
- - ((xword - 0x0101010101010101) & 0x8080808080808080) test
- - to find out if any byte in xword could be zero. This is fast, but
- - also gives false alarm for any byte in range 0x81-0xff. It does
- - not matter for correctness, as if this test tells us there could
- - be some zero byte, we check it byte by byte, but if bytes with
- - high bits set are common in the strings, then this will give poor
- - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- - will use one tick slower, but more precise test
- - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- - which does not give any false alarms (but if some bits are set,
- - one cannot assume from it which bytes are zero and which are not).
- - It is yet to be measured, what is the correct default for glibc
- - in these days for an average user.
- - */
- -
- - .text
- - .align 32
- -ENTRY(strlen)
- - sethi %hi(0x01010101), %g1 /* IEU0 Group */
- - ldub [%o0], %o3 /* Load */
- - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- - mov %o0, %o1 /* IEU1 */
- -
- - sllx %g1, 32, %g4 /* IEU0 Group */
- - andcc %o0, 7, %g0 /* IEU1 */
- - or %g1, %g4, %g1 /* IEU0 Group */
- - brz,pn %o3, 13f /* CTI+IEU1 */
- -
- - sllx %g1, 7, %g4 /* IEU0 Group */
- - bne,a,pn %icc, 15f /* CTI */
- - add %o0, 1, %o0 /* IEU1 */
- - /* %g1 = 0x0101010101010101 *
- - * %g4 = 0x8080808080808080 *
- - * %o0 = string pointer *
- - * %o1 = start of string */
- -1: ldx [%o0], %o3 /* Load Group */
- -
- - add %o0, 8, %o0 /* IEU1 */
- -2: sub %o3, %g1, %o2 /* IEU0 Group */
- -#ifdef EIGHTBIT_NOT_RARE
- - andn %o2, %o3, %o5 /* IEU0 Group */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o5, %g4, %g0 /* IEU1 Group */
- -#else
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g4, %g0 /* IEU1 Group */
- -#endif
- -
- - be,pt %xcc, 2b /* CTI */
- - add %o0, 8, %o0 /* IEU0 */
- - addcc %o2, %g1, %g5 /* IEU1 Group */
- -#ifdef EIGHTBIT_NOT_RARE
- - srlx %o5, 32, %o5 /* IEU0 */
- -
- -3: andcc %o5, %g4, %g0 /* IEU1 Group */
- -#else
- - srlx %o2, 32, %o2 /* IEU0 */
- -
- -3: andcc %o2, %g4, %g0 /* IEU1 Group */
- -#endif
- - be,pn %xcc, 4f /* CTI */
- - srlx %g5, 56, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 12f /* CTI */
- - srlx %g5, 48, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 11f /* CTI */
- -
- - srlx %g5, 40, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 10f /* CTI */
- - srlx %g5, 32, %o2 /* IEU0 */
- -
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 9f /* CTI */
- -4: srlx %g5, 24, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- -
- - be,pn %icc, 8f /* CTI */
- - srlx %g5, 16, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 7f /* CTI */
- -
- - srlx %g5, 8, %o2 /* IEU0 */
- - andcc %o2, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 6f /* CTI */
- - sub %o3, %g1, %o2 /* IEU0 */
- -
- - andcc %g5, 0xff, %g0 /* IEU1 Group */
- - be,pn %icc, 5f /* CTI */
- - ldxa [%o0] ASI_PNF, %o3 /* Load */
- - andcc %o2, %g4, %g0 /* IEU1 Group */
- -
- - be,pt %xcc, 2b /* CTI */
- - add %o0, 8, %o0 /* IEU0 */
- - addcc %o2, %g1, %g5 /* IEU1 Group */
- - ba,pt %xcc, 3b /* CTI */
- -
- - srlx %o2, 32, %o2 /* IEU0 */
- -5: add %o0, -9, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -
- -6: add %o0, -10, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -7: add %o0, -11, %o0 /* IEU0 Group */
- -
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -8: add %o0, -12, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- -
- - sub %o0, %o1, %o0 /* IEU0 */
- -9: add %o0, -13, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -
- -10: add %o0, -14, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -11: add %o0, -15, %o0 /* IEU0 Group */
- -
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -12: add %o0, -16, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- -
- - sub %o0, %o1, %o0 /* IEU0 */
- -13: retl /* CTI+IEU1 Group */
- - mov 0, %o0 /* IEU0 */
- - nop
- -
- -15: ldub [%o0], %o3 /* Load Group */
- -16: andcc %o0, 7, %g0 /* IEU1 */
- - be,pn %icc, 1b /* CTI */
- - nop /* IEU0 Group */
- -
- - add %o0, 1, %o0 /* IEU1 */
- - andcc %o3, 0xff, %g0 /* IEU1 Group */
- - bne,a,pt %icc, 16b /* CTI */
- - lduba [%o0] ASI_PNF, %o3 /* Load */
- -
- - add %o0, -1, %o0 /* IEU0 Group */
- - retl /* CTI+IEU1 Group */
- - sub %o0, %o1, %o0 /* IEU0 */
- -END(strlen)
- -libc_hidden_def(strlen)
- diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h
- index 5ec4da5..26f6212 100644
- --- a/libc/sysdeps/linux/sparc/bits/setjmp.h
- +++ b/libc/sysdeps/linux/sparc/bits/setjmp.h
- @@ -25,37 +25,6 @@
-
- #include <bits/wordsize.h>
-
- -#if 0 /*__WORDSIZE == 64*/
- -
- -typedef struct __sparc64_jmp_buf
- - {
- - struct __sparc64_jmp_buf *uc_link;
- - unsigned long uc_flags;
- - unsigned long uc_sigmask;
- - struct __sparc64_jmp_buf_mcontext
- - {
- - unsigned long mc_gregs[19];
- - unsigned long mc_fp;
- - unsigned long mc_i7;
- - struct __sparc64_jmp_buf_fpu
- - {
- - union
- - {
- - unsigned int sregs[32];
- - unsigned long dregs[32];
- - long double qregs[16];
- - } mcfpu_fpregs;
- - unsigned long mcfpu_fprs;
- - unsigned long mcfpu_gsr;
- - void *mcfpu_fq;
- - unsigned char mcfpu_qcnt;
- - unsigned char mcfpu_qentsz;
- - unsigned char mcfpu_enab;
- - } mc_fpregs;
- - } uc_mcontext;
- - } __jmp_buf[1];
- -#else
- typedef int __jmp_buf[3];
- -#endif
-
- #endif /* bits/setjmp.h */
- diff --git a/libc/sysdeps/linux/sparc/bits/sigcontext.h b/libc/sysdeps/linux/sparc/bits/sigcontext.h
- index 9435485..251032f 100644
- --- a/libc/sysdeps/linux/sparc/bits/sigcontext.h
- +++ b/libc/sysdeps/linux/sparc/bits/sigcontext.h
- @@ -21,8 +21,6 @@
-
- #include <bits/wordsize.h>
-
- -#if __WORDSIZE == 32
- -
- /* It is quite hard to choose what to put here, because
- Linux/sparc32 had at least 3 totally incompatible
- signal stack layouts.
- @@ -42,36 +40,3 @@ struct sigcontext
- int si_mask;
- };
-
- -#else /* sparc64 */
- -
- -typedef struct
- - {
- - unsigned int si_float_regs [64];
- - unsigned long si_fsr;
- - unsigned long si_gsr;
- - unsigned long si_fprs;
- - } __siginfo_fpu_t;
- -
- -struct sigcontext
- - {
- - char sigc_info[128];
- - struct
- - {
- - unsigned long u_regs[16]; /* globals and ins */
- - unsigned long tstate;
- - unsigned long tpc;
- - unsigned long tnpc;
- - unsigned int y;
- - unsigned int fprs;
- - } sigc_regs;
- - __siginfo_fpu_t * sigc_fpu_save;
- - struct
- - {
- - void * ss_sp;
- - int ss_flags;
- - unsigned long ss_size;
- - } sigc_stack;
- - unsigned long sigc_mask;
- -};
- -
- -#endif /* sparc64 */
- diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S
- index 25b5ee5..77e9147 100644
- --- a/libc/sysdeps/linux/sparc/crt1.S
- +++ b/libc/sysdeps/linux/sparc/crt1.S
- @@ -39,16 +39,9 @@
- #include <features.h>
- #include <bits/wordsize.h>
-
- -/* macro out the 32 / 64 bit differences */
- -#if __WORDSIZE == 32
- # define STACK_BIAS 0
- # define ELE_SIZE 4
- # define LD ld
- -#else
- -# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */
- -# define ELE_SIZE 8
- -# define LD ldx
- -#endif
-
- .text
- .align 4
- @@ -116,11 +109,7 @@ _start:
- nop
-
- /* Die very horribly if exit returns. */
- -#if __WORDSIZE == 32
- unimp
- -#else
- - illtrap 0
- -#endif
-
- .size _start,.-_start
-
- diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
- index 40303f0..90efb77 100644
- --- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
- +++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
- @@ -6,26 +6,19 @@
- #include <setjmp.h>
- #include <jmpbuf-offsets.h>
-
- -#if __WORDSIZE == 64
- -
- -/* Test if longjmp to JMPBUF would unwind the frame
- - containing a local variable at ADDRESS. */
- -#define _JMPBUF_UNWINDS(jmpbuf, address) \
- - ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
- -
- -#else
- -
- /* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
- #define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((int) (address) < (jmpbuf)[JB_SP])
-
- -#endif
- -
- #ifdef __UCLIBC_HAS_THREADS_NATIVE__
- -#if defined(__arch64__)
- -#include "sparc64/jmpbuf-unwind.h"
- -#else
- -#include "sparc32/jmpbuf-unwind.h"
- -#endif
- +#include <setjmp.h>
- +#include <stdint.h>
- +#include <unwind.h>
- +
- +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
- +
- +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
- #endif
- diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c
- index 123be53..97f98da 100644
- --- a/libc/sysdeps/linux/sparc/qp_ops.c
- +++ b/libc/sysdeps/linux/sparc/qp_ops.c
- @@ -1,5 +1,3 @@
- -/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
- -
- #include <stdio.h>
- #include <stdlib.h>
-
- @@ -9,11 +7,7 @@ static void fakedef(void)
- exit(-1);
- }
-
- -#ifdef __sparc_v9__
- -# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
- -#else
- # define fakedef(sym) strong_alias(fakedef, _Q_##sym)
- -#endif
-
- fakedef(fne)
- fakedef(feq)
- @@ -31,7 +25,6 @@ fakedef(qtos)
- fakedef(stoq)
- fakedef(itoq)
- fakedef(add)
- -#ifndef __sparc_v9__
- fakedef(qtou)
- fakedef(utoq)
- fakedef(cmp)
- @@ -44,4 +37,3 @@ fakedef(qtoll)
- fakedef(qtoull)
- fakedef(sqrt)
- fakedef(ulltoq)
- -#endif
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S
- deleted file mode 100644
- index 2ee62a0..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/clone.S
- +++ /dev/null
- @@ -1,101 +0,0 @@
- -/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Richard Henderson (rth@tamu.edu).
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -/* clone() is even more special than fork() as it mucks with stacks
- - and invokes a function in the right context after its all over. */
- -
- -#include <asm/errno.h>
- -#include <asm/unistd.h>
- -#include <tcb-offsets.h>
- -#include <sysdep.h>
- -
- -#define CLONE_VM 0x00000100
- -#define CLONE_THREAD 0x00010000
- -
- -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
- - pid_t *ptid, void *tls, pid_t *ctid); */
- -
- - .register %g2,#scratch
- - .register %g3,#scratch
- -
- - .text
- -
- -ENTRY (__clone)
- - save %sp, -192, %sp
- - cfi_def_cfa_register(%fp)
- - cfi_window_save
- - cfi_register(%o7, %i7)
- -
- - /* sanity check arguments */
- - brz,pn %i0, 99f /* fn non-NULL? */
- - mov %i0, %g2
- - brz,pn %i1, 99f /* child_stack non-NULL? */
- - mov %i2, %o0 /* clone flags */
- -
- - /* The child_stack is the top of the stack, allocate one
- - whole stack frame from that as this is what the kernel
- - expects. Also, subtract STACK_BIAS. */
- - sub %i1, 192 + 0x7ff, %o1
- - mov %i3, %g3
- - mov %i2, %g4
- -
- - mov %i4,%o2 /* PTID */
- - mov %i5,%o3 /* TLS */
- - ldx [%fp+0x7ff+176],%o4 /* CTID */
- -
- - /* Do the system call */
- - set __NR_clone, %g1
- - ta 0x6d
- - bcs,pn %xcc, 98f
- - nop
- - brnz,pn %o1, __thread_start
- - nop
- - jmpl %i7 + 8, %g0
- - restore %o0, %g0, %o0
- -99: mov EINVAL, %o0
- -98: call HIDDEN_JUMPTARGET(__errno_location)
- - mov %o0, %i0
- - st %i0, [%o0]
- - jmpl %i7 + 8, %g0
- - restore %g0,-1,%o0
- -END(__clone)
- -
- - .type __thread_start,@function
- -__thread_start:
- -#ifdef RESET_PID
- - sethi %hi(CLONE_THREAD), %l0
- - andcc %g4, %l0, %g0
- - bne,pt %icc, 1f
- - andcc %g4, CLONE_VM, %g0
- - bne,a,pn %icc, 2f
- - mov -1,%o0
- - set __NR_getpid,%g1
- - ta 0x6d
- -2: st %o0,[%g7 + PID]
- - st %o0,[%g7 + TID]
- -1:
- -#endif
- - mov %g0, %fp /* terminate backtrace */
- - call %g2
- - mov %g3,%o0
- - call HIDDEN_JUMPTARGET(_exit),0
- - nop
- -
- - .size __thread_start, .-__thread_start
- -
- -weak_alias (__clone, clone)
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S
- deleted file mode 100644
- index 1474e32..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/rem.S
- +++ /dev/null
- @@ -1,20 +0,0 @@
- -/*
- - * Sparc v9 has divide.
- - * As divx takes 68 cycles and sdivcc only 36,
- - * we use sdivcc eventhough it is deprecated.
- - */
- -
- - .text
- - .align 32
- -ENTRY(.rem)
- -
- - sra %o0, 31, %o2
- - wr %o2, 0, %y
- - sdivcc %o0, %o1, %o2
- - xnor %o2, %g0, %o3
- - movvs %icc, %o3, %o2
- - smul %o2, %o1, %o2
- - retl
- - sub %o0, %o2, %o0
- -
- -END(.rem)
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
- deleted file mode 100644
- index 45535bb..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
- +++ /dev/null
- @@ -1,18 +0,0 @@
- -/*
- - * Sparc v9 has divide.
- - * As divx takes 68 cycles and sdivcc only 36,
- - * we use sdivcc eventhough it is deprecated.
- - */
- -
- - .text
- - .align 32
- -ENTRY(.div)
- -
- - sra %o0, 31, %o2
- - wr %o2, 0, %y
- - sdivcc %o0, %o1, %o0
- - xnor %o0, %g0, %o2
- - retl
- - movvs %icc, %o2, %o0
- -
- -END(.div)
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S
- deleted file mode 100644
- index 303f29b..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S
- +++ /dev/null
- @@ -1,15 +0,0 @@
- -/*
- - * Sparc v9 has divide.
- - * As divx takes 68 cycles and udiv only 37,
- - * we use udiv eventhough it is deprecated.
- - */
- -
- - .text
- - .align 32
- -ENTRY(.udiv)
- -
- - wr %g0, 0, %y
- - retl
- - udiv %o0, %o1, %o0
- -
- -END(.udiv)
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S
- deleted file mode 100644
- index e65e4b9..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/umul.S
- +++ /dev/null
- @@ -1,15 +0,0 @@
- -/*
- - * Sparc v9 has multiply.
- - */
- -
- - .text
- - .align 32
- -ENTRY(.umul)
- -
- - srl %o0, 0, %o0
- - srl %o1, 0, %o1
- - mulx %o0, %o1, %o0
- - retl
- - srlx %o0, 32, %o1
- -
- -END(.umul)
- diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S
- deleted file mode 100644
- index 9354269..0000000
- --- a/libc/sysdeps/linux/sparc/sparcv9/urem.S
- +++ /dev/null
- @@ -1,17 +0,0 @@
- -/*
- - * Sparc v9 has divide.
- - * As divx takes 68 cycles and udiv only 37,
- - * we use udiv eventhough it is deprecated.
- - */
- -
- - .text
- - .align 32
- -ENTRY(.urem)
- -
- - wr %g0, 0, %y
- - udiv %o0, %o1, %o2
- - umul %o2, %o1, %o2
- - retl
- - sub %o0, %o2, %o0
- -
- -END(.urem)
- diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h
- index 37d6a61..edbd5a5 100644
- --- a/libc/sysdeps/linux/sparc/sys/procfs.h
- +++ b/libc/sysdeps/linux/sparc/sys/procfs.h
- @@ -32,20 +32,6 @@
-
- __BEGIN_DECLS
-
- -#if __WORDSIZE == 64
- -
- -#define ELF_NGREG 36
- -
- -typedef struct
- - {
- - unsigned long pr_regs[32];
- - unsigned long pr_fsr;
- - unsigned long pr_gsr;
- - unsigned long pr_fprs;
- - } elf_fpregset_t;
- -
- -#else /* sparc32 */
- -
- #define ELF_NGREG 38
-
- typedef struct
- @@ -63,8 +49,6 @@ typedef struct
- unsigned int pr_q[64];
- } elf_fpregset_t;
-
- -#endif /* sparc32 */
- -
- typedef unsigned long elf_greg_t;
- typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
- @@ -110,13 +94,8 @@ struct elf_prpsinfo
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- unsigned long int pr_flag; /* Flags. */
- -#if __WORDSIZE == 64
- - unsigned int pr_uid;
- - unsigned int pr_gid;
- -#else
- unsigned short int pr_uid;
- unsigned short int pr_gid;
- -#endif
- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
- /* Lots missing */
- char pr_fname[16]; /* Filename of executable. */
- @@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;
- typedef struct elf_prstatus prstatus_t;
- typedef struct elf_prpsinfo prpsinfo_t;
-
- -#if __WORDSIZE == 64
- -
- -/* Provide 32-bit variants so that BFD can read 32-bit
- - core files. */
- -#define ELF_NGREG32 38
- -typedef struct
- - {
- - union
- - {
- - unsigned int pr_regs[32];
- - double pr_dregs[16];
- - } pr_fr;
- - unsigned int __unused;
- - unsigned int pr_fsr;
- - unsigned char pr_qcnt;
- - unsigned char pr_q_entrysize;
- - unsigned char pr_en;
- - unsigned int pr_q[64];
- - } elf_fpregset_t32;
- -
- -typedef unsigned int elf_greg_t32;
- -typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
- -
- -struct elf_prstatus32
- - {
- - struct elf_siginfo pr_info; /* Info associated with signal. */
- - short int pr_cursig; /* Current signal. */
- - unsigned int pr_sigpend; /* Set of pending signals. */
- - unsigned int pr_sighold; /* Set of held signals. */
- - __pid_t pr_pid;
- - __pid_t pr_ppid;
- - __pid_t pr_pgrp;
- - __pid_t pr_sid;
- - struct
- - {
- - int tv_sec, tv_usec;
- - } pr_utime, /* User time. */
- - pr_stime, /* System time. */
- - pr_cutime, /* Cumulative user time. */
- - pr_cstime; /* Cumulative system time. */
- - elf_gregset_t32 pr_reg; /* GP registers. */
- - int pr_fpvalid; /* True if math copro being used. */
- - };
- -
- -struct elf_prpsinfo32
- - {
- - char pr_state; /* Numeric process state. */
- - char pr_sname; /* Char for pr_state. */
- - char pr_zomb; /* Zombie. */
- - char pr_nice; /* Nice val. */
- - unsigned int pr_flag; /* Flags. */
- - unsigned short int pr_uid;
- - unsigned short int pr_gid;
- - int pr_pid, pr_ppid, pr_pgrp, pr_sid;
- - /* Lots missing */
- - char pr_fname[16]; /* Filename of executable. */
- - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
- - };
- -
- -typedef elf_gregset_t32 prgregset32_t;
- -typedef elf_fpregset_t32 prfpregset32_t;
- -
- -typedef struct elf_prstatus32 prstatus32_t;
- -typedef struct elf_prpsinfo32 prpsinfo32_t;
- -
- -#endif /* sparc64 */
- -
- __END_DECLS
-
- #endif /* sys/procfs.h */
- diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
- index ab90810..d502c75 100644
- --- a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
- +++ b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
- @@ -1,8 +1,82 @@
- -#include <features.h>
- -#include <bits/wordsize.h>
- +/* Machine-dependent pthreads configuration and inline functions.
- + sparc version.
- + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Richard Henderson <rth@tamu.edu>.
-
- -#if __WORDSIZE == 32
- -# include "sparc32/pt-machine.h"
- -#else
- -# include "sparc64/pt-machine.h"
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public License as
- + published by the Free Software Foundation; either version 2.1 of the
- + License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; see the file COPYING.LIB. If
- + not, see <http://www.gnu.org/licenses/>. */
- +
- +#ifndef _PT_MACHINE_H
- +#define _PT_MACHINE_H 1
- +
- +#ifndef PT_EI
- +# define PT_EI __extern_always_inline
- #endif
- +
- +extern long int testandset (int *spinlock);
- +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- +
- +/* Spinlock implementation; required. */
- +PT_EI long int
- +testandset (int *spinlock)
- +{
- + int ret;
- +
- + __asm__ __volatile__("ldstub %1,%0"
- + : "=r"(ret), "=m"(*spinlock)
- + : "m"(*spinlock));
- +
- + return ret;
- +}
- +
- +
- +/* Memory barrier; default is to do nothing */
- +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
- +
- +
- +/* Get some notion of the current stack. Need not be exactly the top
- + of the stack, just something somewhere in the current frame. */
- +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- +register char *stack_pointer __asm__("%sp");
- +
- +
- +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
- +struct _pthread_descr_struct;
- +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
- +
- +/* Return the thread descriptor for the current thread. */
- +#define THREAD_SELF __thread_self
- +
- +/* Initialize the thread-unique value. */
- +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- +
- +/* Access to data in the thread descriptor is easy. */
- +#define THREAD_GETMEM(descr, member) \
- + ((void) sizeof (descr), THREAD_SELF->member)
- +#define THREAD_GETMEM_NC(descr, member) \
- + ((void) sizeof (descr), THREAD_SELF->member)
- +#define THREAD_SETMEM(descr, member, value) \
- + ((void) sizeof (descr), THREAD_SELF->member = (value))
- +#define THREAD_SETMEM_NC(descr, member, value) \
- + ((void) sizeof (descr), THREAD_SELF->member = (value))
- +
- +/* We want the OS to assign stack addresses. */
- +#define FLOATING_STACKS 1
- +
- +/* Maximum size of the stack if the rlimit is unlimited. */
- +#define ARCH_STACK_MAX_SIZE 8*1024*1024
- +
- +#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
- deleted file mode 100644
- index d502c75..0000000
- --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
- +++ /dev/null
- @@ -1,82 +0,0 @@
- -/* Machine-dependent pthreads configuration and inline functions.
- - sparc version.
- - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Richard Henderson <rth@tamu.edu>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#ifndef _PT_MACHINE_H
- -#define _PT_MACHINE_H 1
- -
- -#ifndef PT_EI
- -# define PT_EI __extern_always_inline
- -#endif
- -
- -extern long int testandset (int *spinlock);
- -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- -
- -/* Spinlock implementation; required. */
- -PT_EI long int
- -testandset (int *spinlock)
- -{
- - int ret;
- -
- - __asm__ __volatile__("ldstub %1,%0"
- - : "=r"(ret), "=m"(*spinlock)
- - : "m"(*spinlock));
- -
- - return ret;
- -}
- -
- -
- -/* Memory barrier; default is to do nothing */
- -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
- -
- -
- -/* Get some notion of the current stack. Need not be exactly the top
- - of the stack, just something somewhere in the current frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- -register char *stack_pointer __asm__("%sp");
- -
- -
- -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
- -struct _pthread_descr_struct;
- -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
- -
- -/* Return the thread descriptor for the current thread. */
- -#define THREAD_SELF __thread_self
- -
- -/* Initialize the thread-unique value. */
- -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- -
- -/* Access to data in the thread descriptor is easy. */
- -#define THREAD_GETMEM(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_GETMEM_NC(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_SETMEM(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -#define THREAD_SETMEM_NC(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -
- -/* We want the OS to assign stack addresses. */
- -#define FLOATING_STACKS 1
- -
- -/* Maximum size of the stack if the rlimit is unlimited. */
- -#define ARCH_STACK_MAX_SIZE 8*1024*1024
- -
- -#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
- deleted file mode 100644
- index e3c73d9..0000000
- --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
- +++ /dev/null
- @@ -1,104 +0,0 @@
- -/* Machine-dependent pthreads configuration and inline functions.
- - Sparc v9 version.
- - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Richard Henderson <rth@tamu.edu>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#ifndef _PT_MACHINE_H
- -#define _PT_MACHINE_H 1
- -
- -#ifndef PT_EI
- -# define PT_EI __extern_always_inline
- -#endif
- -
- -extern long int testandset (int *spinlock);
- -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- -
- -/* Spinlock implementation; required. */
- -PT_EI long int
- -testandset (int *spinlock)
- -{
- - int ret;
- -
- - __asm__ __volatile__("ldstub %1,%0"
- - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
- -
- - return ret;
- -}
- -
- -
- -/* Memory barrier; default is to do nothing */
- -#define MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
- -/* Read barrier. */
- -#define READ_MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
- -/* Write barrier. */
- -#define WRITE_MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
- -
- -
- -/* Get some notion of the current stack. Need not be exactly the top
- - of the stack, just something somewhere in the current frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
- -register char *stack_pointer __asm__ ("%sp");
- -
- -
- -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- - TLS ABI specifies %g7 as the thread pointer. */
- -struct _pthread_descr_struct;
- -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
- -
- -/* Return the thread descriptor for the current thread. */
- -#define THREAD_SELF __thread_self
- -
- -/* Initialize the thread-unique value. */
- -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- -
- -
- -/* Compare-and-swap for semaphores. */
- -
- -#define HAS_COMPARE_AND_SWAP
- -PT_EI int
- -__compare_and_swap (long int *p, long int oldval, long int newval)
- -{
- - long int readval;
- -
- - __asm__ __volatile__ ("casx [%4], %2, %0"
- - : "=r"(readval), "=m"(*p)
- - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- - MEMORY_BARRIER();
- - return readval == oldval;
- -}
- -
- -/* Access to data in the thread descriptor is easy. */
- -#define THREAD_GETMEM(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_GETMEM_NC(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_SETMEM(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -#define THREAD_SETMEM_NC(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -
- -/* We want the OS to assign stack addresses. */
- -#define FLOATING_STACKS 1
- -
- -/* Maximum size of the stack if the rlimit is unlimited. */
- -#define ARCH_STACK_MAX_SIZE 32*1024*1024
- -
- -#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
- index 72a9af5..4de152b 100644
- --- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
- +++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
- @@ -1,14 +1,87 @@
- -#include <features.h>
- -#include <bits/wordsize.h>
- +/* POSIX spinlock implementation. SPARC32 version.
- + Copyright (C) 2000 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
-
- -#if __WORDSIZE == 32
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public License as
- + published by the Free Software Foundation; either version 2.1 of the
- + License, or (at your option) any later version.
-
- -# if defined(__CONFIG_SPARC_V9B__)
- -# include "sparc32/sparcv9b/pspinlock.c"
- -# else
- -# include "sparc32/pspinlock.c"
- -# endif
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
-
- -#else
- -# include "sparc64/pspinlock.c"
- -#endif
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; see the file COPYING.LIB. If
- + not, see <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <pthread.h>
- +#include "internals.h"
- +
- +/* This implementation is similar to the one used in the Linux kernel. */
- +int
- +__pthread_spin_lock (pthread_spinlock_t *lock)
- +{
- + __asm__ __volatile__
- + ("1: ldstub [%0], %%g2\n"
- + " orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2f\n"
- + " ldub [%0], %%g2\n"
- + ".subsection 2\n"
- + "2: orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2b\n"
- + " ldub [%0], %%g2\n"
- + " b,a 1b\n"
- + ".previous"
- + : /* no outputs */
- + : "r" (lock)
- + : "g2", "memory", "cc");
- + return 0;
- +}
- +weak_alias (__pthread_spin_lock, pthread_spin_lock)
- +
- +
- +int
- +__pthread_spin_trylock (pthread_spinlock_t *lock)
- +{
- + int result;
- + __asm__ __volatile__
- + ("ldstub [%1], %0"
- + : "=r" (result)
- + : "r" (lock)
- + : "memory");
- + return result == 0 ? 0 : EBUSY;
- +}
- +weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
- +
- +
- +int
- +__pthread_spin_unlock (pthread_spinlock_t *lock)
- +{
- + *lock = 0;
- + return 0;
- +}
- +weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
- +
- +
- +int
- +__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
- +{
- + /* We can ignore the `pshared' parameter. Since we are busy-waiting
- + all processes which can access the memory location `lock' points
- + to can use the spinlock. */
- + *lock = 0;
- + return 0;
- +}
- +weak_alias (__pthread_spin_init, pthread_spin_init)
- +
- +
- +int
- +__pthread_spin_destroy (pthread_spinlock_t *lock)
- +{
- + /* Nothing to do. */
- + return 0;
- +}
- +weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
- index ab90810..d502c75 100644
- --- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
- +++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
- @@ -1,8 +1,82 @@
- -#include <features.h>
- -#include <bits/wordsize.h>
- +/* Machine-dependent pthreads configuration and inline functions.
- + sparc version.
- + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Richard Henderson <rth@tamu.edu>.
-
- -#if __WORDSIZE == 32
- -# include "sparc32/pt-machine.h"
- -#else
- -# include "sparc64/pt-machine.h"
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public License as
- + published by the Free Software Foundation; either version 2.1 of the
- + License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; see the file COPYING.LIB. If
- + not, see <http://www.gnu.org/licenses/>. */
- +
- +#ifndef _PT_MACHINE_H
- +#define _PT_MACHINE_H 1
- +
- +#ifndef PT_EI
- +# define PT_EI __extern_always_inline
- #endif
- +
- +extern long int testandset (int *spinlock);
- +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- +
- +/* Spinlock implementation; required. */
- +PT_EI long int
- +testandset (int *spinlock)
- +{
- + int ret;
- +
- + __asm__ __volatile__("ldstub %1,%0"
- + : "=r"(ret), "=m"(*spinlock)
- + : "m"(*spinlock));
- +
- + return ret;
- +}
- +
- +
- +/* Memory barrier; default is to do nothing */
- +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
- +
- +
- +/* Get some notion of the current stack. Need not be exactly the top
- + of the stack, just something somewhere in the current frame. */
- +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- +register char *stack_pointer __asm__("%sp");
- +
- +
- +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
- +struct _pthread_descr_struct;
- +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
- +
- +/* Return the thread descriptor for the current thread. */
- +#define THREAD_SELF __thread_self
- +
- +/* Initialize the thread-unique value. */
- +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- +
- +/* Access to data in the thread descriptor is easy. */
- +#define THREAD_GETMEM(descr, member) \
- + ((void) sizeof (descr), THREAD_SELF->member)
- +#define THREAD_GETMEM_NC(descr, member) \
- + ((void) sizeof (descr), THREAD_SELF->member)
- +#define THREAD_SETMEM(descr, member, value) \
- + ((void) sizeof (descr), THREAD_SELF->member = (value))
- +#define THREAD_SETMEM_NC(descr, member, value) \
- + ((void) sizeof (descr), THREAD_SELF->member = (value))
- +
- +/* We want the OS to assign stack addresses. */
- +#define FLOATING_STACKS 1
- +
- +/* Maximum size of the stack if the rlimit is unlimited. */
- +#define ARCH_STACK_MAX_SIZE 8*1024*1024
- +
- +#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
- deleted file mode 100644
- index 4de152b..0000000
- --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
- +++ /dev/null
- @@ -1,87 +0,0 @@
- -/* POSIX spinlock implementation. SPARC32 version.
- - Copyright (C) 2000 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <pthread.h>
- -#include "internals.h"
- -
- -/* This implementation is similar to the one used in the Linux kernel. */
- -int
- -__pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g2\n"
- - " orcc %%g2, 0x0, %%g0\n"
- - " bne,a 2f\n"
- - " ldub [%0], %%g2\n"
- - ".subsection 2\n"
- - "2: orcc %%g2, 0x0, %%g0\n"
- - " bne,a 2b\n"
- - " ldub [%0], %%g2\n"
- - " b,a 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g2", "memory", "cc");
- - return 0;
- -}
- -weak_alias (__pthread_spin_lock, pthread_spin_lock)
- -
- -
- -int
- -__pthread_spin_trylock (pthread_spinlock_t *lock)
- -{
- - int result;
- - __asm__ __volatile__
- - ("ldstub [%1], %0"
- - : "=r" (result)
- - : "r" (lock)
- - : "memory");
- - return result == 0 ? 0 : EBUSY;
- -}
- -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
- -
- -
- -int
- -__pthread_spin_unlock (pthread_spinlock_t *lock)
- -{
- - *lock = 0;
- - return 0;
- -}
- -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
- -
- -
- -int
- -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
- -{
- - /* We can ignore the `pshared' parameter. Since we are busy-waiting
- - all processes which can access the memory location `lock' points
- - to can use the spinlock. */
- - *lock = 0;
- - return 0;
- -}
- -weak_alias (__pthread_spin_init, pthread_spin_init)
- -
- -
- -int
- -__pthread_spin_destroy (pthread_spinlock_t *lock)
- -{
- - /* Nothing to do. */
- - return 0;
- -}
- -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
- deleted file mode 100644
- index d502c75..0000000
- --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
- +++ /dev/null
- @@ -1,82 +0,0 @@
- -/* Machine-dependent pthreads configuration and inline functions.
- - sparc version.
- - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Richard Henderson <rth@tamu.edu>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#ifndef _PT_MACHINE_H
- -#define _PT_MACHINE_H 1
- -
- -#ifndef PT_EI
- -# define PT_EI __extern_always_inline
- -#endif
- -
- -extern long int testandset (int *spinlock);
- -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- -
- -/* Spinlock implementation; required. */
- -PT_EI long int
- -testandset (int *spinlock)
- -{
- - int ret;
- -
- - __asm__ __volatile__("ldstub %1,%0"
- - : "=r"(ret), "=m"(*spinlock)
- - : "m"(*spinlock));
- -
- - return ret;
- -}
- -
- -
- -/* Memory barrier; default is to do nothing */
- -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
- -
- -
- -/* Get some notion of the current stack. Need not be exactly the top
- - of the stack, just something somewhere in the current frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- -register char *stack_pointer __asm__("%sp");
- -
- -
- -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
- -struct _pthread_descr_struct;
- -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
- -
- -/* Return the thread descriptor for the current thread. */
- -#define THREAD_SELF __thread_self
- -
- -/* Initialize the thread-unique value. */
- -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- -
- -/* Access to data in the thread descriptor is easy. */
- -#define THREAD_GETMEM(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_GETMEM_NC(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_SETMEM(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -#define THREAD_SETMEM_NC(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -
- -/* We want the OS to assign stack addresses. */
- -#define FLOATING_STACKS 1
- -
- -/* Maximum size of the stack if the rlimit is unlimited. */
- -#define ARCH_STACK_MAX_SIZE 8*1024*1024
- -
- -#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
- deleted file mode 100644
- index fb49ca3..0000000
- --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
- +++ /dev/null
- @@ -1,93 +0,0 @@
- -/* POSIX spinlock implementation. SPARC v9 version.
- - Copyright (C) 2000 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <pthread.h>
- -#include "internals.h"
- -
- -
- -/* This implementation is similar to the one used in the Linux kernel. */
- -int
- -__pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g2\n"
- - " brnz,pn %%g2, 2f\n"
- - " membar #StoreLoad | #StoreStore\n"
- - ".subsection 2\n"
- - "2: ldub [%0], %%g2\n"
- - " brnz,pt %%g2, 2b\n"
- - " membar #LoadLoad\n"
- - " b,a,pt %%xcc, 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g2", "memory");
- - return 0;
- -}
- -weak_alias (__pthread_spin_lock, pthread_spin_lock)
- -
- -
- -int
- -__pthread_spin_trylock (pthread_spinlock_t *lock)
- -{
- - int result;
- - __asm__ __volatile__
- - ("ldstub [%1], %0\n"
- - "membar #StoreLoad | #StoreStore"
- - : "=r" (result)
- - : "r" (lock)
- - : "memory");
- - return result == 0 ? 0 : EBUSY;
- -}
- -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
- -
- -
- -int
- -__pthread_spin_unlock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("membar #StoreStore | #LoadStore\n"
- - "stb %%g0, [%0]"
- - :
- - : "r" (lock)
- - : "memory");
- - return 0;
- -}
- -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
- -
- -
- -int
- -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
- -{
- - /* We can ignore the `pshared' parameter. Since we are busy-waiting
- - all processes which can access the memory location `lock' points
- - to can use the spinlock. */
- - *lock = 0;
- - return 0;
- -}
- -weak_alias (__pthread_spin_init, pthread_spin_init)
- -
- -
- -int
- -__pthread_spin_destroy (pthread_spinlock_t *lock)
- -{
- - /* Nothing to do. */
- - return 0;
- -}
- -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
- deleted file mode 100644
- index 743cb77..0000000
- --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
- +++ /dev/null
- @@ -1,92 +0,0 @@
- -/* POSIX spinlock implementation. SPARC64 version.
- - Copyright (C) 2000 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <pthread.h>
- -#include "internals.h"
- -
- -/* This implementation is similar to the one used in the Linux kernel. */
- -int
- -__pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g5\n"
- - " brnz,pn %%g5, 2f\n"
- - " membar #StoreLoad | #StoreStore\n"
- - ".subsection 2\n"
- - "2: ldub [%0], %%g5\n"
- - " brnz,pt %%g5, 2b\n"
- - " membar #LoadLoad\n"
- - " b,a,pt %%xcc, 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g5", "memory");
- - return 0;
- -}
- -weak_alias (__pthread_spin_lock, pthread_spin_lock)
- -
- -
- -int
- -__pthread_spin_trylock (pthread_spinlock_t *lock)
- -{
- - int result;
- - __asm__ __volatile__
- - ("ldstub [%1], %0\n"
- - "membar #StoreLoad | #StoreStore"
- - : "=r" (result)
- - : "r" (lock)
- - : "memory");
- - return result == 0 ? 0 : EBUSY;
- -}
- -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
- -
- -
- -int
- -__pthread_spin_unlock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("membar #StoreStore | #LoadStore\n"
- - "stb %%g0, [%0]"
- - :
- - : "r" (lock)
- - : "memory");
- - return 0;
- -}
- -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
- -
- -
- -int
- -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
- -{
- - /* We can ignore the `pshared' parameter. Since we are busy-waiting
- - all processes which can access the memory location `lock' points
- - to can use the spinlock. */
- - *lock = 0;
- - return 0;
- -}
- -weak_alias (__pthread_spin_init, pthread_spin_init)
- -
- -
- -int
- -__pthread_spin_destroy (pthread_spinlock_t *lock)
- -{
- - /* Nothing to do. */
- - return 0;
- -}
- -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
- diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
- deleted file mode 100644
- index e3c73d9..0000000
- --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
- +++ /dev/null
- @@ -1,104 +0,0 @@
- -/* Machine-dependent pthreads configuration and inline functions.
- - Sparc v9 version.
- - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Richard Henderson <rth@tamu.edu>.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public License as
- - published by the Free Software Foundation; either version 2.1 of the
- - License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; see the file COPYING.LIB. If
- - not, see <http://www.gnu.org/licenses/>. */
- -
- -#ifndef _PT_MACHINE_H
- -#define _PT_MACHINE_H 1
- -
- -#ifndef PT_EI
- -# define PT_EI __extern_always_inline
- -#endif
- -
- -extern long int testandset (int *spinlock);
- -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- -
- -/* Spinlock implementation; required. */
- -PT_EI long int
- -testandset (int *spinlock)
- -{
- - int ret;
- -
- - __asm__ __volatile__("ldstub %1,%0"
- - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
- -
- - return ret;
- -}
- -
- -
- -/* Memory barrier; default is to do nothing */
- -#define MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
- -/* Read barrier. */
- -#define READ_MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
- -/* Write barrier. */
- -#define WRITE_MEMORY_BARRIER() \
- - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
- -
- -
- -/* Get some notion of the current stack. Need not be exactly the top
- - of the stack, just something somewhere in the current frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
- -register char *stack_pointer __asm__ ("%sp");
- -
- -
- -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- - TLS ABI specifies %g7 as the thread pointer. */
- -struct _pthread_descr_struct;
- -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
- -
- -/* Return the thread descriptor for the current thread. */
- -#define THREAD_SELF __thread_self
- -
- -/* Initialize the thread-unique value. */
- -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- -
- -
- -/* Compare-and-swap for semaphores. */
- -
- -#define HAS_COMPARE_AND_SWAP
- -PT_EI int
- -__compare_and_swap (long int *p, long int oldval, long int newval)
- -{
- - long int readval;
- -
- - __asm__ __volatile__ ("casx [%4], %2, %0"
- - : "=r"(readval), "=m"(*p)
- - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- - MEMORY_BARRIER();
- - return readval == oldval;
- -}
- -
- -/* Access to data in the thread descriptor is easy. */
- -#define THREAD_GETMEM(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_GETMEM_NC(descr, member) \
- - ((void) sizeof (descr), THREAD_SELF->member)
- -#define THREAD_SETMEM(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -#define THREAD_SETMEM_NC(descr, member, value) \
- - ((void) sizeof (descr), THREAD_SELF->member = (value))
- -
- -/* We want the OS to assign stack addresses. */
- -#define FLOATING_STACKS 1
- -
- -/* Maximum size of the stack if the rlimit is unlimited. */
- -#define ARCH_STACK_MAX_SIZE 32*1024*1024
- -
- -#endif /* pt-machine.h */
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- deleted file mode 100644
- index bd9bb0d..0000000
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- +++ /dev/null
- @@ -1,100 +0,0 @@
- -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <tls.h>
- -#ifndef __ASSEMBLER__
- -# include <linuxthreads/internals.h>
- -#endif
- -
- -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- -
- -# undef PSEUDO
- -# define PSEUDO(name, syscall_name, args) \
- - .text; \
- -ENTRY(name) \
- - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- - cmp %g1, 0; \
- - bne 1f; \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x10; \
- - bcs __syscall_error_handler; \
- - nop; \
- - .subsection 2; \
- -1: save %sp, -96, %sp; \
- - CENABLE; \
- - nop; \
- - mov %o0, %l0; \
- - COPY_ARGS_##args \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x10; \
- - bcs __syscall_error_handler2; \
- - mov %o0, %l1; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - jmpl %i7 + 8, %g0; \
- - restore %g0, %l1, %o0; \
- - .previous; \
- - SYSCALL_ERROR_HANDLER \
- - SYSCALL_ERROR_HANDLER2
- -
- -#define SYSCALL_ERROR_HANDLER2 \
- -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- - .global __errno_location; \
- - .type __errno_location,@function; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - call __errno_location; \
- - nop; \
- - st %l1, [%o0]; \
- - jmpl %i7 + 8, %g0; \
- - restore %g0, -1, %o0; \
- - .previous;
- -
- -# ifdef IS_IN_libpthread
- -# define CENABLE call __pthread_enable_asynccancel
- -# define CDISABLE call __pthread_disable_asynccancel
- -# elif !defined NOT_IN_libc
- -# define CENABLE call __libc_enable_asynccancel
- -# define CDISABLE call __libc_disable_asynccancel
- -# else
- -# define CENABLE call __librt_enable_asynccancel
- -# define CDISABLE call __librt_disable_asynccancel
- -# endif
- -
- -#define COPY_ARGS_0 /* Nothing */
- -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- -
- -# ifndef __ASSEMBLER__
- -# define SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - p_header.data.multiple_threads) == 0, 1)
- -# else
- -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- -# endif
- -
- -#elif !defined __ASSEMBLER__
- -
- -/* This code should never be used but we define it anyhow. */
- -# define SINGLE_THREAD_P (1)
- -
- -#endif
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- deleted file mode 100644
- index ab2286e..0000000
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- +++ /dev/null
- @@ -1,64 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep-cancel.h>
- -
- - .text
- -#ifdef SHARED
- -.LLGETPC0:
- - retl
- - add %o7, %o0, %o0
- -#endif
- -ENTRY(__vfork)
- -#ifdef SHARED
- - mov %o7, %o1
- - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
- - call .LLGETPC0
- - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
- - sethi %hi(__libc_pthread_functions), %o2
- - mov %o1, %o7
- - or %o2, %lo(__libc_pthread_functions), %o2
- - ld [%o0 + %o2], %o2
- - ld [%o2], %o2
- - cmp %o2, 0
- -#else
- - .weak pthread_create
- - sethi %hi(pthread_create), %o0
- - orcc %o0, %lo(pthread_create), %o0
- -#endif
- -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
- - bne HIDDEN_JUMPTARGET(fork)
- -#else
- - bne 1f
- -#endif
- - mov __NR_vfork, %g1
- - ta 0x10
- - bcs __syscall_error_handler
- - nop
- - sub %o1, 1, %o1
- - retl
- - and %o0, %o1, %o0
- -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
- -1: mov %o7, %g1
- - call HIDDEN_JUMPTARGET(fork)
- - mov %g1, %o7
- -#endif
- - SYSCALL_ERROR_HANDLER
- -PSEUDO_END (__vfork)
- -libc_hidden_def (__vfork)
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
- deleted file mode 100644
- index d57283a..0000000
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../ia64/pt-sigsuspend.c"
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- deleted file mode 100644
- index 9972ee4..0000000
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- +++ /dev/null
- @@ -1,99 +0,0 @@
- -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <tls.h>
- -#ifndef __ASSEMBLER__
- -# include <linuxthreads/internals.h>
- -#endif
- -
- -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- -
- -# undef PSEUDO
- -# define PSEUDO(name, syscall_name, args) \
- - .text; \
- -ENTRY(name) \
- - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- - brnz,pn %g1, 1f; \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x6d; \
- - bcs,pn %xcc, __syscall_error_handler; \
- - nop; \
- - .subsection 2; \
- -1: save %sp, -192, %sp; \
- - CENABLE; \
- - nop; \
- - mov %o0, %l0; \
- - COPY_ARGS_##args \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x6d; \
- - bcs,pn %xcc, __syscall_error_handler2; \
- - mov %o0, %l1; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - jmpl %i7 + 8, %g0; \
- - restore %g0, %l1, %o0; \
- - .previous; \
- - SYSCALL_ERROR_HANDLER \
- - SYSCALL_ERROR_HANDLER2
- -
- -#define SYSCALL_ERROR_HANDLER2 \
- -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- - .global __errno_location; \
- - .type __errno_location,@function; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - call __errno_location; \
- - nop; \
- - st %l1, [%o0]; \
- - jmpl %i7 + 8, %g0; \
- - restore %g0, -1, %o0; \
- - .previous;
- -
- -# ifdef IS_IN_libpthread
- -# define CENABLE call __pthread_enable_asynccancel
- -# define CDISABLE call __pthread_disable_asynccancel
- -# elif !defined NOT_IN_libc
- -# define CENABLE call __libc_enable_asynccancel
- -# define CDISABLE call __libc_disable_asynccancel
- -# else
- -# define CENABLE call __librt_enable_asynccancel
- -# define CDISABLE call __librt_disable_asynccancel
- -# endif
- -
- -#define COPY_ARGS_0 /* Nothing */
- -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- -
- -# ifndef __ASSEMBLER__
- -# define SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - p_header.data.multiple_threads) == 0, 1)
- -# else
- -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- -# endif
- -
- -#elif !defined __ASSEMBLER__
- -
- -/* This code should never be used but we define it anyhow. */
- -# define SINGLE_THREAD_P (1)
- -
- -#endif
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- deleted file mode 100644
- index 3ff16b1..0000000
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- +++ /dev/null
- @@ -1,63 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep-cancel.h>
- -
- -#ifdef SHARED
- -.LLGETPC0:
- - retl
- - add %o7, %o0, %o0
- -#endif
- -ENTRY(__vfork)
- -#ifdef SHARED
- - mov %o7, %o1
- - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
- - call .LLGETPC0
- - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
- - sethi %hi(__libc_pthread_functions), %o2
- - mov %o1, %o7
- - or %o2, %lo(__libc_pthread_functions), %o2
- - ldx [%o0 + %o2], %o2
- - ldx [%o2], %o0
- -#else
- - .weak pthread_create
- - sethi %hi(pthread_create), %o0
- - or %o0, %lo(pthread_create), %o0
- -#endif
- -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
- - cmp %o0, 0
- - bne HIDDEN_JUMPTARGET(fork)
- -#else
- - brnz,pn %o0, 1f
- -#endif
- - mov __NR_vfork, %g1
- - ta 0x6d
- - bcs,pn %xcc, __syscall_error_handler
- - nop
- - sub %o1, 1, %o1
- - retl
- - and %o0, %o1, %o0
- -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
- -1: mov %o7, %g1
- - call HIDDEN_JUMPTARGET(fork)
- - mov %g1, %o7
- -#endif
- - SYSCALL_ERROR_HANDLER
- -PSEUDO_END (__vfork)
- -libc_hidden_def (__vfork)
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- index fa656b3..bd9bb0d 100644
- --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- @@ -1,10 +1,100 @@
- -#ifndef SPARC_SYSDEP_CANCEL_H
- -#define SPARC_SYSDEP_CANCEL_H
- +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
-
- -#if defined(__arch64__)
- -#include <sparc64/sysdep-cancel.h>
- -#else
- -#include <sparc32/sysdep-cancel.h>
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <tls.h>
- +#ifndef __ASSEMBLER__
- +# include <linuxthreads/internals.h>
- #endif
-
- +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- +
- +# undef PSEUDO
- +# define PSEUDO(name, syscall_name, args) \
- + .text; \
- +ENTRY(name) \
- + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- + cmp %g1, 0; \
- + bne 1f; \
- + mov SYS_ify(syscall_name), %g1; \
- + ta 0x10; \
- + bcs __syscall_error_handler; \
- + nop; \
- + .subsection 2; \
- +1: save %sp, -96, %sp; \
- + CENABLE; \
- + nop; \
- + mov %o0, %l0; \
- + COPY_ARGS_##args \
- + mov SYS_ify(syscall_name), %g1; \
- + ta 0x10; \
- + bcs __syscall_error_handler2; \
- + mov %o0, %l1; \
- + CDISABLE; \
- + mov %l0, %o0; \
- + jmpl %i7 + 8, %g0; \
- + restore %g0, %l1, %o0; \
- + .previous; \
- + SYSCALL_ERROR_HANDLER \
- + SYSCALL_ERROR_HANDLER2
- +
- +#define SYSCALL_ERROR_HANDLER2 \
- +SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- + .global __errno_location; \
- + .type __errno_location,@function; \
- + CDISABLE; \
- + mov %l0, %o0; \
- + call __errno_location; \
- + nop; \
- + st %l1, [%o0]; \
- + jmpl %i7 + 8, %g0; \
- + restore %g0, -1, %o0; \
- + .previous;
- +
- +# ifdef IS_IN_libpthread
- +# define CENABLE call __pthread_enable_asynccancel
- +# define CDISABLE call __pthread_disable_asynccancel
- +# elif !defined NOT_IN_libc
- +# define CENABLE call __libc_enable_asynccancel
- +# define CDISABLE call __libc_disable_asynccancel
- +# else
- +# define CENABLE call __librt_enable_asynccancel
- +# define CDISABLE call __librt_disable_asynccancel
- +# endif
- +
- +#define COPY_ARGS_0 /* Nothing */
- +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- +
- +# ifndef __ASSEMBLER__
- +# define SINGLE_THREAD_P \
- + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- + p_header.data.multiple_threads) == 0, 1)
- +# else
- +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- +# endif
- +
- +#elif !defined __ASSEMBLER__
- +
- +/* This code should never be used but we define it anyhow. */
- +# define SINGLE_THREAD_P (1)
- +
- #endif
- diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
- new file mode 100644
- index 0000000..ab2286e
- --- /dev/null
- +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
- @@ -0,0 +1,64 @@
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <sysdep-cancel.h>
- +
- + .text
- +#ifdef SHARED
- +.LLGETPC0:
- + retl
- + add %o7, %o0, %o0
- +#endif
- +ENTRY(__vfork)
- +#ifdef SHARED
- + mov %o7, %o1
- + sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
- + call .LLGETPC0
- + add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
- + sethi %hi(__libc_pthread_functions), %o2
- + mov %o1, %o7
- + or %o2, %lo(__libc_pthread_functions), %o2
- + ld [%o0 + %o2], %o2
- + ld [%o2], %o2
- + cmp %o2, 0
- +#else
- + .weak pthread_create
- + sethi %hi(pthread_create), %o0
- + orcc %o0, %lo(pthread_create), %o0
- +#endif
- +#if defined SHARED && !defined BROKEN_SPARC_WDISP22
- + bne HIDDEN_JUMPTARGET(fork)
- +#else
- + bne 1f
- +#endif
- + mov __NR_vfork, %g1
- + ta 0x10
- + bcs __syscall_error_handler
- + nop
- + sub %o1, 1, %o1
- + retl
- + and %o0, %o1, %o0
- +#if !defined SHARED || defined BROKEN_SPARC_WDISP22
- +1: mov %o7, %g1
- + call HIDDEN_JUMPTARGET(fork)
- + mov %g1, %o7
- +#endif
- + SYSCALL_ERROR_HANDLER
- +PSEUDO_END (__vfork)
- +libc_hidden_def (__vfork)
- +weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
- new file mode 100644
- index 0000000..2f64e7d
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
- @@ -0,0 +1,27 @@
- +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <setjmp.h>
- +#include <stdint.h>
- +#include <unwind.h>
- +
- +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
- +
- +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
- diff --git a/libpthread/nptl/sysdeps/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
- new file mode 100644
- index 0000000..2dfcd3c
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/pthread_spin_lock.c
- @@ -0,0 +1,39 @@
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include "pthreadP.h"
- +
- +int
- +pthread_spin_lock (pthread_spinlock_t *lock)
- +{
- + __asm__ __volatile__
- + ("1: ldstub [%0], %%g2\n"
- + " orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2f\n"
- + " ldub [%0], %%g2\n"
- + ".subsection 2\n"
- + "2: orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2b\n"
- + " ldub [%0], %%g2\n"
- + " b,a 1b\n"
- + ".previous"
- + : /* no outputs */
- + : "r" (lock)
- + : "g2", "memory", "cc");
- + return 0;
- +}
- diff --git a/libpthread/nptl/sysdeps/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
- new file mode 100644
- index 0000000..c1b7b23
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
- @@ -0,0 +1,28 @@
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include "pthreadP.h"
- +
- +int
- +pthread_spin_trylock (pthread_spinlock_t *lock)
- +{
- + int res;
- + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
- + return res == 0 ? 0 : EBUSY;
- +}
- diff --git a/libpthread/nptl/sysdeps/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
- new file mode 100644
- index 0000000..435fedc
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/pthreaddef.h
- @@ -0,0 +1,39 @@
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +/* Default stack size. */
- +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
- +
- +/* Required stack pointer alignment at beginning. */
- +#define STACK_ALIGN 16
- +
- +/* Minimal stack size after allocating thread descriptor and guard size. */
- +#define MINIMAL_REST_STACK 2048
- +
- +/* Alignment requirement for TCB. */
- +#define TCB_ALIGNMENT 16
- +
- +
- +/* Location of current stack frame. */
- +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- +register char *stack_pointer __asm__("%sp");
- +
- +/* XXX Until we have a better place keep the definitions here. */
- +
- +/* While there is no such syscall. */
- +#define __exit_thread_inline(val) \
- + INLINE_SYSCALL (exit, 1, (val))
- diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
- index 6cbb37b..2f64e7d 100644
- --- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
- +++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
- @@ -1,5 +1,27 @@
- -#if defined(__arch64__)
- -#include "sparc64/jmpbuf-unwind.h"
- -#else
- -#include "sparc32/jmpbuf-unwind.h"
- -#endif
- +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <setjmp.h>
- +#include <stdint.h>
- +#include <unwind.h>
- +
- +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
- +
- +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
- diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
- index dcc5ae2..2dfcd3c 100644
- --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
- +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
- @@ -1,5 +1,39 @@
- -#if defined(__arch64__)
- -#include "sparc64/pthread_spin_lock.c"
- -#else
- -#include "sparc32/pthread_spin_lock.c"
- -#endif
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include "pthreadP.h"
- +
- +int
- +pthread_spin_lock (pthread_spinlock_t *lock)
- +{
- + __asm__ __volatile__
- + ("1: ldstub [%0], %%g2\n"
- + " orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2f\n"
- + " ldub [%0], %%g2\n"
- + ".subsection 2\n"
- + "2: orcc %%g2, 0x0, %%g0\n"
- + " bne,a 2b\n"
- + " ldub [%0], %%g2\n"
- + " b,a 1b\n"
- + ".previous"
- + : /* no outputs */
- + : "r" (lock)
- + : "g2", "memory", "cc");
- + return 0;
- +}
- diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
- index af63eec..c1b7b23 100644
- --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
- +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
- @@ -1,5 +1,28 @@
- -#if defined(__arch64__)
- -#include "sparc64/pthread_spin_trylock.c"
- -#else
- -#include "sparc32/pthread_spin_trylock.c"
- -#endif
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include "pthreadP.h"
- +
- +int
- +pthread_spin_trylock (pthread_spinlock_t *lock)
- +{
- + int res;
- + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
- + return res == 0 ? 0 : EBUSY;
- +}
- diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
- index d4695c4..435fedc 100644
- --- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
- +++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
- @@ -1,5 +1,39 @@
- -#if defined(__arch64__)
- -#include "sparc64/pthreaddef.h"
- -#else
- -#include "sparc32/pthreaddef.h"
- -#endif
- +/* Copyright (C) 2003 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +/* Default stack size. */
- +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
- +
- +/* Required stack pointer alignment at beginning. */
- +#define STACK_ALIGN 16
- +
- +/* Minimal stack size after allocating thread descriptor and guard size. */
- +#define MINIMAL_REST_STACK 2048
- +
- +/* Alignment requirement for TCB. */
- +#define TCB_ALIGNMENT 16
- +
- +
- +/* Location of current stack frame. */
- +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- +register char *stack_pointer __asm__("%sp");
- +
- +/* XXX Until we have a better place keep the definitions here. */
- +
- +/* While there is no such syscall. */
- +#define __exit_thread_inline(val) \
- + INLINE_SYSCALL (exit, 1, (val))
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
- deleted file mode 100644
- index 2f64e7d..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
- +++ /dev/null
- @@ -1,27 +0,0 @@
- -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <setjmp.h>
- -#include <stdint.h>
- -#include <unwind.h>
- -
- -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
- -
- -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
- deleted file mode 100644
- index 2dfcd3c..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
- +++ /dev/null
- @@ -1,39 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include "pthreadP.h"
- -
- -int
- -pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g2\n"
- - " orcc %%g2, 0x0, %%g0\n"
- - " bne,a 2f\n"
- - " ldub [%0], %%g2\n"
- - ".subsection 2\n"
- - "2: orcc %%g2, 0x0, %%g0\n"
- - " bne,a 2b\n"
- - " ldub [%0], %%g2\n"
- - " b,a 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g2", "memory", "cc");
- - return 0;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
- deleted file mode 100644
- index c1b7b23..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
- +++ /dev/null
- @@ -1,28 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include "pthreadP.h"
- -
- -int
- -pthread_spin_trylock (pthread_spinlock_t *lock)
- -{
- - int res;
- - __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
- - return res == 0 ? 0 : EBUSY;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
- deleted file mode 100644
- index 435fedc..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
- +++ /dev/null
- @@ -1,39 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -/* Default stack size. */
- -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
- -
- -/* Required stack pointer alignment at beginning. */
- -#define STACK_ALIGN 16
- -
- -/* Minimal stack size after allocating thread descriptor and guard size. */
- -#define MINIMAL_REST_STACK 2048
- -
- -/* Alignment requirement for TCB. */
- -#define TCB_ALIGNMENT 16
- -
- -
- -/* Location of current stack frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- -register char *stack_pointer __asm__("%sp");
- -
- -/* XXX Until we have a better place keep the definitions here. */
- -
- -/* While there is no such syscall. */
- -#define __exit_thread_inline(val) \
- - INLINE_SYSCALL (exit, 1, (val))
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
- deleted file mode 100644
- index 3d314be..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
- +++ /dev/null
- @@ -1,38 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include "pthreadP.h"
- -
- -int
- -pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g2\n"
- - " brnz,pn %%g2, 2f\n"
- - " membar #StoreLoad | #StoreStore\n"
- - ".subsection 2\n"
- - "2: ldub [%0], %%g2\n"
- - " brnz,pt %%g2, 2b\n"
- - " membar #LoadLoad\n"
- - " b,a,pt %%xcc, 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g2", "memory");
- - return 0;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
- deleted file mode 100644
- index 3b20a21..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include <sparc64/pthread_spin_trylock.c>
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
- deleted file mode 100644
- index 482cbe3..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include <sparc64/pthread_spin_unlock.c>
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
- deleted file mode 100644
- index 2f64e7d..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
- +++ /dev/null
- @@ -1,27 +0,0 @@
- -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <setjmp.h>
- -#include <stdint.h>
- -#include <unwind.h>
- -
- -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
- -
- -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
- deleted file mode 100644
- index 0235056..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
- +++ /dev/null
- @@ -1,38 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include "pthreadP.h"
- -
- -int
- -pthread_spin_lock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__
- - ("1: ldstub [%0], %%g5\n"
- - " brnz,pn %%g5, 2f\n"
- - " membar #StoreLoad | #StoreStore\n"
- - ".subsection 2\n"
- - "2: ldub [%0], %%g5\n"
- - " brnz,pt %%g5, 2b\n"
- - " membar #LoadLoad\n"
- - " b,a,pt %%xcc, 1b\n"
- - ".previous"
- - : /* no outputs */
- - : "r" (lock)
- - : "g5", "memory");
- - return 0;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
- deleted file mode 100644
- index b14621b..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
- +++ /dev/null
- @@ -1,33 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include "pthreadP.h"
- -
- -int
- -pthread_spin_trylock (pthread_spinlock_t *lock)
- -{
- - int res;
- - __asm__ __volatile__
- - ("ldstub [%1], %0\n"
- - "membar #StoreLoad | #StoreStore"
- - : "=r" (res)
- - : "r" (lock)
- - : "memory");
- - return res == 0 ? 0 : EBUSY;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
- deleted file mode 100644
- index a00fad3..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
- +++ /dev/null
- @@ -1,29 +0,0 @@
- -/* pthread_spin_unlock -- unlock a spin lock. Generic version.
- - Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include "pthreadP.h"
- -#include <atomic.h>
- -
- -int
- -pthread_spin_unlock (pthread_spinlock_t *lock)
- -{
- - __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
- - *lock = 0;
- - return 0;
- -}
- diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
- deleted file mode 100644
- index 845f4bf..0000000
- --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
- +++ /dev/null
- @@ -1,39 +0,0 @@
- -/* Copyright (C) 2003 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -/* Default stack size. */
- -#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
- -
- -/* Required stack pointer alignment at beginning. */
- -#define STACK_ALIGN 16
- -
- -/* Minimal stack size after allocating thread descriptor and guard size. */
- -#define MINIMAL_REST_STACK 4096
- -
- -/* Alignment requirement for TCB. */
- -#define TCB_ALIGNMENT 16
- -
- -
- -/* Location of current stack frame. */
- -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
- -register char *stack_pointer __asm__("%sp");
- -
- -/* XXX Until we have a better place keep the definitions here. */
- -
- -/* While there is no such syscall. */
- -#define __exit_thread_inline(val) \
- - INLINE_SYSCALL (exit, 1, (val))
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
- index dfc5e82..a6142aa 100644
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
- @@ -1,5 +1,2 @@
- -#if defined(__arch64__)
- -#include "./sparc64/clone.S"
- -#else
- -#include "./sparc32/clone.S"
- -#endif
- +#define RESET_PID
- +#include <libc/sysdeps/linux/sparc/clone.S>
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
- index e8705c5..37231a8 100644
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
- @@ -1,5 +1,44 @@
- -#if defined(__arch64__)
- -#include "sparc64/pt-vfork.S"
- -#else
- -#include "sparc32/pt-vfork.S"
- -#endif
- +/* Copyright (C) 2004 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <sysdep.h>
- +#include <tcb-offsets.h>
- +
- + .text
- + .globl __syscall_error
- +ENTRY(__vfork)
- + ld [%g7 + PID], %o5
- + sub %g0, %o5, %o4
- + st %o4, [%g7 + PID]
- +
- + LOADSYSCALL(vfork)
- + ta 0x10
- + bcc 2f
- + mov %o7, %g1
- + st %o5, [%g7 + PID]
- + call __syscall_error
- + mov %g1, %o7
- +2: sub %o1, 1, %o1
- + andcc %o0, %o1, %o0
- + bne,a 1f
- + st %o5, [%g7 + PID]
- +1: retl
- + nop
- +END(__vfork)
- +
- +weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
- index 73eaa69..169f6e7 100644
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
- @@ -1 +1,93 @@
- -#include "sparc32/pthread_barrier_wait.c"
- +/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <sysdep.h>
- +#include <lowlevellock.h>
- +#include <pthreadP.h>
- +
- +/* Wait on barrier. */
- +int
- +pthread_barrier_wait (
- + pthread_barrier_t *barrier)
- +{
- + union sparc_pthread_barrier *ibarrier
- + = (union sparc_pthread_barrier *) barrier;
- + int result = 0;
- + int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
- +
- + /* Make sure we are alone. */
- + lll_lock (ibarrier->b.lock, private);
- +
- + /* One more arrival. */
- + --ibarrier->b.left;
- +
- + /* Are these all? */
- + if (ibarrier->b.left == 0)
- + {
- + /* Yes. Increment the event counter to avoid invalid wake-ups and
- + tell the current waiters that it is their turn. */
- + ++ibarrier->b.curr_event;
- +
- + /* Wake up everybody. */
- + lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
- +
- + /* This is the thread which finished the serialization. */
- + result = PTHREAD_BARRIER_SERIAL_THREAD;
- + }
- + else
- + {
- + /* The number of the event we are waiting for. The barrier's event
- + number must be bumped before we continue. */
- + unsigned int event = ibarrier->b.curr_event;
- +
- + /* Before suspending, make the barrier available to others. */
- + lll_unlock (ibarrier->b.lock, private);
- +
- + /* Wait for the event counter of the barrier to change. */
- + do
- + lll_futex_wait (&ibarrier->b.curr_event, event, private);
- + while (event == ibarrier->b.curr_event);
- + }
- +
- + /* Make sure the init_count is stored locally or in a register. */
- + unsigned int init_count = ibarrier->b.init_count;
- +
- + /* If this was the last woken thread, unlock. */
- + if (__atomic_is_v9 || ibarrier->s.pshared == 0)
- + {
- + if (atomic_increment_val (&ibarrier->b.left) == init_count)
- + /* We are done. */
- + lll_unlock (ibarrier->b.lock, private);
- + }
- + else
- + {
- + unsigned int left;
- + /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
- + is only atomic for threads within the same process, not for
- + multiple processes. */
- + __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
- + left = ++ibarrier->b.left;
- + __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
- + if (left == init_count)
- + /* We are done. */
- + lll_unlock (ibarrier->b.lock, private);
- + }
- +
- + return result;
- +}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
- new file mode 100644
- index 0000000..8da4193
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
- @@ -0,0 +1,52 @@
- +/* sem_post -- post to a POSIX semaphore. SPARC version.
- + Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <sysdep.h>
- +#include <lowlevellock.h>
- +#include <internaltypes.h>
- +#include <semaphore.h>
- +
- +int
- +sem_post (sem_t *sem)
- +{
- + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- + int nr;
- +
- + if (__atomic_is_v9)
- + nr = atomic_increment_val (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + nr = ++(isem->value);
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- + atomic_full_barrier ();
- + if (isem->nwaiters > 0)
- + {
- + int err = lll_futex_wake (&isem->value, 1,
- + isem->private ^ FUTEX_PRIVATE_FLAG);
- + if (__builtin_expect (err, 0) < 0)
- + {
- + __set_errno (-err);
- + return -1;
- + }
- + }
- + return 0;
- +}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
- new file mode 100644
- index 0000000..64c9abf
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
- @@ -0,0 +1,147 @@
- +/* sem_timedwait -- wait on a semaphore. SPARC version.
- + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <sysdep.h>
- +#include <lowlevellock.h>
- +#include <internaltypes.h>
- +#include <semaphore.h>
- +
- +#include <pthreadP.h>
- +
- +
- +extern void __sem_wait_cleanup (void *arg) attribute_hidden;
- +
- +
- +int
- +sem_timedwait (sem_t *sem, const struct timespec *abstime)
- +{
- + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- + int err;
- + int val;
- +
- + if (__atomic_is_v9)
- + val = atomic_decrement_if_positive (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + val = isem->value;
- + if (val > 0)
- + isem->value = val - 1;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + if (val > 0)
- + return 0;
- +
- + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
- + {
- + __set_errno (EINVAL);
- + return -1;
- + }
- +
- + if (__atomic_is_v9)
- + atomic_increment (&isem->nwaiters);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + isem->nwaiters++;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + pthread_cleanup_push (__sem_wait_cleanup, isem);
- +
- + while (1)
- + {
- + struct timeval tv;
- + struct timespec rt;
- + int sec, nsec;
- +
- + /* Get the current time. */
- + __gettimeofday (&tv, NULL);
- +
- + /* Compute relative timeout. */
- + sec = abstime->tv_sec - tv.tv_sec;
- + nsec = abstime->tv_nsec - tv.tv_usec * 1000;
- + if (nsec < 0)
- + {
- + nsec += 1000000000;
- + --sec;
- + }
- +
- + /* Already timed out? */
- + err = -ETIMEDOUT;
- + if (sec < 0)
- + {
- + __set_errno (ETIMEDOUT);
- + err = -1;
- + break;
- + }
- +
- + /* Do wait. */
- + rt.tv_sec = sec;
- + rt.tv_nsec = nsec;
- +
- + /* Enable asynchronous cancellation. Required by the standard. */
- + int oldtype = __pthread_enable_asynccancel ();
- +
- + err = lll_futex_timed_wait (&isem->value, 0, &rt,
- + isem->private ^ FUTEX_PRIVATE_FLAG);
- +
- + /* Disable asynchronous cancellation. */
- + __pthread_disable_asynccancel (oldtype);
- +
- + if (err != 0 && err != -EWOULDBLOCK)
- + {
- + __set_errno (-err);
- + err = -1;
- + break;
- + }
- +
- + if (__atomic_is_v9)
- + val = atomic_decrement_if_positive (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + val = isem->value;
- + if (val > 0)
- + isem->value = val - 1;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + if (val > 0)
- + {
- + err = 0;
- + break;
- + }
- + }
- +
- + pthread_cleanup_pop (0);
- +
- + if (__atomic_is_v9)
- + atomic_decrement (&isem->nwaiters);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + isem->nwaiters--;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + return err;
- +}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
- new file mode 100644
- index 0000000..36e859b
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
- @@ -0,0 +1,51 @@
- +/* sem_trywait -- wait on a semaphore. SPARC version.
- + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <sysdep.h>
- +#include <lowlevellock.h>
- +#include <internaltypes.h>
- +#include <semaphore.h>
- +
- +
- +int
- +sem_trywait (sem_t *sem)
- +{
- + struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
- + int val;
- +
- + if (isem->value > 0)
- + {
- + if (__atomic_is_v9)
- + val = atomic_decrement_if_positive (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + val = isem->value;
- + if (val > 0)
- + isem->value = val - 1;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- + if (val > 0)
- + return 0;
- + }
- +
- + __set_errno (EAGAIN);
- + return -1;
- +}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
- new file mode 100644
- index 0000000..5d887ab
- --- /dev/null
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
- @@ -0,0 +1,124 @@
- +/* sem_wait -- wait on a semaphore. Generic futex-using version.
- + Copyright (C) 2003, 2007 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <errno.h>
- +#include <sysdep.h>
- +#include <lowlevellock.h>
- +#include <internaltypes.h>
- +#include <semaphore.h>
- +
- +#include <pthreadP.h>
- +
- +
- +void
- +attribute_hidden
- +__sem_wait_cleanup (void *arg)
- +{
- + struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
- +
- + if (__atomic_is_v9)
- + atomic_decrement (&isem->nwaiters);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + isem->nwaiters--;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +}
- +
- +
- +int
- +sem_wait (sem_t *sem)
- +{
- + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- + int err;
- + int val;
- +
- + if (__atomic_is_v9)
- + val = atomic_decrement_if_positive (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + val = isem->value;
- + if (val > 0)
- + isem->value = val - 1;
- + else
- + isem->nwaiters++;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + if (val > 0)
- + return 0;
- +
- + if (__atomic_is_v9)
- + atomic_increment (&isem->nwaiters);
- + else
- + /* Already done above while still holding isem->lock. */;
- +
- + pthread_cleanup_push (__sem_wait_cleanup, isem);
- +
- + while (1)
- + {
- + /* Enable asynchronous cancellation. Required by the standard. */
- + int oldtype = __pthread_enable_asynccancel ();
- +
- + err = lll_futex_wait (&isem->value, 0,
- + isem->private ^ FUTEX_PRIVATE_FLAG);
- +
- + /* Disable asynchronous cancellation. */
- + __pthread_disable_asynccancel (oldtype);
- +
- + if (err != 0 && err != -EWOULDBLOCK)
- + {
- + __set_errno (-err);
- + err = -1;
- + break;
- + }
- +
- + if (__atomic_is_v9)
- + val = atomic_decrement_if_positive (&isem->value);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + val = isem->value;
- + if (val > 0)
- + isem->value = val - 1;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + if (val > 0)
- + {
- + err = 0;
- + break;
- + }
- + }
- +
- + pthread_cleanup_pop (0);
- +
- + if (__atomic_is_v9)
- + atomic_decrement (&isem->nwaiters);
- + else
- + {
- + __sparc32_atomic_do_lock24 (&isem->lock);
- + isem->nwaiters--;
- + __sparc32_atomic_do_unlock24 (&isem->lock);
- + }
- +
- + return err;
- +}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
- deleted file mode 100644
- index a6142aa..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -#define RESET_PID
- -#include <libc/sysdeps/linux/sparc/clone.S>
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
- deleted file mode 100644
- index 37231a8..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
- +++ /dev/null
- @@ -1,44 +0,0 @@
- -/* Copyright (C) 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep.h>
- -#include <tcb-offsets.h>
- -
- - .text
- - .globl __syscall_error
- -ENTRY(__vfork)
- - ld [%g7 + PID], %o5
- - sub %g0, %o5, %o4
- - st %o4, [%g7 + PID]
- -
- - LOADSYSCALL(vfork)
- - ta 0x10
- - bcc 2f
- - mov %o7, %g1
- - st %o5, [%g7 + PID]
- - call __syscall_error
- - mov %g1, %o7
- -2: sub %o1, 1, %o1
- - andcc %o0, %o1, %o0
- - bne,a 1f
- - st %o5, [%g7 + PID]
- -1: retl
- - nop
- -END(__vfork)
- -
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
- deleted file mode 100644
- index 169f6e7..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
- +++ /dev/null
- @@ -1,93 +0,0 @@
- -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <sysdep.h>
- -#include <lowlevellock.h>
- -#include <pthreadP.h>
- -
- -/* Wait on barrier. */
- -int
- -pthread_barrier_wait (
- - pthread_barrier_t *barrier)
- -{
- - union sparc_pthread_barrier *ibarrier
- - = (union sparc_pthread_barrier *) barrier;
- - int result = 0;
- - int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
- -
- - /* Make sure we are alone. */
- - lll_lock (ibarrier->b.lock, private);
- -
- - /* One more arrival. */
- - --ibarrier->b.left;
- -
- - /* Are these all? */
- - if (ibarrier->b.left == 0)
- - {
- - /* Yes. Increment the event counter to avoid invalid wake-ups and
- - tell the current waiters that it is their turn. */
- - ++ibarrier->b.curr_event;
- -
- - /* Wake up everybody. */
- - lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
- -
- - /* This is the thread which finished the serialization. */
- - result = PTHREAD_BARRIER_SERIAL_THREAD;
- - }
- - else
- - {
- - /* The number of the event we are waiting for. The barrier's event
- - number must be bumped before we continue. */
- - unsigned int event = ibarrier->b.curr_event;
- -
- - /* Before suspending, make the barrier available to others. */
- - lll_unlock (ibarrier->b.lock, private);
- -
- - /* Wait for the event counter of the barrier to change. */
- - do
- - lll_futex_wait (&ibarrier->b.curr_event, event, private);
- - while (event == ibarrier->b.curr_event);
- - }
- -
- - /* Make sure the init_count is stored locally or in a register. */
- - unsigned int init_count = ibarrier->b.init_count;
- -
- - /* If this was the last woken thread, unlock. */
- - if (__atomic_is_v9 || ibarrier->s.pshared == 0)
- - {
- - if (atomic_increment_val (&ibarrier->b.left) == init_count)
- - /* We are done. */
- - lll_unlock (ibarrier->b.lock, private);
- - }
- - else
- - {
- - unsigned int left;
- - /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
- - is only atomic for threads within the same process, not for
- - multiple processes. */
- - __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
- - left = ++ibarrier->b.left;
- - __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
- - if (left == init_count)
- - /* We are done. */
- - lll_unlock (ibarrier->b.lock, private);
- - }
- -
- - return result;
- -}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
- deleted file mode 100644
- index 8da4193..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
- +++ /dev/null
- @@ -1,52 +0,0 @@
- -/* sem_post -- post to a POSIX semaphore. SPARC version.
- - Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <sysdep.h>
- -#include <lowlevellock.h>
- -#include <internaltypes.h>
- -#include <semaphore.h>
- -
- -int
- -sem_post (sem_t *sem)
- -{
- - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- - int nr;
- -
- - if (__atomic_is_v9)
- - nr = atomic_increment_val (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - nr = ++(isem->value);
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- - atomic_full_barrier ();
- - if (isem->nwaiters > 0)
- - {
- - int err = lll_futex_wake (&isem->value, 1,
- - isem->private ^ FUTEX_PRIVATE_FLAG);
- - if (__builtin_expect (err, 0) < 0)
- - {
- - __set_errno (-err);
- - return -1;
- - }
- - }
- - return 0;
- -}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
- deleted file mode 100644
- index 64c9abf..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
- +++ /dev/null
- @@ -1,147 +0,0 @@
- -/* sem_timedwait -- wait on a semaphore. SPARC version.
- - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <sysdep.h>
- -#include <lowlevellock.h>
- -#include <internaltypes.h>
- -#include <semaphore.h>
- -
- -#include <pthreadP.h>
- -
- -
- -extern void __sem_wait_cleanup (void *arg) attribute_hidden;
- -
- -
- -int
- -sem_timedwait (sem_t *sem, const struct timespec *abstime)
- -{
- - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- - int err;
- - int val;
- -
- - if (__atomic_is_v9)
- - val = atomic_decrement_if_positive (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - val = isem->value;
- - if (val > 0)
- - isem->value = val - 1;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - if (val > 0)
- - return 0;
- -
- - if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
- - {
- - __set_errno (EINVAL);
- - return -1;
- - }
- -
- - if (__atomic_is_v9)
- - atomic_increment (&isem->nwaiters);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - isem->nwaiters++;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - pthread_cleanup_push (__sem_wait_cleanup, isem);
- -
- - while (1)
- - {
- - struct timeval tv;
- - struct timespec rt;
- - int sec, nsec;
- -
- - /* Get the current time. */
- - __gettimeofday (&tv, NULL);
- -
- - /* Compute relative timeout. */
- - sec = abstime->tv_sec - tv.tv_sec;
- - nsec = abstime->tv_nsec - tv.tv_usec * 1000;
- - if (nsec < 0)
- - {
- - nsec += 1000000000;
- - --sec;
- - }
- -
- - /* Already timed out? */
- - err = -ETIMEDOUT;
- - if (sec < 0)
- - {
- - __set_errno (ETIMEDOUT);
- - err = -1;
- - break;
- - }
- -
- - /* Do wait. */
- - rt.tv_sec = sec;
- - rt.tv_nsec = nsec;
- -
- - /* Enable asynchronous cancellation. Required by the standard. */
- - int oldtype = __pthread_enable_asynccancel ();
- -
- - err = lll_futex_timed_wait (&isem->value, 0, &rt,
- - isem->private ^ FUTEX_PRIVATE_FLAG);
- -
- - /* Disable asynchronous cancellation. */
- - __pthread_disable_asynccancel (oldtype);
- -
- - if (err != 0 && err != -EWOULDBLOCK)
- - {
- - __set_errno (-err);
- - err = -1;
- - break;
- - }
- -
- - if (__atomic_is_v9)
- - val = atomic_decrement_if_positive (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - val = isem->value;
- - if (val > 0)
- - isem->value = val - 1;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - if (val > 0)
- - {
- - err = 0;
- - break;
- - }
- - }
- -
- - pthread_cleanup_pop (0);
- -
- - if (__atomic_is_v9)
- - atomic_decrement (&isem->nwaiters);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - isem->nwaiters--;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - return err;
- -}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
- deleted file mode 100644
- index 36e859b..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
- +++ /dev/null
- @@ -1,51 +0,0 @@
- -/* sem_trywait -- wait on a semaphore. SPARC version.
- - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <sysdep.h>
- -#include <lowlevellock.h>
- -#include <internaltypes.h>
- -#include <semaphore.h>
- -
- -
- -int
- -sem_trywait (sem_t *sem)
- -{
- - struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
- - int val;
- -
- - if (isem->value > 0)
- - {
- - if (__atomic_is_v9)
- - val = atomic_decrement_if_positive (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - val = isem->value;
- - if (val > 0)
- - isem->value = val - 1;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- - if (val > 0)
- - return 0;
- - }
- -
- - __set_errno (EAGAIN);
- - return -1;
- -}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
- deleted file mode 100644
- index 5d887ab..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
- +++ /dev/null
- @@ -1,124 +0,0 @@
- -/* sem_wait -- wait on a semaphore. Generic futex-using version.
- - Copyright (C) 2003, 2007 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <errno.h>
- -#include <sysdep.h>
- -#include <lowlevellock.h>
- -#include <internaltypes.h>
- -#include <semaphore.h>
- -
- -#include <pthreadP.h>
- -
- -
- -void
- -attribute_hidden
- -__sem_wait_cleanup (void *arg)
- -{
- - struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
- -
- - if (__atomic_is_v9)
- - atomic_decrement (&isem->nwaiters);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - isem->nwaiters--;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -}
- -
- -
- -int
- -sem_wait (sem_t *sem)
- -{
- - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
- - int err;
- - int val;
- -
- - if (__atomic_is_v9)
- - val = atomic_decrement_if_positive (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - val = isem->value;
- - if (val > 0)
- - isem->value = val - 1;
- - else
- - isem->nwaiters++;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - if (val > 0)
- - return 0;
- -
- - if (__atomic_is_v9)
- - atomic_increment (&isem->nwaiters);
- - else
- - /* Already done above while still holding isem->lock. */;
- -
- - pthread_cleanup_push (__sem_wait_cleanup, isem);
- -
- - while (1)
- - {
- - /* Enable asynchronous cancellation. Required by the standard. */
- - int oldtype = __pthread_enable_asynccancel ();
- -
- - err = lll_futex_wait (&isem->value, 0,
- - isem->private ^ FUTEX_PRIVATE_FLAG);
- -
- - /* Disable asynchronous cancellation. */
- - __pthread_disable_asynccancel (oldtype);
- -
- - if (err != 0 && err != -EWOULDBLOCK)
- - {
- - __set_errno (-err);
- - err = -1;
- - break;
- - }
- -
- - if (__atomic_is_v9)
- - val = atomic_decrement_if_positive (&isem->value);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - val = isem->value;
- - if (val > 0)
- - isem->value = val - 1;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - if (val > 0)
- - {
- - err = 0;
- - break;
- - }
- - }
- -
- - pthread_cleanup_pop (0);
- -
- - if (__atomic_is_v9)
- - atomic_decrement (&isem->nwaiters);
- - else
- - {
- - __sparc32_atomic_do_lock24 (&isem->lock);
- - isem->nwaiters--;
- - __sparc32_atomic_do_unlock24 (&isem->lock);
- - }
- -
- - return err;
- -}
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- deleted file mode 100644
- index b61ca7b..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
- +++ /dev/null
- @@ -1,111 +0,0 @@
- -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <tls.h>
- -#include <sysdep.h>
- -#ifndef __ASSEMBLER__
- -# include <pthreadP.h>
- -#endif
- -
- -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- -
- -# undef PSEUDO
- -# define PSEUDO(name, syscall_name, args) \
- - .text; \
- - .globl __syscall_error; \
- -ENTRY(name) \
- - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- - cmp %g1, 0; \
- - bne 1f; \
- -.type __##syscall_name##_nocancel,@function; \
- -.globl __##syscall_name##_nocancel; \
- -__##syscall_name##_nocancel: \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x10; \
- - bcc 8f; \
- - mov %o7, %g1; \
- - call __syscall_error; \
- - mov %g1, %o7; \
- -8: jmpl %o7 + 8, %g0; \
- - nop; \
- -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
- -1: save %sp, -96, %sp; \
- - cfi_def_cfa_register(%fp); \
- - cfi_window_save; \
- - cfi_register(%o7, %i7); \
- - CENABLE; \
- - nop; \
- - mov %o0, %l0; \
- - COPY_ARGS_##args \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x10; \
- - bcc 1f; \
- - mov %o0, %l1; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - call __syscall_error; \
- - mov %l1, %o0; \
- - b 2f; \
- - mov -1, %l1; \
- -1: CDISABLE; \
- - mov %l0, %o0; \
- -2: jmpl %i7 + 8, %g0; \
- - restore %g0, %l1, %o0;
- -
- -
- -# ifdef IS_IN_libpthread
- -# define CENABLE call __pthread_enable_asynccancel
- -# define CDISABLE call __pthread_disable_asynccancel
- -# elif !defined NOT_IN_libc
- -# define CENABLE call __libc_enable_asynccancel
- -# define CDISABLE call __libc_disable_asynccancel
- -# elif defined IS_IN_librt
- -# define CENABLE call __librt_enable_asynccancel
- -# define CDISABLE call __librt_disable_asynccancel
- -# else
- -# error Unsupported library
- -# endif
- -
- -#define COPY_ARGS_0 /* Nothing */
- -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- -
- -# ifndef __ASSEMBLER__
- -# define SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - header.multiple_threads) == 0, 1)
- -# else
- -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- -# endif
- -
- -#elif !defined __ASSEMBLER__
- -
- -# define SINGLE_THREAD_P (1)
- -# define NO_CANCELLATION 1
- -
- -#endif
- -
- -#ifndef __ASSEMBLER__
- -# define RTLD_SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - header.multiple_threads) == 0, 1)
- -#endif
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- deleted file mode 100644
- index 71f0662..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
- +++ /dev/null
- @@ -1,48 +0,0 @@
- -/* Copyright (C) 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep.h>
- -#include <tcb-offsets.h>
- -
- - .text
- - .globl __syscall_error
- -ENTRY(__vfork)
- - ld [%g7 + PID], %o5
- - cmp %o5, 0
- - bne 1f
- - sub %g0, %o5, %o4
- - sethi %hi(0x80000000), %o4
- -1: st %o4, [%g7 + PID]
- -
- - LOADSYSCALL(vfork)
- - ta 0x10
- - bcc 2f
- - mov %o7, %g1
- - st %o5, [%g7 + PID]
- - call __syscall_error
- - mov %g1, %o7
- -2: sub %o1, 1, %o1
- - andcc %o0, %o1, %o0
- - bne,a 1f
- - st %o5, [%g7 + PID]
- -1: retl
- - nop
- -END(__vfork)
- -
- -libc_hidden_def (vfork)
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
- deleted file mode 100644
- index 64e3bfc..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -#define RESET_PID
- -#include <libc/sysdeps/linux/sparc/sparcv9/clone.S>
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
- deleted file mode 100644
- index a058d89..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
- +++ /dev/null
- @@ -1,44 +0,0 @@
- -/* Copyright (C) 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep.h>
- -#include <tcb-offsets.h>
- -
- - .text
- - .globl __syscall_error
- -ENTRY(__vfork)
- - ld [%g7 + PID], %o5
- - sub %g0, %o5, %o4
- - st %o4, [%g7 + PID]
- -
- - LOADSYSCALL(vfork)
- - ta 0x6d
- - bcc,pt %xcc, 2f
- - mov %o7, %g1
- - st %o5, [%g7 + PID]
- - call __syscall_error
- - mov %g1, %o7
- -2: sub %o1, 1, %o1
- - andcc %o0, %o1, %o0
- - bne,a,pt %icc, 1f
- - st %o5, [%g7 + PID]
- -1: retl
- - nop
- -END(__vfork)
- -
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- deleted file mode 100644
- index 0e9d263..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
- +++ /dev/null
- @@ -1,109 +0,0 @@
- -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep.h>
- -#include <tls.h>
- -#ifndef __ASSEMBLER__
- -# include <pthreadP.h>
- -#endif
- -
- -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- -
- -# undef PSEUDO
- -# define PSEUDO(name, syscall_name, args) \
- - .text; \
- - .globl __syscall_error; \
- -ENTRY(name) \
- - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- - brnz,pn %g1, 1f; \
- -.type __##syscall_name##_nocancel,@function; \
- -.globl __##syscall_name##_nocancel; \
- -__##syscall_name##_nocancel: \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x6d; \
- - bcc,pt %xcc, 8f; \
- - mov %o7, %g1; \
- - call __syscall_error; \
- - mov %g1, %o7; \
- -8: jmpl %o7 + 8, %g0; \
- - nop; \
- -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
- -1: save %sp, -192, %sp; \
- - cfi_def_cfa_register(%fp); \
- - cfi_window_save; \
- - cfi_register(%o7, %i7); \
- - CENABLE; \
- - nop; \
- - mov %o0, %l0; \
- - COPY_ARGS_##args \
- - mov SYS_ify(syscall_name), %g1; \
- - ta 0x6d; \
- - bcc,pt %xcc, 1f; \
- - mov %o0, %l1; \
- - CDISABLE; \
- - mov %l0, %o0; \
- - call __syscall_error; \
- - mov %l1, %o0; \
- - ba,pt %xcc, 2f; \
- - mov -1, %l1; \
- -1: CDISABLE; \
- - mov %l0, %o0; \
- -2: jmpl %i7 + 8, %g0; \
- - restore %g0, %l1, %o0;
- -
- -# ifdef IS_IN_libpthread
- -# define CENABLE call __pthread_enable_asynccancel
- -# define CDISABLE call __pthread_disable_asynccancel
- -# elif !defined NOT_IN_libc
- -# define CENABLE call __libc_enable_asynccancel
- -# define CDISABLE call __libc_disable_asynccancel
- -# elif defined IS_IN_librt
- -# define CENABLE call __librt_enable_asynccancel
- -# define CDISABLE call __librt_disable_asynccancel
- -# else
- -# error Unsupported library
- -# endif
- -
- -#define COPY_ARGS_0 /* Nothing */
- -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- -
- -# ifndef __ASSEMBLER__
- -# define SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - header.multiple_threads) == 0, 1)
- -# else
- -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- -# endif
- -
- -#elif !defined __ASSEMBLER__
- -
- -# define SINGLE_THREAD_P (1)
- -# define NO_CANCELLATION 1
- -
- -#endif
- -
- -#ifndef __ASSEMBLER__
- -# define RTLD_SINGLE_THREAD_P \
- - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- - header.multiple_threads) == 0, 1)
- -#endif
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
- deleted file mode 100644
- index 0a9c337..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../x86_64/timer_create.c"
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
- deleted file mode 100644
- index f0d4fd2..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../x86_64/timer_delete.c"
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
- deleted file mode 100644
- index 82121a7..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../x86_64/timer_getoverr.c"
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
- deleted file mode 100644
- index 313c05f..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../x86_64/timer_gettime.c"
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
- deleted file mode 100644
- index 76f549c..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
- +++ /dev/null
- @@ -1 +0,0 @@
- -#include "../../x86_64/timer_settime.c"
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- deleted file mode 100644
- index bea4f2f..0000000
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
- +++ /dev/null
- @@ -1,48 +0,0 @@
- -/* Copyright (C) 2004 Free Software Foundation, Inc.
- - This file is part of the GNU C Library.
- - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- -
- - The GNU C Library is free software; you can redistribute it and/or
- - modify it under the terms of the GNU Lesser General Public
- - License as published by the Free Software Foundation; either
- - version 2.1 of the License, or (at your option) any later version.
- -
- - The GNU C Library is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- - Lesser General Public License for more details.
- -
- - You should have received a copy of the GNU Lesser General Public
- - License along with the GNU C Library; if not, see
- - <http://www.gnu.org/licenses/>. */
- -
- -#include <sysdep.h>
- -#include <tcb-offsets.h>
- -
- - .text
- - .globl __syscall_error
- -ENTRY(__vfork)
- - ld [%g7 + PID], %o5
- - sethi %hi(0x80000000), %o3
- - cmp %o5, 0
- - sub %g0, %o5, %o4
- - move %icc, %o3, %o4
- - st %o4, [%g7 + PID]
- -
- - LOADSYSCALL(vfork)
- - ta 0x6d
- - bcc,pt %xcc, 2f
- - mov %o7, %g1
- - st %o5, [%g7 + PID]
- - call __syscall_error
- - mov %g1, %o7
- -2: sub %o1, 1, %o1
- - andcc %o0, %o1, %o0
- - bne,a,pt %icc, 1f
- - st %o5, [%g7 + PID]
- -1: retl
- - nop
- -END(__vfork)
- -
- -hidden_def (vfork)
- -weak_alias (__vfork, vfork)
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- index 5be9beb..b61ca7b 100644
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
- @@ -1,5 +1,111 @@
- -#if defined(__arch64__)
- -#include "sparc64/sysdep-cancel.h"
- -#else
- -#include "sparc32/sysdep-cancel.h"
- +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <tls.h>
- +#include <sysdep.h>
- +#ifndef __ASSEMBLER__
- +# include <pthreadP.h>
- +#endif
- +
- +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
- +
- +# undef PSEUDO
- +# define PSEUDO(name, syscall_name, args) \
- + .text; \
- + .globl __syscall_error; \
- +ENTRY(name) \
- + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- + cmp %g1, 0; \
- + bne 1f; \
- +.type __##syscall_name##_nocancel,@function; \
- +.globl __##syscall_name##_nocancel; \
- +__##syscall_name##_nocancel: \
- + mov SYS_ify(syscall_name), %g1; \
- + ta 0x10; \
- + bcc 8f; \
- + mov %o7, %g1; \
- + call __syscall_error; \
- + mov %g1, %o7; \
- +8: jmpl %o7 + 8, %g0; \
- + nop; \
- +.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
- +1: save %sp, -96, %sp; \
- + cfi_def_cfa_register(%fp); \
- + cfi_window_save; \
- + cfi_register(%o7, %i7); \
- + CENABLE; \
- + nop; \
- + mov %o0, %l0; \
- + COPY_ARGS_##args \
- + mov SYS_ify(syscall_name), %g1; \
- + ta 0x10; \
- + bcc 1f; \
- + mov %o0, %l1; \
- + CDISABLE; \
- + mov %l0, %o0; \
- + call __syscall_error; \
- + mov %l1, %o0; \
- + b 2f; \
- + mov -1, %l1; \
- +1: CDISABLE; \
- + mov %l0, %o0; \
- +2: jmpl %i7 + 8, %g0; \
- + restore %g0, %l1, %o0;
- +
- +
- +# ifdef IS_IN_libpthread
- +# define CENABLE call __pthread_enable_asynccancel
- +# define CDISABLE call __pthread_disable_asynccancel
- +# elif !defined NOT_IN_libc
- +# define CENABLE call __libc_enable_asynccancel
- +# define CDISABLE call __libc_disable_asynccancel
- +# elif defined IS_IN_librt
- +# define CENABLE call __librt_enable_asynccancel
- +# define CDISABLE call __librt_disable_asynccancel
- +# else
- +# error Unsupported library
- +# endif
- +
- +#define COPY_ARGS_0 /* Nothing */
- +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
- +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
- +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
- +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
- +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
- +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
- +
- +# ifndef __ASSEMBLER__
- +# define SINGLE_THREAD_P \
- + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- + header.multiple_threads) == 0, 1)
- +# else
- +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
- +# endif
- +
- +#elif !defined __ASSEMBLER__
- +
- +# define SINGLE_THREAD_P (1)
- +# define NO_CANCELLATION 1
- +
- +#endif
- +
- +#ifndef __ASSEMBLER__
- +# define RTLD_SINGLE_THREAD_P \
- + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- + header.multiple_threads) == 0, 1)
- #endif
- diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
- index 160cd0b..71f0662 100644
- --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
- +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
- @@ -1,5 +1,48 @@
- -#if defined(__arch64__)
- -#include "sparc64/vfork.S"
- -#else
- -#include "sparc32/vfork.S"
- -#endif
- +/* Copyright (C) 2004 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <http://www.gnu.org/licenses/>. */
- +
- +#include <sysdep.h>
- +#include <tcb-offsets.h>
- +
- + .text
- + .globl __syscall_error
- +ENTRY(__vfork)
- + ld [%g7 + PID], %o5
- + cmp %o5, 0
- + bne 1f
- + sub %g0, %o5, %o4
- + sethi %hi(0x80000000), %o4
- +1: st %o4, [%g7 + PID]
- +
- + LOADSYSCALL(vfork)
- + ta 0x10
- + bcc 2f
- + mov %o7, %g1
- + st %o5, [%g7 + PID]
- + call __syscall_error
- + mov %g1, %o7
- +2: sub %o1, 1, %o1
- + andcc %o0, %o1, %o0
- + bne,a 1f
- + st %o5, [%g7 + PID]
- +1: retl
- + nop
- +END(__vfork)
- +
- +libc_hidden_def (vfork)
- +weak_alias (__vfork, vfork)
- --
- 1.8.5.2 (Apple Git-48)
|