0004-sparc-remove-sparc64-sparcv9-code.patch 282 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657
  1. From b0baf143cc3f8f081254e6073b47eeb837ca4470 Mon Sep 17 00:00:00 2001
  2. From: Waldemar Brodkorb <wbx@openadk.org>
  3. Date: Sun, 31 Aug 2014 10:48:39 +0200
  4. Subject: [PATCH 4/4] sparc: remove sparc64/sparcv9 code
  5. The sparc64/sparcv9 code is incomplete. Furthermore there is
  6. no real embedded hardware for sparc64 available, so better remove
  7. it until someone comes up with a complete port.
  8. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  9. ---
  10. extra/Configs/Config.sparc | 6 -
  11. libc/string/sparc/sparc64/memchr.S | 258 ------
  12. libc/string/sparc/sparc64/memcpy.S | 922 ---------------------
  13. libc/string/sparc/sparc64/memset.S | 316 -------
  14. libc/string/sparc/sparc64/sparcv9b/memcpy.S | 611 --------------
  15. libc/string/sparc/sparc64/stpcpy.S | 270 ------
  16. libc/string/sparc/sparc64/strcat.S | 338 --------
  17. libc/string/sparc/sparc64/strchr.S | 485 -----------
  18. libc/string/sparc/sparc64/strcmp.S | 278 -------
  19. libc/string/sparc/sparc64/strcpy.S | 244 ------
  20. libc/string/sparc/sparc64/strlen.S | 172 ----
  21. libc/sysdeps/linux/sparc/bits/setjmp.h | 31 -
  22. libc/sysdeps/linux/sparc/bits/sigcontext.h | 35 -
  23. libc/sysdeps/linux/sparc/crt1.S | 11 -
  24. libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 18 -
  25. libc/sysdeps/linux/sparc/qp_ops.c | 8 -
  26. libc/sysdeps/linux/sparc/sparcv9/clone.S | 101 ---
  27. libc/sysdeps/linux/sparc/sparcv9/rem.S | 20 -
  28. libc/sysdeps/linux/sparc/sparcv9/sdiv.S | 18 -
  29. libc/sysdeps/linux/sparc/sparcv9/udiv.S | 15 -
  30. libc/sysdeps/linux/sparc/sparcv9/umul.S | 15 -
  31. libc/sysdeps/linux/sparc/sparcv9/urem.S | 17 -
  32. libc/sysdeps/linux/sparc/sys/procfs.h | 88 --
  33. .../linuxthreads.old/sysdeps/sparc/pt-machine.h | 86 +-
  34. .../sysdeps/sparc/sparc32/pt-machine.h | 82 --
  35. .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
  36. libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 95 ++-
  37. libpthread/linuxthreads/sysdeps/sparc/pt-machine.h | 86 +-
  38. .../linuxthreads/sysdeps/sparc/sparc32/pspinlock.c | 87 --
  39. .../sysdeps/sparc/sparc32/pt-machine.h | 82 --
  40. .../sysdeps/sparc/sparc32/sparcv9/pspinlock.c | 93 ---
  41. .../linuxthreads/sysdeps/sparc/sparc64/pspinlock.c | 92 --
  42. .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
  43. .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 100 ---
  44. .../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 64 --
  45. .../unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c | 1 -
  46. .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 99 ---
  47. .../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 63 --
  48. .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 102 ++-
  49. .../sysdeps/unix/sysv/linux/sparc/vfork.S | 64 ++
  50. libpthread/nptl/sysdeps/jmpbuf-unwind.h | 27 +
  51. libpthread/nptl/sysdeps/pthread_spin_lock.c | 39 +
  52. libpthread/nptl/sysdeps/pthread_spin_trylock.c | 28 +
  53. libpthread/nptl/sysdeps/pthreaddef.h | 39 +
  54. libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 32 +-
  55. libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c | 44 +-
  56. .../nptl/sysdeps/sparc/pthread_spin_trylock.c | 33 +-
  57. libpthread/nptl/sysdeps/sparc/pthreaddef.h | 44 +-
  58. .../nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h | 27 -
  59. .../nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c | 39 -
  60. .../sysdeps/sparc/sparc32/pthread_spin_trylock.c | 28 -
  61. libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h | 39 -
  62. .../sparc/sparc32/sparcv9/pthread_spin_lock.c | 38 -
  63. .../sparc/sparc32/sparcv9/pthread_spin_trylock.c | 1 -
  64. .../sparc/sparc32/sparcv9/pthread_spin_unlock.c | 1 -
  65. .../nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h | 27 -
  66. .../nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c | 38 -
  67. .../sysdeps/sparc/sparc64/pthread_spin_trylock.c | 33 -
  68. .../sysdeps/sparc/sparc64/pthread_spin_unlock.c | 29 -
  69. libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h | 39 -
  70. .../nptl/sysdeps/unix/sysv/linux/sparc/clone.S | 7 +-
  71. .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 49 +-
  72. .../unix/sysv/linux/sparc/pthread_barrier_wait.c | 94 ++-
  73. .../nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c | 52 ++
  74. .../sysdeps/unix/sysv/linux/sparc/sem_timedwait.c | 147 ++++
  75. .../sysdeps/unix/sysv/linux/sparc/sem_trywait.c | 51 ++
  76. .../nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c | 124 +++
  77. .../sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 2 -
  78. .../unix/sysv/linux/sparc/sparc32/pt-vfork.S | 44 -
  79. .../linux/sparc/sparc32/pthread_barrier_wait.c | 93 ---
  80. .../unix/sysv/linux/sparc/sparc32/sem_post.c | 52 --
  81. .../unix/sysv/linux/sparc/sparc32/sem_timedwait.c | 147 ----
  82. .../unix/sysv/linux/sparc/sparc32/sem_trywait.c | 51 --
  83. .../unix/sysv/linux/sparc/sparc32/sem_wait.c | 124 ---
  84. .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 111 ---
  85. .../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 48 --
  86. .../sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 2 -
  87. .../unix/sysv/linux/sparc/sparc64/pt-vfork.S | 44 -
  88. .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 109 ---
  89. .../unix/sysv/linux/sparc/sparc64/timer_create.c | 1 -
  90. .../unix/sysv/linux/sparc/sparc64/timer_delete.c | 1 -
  91. .../unix/sysv/linux/sparc/sparc64/timer_getoverr.c | 1 -
  92. .../unix/sysv/linux/sparc/sparc64/timer_gettime.c | 1 -
  93. .../unix/sysv/linux/sparc/sparc64/timer_settime.c | 1 -
  94. .../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 48 --
  95. .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 114 ++-
  96. .../nptl/sysdeps/unix/sysv/linux/sparc/vfork.S | 53 +-
  97. 87 files changed, 1341 insertions(+), 6536 deletions(-)
  98. delete mode 100644 libc/string/sparc/sparc64/memchr.S
  99. delete mode 100644 libc/string/sparc/sparc64/memcpy.S
  100. delete mode 100644 libc/string/sparc/sparc64/memset.S
  101. delete mode 100644 libc/string/sparc/sparc64/sparcv9b/memcpy.S
  102. delete mode 100644 libc/string/sparc/sparc64/stpcpy.S
  103. delete mode 100644 libc/string/sparc/sparc64/strcat.S
  104. delete mode 100644 libc/string/sparc/sparc64/strchr.S
  105. delete mode 100644 libc/string/sparc/sparc64/strcmp.S
  106. delete mode 100644 libc/string/sparc/sparc64/strcpy.S
  107. delete mode 100644 libc/string/sparc/sparc64/strlen.S
  108. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/clone.S
  109. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/rem.S
  110. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/sdiv.S
  111. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/udiv.S
  112. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/umul.S
  113. delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/urem.S
  114. delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
  115. delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
  116. delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
  117. delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
  118. delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
  119. delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
  120. delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
  121. delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  122. delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  123. delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
  124. delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  125. delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  126. create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
  127. create mode 100644 libpthread/nptl/sysdeps/jmpbuf-unwind.h
  128. create mode 100644 libpthread/nptl/sysdeps/pthread_spin_lock.c
  129. create mode 100644 libpthread/nptl/sysdeps/pthread_spin_trylock.c
  130. create mode 100644 libpthread/nptl/sysdeps/pthreaddef.h
  131. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
  132. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
  133. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
  134. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
  135. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
  136. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
  137. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
  138. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
  139. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
  140. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
  141. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
  142. delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
  143. create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
  144. create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
  145. create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
  146. create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
  147. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
  148. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
  149. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
  150. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
  151. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
  152. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
  153. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
  154. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  155. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  156. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
  157. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
  158. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  159. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
  160. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
  161. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
  162. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
  163. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
  164. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  165. diff --git a/extra/Configs/Config.sparc b/extra/Configs/Config.sparc
  166. index c6180c8..47c8ac2 100644
  167. --- a/extra/Configs/Config.sparc
  168. +++ b/extra/Configs/Config.sparc
  169. @@ -26,10 +26,4 @@ config CONFIG_SPARC_V7
  170. config CONFIG_SPARC_V8
  171. bool "SPARC v8"
  172. -config CONFIG_SPARC_V9
  173. - bool "SPARC v9"
  174. -
  175. -config CONFIG_SPARC_V9B
  176. - bool "SPARC v9b"
  177. -
  178. endchoice
  179. diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S
  180. deleted file mode 100644
  181. index 6467f7f..0000000
  182. --- a/libc/string/sparc/sparc64/memchr.S
  183. +++ /dev/null
  184. @@ -1,258 +0,0 @@
  185. -/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
  186. - than N.
  187. - For SPARC v9.
  188. - Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
  189. - This file is part of the GNU C Library.
  190. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  191. - Jakub Jelinek <jj@ultra.linux.cz>.
  192. - This version is developed using the same algorithm as the fast C
  193. - version which carries the following introduction:
  194. - Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
  195. - with help from Dan Sahlin (dan@sics.se) and
  196. - commentary by Jim Blandy (jimb@ai.mit.edu);
  197. - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
  198. - and implemented by Roland McGrath (roland@ai.mit.edu).
  199. -
  200. - The GNU C Library is free software; you can redistribute it and/or
  201. - modify it under the terms of the GNU Lesser General Public
  202. - License as published by the Free Software Foundation; either
  203. - version 2.1 of the License, or (at your option) any later version.
  204. -
  205. - The GNU C Library is distributed in the hope that it will be useful,
  206. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  207. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  208. - Lesser General Public License for more details.
  209. -
  210. - You should have received a copy of the GNU Lesser General Public
  211. - License along with the GNU C Library; if not, see
  212. - <http://www.gnu.org/licenses/>. */
  213. -
  214. -#include <asm/asi.h>
  215. -#ifndef XCC
  216. -#define XCC xcc
  217. -#define USE_BPR
  218. - .register %g2, #scratch
  219. - .register %g3, #scratch
  220. -#endif
  221. -
  222. - /* Normally, this uses
  223. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  224. - to find out if any byte in xword could be zero. This is fast, but
  225. - also gives false alarm for any byte in range 0x81-0xff. It does
  226. - not matter for correctness, as if this test tells us there could
  227. - be some zero byte, we check it byte by byte, but if bytes with
  228. - high bits set are common in the strings, then this will give poor
  229. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  230. - will use one tick slower, but more precise test
  231. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  232. - which does not give any false alarms (but if some bits are set,
  233. - one cannot assume from it which bytes are zero and which are not).
  234. - It is yet to be measured, what is the correct default for glibc
  235. - in these days for an average user.
  236. - */
  237. -
  238. - .text
  239. - .align 32
  240. -ENTRY(memchr)
  241. - and %o1, 0xff, %o1 /* IEU0 Group */
  242. -#ifdef USE_BPR
  243. - brz,pn %o2, 12f /* CTI+IEU1 */
  244. -#else
  245. - tst %o2 /* IEU1 */
  246. - be,pn %XCC, 12f /* CTI */
  247. -#endif
  248. - sll %o1, 8, %g3 /* IEU0 Group */
  249. - add %o0, %o2, %o2 /* IEU1 */
  250. -
  251. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  252. - or %g3, %o1, %g3 /* IEU1 */
  253. - ldub [%o0], %o3 /* Load */
  254. - sllx %g3, 16, %g5 /* IEU0 Group */
  255. -
  256. - or %g1, %lo(0x01010101), %g1 /* IEU1 */
  257. - sllx %g1, 32, %g2 /* IEU0 Group */
  258. - or %g3, %g5, %g3 /* IEU1 */
  259. - sllx %g3, 32, %g5 /* IEU0 Group */
  260. -
  261. - cmp %o3, %o1 /* IEU1 */
  262. - be,pn %xcc, 13f /* CTI */
  263. - or %g1, %g2, %g1 /* IEU0 Group */
  264. - andcc %o0, 7, %g0 /* IEU1 */
  265. -
  266. - bne,a,pn %icc, 21f /* CTI */
  267. - add %o0, 1, %o0 /* IEU0 Group */
  268. - ldx [%o0], %o3 /* Load Group */
  269. - sllx %g1, 7, %g2 /* IEU0 */
  270. -
  271. - or %g3, %g5, %g3 /* IEU1 */
  272. -1: add %o0, 8, %o0 /* IEU0 Group */
  273. - xor %o3, %g3, %o4 /* IEU1 */
  274. - /* %g1 = 0101010101010101 *
  275. - * %g2 = 8080088080808080 *
  276. - * %g3 = c c c c c c c c *
  277. - * %o3 = value *
  278. - * %o4 = value XOR c */
  279. -2: cmp %o0, %o2 /* IEU1 Group */
  280. -
  281. - bg,pn %XCC, 11f /* CTI */
  282. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  283. - sub %o4, %g1, %o5 /* IEU0 Group */
  284. - add %o0, 8, %o0 /* IEU1 */
  285. -#ifdef EIGHTBIT_NOT_RARE
  286. - andn %o5, %o4, %o5 /* IEU0 Group */
  287. -#endif
  288. -
  289. - andcc %o5, %g2, %g0 /* IEU1 Group */
  290. - be,a,pt %xcc, 2b /* CTI */
  291. - xor %o3, %g3, %o4 /* IEU0 */
  292. - srlx %o4, 56, %g5 /* IEU0 */
  293. -
  294. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  295. - be,pn %icc, 3f /* CTI */
  296. - srlx %o4, 48, %g5 /* IEU0 */
  297. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  298. -
  299. - be,pn %icc, 4f /* CTI */
  300. - srlx %o4, 40, %g5 /* IEU0 */
  301. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  302. - be,pn %icc, 5f /* CTI */
  303. -
  304. - srlx %o4, 32, %g5 /* IEU0 */
  305. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  306. - be,pn %icc, 6f /* CTI */
  307. - srlx %o4, 24, %g5 /* IEU0 */
  308. -
  309. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  310. - be,pn %icc, 7f /* CTI */
  311. - srlx %o4, 16, %g5 /* IEU0 */
  312. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  313. -
  314. - be,pn %icc, 8f /* CTI */
  315. - srlx %o4, 8, %g5 /* IEU0 */
  316. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  317. - be,pn %icc, 9f /* CTI */
  318. -
  319. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  320. - bne,pt %icc, 2b /* CTI */
  321. - xor %o3, %g3, %o4 /* IEU0 */
  322. - retl /* CTI+IEU1 Group */
  323. -
  324. - add %o0, -9, %o0 /* IEU0 */
  325. -
  326. - .align 16
  327. -3: retl /* CTI+IEU1 Group */
  328. - add %o0, -16, %o0 /* IEU0 */
  329. -4: retl /* CTI+IEU1 Group */
  330. - add %o0, -15, %o0 /* IEU0 */
  331. -
  332. -5: retl /* CTI+IEU1 Group */
  333. - add %o0, -14, %o0 /* IEU0 */
  334. -6: retl /* CTI+IEU1 Group */
  335. - add %o0, -13, %o0 /* IEU0 */
  336. -
  337. -7: retl /* CTI+IEU1 Group */
  338. - add %o0, -12, %o0 /* IEU0 */
  339. -8: retl /* CTI+IEU1 Group */
  340. - add %o0, -11, %o0 /* IEU0 */
  341. -
  342. -9: retl /* CTI+IEU1 Group */
  343. - add %o0, -10, %o0 /* IEU0 */
  344. -11: sub %o4, %g1, %o5 /* IEU0 Group */
  345. - sub %o0, 8, %o0 /* IEU1 */
  346. -
  347. - andcc %o5, %g2, %g0 /* IEU1 Group */
  348. - be,pt %xcc, 12f /* CTI */
  349. - sub %o2, %o0, %o2 /* IEU0 */
  350. - tst %o2 /* IEU1 Group */
  351. -
  352. - be,pn %XCC, 12f /* CTI */
  353. - srlx %o4, 56, %g5 /* IEU0 */
  354. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  355. - be,pn %icc, 13f /* CTI */
  356. -
  357. - cmp %o2, 1 /* IEU0 */
  358. - be,pn %XCC, 12f /* CTI Group */
  359. - srlx %o4, 48, %g5 /* IEU0 */
  360. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  361. -
  362. - be,pn %icc, 14f /* CTI */
  363. - cmp %o2, 2 /* IEU1 Group */
  364. - be,pn %XCC, 12f /* CTI */
  365. - srlx %o4, 40, %g5 /* IEU0 */
  366. -
  367. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  368. - be,pn %icc, 15f /* CTI */
  369. - cmp %o2, 3 /* IEU1 Group */
  370. - be,pn %XCC, 12f /* CTI */
  371. -
  372. - srlx %o4, 32, %g5 /* IEU0 */
  373. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  374. - be,pn %icc, 16f /* CTI */
  375. - cmp %o2, 4 /* IEU1 Group */
  376. -
  377. - be,pn %XCC, 12f /* CTI */
  378. - srlx %o4, 24, %g5 /* IEU0 */
  379. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  380. - be,pn %icc, 17f /* CTI */
  381. -
  382. - cmp %o2, 5 /* IEU1 Group */
  383. - be,pn %XCC, 12f /* CTI */
  384. - srlx %o4, 16, %g5 /* IEU0 */
  385. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  386. -
  387. - be,pn %icc, 18f /* CTI */
  388. - cmp %o2, 6 /* IEU1 Group */
  389. - be,pn %XCC, 12f /* CTI */
  390. - srlx %o4, 8, %g5 /* IEU0 */
  391. -
  392. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  393. - be,pn %icc, 19f /* CTI */
  394. - nop /* IEU0 */
  395. -12: retl /* CTI+IEU1 Group */
  396. -
  397. - clr %o0 /* IEU0 */
  398. - nop /* Stub */
  399. -13: retl /* CTI+IEU1 Group */
  400. - nop /* IEU0 */
  401. -
  402. -14: retl /* CTI+IEU1 Group */
  403. - add %o0, 1, %o0 /* IEU0 */
  404. -15: retl /* CTI+IEU1 Group */
  405. - add %o0, 2, %o0 /* IEU0 */
  406. -
  407. -16: retl /* CTI+IEU1 Group */
  408. - add %o0, 3, %o0 /* IEU0 */
  409. -17: retl /* CTI+IEU1 Group */
  410. - add %o0, 4, %o0 /* IEU0 */
  411. -
  412. -18: retl /* CTI+IEU1 Group */
  413. - add %o0, 5, %o0 /* IEU0 */
  414. -19: retl /* CTI+IEU1 Group */
  415. - add %o0, 6, %o0 /* IEU0 */
  416. -
  417. -21: cmp %o0, %o2 /* IEU1 */
  418. - be,pn %XCC, 12b /* CTI */
  419. - sllx %g1, 7, %g2 /* IEU0 Group */
  420. - ldub [%o0], %o3 /* Load */
  421. -
  422. - or %g3, %g5, %g3 /* IEU1 */
  423. -22: andcc %o0, 7, %g0 /* IEU1 Group */
  424. - be,a,pn %icc, 1b /* CTI */
  425. - ldx [%o0], %o3 /* Load */
  426. -
  427. - cmp %o3, %o1 /* IEU1 Group */
  428. - be,pn %xcc, 23f /* CTI */
  429. - add %o0, 1, %o0 /* IEU0 */
  430. - cmp %o0, %o2 /* IEU1 Group */
  431. -
  432. - bne,a,pt %XCC, 22b /* CTI */
  433. - ldub [%o0], %o3 /* Load */
  434. - retl /* CTI+IEU1 Group */
  435. - clr %o0 /* IEU0 */
  436. -
  437. -23: retl /* CTI+IEU1 Group */
  438. - add %o0, -1, %o0 /* IEU0 */
  439. -END(memchr)
  440. -
  441. -libc_hidden_def(memchr)
  442. -weak_alias(memchr,__ubp_memchr)
  443. diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
  444. deleted file mode 100644
  445. index df3e2d3..0000000
  446. --- a/libc/string/sparc/sparc64/memcpy.S
  447. +++ /dev/null
  448. @@ -1,922 +0,0 @@
  449. -/* Copy SIZE bytes from SRC to DEST.
  450. - For UltraSPARC.
  451. - Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
  452. - This file is part of the GNU C Library.
  453. - Contributed by David S. Miller (davem@caip.rutgers.edu) and
  454. - Jakub Jelinek (jakub@redhat.com).
  455. -
  456. - The GNU C Library is free software; you can redistribute it and/or
  457. - modify it under the terms of the GNU Lesser General Public
  458. - License as published by the Free Software Foundation; either
  459. - version 2.1 of the License, or (at your option) any later version.
  460. -
  461. - The GNU C Library is distributed in the hope that it will be useful,
  462. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  463. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  464. - Lesser General Public License for more details.
  465. -
  466. - You should have received a copy of the GNU Lesser General Public
  467. - License along with the GNU C Library; if not, see
  468. - <http://www.gnu.org/licenses/>. */
  469. -
  470. -#include <features.h>
  471. -#include <asm/asi.h>
  472. -#ifndef XCC
  473. -#define USE_BPR
  474. - .register %g2, #scratch
  475. - .register %g3, #scratch
  476. - .register %g6, #scratch
  477. -#define XCC xcc
  478. -#endif
  479. -#define FPRS_FEF 4
  480. -
  481. -#define FREG_FROB(f1, f2, f3, f4, f5, f6, f7, f8, f9) \
  482. - faligndata %f1, %f2, %f48; \
  483. - faligndata %f2, %f3, %f50; \
  484. - faligndata %f3, %f4, %f52; \
  485. - faligndata %f4, %f5, %f54; \
  486. - faligndata %f5, %f6, %f56; \
  487. - faligndata %f6, %f7, %f58; \
  488. - faligndata %f7, %f8, %f60; \
  489. - faligndata %f8, %f9, %f62;
  490. -
  491. -#define MAIN_LOOP_CHUNK(src, dest, fdest, fsrc, len, jmptgt) \
  492. - ldda [%src] %asi, %fdest; \
  493. - add %src, 0x40, %src; \
  494. - add %dest, 0x40, %dest; \
  495. - subcc %len, 0x40, %len; \
  496. - be,pn %xcc, jmptgt; \
  497. - stda %fsrc, [%dest - 0x40] %asi;
  498. -
  499. -#define LOOP_CHUNK1(src, dest, len, branch_dest) \
  500. - MAIN_LOOP_CHUNK(src, dest, f0, f48, len, branch_dest)
  501. -#define LOOP_CHUNK2(src, dest, len, branch_dest) \
  502. - MAIN_LOOP_CHUNK(src, dest, f16, f48, len, branch_dest)
  503. -#define LOOP_CHUNK3(src, dest, len, branch_dest) \
  504. - MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest)
  505. -
  506. -#define STORE_SYNC(dest, fsrc) \
  507. - stda %fsrc, [%dest] %asi; \
  508. - add %dest, 0x40, %dest;
  509. -
  510. -#define STORE_JUMP(dest, fsrc, target) \
  511. - stda %fsrc, [%dest] %asi; \
  512. - add %dest, 0x40, %dest; \
  513. - ba,pt %xcc, target;
  514. -
  515. -#define VISLOOP_PAD nop; nop; nop; nop; \
  516. - nop; nop; nop; nop; \
  517. - nop; nop; nop; nop; \
  518. - nop; nop; nop;
  519. -
  520. -#define FINISH_VISCHUNK(dest, f0, f1, left) \
  521. - subcc %left, 8, %left; \
  522. - bl,pn %xcc, 205f; \
  523. - faligndata %f0, %f1, %f48; \
  524. - std %f48, [%dest]; \
  525. - add %dest, 8, %dest;
  526. -
  527. -#define UNEVEN_VISCHUNK(dest, f0, f1, left) \
  528. - subcc %left, 8, %left; \
  529. - bl,pn %xcc, 205f; \
  530. - fsrc1 %f0, %f1; \
  531. - ba,a,pt %xcc, 204f;
  532. -
  533. - /* Macros for non-VIS memcpy code. */
  534. -#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
  535. - ldx [%src + offset + 0x00], %t0; \
  536. - ldx [%src + offset + 0x08], %t1; \
  537. - ldx [%src + offset + 0x10], %t2; \
  538. - ldx [%src + offset + 0x18], %t3; \
  539. - stw %t0, [%dst + offset + 0x04]; \
  540. - srlx %t0, 32, %t0; \
  541. - stw %t0, [%dst + offset + 0x00]; \
  542. - stw %t1, [%dst + offset + 0x0c]; \
  543. - srlx %t1, 32, %t1; \
  544. - stw %t1, [%dst + offset + 0x08]; \
  545. - stw %t2, [%dst + offset + 0x14]; \
  546. - srlx %t2, 32, %t2; \
  547. - stw %t2, [%dst + offset + 0x10]; \
  548. - stw %t3, [%dst + offset + 0x1c]; \
  549. - srlx %t3, 32, %t3; \
  550. - stw %t3, [%dst + offset + 0x18];
  551. -
  552. -#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
  553. - ldx [%src + offset + 0x00], %t0; \
  554. - ldx [%src + offset + 0x08], %t1; \
  555. - ldx [%src + offset + 0x10], %t2; \
  556. - ldx [%src + offset + 0x18], %t3; \
  557. - stx %t0, [%dst + offset + 0x00]; \
  558. - stx %t1, [%dst + offset + 0x08]; \
  559. - stx %t2, [%dst + offset + 0x10]; \
  560. - stx %t3, [%dst + offset + 0x18]; \
  561. - ldx [%src + offset + 0x20], %t0; \
  562. - ldx [%src + offset + 0x28], %t1; \
  563. - ldx [%src + offset + 0x30], %t2; \
  564. - ldx [%src + offset + 0x38], %t3; \
  565. - stx %t0, [%dst + offset + 0x20]; \
  566. - stx %t1, [%dst + offset + 0x28]; \
  567. - stx %t2, [%dst + offset + 0x30]; \
  568. - stx %t3, [%dst + offset + 0x38];
  569. -
  570. -#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
  571. - ldx [%src - offset - 0x10], %t0; \
  572. - ldx [%src - offset - 0x08], %t1; \
  573. - stw %t0, [%dst - offset - 0x0c]; \
  574. - srlx %t0, 32, %t2; \
  575. - stw %t2, [%dst - offset - 0x10]; \
  576. - stw %t1, [%dst - offset - 0x04]; \
  577. - srlx %t1, 32, %t3; \
  578. - stw %t3, [%dst - offset - 0x08];
  579. -
  580. -#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
  581. - ldx [%src - offset - 0x10], %t0; \
  582. - ldx [%src - offset - 0x08], %t1; \
  583. - stx %t0, [%dst - offset - 0x10]; \
  584. - stx %t1, [%dst - offset - 0x08];
  585. -
  586. - /* Macros for non-VIS memmove code. */
  587. -#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
  588. - ldx [%src - offset - 0x20], %t0; \
  589. - ldx [%src - offset - 0x18], %t1; \
  590. - ldx [%src - offset - 0x10], %t2; \
  591. - ldx [%src - offset - 0x08], %t3; \
  592. - stw %t0, [%dst - offset - 0x1c]; \
  593. - srlx %t0, 32, %t0; \
  594. - stw %t0, [%dst - offset - 0x20]; \
  595. - stw %t1, [%dst - offset - 0x14]; \
  596. - srlx %t1, 32, %t1; \
  597. - stw %t1, [%dst - offset - 0x18]; \
  598. - stw %t2, [%dst - offset - 0x0c]; \
  599. - srlx %t2, 32, %t2; \
  600. - stw %t2, [%dst - offset - 0x10]; \
  601. - stw %t3, [%dst - offset - 0x04]; \
  602. - srlx %t3, 32, %t3; \
  603. - stw %t3, [%dst - offset - 0x08];
  604. -
  605. -#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
  606. - ldx [%src - offset - 0x20], %t0; \
  607. - ldx [%src - offset - 0x18], %t1; \
  608. - ldx [%src - offset - 0x10], %t2; \
  609. - ldx [%src - offset - 0x08], %t3; \
  610. - stx %t0, [%dst - offset - 0x20]; \
  611. - stx %t1, [%dst - offset - 0x18]; \
  612. - stx %t2, [%dst - offset - 0x10]; \
  613. - stx %t3, [%dst - offset - 0x08]; \
  614. - ldx [%src - offset - 0x40], %t0; \
  615. - ldx [%src - offset - 0x38], %t1; \
  616. - ldx [%src - offset - 0x30], %t2; \
  617. - ldx [%src - offset - 0x28], %t3; \
  618. - stx %t0, [%dst - offset - 0x40]; \
  619. - stx %t1, [%dst - offset - 0x38]; \
  620. - stx %t2, [%dst - offset - 0x30]; \
  621. - stx %t3, [%dst - offset - 0x28];
  622. -
  623. -#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
  624. - ldx [%src + offset + 0x00], %t0; \
  625. - ldx [%src + offset + 0x08], %t1; \
  626. - stw %t0, [%dst + offset + 0x04]; \
  627. - srlx %t0, 32, %t2; \
  628. - stw %t2, [%dst + offset + 0x00]; \
  629. - stw %t1, [%dst + offset + 0x0c]; \
  630. - srlx %t1, 32, %t3; \
  631. - stw %t3, [%dst + offset + 0x08];
  632. -
  633. -#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
  634. - ldx [%src + offset + 0x00], %t0; \
  635. - ldx [%src + offset + 0x08], %t1; \
  636. - stx %t0, [%dst + offset + 0x00]; \
  637. - stx %t1, [%dst + offset + 0x08];
  638. -
  639. - .text
  640. - .align 32
  641. -
  642. -#ifdef __UCLIBC_SUSV3_LEGACY__
  643. -ENTRY(bcopy)
  644. - sub %o1, %o0, %o4 /* IEU0 Group */
  645. - mov %o0, %g3 /* IEU1 */
  646. - cmp %o4, %o2 /* IEU1 Group */
  647. - mov %o1, %o0 /* IEU0 */
  648. - bgeu,pt %XCC, 210f /* CTI */
  649. - mov %g3, %o1 /* IEU0 Group */
  650. -#ifndef USE_BPR
  651. - srl %o2, 0, %o2 /* IEU1 */
  652. -#endif
  653. - brnz,pn %o2, 220f /* CTI Group */
  654. - add %o0, %o2, %o0 /* IEU0 */
  655. - retl
  656. - nop
  657. -END(bcopy)
  658. -#endif
  659. -
  660. - .align 32
  661. -200: be,pt %xcc, 201f /* CTI */
  662. - andcc %o0, 0x38, %g5 /* IEU1 Group */
  663. - mov 8, %g1 /* IEU0 */
  664. - sub %g1, %g2, %g2 /* IEU0 Group */
  665. - andcc %o0, 1, %g0 /* IEU1 */
  666. - be,pt %icc, 2f /* CTI */
  667. - sub %o2, %g2, %o2 /* IEU0 Group */
  668. -1: ldub [%o1], %o5 /* Load Group */
  669. - add %o1, 1, %o1 /* IEU0 */
  670. - add %o0, 1, %o0 /* IEU1 */
  671. - subcc %g2, 1, %g2 /* IEU1 Group */
  672. - be,pn %xcc, 3f /* CTI */
  673. - stb %o5, [%o0 - 1] /* Store */
  674. -2: ldub [%o1], %o5 /* Load Group */
  675. - add %o0, 2, %o0 /* IEU0 */
  676. - ldub [%o1 + 1], %g3 /* Load Group */
  677. - subcc %g2, 2, %g2 /* IEU1 Group */
  678. - stb %o5, [%o0 - 2] /* Store */
  679. - add %o1, 2, %o1 /* IEU0 */
  680. - bne,pt %xcc, 2b /* CTI Group */
  681. - stb %g3, [%o0 - 1] /* Store */
  682. -3: andcc %o0, 0x38, %g5 /* IEU1 Group */
  683. -201: be,pt %icc, 202f /* CTI */
  684. - mov 64, %g1 /* IEU0 */
  685. - fmovd %f0, %f2 /* FPU */
  686. - sub %g1, %g5, %g5 /* IEU0 Group */
  687. - alignaddr %o1, %g0, %g1 /* GRU Group */
  688. - ldd [%g1], %f4 /* Load Group */
  689. - sub %o2, %g5, %o2 /* IEU0 */
  690. -1: ldd [%g1 + 0x8], %f6 /* Load Group */
  691. - add %g1, 0x8, %g1 /* IEU0 Group */
  692. - subcc %g5, 8, %g5 /* IEU1 */
  693. - faligndata %f4, %f6, %f0 /* GRU Group */
  694. - std %f0, [%o0] /* Store */
  695. - add %o1, 8, %o1 /* IEU0 Group */
  696. - be,pn %xcc, 202f /* CTI */
  697. - add %o0, 8, %o0 /* IEU1 */
  698. - ldd [%g1 + 0x8], %f4 /* Load Group */
  699. - add %g1, 8, %g1 /* IEU0 */
  700. - subcc %g5, 8, %g5 /* IEU1 */
  701. - faligndata %f6, %f4, %f0 /* GRU Group */
  702. - std %f0, [%o0] /* Store */
  703. - add %o1, 8, %o1 /* IEU0 */
  704. - bne,pt %xcc, 1b /* CTI Group */
  705. - add %o0, 8, %o0 /* IEU0 */
  706. -202: membar #LoadStore | #StoreStore | #StoreLoad /* LSU Group */
  707. - wr %g0, ASI_BLK_P, %asi /* LSU Group */
  708. - subcc %o2, 0x40, %g6 /* IEU1 Group */
  709. - mov %o1, %g1 /* IEU0 */
  710. - andncc %g6, (0x40 - 1), %g6 /* IEU1 Group */
  711. - srl %g1, 3, %g2 /* IEU0 */
  712. - sub %o2, %g6, %g3 /* IEU0 Group */
  713. - andn %o1, (0x40 - 1), %o1 /* IEU1 */
  714. - and %g2, 7, %g2 /* IEU0 Group */
  715. - andncc %g3, 0x7, %g3 /* IEU1 */
  716. - fmovd %f0, %f2 /* FPU */
  717. - sub %g3, 0x10, %g3 /* IEU0 Group */
  718. - sub %o2, %g6, %o2 /* IEU1 */
  719. - alignaddr %g1, %g0, %g0 /* GRU Group */
  720. - add %g1, %g6, %g1 /* IEU0 Group */
  721. - subcc %o2, %g3, %o2 /* IEU1 */
  722. - ldda [%o1 + 0x00] %asi, %f0 /* LSU Group */
  723. - add %g1, %g3, %g1 /* IEU0 */
  724. - ldda [%o1 + 0x40] %asi, %f16 /* LSU Group */
  725. - sub %g6, 0x80, %g6 /* IEU0 */
  726. - ldda [%o1 + 0x80] %asi, %f32 /* LSU Group */
  727. - /* Clk1 Group 8-( */
  728. - /* Clk2 Group 8-( */
  729. - /* Clk3 Group 8-( */
  730. - /* Clk4 Group 8-( */
  731. -203: rd %pc, %g5 /* PDU Group 8-( */
  732. - addcc %g5, %lo(300f - 203b), %g5 /* IEU1 Group */
  733. - sll %g2, 9, %g2 /* IEU0 */
  734. - jmpl %g5 + %g2, %g0 /* CTI Group brk forced*/
  735. - addcc %o1, 0xc0, %o1 /* IEU1 Group */
  736. -
  737. - .align 512 /* OK, here comes the fun part... */
  738. -300: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) LOOP_CHUNK1(o1, o0, g6, 301f)
  739. - FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) LOOP_CHUNK2(o1, o0, g6, 302f)
  740. - FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) LOOP_CHUNK3(o1, o0, g6, 303f)
  741. - b,pt %xcc, 300b+4; faligndata %f0, %f2, %f48
  742. -301: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_SYNC(o0, f48) membar #Sync
  743. - FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_JUMP(o0, f48, 400f) membar #Sync
  744. -302: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_SYNC(o0, f48) membar #Sync
  745. - FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_JUMP(o0, f48, 416f) membar #Sync
  746. -303: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_SYNC(o0, f48) membar #Sync
  747. - FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_JUMP(o0, f48, 432f) membar #Sync
  748. - VISLOOP_PAD
  749. -310: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) LOOP_CHUNK1(o1, o0, g6, 311f)
  750. - FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) LOOP_CHUNK2(o1, o0, g6, 312f)
  751. - FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) LOOP_CHUNK3(o1, o0, g6, 313f)
  752. - b,pt %xcc, 310b+4; faligndata %f2, %f4, %f48
  753. -311: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_SYNC(o0, f48) membar #Sync
  754. - FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_JUMP(o0, f48, 402f) membar #Sync
  755. -312: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_SYNC(o0, f48) membar #Sync
  756. - FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_JUMP(o0, f48, 418f) membar #Sync
  757. -313: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_SYNC(o0, f48) membar #Sync
  758. - FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_JUMP(o0, f48, 434f) membar #Sync
  759. - VISLOOP_PAD
  760. -320: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) LOOP_CHUNK1(o1, o0, g6, 321f)
  761. - FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) LOOP_CHUNK2(o1, o0, g6, 322f)
  762. - FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) LOOP_CHUNK3(o1, o0, g6, 323f)
  763. - b,pt %xcc, 320b+4; faligndata %f4, %f6, %f48
  764. -321: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_SYNC(o0, f48) membar #Sync
  765. - FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_JUMP(o0, f48, 404f) membar #Sync
  766. -322: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_SYNC(o0, f48) membar #Sync
  767. - FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_JUMP(o0, f48, 420f) membar #Sync
  768. -323: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_SYNC(o0, f48) membar #Sync
  769. - FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_JUMP(o0, f48, 436f) membar #Sync
  770. - VISLOOP_PAD
  771. -330: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) LOOP_CHUNK1(o1, o0, g6, 331f)
  772. - FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) LOOP_CHUNK2(o1, o0, g6, 332f)
  773. - FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) LOOP_CHUNK3(o1, o0, g6, 333f)
  774. - b,pt %xcc, 330b+4; faligndata %f6, %f8, %f48
  775. -331: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_SYNC(o0, f48) membar #Sync
  776. - FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_JUMP(o0, f48, 406f) membar #Sync
  777. -332: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_SYNC(o0, f48) membar #Sync
  778. - FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_JUMP(o0, f48, 422f) membar #Sync
  779. -333: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_SYNC(o0, f48) membar #Sync
  780. - FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_JUMP(o0, f48, 438f) membar #Sync
  781. - VISLOOP_PAD
  782. -340: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) LOOP_CHUNK1(o1, o0, g6, 341f)
  783. - FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) LOOP_CHUNK2(o1, o0, g6, 342f)
  784. - FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) LOOP_CHUNK3(o1, o0, g6, 343f)
  785. - b,pt %xcc, 340b+4; faligndata %f8, %f10, %f48
  786. -341: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_SYNC(o0, f48) membar #Sync
  787. - FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_JUMP(o0, f48, 408f) membar #Sync
  788. -342: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_SYNC(o0, f48) membar #Sync
  789. - FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_JUMP(o0, f48, 424f) membar #Sync
  790. -343: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_SYNC(o0, f48) membar #Sync
  791. - FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_JUMP(o0, f48, 440f) membar #Sync
  792. - VISLOOP_PAD
  793. -350: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) LOOP_CHUNK1(o1, o0, g6, 351f)
  794. - FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) LOOP_CHUNK2(o1, o0, g6, 352f)
  795. - FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) LOOP_CHUNK3(o1, o0, g6, 353f)
  796. - b,pt %xcc, 350b+4; faligndata %f10, %f12, %f48
  797. -351: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_SYNC(o0, f48) membar #Sync
  798. - FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_JUMP(o0, f48, 410f) membar #Sync
  799. -352: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_SYNC(o0, f48) membar #Sync
  800. - FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_JUMP(o0, f48, 426f) membar #Sync
  801. -353: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_SYNC(o0, f48) membar #Sync
  802. - FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_JUMP(o0, f48, 442f) membar #Sync
  803. - VISLOOP_PAD
  804. -360: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) LOOP_CHUNK1(o1, o0, g6, 361f)
  805. - FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) LOOP_CHUNK2(o1, o0, g6, 362f)
  806. - FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) LOOP_CHUNK3(o1, o0, g6, 363f)
  807. - b,pt %xcc, 360b+4; faligndata %f12, %f14, %f48
  808. -361: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_SYNC(o0, f48) membar #Sync
  809. - FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_JUMP(o0, f48, 412f) membar #Sync
  810. -362: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_SYNC(o0, f48) membar #Sync
  811. - FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_JUMP(o0, f48, 428f) membar #Sync
  812. -363: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_SYNC(o0, f48) membar #Sync
  813. - FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_JUMP(o0, f48, 444f) membar #Sync
  814. - VISLOOP_PAD
  815. -370: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) LOOP_CHUNK1(o1, o0, g6, 371f)
  816. - FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) LOOP_CHUNK2(o1, o0, g6, 372f)
  817. - FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) LOOP_CHUNK3(o1, o0, g6, 373f)
  818. - b,pt %xcc, 370b+4; faligndata %f14, %f16, %f48
  819. -371: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_SYNC(o0, f48) membar #Sync
  820. - FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_JUMP(o0, f48, 414f) membar #Sync
  821. -372: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_SYNC(o0, f48) membar #Sync
  822. - FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_JUMP(o0, f48, 430f) membar #Sync
  823. -373: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_SYNC(o0, f48) membar #Sync
  824. - FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_JUMP(o0, f48, 446f) membar #Sync
  825. - VISLOOP_PAD
  826. -400: FINISH_VISCHUNK(o0, f0, f2, g3)
  827. -402: FINISH_VISCHUNK(o0, f2, f4, g3)
  828. -404: FINISH_VISCHUNK(o0, f4, f6, g3)
  829. -406: FINISH_VISCHUNK(o0, f6, f8, g3)
  830. -408: FINISH_VISCHUNK(o0, f8, f10, g3)
  831. -410: FINISH_VISCHUNK(o0, f10, f12, g3)
  832. -412: FINISH_VISCHUNK(o0, f12, f14, g3)
  833. -414: UNEVEN_VISCHUNK(o0, f14, f0, g3)
  834. -416: FINISH_VISCHUNK(o0, f16, f18, g3)
  835. -418: FINISH_VISCHUNK(o0, f18, f20, g3)
  836. -420: FINISH_VISCHUNK(o0, f20, f22, g3)
  837. -422: FINISH_VISCHUNK(o0, f22, f24, g3)
  838. -424: FINISH_VISCHUNK(o0, f24, f26, g3)
  839. -426: FINISH_VISCHUNK(o0, f26, f28, g3)
  840. -428: FINISH_VISCHUNK(o0, f28, f30, g3)
  841. -430: UNEVEN_VISCHUNK(o0, f30, f0, g3)
  842. -432: FINISH_VISCHUNK(o0, f32, f34, g3)
  843. -434: FINISH_VISCHUNK(o0, f34, f36, g3)
  844. -436: FINISH_VISCHUNK(o0, f36, f38, g3)
  845. -438: FINISH_VISCHUNK(o0, f38, f40, g3)
  846. -440: FINISH_VISCHUNK(o0, f40, f42, g3)
  847. -442: FINISH_VISCHUNK(o0, f42, f44, g3)
  848. -444: FINISH_VISCHUNK(o0, f44, f46, g3)
  849. -446: UNEVEN_VISCHUNK(o0, f46, f0, g3)
  850. -204: ldd [%o1], %f2 /* Load Group */
  851. - add %o1, 8, %o1 /* IEU0 */
  852. - subcc %g3, 8, %g3 /* IEU1 */
  853. - faligndata %f0, %f2, %f8 /* GRU Group */
  854. - std %f8, [%o0] /* Store */
  855. - bl,pn %xcc, 205f /* CTI */
  856. - add %o0, 8, %o0 /* IEU0 Group */
  857. - ldd [%o1], %f0 /* Load Group */
  858. - add %o1, 8, %o1 /* IEU0 */
  859. - subcc %g3, 8, %g3 /* IEU1 */
  860. - faligndata %f2, %f0, %f8 /* GRU Group */
  861. - std %f8, [%o0] /* Store */
  862. - bge,pt %xcc, 204b /* CTI */
  863. - add %o0, 8, %o0 /* IEU0 Group */
  864. -205: brz,pt %o2, 207f /* CTI Group */
  865. - mov %g1, %o1 /* IEU0 */
  866. -206: ldub [%o1], %g5 /* LOAD */
  867. - add %o1, 1, %o1 /* IEU0 */
  868. - add %o0, 1, %o0 /* IEU1 */
  869. - subcc %o2, 1, %o2 /* IEU1 */
  870. - bne,pt %xcc, 206b /* CTI */
  871. - stb %g5, [%o0 - 1] /* Store Group */
  872. -207: membar #StoreLoad | #StoreStore /* LSU Group */
  873. - wr %g0, FPRS_FEF, %fprs
  874. - retl
  875. - mov %g4, %o0
  876. -
  877. -208: andcc %o2, 1, %g0 /* IEU1 Group */
  878. - be,pt %icc, 2f+4 /* CTI */
  879. -1: ldub [%o1], %g5 /* LOAD Group */
  880. - add %o1, 1, %o1 /* IEU0 */
  881. - add %o0, 1, %o0 /* IEU1 */
  882. - subcc %o2, 1, %o2 /* IEU1 Group */
  883. - be,pn %xcc, 209f /* CTI */
  884. - stb %g5, [%o0 - 1] /* Store */
  885. -2: ldub [%o1], %g5 /* LOAD Group */
  886. - add %o0, 2, %o0 /* IEU0 */
  887. - ldub [%o1 + 1], %o5 /* LOAD Group */
  888. - add %o1, 2, %o1 /* IEU0 */
  889. - subcc %o2, 2, %o2 /* IEU1 Group */
  890. - stb %g5, [%o0 - 2] /* Store */
  891. - bne,pt %xcc, 2b /* CTI */
  892. - stb %o5, [%o0 - 1] /* Store */
  893. -209: retl
  894. - mov %g4, %o0
  895. -
  896. -#ifdef USE_BPR
  897. -
  898. - /* void *__align_cpy_4(void *dest, void *src, size_t n)
  899. - * SPARC v9 SYSV ABI
  900. - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 3))
  901. - */
  902. -
  903. - .align 32
  904. -ENTRY(__align_cpy_4)
  905. - mov %o0, %g4 /* IEU0 Group */
  906. - cmp %o2, 15 /* IEU1 */
  907. - bleu,pn %xcc, 208b /* CTI */
  908. - cmp %o2, (64 * 6) /* IEU1 Group */
  909. - bgeu,pn %xcc, 200b /* CTI */
  910. - andcc %o0, 7, %g2 /* IEU1 Group */
  911. - ba,pt %xcc, 216f /* CTI */
  912. - andcc %o1, 4, %g0 /* IEU1 Group */
  913. -END(__align_cpy_4)
  914. -
  915. - /* void *__align_cpy_8(void *dest, void *src, size_t n)
  916. - * SPARC v9 SYSV ABI
  917. - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 7))
  918. - */
  919. -
  920. - .align 32
  921. -ENTRY(__align_cpy_8)
  922. - mov %o0, %g4 /* IEU0 Group */
  923. - cmp %o2, 15 /* IEU1 */
  924. - bleu,pn %xcc, 208b /* CTI */
  925. - cmp %o2, (64 * 6) /* IEU1 Group */
  926. - bgeu,pn %xcc, 201b /* CTI */
  927. - andcc %o0, 0x38, %g5 /* IEU1 Group */
  928. - andcc %o2, -128, %g6 /* IEU1 Group */
  929. - bne,a,pt %xcc, 82f + 4 /* CTI */
  930. - ldx [%o1], %g1 /* Load */
  931. - ba,pt %xcc, 41f /* CTI Group */
  932. - andcc %o2, 0x70, %g6 /* IEU1 */
  933. -END(__align_cpy_8)
  934. -
  935. - /* void *__align_cpy_16(void *dest, void *src, size_t n)
  936. - * SPARC v9 SYSV ABI
  937. - * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 15))
  938. - */
  939. -
  940. - .align 32
  941. -ENTRY(__align_cpy_16)
  942. - mov %o0, %g4 /* IEU0 Group */
  943. - cmp %o2, (64 * 6) /* IEU1 */
  944. - bgeu,pn %xcc, 201b /* CTI */
  945. - andcc %o0, 0x38, %g5 /* IEU1 Group */
  946. - andcc %o2, -128, %g6 /* IEU1 Group */
  947. - bne,a,pt %xcc, 82f + 4 /* CTI */
  948. - ldx [%o1], %g1 /* Load */
  949. - ba,pt %xcc, 41f /* CTI Group */
  950. - andcc %o2, 0x70, %g6 /* IEU1 */
  951. -END(__align_cpy_16)
  952. -
  953. -#endif
  954. -
  955. - .align 32
  956. -ENTRY(memcpy)
  957. -210:
  958. -#ifndef USE_BPR
  959. - srl %o2, 0, %o2 /* IEU1 Group */
  960. -#endif
  961. - brz,pn %o2, 209b /* CTI Group */
  962. - mov %o0, %g4 /* IEU0 */
  963. -218: cmp %o2, 15 /* IEU1 Group */
  964. - bleu,pn %xcc, 208b /* CTI */
  965. - cmp %o2, (64 * 6) /* IEU1 Group */
  966. - bgeu,pn %xcc, 200b /* CTI */
  967. - andcc %o0, 7, %g2 /* IEU1 Group */
  968. - sub %o0, %o1, %g5 /* IEU0 */
  969. - andcc %g5, 3, %o5 /* IEU1 Group */
  970. - bne,pn %xcc, 212f /* CTI */
  971. - andcc %o1, 3, %g0 /* IEU1 Group */
  972. - be,a,pt %xcc, 216f /* CTI */
  973. - andcc %o1, 4, %g0 /* IEU1 Group */
  974. - andcc %o1, 1, %g0 /* IEU1 Group */
  975. - be,pn %xcc, 4f /* CTI */
  976. - andcc %o1, 2, %g0 /* IEU1 Group */
  977. - ldub [%o1], %g2 /* Load Group */
  978. - add %o1, 1, %o1 /* IEU0 */
  979. - add %o0, 1, %o0 /* IEU1 */
  980. - sub %o2, 1, %o2 /* IEU0 Group */
  981. - bne,pn %xcc, 5f /* CTI Group */
  982. - stb %g2, [%o0 - 1] /* Store */
  983. -4: lduh [%o1], %g2 /* Load Group */
  984. - add %o1, 2, %o1 /* IEU0 */
  985. - add %o0, 2, %o0 /* IEU1 */
  986. - sub %o2, 2, %o2 /* IEU0 */
  987. - sth %g2, [%o0 - 2] /* Store Group + bubble */
  988. -5: andcc %o1, 4, %g0 /* IEU1 */
  989. -216: be,a,pn %xcc, 2f /* CTI */
  990. - andcc %o2, -128, %g6 /* IEU1 Group */
  991. - lduw [%o1], %g5 /* Load Group */
  992. - add %o1, 4, %o1 /* IEU0 */
  993. - add %o0, 4, %o0 /* IEU1 */
  994. - sub %o2, 4, %o2 /* IEU0 Group */
  995. - stw %g5, [%o0 - 4] /* Store */
  996. - andcc %o2, -128, %g6 /* IEU1 Group */
  997. -2: be,pn %xcc, 215f /* CTI */
  998. - andcc %o0, 4, %g0 /* IEU1 Group */
  999. - be,pn %xcc, 82f + 4 /* CTI Group */
  1000. -5: MOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  1001. - MOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
  1002. - MOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  1003. - MOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
  1004. -35: subcc %g6, 128, %g6 /* IEU1 Group */
  1005. - add %o1, 128, %o1 /* IEU0 */
  1006. - bne,pt %xcc, 5b /* CTI */
  1007. - add %o0, 128, %o0 /* IEU0 Group */
  1008. -215: andcc %o2, 0x70, %g6 /* IEU1 Group */
  1009. -41: be,pn %xcc, 80f /* CTI */
  1010. - andcc %o2, 8, %g0 /* IEU1 Group */
  1011. - /* Clk1 8-( */
  1012. - /* Clk2 8-( */
  1013. - /* Clk3 8-( */
  1014. - /* Clk4 8-( */
  1015. -79: rd %pc, %o5 /* PDU Group */
  1016. - sll %g6, 1, %g5 /* IEU0 Group */
  1017. - add %o1, %g6, %o1 /* IEU1 */
  1018. - sub %o5, %g5, %o5 /* IEU0 Group */
  1019. - jmpl %o5 + %lo(80f - 79b), %g0 /* CTI Group brk forced*/
  1020. - add %o0, %g6, %o0 /* IEU0 Group */
  1021. -36: MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
  1022. - MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
  1023. - MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
  1024. - MOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
  1025. - MOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
  1026. - MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
  1027. - MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
  1028. -80: be,pt %xcc, 81f /* CTI */
  1029. - andcc %o2, 4, %g0 /* IEU1 */
  1030. - ldx [%o1], %g2 /* Load Group */
  1031. - add %o0, 8, %o0 /* IEU0 */
  1032. - stw %g2, [%o0 - 0x4] /* Store Group */
  1033. - add %o1, 8, %o1 /* IEU1 */
  1034. - srlx %g2, 32, %g2 /* IEU0 Group */
  1035. - stw %g2, [%o0 - 0x8] /* Store */
  1036. -81: be,pt %xcc, 1f /* CTI */
  1037. - andcc %o2, 2, %g0 /* IEU1 Group */
  1038. - lduw [%o1], %g2 /* Load Group */
  1039. - add %o1, 4, %o1 /* IEU0 */
  1040. - stw %g2, [%o0] /* Store Group */
  1041. - add %o0, 4, %o0 /* IEU0 */
  1042. -1: be,pt %xcc, 1f /* CTI */
  1043. - andcc %o2, 1, %g0 /* IEU1 Group */
  1044. - lduh [%o1], %g2 /* Load Group */
  1045. - add %o1, 2, %o1 /* IEU0 */
  1046. - sth %g2, [%o0] /* Store Group */
  1047. - add %o0, 2, %o0 /* IEU0 */
  1048. -1: be,pt %xcc, 211f /* CTI */
  1049. - nop /* IEU1 */
  1050. - ldub [%o1], %g2 /* Load Group */
  1051. - stb %g2, [%o0] /* Store Group + bubble */
  1052. -211: retl
  1053. - mov %g4, %o0
  1054. -
  1055. -82: MOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  1056. - MOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  1057. -37: subcc %g6, 128, %g6 /* IEU1 Group */
  1058. - add %o1, 128, %o1 /* IEU0 */
  1059. - bne,pt %xcc, 82b /* CTI */
  1060. - add %o0, 128, %o0 /* IEU0 Group */
  1061. - andcc %o2, 0x70, %g6 /* IEU1 */
  1062. - be,pn %xcc, 84f /* CTI */
  1063. - andcc %o2, 8, %g0 /* IEU1 Group */
  1064. - /* Clk1 8-( */
  1065. - /* Clk2 8-( */
  1066. - /* Clk3 8-( */
  1067. - /* Clk4 8-( */
  1068. -83: rd %pc, %o5 /* PDU Group */
  1069. - add %o1, %g6, %o1 /* IEU0 Group */
  1070. - sub %o5, %g6, %o5 /* IEU1 */
  1071. - jmpl %o5 + %lo(84f - 83b), %g0 /* CTI Group brk forced*/
  1072. - add %o0, %g6, %o0 /* IEU0 Group */
  1073. -38: MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
  1074. - MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
  1075. - MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
  1076. - MOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
  1077. - MOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
  1078. - MOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
  1079. - MOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
  1080. -84: be,pt %xcc, 85f /* CTI Group */
  1081. - andcc %o2, 4, %g0 /* IEU1 */
  1082. - ldx [%o1], %g2 /* Load Group */
  1083. - add %o0, 8, %o0 /* IEU0 */
  1084. - add %o1, 8, %o1 /* IEU0 Group */
  1085. - stx %g2, [%o0 - 0x8] /* Store */
  1086. -85: be,pt %xcc, 1f /* CTI */
  1087. - andcc %o2, 2, %g0 /* IEU1 Group */
  1088. - lduw [%o1], %g2 /* Load Group */
  1089. - add %o0, 4, %o0 /* IEU0 */
  1090. - add %o1, 4, %o1 /* IEU0 Group */
  1091. - stw %g2, [%o0 - 0x4] /* Store */
  1092. -1: be,pt %xcc, 1f /* CTI */
  1093. - andcc %o2, 1, %g0 /* IEU1 Group */
  1094. - lduh [%o1], %g2 /* Load Group */
  1095. - add %o0, 2, %o0 /* IEU0 */
  1096. - add %o1, 2, %o1 /* IEU0 Group */
  1097. - sth %g2, [%o0 - 0x2] /* Store */
  1098. -1: be,pt %xcc, 1f /* CTI */
  1099. - nop /* IEU0 Group */
  1100. - ldub [%o1], %g2 /* Load Group */
  1101. - stb %g2, [%o0] /* Store Group + bubble */
  1102. -1: retl
  1103. - mov %g4, %o0
  1104. -
  1105. -212: brz,pt %g2, 2f /* CTI Group */
  1106. - mov 8, %g1 /* IEU0 */
  1107. - sub %g1, %g2, %g2 /* IEU0 Group */
  1108. - sub %o2, %g2, %o2 /* IEU0 Group */
  1109. -1: ldub [%o1], %g5 /* Load Group */
  1110. - add %o1, 1, %o1 /* IEU0 */
  1111. - add %o0, 1, %o0 /* IEU1 */
  1112. - subcc %g2, 1, %g2 /* IEU1 Group */
  1113. - bne,pt %xcc, 1b /* CTI */
  1114. - stb %g5, [%o0 - 1] /* Store */
  1115. -2: andn %o2, 7, %g5 /* IEU0 Group */
  1116. - and %o2, 7, %o2 /* IEU1 */
  1117. - fmovd %f0, %f2 /* FPU */
  1118. - alignaddr %o1, %g0, %g1 /* GRU Group */
  1119. - ldd [%g1], %f4 /* Load Group */
  1120. -1: ldd [%g1 + 0x8], %f6 /* Load Group */
  1121. - add %g1, 0x8, %g1 /* IEU0 Group */
  1122. - subcc %g5, 8, %g5 /* IEU1 */
  1123. - faligndata %f4, %f6, %f0 /* GRU Group */
  1124. - std %f0, [%o0] /* Store */
  1125. - add %o1, 8, %o1 /* IEU0 Group */
  1126. - be,pn %xcc, 213f /* CTI */
  1127. - add %o0, 8, %o0 /* IEU1 */
  1128. - ldd [%g1 + 0x8], %f4 /* Load Group */
  1129. - add %g1, 8, %g1 /* IEU0 */
  1130. - subcc %g5, 8, %g5 /* IEU1 */
  1131. - faligndata %f6, %f4, %f0 /* GRU Group */
  1132. - std %f0, [%o0] /* Store */
  1133. - add %o1, 8, %o1 /* IEU0 */
  1134. - bne,pn %xcc, 1b /* CTI Group */
  1135. - add %o0, 8, %o0 /* IEU0 */
  1136. -213: brz,pn %o2, 214f /* CTI Group */
  1137. - nop /* IEU0 */
  1138. - ldub [%o1], %g5 /* LOAD */
  1139. - add %o1, 1, %o1 /* IEU0 */
  1140. - add %o0, 1, %o0 /* IEU1 */
  1141. - subcc %o2, 1, %o2 /* IEU1 */
  1142. - bne,pt %xcc, 206b /* CTI */
  1143. - stb %g5, [%o0 - 1] /* Store Group */
  1144. -214: wr %g0, FPRS_FEF, %fprs
  1145. - retl
  1146. - mov %g4, %o0
  1147. -END(memcpy)
  1148. -libc_hidden_def(memcpy)
  1149. -
  1150. - .align 32
  1151. -228: andcc %o2, 1, %g0 /* IEU1 Group */
  1152. - be,pt %icc, 2f+4 /* CTI */
  1153. -1: ldub [%o1 - 1], %o5 /* LOAD Group */
  1154. - sub %o1, 1, %o1 /* IEU0 */
  1155. - sub %o0, 1, %o0 /* IEU1 */
  1156. - subcc %o2, 1, %o2 /* IEU1 Group */
  1157. - be,pn %xcc, 229f /* CTI */
  1158. - stb %o5, [%o0] /* Store */
  1159. -2: ldub [%o1 - 1], %o5 /* LOAD Group */
  1160. - sub %o0, 2, %o0 /* IEU0 */
  1161. - ldub [%o1 - 2], %g5 /* LOAD Group */
  1162. - sub %o1, 2, %o1 /* IEU0 */
  1163. - subcc %o2, 2, %o2 /* IEU1 Group */
  1164. - stb %o5, [%o0 + 1] /* Store */
  1165. - bne,pt %xcc, 2b /* CTI */
  1166. - stb %g5, [%o0] /* Store */
  1167. -229: retl
  1168. - mov %g4, %o0
  1169. -219: retl
  1170. - nop
  1171. -
  1172. - .align 32
  1173. -ENTRY(memmove)
  1174. -#ifndef USE_BPR
  1175. - srl %o2, 0, %o2 /* IEU1 Group */
  1176. -#endif
  1177. - brz,pn %o2, 219b /* CTI Group */
  1178. - sub %o0, %o1, %o4 /* IEU0 */
  1179. - cmp %o4, %o2 /* IEU1 Group */
  1180. - bgeu,pt %XCC, 218b /* CTI */
  1181. - mov %o0, %g4 /* IEU0 */
  1182. - add %o0, %o2, %o0 /* IEU0 Group */
  1183. -220: add %o1, %o2, %o1 /* IEU1 */
  1184. - cmp %o2, 15 /* IEU1 Group */
  1185. - bleu,pn %xcc, 228b /* CTI */
  1186. - andcc %o0, 7, %g2 /* IEU1 Group */
  1187. - sub %o0, %o1, %g5 /* IEU0 */
  1188. - andcc %g5, 3, %o5 /* IEU1 Group */
  1189. - bne,pn %xcc, 232f /* CTI */
  1190. - andcc %o1, 3, %g0 /* IEU1 Group */
  1191. - be,a,pt %xcc, 236f /* CTI */
  1192. - andcc %o1, 4, %g0 /* IEU1 Group */
  1193. - andcc %o1, 1, %g0 /* IEU1 Group */
  1194. - be,pn %xcc, 4f /* CTI */
  1195. - andcc %o1, 2, %g0 /* IEU1 Group */
  1196. - ldub [%o1 - 1], %g2 /* Load Group */
  1197. - sub %o1, 1, %o1 /* IEU0 */
  1198. - sub %o0, 1, %o0 /* IEU1 */
  1199. - sub %o2, 1, %o2 /* IEU0 Group */
  1200. - be,pn %xcc, 5f /* CTI Group */
  1201. - stb %g2, [%o0] /* Store */
  1202. -4: lduh [%o1 - 2], %g2 /* Load Group */
  1203. - sub %o1, 2, %o1 /* IEU0 */
  1204. - sub %o0, 2, %o0 /* IEU1 */
  1205. - sub %o2, 2, %o2 /* IEU0 */
  1206. - sth %g2, [%o0] /* Store Group + bubble */
  1207. -5: andcc %o1, 4, %g0 /* IEU1 */
  1208. -236: be,a,pn %xcc, 2f /* CTI */
  1209. - andcc %o2, -128, %g6 /* IEU1 Group */
  1210. - lduw [%o1 - 4], %g5 /* Load Group */
  1211. - sub %o1, 4, %o1 /* IEU0 */
  1212. - sub %o0, 4, %o0 /* IEU1 */
  1213. - sub %o2, 4, %o2 /* IEU0 Group */
  1214. - stw %g5, [%o0] /* Store */
  1215. - andcc %o2, -128, %g6 /* IEU1 Group */
  1216. -2: be,pn %xcc, 235f /* CTI */
  1217. - andcc %o0, 4, %g0 /* IEU1 Group */
  1218. - be,pn %xcc, 282f + 4 /* CTI Group */
  1219. -5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  1220. - RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
  1221. - RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  1222. - RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
  1223. - subcc %g6, 128, %g6 /* IEU1 Group */
  1224. - sub %o1, 128, %o1 /* IEU0 */
  1225. - bne,pt %xcc, 5b /* CTI */
  1226. - sub %o0, 128, %o0 /* IEU0 Group */
  1227. -235: andcc %o2, 0x70, %g6 /* IEU1 Group */
  1228. -41: be,pn %xcc, 280f /* CTI */
  1229. - andcc %o2, 8, %g0 /* IEU1 Group */
  1230. - /* Clk1 8-( */
  1231. - /* Clk2 8-( */
  1232. - /* Clk3 8-( */
  1233. - /* Clk4 8-( */
  1234. -279: rd %pc, %o5 /* PDU Group */
  1235. - sll %g6, 1, %g5 /* IEU0 Group */
  1236. - sub %o1, %g6, %o1 /* IEU1 */
  1237. - sub %o5, %g5, %o5 /* IEU0 Group */
  1238. - jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
  1239. - sub %o0, %g6, %o0 /* IEU0 Group */
  1240. - RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
  1241. - RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
  1242. - RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
  1243. - RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
  1244. - RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
  1245. - RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
  1246. - RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
  1247. -280: be,pt %xcc, 281f /* CTI */
  1248. - andcc %o2, 4, %g0 /* IEU1 */
  1249. - ldx [%o1 - 8], %g2 /* Load Group */
  1250. - sub %o0, 8, %o0 /* IEU0 */
  1251. - stw %g2, [%o0 + 4] /* Store Group */
  1252. - sub %o1, 8, %o1 /* IEU1 */
  1253. - srlx %g2, 32, %g2 /* IEU0 Group */
  1254. - stw %g2, [%o0] /* Store */
  1255. -281: be,pt %xcc, 1f /* CTI */
  1256. - andcc %o2, 2, %g0 /* IEU1 Group */
  1257. - lduw [%o1 - 4], %g2 /* Load Group */
  1258. - sub %o1, 4, %o1 /* IEU0 */
  1259. - stw %g2, [%o0 - 4] /* Store Group */
  1260. - sub %o0, 4, %o0 /* IEU0 */
  1261. -1: be,pt %xcc, 1f /* CTI */
  1262. - andcc %o2, 1, %g0 /* IEU1 Group */
  1263. - lduh [%o1 - 2], %g2 /* Load Group */
  1264. - sub %o1, 2, %o1 /* IEU0 */
  1265. - sth %g2, [%o0 - 2] /* Store Group */
  1266. - sub %o0, 2, %o0 /* IEU0 */
  1267. -1: be,pt %xcc, 211f /* CTI */
  1268. - nop /* IEU1 */
  1269. - ldub [%o1 - 1], %g2 /* Load Group */
  1270. - stb %g2, [%o0 - 1] /* Store Group + bubble */
  1271. -211: retl
  1272. - mov %g4, %o0
  1273. -
  1274. -282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  1275. - RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  1276. - subcc %g6, 128, %g6 /* IEU1 Group */
  1277. - sub %o1, 128, %o1 /* IEU0 */
  1278. - bne,pt %xcc, 282b /* CTI */
  1279. - sub %o0, 128, %o0 /* IEU0 Group */
  1280. - andcc %o2, 0x70, %g6 /* IEU1 */
  1281. - be,pn %xcc, 284f /* CTI */
  1282. - andcc %o2, 8, %g0 /* IEU1 Group */
  1283. - /* Clk1 8-( */
  1284. - /* Clk2 8-( */
  1285. - /* Clk3 8-( */
  1286. - /* Clk4 8-( */
  1287. -283: rd %pc, %o5 /* PDU Group */
  1288. - sub %o1, %g6, %o1 /* IEU0 Group */
  1289. - sub %o5, %g6, %o5 /* IEU1 */
  1290. - jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
  1291. - sub %o0, %g6, %o0 /* IEU0 Group */
  1292. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
  1293. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
  1294. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
  1295. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
  1296. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
  1297. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
  1298. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
  1299. -284: be,pt %xcc, 285f /* CTI Group */
  1300. - andcc %o2, 4, %g0 /* IEU1 */
  1301. - ldx [%o1 - 8], %g2 /* Load Group */
  1302. - sub %o0, 8, %o0 /* IEU0 */
  1303. - sub %o1, 8, %o1 /* IEU0 Group */
  1304. - stx %g2, [%o0] /* Store */
  1305. -285: be,pt %xcc, 1f /* CTI */
  1306. - andcc %o2, 2, %g0 /* IEU1 Group */
  1307. - lduw [%o1 - 4], %g2 /* Load Group */
  1308. - sub %o0, 4, %o0 /* IEU0 */
  1309. - sub %o1, 4, %o1 /* IEU0 Group */
  1310. - stw %g2, [%o0] /* Store */
  1311. -1: be,pt %xcc, 1f /* CTI */
  1312. - andcc %o2, 1, %g0 /* IEU1 Group */
  1313. - lduh [%o1 - 2], %g2 /* Load Group */
  1314. - sub %o0, 2, %o0 /* IEU0 */
  1315. - sub %o1, 2, %o1 /* IEU0 Group */
  1316. - sth %g2, [%o0] /* Store */
  1317. -1: be,pt %xcc, 1f /* CTI */
  1318. - nop /* IEU0 Group */
  1319. - ldub [%o1 - 1], %g2 /* Load Group */
  1320. - stb %g2, [%o0 - 1] /* Store Group + bubble */
  1321. -1: retl
  1322. - mov %g4, %o0
  1323. -
  1324. -232: brz,pt %g2, 2f /* CTI Group */
  1325. - sub %o2, %g2, %o2 /* IEU0 Group */
  1326. -1: ldub [%o1 - 1], %g5 /* Load Group */
  1327. - sub %o1, 1, %o1 /* IEU0 */
  1328. - sub %o0, 1, %o0 /* IEU1 */
  1329. - subcc %g2, 1, %g2 /* IEU1 Group */
  1330. - bne,pt %xcc, 1b /* CTI */
  1331. - stb %g5, [%o0] /* Store */
  1332. -2: andn %o2, 7, %g5 /* IEU0 Group */
  1333. - and %o2, 7, %o2 /* IEU1 */
  1334. - fmovd %f0, %f2 /* FPU */
  1335. - alignaddr %o1, %g0, %g1 /* GRU Group */
  1336. - ldd [%g1], %f4 /* Load Group */
  1337. -1: ldd [%g1 - 8], %f6 /* Load Group */
  1338. - sub %g1, 8, %g1 /* IEU0 Group */
  1339. - subcc %g5, 8, %g5 /* IEU1 */
  1340. - faligndata %f6, %f4, %f0 /* GRU Group */
  1341. - std %f0, [%o0 - 8] /* Store */
  1342. - sub %o1, 8, %o1 /* IEU0 Group */
  1343. - be,pn %xcc, 233f /* CTI */
  1344. - sub %o0, 8, %o0 /* IEU1 */
  1345. - ldd [%g1 - 8], %f4 /* Load Group */
  1346. - sub %g1, 8, %g1 /* IEU0 */
  1347. - subcc %g5, 8, %g5 /* IEU1 */
  1348. - faligndata %f4, %f6, %f0 /* GRU Group */
  1349. - std %f0, [%o0 - 8] /* Store */
  1350. - sub %o1, 8, %o1 /* IEU0 */
  1351. - bne,pn %xcc, 1b /* CTI Group */
  1352. - sub %o0, 8, %o0 /* IEU0 */
  1353. -233: brz,pn %o2, 234f /* CTI Group */
  1354. - nop /* IEU0 */
  1355. -237: ldub [%o1 - 1], %g5 /* LOAD */
  1356. - sub %o1, 1, %o1 /* IEU0 */
  1357. - sub %o0, 1, %o0 /* IEU1 */
  1358. - subcc %o2, 1, %o2 /* IEU1 */
  1359. - bne,pt %xcc, 237b /* CTI */
  1360. - stb %g5, [%o0] /* Store Group */
  1361. -234: wr %g0, FPRS_FEF, %fprs
  1362. - retl
  1363. - mov %g4, %o0
  1364. -END(memmove)
  1365. -libc_hidden_def(memmove)
  1366. -
  1367. -#ifdef USE_BPR
  1368. -weak_alias(memcpy,__align_cpy_1)
  1369. -weak_alias(memcpy,__align_cpy_2)
  1370. -#endif
  1371. diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
  1372. deleted file mode 100644
  1373. index f76a637..0000000
  1374. --- a/libc/string/sparc/sparc64/memset.S
  1375. +++ /dev/null
  1376. @@ -1,316 +0,0 @@
  1377. -/* Set a block of memory to some byte value.
  1378. - For UltraSPARC.
  1379. - Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
  1380. - This file is part of the GNU C Library.
  1381. - Contributed by David S. Miller (davem@caip.rutgers.edu) and
  1382. - Jakub Jelinek (jj@ultra.linux.cz).
  1383. -
  1384. - The GNU C Library is free software; you can redistribute it and/or
  1385. - modify it under the terms of the GNU Lesser General Public
  1386. - License as published by the Free Software Foundation; either
  1387. - version 2.1 of the License, or (at your option) any later version.
  1388. -
  1389. - The GNU C Library is distributed in the hope that it will be useful,
  1390. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  1391. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1392. - Lesser General Public License for more details.
  1393. -
  1394. - You should have received a copy of the GNU Lesser General Public
  1395. - License along with the GNU C Library; if not, see
  1396. - <http://www.gnu.org/licenses/>. */
  1397. -
  1398. -#include <features.h>
  1399. -#include <asm/asi.h>
  1400. -#ifndef XCC
  1401. -#define XCC xcc
  1402. -#define USE_BPR
  1403. -#endif
  1404. -#define FPRS_FEF 4
  1405. -
  1406. -#define SET_BLOCKS(base, offset, source) \
  1407. - stx source, [base - offset - 0x18]; \
  1408. - stx source, [base - offset - 0x10]; \
  1409. - stx source, [base - offset - 0x08]; \
  1410. - stx source, [base - offset - 0x00];
  1411. -
  1412. - /* Well, memset is a lot easier to get right than bcopy... */
  1413. - .text
  1414. - .align 32
  1415. -ENTRY(memset)
  1416. - andcc %o1, 0xff, %o1
  1417. - mov %o0, %o5
  1418. - be,a,pt %icc, 50f
  1419. -#ifndef USE_BPR
  1420. - srl %o2, 0, %o1
  1421. -#else
  1422. - mov %o2, %o1
  1423. -#endif
  1424. - cmp %o2, 7
  1425. -#ifndef USE_BPR
  1426. - srl %o2, 0, %o2
  1427. -#endif
  1428. - bleu,pn %XCC, 17f
  1429. - andcc %o0, 3, %g5
  1430. - be,pt %xcc, 4f
  1431. - and %o1, 0xff, %o1
  1432. - cmp %g5, 3
  1433. - be,pn %xcc, 2f
  1434. - stb %o1, [%o0 + 0x00]
  1435. - cmp %g5, 2
  1436. - be,pt %xcc, 2f
  1437. - stb %o1, [%o0 + 0x01]
  1438. - stb %o1, [%o0 + 0x02]
  1439. -2: sub %g5, 4, %g5
  1440. - sub %o0, %g5, %o0
  1441. - add %o2, %g5, %o2
  1442. -4: sllx %o1, 8, %g1
  1443. - andcc %o0, 4, %g0
  1444. - or %o1, %g1, %o1
  1445. - sllx %o1, 16, %g1
  1446. - or %o1, %g1, %o1
  1447. - be,pt %xcc, 2f
  1448. - sllx %o1, 32, %g1
  1449. - stw %o1, [%o0]
  1450. - sub %o2, 4, %o2
  1451. - add %o0, 4, %o0
  1452. -2: cmp %o2, 128
  1453. - or %o1, %g1, %o1
  1454. - blu,pn %xcc, 9f
  1455. - andcc %o0, 0x38, %g5
  1456. - be,pn %icc, 6f
  1457. - mov 64, %o4
  1458. - andcc %o0, 8, %g0
  1459. - be,pn %icc, 1f
  1460. - sub %o4, %g5, %o4
  1461. - stx %o1, [%o0]
  1462. - add %o0, 8, %o0
  1463. -1: andcc %o4, 16, %g0
  1464. - be,pn %icc, 1f
  1465. - sub %o2, %o4, %o2
  1466. - stx %o1, [%o0]
  1467. - stx %o1, [%o0 + 8]
  1468. - add %o0, 16, %o0
  1469. -1: andcc %o4, 32, %g0
  1470. - be,pn %icc, 7f
  1471. - andncc %o2, 0x3f, %o3
  1472. - stw %o1, [%o0]
  1473. - stw %o1, [%o0 + 4]
  1474. - stw %o1, [%o0 + 8]
  1475. - stw %o1, [%o0 + 12]
  1476. - stw %o1, [%o0 + 16]
  1477. - stw %o1, [%o0 + 20]
  1478. - stw %o1, [%o0 + 24]
  1479. - stw %o1, [%o0 + 28]
  1480. - add %o0, 32, %o0
  1481. -7: be,pn %xcc, 9f
  1482. - nop
  1483. - ldd [%o0 - 8], %f0
  1484. -18: wr %g0, ASI_BLK_P, %asi
  1485. - membar #StoreStore | #LoadStore
  1486. - andcc %o3, 0xc0, %g5
  1487. - and %o2, 0x3f, %o2
  1488. - fmovd %f0, %f2
  1489. - fmovd %f0, %f4
  1490. - andn %o3, 0xff, %o3
  1491. - fmovd %f0, %f6
  1492. - cmp %g5, 64
  1493. - fmovd %f0, %f8
  1494. - fmovd %f0, %f10
  1495. - fmovd %f0, %f12
  1496. - brz,pn %g5, 10f
  1497. - fmovd %f0, %f14
  1498. - be,pn %icc, 2f
  1499. - stda %f0, [%o0 + 0x00] %asi
  1500. - cmp %g5, 128
  1501. - be,pn %icc, 2f
  1502. - stda %f0, [%o0 + 0x40] %asi
  1503. - stda %f0, [%o0 + 0x80] %asi
  1504. -2: brz,pn %o3, 12f
  1505. - add %o0, %g5, %o0
  1506. -10: stda %f0, [%o0 + 0x00] %asi
  1507. - stda %f0, [%o0 + 0x40] %asi
  1508. - stda %f0, [%o0 + 0x80] %asi
  1509. - stda %f0, [%o0 + 0xc0] %asi
  1510. -11: subcc %o3, 256, %o3
  1511. - bne,pt %xcc, 10b
  1512. - add %o0, 256, %o0
  1513. -12: wr %g0, FPRS_FEF, %fprs
  1514. - membar #StoreLoad | #StoreStore
  1515. -9: andcc %o2, 0x78, %g5
  1516. - be,pn %xcc, 13f
  1517. - andcc %o2, 7, %o2
  1518. -14: rd %pc, %o4
  1519. - srl %g5, 1, %o3
  1520. - sub %o4, %o3, %o4
  1521. - jmpl %o4 + (13f - 14b), %g0
  1522. - add %o0, %g5, %o0
  1523. -12: SET_BLOCKS (%o0, 0x68, %o1)
  1524. - SET_BLOCKS (%o0, 0x48, %o1)
  1525. - SET_BLOCKS (%o0, 0x28, %o1)
  1526. - SET_BLOCKS (%o0, 0x08, %o1)
  1527. -13: be,pn %xcc, 8f
  1528. - andcc %o2, 4, %g0
  1529. - be,pn %xcc, 1f
  1530. - andcc %o2, 2, %g0
  1531. - stw %o1, [%o0]
  1532. - add %o0, 4, %o0
  1533. -1: be,pn %xcc, 1f
  1534. - andcc %o2, 1, %g0
  1535. - sth %o1, [%o0]
  1536. - add %o0, 2, %o0
  1537. -1: bne,a,pn %xcc, 8f
  1538. - stb %o1, [%o0]
  1539. -8: retl
  1540. - mov %o5, %o0
  1541. -17: brz,pn %o2, 0f
  1542. -8: add %o0, 1, %o0
  1543. - subcc %o2, 1, %o2
  1544. - bne,pt %xcc, 8b
  1545. - stb %o1, [%o0 - 1]
  1546. -0: retl
  1547. - mov %o5, %o0
  1548. -
  1549. -6: stx %o1, [%o0]
  1550. - andncc %o2, 0x3f, %o3
  1551. - be,pn %xcc, 9b
  1552. - nop
  1553. - ba,pt %xcc, 18b
  1554. - ldd [%o0], %f0
  1555. -END(memset)
  1556. -libc_hidden_def(memset)
  1557. -
  1558. -#define ZERO_BLOCKS(base, offset, source) \
  1559. - stx source, [base - offset - 0x38]; \
  1560. - stx source, [base - offset - 0x30]; \
  1561. - stx source, [base - offset - 0x28]; \
  1562. - stx source, [base - offset - 0x20]; \
  1563. - stx source, [base - offset - 0x18]; \
  1564. - stx source, [base - offset - 0x10]; \
  1565. - stx source, [base - offset - 0x08]; \
  1566. - stx source, [base - offset - 0x00];
  1567. -
  1568. - .text
  1569. - .align 32
  1570. -#ifdef __UCLIBC_SUSV3_LEGACY__
  1571. -ENTRY(bzero)
  1572. -#ifndef USE_BPR
  1573. - srl %o1, 0, %o1
  1574. -#endif
  1575. - mov %o0, %o5
  1576. -#endif
  1577. -50: cmp %o1, 7
  1578. - bleu,pn %xcc, 17f
  1579. - andcc %o0, 3, %o2
  1580. - be,a,pt %xcc, 4f
  1581. - andcc %o0, 4, %g0
  1582. - cmp %o2, 3
  1583. - be,pn %xcc, 2f
  1584. - stb %g0, [%o0 + 0x00]
  1585. - cmp %o2, 2
  1586. - be,pt %xcc, 2f
  1587. - stb %g0, [%o0 + 0x01]
  1588. - stb %g0, [%o0 + 0x02]
  1589. -2: sub %o2, 4, %o2
  1590. - sub %o0, %o2, %o0
  1591. - add %o1, %o2, %o1
  1592. - andcc %o0, 4, %g0
  1593. -4: be,pt %xcc, 2f
  1594. - cmp %o1, 128
  1595. - stw %g0, [%o0]
  1596. - sub %o1, 4, %o1
  1597. - add %o0, 4, %o0
  1598. -2: blu,pn %xcc, 9f
  1599. - andcc %o0, 0x38, %o2
  1600. - be,pn %icc, 6f
  1601. - mov 64, %o4
  1602. - andcc %o0, 8, %g0
  1603. - be,pn %icc, 1f
  1604. - sub %o4, %o2, %o4
  1605. - stx %g0, [%o0]
  1606. - add %o0, 8, %o0
  1607. -1: andcc %o4, 16, %g0
  1608. - be,pn %icc, 1f
  1609. - sub %o1, %o4, %o1
  1610. - stx %g0, [%o0]
  1611. - stx %g0, [%o0 + 8]
  1612. - add %o0, 16, %o0
  1613. -1: andcc %o4, 32, %g0
  1614. - be,pn %icc, 7f
  1615. - andncc %o1, 0x3f, %o3
  1616. - stx %g0, [%o0]
  1617. - stx %g0, [%o0 + 8]
  1618. - stx %g0, [%o0 + 16]
  1619. - stx %g0, [%o0 + 24]
  1620. - add %o0, 32, %o0
  1621. -6: andncc %o1, 0x3f, %o3
  1622. -7: be,pn %xcc, 9f
  1623. - wr %g0, ASI_BLK_P, %asi
  1624. - membar #StoreLoad | #StoreStore | #LoadStore
  1625. - fzero %f0
  1626. - andcc %o3, 0xc0, %o2
  1627. - and %o1, 0x3f, %o1
  1628. - fzero %f2
  1629. - andn %o3, 0xff, %o3
  1630. - faddd %f0, %f2, %f4
  1631. - fmuld %f0, %f2, %f6
  1632. - cmp %o2, 64
  1633. - faddd %f0, %f2, %f8
  1634. - fmuld %f0, %f2, %f10
  1635. - faddd %f0, %f2, %f12
  1636. - brz,pn %o2, 10f
  1637. - fmuld %f0, %f2, %f14
  1638. - be,pn %icc, 2f
  1639. - stda %f0, [%o0 + 0x00] %asi
  1640. - cmp %o2, 128
  1641. - be,pn %icc, 2f
  1642. - stda %f0, [%o0 + 0x40] %asi
  1643. - stda %f0, [%o0 + 0x80] %asi
  1644. -2: brz,pn %o3, 12f
  1645. - add %o0, %o2, %o0
  1646. -10: stda %f0, [%o0 + 0x00] %asi
  1647. - stda %f0, [%o0 + 0x40] %asi
  1648. - stda %f0, [%o0 + 0x80] %asi
  1649. - stda %f0, [%o0 + 0xc0] %asi
  1650. -11: subcc %o3, 256, %o3
  1651. - bne,pt %xcc, 10b
  1652. - add %o0, 256, %o0
  1653. -12: wr %g0, FPRS_FEF, %fprs
  1654. - membar #StoreLoad | #StoreStore
  1655. -9: andcc %o1, 0xf8, %o2
  1656. - be,pn %xcc, 13f
  1657. - andcc %o1, 7, %o1
  1658. -14: rd %pc, %o4
  1659. - srl %o2, 1, %o3
  1660. - sub %o4, %o3, %o4
  1661. - jmpl %o4 + (13f - 14b), %g0
  1662. - add %o0, %o2, %o0
  1663. -12: ZERO_BLOCKS (%o0, 0xc8, %g0)
  1664. - ZERO_BLOCKS (%o0, 0x88, %g0)
  1665. - ZERO_BLOCKS (%o0, 0x48, %g0)
  1666. - ZERO_BLOCKS (%o0, 0x08, %g0)
  1667. -13: be,pn %xcc, 8f
  1668. - andcc %o1, 4, %g0
  1669. - be,pn %xcc, 1f
  1670. - andcc %o1, 2, %g0
  1671. - stw %g0, [%o0]
  1672. - add %o0, 4, %o0
  1673. -1: be,pn %xcc, 1f
  1674. - andcc %o1, 1, %g0
  1675. - sth %g0, [%o0]
  1676. - add %o0, 2, %o0
  1677. -1: bne,a,pn %xcc, 8f
  1678. - stb %g0, [%o0]
  1679. -8: retl
  1680. - mov %o5, %o0
  1681. -17: be,pn %xcc, 13b
  1682. - orcc %o1, 0, %g0
  1683. - be,pn %xcc, 0f
  1684. -8: add %o0, 1, %o0
  1685. - subcc %o1, 1, %o1
  1686. - bne,pt %xcc, 8b
  1687. - stb %g0, [%o0 - 1]
  1688. -0: retl
  1689. - mov %o5, %o0
  1690. -#ifdef __UCLIBC_SUSV3_LEGACY__
  1691. -END(bzero)
  1692. -#endif
  1693. diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
  1694. deleted file mode 100644
  1695. index 8bbdc84..0000000
  1696. --- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
  1697. +++ /dev/null
  1698. @@ -1,611 +0,0 @@
  1699. -/* Copy SIZE bytes from SRC to DEST.
  1700. - For UltraSPARC-III.
  1701. - Copyright (C) 2001, 2003 Free Software Foundation, Inc.
  1702. - This file is part of the GNU C Library.
  1703. - Contributed by David S. Miller (davem@redhat.com)
  1704. -
  1705. - The GNU C Library is free software; you can redistribute it and/or
  1706. - modify it under the terms of the GNU Lesser General Public
  1707. - License as published by the Free Software Foundation; either
  1708. - version 2.1 of the License, or (at your option) any later version.
  1709. -
  1710. - The GNU C Library is distributed in the hope that it will be useful,
  1711. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  1712. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1713. - Lesser General Public License for more details.
  1714. -
  1715. - You should have received a copy of the GNU Lesser General Public
  1716. - License along with the GNU C Library; if not, see
  1717. - <http://www.gnu.org/licenses/>. */
  1718. -
  1719. -#include <features.h>
  1720. -
  1721. -#define ASI_BLK_P 0xf0
  1722. -#define FPRS_FEF 0x04
  1723. -#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
  1724. -#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
  1725. -
  1726. -#ifndef XCC
  1727. -#define USE_BPR
  1728. -#define XCC xcc
  1729. -#endif
  1730. -
  1731. - .register %g2,#scratch
  1732. - .register %g3,#scratch
  1733. - .register %g6,#scratch
  1734. -
  1735. - .text
  1736. - .align 32
  1737. -
  1738. -#ifdef __UCLIBC_SUSV3_LEGACY__
  1739. -ENTRY(bcopy)
  1740. - sub %o1, %o0, %o4
  1741. - mov %o0, %g4
  1742. - cmp %o4, %o2
  1743. - mov %o1, %o0
  1744. - bgeu,pt %XCC, 100f
  1745. - mov %g4, %o1
  1746. -#ifndef USE_BPR
  1747. - srl %o2, 0, %o2
  1748. -#endif
  1749. - brnz,pn %o2, 220f
  1750. - add %o0, %o2, %o0
  1751. - retl
  1752. - nop
  1753. -END(bcopy)
  1754. -#endif
  1755. -
  1756. - /* Special/non-trivial issues of this code:
  1757. - *
  1758. - * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
  1759. - * 2) Only low 32 FPU registers are used so that only the
  1760. - * lower half of the FPU register set is dirtied by this
  1761. - * code. This is especially important in the kernel.
  1762. - * 3) This code never prefetches cachelines past the end
  1763. - * of the source buffer.
  1764. - *
  1765. - * The cheetah's flexible spine, oversized liver, enlarged heart,
  1766. - * slender muscular body, and claws make it the swiftest hunter
  1767. - * in Africa and the fastest animal on land. Can reach speeds
  1768. - * of up to 2.4GB per second.
  1769. - */
  1770. - .align 32
  1771. -ENTRY(memcpy)
  1772. -
  1773. -100: /* %o0=dst, %o1=src, %o2=len */
  1774. - mov %o0, %g5
  1775. - cmp %o2, 0
  1776. - be,pn %XCC, out
  1777. -218: or %o0, %o1, %o3
  1778. - cmp %o2, 16
  1779. - bleu,a,pn %XCC, small_copy
  1780. - or %o3, %o2, %o3
  1781. -
  1782. - cmp %o2, 256
  1783. - blu,pt %XCC, medium_copy
  1784. - andcc %o3, 0x7, %g0
  1785. -
  1786. - ba,pt %xcc, enter
  1787. - andcc %o0, 0x3f, %g2
  1788. -
  1789. - /* Here len >= 256 and condition codes reflect execution
  1790. - * of "andcc %o0, 0x7, %g2", done by caller.
  1791. - */
  1792. - .align 64
  1793. -enter:
  1794. - /* Is 'dst' already aligned on an 64-byte boundary? */
  1795. - be,pt %XCC, 2f
  1796. -
  1797. - /* Compute abs((dst & 0x3f) - 0x40) into %g2. This is the number
  1798. - * of bytes to copy to make 'dst' 64-byte aligned. We pre-
  1799. - * subtract this from 'len'.
  1800. - */
  1801. - sub %g2, 0x40, %g2
  1802. - sub %g0, %g2, %g2
  1803. - sub %o2, %g2, %o2
  1804. -
  1805. - /* Copy %g2 bytes from src to dst, one byte at a time. */
  1806. -1: ldub [%o1 + 0x00], %o3
  1807. - add %o1, 0x1, %o1
  1808. - add %o0, 0x1, %o0
  1809. - subcc %g2, 0x1, %g2
  1810. -
  1811. - bg,pt %XCC, 1b
  1812. - stb %o3, [%o0 + -1]
  1813. -
  1814. -2: VISEntryHalf
  1815. - and %o1, 0x7, %g1
  1816. - ba,pt %xcc, begin
  1817. - alignaddr %o1, %g0, %o1
  1818. -
  1819. - .align 64
  1820. -begin:
  1821. - prefetch [%o1 + 0x000], #one_read
  1822. - prefetch [%o1 + 0x040], #one_read
  1823. - andn %o2, (0x40 - 1), %o4
  1824. - prefetch [%o1 + 0x080], #one_read
  1825. - prefetch [%o1 + 0x0c0], #one_read
  1826. - ldd [%o1 + 0x000], %f0
  1827. - prefetch [%o1 + 0x100], #one_read
  1828. - ldd [%o1 + 0x008], %f2
  1829. - prefetch [%o1 + 0x140], #one_read
  1830. - ldd [%o1 + 0x010], %f4
  1831. - prefetch [%o1 + 0x180], #one_read
  1832. - faligndata %f0, %f2, %f16
  1833. - ldd [%o1 + 0x018], %f6
  1834. - faligndata %f2, %f4, %f18
  1835. - ldd [%o1 + 0x020], %f8
  1836. - faligndata %f4, %f6, %f20
  1837. - ldd [%o1 + 0x028], %f10
  1838. - faligndata %f6, %f8, %f22
  1839. -
  1840. - ldd [%o1 + 0x030], %f12
  1841. - faligndata %f8, %f10, %f24
  1842. - ldd [%o1 + 0x038], %f14
  1843. - faligndata %f10, %f12, %f26
  1844. - ldd [%o1 + 0x040], %f0
  1845. -
  1846. - sub %o4, 0x80, %o4
  1847. - add %o1, 0x40, %o1
  1848. - ba,pt %xcc, loop
  1849. - srl %o4, 6, %o3
  1850. -
  1851. - .align 64
  1852. -loop:
  1853. - ldd [%o1 + 0x008], %f2
  1854. - faligndata %f12, %f14, %f28
  1855. - ldd [%o1 + 0x010], %f4
  1856. - faligndata %f14, %f0, %f30
  1857. - stda %f16, [%o0] ASI_BLK_P
  1858. - ldd [%o1 + 0x018], %f6
  1859. - faligndata %f0, %f2, %f16
  1860. -
  1861. - ldd [%o1 + 0x020], %f8
  1862. - faligndata %f2, %f4, %f18
  1863. - ldd [%o1 + 0x028], %f10
  1864. - faligndata %f4, %f6, %f20
  1865. - ldd [%o1 + 0x030], %f12
  1866. - faligndata %f6, %f8, %f22
  1867. - ldd [%o1 + 0x038], %f14
  1868. - faligndata %f8, %f10, %f24
  1869. -
  1870. - ldd [%o1 + 0x040], %f0
  1871. - prefetch [%o1 + 0x180], #one_read
  1872. - faligndata %f10, %f12, %f26
  1873. - subcc %o3, 0x01, %o3
  1874. - add %o1, 0x40, %o1
  1875. - bg,pt %XCC, loop
  1876. - add %o0, 0x40, %o0
  1877. -
  1878. - /* Finally we copy the last full 64-byte block. */
  1879. -loopfini:
  1880. - ldd [%o1 + 0x008], %f2
  1881. - faligndata %f12, %f14, %f28
  1882. - ldd [%o1 + 0x010], %f4
  1883. - faligndata %f14, %f0, %f30
  1884. - stda %f16, [%o0] ASI_BLK_P
  1885. - ldd [%o1 + 0x018], %f6
  1886. - faligndata %f0, %f2, %f16
  1887. - ldd [%o1 + 0x020], %f8
  1888. - faligndata %f2, %f4, %f18
  1889. - ldd [%o1 + 0x028], %f10
  1890. - faligndata %f4, %f6, %f20
  1891. - ldd [%o1 + 0x030], %f12
  1892. - faligndata %f6, %f8, %f22
  1893. - ldd [%o1 + 0x038], %f14
  1894. - faligndata %f8, %f10, %f24
  1895. - cmp %g1, 0
  1896. - be,pt %XCC, 1f
  1897. - add %o0, 0x40, %o0
  1898. - ldd [%o1 + 0x040], %f0
  1899. -1: faligndata %f10, %f12, %f26
  1900. - faligndata %f12, %f14, %f28
  1901. - faligndata %f14, %f0, %f30
  1902. - stda %f16, [%o0] ASI_BLK_P
  1903. - add %o0, 0x40, %o0
  1904. - add %o1, 0x40, %o1
  1905. - membar #Sync
  1906. -
  1907. - /* Now we copy the (len modulo 64) bytes at the end.
  1908. - * Note how we borrow the %f0 loaded above.
  1909. - *
  1910. - * Also notice how this code is careful not to perform a
  1911. - * load past the end of the src buffer.
  1912. - */
  1913. -loopend:
  1914. - and %o2, 0x3f, %o2
  1915. - andcc %o2, 0x38, %g2
  1916. - be,pn %XCC, endcruft
  1917. - subcc %g2, 0x8, %g2
  1918. - be,pn %XCC, endcruft
  1919. - cmp %g1, 0
  1920. -
  1921. - be,a,pt %XCC, 1f
  1922. - ldd [%o1 + 0x00], %f0
  1923. -
  1924. -1: ldd [%o1 + 0x08], %f2
  1925. - add %o1, 0x8, %o1
  1926. - sub %o2, 0x8, %o2
  1927. - subcc %g2, 0x8, %g2
  1928. - faligndata %f0, %f2, %f8
  1929. - std %f8, [%o0 + 0x00]
  1930. - be,pn %XCC, endcruft
  1931. - add %o0, 0x8, %o0
  1932. - ldd [%o1 + 0x08], %f0
  1933. - add %o1, 0x8, %o1
  1934. - sub %o2, 0x8, %o2
  1935. - subcc %g2, 0x8, %g2
  1936. - faligndata %f2, %f0, %f8
  1937. - std %f8, [%o0 + 0x00]
  1938. - bne,pn %XCC, 1b
  1939. - add %o0, 0x8, %o0
  1940. -
  1941. - /* If anything is left, we copy it one byte at a time.
  1942. - * Note that %g1 is (src & 0x3) saved above before the
  1943. - * alignaddr was performed.
  1944. - */
  1945. -endcruft:
  1946. - cmp %o2, 0
  1947. - add %o1, %g1, %o1
  1948. - VISExitHalf
  1949. - be,pn %XCC, out
  1950. - sub %o0, %o1, %o3
  1951. -
  1952. - andcc %g1, 0x7, %g0
  1953. - bne,pn %icc, small_copy_unaligned
  1954. - andcc %o2, 0x8, %g0
  1955. - be,pt %icc, 1f
  1956. - nop
  1957. - ldx [%o1], %o5
  1958. - stx %o5, [%o1 + %o3]
  1959. - add %o1, 0x8, %o1
  1960. -
  1961. -1: andcc %o2, 0x4, %g0
  1962. - be,pt %icc, 1f
  1963. - nop
  1964. - lduw [%o1], %o5
  1965. - stw %o5, [%o1 + %o3]
  1966. - add %o1, 0x4, %o1
  1967. -
  1968. -1: andcc %o2, 0x2, %g0
  1969. - be,pt %icc, 1f
  1970. - nop
  1971. - lduh [%o1], %o5
  1972. - sth %o5, [%o1 + %o3]
  1973. - add %o1, 0x2, %o1
  1974. -
  1975. -1: andcc %o2, 0x1, %g0
  1976. - be,pt %icc, out
  1977. - nop
  1978. - ldub [%o1], %o5
  1979. - ba,pt %xcc, out
  1980. - stb %o5, [%o1 + %o3]
  1981. -
  1982. -medium_copy: /* 16 < len <= 64 */
  1983. - bne,pn %XCC, small_copy_unaligned
  1984. - sub %o0, %o1, %o3
  1985. -
  1986. -medium_copy_aligned:
  1987. - andn %o2, 0x7, %o4
  1988. - and %o2, 0x7, %o2
  1989. -1: subcc %o4, 0x8, %o4
  1990. - ldx [%o1], %o5
  1991. - stx %o5, [%o1 + %o3]
  1992. - bgu,pt %XCC, 1b
  1993. - add %o1, 0x8, %o1
  1994. - andcc %o2, 0x4, %g0
  1995. - be,pt %XCC, 1f
  1996. - nop
  1997. - sub %o2, 0x4, %o2
  1998. - lduw [%o1], %o5
  1999. - stw %o5, [%o1 + %o3]
  2000. - add %o1, 0x4, %o1
  2001. -1: cmp %o2, 0
  2002. - be,pt %XCC, out
  2003. - nop
  2004. - ba,pt %xcc, small_copy_unaligned
  2005. - nop
  2006. -
  2007. -small_copy: /* 0 < len <= 16 */
  2008. - andcc %o3, 0x3, %g0
  2009. - bne,pn %XCC, small_copy_unaligned
  2010. - sub %o0, %o1, %o3
  2011. -
  2012. -small_copy_aligned:
  2013. - subcc %o2, 4, %o2
  2014. - lduw [%o1], %g1
  2015. - stw %g1, [%o1 + %o3]
  2016. - bgu,pt %XCC, small_copy_aligned
  2017. - add %o1, 4, %o1
  2018. -
  2019. -out: retl
  2020. - mov %g5, %o0
  2021. -
  2022. - .align 32
  2023. -small_copy_unaligned:
  2024. - subcc %o2, 1, %o2
  2025. - ldub [%o1], %g1
  2026. - stb %g1, [%o1 + %o3]
  2027. - bgu,pt %XCC, small_copy_unaligned
  2028. - add %o1, 1, %o1
  2029. - retl
  2030. - mov %g5, %o0
  2031. -
  2032. -END(memcpy)
  2033. -libc_hidden_def(memcpy)
  2034. -
  2035. -#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
  2036. - ldx [%src - offset - 0x20], %t0; \
  2037. - ldx [%src - offset - 0x18], %t1; \
  2038. - ldx [%src - offset - 0x10], %t2; \
  2039. - ldx [%src - offset - 0x08], %t3; \
  2040. - stw %t0, [%dst - offset - 0x1c]; \
  2041. - srlx %t0, 32, %t0; \
  2042. - stw %t0, [%dst - offset - 0x20]; \
  2043. - stw %t1, [%dst - offset - 0x14]; \
  2044. - srlx %t1, 32, %t1; \
  2045. - stw %t1, [%dst - offset - 0x18]; \
  2046. - stw %t2, [%dst - offset - 0x0c]; \
  2047. - srlx %t2, 32, %t2; \
  2048. - stw %t2, [%dst - offset - 0x10]; \
  2049. - stw %t3, [%dst - offset - 0x04]; \
  2050. - srlx %t3, 32, %t3; \
  2051. - stw %t3, [%dst - offset - 0x08];
  2052. -
  2053. -#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
  2054. - ldx [%src - offset - 0x20], %t0; \
  2055. - ldx [%src - offset - 0x18], %t1; \
  2056. - ldx [%src - offset - 0x10], %t2; \
  2057. - ldx [%src - offset - 0x08], %t3; \
  2058. - stx %t0, [%dst - offset - 0x20]; \
  2059. - stx %t1, [%dst - offset - 0x18]; \
  2060. - stx %t2, [%dst - offset - 0x10]; \
  2061. - stx %t3, [%dst - offset - 0x08]; \
  2062. - ldx [%src - offset - 0x40], %t0; \
  2063. - ldx [%src - offset - 0x38], %t1; \
  2064. - ldx [%src - offset - 0x30], %t2; \
  2065. - ldx [%src - offset - 0x28], %t3; \
  2066. - stx %t0, [%dst - offset - 0x40]; \
  2067. - stx %t1, [%dst - offset - 0x38]; \
  2068. - stx %t2, [%dst - offset - 0x30]; \
  2069. - stx %t3, [%dst - offset - 0x28];
  2070. -
  2071. -#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
  2072. - ldx [%src + offset + 0x00], %t0; \
  2073. - ldx [%src + offset + 0x08], %t1; \
  2074. - stw %t0, [%dst + offset + 0x04]; \
  2075. - srlx %t0, 32, %t2; \
  2076. - stw %t2, [%dst + offset + 0x00]; \
  2077. - stw %t1, [%dst + offset + 0x0c]; \
  2078. - srlx %t1, 32, %t3; \
  2079. - stw %t3, [%dst + offset + 0x08];
  2080. -
  2081. -#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
  2082. - ldx [%src + offset + 0x00], %t0; \
  2083. - ldx [%src + offset + 0x08], %t1; \
  2084. - stx %t0, [%dst + offset + 0x00]; \
  2085. - stx %t1, [%dst + offset + 0x08];
  2086. -
  2087. - .align 32
  2088. -228: andcc %o2, 1, %g0 /* IEU1 Group */
  2089. - be,pt %icc, 2f+4 /* CTI */
  2090. -1: ldub [%o1 - 1], %o5 /* LOAD Group */
  2091. - sub %o1, 1, %o1 /* IEU0 */
  2092. - sub %o0, 1, %o0 /* IEU1 */
  2093. - subcc %o2, 1, %o2 /* IEU1 Group */
  2094. - be,pn %xcc, 229f /* CTI */
  2095. - stb %o5, [%o0] /* Store */
  2096. -2: ldub [%o1 - 1], %o5 /* LOAD Group */
  2097. - sub %o0, 2, %o0 /* IEU0 */
  2098. - ldub [%o1 - 2], %g5 /* LOAD Group */
  2099. - sub %o1, 2, %o1 /* IEU0 */
  2100. - subcc %o2, 2, %o2 /* IEU1 Group */
  2101. - stb %o5, [%o0 + 1] /* Store */
  2102. - bne,pt %xcc, 2b /* CTI */
  2103. - stb %g5, [%o0] /* Store */
  2104. -229: retl
  2105. - mov %g4, %o0
  2106. -
  2107. - .align 32
  2108. -ENTRY(memmove)
  2109. - mov %o0, %g5
  2110. -#ifndef USE_BPR
  2111. - srl %o2, 0, %o2 /* IEU1 Group */
  2112. -#endif
  2113. - brz,pn %o2, out /* CTI Group */
  2114. - sub %o0, %o1, %o4 /* IEU0 */
  2115. - cmp %o4, %o2 /* IEU1 Group */
  2116. - bgeu,pt %XCC, 218b /* CTI */
  2117. - mov %o0, %g4 /* IEU0 */
  2118. - add %o0, %o2, %o0 /* IEU0 Group */
  2119. -220: add %o1, %o2, %o1 /* IEU1 */
  2120. - cmp %o2, 15 /* IEU1 Group */
  2121. - bleu,pn %xcc, 228b /* CTI */
  2122. - andcc %o0, 7, %g2 /* IEU1 Group */
  2123. - sub %o0, %o1, %g5 /* IEU0 */
  2124. - andcc %g5, 3, %o5 /* IEU1 Group */
  2125. - bne,pn %xcc, 232f /* CTI */
  2126. - andcc %o1, 3, %g0 /* IEU1 Group */
  2127. - be,a,pt %xcc, 236f /* CTI */
  2128. - andcc %o1, 4, %g0 /* IEU1 Group */
  2129. - andcc %o1, 1, %g0 /* IEU1 Group */
  2130. - be,pn %xcc, 4f /* CTI */
  2131. - andcc %o1, 2, %g0 /* IEU1 Group */
  2132. - ldub [%o1 - 1], %g2 /* Load Group */
  2133. - sub %o1, 1, %o1 /* IEU0 */
  2134. - sub %o0, 1, %o0 /* IEU1 */
  2135. - sub %o2, 1, %o2 /* IEU0 Group */
  2136. - be,pn %xcc, 5f /* CTI Group */
  2137. - stb %g2, [%o0] /* Store */
  2138. -4: lduh [%o1 - 2], %g2 /* Load Group */
  2139. - sub %o1, 2, %o1 /* IEU0 */
  2140. - sub %o0, 2, %o0 /* IEU1 */
  2141. - sub %o2, 2, %o2 /* IEU0 */
  2142. - sth %g2, [%o0] /* Store Group + bubble */
  2143. -5: andcc %o1, 4, %g0 /* IEU1 */
  2144. -236: be,a,pn %xcc, 2f /* CTI */
  2145. - andcc %o2, -128, %g6 /* IEU1 Group */
  2146. - lduw [%o1 - 4], %g5 /* Load Group */
  2147. - sub %o1, 4, %o1 /* IEU0 */
  2148. - sub %o0, 4, %o0 /* IEU1 */
  2149. - sub %o2, 4, %o2 /* IEU0 Group */
  2150. - stw %g5, [%o0] /* Store */
  2151. - andcc %o2, -128, %g6 /* IEU1 Group */
  2152. -2: be,pn %xcc, 235f /* CTI */
  2153. - andcc %o0, 4, %g0 /* IEU1 Group */
  2154. - be,pn %xcc, 282f + 4 /* CTI Group */
  2155. -5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  2156. - RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
  2157. - RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  2158. - RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
  2159. - subcc %g6, 128, %g6 /* IEU1 Group */
  2160. - sub %o1, 128, %o1 /* IEU0 */
  2161. - bne,pt %xcc, 5b /* CTI */
  2162. - sub %o0, 128, %o0 /* IEU0 Group */
  2163. -235: andcc %o2, 0x70, %g6 /* IEU1 Group */
  2164. -41: be,pn %xcc, 280f /* CTI */
  2165. - andcc %o2, 8, %g0 /* IEU1 Group */
  2166. - /* Clk1 8-( */
  2167. - /* Clk2 8-( */
  2168. - /* Clk3 8-( */
  2169. - /* Clk4 8-( */
  2170. -279: rd %pc, %o5 /* PDU Group */
  2171. - sll %g6, 1, %g5 /* IEU0 Group */
  2172. - sub %o1, %g6, %o1 /* IEU1 */
  2173. - sub %o5, %g5, %o5 /* IEU0 Group */
  2174. - jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
  2175. - sub %o0, %g6, %o0 /* IEU0 Group */
  2176. - RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
  2177. - RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
  2178. - RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
  2179. - RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
  2180. - RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
  2181. - RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
  2182. - RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
  2183. -280: be,pt %xcc, 281f /* CTI */
  2184. - andcc %o2, 4, %g0 /* IEU1 */
  2185. - ldx [%o1 - 8], %g2 /* Load Group */
  2186. - sub %o0, 8, %o0 /* IEU0 */
  2187. - stw %g2, [%o0 + 4] /* Store Group */
  2188. - sub %o1, 8, %o1 /* IEU1 */
  2189. - srlx %g2, 32, %g2 /* IEU0 Group */
  2190. - stw %g2, [%o0] /* Store */
  2191. -281: be,pt %xcc, 1f /* CTI */
  2192. - andcc %o2, 2, %g0 /* IEU1 Group */
  2193. - lduw [%o1 - 4], %g2 /* Load Group */
  2194. - sub %o1, 4, %o1 /* IEU0 */
  2195. - stw %g2, [%o0 - 4] /* Store Group */
  2196. - sub %o0, 4, %o0 /* IEU0 */
  2197. -1: be,pt %xcc, 1f /* CTI */
  2198. - andcc %o2, 1, %g0 /* IEU1 Group */
  2199. - lduh [%o1 - 2], %g2 /* Load Group */
  2200. - sub %o1, 2, %o1 /* IEU0 */
  2201. - sth %g2, [%o0 - 2] /* Store Group */
  2202. - sub %o0, 2, %o0 /* IEU0 */
  2203. -1: be,pt %xcc, 211f /* CTI */
  2204. - nop /* IEU1 */
  2205. - ldub [%o1 - 1], %g2 /* Load Group */
  2206. - stb %g2, [%o0 - 1] /* Store Group + bubble */
  2207. -211: retl
  2208. - mov %g4, %o0
  2209. -
  2210. -282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
  2211. - RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
  2212. - subcc %g6, 128, %g6 /* IEU1 Group */
  2213. - sub %o1, 128, %o1 /* IEU0 */
  2214. - bne,pt %xcc, 282b /* CTI */
  2215. - sub %o0, 128, %o0 /* IEU0 Group */
  2216. - andcc %o2, 0x70, %g6 /* IEU1 */
  2217. - be,pn %xcc, 284f /* CTI */
  2218. - andcc %o2, 8, %g0 /* IEU1 Group */
  2219. - /* Clk1 8-( */
  2220. - /* Clk2 8-( */
  2221. - /* Clk3 8-( */
  2222. - /* Clk4 8-( */
  2223. -283: rd %pc, %o5 /* PDU Group */
  2224. - sub %o1, %g6, %o1 /* IEU0 Group */
  2225. - sub %o5, %g6, %o5 /* IEU1 */
  2226. - jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
  2227. - sub %o0, %g6, %o0 /* IEU0 Group */
  2228. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
  2229. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
  2230. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
  2231. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
  2232. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
  2233. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
  2234. - RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
  2235. -284: be,pt %xcc, 285f /* CTI Group */
  2236. - andcc %o2, 4, %g0 /* IEU1 */
  2237. - ldx [%o1 - 8], %g2 /* Load Group */
  2238. - sub %o0, 8, %o0 /* IEU0 */
  2239. - sub %o1, 8, %o1 /* IEU0 Group */
  2240. - stx %g2, [%o0] /* Store */
  2241. -285: be,pt %xcc, 1f /* CTI */
  2242. - andcc %o2, 2, %g0 /* IEU1 Group */
  2243. - lduw [%o1 - 4], %g2 /* Load Group */
  2244. - sub %o0, 4, %o0 /* IEU0 */
  2245. - sub %o1, 4, %o1 /* IEU0 Group */
  2246. - stw %g2, [%o0] /* Store */
  2247. -1: be,pt %xcc, 1f /* CTI */
  2248. - andcc %o2, 1, %g0 /* IEU1 Group */
  2249. - lduh [%o1 - 2], %g2 /* Load Group */
  2250. - sub %o0, 2, %o0 /* IEU0 */
  2251. - sub %o1, 2, %o1 /* IEU0 Group */
  2252. - sth %g2, [%o0] /* Store */
  2253. -1: be,pt %xcc, 1f /* CTI */
  2254. - nop /* IEU0 Group */
  2255. - ldub [%o1 - 1], %g2 /* Load Group */
  2256. - stb %g2, [%o0 - 1] /* Store Group + bubble */
  2257. -1: retl
  2258. - mov %g4, %o0
  2259. -
  2260. -232: brz,pt %g2, 2f /* CTI Group */
  2261. - sub %o2, %g2, %o2 /* IEU0 Group */
  2262. -1: ldub [%o1 - 1], %g5 /* Load Group */
  2263. - sub %o1, 1, %o1 /* IEU0 */
  2264. - sub %o0, 1, %o0 /* IEU1 */
  2265. - subcc %g2, 1, %g2 /* IEU1 Group */
  2266. - bne,pt %xcc, 1b /* CTI */
  2267. - stb %g5, [%o0] /* Store */
  2268. -2: andn %o2, 7, %g5 /* IEU0 Group */
  2269. - and %o2, 7, %o2 /* IEU1 */
  2270. - fmovd %f0, %f2 /* FPU */
  2271. - alignaddr %o1, %g0, %g1 /* GRU Group */
  2272. - ldd [%g1], %f4 /* Load Group */
  2273. -1: ldd [%g1 - 8], %f6 /* Load Group */
  2274. - sub %g1, 8, %g1 /* IEU0 Group */
  2275. - subcc %g5, 8, %g5 /* IEU1 */
  2276. - faligndata %f6, %f4, %f0 /* GRU Group */
  2277. - std %f0, [%o0 - 8] /* Store */
  2278. - sub %o1, 8, %o1 /* IEU0 Group */
  2279. - be,pn %xcc, 233f /* CTI */
  2280. - sub %o0, 8, %o0 /* IEU1 */
  2281. - ldd [%g1 - 8], %f4 /* Load Group */
  2282. - sub %g1, 8, %g1 /* IEU0 */
  2283. - subcc %g5, 8, %g5 /* IEU1 */
  2284. - faligndata %f4, %f6, %f0 /* GRU Group */
  2285. - std %f0, [%o0 - 8] /* Store */
  2286. - sub %o1, 8, %o1 /* IEU0 */
  2287. - bne,pn %xcc, 1b /* CTI Group */
  2288. - sub %o0, 8, %o0 /* IEU0 */
  2289. -233: brz,pn %o2, 234f /* CTI Group */
  2290. - nop /* IEU0 */
  2291. -237: ldub [%o1 - 1], %g5 /* LOAD */
  2292. - sub %o1, 1, %o1 /* IEU0 */
  2293. - sub %o0, 1, %o0 /* IEU1 */
  2294. - subcc %o2, 1, %o2 /* IEU1 */
  2295. - bne,pt %xcc, 237b /* CTI */
  2296. - stb %g5, [%o0] /* Store Group */
  2297. -234: wr %g0, FPRS_FEF, %fprs
  2298. - retl
  2299. - mov %g4, %o0
  2300. -END(memmove)
  2301. -libc_hidden_def(memmove)
  2302. -
  2303. -#ifdef USE_BPR
  2304. -weak_alias(memcpy,__align_cpy_1)
  2305. -weak_alias(memcpy,__align_cpy_2)
  2306. -weak_alias(memcpy,__align_cpy_4)
  2307. -weak_alias(memcpy,__align_cpy_8)
  2308. -weak_alias(memcpy,__align_cpy_16)
  2309. -#endif
  2310. diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S
  2311. deleted file mode 100644
  2312. index 9af0d56..0000000
  2313. --- a/libc/string/sparc/sparc64/stpcpy.S
  2314. +++ /dev/null
  2315. @@ -1,270 +0,0 @@
  2316. -/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
  2317. - For SPARC v9.
  2318. - Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
  2319. - This file is part of the GNU C Library.
  2320. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  2321. - Jakub Jelinek <jj@ultra.linux.cz>.
  2322. -
  2323. - The GNU C Library is free software; you can redistribute it and/or
  2324. - modify it under the terms of the GNU Lesser General Public
  2325. - License as published by the Free Software Foundation; either
  2326. - version 2.1 of the License, or (at your option) any later version.
  2327. -
  2328. - The GNU C Library is distributed in the hope that it will be useful,
  2329. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  2330. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2331. - Lesser General Public License for more details.
  2332. -
  2333. - You should have received a copy of the GNU Lesser General Public
  2334. - License along with the GNU C Library; if not, see
  2335. - <http://www.gnu.org/licenses/>. */
  2336. -
  2337. -#include <asm/asi.h>
  2338. -#ifndef XCC
  2339. - .register %g2, #scratch
  2340. - .register %g3, #scratch
  2341. - .register %g6, #scratch
  2342. -#endif
  2343. -
  2344. - /* Normally, this uses
  2345. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  2346. - to find out if any byte in xword could be zero. This is fast, but
  2347. - also gives false alarm for any byte in range 0x81-0xff. It does
  2348. - not matter for correctness, as if this test tells us there could
  2349. - be some zero byte, we check it byte by byte, but if bytes with
  2350. - high bits set are common in the strings, then this will give poor
  2351. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  2352. - will use one tick slower, but more precise test
  2353. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  2354. - which does not give any false alarms (but if some bits are set,
  2355. - one cannot assume from it which bytes are zero and which are not).
  2356. - It is yet to be measured, what is the correct default for glibc
  2357. - in these days for an average user.
  2358. - */
  2359. -
  2360. - .text
  2361. - .align 32
  2362. -ENTRY(stpcpy)
  2363. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  2364. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  2365. - andcc %o0, 7, %g0 /* IEU1 */
  2366. - sllx %g1, 32, %g2 /* IEU0 Group */
  2367. -
  2368. - bne,pn %icc, 12f /* CTI */
  2369. - andcc %o1, 7, %g3 /* IEU1 */
  2370. - or %g1, %g2, %g1 /* IEU0 Group */
  2371. - bne,pn %icc, 14f /* CTI */
  2372. -
  2373. - sllx %g1, 7, %g2 /* IEU0 Group */
  2374. -1: ldx [%o1], %o3 /* Load */
  2375. - add %o1, 8, %o1 /* IEU1 */
  2376. -2: mov %o3, %g3 /* IEU0 Group */
  2377. -
  2378. - sub %o3, %g1, %o2 /* IEU1 */
  2379. -3: ldxa [%o1] ASI_PNF, %o3 /* Load */
  2380. -#ifdef EIGHTBIT_NOT_RARE
  2381. - andn %o2, %g3, %o2 /* IEU0 Group */
  2382. -#endif
  2383. - add %o0, 8, %o0 /* IEU0 Group */
  2384. - andcc %o2, %g2, %g0 /* IEU1 */
  2385. -
  2386. - add %o1, 8, %o1 /* IEU0 Group */
  2387. - be,a,pt %xcc, 2b /* CTI */
  2388. - stx %g3, [%o0 - 8] /* Store */
  2389. - srlx %g3, 56, %g5 /* IEU0 Group */
  2390. -
  2391. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2392. - be,pn %icc, 11f /* CTI */
  2393. - srlx %g3, 48, %g4 /* IEU0 */
  2394. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2395. -
  2396. - be,pn %icc, 10f /* CTI */
  2397. - srlx %g3, 40, %g5 /* IEU0 */
  2398. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2399. - be,pn %icc, 9f /* CTI */
  2400. -
  2401. - srlx %g3, 32, %g4 /* IEU0 */
  2402. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2403. - be,pn %icc, 8f /* CTI */
  2404. - srlx %g3, 24, %g5 /* IEU0 */
  2405. -
  2406. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2407. - be,pn %icc, 7f /* CTI */
  2408. - srlx %g3, 16, %g4 /* IEU0 */
  2409. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2410. -
  2411. - be,pn %icc, 6f /* CTI */
  2412. - srlx %g3, 8, %g5 /* IEU0 */
  2413. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2414. - be,pn %icc, 5f /* CTI */
  2415. -
  2416. - sub %o3, %g1, %o2 /* IEU0 */
  2417. - stx %g3, [%o0 - 8] /* Store Group */
  2418. - andcc %g3, 0xff, %g0 /* IEU1 */
  2419. - bne,pt %icc, 3b /* CTI */
  2420. -
  2421. - mov %o3, %g3 /* IEU0 Group */
  2422. -4: retl /* CTI+IEU1 Group */
  2423. - sub %o0, 1, %o0 /* IEU0 */
  2424. -
  2425. - .align 16
  2426. -6: ba,pt %xcc, 23f /* CTI Group */
  2427. - sub %o0, 3, %g6 /* IEU0 */
  2428. -5: sub %o0, 2, %g6 /* IEU0 Group */
  2429. - stb %g5, [%o0 - 2] /* Store */
  2430. -
  2431. - srlx %g3, 16, %g4 /* IEU0 Group */
  2432. -23: sth %g4, [%o0 - 4] /* Store */
  2433. - srlx %g3, 32, %g4 /* IEU0 Group */
  2434. - stw %g4, [%o0 - 8] /* Store */
  2435. -
  2436. - retl /* CTI+IEU1 Group */
  2437. - mov %g6, %o0 /* IEU0 */
  2438. -8: ba,pt %xcc, 24f /* CTI Group */
  2439. - sub %o0, 5, %g6 /* IEU0 */
  2440. -
  2441. -7: sub %o0, 4, %g6 /* IEU0 Group */
  2442. - stb %g5, [%o0 - 4] /* Store */
  2443. - srlx %g3, 32, %g4 /* IEU0 Group */
  2444. -24: stw %g4, [%o0 - 8] /* Store */
  2445. -
  2446. - retl /* CTI+IEU1 Group */
  2447. - mov %g6, %o0 /* IEU0 */
  2448. -10: ba,pt %xcc, 25f /* CTI Group */
  2449. - sub %o0, 7, %g6 /* IEU0 */
  2450. -
  2451. -9: sub %o0, 6, %g6 /* IEU0 Group */
  2452. - stb %g5, [%o0 - 6] /* Store */
  2453. - srlx %g3, 48, %g4 /* IEU0 */
  2454. -25: sth %g4, [%o0 - 8] /* Store Group */
  2455. -
  2456. - retl /* CTI+IEU1 Group */
  2457. - mov %g6, %o0 /* IEU0 */
  2458. -11: stb %g5, [%o0 - 8] /* Store Group */
  2459. - retl /* CTI+IEU1 Group */
  2460. -
  2461. - sub %o0, 8, %o0 /* IEU0 */
  2462. -
  2463. - .align 16
  2464. -12: or %g1, %g2, %g1 /* IEU0 Group */
  2465. - ldub [%o1], %o3 /* Load */
  2466. - sllx %g1, 7, %g2 /* IEU0 Group */
  2467. - stb %o3, [%o0] /* Store Group */
  2468. -
  2469. -13: add %o0, 1, %o0 /* IEU0 */
  2470. - add %o1, 1, %o1 /* IEU1 */
  2471. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  2472. - be,pn %icc, 4b /* CTI */
  2473. -
  2474. - lduba [%o1] ASI_PNF, %o3 /* Load */
  2475. - andcc %o0, 7, %g0 /* IEU1 Group */
  2476. - bne,a,pt %icc, 13b /* CTI */
  2477. - stb %o3, [%o0] /* Store */
  2478. -
  2479. - andcc %o1, 7, %g3 /* IEU1 Group */
  2480. - be,a,pt %icc, 1b /* CTI */
  2481. - ldx [%o1], %o3 /* Load */
  2482. -14: orcc %g0, 64, %g4 /* IEU1 Group */
  2483. -
  2484. - sllx %g3, 3, %g5 /* IEU0 */
  2485. - sub %o1, %g3, %o1 /* IEU0 Group */
  2486. - sub %g4, %g5, %g4 /* IEU1 */
  2487. - /* %g1 = 0101010101010101 *
  2488. - * %g2 = 8080808080808080 *
  2489. - * %g3 = source alignment *
  2490. - * %g5 = number of bits to shift left *
  2491. - * %g4 = number of bits to shift right */
  2492. - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
  2493. -
  2494. - addcc %o1, 8, %o1 /* IEU1 */
  2495. -15: sllx %o5, %g5, %o3 /* IEU0 Group */
  2496. - ldxa [%o1] ASI_PNF, %o5 /* Load */
  2497. - srlx %o5, %g4, %o4 /* IEU0 Group */
  2498. -
  2499. - add %o0, 8, %o0 /* IEU1 */
  2500. - or %o3, %o4, %o3 /* IEU0 Group */
  2501. - add %o1, 8, %o1 /* IEU1 */
  2502. - sub %o3, %g1, %o4 /* IEU0 Group */
  2503. -
  2504. -#ifdef EIGHTBIT_NOT_RARE
  2505. - andn %o4, %o3, %o4 /* IEU0 Group */
  2506. -#endif
  2507. - andcc %o4, %g2, %g0 /* IEU1 Group */
  2508. - be,a,pt %xcc, 15b /* CTI */
  2509. - stx %o3, [%o0 - 8] /* Store */
  2510. - srlx %o3, 56, %o4 /* IEU0 Group */
  2511. -
  2512. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2513. - be,pn %icc, 22f /* CTI */
  2514. - srlx %o3, 48, %o4 /* IEU0 */
  2515. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2516. -
  2517. - be,pn %icc, 21f /* CTI */
  2518. - srlx %o3, 40, %o4 /* IEU0 */
  2519. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2520. - be,pn %icc, 20f /* CTI */
  2521. -
  2522. - srlx %o3, 32, %o4 /* IEU0 */
  2523. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2524. - be,pn %icc, 19f /* CTI */
  2525. - srlx %o3, 24, %o4 /* IEU0 */
  2526. -
  2527. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2528. - be,pn %icc, 18f /* CTI */
  2529. - srlx %o3, 16, %o4 /* IEU0 */
  2530. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2531. -
  2532. - be,pn %icc, 17f /* CTI */
  2533. - srlx %o3, 8, %o4 /* IEU0 */
  2534. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2535. - be,pn %icc, 16f /* CTI */
  2536. -
  2537. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  2538. - bne,pn %icc, 15b /* CTI */
  2539. - stx %o3, [%o0 - 8] /* Store */
  2540. - retl /* CTI+IEU1 Group */
  2541. -
  2542. - sub %o0, 1, %o0 /* IEU0 */
  2543. -
  2544. - .align 16
  2545. -17: ba,pt %xcc, 26f /* CTI Group */
  2546. - subcc %o0, 3, %g6 /* IEU1 */
  2547. -18: ba,pt %xcc, 27f /* CTI Group */
  2548. - subcc %o0, 4, %g6 /* IEU1 */
  2549. -
  2550. -19: ba,pt %xcc, 28f /* CTI Group */
  2551. - subcc %o0, 5, %g6 /* IEU1 */
  2552. -16: subcc %o0, 2, %g6 /* IEU1 Group */
  2553. - srlx %o3, 8, %o4 /* IEU0 */
  2554. -
  2555. - stb %o4, [%o0 - 2] /* Store */
  2556. -26: srlx %o3, 16, %o4 /* IEU0 Group */
  2557. - stb %o4, [%o0 - 3] /* Store */
  2558. -27: srlx %o3, 24, %o4 /* IEU0 Group */
  2559. -
  2560. - stb %o4, [%o0 - 4] /* Store */
  2561. -28: srlx %o3, 32, %o4 /* IEU0 Group */
  2562. - stw %o4, [%o0 - 8] /* Store */
  2563. - retl /* CTI+IEU1 Group */
  2564. -
  2565. - mov %g6, %o0 /* IEU0 */
  2566. -
  2567. - .align 16
  2568. -21: ba,pt %xcc, 29f /* CTI Group */
  2569. - subcc %o0, 7, %g6 /* IEU1 */
  2570. -22: ba,pt %xcc, 30f /* CTI Group */
  2571. - subcc %o0, 8, %g6 /* IEU1 */
  2572. -
  2573. -20: subcc %o0, 6, %g6 /* IEU1 Group */
  2574. - srlx %o3, 40, %o4 /* IEU0 */
  2575. - stb %o4, [%o0 - 6] /* Store */
  2576. -29: srlx %o3, 48, %o4 /* IEU0 Group */
  2577. -
  2578. - stb %o4, [%o0 - 7] /* Store */
  2579. -30: srlx %o3, 56, %o4 /* IEU0 Group */
  2580. - stb %o4, [%o0 - 8] /* Store */
  2581. - retl /* CTI+IEU1 Group */
  2582. -
  2583. - mov %g6, %o0 /* IEU0 */
  2584. -END(stpcpy)
  2585. -libc_hidden_def(stpcpy)
  2586. diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
  2587. deleted file mode 100644
  2588. index 56725cc..0000000
  2589. --- a/libc/string/sparc/sparc64/strcat.S
  2590. +++ /dev/null
  2591. @@ -1,338 +0,0 @@
  2592. -/* strcat (dest, src) -- Append SRC on the end of DEST.
  2593. - For SPARC v9.
  2594. - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
  2595. - This file is part of the GNU C Library.
  2596. - Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
  2597. - Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
  2598. -
  2599. - The GNU C Library is free software; you can redistribute it and/or
  2600. - modify it under the terms of the GNU Lesser General Public
  2601. - License as published by the Free Software Foundation; either
  2602. - version 2.1 of the License, or (at your option) any later version.
  2603. -
  2604. - The GNU C Library is distributed in the hope that it will be useful,
  2605. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  2606. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2607. - Lesser General Public License for more details.
  2608. -
  2609. - You should have received a copy of the GNU Lesser General Public
  2610. - License along with the GNU C Library; if not, see
  2611. - <http://www.gnu.org/licenses/>. */
  2612. -
  2613. -#include <asm/asi.h>
  2614. -#ifndef XCC
  2615. -#define XCC xcc
  2616. -#define USE_BPR
  2617. - .register %g2, #scratch
  2618. - .register %g3, #scratch
  2619. - .register %g6, #scratch
  2620. -#endif
  2621. -
  2622. - /* Normally, this uses
  2623. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  2624. - to find out if any byte in xword could be zero. This is fast, but
  2625. - also gives false alarm for any byte in range 0x81-0xff. It does
  2626. - not matter for correctness, as if this test tells us there could
  2627. - be some zero byte, we check it byte by byte, but if bytes with
  2628. - high bits set are common in the strings, then this will give poor
  2629. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  2630. - will use one tick slower, but more precise test
  2631. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  2632. - which does not give any false alarms (but if some bits are set,
  2633. - one cannot assume from it which bytes are zero and which are not).
  2634. - It is yet to be measured, what is the correct default for glibc
  2635. - in these days for an average user.
  2636. - */
  2637. -
  2638. - .text
  2639. - .align 32
  2640. -ENTRY(strcat)
  2641. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  2642. - ldub [%o0], %o3 /* Load */
  2643. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  2644. - mov %o0, %g6 /* IEU1 */
  2645. -
  2646. - sllx %g1, 32, %g2 /* IEU0 Group */
  2647. - andcc %o0, 7, %g0 /* IEU1 */
  2648. - or %g1, %g2, %g1 /* IEU0 Group */
  2649. - bne,pn %icc, 32f /* CTI */
  2650. -
  2651. - sllx %g1, 7, %g2 /* IEU0 Group */
  2652. - brz,pn %o3, 30f /* CTI+IEU1 */
  2653. - ldx [%o0], %o3 /* Load */
  2654. -48: add %o0, 8, %o0 /* IEU0 Group */
  2655. -
  2656. -49: sub %o3, %g1, %o2 /* IEU0 Group */
  2657. -#ifdef EIGHTBIT_NOT_RARE
  2658. - andn %o2, %o3, %g5 /* IEU0 Group */
  2659. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  2660. - andcc %g5, %g2, %g0 /* IEU1 Group */
  2661. -#else
  2662. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  2663. - andcc %o2, %g2, %g0 /* IEU1 Group */
  2664. -#endif
  2665. - be,pt %xcc, 49b /* CTI */
  2666. -
  2667. - add %o0, 8, %o0 /* IEU0 */
  2668. - addcc %o2, %g1, %g3 /* IEU1 Group */
  2669. - srlx %o2, 32, %o2 /* IEU0 */
  2670. -50: andcc %o2, %g2, %g0 /* IEU1 Group */
  2671. -
  2672. - be,pn %xcc, 51f /* CTI */
  2673. - srlx %g3, 56, %o2 /* IEU0 */
  2674. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2675. - be,pn %icc, 29f /* CTI */
  2676. -
  2677. - srlx %g3, 48, %o2 /* IEU0 */
  2678. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2679. - be,pn %icc, 28f /* CTI */
  2680. - srlx %g3, 40, %o2 /* IEU0 */
  2681. -
  2682. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2683. - be,pn %icc, 27f /* CTI */
  2684. - srlx %g3, 32, %o2 /* IEU0 */
  2685. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2686. -
  2687. - be,pn %icc, 26f /* CTI */
  2688. -51: srlx %g3, 24, %o2 /* IEU0 */
  2689. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2690. - be,pn %icc, 25f /* CTI */
  2691. -
  2692. - srlx %g3, 16, %o2 /* IEU0 */
  2693. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2694. - be,pn %icc, 24f /* CTI */
  2695. - srlx %g3, 8, %o2 /* IEU0 */
  2696. -
  2697. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  2698. - be,pn %icc, 23f /* CTI */
  2699. - sub %o3, %g1, %o2 /* IEU0 */
  2700. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  2701. -
  2702. - be,pn %icc, 52f /* CTI */
  2703. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  2704. - andcc %o2, %g2, %g0 /* IEU1 Group */
  2705. - be,pt %xcc, 49b /* CTI */
  2706. -
  2707. - add %o0, 8, %o0 /* IEU0 */
  2708. - addcc %o2, %g1, %g3 /* IEU1 Group */
  2709. - ba,pt %xcc, 50b /* CTI */
  2710. - srlx %o2, 32, %o2 /* IEU0 */
  2711. -
  2712. - .align 16
  2713. -52: ba,pt %xcc, 12f /* CTI Group */
  2714. - add %o0, -9, %o0 /* IEU0 */
  2715. -23: ba,pt %xcc, 12f /* CTI Group */
  2716. - add %o0, -10, %o0 /* IEU0 */
  2717. -
  2718. -24: ba,pt %xcc, 12f /* CTI Group */
  2719. - add %o0, -11, %o0 /* IEU0 */
  2720. -25: ba,pt %xcc, 12f /* CTI Group */
  2721. - add %o0, -12, %o0 /* IEU0 */
  2722. -
  2723. -26: ba,pt %xcc, 12f /* CTI Group */
  2724. - add %o0, -13, %o0 /* IEU0 */
  2725. -27: ba,pt %xcc, 12f /* CTI Group */
  2726. - add %o0, -14, %o0 /* IEU0 */
  2727. -
  2728. -28: ba,pt %xcc, 12f /* CTI Group */
  2729. - add %o0, -15, %o0 /* IEU0 */
  2730. -29: add %o0, -16, %o0 /* IEU0 Group */
  2731. -30: andcc %o1, 7, %g3 /* IEU1 */
  2732. -
  2733. -31: bne,pn %icc, 14f /* CTI */
  2734. - orcc %g0, 64, %g4 /* IEU1 Group */
  2735. -1: ldx [%o1], %o3 /* Load */
  2736. - add %o1, 8, %o1 /* IEU1 */
  2737. -
  2738. -2: mov %o3, %g3 /* IEU0 Group */
  2739. -3: sub %o3, %g1, %o2 /* IEU1 */
  2740. - ldxa [%o1] ASI_PNF, %o3 /* Load */
  2741. -#ifdef EIGHTBIT_NOT_RARE
  2742. - andn %o2, %g3, %o2 /* IEU0 Group */
  2743. -#endif
  2744. - add %o0, 8, %o0 /* IEU0 Group */
  2745. -
  2746. - andcc %o2, %g2, %g0 /* IEU1 */
  2747. - add %o1, 8, %o1 /* IEU0 Group */
  2748. - be,a,pt %xcc, 2b /* CTI */
  2749. - stx %g3, [%o0 - 8] /* Store */
  2750. -
  2751. - srlx %g3, 56, %g5 /* IEU0 Group */
  2752. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2753. - be,pn %icc, 11f /* CTI */
  2754. - srlx %g3, 48, %g4 /* IEU0 */
  2755. -
  2756. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2757. - be,pn %icc, 10f /* CTI */
  2758. - srlx %g3, 40, %g5 /* IEU0 */
  2759. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2760. -
  2761. - be,pn %icc, 9f /* CTI */
  2762. - srlx %g3, 32, %g4 /* IEU0 */
  2763. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2764. - be,pn %icc, 8f /* CTI */
  2765. -
  2766. - srlx %g3, 24, %g5 /* IEU0 */
  2767. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2768. - be,pn %icc, 7f /* CTI */
  2769. - srlx %g3, 16, %g4 /* IEU0 */
  2770. -
  2771. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  2772. - be,pn %icc, 6f /* CTI */
  2773. - srlx %g3, 8, %g5 /* IEU0 */
  2774. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  2775. -
  2776. - be,pn %icc, 5f /* CTI */
  2777. - sub %o3, %g1, %o2 /* IEU0 */
  2778. - stx %g3, [%o0 - 8] /* Store Group */
  2779. - andcc %g3, 0xff, %g0 /* IEU1 */
  2780. -
  2781. - bne,pt %icc, 3b /* CTI */
  2782. - mov %o3, %g3 /* IEU0 Group */
  2783. -4: retl /* CTI+IEU1 Group */
  2784. - mov %g6, %o0 /* IEU0 */
  2785. -
  2786. - .align 16
  2787. -5: stb %g5, [%o0 - 2] /* Store Group */
  2788. - srlx %g3, 16, %g4 /* IEU0 */
  2789. -6: sth %g4, [%o0 - 4] /* Store Group */
  2790. - srlx %g3, 32, %g4 /* IEU0 */
  2791. -
  2792. - stw %g4, [%o0 - 8] /* Store Group */
  2793. - retl /* CTI+IEU1 Group */
  2794. - mov %g6, %o0 /* IEU0 */
  2795. -7: stb %g5, [%o0 - 4] /* Store Group */
  2796. -
  2797. - srlx %g3, 32, %g4 /* IEU0 */
  2798. -8: stw %g4, [%o0 - 8] /* Store Group */
  2799. - retl /* CTI+IEU1 Group */
  2800. - mov %g6, %o0 /* IEU0 */
  2801. -
  2802. -9: stb %g5, [%o0 - 6] /* Store Group */
  2803. - srlx %g3, 48, %g4 /* IEU0 */
  2804. -10: sth %g4, [%o0 - 8] /* Store Group */
  2805. - retl /* CTI+IEU1 Group */
  2806. -
  2807. - mov %g6, %o0 /* IEU0 */
  2808. -11: stb %g5, [%o0 - 8] /* Store Group */
  2809. - retl /* CTI+IEU1 Group */
  2810. - mov %g6, %o0 /* IEU0 */
  2811. -
  2812. - .align 16
  2813. -32: andcc %o0, 7, %g0 /* IEU1 Group */
  2814. - be,a,pn %icc, 48b /* CTI */
  2815. - ldx [%o0], %o3 /* Load */
  2816. - add %o0, 1, %o0 /* IEU0 Group */
  2817. -
  2818. - brnz,a,pt %o3, 32b /* CTI+IEU1 */
  2819. - lduba [%o0] ASI_PNF, %o3 /* Load */
  2820. - add %o0, -1, %o0 /* IEU0 Group */
  2821. - andcc %o0, 7, %g0 /* IEU1 Group */
  2822. -
  2823. - be,a,pn %icc, 31b /* CTI */
  2824. - andcc %o1, 7, %g3 /* IEU1 Group */
  2825. -12: ldub [%o1], %o3 /* Load */
  2826. - stb %o3, [%o0] /* Store Group */
  2827. -
  2828. -13: add %o0, 1, %o0 /* IEU0 */
  2829. - add %o1, 1, %o1 /* IEU1 */
  2830. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  2831. - be,pn %icc, 4b /* CTI */
  2832. -
  2833. - lduba [%o1] ASI_PNF, %o3 /* Load */
  2834. - andcc %o0, 7, %g0 /* IEU1 Group */
  2835. - bne,a,pt %icc, 13b /* CTI */
  2836. - stb %o3, [%o0] /* Store */
  2837. -
  2838. - andcc %o1, 7, %g3 /* IEU1 Group */
  2839. - be,a,pt %icc, 1b /* CTI */
  2840. - ldx [%o1], %o3 /* Load */
  2841. - orcc %g0, 64, %g4 /* IEU1 Group */
  2842. -
  2843. -14: sllx %g3, 3, %g5 /* IEU0 */
  2844. - sub %o1, %g3, %o1 /* IEU0 Group */
  2845. - sub %g4, %g5, %g4 /* IEU1 */
  2846. - /* %g1 = 0101010101010101 *
  2847. - * %g2 = 8080808080808080 *
  2848. - * %g3 = source alignment *
  2849. - * %g5 = number of bits to shift left *
  2850. - * %g4 = number of bits to shift right */
  2851. - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
  2852. -
  2853. - addcc %o1, 8, %o1 /* IEU1 */
  2854. -15: sllx %o5, %g5, %o3 /* IEU0 Group */
  2855. - ldxa [%o1] ASI_PNF, %o5 /* Load */
  2856. - srlx %o5, %g4, %o4 /* IEU0 Group */
  2857. -
  2858. - add %o0, 8, %o0 /* IEU1 */
  2859. - or %o3, %o4, %o3 /* IEU0 Group */
  2860. - add %o1, 8, %o1 /* IEU1 */
  2861. - sub %o3, %g1, %o4 /* IEU0 Group */
  2862. -
  2863. -#ifdef EIGHTBIT_NOT_RARE
  2864. - andn %o4, %o3, %o4 /* IEU0 Group */
  2865. -#endif
  2866. - andcc %o4, %g2, %g0 /* IEU1 Group */
  2867. - be,a,pt %xcc, 15b /* CTI */
  2868. - stx %o3, [%o0 - 8] /* Store */
  2869. - srlx %o3, 56, %o4 /* IEU0 Group */
  2870. -
  2871. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2872. - be,pn %icc, 22f /* CTI */
  2873. - srlx %o3, 48, %o4 /* IEU0 */
  2874. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2875. -
  2876. - be,pn %icc, 21f /* CTI */
  2877. - srlx %o3, 40, %o4 /* IEU0 */
  2878. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2879. - be,pn %icc, 20f /* CTI */
  2880. -
  2881. - srlx %o3, 32, %o4 /* IEU0 */
  2882. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2883. - be,pn %icc, 19f /* CTI */
  2884. - srlx %o3, 24, %o4 /* IEU0 */
  2885. -
  2886. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2887. - be,pn %icc, 18f /* CTI */
  2888. - srlx %o3, 16, %o4 /* IEU0 */
  2889. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2890. -
  2891. - be,pn %icc, 17f /* CTI */
  2892. - srlx %o3, 8, %o4 /* IEU0 */
  2893. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  2894. - be,pn %icc, 16f /* CTI */
  2895. -
  2896. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  2897. - bne,pn %icc, 15b /* CTI */
  2898. - stx %o3, [%o0 - 8] /* Store */
  2899. - retl /* CTI+IEU1 Group */
  2900. -
  2901. - mov %g6, %o0 /* IEU0 */
  2902. -
  2903. - .align 16
  2904. -16: srlx %o3, 8, %o4 /* IEU0 Group */
  2905. - stb %o4, [%o0 - 2] /* Store */
  2906. -17: srlx %o3, 16, %o4 /* IEU0 Group */
  2907. - stb %o4, [%o0 - 3] /* Store */
  2908. -
  2909. -18: srlx %o3, 24, %o4 /* IEU0 Group */
  2910. - stb %o4, [%o0 - 4] /* Store */
  2911. -19: srlx %o3, 32, %o4 /* IEU0 Group */
  2912. - stw %o4, [%o0 - 8] /* Store */
  2913. -
  2914. - retl /* CTI+IEU1 Group */
  2915. - mov %g6, %o0 /* IEU0 */
  2916. - nop
  2917. - nop
  2918. -
  2919. -20: srlx %o3, 40, %o4 /* IEU0 Group */
  2920. - stb %o4, [%o0 - 6] /* Store */
  2921. -21: srlx %o3, 48, %o4 /* IEU0 Group */
  2922. - stb %o4, [%o0 - 7] /* Store */
  2923. -
  2924. -22: srlx %o3, 56, %o4 /* IEU0 Group */
  2925. - stb %o4, [%o0 - 8] /* Store */
  2926. - retl /* CTI+IEU1 Group */
  2927. - mov %g6, %o0 /* IEU0 */
  2928. -END(strcat)
  2929. -libc_hidden_def(strcat)
  2930. diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
  2931. deleted file mode 100644
  2932. index 25810fd..0000000
  2933. --- a/libc/string/sparc/sparc64/strchr.S
  2934. +++ /dev/null
  2935. @@ -1,485 +0,0 @@
  2936. -/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
  2937. - For SPARC v9.
  2938. - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
  2939. - This file is part of the GNU C Library.
  2940. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  2941. - Jakub Jelinek <jj@ultra.linux.cz>.
  2942. -
  2943. - The GNU C Library is free software; you can redistribute it and/or
  2944. - modify it under the terms of the GNU Lesser General Public
  2945. - License as published by the Free Software Foundation; either
  2946. - version 2.1 of the License, or (at your option) any later version.
  2947. -
  2948. - The GNU C Library is distributed in the hope that it will be useful,
  2949. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  2950. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2951. - Lesser General Public License for more details.
  2952. -
  2953. - You should have received a copy of the GNU Lesser General Public
  2954. - License along with the GNU C Library; if not, see
  2955. - <http://www.gnu.org/licenses/>. */
  2956. -
  2957. -#include <features.h>
  2958. -#include <asm/asi.h>
  2959. -#ifndef XCC
  2960. -#define XCC xcc
  2961. -#define USE_BPR
  2962. - .register %g2, #scratch
  2963. - .register %g3, #scratch
  2964. - .register %g6, #scratch
  2965. -#endif
  2966. -
  2967. - /* Normally, this uses
  2968. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  2969. - to find out if any byte in xword could be zero. This is fast, but
  2970. - also gives false alarm for any byte in range 0x81-0xff. It does
  2971. - not matter for correctness, as if this test tells us there could
  2972. - be some zero byte, we check it byte by byte, but if bytes with
  2973. - high bits set are common in the strings, then this will give poor
  2974. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  2975. - will use one tick slower, but more precise test
  2976. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  2977. - which does not give any false alarms (but if some bits are set,
  2978. - one cannot assume from it which bytes are zero and which are not).
  2979. - It is yet to be measured, what is the correct default for glibc
  2980. - in these days for an average user.
  2981. - */
  2982. -
  2983. - .text
  2984. - .align 32
  2985. -ENTRY(strchr)
  2986. - andcc %o1, 0xff, %o1 /* IEU1 Group */
  2987. - be,pn %icc, 17f /* CTI */
  2988. - sllx %o1, 8, %g3 /* IEU0 Group */
  2989. - sethi %hi(0x01010101), %g1 /* IEU1 */
  2990. -
  2991. - or %g3, %o1, %g3 /* IEU0 Group */
  2992. - ldub [%o0], %o3 /* Load */
  2993. - sllx %g3, 16, %g5 /* IEU0 Group */
  2994. - or %g1, %lo(0x01010101), %g1 /* IEU1 */
  2995. -
  2996. - sllx %g1, 32, %g2 /* IEU0 Group */
  2997. - brz,pn %o3, 5f /* CTI+IEU1 */
  2998. - orcc %g3, %g5, %g3 /* IEU1 Group */
  2999. - sllx %g3, 32, %g5 /* IEU0 */
  3000. -
  3001. - cmp %o3, %o1 /* IEU1 Group */
  3002. - be,pn %xcc, 14f /* CTI */
  3003. - or %g1, %g2, %g1 /* IEU0 */
  3004. - andcc %o0, 7, %g0 /* IEU1 Group */
  3005. -
  3006. - bne,a,pn %icc, 15f /* CTI */
  3007. - add %o0, 1, %o0 /* IEU0 */
  3008. - ldx [%o0], %o3 /* Load Group */
  3009. -1: sllx %g1, 7, %g2 /* IEU0 */
  3010. -
  3011. - or %g3, %g5, %g3 /* IEU1 */
  3012. - add %o0, 8, %o0 /* IEU0 Group */
  3013. - xor %o3, %g3, %o4 /* IEU1 */
  3014. - /* %g1 = 0101010101010101 *
  3015. - * %g2 = 8080088080808080 *
  3016. - * %g3 = c c c c c c c c *
  3017. - * %o3 = value *
  3018. - * %o4 = value XOR c */
  3019. -2: sub %o3, %g1, %o2 /* IEU0 Group */
  3020. -
  3021. - sub %o4, %g1, %o5 /* IEU1 */
  3022. -#ifdef EIGHTBIT_NOT_RARE
  3023. - andn %o2, %o3, %g6 /* IEU0 Group */
  3024. - andn %o5, %o4, %o5 /* IEU1 */
  3025. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3026. - or %o5, %g6, %o5 /* IEU0 Group */
  3027. -#else
  3028. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3029. - or %o5, %o2, %o5 /* IEU0 Group */
  3030. -#endif
  3031. - add %o0, 8, %o0 /* IEU1 */
  3032. -
  3033. - andcc %o5, %g2, %g0 /* IEU1 Group */
  3034. - be,a,pt %xcc, 2b /* CTI */
  3035. - xor %o3, %g3, %o4 /* IEU0 */
  3036. - srlx %o5, 32, %g5 /* IEU0 Group */
  3037. -
  3038. - add %o2, %g1, %o2 /* IEU1 */
  3039. -3: andcc %g5, %g2, %g0 /* IEU1 Group */
  3040. - be,pn %xcc, 4f /* CTI */
  3041. - srlx %o2, 56, %g5 /* IEU0 */
  3042. -
  3043. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3044. - be,pn %icc, 5f /* CTI */
  3045. - srlx %o4, 56, %g5 /* IEU0 */
  3046. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3047. -
  3048. - be,pn %icc, 6f /* CTI */
  3049. - srlx %o2, 48, %g5 /* IEU0 */
  3050. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3051. - be,pn %icc, 5f /* CTI */
  3052. -
  3053. - srlx %o4, 48, %g5 /* IEU0 */
  3054. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3055. - be,pn %icc, 7f /* CTI */
  3056. - srlx %o2, 40, %g5 /* IEU0 */
  3057. -
  3058. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3059. - be,pn %icc, 5f /* CTI */
  3060. - srlx %o4, 40, %g5 /* IEU0 */
  3061. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3062. -
  3063. - be,pn %icc, 8f /* CTI */
  3064. - srlx %o2, 32, %g5 /* IEU0 */
  3065. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3066. - be,pn %icc, 5f /* CTI */
  3067. -
  3068. - srlx %o4, 32, %g5 /* IEU0 */
  3069. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3070. - be,pn %icc, 9f /* CTI */
  3071. -4: srlx %o2, 24, %g5 /* IEU0 */
  3072. -
  3073. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3074. - be,pn %icc, 5f /* CTI */
  3075. - srlx %o4, 24, %g5 /* IEU0 */
  3076. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3077. -
  3078. - be,pn %icc, 10f /* CTI */
  3079. - srlx %o2, 16, %g5 /* IEU0 */
  3080. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3081. - be,pn %icc, 5f /* CTI */
  3082. -
  3083. - srlx %o4, 16, %g5 /* IEU0 */
  3084. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3085. - be,pn %icc, 11f /* CTI */
  3086. - srlx %o2, 8, %g5 /* IEU0 */
  3087. -
  3088. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3089. - be,pn %icc, 5f /* CTI */
  3090. - srlx %o4, 8, %g5 /* IEU0 */
  3091. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3092. -
  3093. - be,pn %icc, 12f /* CTI */
  3094. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3095. - be,pn %icc, 5f /* CTI */
  3096. - sub %o3, %g1, %o2 /* IEU0 */
  3097. -
  3098. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3099. - be,pn %icc, 13f /* CTI */
  3100. - xor %o3, %g3, %o4 /* IEU0 */
  3101. - ldxa [%o0] ASI_PNF, %o3 /* Load Group */
  3102. -
  3103. - sub %o4, %g1, %o5 /* IEU0 */
  3104. - or %o5, %o2, %o5 /* IEU1 */
  3105. - add %o0, 8, %o0 /* IEU0 Group */
  3106. - andcc %o5, %g2, %g0 /* IEU1 */
  3107. -
  3108. - be,a,pt %xcc, 2b /* CTI */
  3109. - xor %o3, %g3, %o4 /* IEU0 Group */
  3110. - srlx %o5, 32, %g5 /* IEU0 Group */
  3111. - ba,pt %xcc, 3b /* CTI */
  3112. -
  3113. - add %o2, %g1, %o2 /* IEU1 */
  3114. -
  3115. - .align 16
  3116. -5: retl /* CTI+IEU1 Group */
  3117. - clr %o0 /* IEU0 */
  3118. -6: retl /* CTI+IEU1 Group */
  3119. - add %o0, -16, %o0 /* IEU0 */
  3120. -
  3121. -7: retl /* CTI+IEU1 Group */
  3122. - add %o0, -15, %o0 /* IEU0 */
  3123. -8: retl /* CTI+IEU1 Group */
  3124. - add %o0, -14, %o0 /* IEU0 */
  3125. -
  3126. -9: retl /* CTI+IEU1 Group */
  3127. - add %o0, -13, %o0 /* IEU0 */
  3128. -10: retl /* CTI+IEU1 Group */
  3129. - add %o0, -12, %o0 /* IEU0 */
  3130. -
  3131. -11: retl /* CTI+IEU1 Group */
  3132. - add %o0, -11, %o0 /* IEU0 */
  3133. -12: retl /* CTI+IEU1 Group */
  3134. - add %o0, -10, %o0 /* IEU0 */
  3135. -
  3136. -13: retl /* CTI+IEU1 Group */
  3137. - add %o0, -9, %o0 /* IEU0 */
  3138. -14: retl /* CTI+IEU1 Group */
  3139. - nop /* IEU0 */
  3140. -
  3141. - .align 16
  3142. -15: ldub [%o0], %o3 /* Load Group */
  3143. -16: andcc %o0, 7, %g0 /* IEU1 */
  3144. - be,a,pn %icc, 1b /* CTI */
  3145. - ldx [%o0], %o3 /* Load Group */
  3146. -
  3147. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  3148. - be,pn %icc, 5b /* CTI */
  3149. - add %o0, 1, %o0 /* IEU0 */
  3150. - cmp %o3, %o1 /* IEU1 Group */
  3151. -
  3152. - bne,a,pn %icc, 16b /* CTI */
  3153. - ldub [%o0], %o3 /* Load */
  3154. - retl /* CTI+IEU1 Group */
  3155. - add %o0, -1, %o0 /* IEU0 */
  3156. -
  3157. - /* strchr (str, 0) */
  3158. - .align 32
  3159. - nop
  3160. - .align 16
  3161. -17: sethi %hi(0x01010101), %g1 /* IEU0 Group */
  3162. - ldub [%o0], %o3 /* Load */
  3163. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  3164. - sllx %g1, 32, %g2 /* IEU0 Group */
  3165. -
  3166. - andcc %o0, 7, %g0 /* IEU1 */
  3167. - or %g1, %g2, %g1 /* IEU0 Group */
  3168. - bne,pn %icc, 32f /* CTI */
  3169. - sllx %g1, 7, %g2 /* IEU0 Group */
  3170. -
  3171. - brz,pn %o3, 30f /* CTI+IEU1 */
  3172. - ldx [%o0], %o3 /* Load */
  3173. -18: add %o0, 8, %o0 /* IEU0 Group */
  3174. -19: sub %o3, %g1, %o2 /* IEU0 Group */
  3175. -
  3176. -#ifdef EIGHTBIT_NOT_RARE
  3177. - andn %o2, %o3, %g6 /* IEU0 Group */
  3178. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3179. - andcc %g6, %g2, %g0 /* IEU1 Group */
  3180. -#else
  3181. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3182. - andcc %o2, %g2, %g0 /* IEU1 Group */
  3183. -#endif
  3184. - be,pt %xcc, 19b /* CTI */
  3185. - add %o0, 8, %o0 /* IEU0 */
  3186. -
  3187. - addcc %o2, %g1, %g3 /* IEU1 Group */
  3188. - srlx %o2, 32, %o2 /* IEU0 */
  3189. -20: andcc %o2, %g2, %g0 /* IEU1 Group */
  3190. - be,pn %xcc, 21f /* CTI */
  3191. -
  3192. - srlx %g3, 56, %o2 /* IEU0 */
  3193. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3194. - be,pn %icc, 29f /* CTI */
  3195. - srlx %g3, 48, %o2 /* IEU0 */
  3196. -
  3197. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3198. - be,pn %icc, 28f /* CTI */
  3199. - srlx %g3, 40, %o2 /* IEU0 */
  3200. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3201. -
  3202. - be,pn %icc, 27f /* CTI */
  3203. - srlx %g3, 32, %o2 /* IEU0 */
  3204. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3205. - be,pn %icc, 26f /* CTI */
  3206. -
  3207. -21: srlx %g3, 24, %o2 /* IEU0 */
  3208. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3209. - be,pn %icc, 25f /* CTI */
  3210. - srlx %g3, 16, %o2 /* IEU0 */
  3211. -
  3212. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3213. - be,pn %icc, 24f /* CTI */
  3214. - srlx %g3, 8, %o2 /* IEU0 */
  3215. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3216. -
  3217. - be,pn %icc, 23f /* CTI */
  3218. - sub %o3, %g1, %o2 /* IEU0 */
  3219. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3220. - be,pn %icc, 22f /* CTI */
  3221. -
  3222. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3223. - andcc %o2, %g2, %g0 /* IEU1 Group */
  3224. - be,pt %xcc, 19b /* CTI */
  3225. - add %o0, 8, %o0 /* IEU0 */
  3226. -
  3227. - addcc %o2, %g1, %g3 /* IEU1 Group */
  3228. - ba,pt %xcc, 20b /* CTI */
  3229. - srlx %o2, 32, %o2 /* IEU0 */
  3230. -
  3231. - .align 16
  3232. -22: retl /* CTI+IEU1 Group */
  3233. - add %o0, -9, %o0 /* IEU0 */
  3234. -23: retl /* CTI+IEU1 Group */
  3235. - add %o0, -10, %o0 /* IEU0 */
  3236. -
  3237. -24: retl /* CTI+IEU1 Group */
  3238. - add %o0, -11, %o0 /* IEU0 */
  3239. -25: retl /* CTI+IEU1 Group */
  3240. - add %o0, -12, %o0 /* IEU0 */
  3241. -
  3242. -26: retl /* CTI+IEU1 Group */
  3243. - add %o0, -13, %o0 /* IEU0 */
  3244. -27: retl /* CTI+IEU1 Group */
  3245. - add %o0, -14, %o0 /* IEU0 */
  3246. -
  3247. -28: retl /* CTI+IEU1 Group */
  3248. - add %o0, -15, %o0 /* IEU0 */
  3249. -29: retl /* CTI+IEU1 Group */
  3250. - add %o0, -16, %o0 /* IEU0 */
  3251. -
  3252. -30: retl /* CTI+IEU1 Group */
  3253. - nop /* IEU0 */
  3254. -
  3255. - .align 16
  3256. -32: andcc %o0, 7, %g0 /* IEU1 Group */
  3257. - be,a,pn %icc, 18b /* CTI */
  3258. - ldx [%o0], %o3 /* Load */
  3259. - add %o0, 1, %o0 /* IEU0 Group */
  3260. -
  3261. - brnz,a,pt %o3, 32b /* CTI+IEU1 */
  3262. - lduba [%o0] ASI_PNF, %o3 /* Load */
  3263. - retl /* CTI+IEU1 Group */
  3264. - add %o0, -1, %o0 /* IEU0 */
  3265. -END(strchr)
  3266. -libc_hidden_def(strchr)
  3267. -#ifdef __UCLIBC_SUSV3_LEGACY__
  3268. -strong_alias(strchr,index)
  3269. -#endif
  3270. -
  3271. - .align 32
  3272. -ENTRY(strrchr)
  3273. - andcc %o1, 0xff, %o1 /* IEU1 Group */
  3274. - be,pn %icc, 17b /* CTI */
  3275. - clr %g4 /* IEU0 */
  3276. - andcc %o0, 7, %g0 /* IEU1 Group */
  3277. -
  3278. - bne,pn %icc, 13f /* CTI */
  3279. - sllx %o1, 8, %g3 /* IEU0 */
  3280. - ldx [%o0], %o3 /* Load Group */
  3281. -1: sethi %hi(0x01010101), %g1 /* IEU0 */
  3282. -
  3283. - or %g3, %o1, %g3 /* IEU1 */
  3284. - sllx %g3, 16, %g5 /* IEU0 Group */
  3285. - or %g1, %lo(0x01010101), %g1 /* IEU1 */
  3286. - sllx %g1, 32, %g2 /* IEU0 Group */
  3287. -
  3288. - or %g3, %g5, %g3 /* IEU1 */
  3289. - sllx %g3, 32, %g5 /* IEU0 Group */
  3290. - or %g1, %g2, %g1 /* IEU1 */
  3291. - sllx %g1, 7, %g2 /* IEU0 Group */
  3292. -
  3293. - or %g3, %g5, %g3 /* IEU1 */
  3294. - add %o0, 8, %o0 /* IEU0 Group */
  3295. - xor %o3, %g3, %o4 /* IEU1 */
  3296. - /* %g1 = 0101010101010101 *
  3297. - * %g2 = 8080088080808080 *
  3298. - * %g3 = c c c c c c c c *
  3299. - * %o3 = value *
  3300. - * %o4 = value XOR c */
  3301. -2: sub %o3, %g1, %o2 /* IEU0 Group */
  3302. -
  3303. -3: sub %o4, %g1, %o5 /* IEU1 */
  3304. -#ifdef EIGHTBIT_NOT_RARE
  3305. - andn %o2, %o3, %g6 /* IEU0 Group */
  3306. - andn %o5, %o4, %o5 /* IEU1 */
  3307. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3308. -
  3309. - or %o5, %g6, %o5 /* IEU0 Group */
  3310. -#else
  3311. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  3312. -
  3313. - or %o5, %o2, %o5 /* IEU0 Group */
  3314. -#endif
  3315. - add %o0, 8, %o0 /* IEU1 */
  3316. - andcc %o5, %g2, %g0 /* IEU1 Group */
  3317. - be,a,pt %xcc, 2b /* CTI */
  3318. -
  3319. - xor %o3, %g3, %o4 /* IEU0 */
  3320. - srlx %o5, 32, %g5 /* IEU0 Group */
  3321. - add %o2, %g1, %o2 /* IEU1 */
  3322. - andcc %g5, %g2, %g0 /* IEU1 Group */
  3323. -
  3324. - be,pn %xcc, 7f /* CTI */
  3325. - srlx %o2, 56, %g5 /* IEU0 */
  3326. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3327. - be,pn %icc, 12f /* CTI */
  3328. -
  3329. - srlx %o4, 56, %g5 /* IEU0 */
  3330. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3331. - srlx %o2, 48, %g5 /* IEU0 */
  3332. - be,a,pn %icc, 4f /* CTI */
  3333. -
  3334. - add %o0, -16, %g4 /* IEU0 Group */
  3335. -4: andcc %g5, 0xff, %g0 /* IEU1 Group */
  3336. - be,pn %icc, 12f /* CTI */
  3337. - srlx %o4, 48, %g5 /* IEU0 */
  3338. -
  3339. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3340. - srlx %o2, 40, %g5 /* IEU0 */
  3341. - be,a,pn %icc, 5f /* CTI */
  3342. - add %o0, -15, %g4 /* IEU0 Group */
  3343. -
  3344. -5: andcc %g5, 0xff, %g0 /* IEU1 Group */
  3345. - be,pn %icc, 12f /* CTI */
  3346. - srlx %o4, 40, %g5 /* IEU0 */
  3347. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3348. -
  3349. - srlx %o2, 32, %g5 /* IEU0 */
  3350. - be,a,pn %icc, 6f /* CTI */
  3351. - add %o0, -14, %g4 /* IEU0 Group */
  3352. -6: andcc %g5, 0xff, %g0 /* IEU1 Group */
  3353. -
  3354. - be,pn %icc, 12f /* CTI */
  3355. - srlx %o4, 32, %g5 /* IEU0 */
  3356. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3357. - be,a,pn %icc, 7f /* CTI */
  3358. -
  3359. - add %o0, -13, %g4 /* IEU0 */
  3360. -7: srlx %o2, 24, %g5 /* IEU0 */
  3361. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3362. - be,pn %icc, 12f /* CTI */
  3363. -
  3364. - srlx %o4, 24, %g5 /* IEU0 */
  3365. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3366. - srlx %o2, 16, %g5 /* IEU0 */
  3367. - be,a,pn %icc, 8f /* CTI */
  3368. -
  3369. - add %o0, -12, %g4 /* IEU0 Group */
  3370. -8: andcc %g5, 0xff, %g0 /* IEU1 Group */
  3371. - be,pn %icc, 12f /* CTI */
  3372. - srlx %o4, 16, %g5 /* IEU0 */
  3373. -
  3374. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3375. - srlx %o2, 8, %g5 /* IEU0 */
  3376. - be,a,pn %icc, 9f /* CTI */
  3377. - add %o0, -11, %g4 /* IEU0 Group */
  3378. -
  3379. -9: andcc %g5, 0xff, %g0 /* IEU1 Group */
  3380. - be,pn %icc, 12f /* CTI */
  3381. - srlx %o4, 8, %g5 /* IEU0 */
  3382. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3383. -
  3384. - be,a,pn %icc, 10f /* CTI */
  3385. - add %o0, -10, %g4 /* IEU0 */
  3386. -10: andcc %o2, 0xff, %g0 /* IEU1 Group */
  3387. - be,pn %icc, 12f /* CTI */
  3388. -
  3389. - sub %o3, %g1, %o2 /* IEU0 */
  3390. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3391. - be,a,pn %icc, 11f /* CTI */
  3392. - add %o0, -9, %g4 /* IEU0 */
  3393. -
  3394. -11: ba,pt %xcc, 3b /* CTI Group */
  3395. - xor %o3, %g3, %o4 /* IEU0 Group */
  3396. -12: retl /* CTI+IEU1 Group */
  3397. - mov %g4, %o0 /* IEU0 */
  3398. -
  3399. - .align 16
  3400. -13: ldub [%o0], %o3 /* Load Group */
  3401. - add %o0, 1, %o0 /* IEU0 */
  3402. -14: andcc %o3, 0xff, %g0 /* IEU1 Group */
  3403. - be,pn %icc, 12b /* CTI */
  3404. -
  3405. - cmp %o3, %o1 /* IEU1 Group */
  3406. - ldub [%o0], %o3 /* Load */
  3407. - be,a,pn %icc, 15f /* CTI */
  3408. - add %o0, -1, %g4 /* IEU0 Group */
  3409. -
  3410. -15: andcc %o0, 7, %g0 /* IEU1 Group */
  3411. - bne,a,pt %icc, 14b /* CTI */
  3412. - add %o0, 1, %o0 /* IEU0 */
  3413. - ba,pt %xcc, 1b /* CTI Group */
  3414. -
  3415. - ldx [%o0], %o3 /* Load */
  3416. -END(strrchr)
  3417. -libc_hidden_def(strrchr)
  3418. -#ifdef __UCLIBC_SUSV3_LEGACY__
  3419. -strong_alias(strrchr,rindex)
  3420. -#endif
  3421. diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
  3422. deleted file mode 100644
  3423. index 7b85007..0000000
  3424. --- a/libc/string/sparc/sparc64/strcmp.S
  3425. +++ /dev/null
  3426. @@ -1,278 +0,0 @@
  3427. -/* Compare two strings for differences.
  3428. - For SPARC v9.
  3429. - Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
  3430. - This file is part of the GNU C Library.
  3431. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  3432. - Jakub Jelinek <jj@ultra.linux.cz>.
  3433. -
  3434. - The GNU C Library is free software; you can redistribute it and/or
  3435. - modify it under the terms of the GNU Lesser General Public
  3436. - License as published by the Free Software Foundation; either
  3437. - version 2.1 of the License, or (at your option) any later version.
  3438. -
  3439. - The GNU C Library is distributed in the hope that it will be useful,
  3440. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  3441. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3442. - Lesser General Public License for more details.
  3443. -
  3444. - You should have received a copy of the GNU Lesser General Public
  3445. - License along with the GNU C Library; if not, see
  3446. - <http://www.gnu.org/licenses/>. */
  3447. -
  3448. -#include <asm/asi.h>
  3449. -#ifndef XCC
  3450. - .register %g2, #scratch
  3451. - .register %g3, #scratch
  3452. - .register %g6, #scratch
  3453. -#endif
  3454. -
  3455. - /* Normally, this uses
  3456. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  3457. - to find out if any byte in xword could be zero. This is fast, but
  3458. - also gives false alarm for any byte in range 0x81-0xff. It does
  3459. - not matter for correctness, as if this test tells us there could
  3460. - be some zero byte, we check it byte by byte, but if bytes with
  3461. - high bits set are common in the strings, then this will give poor
  3462. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  3463. - will use one tick slower, but more precise test
  3464. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  3465. - which does not give any false alarms (but if some bits are set,
  3466. - one cannot assume from it which bytes are zero and which are not).
  3467. - It is yet to be measured, what is the correct default for glibc
  3468. - in these days for an average user.
  3469. - */
  3470. -
  3471. - .text
  3472. - .align 32
  3473. -ENTRY(strcmp)
  3474. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  3475. - andcc %o0, 7, %g0 /* IEU1 */
  3476. - bne,pn %icc, 7f /* CTI */
  3477. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  3478. -
  3479. - andcc %o1, 7, %g3 /* IEU1 */
  3480. - bne,pn %icc, 9f /* CTI */
  3481. - sllx %g1, 32, %g2 /* IEU0 Group */
  3482. - ldx [%o0], %o2 /* Load */
  3483. -
  3484. - or %g1, %g2, %g1 /* IEU0 Group */
  3485. -1: ldx [%o1], %o3 /* Load */
  3486. - sub %o1, %o0, %o1 /* IEU1 */
  3487. - sllx %g1, 7, %g2 /* IEU0 Group */
  3488. -
  3489. -2: add %o0, 8, %o0 /* IEU1 */
  3490. - sub %o2, %g1, %g3 /* IEU0 Group */
  3491. - subcc %o2, %o3, %g0 /* IEU1 */
  3492. - bne,pn %xcc, 13f /* CTI */
  3493. -
  3494. -#ifdef EIGHTBIT_NOT_RARE
  3495. - andn %g3, %o2, %g4 /* IEU0 Group */
  3496. - ldxa [%o0] ASI_PNF, %o2 /* Load */
  3497. - andcc %g4, %g2, %g0 /* IEU1 Group */
  3498. -#else
  3499. - ldxa [%o0] ASI_PNF, %o2 /* Load Group */
  3500. - andcc %g3, %g2, %g0 /* IEU1 */
  3501. -#endif
  3502. - be,a,pt %xcc, 2b /* CTI */
  3503. - ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load Group */
  3504. -
  3505. - addcc %g3, %g1, %o4 /* IEU1 */
  3506. - srlx %g3, 32, %g3 /* IEU0 */
  3507. - andcc %g3, %g2, %g0 /* IEU1 Group */
  3508. - be,pt %xcc, 3f /* CTI */
  3509. -
  3510. - srlx %o4, 56, %o5 /* IEU0 */
  3511. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3512. - be,pn %icc, 4f /* CTI */
  3513. - srlx %o4, 48, %o5 /* IEU0 */
  3514. -
  3515. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3516. - be,pn %icc, 4f /* CTI */
  3517. - srlx %o4, 40, %o5 /* IEU0 */
  3518. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3519. -
  3520. - be,pn %icc, 4f /* CTI */
  3521. - srlx %o4, 32, %o5 /* IEU0 */
  3522. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3523. - be,pn %icc, 4f /* CTI */
  3524. -
  3525. -3: srlx %o4, 24, %o5 /* IEU0 */
  3526. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3527. - be,pn %icc, 4f /* CTI */
  3528. - srlx %o4, 16, %o5 /* IEU0 */
  3529. -
  3530. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3531. - be,pn %icc, 4f /* CTI */
  3532. - srlx %o4, 8, %o5 /* IEU0 */
  3533. - andcc %o5, 0xff, %g0 /* IEU1 Group */
  3534. -
  3535. - be,pn %icc, 4f /* CTI */
  3536. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3537. - bne,a,pn %icc, 2b /* CTI */
  3538. - ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load */
  3539. -
  3540. -4: retl /* CTI+IEU1 Group */
  3541. - clr %o0 /* IEU0 */
  3542. -
  3543. - .align 32
  3544. -13: mov 0xff, %g6 /* IEU0 Group */
  3545. -#ifdef EIGHTBIT_NOT_RARE
  3546. - andcc %g4, %g2, %g0 /* IEU1 */
  3547. -#else
  3548. - andcc %g3, %g2, %g0 /* IEU1 */
  3549. -#endif
  3550. - be,pt %xcc, 25f /* CTI */
  3551. - addcc %g3, %g1, %o4 /* IEU1 Group */
  3552. -
  3553. - srlx %g3, 32, %g3 /* IEU0 */
  3554. - andcc %g3, %g2, %g0 /* IEU1 Group */
  3555. - be,pt %xcc, 23f /* CTI */
  3556. - sllx %g6, 56, %o5 /* IEU0 */
  3557. -
  3558. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3559. - be,pn %xcc, 24f /* CTI */
  3560. - sllx %g6, 48, %o5 /* IEU0 */
  3561. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3562. -
  3563. - be,pn %xcc, 24f /* CTI */
  3564. - sllx %g6, 40, %o5 /* IEU0 */
  3565. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3566. - be,pn %xcc, 24f /* CTI */
  3567. -
  3568. - sllx %g6, 32, %o5 /* IEU0 */
  3569. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3570. - be,pn %xcc, 24f /* CTI */
  3571. -23: sllx %g6, 24, %o5 /* IEU0 */
  3572. -
  3573. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3574. - be,pn %icc, 24f /* CTI */
  3575. - sllx %g6, 16, %o5 /* IEU0 */
  3576. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3577. -
  3578. - be,pn %icc, 24f /* CTI */
  3579. - sllx %g6, 8, %o5 /* IEU0 */
  3580. - andcc %o4, %o5, %g0 /* IEU1 Group */
  3581. - be,pn %icc, 24f /* CTI */
  3582. -
  3583. - mov %g6, %o5 /* IEU0 */
  3584. -25: cmp %o4, %o3 /* IEU1 Group */
  3585. -5: mov -1, %o0 /* IEU0 */
  3586. - retl /* CTI+IEU1 Group */
  3587. -
  3588. - movgu %xcc, 1, %o0 /* Single Group */
  3589. -
  3590. - .align 16
  3591. -24: sub %o5, 1, %g6 /* IEU0 Group */
  3592. - clr %o0 /* IEU1 */
  3593. - or %o5, %g6, %o5 /* IEU0 Group */
  3594. - andn %o4, %o5, %o4 /* IEU0 Group */
  3595. -
  3596. - andn %o3, %o5, %o3 /* IEU1 */
  3597. - cmp %o4, %o3 /* IEU1 Group */
  3598. - movgu %xcc, 1, %o0 /* Single Group */
  3599. - retl /* CTI+IEU1 Group */
  3600. -
  3601. - movlu %xcc, -1, %o0 /* Single Group */
  3602. -6: retl /* CTI+IEU1 Group */
  3603. - mov %o4, %o0 /* IEU0 */
  3604. -
  3605. - .align 16
  3606. -7: ldub [%o0], %o2 /* Load */
  3607. - add %o0, 1, %o0 /* IEU1 */
  3608. - ldub [%o1], %o3 /* Load Group */
  3609. - sllx %g1, 32, %g2 /* IEU0 */
  3610. -
  3611. -8: add %o1, 1, %o1 /* IEU1 */
  3612. - subcc %o2, %o3, %o4 /* IEU1 Group */
  3613. - bne,pn %xcc, 6b /* CTI */
  3614. - lduba [%o0] ASI_PNF, %o2 /* Load */
  3615. -
  3616. - brz,pn %o3, 4b /* CTI+IEU1 Group */
  3617. - lduba [%o1] ASI_PNF, %o3 /* Load */
  3618. - andcc %o0, 7, %g0 /* IEU1 Group */
  3619. - bne,a,pn %icc, 8b /* CTI */
  3620. -
  3621. - add %o0, 1, %o0 /* IEU0 */
  3622. - or %g1, %g2, %g1 /* IEU0 Group */
  3623. - andcc %o1, 7, %g3 /* IEU1 */
  3624. - be,a,pn %icc, 1b /* CTI */
  3625. -
  3626. - ldxa [%o0] ASI_PNF, %o2 /* Load Group */
  3627. -9: sllx %g3, 3, %g5 /* IEU0 */
  3628. - mov 64, %o5 /* IEU1 */
  3629. - sub %o1, %g3, %o1 /* IEU0 Group */
  3630. -
  3631. - sub %o5, %g5, %o5 /* IEU1 */
  3632. - ldxa [%o1] ASI_PNF, %g6 /* Load Group */
  3633. - or %g1, %g2, %g1 /* IEU0 */
  3634. - sub %o1, %o0, %o1 /* IEU1 */
  3635. -
  3636. - sllx %g1, 7, %g2 /* IEU0 Group */
  3637. - add %o1, 8, %o1 /* IEU1 */
  3638. - /* %g1 = 0101010101010101
  3639. - * %g2 = 8080808080800880
  3640. - * %g5 = number of bits to shift left
  3641. - * %o5 = number of bits to shift right */
  3642. -10: sllx %g6, %g5, %o3 /* IEU0 Group */
  3643. - ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
  3644. -
  3645. -11: srlx %g6, %o5, %o4 /* IEU0 Group */
  3646. - ldxa [%o0] ASI_PNF, %o2 /* Load */
  3647. - or %o3, %o4, %o3 /* IEU1 */
  3648. - add %o0, 8, %o0 /* IEU0 Group */
  3649. -
  3650. - subcc %o2, %o3, %g0 /* IEU1 */
  3651. -#ifdef EIGHTBIT_NOT_RARE
  3652. - sub %o2, %g1, %g3 /* IEU0 Group */
  3653. - bne,pn %xcc, 13b /* CTI */
  3654. - andn %g3, %o2, %g4 /* IEU0 Group */
  3655. -
  3656. - andcc %g4, %g2, %g0 /* IEU1 Group */
  3657. - be,pt %xcc, 10b /* CTI */
  3658. - srlx %g4, 32, %g4 /* IEU0 */
  3659. - andcc %g4, %g2, %g0 /* IEU1 Group */
  3660. -#else
  3661. - bne,pn %xcc, 13b /* CTI */
  3662. - sub %o2, %g1, %g3 /* IEU0 Group */
  3663. - andcc %g3, %g2, %g0 /* IEU1 Group */
  3664. -
  3665. - be,pt %xcc, 10b /* CTI */
  3666. - srlx %g3, 32, %g3 /* IEU0 */
  3667. - andcc %g3, %g2, %g0 /* IEU1 Group */
  3668. -#endif
  3669. - be,pt %xcc, 12f /* CTI */
  3670. -
  3671. - srlx %o2, 56, %g3 /* IEU0 */
  3672. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3673. - be,pn %icc, 4b /* CTI */
  3674. - srlx %o2, 48, %g3 /* IEU0 */
  3675. -
  3676. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3677. - be,pn %icc, 4b /* CTI */
  3678. - srlx %o2, 40, %g3 /* IEU0 */
  3679. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3680. -
  3681. - be,pn %icc, 4b /* CTI */
  3682. - srlx %o2, 32, %g3 /* IEU0 */
  3683. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3684. - be,pn %icc, 4b /* CTI */
  3685. -
  3686. -12: srlx %o2, 24, %g3 /* IEU0 */
  3687. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3688. - be,pn %icc, 4b /* CTI */
  3689. - srlx %o2, 16, %g3 /* IEU0 */
  3690. -
  3691. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3692. - be,pn %icc, 4b /* CTI */
  3693. - srlx %o2, 8, %g3 /* IEU0 */
  3694. - andcc %g3, 0xff, %g0 /* IEU1 Group */
  3695. -
  3696. - be,pn %icc, 4b /* CTI */
  3697. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  3698. - be,pn %icc, 4b /* CTI */
  3699. - sllx %g6, %g5, %o3 /* IEU0 */
  3700. -
  3701. - ba,pt %xcc, 11b /* CTI Group */
  3702. - ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
  3703. -END(strcmp)
  3704. -libc_hidden_def(strcmp)
  3705. diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
  3706. deleted file mode 100644
  3707. index 28799e4..0000000
  3708. --- a/libc/string/sparc/sparc64/strcpy.S
  3709. +++ /dev/null
  3710. @@ -1,244 +0,0 @@
  3711. -/* Copy SRC to DEST returning DEST.
  3712. - For SPARC v9.
  3713. - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
  3714. - This file is part of the GNU C Library.
  3715. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  3716. - Jakub Jelinek <jj@ultra.linux.cz>.
  3717. -
  3718. - The GNU C Library is free software; you can redistribute it and/or
  3719. - modify it under the terms of the GNU Lesser General Public
  3720. - License as published by the Free Software Foundation; either
  3721. - version 2.1 of the License, or (at your option) any later version.
  3722. -
  3723. - The GNU C Library is distributed in the hope that it will be useful,
  3724. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  3725. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3726. - Lesser General Public License for more details.
  3727. -
  3728. - You should have received a copy of the GNU Lesser General Public
  3729. - License along with the GNU C Library; if not, see
  3730. - <http://www.gnu.org/licenses/>. */
  3731. -
  3732. -#include <asm/asi.h>
  3733. -#ifndef XCC
  3734. - .register %g2, #scratch
  3735. - .register %g3, #scratch
  3736. - .register %g6, #scratch
  3737. -#endif
  3738. -
  3739. - /* Normally, this uses
  3740. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  3741. - to find out if any byte in xword could be zero. This is fast, but
  3742. - also gives false alarm for any byte in range 0x81-0xff. It does
  3743. - not matter for correctness, as if this test tells us there could
  3744. - be some zero byte, we check it byte by byte, but if bytes with
  3745. - high bits set are common in the strings, then this will give poor
  3746. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  3747. - will use one tick slower, but more precise test
  3748. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  3749. - which does not give any false alarms (but if some bits are set,
  3750. - one cannot assume from it which bytes are zero and which are not).
  3751. - It is yet to be measured, what is the correct default for glibc
  3752. - in these days for an average user.
  3753. - */
  3754. -
  3755. - .text
  3756. - .align 32
  3757. -ENTRY(strcpy)
  3758. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  3759. - mov %o0, %g6 /* IEU1 */
  3760. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  3761. - andcc %o0, 7, %g0 /* IEU1 */
  3762. -
  3763. - sllx %g1, 32, %g2 /* IEU0 Group */
  3764. - bne,pn %icc, 12f /* CTI */
  3765. - andcc %o1, 7, %g3 /* IEU1 */
  3766. - or %g1, %g2, %g1 /* IEU0 Group */
  3767. -
  3768. - bne,pn %icc, 14f /* CTI */
  3769. - sllx %g1, 7, %g2 /* IEU0 Group */
  3770. -1: ldx [%o1], %o3 /* Load */
  3771. - add %o1, 8, %o1 /* IEU1 */
  3772. -
  3773. -2: mov %o3, %g3 /* IEU0 Group */
  3774. -3: sub %o3, %g1, %o2 /* IEU1 */
  3775. - ldxa [%o1] ASI_PNF, %o3 /* Load */
  3776. -#ifdef EIGHTBIT_NOT_RARE
  3777. - andn %o2, %g3, %o2 /* IEU0 Group */
  3778. -#endif
  3779. - add %o0, 8, %o0 /* IEU0 Group */
  3780. -
  3781. - andcc %o2, %g2, %g0 /* IEU1 */
  3782. - add %o1, 8, %o1 /* IEU0 Group */
  3783. - be,a,pt %xcc, 2b /* CTI */
  3784. - stx %g3, [%o0 - 8] /* Store */
  3785. -
  3786. - srlx %g3, 56, %g5 /* IEU0 Group */
  3787. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3788. - be,pn %icc, 11f /* CTI */
  3789. - srlx %g3, 48, %g4 /* IEU0 */
  3790. -
  3791. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  3792. - be,pn %icc, 10f /* CTI */
  3793. - srlx %g3, 40, %g5 /* IEU0 */
  3794. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3795. -
  3796. - be,pn %icc, 9f /* CTI */
  3797. - srlx %g3, 32, %g4 /* IEU0 */
  3798. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  3799. - be,pn %icc, 8f /* CTI */
  3800. -
  3801. - srlx %g3, 24, %g5 /* IEU0 */
  3802. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3803. - be,pn %icc, 7f /* CTI */
  3804. - srlx %g3, 16, %g4 /* IEU0 */
  3805. -
  3806. - andcc %g4, 0xff, %g0 /* IEU1 Group */
  3807. - be,pn %icc, 6f /* CTI */
  3808. - srlx %g3, 8, %g5 /* IEU0 */
  3809. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  3810. -
  3811. - be,pn %icc, 5f /* CTI */
  3812. - sub %o3, %g1, %o2 /* IEU0 */
  3813. - stx %g3, [%o0 - 8] /* Store Group */
  3814. - andcc %g3, 0xff, %g0 /* IEU1 */
  3815. -
  3816. - bne,pt %icc, 3b /* CTI */
  3817. - mov %o3, %g3 /* IEU0 Group */
  3818. -4: retl /* CTI+IEU1 Group */
  3819. - mov %g6, %o0 /* IEU0 */
  3820. -
  3821. - .align 16
  3822. -5: stb %g5, [%o0 - 2] /* Store Group */
  3823. - srlx %g3, 16, %g4 /* IEU0 */
  3824. -6: sth %g4, [%o0 - 4] /* Store Group */
  3825. - srlx %g3, 32, %g4 /* IEU0 */
  3826. -
  3827. - stw %g4, [%o0 - 8] /* Store Group */
  3828. - retl /* CTI+IEU1 Group */
  3829. - mov %g6, %o0 /* IEU0 */
  3830. -7: stb %g5, [%o0 - 4] /* Store Group */
  3831. -
  3832. - srlx %g3, 32, %g4 /* IEU0 */
  3833. -8: stw %g4, [%o0 - 8] /* Store Group */
  3834. - retl /* CTI+IEU1 Group */
  3835. - mov %g6, %o0 /* IEU0 */
  3836. -
  3837. -9: stb %g5, [%o0 - 6] /* Store Group */
  3838. - srlx %g3, 48, %g4 /* IEU0 */
  3839. -10: sth %g4, [%o0 - 8] /* Store Group */
  3840. - retl /* CTI+IEU1 Group */
  3841. -
  3842. - mov %g6, %o0 /* IEU0 */
  3843. -11: stb %g5, [%o0 - 8] /* Store Group */
  3844. - retl /* CTI+IEU1 Group */
  3845. - mov %g6, %o0 /* IEU0 */
  3846. -
  3847. -12: or %g1, %g2, %g1 /* IEU0 Group */
  3848. - ldub [%o1], %o3 /* Load */
  3849. - sllx %g1, 7, %g2 /* IEU0 Group */
  3850. - stb %o3, [%o0] /* Store Group */
  3851. -
  3852. -13: add %o0, 1, %o0 /* IEU0 */
  3853. - add %o1, 1, %o1 /* IEU1 */
  3854. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  3855. - be,pn %icc, 4b /* CTI */
  3856. -
  3857. - lduba [%o1] ASI_PNF, %o3 /* Load */
  3858. - andcc %o0, 7, %g0 /* IEU1 Group */
  3859. - bne,a,pt %icc, 13b /* CTI */
  3860. - stb %o3, [%o0] /* Store */
  3861. -
  3862. - andcc %o1, 7, %g3 /* IEU1 Group */
  3863. - be,a,pt %icc, 1b /* CTI */
  3864. - ldx [%o1], %o3 /* Load */
  3865. -14: orcc %g0, 64, %g4 /* IEU1 Group */
  3866. -
  3867. - sllx %g3, 3, %g5 /* IEU0 */
  3868. - sub %o1, %g3, %o1 /* IEU0 Group */
  3869. - sub %g4, %g5, %g4 /* IEU1 */
  3870. - /* %g1 = 0101010101010101 *
  3871. - * %g2 = 8080808080808080 *
  3872. - * %g3 = source alignment *
  3873. - * %g5 = number of bits to shift left *
  3874. - * %g4 = number of bits to shift right */
  3875. - ldxa [%o1] ASI_PNF, %o5 /* Load Group */
  3876. -
  3877. - addcc %o1, 8, %o1 /* IEU1 */
  3878. -15: sllx %o5, %g5, %o3 /* IEU0 Group */
  3879. - ldxa [%o1] ASI_PNF, %o5 /* Load */
  3880. - srlx %o5, %g4, %o4 /* IEU0 Group */
  3881. -
  3882. - add %o0, 8, %o0 /* IEU1 */
  3883. - or %o3, %o4, %o3 /* IEU0 Group */
  3884. - add %o1, 8, %o1 /* IEU1 */
  3885. - sub %o3, %g1, %o4 /* IEU0 Group */
  3886. -
  3887. -#ifdef EIGHTBIT_NOT_RARE
  3888. - andn %o4, %o3, %o4 /* IEU0 Group */
  3889. -#endif
  3890. - andcc %o4, %g2, %g0 /* IEU1 Group */
  3891. - be,a,pt %xcc, 15b /* CTI */
  3892. - stx %o3, [%o0 - 8] /* Store */
  3893. - srlx %o3, 56, %o4 /* IEU0 Group */
  3894. -
  3895. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3896. - be,pn %icc, 22f /* CTI */
  3897. - srlx %o3, 48, %o4 /* IEU0 */
  3898. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3899. -
  3900. - be,pn %icc, 21f /* CTI */
  3901. - srlx %o3, 40, %o4 /* IEU0 */
  3902. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3903. - be,pn %icc, 20f /* CTI */
  3904. -
  3905. - srlx %o3, 32, %o4 /* IEU0 */
  3906. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3907. - be,pn %icc, 19f /* CTI */
  3908. - srlx %o3, 24, %o4 /* IEU0 */
  3909. -
  3910. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3911. - be,pn %icc, 18f /* CTI */
  3912. - srlx %o3, 16, %o4 /* IEU0 */
  3913. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3914. -
  3915. - be,pn %icc, 17f /* CTI */
  3916. - srlx %o3, 8, %o4 /* IEU0 */
  3917. - andcc %o4, 0xff, %g0 /* IEU1 Group */
  3918. - be,pn %icc, 16f /* CTI */
  3919. -
  3920. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  3921. - bne,pn %icc, 15b /* CTI */
  3922. - stx %o3, [%o0 - 8] /* Store */
  3923. - retl /* CTI+IEU1 Group */
  3924. -
  3925. - mov %g6, %o0 /* IEU0 */
  3926. -
  3927. - .align 16
  3928. -16: srlx %o3, 8, %o4 /* IEU0 Group */
  3929. - stb %o4, [%o0 - 2] /* Store */
  3930. -17: srlx %o3, 16, %o4 /* IEU0 Group */
  3931. - stb %o4, [%o0 - 3] /* Store */
  3932. -
  3933. -18: srlx %o3, 24, %o4 /* IEU0 Group */
  3934. - stb %o4, [%o0 - 4] /* Store */
  3935. -19: srlx %o3, 32, %o4 /* IEU0 Group */
  3936. - stw %o4, [%o0 - 8] /* Store */
  3937. -
  3938. - retl /* CTI+IEU1 Group */
  3939. - mov %g6, %o0 /* IEU0 */
  3940. - nop
  3941. - nop
  3942. -
  3943. -20: srlx %o3, 40, %o4 /* IEU0 Group */
  3944. - stb %o4, [%o0 - 6] /* Store */
  3945. -21: srlx %o3, 48, %o4 /* IEU0 Group */
  3946. - stb %o4, [%o0 - 7] /* Store */
  3947. -
  3948. -22: srlx %o3, 56, %o4 /* IEU0 Group */
  3949. - stb %o4, [%o0 - 8] /* Store */
  3950. - retl /* CTI+IEU1 Group */
  3951. - mov %g6, %o0 /* IEU0 */
  3952. -END(strcpy)
  3953. -
  3954. -libc_hidden_def(strcpy)
  3955. diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
  3956. deleted file mode 100644
  3957. index f58c1c2..0000000
  3958. --- a/libc/string/sparc/sparc64/strlen.S
  3959. +++ /dev/null
  3960. @@ -1,172 +0,0 @@
  3961. -/* Determine the length of a string. For SPARC v9.
  3962. - Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
  3963. - This file is part of the GNU C Library.
  3964. - Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
  3965. - Jakub Jelinek <jj@ultra.linux.cz>.
  3966. -
  3967. - The GNU C Library is free software; you can redistribute it and/or
  3968. - modify it under the terms of the GNU Lesser General Public
  3969. - License as published by the Free Software Foundation; either
  3970. - version 2.1 of the License, or (at your option) any later version.
  3971. -
  3972. - The GNU C Library is distributed in the hope that it will be useful,
  3973. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  3974. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3975. - Lesser General Public License for more details.
  3976. -
  3977. - You should have received a copy of the GNU Lesser General Public
  3978. - License along with the GNU C Library; if not, see
  3979. - <http://www.gnu.org/licenses/>. */
  3980. -
  3981. -#include <asm/asi.h>
  3982. -
  3983. - /* Normally, this uses
  3984. - ((xword - 0x0101010101010101) & 0x8080808080808080) test
  3985. - to find out if any byte in xword could be zero. This is fast, but
  3986. - also gives false alarm for any byte in range 0x81-0xff. It does
  3987. - not matter for correctness, as if this test tells us there could
  3988. - be some zero byte, we check it byte by byte, but if bytes with
  3989. - high bits set are common in the strings, then this will give poor
  3990. - performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
  3991. - will use one tick slower, but more precise test
  3992. - ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
  3993. - which does not give any false alarms (but if some bits are set,
  3994. - one cannot assume from it which bytes are zero and which are not).
  3995. - It is yet to be measured, what is the correct default for glibc
  3996. - in these days for an average user.
  3997. - */
  3998. -
  3999. - .text
  4000. - .align 32
  4001. -ENTRY(strlen)
  4002. - sethi %hi(0x01010101), %g1 /* IEU0 Group */
  4003. - ldub [%o0], %o3 /* Load */
  4004. - or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
  4005. - mov %o0, %o1 /* IEU1 */
  4006. -
  4007. - sllx %g1, 32, %g4 /* IEU0 Group */
  4008. - andcc %o0, 7, %g0 /* IEU1 */
  4009. - or %g1, %g4, %g1 /* IEU0 Group */
  4010. - brz,pn %o3, 13f /* CTI+IEU1 */
  4011. -
  4012. - sllx %g1, 7, %g4 /* IEU0 Group */
  4013. - bne,a,pn %icc, 15f /* CTI */
  4014. - add %o0, 1, %o0 /* IEU1 */
  4015. - /* %g1 = 0x0101010101010101 *
  4016. - * %g4 = 0x8080808080808080 *
  4017. - * %o0 = string pointer *
  4018. - * %o1 = start of string */
  4019. -1: ldx [%o0], %o3 /* Load Group */
  4020. -
  4021. - add %o0, 8, %o0 /* IEU1 */
  4022. -2: sub %o3, %g1, %o2 /* IEU0 Group */
  4023. -#ifdef EIGHTBIT_NOT_RARE
  4024. - andn %o2, %o3, %o5 /* IEU0 Group */
  4025. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  4026. - andcc %o5, %g4, %g0 /* IEU1 Group */
  4027. -#else
  4028. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  4029. - andcc %o2, %g4, %g0 /* IEU1 Group */
  4030. -#endif
  4031. -
  4032. - be,pt %xcc, 2b /* CTI */
  4033. - add %o0, 8, %o0 /* IEU0 */
  4034. - addcc %o2, %g1, %g5 /* IEU1 Group */
  4035. -#ifdef EIGHTBIT_NOT_RARE
  4036. - srlx %o5, 32, %o5 /* IEU0 */
  4037. -
  4038. -3: andcc %o5, %g4, %g0 /* IEU1 Group */
  4039. -#else
  4040. - srlx %o2, 32, %o2 /* IEU0 */
  4041. -
  4042. -3: andcc %o2, %g4, %g0 /* IEU1 Group */
  4043. -#endif
  4044. - be,pn %xcc, 4f /* CTI */
  4045. - srlx %g5, 56, %o2 /* IEU0 */
  4046. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4047. -
  4048. - be,pn %icc, 12f /* CTI */
  4049. - srlx %g5, 48, %o2 /* IEU0 */
  4050. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4051. - be,pn %icc, 11f /* CTI */
  4052. -
  4053. - srlx %g5, 40, %o2 /* IEU0 */
  4054. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4055. - be,pn %icc, 10f /* CTI */
  4056. - srlx %g5, 32, %o2 /* IEU0 */
  4057. -
  4058. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4059. - be,pn %icc, 9f /* CTI */
  4060. -4: srlx %g5, 24, %o2 /* IEU0 */
  4061. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4062. -
  4063. - be,pn %icc, 8f /* CTI */
  4064. - srlx %g5, 16, %o2 /* IEU0 */
  4065. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4066. - be,pn %icc, 7f /* CTI */
  4067. -
  4068. - srlx %g5, 8, %o2 /* IEU0 */
  4069. - andcc %o2, 0xff, %g0 /* IEU1 Group */
  4070. - be,pn %icc, 6f /* CTI */
  4071. - sub %o3, %g1, %o2 /* IEU0 */
  4072. -
  4073. - andcc %g5, 0xff, %g0 /* IEU1 Group */
  4074. - be,pn %icc, 5f /* CTI */
  4075. - ldxa [%o0] ASI_PNF, %o3 /* Load */
  4076. - andcc %o2, %g4, %g0 /* IEU1 Group */
  4077. -
  4078. - be,pt %xcc, 2b /* CTI */
  4079. - add %o0, 8, %o0 /* IEU0 */
  4080. - addcc %o2, %g1, %g5 /* IEU1 Group */
  4081. - ba,pt %xcc, 3b /* CTI */
  4082. -
  4083. - srlx %o2, 32, %o2 /* IEU0 */
  4084. -5: add %o0, -9, %o0 /* IEU0 Group */
  4085. - retl /* CTI+IEU1 Group */
  4086. - sub %o0, %o1, %o0 /* IEU0 */
  4087. -
  4088. -6: add %o0, -10, %o0 /* IEU0 Group */
  4089. - retl /* CTI+IEU1 Group */
  4090. - sub %o0, %o1, %o0 /* IEU0 */
  4091. -7: add %o0, -11, %o0 /* IEU0 Group */
  4092. -
  4093. - retl /* CTI+IEU1 Group */
  4094. - sub %o0, %o1, %o0 /* IEU0 */
  4095. -8: add %o0, -12, %o0 /* IEU0 Group */
  4096. - retl /* CTI+IEU1 Group */
  4097. -
  4098. - sub %o0, %o1, %o0 /* IEU0 */
  4099. -9: add %o0, -13, %o0 /* IEU0 Group */
  4100. - retl /* CTI+IEU1 Group */
  4101. - sub %o0, %o1, %o0 /* IEU0 */
  4102. -
  4103. -10: add %o0, -14, %o0 /* IEU0 Group */
  4104. - retl /* CTI+IEU1 Group */
  4105. - sub %o0, %o1, %o0 /* IEU0 */
  4106. -11: add %o0, -15, %o0 /* IEU0 Group */
  4107. -
  4108. - retl /* CTI+IEU1 Group */
  4109. - sub %o0, %o1, %o0 /* IEU0 */
  4110. -12: add %o0, -16, %o0 /* IEU0 Group */
  4111. - retl /* CTI+IEU1 Group */
  4112. -
  4113. - sub %o0, %o1, %o0 /* IEU0 */
  4114. -13: retl /* CTI+IEU1 Group */
  4115. - mov 0, %o0 /* IEU0 */
  4116. - nop
  4117. -
  4118. -15: ldub [%o0], %o3 /* Load Group */
  4119. -16: andcc %o0, 7, %g0 /* IEU1 */
  4120. - be,pn %icc, 1b /* CTI */
  4121. - nop /* IEU0 Group */
  4122. -
  4123. - add %o0, 1, %o0 /* IEU1 */
  4124. - andcc %o3, 0xff, %g0 /* IEU1 Group */
  4125. - bne,a,pt %icc, 16b /* CTI */
  4126. - lduba [%o0] ASI_PNF, %o3 /* Load */
  4127. -
  4128. - add %o0, -1, %o0 /* IEU0 Group */
  4129. - retl /* CTI+IEU1 Group */
  4130. - sub %o0, %o1, %o0 /* IEU0 */
  4131. -END(strlen)
  4132. -libc_hidden_def(strlen)
  4133. diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h
  4134. index 5ec4da5..26f6212 100644
  4135. --- a/libc/sysdeps/linux/sparc/bits/setjmp.h
  4136. +++ b/libc/sysdeps/linux/sparc/bits/setjmp.h
  4137. @@ -25,37 +25,6 @@
  4138. #include <bits/wordsize.h>
  4139. -#if 0 /*__WORDSIZE == 64*/
  4140. -
  4141. -typedef struct __sparc64_jmp_buf
  4142. - {
  4143. - struct __sparc64_jmp_buf *uc_link;
  4144. - unsigned long uc_flags;
  4145. - unsigned long uc_sigmask;
  4146. - struct __sparc64_jmp_buf_mcontext
  4147. - {
  4148. - unsigned long mc_gregs[19];
  4149. - unsigned long mc_fp;
  4150. - unsigned long mc_i7;
  4151. - struct __sparc64_jmp_buf_fpu
  4152. - {
  4153. - union
  4154. - {
  4155. - unsigned int sregs[32];
  4156. - unsigned long dregs[32];
  4157. - long double qregs[16];
  4158. - } mcfpu_fpregs;
  4159. - unsigned long mcfpu_fprs;
  4160. - unsigned long mcfpu_gsr;
  4161. - void *mcfpu_fq;
  4162. - unsigned char mcfpu_qcnt;
  4163. - unsigned char mcfpu_qentsz;
  4164. - unsigned char mcfpu_enab;
  4165. - } mc_fpregs;
  4166. - } uc_mcontext;
  4167. - } __jmp_buf[1];
  4168. -#else
  4169. typedef int __jmp_buf[3];
  4170. -#endif
  4171. #endif /* bits/setjmp.h */
  4172. diff --git a/libc/sysdeps/linux/sparc/bits/sigcontext.h b/libc/sysdeps/linux/sparc/bits/sigcontext.h
  4173. index 9435485..251032f 100644
  4174. --- a/libc/sysdeps/linux/sparc/bits/sigcontext.h
  4175. +++ b/libc/sysdeps/linux/sparc/bits/sigcontext.h
  4176. @@ -21,8 +21,6 @@
  4177. #include <bits/wordsize.h>
  4178. -#if __WORDSIZE == 32
  4179. -
  4180. /* It is quite hard to choose what to put here, because
  4181. Linux/sparc32 had at least 3 totally incompatible
  4182. signal stack layouts.
  4183. @@ -42,36 +40,3 @@ struct sigcontext
  4184. int si_mask;
  4185. };
  4186. -#else /* sparc64 */
  4187. -
  4188. -typedef struct
  4189. - {
  4190. - unsigned int si_float_regs [64];
  4191. - unsigned long si_fsr;
  4192. - unsigned long si_gsr;
  4193. - unsigned long si_fprs;
  4194. - } __siginfo_fpu_t;
  4195. -
  4196. -struct sigcontext
  4197. - {
  4198. - char sigc_info[128];
  4199. - struct
  4200. - {
  4201. - unsigned long u_regs[16]; /* globals and ins */
  4202. - unsigned long tstate;
  4203. - unsigned long tpc;
  4204. - unsigned long tnpc;
  4205. - unsigned int y;
  4206. - unsigned int fprs;
  4207. - } sigc_regs;
  4208. - __siginfo_fpu_t * sigc_fpu_save;
  4209. - struct
  4210. - {
  4211. - void * ss_sp;
  4212. - int ss_flags;
  4213. - unsigned long ss_size;
  4214. - } sigc_stack;
  4215. - unsigned long sigc_mask;
  4216. -};
  4217. -
  4218. -#endif /* sparc64 */
  4219. diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S
  4220. index 25b5ee5..77e9147 100644
  4221. --- a/libc/sysdeps/linux/sparc/crt1.S
  4222. +++ b/libc/sysdeps/linux/sparc/crt1.S
  4223. @@ -39,16 +39,9 @@
  4224. #include <features.h>
  4225. #include <bits/wordsize.h>
  4226. -/* macro out the 32 / 64 bit differences */
  4227. -#if __WORDSIZE == 32
  4228. # define STACK_BIAS 0
  4229. # define ELE_SIZE 4
  4230. # define LD ld
  4231. -#else
  4232. -# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */
  4233. -# define ELE_SIZE 8
  4234. -# define LD ldx
  4235. -#endif
  4236. .text
  4237. .align 4
  4238. @@ -116,11 +109,7 @@ _start:
  4239. nop
  4240. /* Die very horribly if exit returns. */
  4241. -#if __WORDSIZE == 32
  4242. unimp
  4243. -#else
  4244. - illtrap 0
  4245. -#endif
  4246. .size _start,.-_start
  4247. diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
  4248. index 40303f0..eabfad8 100644
  4249. --- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
  4250. +++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
  4251. @@ -6,26 +6,8 @@
  4252. #include <setjmp.h>
  4253. #include <jmpbuf-offsets.h>
  4254. -#if __WORDSIZE == 64
  4255. -
  4256. -/* Test if longjmp to JMPBUF would unwind the frame
  4257. - containing a local variable at ADDRESS. */
  4258. -#define _JMPBUF_UNWINDS(jmpbuf, address) \
  4259. - ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
  4260. -
  4261. -#else
  4262. -
  4263. /* Test if longjmp to JMPBUF would unwind the frame
  4264. containing a local variable at ADDRESS. */
  4265. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  4266. ((int) (address) < (jmpbuf)[JB_SP])
  4267. -#endif
  4268. -
  4269. -#ifdef __UCLIBC_HAS_THREADS_NATIVE__
  4270. -#if defined(__arch64__)
  4271. -#include "sparc64/jmpbuf-unwind.h"
  4272. -#else
  4273. -#include "sparc32/jmpbuf-unwind.h"
  4274. -#endif
  4275. -#endif
  4276. diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c
  4277. index 123be53..97f98da 100644
  4278. --- a/libc/sysdeps/linux/sparc/qp_ops.c
  4279. +++ b/libc/sysdeps/linux/sparc/qp_ops.c
  4280. @@ -1,5 +1,3 @@
  4281. -/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
  4282. -
  4283. #include <stdio.h>
  4284. #include <stdlib.h>
  4285. @@ -9,11 +7,7 @@ static void fakedef(void)
  4286. exit(-1);
  4287. }
  4288. -#ifdef __sparc_v9__
  4289. -# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
  4290. -#else
  4291. # define fakedef(sym) strong_alias(fakedef, _Q_##sym)
  4292. -#endif
  4293. fakedef(fne)
  4294. fakedef(feq)
  4295. @@ -31,7 +25,6 @@ fakedef(qtos)
  4296. fakedef(stoq)
  4297. fakedef(itoq)
  4298. fakedef(add)
  4299. -#ifndef __sparc_v9__
  4300. fakedef(qtou)
  4301. fakedef(utoq)
  4302. fakedef(cmp)
  4303. @@ -44,4 +37,3 @@ fakedef(qtoll)
  4304. fakedef(qtoull)
  4305. fakedef(sqrt)
  4306. fakedef(ulltoq)
  4307. -#endif
  4308. diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S
  4309. deleted file mode 100644
  4310. index 2ee62a0..0000000
  4311. --- a/libc/sysdeps/linux/sparc/sparcv9/clone.S
  4312. +++ /dev/null
  4313. @@ -1,101 +0,0 @@
  4314. -/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
  4315. - This file is part of the GNU C Library.
  4316. - Contributed by Richard Henderson (rth@tamu.edu).
  4317. -
  4318. - The GNU C Library is free software; you can redistribute it and/or
  4319. - modify it under the terms of the GNU Lesser General Public
  4320. - License as published by the Free Software Foundation; either
  4321. - version 2.1 of the License, or (at your option) any later version.
  4322. -
  4323. - The GNU C Library is distributed in the hope that it will be useful,
  4324. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4325. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4326. - Lesser General Public License for more details.
  4327. -
  4328. - You should have received a copy of the GNU Lesser General Public
  4329. - License along with the GNU C Library; if not, see
  4330. - <http://www.gnu.org/licenses/>. */
  4331. -
  4332. -/* clone() is even more special than fork() as it mucks with stacks
  4333. - and invokes a function in the right context after its all over. */
  4334. -
  4335. -#include <asm/errno.h>
  4336. -#include <asm/unistd.h>
  4337. -#include <tcb-offsets.h>
  4338. -#include <sysdep.h>
  4339. -
  4340. -#define CLONE_VM 0x00000100
  4341. -#define CLONE_THREAD 0x00010000
  4342. -
  4343. -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
  4344. - pid_t *ptid, void *tls, pid_t *ctid); */
  4345. -
  4346. - .register %g2,#scratch
  4347. - .register %g3,#scratch
  4348. -
  4349. - .text
  4350. -
  4351. -ENTRY (__clone)
  4352. - save %sp, -192, %sp
  4353. - cfi_def_cfa_register(%fp)
  4354. - cfi_window_save
  4355. - cfi_register(%o7, %i7)
  4356. -
  4357. - /* sanity check arguments */
  4358. - brz,pn %i0, 99f /* fn non-NULL? */
  4359. - mov %i0, %g2
  4360. - brz,pn %i1, 99f /* child_stack non-NULL? */
  4361. - mov %i2, %o0 /* clone flags */
  4362. -
  4363. - /* The child_stack is the top of the stack, allocate one
  4364. - whole stack frame from that as this is what the kernel
  4365. - expects. Also, subtract STACK_BIAS. */
  4366. - sub %i1, 192 + 0x7ff, %o1
  4367. - mov %i3, %g3
  4368. - mov %i2, %g4
  4369. -
  4370. - mov %i4,%o2 /* PTID */
  4371. - mov %i5,%o3 /* TLS */
  4372. - ldx [%fp+0x7ff+176],%o4 /* CTID */
  4373. -
  4374. - /* Do the system call */
  4375. - set __NR_clone, %g1
  4376. - ta 0x6d
  4377. - bcs,pn %xcc, 98f
  4378. - nop
  4379. - brnz,pn %o1, __thread_start
  4380. - nop
  4381. - jmpl %i7 + 8, %g0
  4382. - restore %o0, %g0, %o0
  4383. -99: mov EINVAL, %o0
  4384. -98: call HIDDEN_JUMPTARGET(__errno_location)
  4385. - mov %o0, %i0
  4386. - st %i0, [%o0]
  4387. - jmpl %i7 + 8, %g0
  4388. - restore %g0,-1,%o0
  4389. -END(__clone)
  4390. -
  4391. - .type __thread_start,@function
  4392. -__thread_start:
  4393. -#ifdef RESET_PID
  4394. - sethi %hi(CLONE_THREAD), %l0
  4395. - andcc %g4, %l0, %g0
  4396. - bne,pt %icc, 1f
  4397. - andcc %g4, CLONE_VM, %g0
  4398. - bne,a,pn %icc, 2f
  4399. - mov -1,%o0
  4400. - set __NR_getpid,%g1
  4401. - ta 0x6d
  4402. -2: st %o0,[%g7 + PID]
  4403. - st %o0,[%g7 + TID]
  4404. -1:
  4405. -#endif
  4406. - mov %g0, %fp /* terminate backtrace */
  4407. - call %g2
  4408. - mov %g3,%o0
  4409. - call HIDDEN_JUMPTARGET(_exit),0
  4410. - nop
  4411. -
  4412. - .size __thread_start, .-__thread_start
  4413. -
  4414. -weak_alias (__clone, clone)
  4415. diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S
  4416. deleted file mode 100644
  4417. index 1474e32..0000000
  4418. --- a/libc/sysdeps/linux/sparc/sparcv9/rem.S
  4419. +++ /dev/null
  4420. @@ -1,20 +0,0 @@
  4421. -/*
  4422. - * Sparc v9 has divide.
  4423. - * As divx takes 68 cycles and sdivcc only 36,
  4424. - * we use sdivcc eventhough it is deprecated.
  4425. - */
  4426. -
  4427. - .text
  4428. - .align 32
  4429. -ENTRY(.rem)
  4430. -
  4431. - sra %o0, 31, %o2
  4432. - wr %o2, 0, %y
  4433. - sdivcc %o0, %o1, %o2
  4434. - xnor %o2, %g0, %o3
  4435. - movvs %icc, %o3, %o2
  4436. - smul %o2, %o1, %o2
  4437. - retl
  4438. - sub %o0, %o2, %o0
  4439. -
  4440. -END(.rem)
  4441. diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
  4442. deleted file mode 100644
  4443. index 45535bb..0000000
  4444. --- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
  4445. +++ /dev/null
  4446. @@ -1,18 +0,0 @@
  4447. -/*
  4448. - * Sparc v9 has divide.
  4449. - * As divx takes 68 cycles and sdivcc only 36,
  4450. - * we use sdivcc eventhough it is deprecated.
  4451. - */
  4452. -
  4453. - .text
  4454. - .align 32
  4455. -ENTRY(.div)
  4456. -
  4457. - sra %o0, 31, %o2
  4458. - wr %o2, 0, %y
  4459. - sdivcc %o0, %o1, %o0
  4460. - xnor %o0, %g0, %o2
  4461. - retl
  4462. - movvs %icc, %o2, %o0
  4463. -
  4464. -END(.div)
  4465. diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S
  4466. deleted file mode 100644
  4467. index 303f29b..0000000
  4468. --- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S
  4469. +++ /dev/null
  4470. @@ -1,15 +0,0 @@
  4471. -/*
  4472. - * Sparc v9 has divide.
  4473. - * As divx takes 68 cycles and udiv only 37,
  4474. - * we use udiv eventhough it is deprecated.
  4475. - */
  4476. -
  4477. - .text
  4478. - .align 32
  4479. -ENTRY(.udiv)
  4480. -
  4481. - wr %g0, 0, %y
  4482. - retl
  4483. - udiv %o0, %o1, %o0
  4484. -
  4485. -END(.udiv)
  4486. diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S
  4487. deleted file mode 100644
  4488. index e65e4b9..0000000
  4489. --- a/libc/sysdeps/linux/sparc/sparcv9/umul.S
  4490. +++ /dev/null
  4491. @@ -1,15 +0,0 @@
  4492. -/*
  4493. - * Sparc v9 has multiply.
  4494. - */
  4495. -
  4496. - .text
  4497. - .align 32
  4498. -ENTRY(.umul)
  4499. -
  4500. - srl %o0, 0, %o0
  4501. - srl %o1, 0, %o1
  4502. - mulx %o0, %o1, %o0
  4503. - retl
  4504. - srlx %o0, 32, %o1
  4505. -
  4506. -END(.umul)
  4507. diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S
  4508. deleted file mode 100644
  4509. index 9354269..0000000
  4510. --- a/libc/sysdeps/linux/sparc/sparcv9/urem.S
  4511. +++ /dev/null
  4512. @@ -1,17 +0,0 @@
  4513. -/*
  4514. - * Sparc v9 has divide.
  4515. - * As divx takes 68 cycles and udiv only 37,
  4516. - * we use udiv eventhough it is deprecated.
  4517. - */
  4518. -
  4519. - .text
  4520. - .align 32
  4521. -ENTRY(.urem)
  4522. -
  4523. - wr %g0, 0, %y
  4524. - udiv %o0, %o1, %o2
  4525. - umul %o2, %o1, %o2
  4526. - retl
  4527. - sub %o0, %o2, %o0
  4528. -
  4529. -END(.urem)
  4530. diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h
  4531. index 37d6a61..edbd5a5 100644
  4532. --- a/libc/sysdeps/linux/sparc/sys/procfs.h
  4533. +++ b/libc/sysdeps/linux/sparc/sys/procfs.h
  4534. @@ -32,20 +32,6 @@
  4535. __BEGIN_DECLS
  4536. -#if __WORDSIZE == 64
  4537. -
  4538. -#define ELF_NGREG 36
  4539. -
  4540. -typedef struct
  4541. - {
  4542. - unsigned long pr_regs[32];
  4543. - unsigned long pr_fsr;
  4544. - unsigned long pr_gsr;
  4545. - unsigned long pr_fprs;
  4546. - } elf_fpregset_t;
  4547. -
  4548. -#else /* sparc32 */
  4549. -
  4550. #define ELF_NGREG 38
  4551. typedef struct
  4552. @@ -63,8 +49,6 @@ typedef struct
  4553. unsigned int pr_q[64];
  4554. } elf_fpregset_t;
  4555. -#endif /* sparc32 */
  4556. -
  4557. typedef unsigned long elf_greg_t;
  4558. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  4559. @@ -110,13 +94,8 @@ struct elf_prpsinfo
  4560. char pr_zomb; /* Zombie. */
  4561. char pr_nice; /* Nice val. */
  4562. unsigned long int pr_flag; /* Flags. */
  4563. -#if __WORDSIZE == 64
  4564. - unsigned int pr_uid;
  4565. - unsigned int pr_gid;
  4566. -#else
  4567. unsigned short int pr_uid;
  4568. unsigned short int pr_gid;
  4569. -#endif
  4570. int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  4571. /* Lots missing */
  4572. char pr_fname[16]; /* Filename of executable. */
  4573. @@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;
  4574. typedef struct elf_prstatus prstatus_t;
  4575. typedef struct elf_prpsinfo prpsinfo_t;
  4576. -#if __WORDSIZE == 64
  4577. -
  4578. -/* Provide 32-bit variants so that BFD can read 32-bit
  4579. - core files. */
  4580. -#define ELF_NGREG32 38
  4581. -typedef struct
  4582. - {
  4583. - union
  4584. - {
  4585. - unsigned int pr_regs[32];
  4586. - double pr_dregs[16];
  4587. - } pr_fr;
  4588. - unsigned int __unused;
  4589. - unsigned int pr_fsr;
  4590. - unsigned char pr_qcnt;
  4591. - unsigned char pr_q_entrysize;
  4592. - unsigned char pr_en;
  4593. - unsigned int pr_q[64];
  4594. - } elf_fpregset_t32;
  4595. -
  4596. -typedef unsigned int elf_greg_t32;
  4597. -typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
  4598. -
  4599. -struct elf_prstatus32
  4600. - {
  4601. - struct elf_siginfo pr_info; /* Info associated with signal. */
  4602. - short int pr_cursig; /* Current signal. */
  4603. - unsigned int pr_sigpend; /* Set of pending signals. */
  4604. - unsigned int pr_sighold; /* Set of held signals. */
  4605. - __pid_t pr_pid;
  4606. - __pid_t pr_ppid;
  4607. - __pid_t pr_pgrp;
  4608. - __pid_t pr_sid;
  4609. - struct
  4610. - {
  4611. - int tv_sec, tv_usec;
  4612. - } pr_utime, /* User time. */
  4613. - pr_stime, /* System time. */
  4614. - pr_cutime, /* Cumulative user time. */
  4615. - pr_cstime; /* Cumulative system time. */
  4616. - elf_gregset_t32 pr_reg; /* GP registers. */
  4617. - int pr_fpvalid; /* True if math copro being used. */
  4618. - };
  4619. -
  4620. -struct elf_prpsinfo32
  4621. - {
  4622. - char pr_state; /* Numeric process state. */
  4623. - char pr_sname; /* Char for pr_state. */
  4624. - char pr_zomb; /* Zombie. */
  4625. - char pr_nice; /* Nice val. */
  4626. - unsigned int pr_flag; /* Flags. */
  4627. - unsigned short int pr_uid;
  4628. - unsigned short int pr_gid;
  4629. - int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  4630. - /* Lots missing */
  4631. - char pr_fname[16]; /* Filename of executable. */
  4632. - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
  4633. - };
  4634. -
  4635. -typedef elf_gregset_t32 prgregset32_t;
  4636. -typedef elf_fpregset_t32 prfpregset32_t;
  4637. -
  4638. -typedef struct elf_prstatus32 prstatus32_t;
  4639. -typedef struct elf_prpsinfo32 prpsinfo32_t;
  4640. -
  4641. -#endif /* sparc64 */
  4642. -
  4643. __END_DECLS
  4644. #endif /* sys/procfs.h */
  4645. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4646. index ab90810..d502c75 100644
  4647. --- a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4648. +++ b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4649. @@ -1,8 +1,82 @@
  4650. -#include <features.h>
  4651. -#include <bits/wordsize.h>
  4652. +/* Machine-dependent pthreads configuration and inline functions.
  4653. + sparc version.
  4654. + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  4655. + This file is part of the GNU C Library.
  4656. + Contributed by Richard Henderson <rth@tamu.edu>.
  4657. -#if __WORDSIZE == 32
  4658. -# include "sparc32/pt-machine.h"
  4659. -#else
  4660. -# include "sparc64/pt-machine.h"
  4661. + The GNU C Library is free software; you can redistribute it and/or
  4662. + modify it under the terms of the GNU Lesser General Public License as
  4663. + published by the Free Software Foundation; either version 2.1 of the
  4664. + License, or (at your option) any later version.
  4665. +
  4666. + The GNU C Library is distributed in the hope that it will be useful,
  4667. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  4668. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4669. + Lesser General Public License for more details.
  4670. +
  4671. + You should have received a copy of the GNU Lesser General Public
  4672. + License along with the GNU C Library; see the file COPYING.LIB. If
  4673. + not, see <http://www.gnu.org/licenses/>. */
  4674. +
  4675. +#ifndef _PT_MACHINE_H
  4676. +#define _PT_MACHINE_H 1
  4677. +
  4678. +#ifndef PT_EI
  4679. +# define PT_EI __extern_always_inline
  4680. #endif
  4681. +
  4682. +extern long int testandset (int *spinlock);
  4683. +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4684. +
  4685. +/* Spinlock implementation; required. */
  4686. +PT_EI long int
  4687. +testandset (int *spinlock)
  4688. +{
  4689. + int ret;
  4690. +
  4691. + __asm__ __volatile__("ldstub %1,%0"
  4692. + : "=r"(ret), "=m"(*spinlock)
  4693. + : "m"(*spinlock));
  4694. +
  4695. + return ret;
  4696. +}
  4697. +
  4698. +
  4699. +/* Memory barrier; default is to do nothing */
  4700. +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  4701. +
  4702. +
  4703. +/* Get some notion of the current stack. Need not be exactly the top
  4704. + of the stack, just something somewhere in the current frame. */
  4705. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  4706. +register char *stack_pointer __asm__("%sp");
  4707. +
  4708. +
  4709. +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  4710. + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  4711. +struct _pthread_descr_struct;
  4712. +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  4713. +
  4714. +/* Return the thread descriptor for the current thread. */
  4715. +#define THREAD_SELF __thread_self
  4716. +
  4717. +/* Initialize the thread-unique value. */
  4718. +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4719. +
  4720. +/* Access to data in the thread descriptor is easy. */
  4721. +#define THREAD_GETMEM(descr, member) \
  4722. + ((void) sizeof (descr), THREAD_SELF->member)
  4723. +#define THREAD_GETMEM_NC(descr, member) \
  4724. + ((void) sizeof (descr), THREAD_SELF->member)
  4725. +#define THREAD_SETMEM(descr, member, value) \
  4726. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  4727. +#define THREAD_SETMEM_NC(descr, member, value) \
  4728. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  4729. +
  4730. +/* We want the OS to assign stack addresses. */
  4731. +#define FLOATING_STACKS 1
  4732. +
  4733. +/* Maximum size of the stack if the rlimit is unlimited. */
  4734. +#define ARCH_STACK_MAX_SIZE 8*1024*1024
  4735. +
  4736. +#endif /* pt-machine.h */
  4737. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
  4738. deleted file mode 100644
  4739. index d502c75..0000000
  4740. --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
  4741. +++ /dev/null
  4742. @@ -1,82 +0,0 @@
  4743. -/* Machine-dependent pthreads configuration and inline functions.
  4744. - sparc version.
  4745. - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  4746. - This file is part of the GNU C Library.
  4747. - Contributed by Richard Henderson <rth@tamu.edu>.
  4748. -
  4749. - The GNU C Library is free software; you can redistribute it and/or
  4750. - modify it under the terms of the GNU Lesser General Public License as
  4751. - published by the Free Software Foundation; either version 2.1 of the
  4752. - License, or (at your option) any later version.
  4753. -
  4754. - The GNU C Library is distributed in the hope that it will be useful,
  4755. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4756. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4757. - Lesser General Public License for more details.
  4758. -
  4759. - You should have received a copy of the GNU Lesser General Public
  4760. - License along with the GNU C Library; see the file COPYING.LIB. If
  4761. - not, see <http://www.gnu.org/licenses/>. */
  4762. -
  4763. -#ifndef _PT_MACHINE_H
  4764. -#define _PT_MACHINE_H 1
  4765. -
  4766. -#ifndef PT_EI
  4767. -# define PT_EI __extern_always_inline
  4768. -#endif
  4769. -
  4770. -extern long int testandset (int *spinlock);
  4771. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4772. -
  4773. -/* Spinlock implementation; required. */
  4774. -PT_EI long int
  4775. -testandset (int *spinlock)
  4776. -{
  4777. - int ret;
  4778. -
  4779. - __asm__ __volatile__("ldstub %1,%0"
  4780. - : "=r"(ret), "=m"(*spinlock)
  4781. - : "m"(*spinlock));
  4782. -
  4783. - return ret;
  4784. -}
  4785. -
  4786. -
  4787. -/* Memory barrier; default is to do nothing */
  4788. -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  4789. -
  4790. -
  4791. -/* Get some notion of the current stack. Need not be exactly the top
  4792. - of the stack, just something somewhere in the current frame. */
  4793. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  4794. -register char *stack_pointer __asm__("%sp");
  4795. -
  4796. -
  4797. -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  4798. - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  4799. -struct _pthread_descr_struct;
  4800. -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  4801. -
  4802. -/* Return the thread descriptor for the current thread. */
  4803. -#define THREAD_SELF __thread_self
  4804. -
  4805. -/* Initialize the thread-unique value. */
  4806. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4807. -
  4808. -/* Access to data in the thread descriptor is easy. */
  4809. -#define THREAD_GETMEM(descr, member) \
  4810. - ((void) sizeof (descr), THREAD_SELF->member)
  4811. -#define THREAD_GETMEM_NC(descr, member) \
  4812. - ((void) sizeof (descr), THREAD_SELF->member)
  4813. -#define THREAD_SETMEM(descr, member, value) \
  4814. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4815. -#define THREAD_SETMEM_NC(descr, member, value) \
  4816. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4817. -
  4818. -/* We want the OS to assign stack addresses. */
  4819. -#define FLOATING_STACKS 1
  4820. -
  4821. -/* Maximum size of the stack if the rlimit is unlimited. */
  4822. -#define ARCH_STACK_MAX_SIZE 8*1024*1024
  4823. -
  4824. -#endif /* pt-machine.h */
  4825. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
  4826. deleted file mode 100644
  4827. index e3c73d9..0000000
  4828. --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
  4829. +++ /dev/null
  4830. @@ -1,104 +0,0 @@
  4831. -/* Machine-dependent pthreads configuration and inline functions.
  4832. - Sparc v9 version.
  4833. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
  4834. - This file is part of the GNU C Library.
  4835. - Contributed by Richard Henderson <rth@tamu.edu>.
  4836. -
  4837. - The GNU C Library is free software; you can redistribute it and/or
  4838. - modify it under the terms of the GNU Lesser General Public License as
  4839. - published by the Free Software Foundation; either version 2.1 of the
  4840. - License, or (at your option) any later version.
  4841. -
  4842. - The GNU C Library is distributed in the hope that it will be useful,
  4843. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4844. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4845. - Lesser General Public License for more details.
  4846. -
  4847. - You should have received a copy of the GNU Lesser General Public
  4848. - License along with the GNU C Library; see the file COPYING.LIB. If
  4849. - not, see <http://www.gnu.org/licenses/>. */
  4850. -
  4851. -#ifndef _PT_MACHINE_H
  4852. -#define _PT_MACHINE_H 1
  4853. -
  4854. -#ifndef PT_EI
  4855. -# define PT_EI __extern_always_inline
  4856. -#endif
  4857. -
  4858. -extern long int testandset (int *spinlock);
  4859. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4860. -
  4861. -/* Spinlock implementation; required. */
  4862. -PT_EI long int
  4863. -testandset (int *spinlock)
  4864. -{
  4865. - int ret;
  4866. -
  4867. - __asm__ __volatile__("ldstub %1,%0"
  4868. - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
  4869. -
  4870. - return ret;
  4871. -}
  4872. -
  4873. -
  4874. -/* Memory barrier; default is to do nothing */
  4875. -#define MEMORY_BARRIER() \
  4876. - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
  4877. -/* Read barrier. */
  4878. -#define READ_MEMORY_BARRIER() \
  4879. - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
  4880. -/* Write barrier. */
  4881. -#define WRITE_MEMORY_BARRIER() \
  4882. - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
  4883. -
  4884. -
  4885. -/* Get some notion of the current stack. Need not be exactly the top
  4886. - of the stack, just something somewhere in the current frame. */
  4887. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  4888. -register char *stack_pointer __asm__ ("%sp");
  4889. -
  4890. -
  4891. -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
  4892. - TLS ABI specifies %g7 as the thread pointer. */
  4893. -struct _pthread_descr_struct;
  4894. -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
  4895. -
  4896. -/* Return the thread descriptor for the current thread. */
  4897. -#define THREAD_SELF __thread_self
  4898. -
  4899. -/* Initialize the thread-unique value. */
  4900. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4901. -
  4902. -
  4903. -/* Compare-and-swap for semaphores. */
  4904. -
  4905. -#define HAS_COMPARE_AND_SWAP
  4906. -PT_EI int
  4907. -__compare_and_swap (long int *p, long int oldval, long int newval)
  4908. -{
  4909. - long int readval;
  4910. -
  4911. - __asm__ __volatile__ ("casx [%4], %2, %0"
  4912. - : "=r"(readval), "=m"(*p)
  4913. - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
  4914. - MEMORY_BARRIER();
  4915. - return readval == oldval;
  4916. -}
  4917. -
  4918. -/* Access to data in the thread descriptor is easy. */
  4919. -#define THREAD_GETMEM(descr, member) \
  4920. - ((void) sizeof (descr), THREAD_SELF->member)
  4921. -#define THREAD_GETMEM_NC(descr, member) \
  4922. - ((void) sizeof (descr), THREAD_SELF->member)
  4923. -#define THREAD_SETMEM(descr, member, value) \
  4924. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4925. -#define THREAD_SETMEM_NC(descr, member, value) \
  4926. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4927. -
  4928. -/* We want the OS to assign stack addresses. */
  4929. -#define FLOATING_STACKS 1
  4930. -
  4931. -/* Maximum size of the stack if the rlimit is unlimited. */
  4932. -#define ARCH_STACK_MAX_SIZE 32*1024*1024
  4933. -
  4934. -#endif /* pt-machine.h */
  4935. diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4936. index 72a9af5..4de152b 100644
  4937. --- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4938. +++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4939. @@ -1,14 +1,87 @@
  4940. -#include <features.h>
  4941. -#include <bits/wordsize.h>
  4942. +/* POSIX spinlock implementation. SPARC32 version.
  4943. + Copyright (C) 2000 Free Software Foundation, Inc.
  4944. + This file is part of the GNU C Library.
  4945. -#if __WORDSIZE == 32
  4946. + The GNU C Library is free software; you can redistribute it and/or
  4947. + modify it under the terms of the GNU Lesser General Public License as
  4948. + published by the Free Software Foundation; either version 2.1 of the
  4949. + License, or (at your option) any later version.
  4950. -# if defined(__CONFIG_SPARC_V9B__)
  4951. -# include "sparc32/sparcv9b/pspinlock.c"
  4952. -# else
  4953. -# include "sparc32/pspinlock.c"
  4954. -# endif
  4955. + The GNU C Library is distributed in the hope that it will be useful,
  4956. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  4957. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4958. + Lesser General Public License for more details.
  4959. -#else
  4960. -# include "sparc64/pspinlock.c"
  4961. -#endif
  4962. + You should have received a copy of the GNU Lesser General Public
  4963. + License along with the GNU C Library; see the file COPYING.LIB. If
  4964. + not, see <http://www.gnu.org/licenses/>. */
  4965. +
  4966. +#include <errno.h>
  4967. +#include <pthread.h>
  4968. +#include "internals.h"
  4969. +
  4970. +/* This implementation is similar to the one used in the Linux kernel. */
  4971. +int
  4972. +__pthread_spin_lock (pthread_spinlock_t *lock)
  4973. +{
  4974. + __asm__ __volatile__
  4975. + ("1: ldstub [%0], %%g2\n"
  4976. + " orcc %%g2, 0x0, %%g0\n"
  4977. + " bne,a 2f\n"
  4978. + " ldub [%0], %%g2\n"
  4979. + ".subsection 2\n"
  4980. + "2: orcc %%g2, 0x0, %%g0\n"
  4981. + " bne,a 2b\n"
  4982. + " ldub [%0], %%g2\n"
  4983. + " b,a 1b\n"
  4984. + ".previous"
  4985. + : /* no outputs */
  4986. + : "r" (lock)
  4987. + : "g2", "memory", "cc");
  4988. + return 0;
  4989. +}
  4990. +weak_alias (__pthread_spin_lock, pthread_spin_lock)
  4991. +
  4992. +
  4993. +int
  4994. +__pthread_spin_trylock (pthread_spinlock_t *lock)
  4995. +{
  4996. + int result;
  4997. + __asm__ __volatile__
  4998. + ("ldstub [%1], %0"
  4999. + : "=r" (result)
  5000. + : "r" (lock)
  5001. + : "memory");
  5002. + return result == 0 ? 0 : EBUSY;
  5003. +}
  5004. +weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5005. +
  5006. +
  5007. +int
  5008. +__pthread_spin_unlock (pthread_spinlock_t *lock)
  5009. +{
  5010. + *lock = 0;
  5011. + return 0;
  5012. +}
  5013. +weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5014. +
  5015. +
  5016. +int
  5017. +__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5018. +{
  5019. + /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5020. + all processes which can access the memory location `lock' points
  5021. + to can use the spinlock. */
  5022. + *lock = 0;
  5023. + return 0;
  5024. +}
  5025. +weak_alias (__pthread_spin_init, pthread_spin_init)
  5026. +
  5027. +
  5028. +int
  5029. +__pthread_spin_destroy (pthread_spinlock_t *lock)
  5030. +{
  5031. + /* Nothing to do. */
  5032. + return 0;
  5033. +}
  5034. +weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5035. diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5036. index ab90810..d502c75 100644
  5037. --- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5038. +++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5039. @@ -1,8 +1,82 @@
  5040. -#include <features.h>
  5041. -#include <bits/wordsize.h>
  5042. +/* Machine-dependent pthreads configuration and inline functions.
  5043. + sparc version.
  5044. + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  5045. + This file is part of the GNU C Library.
  5046. + Contributed by Richard Henderson <rth@tamu.edu>.
  5047. -#if __WORDSIZE == 32
  5048. -# include "sparc32/pt-machine.h"
  5049. -#else
  5050. -# include "sparc64/pt-machine.h"
  5051. + The GNU C Library is free software; you can redistribute it and/or
  5052. + modify it under the terms of the GNU Lesser General Public License as
  5053. + published by the Free Software Foundation; either version 2.1 of the
  5054. + License, or (at your option) any later version.
  5055. +
  5056. + The GNU C Library is distributed in the hope that it will be useful,
  5057. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  5058. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5059. + Lesser General Public License for more details.
  5060. +
  5061. + You should have received a copy of the GNU Lesser General Public
  5062. + License along with the GNU C Library; see the file COPYING.LIB. If
  5063. + not, see <http://www.gnu.org/licenses/>. */
  5064. +
  5065. +#ifndef _PT_MACHINE_H
  5066. +#define _PT_MACHINE_H 1
  5067. +
  5068. +#ifndef PT_EI
  5069. +# define PT_EI __extern_always_inline
  5070. #endif
  5071. +
  5072. +extern long int testandset (int *spinlock);
  5073. +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5074. +
  5075. +/* Spinlock implementation; required. */
  5076. +PT_EI long int
  5077. +testandset (int *spinlock)
  5078. +{
  5079. + int ret;
  5080. +
  5081. + __asm__ __volatile__("ldstub %1,%0"
  5082. + : "=r"(ret), "=m"(*spinlock)
  5083. + : "m"(*spinlock));
  5084. +
  5085. + return ret;
  5086. +}
  5087. +
  5088. +
  5089. +/* Memory barrier; default is to do nothing */
  5090. +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  5091. +
  5092. +
  5093. +/* Get some notion of the current stack. Need not be exactly the top
  5094. + of the stack, just something somewhere in the current frame. */
  5095. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  5096. +register char *stack_pointer __asm__("%sp");
  5097. +
  5098. +
  5099. +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  5100. + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  5101. +struct _pthread_descr_struct;
  5102. +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  5103. +
  5104. +/* Return the thread descriptor for the current thread. */
  5105. +#define THREAD_SELF __thread_self
  5106. +
  5107. +/* Initialize the thread-unique value. */
  5108. +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5109. +
  5110. +/* Access to data in the thread descriptor is easy. */
  5111. +#define THREAD_GETMEM(descr, member) \
  5112. + ((void) sizeof (descr), THREAD_SELF->member)
  5113. +#define THREAD_GETMEM_NC(descr, member) \
  5114. + ((void) sizeof (descr), THREAD_SELF->member)
  5115. +#define THREAD_SETMEM(descr, member, value) \
  5116. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  5117. +#define THREAD_SETMEM_NC(descr, member, value) \
  5118. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  5119. +
  5120. +/* We want the OS to assign stack addresses. */
  5121. +#define FLOATING_STACKS 1
  5122. +
  5123. +/* Maximum size of the stack if the rlimit is unlimited. */
  5124. +#define ARCH_STACK_MAX_SIZE 8*1024*1024
  5125. +
  5126. +#endif /* pt-machine.h */
  5127. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
  5128. deleted file mode 100644
  5129. index 4de152b..0000000
  5130. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
  5131. +++ /dev/null
  5132. @@ -1,87 +0,0 @@
  5133. -/* POSIX spinlock implementation. SPARC32 version.
  5134. - Copyright (C) 2000 Free Software Foundation, Inc.
  5135. - This file is part of the GNU C Library.
  5136. -
  5137. - The GNU C Library is free software; you can redistribute it and/or
  5138. - modify it under the terms of the GNU Lesser General Public License as
  5139. - published by the Free Software Foundation; either version 2.1 of the
  5140. - License, or (at your option) any later version.
  5141. -
  5142. - The GNU C Library is distributed in the hope that it will be useful,
  5143. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5144. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5145. - Lesser General Public License for more details.
  5146. -
  5147. - You should have received a copy of the GNU Lesser General Public
  5148. - License along with the GNU C Library; see the file COPYING.LIB. If
  5149. - not, see <http://www.gnu.org/licenses/>. */
  5150. -
  5151. -#include <errno.h>
  5152. -#include <pthread.h>
  5153. -#include "internals.h"
  5154. -
  5155. -/* This implementation is similar to the one used in the Linux kernel. */
  5156. -int
  5157. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5158. -{
  5159. - __asm__ __volatile__
  5160. - ("1: ldstub [%0], %%g2\n"
  5161. - " orcc %%g2, 0x0, %%g0\n"
  5162. - " bne,a 2f\n"
  5163. - " ldub [%0], %%g2\n"
  5164. - ".subsection 2\n"
  5165. - "2: orcc %%g2, 0x0, %%g0\n"
  5166. - " bne,a 2b\n"
  5167. - " ldub [%0], %%g2\n"
  5168. - " b,a 1b\n"
  5169. - ".previous"
  5170. - : /* no outputs */
  5171. - : "r" (lock)
  5172. - : "g2", "memory", "cc");
  5173. - return 0;
  5174. -}
  5175. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5176. -
  5177. -
  5178. -int
  5179. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5180. -{
  5181. - int result;
  5182. - __asm__ __volatile__
  5183. - ("ldstub [%1], %0"
  5184. - : "=r" (result)
  5185. - : "r" (lock)
  5186. - : "memory");
  5187. - return result == 0 ? 0 : EBUSY;
  5188. -}
  5189. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5190. -
  5191. -
  5192. -int
  5193. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5194. -{
  5195. - *lock = 0;
  5196. - return 0;
  5197. -}
  5198. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5199. -
  5200. -
  5201. -int
  5202. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5203. -{
  5204. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5205. - all processes which can access the memory location `lock' points
  5206. - to can use the spinlock. */
  5207. - *lock = 0;
  5208. - return 0;
  5209. -}
  5210. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5211. -
  5212. -
  5213. -int
  5214. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5215. -{
  5216. - /* Nothing to do. */
  5217. - return 0;
  5218. -}
  5219. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5220. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
  5221. deleted file mode 100644
  5222. index d502c75..0000000
  5223. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
  5224. +++ /dev/null
  5225. @@ -1,82 +0,0 @@
  5226. -/* Machine-dependent pthreads configuration and inline functions.
  5227. - sparc version.
  5228. - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  5229. - This file is part of the GNU C Library.
  5230. - Contributed by Richard Henderson <rth@tamu.edu>.
  5231. -
  5232. - The GNU C Library is free software; you can redistribute it and/or
  5233. - modify it under the terms of the GNU Lesser General Public License as
  5234. - published by the Free Software Foundation; either version 2.1 of the
  5235. - License, or (at your option) any later version.
  5236. -
  5237. - The GNU C Library is distributed in the hope that it will be useful,
  5238. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5239. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5240. - Lesser General Public License for more details.
  5241. -
  5242. - You should have received a copy of the GNU Lesser General Public
  5243. - License along with the GNU C Library; see the file COPYING.LIB. If
  5244. - not, see <http://www.gnu.org/licenses/>. */
  5245. -
  5246. -#ifndef _PT_MACHINE_H
  5247. -#define _PT_MACHINE_H 1
  5248. -
  5249. -#ifndef PT_EI
  5250. -# define PT_EI __extern_always_inline
  5251. -#endif
  5252. -
  5253. -extern long int testandset (int *spinlock);
  5254. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5255. -
  5256. -/* Spinlock implementation; required. */
  5257. -PT_EI long int
  5258. -testandset (int *spinlock)
  5259. -{
  5260. - int ret;
  5261. -
  5262. - __asm__ __volatile__("ldstub %1,%0"
  5263. - : "=r"(ret), "=m"(*spinlock)
  5264. - : "m"(*spinlock));
  5265. -
  5266. - return ret;
  5267. -}
  5268. -
  5269. -
  5270. -/* Memory barrier; default is to do nothing */
  5271. -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  5272. -
  5273. -
  5274. -/* Get some notion of the current stack. Need not be exactly the top
  5275. - of the stack, just something somewhere in the current frame. */
  5276. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  5277. -register char *stack_pointer __asm__("%sp");
  5278. -
  5279. -
  5280. -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  5281. - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  5282. -struct _pthread_descr_struct;
  5283. -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  5284. -
  5285. -/* Return the thread descriptor for the current thread. */
  5286. -#define THREAD_SELF __thread_self
  5287. -
  5288. -/* Initialize the thread-unique value. */
  5289. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5290. -
  5291. -/* Access to data in the thread descriptor is easy. */
  5292. -#define THREAD_GETMEM(descr, member) \
  5293. - ((void) sizeof (descr), THREAD_SELF->member)
  5294. -#define THREAD_GETMEM_NC(descr, member) \
  5295. - ((void) sizeof (descr), THREAD_SELF->member)
  5296. -#define THREAD_SETMEM(descr, member, value) \
  5297. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5298. -#define THREAD_SETMEM_NC(descr, member, value) \
  5299. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5300. -
  5301. -/* We want the OS to assign stack addresses. */
  5302. -#define FLOATING_STACKS 1
  5303. -
  5304. -/* Maximum size of the stack if the rlimit is unlimited. */
  5305. -#define ARCH_STACK_MAX_SIZE 8*1024*1024
  5306. -
  5307. -#endif /* pt-machine.h */
  5308. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
  5309. deleted file mode 100644
  5310. index fb49ca3..0000000
  5311. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
  5312. +++ /dev/null
  5313. @@ -1,93 +0,0 @@
  5314. -/* POSIX spinlock implementation. SPARC v9 version.
  5315. - Copyright (C) 2000 Free Software Foundation, Inc.
  5316. - This file is part of the GNU C Library.
  5317. -
  5318. - The GNU C Library is free software; you can redistribute it and/or
  5319. - modify it under the terms of the GNU Lesser General Public License as
  5320. - published by the Free Software Foundation; either version 2.1 of the
  5321. - License, or (at your option) any later version.
  5322. -
  5323. - The GNU C Library is distributed in the hope that it will be useful,
  5324. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5325. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5326. - Lesser General Public License for more details.
  5327. -
  5328. - You should have received a copy of the GNU Lesser General Public
  5329. - License along with the GNU C Library; see the file COPYING.LIB. If
  5330. - not, see <http://www.gnu.org/licenses/>. */
  5331. -
  5332. -#include <errno.h>
  5333. -#include <pthread.h>
  5334. -#include "internals.h"
  5335. -
  5336. -
  5337. -/* This implementation is similar to the one used in the Linux kernel. */
  5338. -int
  5339. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5340. -{
  5341. - __asm__ __volatile__
  5342. - ("1: ldstub [%0], %%g2\n"
  5343. - " brnz,pn %%g2, 2f\n"
  5344. - " membar #StoreLoad | #StoreStore\n"
  5345. - ".subsection 2\n"
  5346. - "2: ldub [%0], %%g2\n"
  5347. - " brnz,pt %%g2, 2b\n"
  5348. - " membar #LoadLoad\n"
  5349. - " b,a,pt %%xcc, 1b\n"
  5350. - ".previous"
  5351. - : /* no outputs */
  5352. - : "r" (lock)
  5353. - : "g2", "memory");
  5354. - return 0;
  5355. -}
  5356. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5357. -
  5358. -
  5359. -int
  5360. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5361. -{
  5362. - int result;
  5363. - __asm__ __volatile__
  5364. - ("ldstub [%1], %0\n"
  5365. - "membar #StoreLoad | #StoreStore"
  5366. - : "=r" (result)
  5367. - : "r" (lock)
  5368. - : "memory");
  5369. - return result == 0 ? 0 : EBUSY;
  5370. -}
  5371. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5372. -
  5373. -
  5374. -int
  5375. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5376. -{
  5377. - __asm__ __volatile__
  5378. - ("membar #StoreStore | #LoadStore\n"
  5379. - "stb %%g0, [%0]"
  5380. - :
  5381. - : "r" (lock)
  5382. - : "memory");
  5383. - return 0;
  5384. -}
  5385. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5386. -
  5387. -
  5388. -int
  5389. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5390. -{
  5391. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5392. - all processes which can access the memory location `lock' points
  5393. - to can use the spinlock. */
  5394. - *lock = 0;
  5395. - return 0;
  5396. -}
  5397. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5398. -
  5399. -
  5400. -int
  5401. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5402. -{
  5403. - /* Nothing to do. */
  5404. - return 0;
  5405. -}
  5406. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5407. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
  5408. deleted file mode 100644
  5409. index 743cb77..0000000
  5410. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
  5411. +++ /dev/null
  5412. @@ -1,92 +0,0 @@
  5413. -/* POSIX spinlock implementation. SPARC64 version.
  5414. - Copyright (C) 2000 Free Software Foundation, Inc.
  5415. - This file is part of the GNU C Library.
  5416. -
  5417. - The GNU C Library is free software; you can redistribute it and/or
  5418. - modify it under the terms of the GNU Lesser General Public License as
  5419. - published by the Free Software Foundation; either version 2.1 of the
  5420. - License, or (at your option) any later version.
  5421. -
  5422. - The GNU C Library is distributed in the hope that it will be useful,
  5423. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5424. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5425. - Lesser General Public License for more details.
  5426. -
  5427. - You should have received a copy of the GNU Lesser General Public
  5428. - License along with the GNU C Library; see the file COPYING.LIB. If
  5429. - not, see <http://www.gnu.org/licenses/>. */
  5430. -
  5431. -#include <errno.h>
  5432. -#include <pthread.h>
  5433. -#include "internals.h"
  5434. -
  5435. -/* This implementation is similar to the one used in the Linux kernel. */
  5436. -int
  5437. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5438. -{
  5439. - __asm__ __volatile__
  5440. - ("1: ldstub [%0], %%g5\n"
  5441. - " brnz,pn %%g5, 2f\n"
  5442. - " membar #StoreLoad | #StoreStore\n"
  5443. - ".subsection 2\n"
  5444. - "2: ldub [%0], %%g5\n"
  5445. - " brnz,pt %%g5, 2b\n"
  5446. - " membar #LoadLoad\n"
  5447. - " b,a,pt %%xcc, 1b\n"
  5448. - ".previous"
  5449. - : /* no outputs */
  5450. - : "r" (lock)
  5451. - : "g5", "memory");
  5452. - return 0;
  5453. -}
  5454. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5455. -
  5456. -
  5457. -int
  5458. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5459. -{
  5460. - int result;
  5461. - __asm__ __volatile__
  5462. - ("ldstub [%1], %0\n"
  5463. - "membar #StoreLoad | #StoreStore"
  5464. - : "=r" (result)
  5465. - : "r" (lock)
  5466. - : "memory");
  5467. - return result == 0 ? 0 : EBUSY;
  5468. -}
  5469. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5470. -
  5471. -
  5472. -int
  5473. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5474. -{
  5475. - __asm__ __volatile__
  5476. - ("membar #StoreStore | #LoadStore\n"
  5477. - "stb %%g0, [%0]"
  5478. - :
  5479. - : "r" (lock)
  5480. - : "memory");
  5481. - return 0;
  5482. -}
  5483. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5484. -
  5485. -
  5486. -int
  5487. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5488. -{
  5489. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5490. - all processes which can access the memory location `lock' points
  5491. - to can use the spinlock. */
  5492. - *lock = 0;
  5493. - return 0;
  5494. -}
  5495. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5496. -
  5497. -
  5498. -int
  5499. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5500. -{
  5501. - /* Nothing to do. */
  5502. - return 0;
  5503. -}
  5504. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5505. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
  5506. deleted file mode 100644
  5507. index e3c73d9..0000000
  5508. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
  5509. +++ /dev/null
  5510. @@ -1,104 +0,0 @@
  5511. -/* Machine-dependent pthreads configuration and inline functions.
  5512. - Sparc v9 version.
  5513. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
  5514. - This file is part of the GNU C Library.
  5515. - Contributed by Richard Henderson <rth@tamu.edu>.
  5516. -
  5517. - The GNU C Library is free software; you can redistribute it and/or
  5518. - modify it under the terms of the GNU Lesser General Public License as
  5519. - published by the Free Software Foundation; either version 2.1 of the
  5520. - License, or (at your option) any later version.
  5521. -
  5522. - The GNU C Library is distributed in the hope that it will be useful,
  5523. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5524. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5525. - Lesser General Public License for more details.
  5526. -
  5527. - You should have received a copy of the GNU Lesser General Public
  5528. - License along with the GNU C Library; see the file COPYING.LIB. If
  5529. - not, see <http://www.gnu.org/licenses/>. */
  5530. -
  5531. -#ifndef _PT_MACHINE_H
  5532. -#define _PT_MACHINE_H 1
  5533. -
  5534. -#ifndef PT_EI
  5535. -# define PT_EI __extern_always_inline
  5536. -#endif
  5537. -
  5538. -extern long int testandset (int *spinlock);
  5539. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5540. -
  5541. -/* Spinlock implementation; required. */
  5542. -PT_EI long int
  5543. -testandset (int *spinlock)
  5544. -{
  5545. - int ret;
  5546. -
  5547. - __asm__ __volatile__("ldstub %1,%0"
  5548. - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
  5549. -
  5550. - return ret;
  5551. -}
  5552. -
  5553. -
  5554. -/* Memory barrier; default is to do nothing */
  5555. -#define MEMORY_BARRIER() \
  5556. - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
  5557. -/* Read barrier. */
  5558. -#define READ_MEMORY_BARRIER() \
  5559. - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
  5560. -/* Write barrier. */
  5561. -#define WRITE_MEMORY_BARRIER() \
  5562. - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
  5563. -
  5564. -
  5565. -/* Get some notion of the current stack. Need not be exactly the top
  5566. - of the stack, just something somewhere in the current frame. */
  5567. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  5568. -register char *stack_pointer __asm__ ("%sp");
  5569. -
  5570. -
  5571. -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
  5572. - TLS ABI specifies %g7 as the thread pointer. */
  5573. -struct _pthread_descr_struct;
  5574. -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
  5575. -
  5576. -/* Return the thread descriptor for the current thread. */
  5577. -#define THREAD_SELF __thread_self
  5578. -
  5579. -/* Initialize the thread-unique value. */
  5580. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5581. -
  5582. -
  5583. -/* Compare-and-swap for semaphores. */
  5584. -
  5585. -#define HAS_COMPARE_AND_SWAP
  5586. -PT_EI int
  5587. -__compare_and_swap (long int *p, long int oldval, long int newval)
  5588. -{
  5589. - long int readval;
  5590. -
  5591. - __asm__ __volatile__ ("casx [%4], %2, %0"
  5592. - : "=r"(readval), "=m"(*p)
  5593. - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
  5594. - MEMORY_BARRIER();
  5595. - return readval == oldval;
  5596. -}
  5597. -
  5598. -/* Access to data in the thread descriptor is easy. */
  5599. -#define THREAD_GETMEM(descr, member) \
  5600. - ((void) sizeof (descr), THREAD_SELF->member)
  5601. -#define THREAD_GETMEM_NC(descr, member) \
  5602. - ((void) sizeof (descr), THREAD_SELF->member)
  5603. -#define THREAD_SETMEM(descr, member, value) \
  5604. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5605. -#define THREAD_SETMEM_NC(descr, member, value) \
  5606. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5607. -
  5608. -/* We want the OS to assign stack addresses. */
  5609. -#define FLOATING_STACKS 1
  5610. -
  5611. -/* Maximum size of the stack if the rlimit is unlimited. */
  5612. -#define ARCH_STACK_MAX_SIZE 32*1024*1024
  5613. -
  5614. -#endif /* pt-machine.h */
  5615. 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
  5616. deleted file mode 100644
  5617. index bd9bb0d..0000000
  5618. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  5619. +++ /dev/null
  5620. @@ -1,100 +0,0 @@
  5621. -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5622. - This file is part of the GNU C Library.
  5623. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5624. -
  5625. - The GNU C Library is free software; you can redistribute it and/or
  5626. - modify it under the terms of the GNU Lesser General Public
  5627. - License as published by the Free Software Foundation; either
  5628. - version 2.1 of the License, or (at your option) any later version.
  5629. -
  5630. - The GNU C Library is distributed in the hope that it will be useful,
  5631. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5632. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5633. - Lesser General Public License for more details.
  5634. -
  5635. - You should have received a copy of the GNU Lesser General Public
  5636. - License along with the GNU C Library; if not, see
  5637. - <http://www.gnu.org/licenses/>. */
  5638. -
  5639. -#include <tls.h>
  5640. -#ifndef __ASSEMBLER__
  5641. -# include <linuxthreads/internals.h>
  5642. -#endif
  5643. -
  5644. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  5645. -
  5646. -# undef PSEUDO
  5647. -# define PSEUDO(name, syscall_name, args) \
  5648. - .text; \
  5649. -ENTRY(name) \
  5650. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  5651. - cmp %g1, 0; \
  5652. - bne 1f; \
  5653. - mov SYS_ify(syscall_name), %g1; \
  5654. - ta 0x10; \
  5655. - bcs __syscall_error_handler; \
  5656. - nop; \
  5657. - .subsection 2; \
  5658. -1: save %sp, -96, %sp; \
  5659. - CENABLE; \
  5660. - nop; \
  5661. - mov %o0, %l0; \
  5662. - COPY_ARGS_##args \
  5663. - mov SYS_ify(syscall_name), %g1; \
  5664. - ta 0x10; \
  5665. - bcs __syscall_error_handler2; \
  5666. - mov %o0, %l1; \
  5667. - CDISABLE; \
  5668. - mov %l0, %o0; \
  5669. - jmpl %i7 + 8, %g0; \
  5670. - restore %g0, %l1, %o0; \
  5671. - .previous; \
  5672. - SYSCALL_ERROR_HANDLER \
  5673. - SYSCALL_ERROR_HANDLER2
  5674. -
  5675. -#define SYSCALL_ERROR_HANDLER2 \
  5676. -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  5677. - .global __errno_location; \
  5678. - .type __errno_location,@function; \
  5679. - CDISABLE; \
  5680. - mov %l0, %o0; \
  5681. - call __errno_location; \
  5682. - nop; \
  5683. - st %l1, [%o0]; \
  5684. - jmpl %i7 + 8, %g0; \
  5685. - restore %g0, -1, %o0; \
  5686. - .previous;
  5687. -
  5688. -# ifdef IS_IN_libpthread
  5689. -# define CENABLE call __pthread_enable_asynccancel
  5690. -# define CDISABLE call __pthread_disable_asynccancel
  5691. -# elif !defined NOT_IN_libc
  5692. -# define CENABLE call __libc_enable_asynccancel
  5693. -# define CDISABLE call __libc_disable_asynccancel
  5694. -# else
  5695. -# define CENABLE call __librt_enable_asynccancel
  5696. -# define CDISABLE call __librt_disable_asynccancel
  5697. -# endif
  5698. -
  5699. -#define COPY_ARGS_0 /* Nothing */
  5700. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  5701. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  5702. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  5703. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  5704. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  5705. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  5706. -
  5707. -# ifndef __ASSEMBLER__
  5708. -# define SINGLE_THREAD_P \
  5709. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  5710. - p_header.data.multiple_threads) == 0, 1)
  5711. -# else
  5712. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  5713. -# endif
  5714. -
  5715. -#elif !defined __ASSEMBLER__
  5716. -
  5717. -/* This code should never be used but we define it anyhow. */
  5718. -# define SINGLE_THREAD_P (1)
  5719. -
  5720. -#endif
  5721. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  5722. deleted file mode 100644
  5723. index ab2286e..0000000
  5724. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  5725. +++ /dev/null
  5726. @@ -1,64 +0,0 @@
  5727. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  5728. - This file is part of the GNU C Library.
  5729. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  5730. -
  5731. - The GNU C Library is free software; you can redistribute it and/or
  5732. - modify it under the terms of the GNU Lesser General Public
  5733. - License as published by the Free Software Foundation; either
  5734. - version 2.1 of the License, or (at your option) any later version.
  5735. -
  5736. - The GNU C Library is distributed in the hope that it will be useful,
  5737. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5738. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5739. - Lesser General Public License for more details.
  5740. -
  5741. - You should have received a copy of the GNU Lesser General Public
  5742. - License along with the GNU C Library; if not, see
  5743. - <http://www.gnu.org/licenses/>. */
  5744. -
  5745. -#include <sysdep-cancel.h>
  5746. -
  5747. - .text
  5748. -#ifdef SHARED
  5749. -.LLGETPC0:
  5750. - retl
  5751. - add %o7, %o0, %o0
  5752. -#endif
  5753. -ENTRY(__vfork)
  5754. -#ifdef SHARED
  5755. - mov %o7, %o1
  5756. - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  5757. - call .LLGETPC0
  5758. - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  5759. - sethi %hi(__libc_pthread_functions), %o2
  5760. - mov %o1, %o7
  5761. - or %o2, %lo(__libc_pthread_functions), %o2
  5762. - ld [%o0 + %o2], %o2
  5763. - ld [%o2], %o2
  5764. - cmp %o2, 0
  5765. -#else
  5766. - .weak pthread_create
  5767. - sethi %hi(pthread_create), %o0
  5768. - orcc %o0, %lo(pthread_create), %o0
  5769. -#endif
  5770. -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  5771. - bne HIDDEN_JUMPTARGET(fork)
  5772. -#else
  5773. - bne 1f
  5774. -#endif
  5775. - mov __NR_vfork, %g1
  5776. - ta 0x10
  5777. - bcs __syscall_error_handler
  5778. - nop
  5779. - sub %o1, 1, %o1
  5780. - retl
  5781. - and %o0, %o1, %o0
  5782. -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  5783. -1: mov %o7, %g1
  5784. - call HIDDEN_JUMPTARGET(fork)
  5785. - mov %g1, %o7
  5786. -#endif
  5787. - SYSCALL_ERROR_HANDLER
  5788. -PSEUDO_END (__vfork)
  5789. -libc_hidden_def (__vfork)
  5790. -weak_alias (__vfork, vfork)
  5791. 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
  5792. deleted file mode 100644
  5793. index d57283a..0000000
  5794. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
  5795. +++ /dev/null
  5796. @@ -1 +0,0 @@
  5797. -#include "../../ia64/pt-sigsuspend.c"
  5798. 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
  5799. deleted file mode 100644
  5800. index 9972ee4..0000000
  5801. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  5802. +++ /dev/null
  5803. @@ -1,99 +0,0 @@
  5804. -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5805. - This file is part of the GNU C Library.
  5806. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5807. -
  5808. - The GNU C Library is free software; you can redistribute it and/or
  5809. - modify it under the terms of the GNU Lesser General Public
  5810. - License as published by the Free Software Foundation; either
  5811. - version 2.1 of the License, or (at your option) any later version.
  5812. -
  5813. - The GNU C Library is distributed in the hope that it will be useful,
  5814. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5815. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5816. - Lesser General Public License for more details.
  5817. -
  5818. - You should have received a copy of the GNU Lesser General Public
  5819. - License along with the GNU C Library; if not, see
  5820. - <http://www.gnu.org/licenses/>. */
  5821. -
  5822. -#include <tls.h>
  5823. -#ifndef __ASSEMBLER__
  5824. -# include <linuxthreads/internals.h>
  5825. -#endif
  5826. -
  5827. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  5828. -
  5829. -# undef PSEUDO
  5830. -# define PSEUDO(name, syscall_name, args) \
  5831. - .text; \
  5832. -ENTRY(name) \
  5833. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  5834. - brnz,pn %g1, 1f; \
  5835. - mov SYS_ify(syscall_name), %g1; \
  5836. - ta 0x6d; \
  5837. - bcs,pn %xcc, __syscall_error_handler; \
  5838. - nop; \
  5839. - .subsection 2; \
  5840. -1: save %sp, -192, %sp; \
  5841. - CENABLE; \
  5842. - nop; \
  5843. - mov %o0, %l0; \
  5844. - COPY_ARGS_##args \
  5845. - mov SYS_ify(syscall_name), %g1; \
  5846. - ta 0x6d; \
  5847. - bcs,pn %xcc, __syscall_error_handler2; \
  5848. - mov %o0, %l1; \
  5849. - CDISABLE; \
  5850. - mov %l0, %o0; \
  5851. - jmpl %i7 + 8, %g0; \
  5852. - restore %g0, %l1, %o0; \
  5853. - .previous; \
  5854. - SYSCALL_ERROR_HANDLER \
  5855. - SYSCALL_ERROR_HANDLER2
  5856. -
  5857. -#define SYSCALL_ERROR_HANDLER2 \
  5858. -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  5859. - .global __errno_location; \
  5860. - .type __errno_location,@function; \
  5861. - CDISABLE; \
  5862. - mov %l0, %o0; \
  5863. - call __errno_location; \
  5864. - nop; \
  5865. - st %l1, [%o0]; \
  5866. - jmpl %i7 + 8, %g0; \
  5867. - restore %g0, -1, %o0; \
  5868. - .previous;
  5869. -
  5870. -# ifdef IS_IN_libpthread
  5871. -# define CENABLE call __pthread_enable_asynccancel
  5872. -# define CDISABLE call __pthread_disable_asynccancel
  5873. -# elif !defined NOT_IN_libc
  5874. -# define CENABLE call __libc_enable_asynccancel
  5875. -# define CDISABLE call __libc_disable_asynccancel
  5876. -# else
  5877. -# define CENABLE call __librt_enable_asynccancel
  5878. -# define CDISABLE call __librt_disable_asynccancel
  5879. -# endif
  5880. -
  5881. -#define COPY_ARGS_0 /* Nothing */
  5882. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  5883. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  5884. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  5885. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  5886. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  5887. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  5888. -
  5889. -# ifndef __ASSEMBLER__
  5890. -# define SINGLE_THREAD_P \
  5891. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  5892. - p_header.data.multiple_threads) == 0, 1)
  5893. -# else
  5894. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  5895. -# endif
  5896. -
  5897. -#elif !defined __ASSEMBLER__
  5898. -
  5899. -/* This code should never be used but we define it anyhow. */
  5900. -# define SINGLE_THREAD_P (1)
  5901. -
  5902. -#endif
  5903. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  5904. deleted file mode 100644
  5905. index 3ff16b1..0000000
  5906. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  5907. +++ /dev/null
  5908. @@ -1,63 +0,0 @@
  5909. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  5910. - This file is part of the GNU C Library.
  5911. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  5912. -
  5913. - The GNU C Library is free software; you can redistribute it and/or
  5914. - modify it under the terms of the GNU Lesser General Public
  5915. - License as published by the Free Software Foundation; either
  5916. - version 2.1 of the License, or (at your option) any later version.
  5917. -
  5918. - The GNU C Library is distributed in the hope that it will be useful,
  5919. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5920. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5921. - Lesser General Public License for more details.
  5922. -
  5923. - You should have received a copy of the GNU Lesser General Public
  5924. - License along with the GNU C Library; if not, see
  5925. - <http://www.gnu.org/licenses/>. */
  5926. -
  5927. -#include <sysdep-cancel.h>
  5928. -
  5929. -#ifdef SHARED
  5930. -.LLGETPC0:
  5931. - retl
  5932. - add %o7, %o0, %o0
  5933. -#endif
  5934. -ENTRY(__vfork)
  5935. -#ifdef SHARED
  5936. - mov %o7, %o1
  5937. - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  5938. - call .LLGETPC0
  5939. - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  5940. - sethi %hi(__libc_pthread_functions), %o2
  5941. - mov %o1, %o7
  5942. - or %o2, %lo(__libc_pthread_functions), %o2
  5943. - ldx [%o0 + %o2], %o2
  5944. - ldx [%o2], %o0
  5945. -#else
  5946. - .weak pthread_create
  5947. - sethi %hi(pthread_create), %o0
  5948. - or %o0, %lo(pthread_create), %o0
  5949. -#endif
  5950. -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  5951. - cmp %o0, 0
  5952. - bne HIDDEN_JUMPTARGET(fork)
  5953. -#else
  5954. - brnz,pn %o0, 1f
  5955. -#endif
  5956. - mov __NR_vfork, %g1
  5957. - ta 0x6d
  5958. - bcs,pn %xcc, __syscall_error_handler
  5959. - nop
  5960. - sub %o1, 1, %o1
  5961. - retl
  5962. - and %o0, %o1, %o0
  5963. -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  5964. -1: mov %o7, %g1
  5965. - call HIDDEN_JUMPTARGET(fork)
  5966. - mov %g1, %o7
  5967. -#endif
  5968. - SYSCALL_ERROR_HANDLER
  5969. -PSEUDO_END (__vfork)
  5970. -libc_hidden_def (__vfork)
  5971. -weak_alias (__vfork, vfork)
  5972. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5973. index fa656b3..bd9bb0d 100644
  5974. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5975. +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5976. @@ -1,10 +1,100 @@
  5977. -#ifndef SPARC_SYSDEP_CANCEL_H
  5978. -#define SPARC_SYSDEP_CANCEL_H
  5979. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5980. + This file is part of the GNU C Library.
  5981. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5982. -#if defined(__arch64__)
  5983. -#include <sparc64/sysdep-cancel.h>
  5984. -#else
  5985. -#include <sparc32/sysdep-cancel.h>
  5986. + The GNU C Library is free software; you can redistribute it and/or
  5987. + modify it under the terms of the GNU Lesser General Public
  5988. + License as published by the Free Software Foundation; either
  5989. + version 2.1 of the License, or (at your option) any later version.
  5990. +
  5991. + The GNU C Library is distributed in the hope that it will be useful,
  5992. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  5993. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5994. + Lesser General Public License for more details.
  5995. +
  5996. + You should have received a copy of the GNU Lesser General Public
  5997. + License along with the GNU C Library; if not, see
  5998. + <http://www.gnu.org/licenses/>. */
  5999. +
  6000. +#include <tls.h>
  6001. +#ifndef __ASSEMBLER__
  6002. +# include <linuxthreads/internals.h>
  6003. #endif
  6004. +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  6005. +
  6006. +# undef PSEUDO
  6007. +# define PSEUDO(name, syscall_name, args) \
  6008. + .text; \
  6009. +ENTRY(name) \
  6010. + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  6011. + cmp %g1, 0; \
  6012. + bne 1f; \
  6013. + mov SYS_ify(syscall_name), %g1; \
  6014. + ta 0x10; \
  6015. + bcs __syscall_error_handler; \
  6016. + nop; \
  6017. + .subsection 2; \
  6018. +1: save %sp, -96, %sp; \
  6019. + CENABLE; \
  6020. + nop; \
  6021. + mov %o0, %l0; \
  6022. + COPY_ARGS_##args \
  6023. + mov SYS_ify(syscall_name), %g1; \
  6024. + ta 0x10; \
  6025. + bcs __syscall_error_handler2; \
  6026. + mov %o0, %l1; \
  6027. + CDISABLE; \
  6028. + mov %l0, %o0; \
  6029. + jmpl %i7 + 8, %g0; \
  6030. + restore %g0, %l1, %o0; \
  6031. + .previous; \
  6032. + SYSCALL_ERROR_HANDLER \
  6033. + SYSCALL_ERROR_HANDLER2
  6034. +
  6035. +#define SYSCALL_ERROR_HANDLER2 \
  6036. +SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  6037. + .global __errno_location; \
  6038. + .type __errno_location,@function; \
  6039. + CDISABLE; \
  6040. + mov %l0, %o0; \
  6041. + call __errno_location; \
  6042. + nop; \
  6043. + st %l1, [%o0]; \
  6044. + jmpl %i7 + 8, %g0; \
  6045. + restore %g0, -1, %o0; \
  6046. + .previous;
  6047. +
  6048. +# ifdef IS_IN_libpthread
  6049. +# define CENABLE call __pthread_enable_asynccancel
  6050. +# define CDISABLE call __pthread_disable_asynccancel
  6051. +# elif !defined NOT_IN_libc
  6052. +# define CENABLE call __libc_enable_asynccancel
  6053. +# define CDISABLE call __libc_disable_asynccancel
  6054. +# else
  6055. +# define CENABLE call __librt_enable_asynccancel
  6056. +# define CDISABLE call __librt_disable_asynccancel
  6057. +# endif
  6058. +
  6059. +#define COPY_ARGS_0 /* Nothing */
  6060. +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  6061. +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  6062. +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  6063. +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  6064. +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  6065. +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  6066. +
  6067. +# ifndef __ASSEMBLER__
  6068. +# define SINGLE_THREAD_P \
  6069. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  6070. + p_header.data.multiple_threads) == 0, 1)
  6071. +# else
  6072. +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  6073. +# endif
  6074. +
  6075. +#elif !defined __ASSEMBLER__
  6076. +
  6077. +/* This code should never be used but we define it anyhow. */
  6078. +# define SINGLE_THREAD_P (1)
  6079. +
  6080. #endif
  6081. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
  6082. new file mode 100644
  6083. index 0000000..ab2286e
  6084. --- /dev/null
  6085. +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
  6086. @@ -0,0 +1,64 @@
  6087. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6088. + This file is part of the GNU C Library.
  6089. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6090. +
  6091. + The GNU C Library is free software; you can redistribute it and/or
  6092. + modify it under the terms of the GNU Lesser General Public
  6093. + License as published by the Free Software Foundation; either
  6094. + version 2.1 of the License, or (at your option) any later version.
  6095. +
  6096. + The GNU C Library is distributed in the hope that it will be useful,
  6097. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6098. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6099. + Lesser General Public License for more details.
  6100. +
  6101. + You should have received a copy of the GNU Lesser General Public
  6102. + License along with the GNU C Library; if not, see
  6103. + <http://www.gnu.org/licenses/>. */
  6104. +
  6105. +#include <sysdep-cancel.h>
  6106. +
  6107. + .text
  6108. +#ifdef SHARED
  6109. +.LLGETPC0:
  6110. + retl
  6111. + add %o7, %o0, %o0
  6112. +#endif
  6113. +ENTRY(__vfork)
  6114. +#ifdef SHARED
  6115. + mov %o7, %o1
  6116. + sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  6117. + call .LLGETPC0
  6118. + add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  6119. + sethi %hi(__libc_pthread_functions), %o2
  6120. + mov %o1, %o7
  6121. + or %o2, %lo(__libc_pthread_functions), %o2
  6122. + ld [%o0 + %o2], %o2
  6123. + ld [%o2], %o2
  6124. + cmp %o2, 0
  6125. +#else
  6126. + .weak pthread_create
  6127. + sethi %hi(pthread_create), %o0
  6128. + orcc %o0, %lo(pthread_create), %o0
  6129. +#endif
  6130. +#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  6131. + bne HIDDEN_JUMPTARGET(fork)
  6132. +#else
  6133. + bne 1f
  6134. +#endif
  6135. + mov __NR_vfork, %g1
  6136. + ta 0x10
  6137. + bcs __syscall_error_handler
  6138. + nop
  6139. + sub %o1, 1, %o1
  6140. + retl
  6141. + and %o0, %o1, %o0
  6142. +#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  6143. +1: mov %o7, %g1
  6144. + call HIDDEN_JUMPTARGET(fork)
  6145. + mov %g1, %o7
  6146. +#endif
  6147. + SYSCALL_ERROR_HANDLER
  6148. +PSEUDO_END (__vfork)
  6149. +libc_hidden_def (__vfork)
  6150. +weak_alias (__vfork, vfork)
  6151. diff --git a/libpthread/nptl/sysdeps/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
  6152. new file mode 100644
  6153. index 0000000..2f64e7d
  6154. --- /dev/null
  6155. +++ b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
  6156. @@ -0,0 +1,27 @@
  6157. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6158. + This file is part of the GNU C Library.
  6159. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6160. +
  6161. + The GNU C Library is free software; you can redistribute it and/or
  6162. + modify it under the terms of the GNU Lesser General Public
  6163. + License as published by the Free Software Foundation; either
  6164. + version 2.1 of the License, or (at your option) any later version.
  6165. +
  6166. + The GNU C Library is distributed in the hope that it will be useful,
  6167. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6168. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6169. + Lesser General Public License for more details.
  6170. +
  6171. + You should have received a copy of the GNU Lesser General Public
  6172. + License along with the GNU C Library; if not, see
  6173. + <http://www.gnu.org/licenses/>. */
  6174. +
  6175. +#include <setjmp.h>
  6176. +#include <stdint.h>
  6177. +#include <unwind.h>
  6178. +
  6179. +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6180. + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6181. +
  6182. +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6183. + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6184. diff --git a/libpthread/nptl/sysdeps/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
  6185. new file mode 100644
  6186. index 0000000..2dfcd3c
  6187. --- /dev/null
  6188. +++ b/libpthread/nptl/sysdeps/pthread_spin_lock.c
  6189. @@ -0,0 +1,39 @@
  6190. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6191. + This file is part of the GNU C Library.
  6192. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6193. +
  6194. + The GNU C Library is free software; you can redistribute it and/or
  6195. + modify it under the terms of the GNU Lesser General Public
  6196. + License as published by the Free Software Foundation; either
  6197. + version 2.1 of the License, or (at your option) any later version.
  6198. +
  6199. + The GNU C Library is distributed in the hope that it will be useful,
  6200. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6201. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6202. + Lesser General Public License for more details.
  6203. +
  6204. + You should have received a copy of the GNU Lesser General Public
  6205. + License along with the GNU C Library; if not, see
  6206. + <http://www.gnu.org/licenses/>. */
  6207. +
  6208. +#include "pthreadP.h"
  6209. +
  6210. +int
  6211. +pthread_spin_lock (pthread_spinlock_t *lock)
  6212. +{
  6213. + __asm__ __volatile__
  6214. + ("1: ldstub [%0], %%g2\n"
  6215. + " orcc %%g2, 0x0, %%g0\n"
  6216. + " bne,a 2f\n"
  6217. + " ldub [%0], %%g2\n"
  6218. + ".subsection 2\n"
  6219. + "2: orcc %%g2, 0x0, %%g0\n"
  6220. + " bne,a 2b\n"
  6221. + " ldub [%0], %%g2\n"
  6222. + " b,a 1b\n"
  6223. + ".previous"
  6224. + : /* no outputs */
  6225. + : "r" (lock)
  6226. + : "g2", "memory", "cc");
  6227. + return 0;
  6228. +}
  6229. diff --git a/libpthread/nptl/sysdeps/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
  6230. new file mode 100644
  6231. index 0000000..c1b7b23
  6232. --- /dev/null
  6233. +++ b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
  6234. @@ -0,0 +1,28 @@
  6235. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6236. + This file is part of the GNU C Library.
  6237. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6238. +
  6239. + The GNU C Library is free software; you can redistribute it and/or
  6240. + modify it under the terms of the GNU Lesser General Public
  6241. + License as published by the Free Software Foundation; either
  6242. + version 2.1 of the License, or (at your option) any later version.
  6243. +
  6244. + The GNU C Library is distributed in the hope that it will be useful,
  6245. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6246. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6247. + Lesser General Public License for more details.
  6248. +
  6249. + You should have received a copy of the GNU Lesser General Public
  6250. + License along with the GNU C Library; if not, see
  6251. + <http://www.gnu.org/licenses/>. */
  6252. +
  6253. +#include <errno.h>
  6254. +#include "pthreadP.h"
  6255. +
  6256. +int
  6257. +pthread_spin_trylock (pthread_spinlock_t *lock)
  6258. +{
  6259. + int res;
  6260. + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6261. + return res == 0 ? 0 : EBUSY;
  6262. +}
  6263. diff --git a/libpthread/nptl/sysdeps/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
  6264. new file mode 100644
  6265. index 0000000..435fedc
  6266. --- /dev/null
  6267. +++ b/libpthread/nptl/sysdeps/pthreaddef.h
  6268. @@ -0,0 +1,39 @@
  6269. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6270. + This file is part of the GNU C Library.
  6271. +
  6272. + The GNU C Library is free software; you can redistribute it and/or
  6273. + modify it under the terms of the GNU Lesser General Public
  6274. + License as published by the Free Software Foundation; either
  6275. + version 2.1 of the License, or (at your option) any later version.
  6276. +
  6277. + The GNU C Library is distributed in the hope that it will be useful,
  6278. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6279. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6280. + Lesser General Public License for more details.
  6281. +
  6282. + You should have received a copy of the GNU Lesser General Public
  6283. + License along with the GNU C Library; if not, see
  6284. + <http://www.gnu.org/licenses/>. */
  6285. +
  6286. +/* Default stack size. */
  6287. +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6288. +
  6289. +/* Required stack pointer alignment at beginning. */
  6290. +#define STACK_ALIGN 16
  6291. +
  6292. +/* Minimal stack size after allocating thread descriptor and guard size. */
  6293. +#define MINIMAL_REST_STACK 2048
  6294. +
  6295. +/* Alignment requirement for TCB. */
  6296. +#define TCB_ALIGNMENT 16
  6297. +
  6298. +
  6299. +/* Location of current stack frame. */
  6300. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6301. +register char *stack_pointer __asm__("%sp");
  6302. +
  6303. +/* XXX Until we have a better place keep the definitions here. */
  6304. +
  6305. +/* While there is no such syscall. */
  6306. +#define __exit_thread_inline(val) \
  6307. + INLINE_SYSCALL (exit, 1, (val))
  6308. diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6309. index 6cbb37b..2f64e7d 100644
  6310. --- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6311. +++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6312. @@ -1,5 +1,27 @@
  6313. -#if defined(__arch64__)
  6314. -#include "sparc64/jmpbuf-unwind.h"
  6315. -#else
  6316. -#include "sparc32/jmpbuf-unwind.h"
  6317. -#endif
  6318. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6319. + This file is part of the GNU C Library.
  6320. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6321. +
  6322. + The GNU C Library is free software; you can redistribute it and/or
  6323. + modify it under the terms of the GNU Lesser General Public
  6324. + License as published by the Free Software Foundation; either
  6325. + version 2.1 of the License, or (at your option) any later version.
  6326. +
  6327. + The GNU C Library is distributed in the hope that it will be useful,
  6328. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6329. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6330. + Lesser General Public License for more details.
  6331. +
  6332. + You should have received a copy of the GNU Lesser General Public
  6333. + License along with the GNU C Library; if not, see
  6334. + <http://www.gnu.org/licenses/>. */
  6335. +
  6336. +#include <setjmp.h>
  6337. +#include <stdint.h>
  6338. +#include <unwind.h>
  6339. +
  6340. +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6341. + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6342. +
  6343. +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6344. + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6345. diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6346. index dcc5ae2..2dfcd3c 100644
  6347. --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6348. +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6349. @@ -1,5 +1,39 @@
  6350. -#if defined(__arch64__)
  6351. -#include "sparc64/pthread_spin_lock.c"
  6352. -#else
  6353. -#include "sparc32/pthread_spin_lock.c"
  6354. -#endif
  6355. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6356. + This file is part of the GNU C Library.
  6357. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6358. +
  6359. + The GNU C Library is free software; you can redistribute it and/or
  6360. + modify it under the terms of the GNU Lesser General Public
  6361. + License as published by the Free Software Foundation; either
  6362. + version 2.1 of the License, or (at your option) any later version.
  6363. +
  6364. + The GNU C Library is distributed in the hope that it will be useful,
  6365. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6366. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6367. + Lesser General Public License for more details.
  6368. +
  6369. + You should have received a copy of the GNU Lesser General Public
  6370. + License along with the GNU C Library; if not, see
  6371. + <http://www.gnu.org/licenses/>. */
  6372. +
  6373. +#include "pthreadP.h"
  6374. +
  6375. +int
  6376. +pthread_spin_lock (pthread_spinlock_t *lock)
  6377. +{
  6378. + __asm__ __volatile__
  6379. + ("1: ldstub [%0], %%g2\n"
  6380. + " orcc %%g2, 0x0, %%g0\n"
  6381. + " bne,a 2f\n"
  6382. + " ldub [%0], %%g2\n"
  6383. + ".subsection 2\n"
  6384. + "2: orcc %%g2, 0x0, %%g0\n"
  6385. + " bne,a 2b\n"
  6386. + " ldub [%0], %%g2\n"
  6387. + " b,a 1b\n"
  6388. + ".previous"
  6389. + : /* no outputs */
  6390. + : "r" (lock)
  6391. + : "g2", "memory", "cc");
  6392. + return 0;
  6393. +}
  6394. diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6395. index af63eec..c1b7b23 100644
  6396. --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6397. +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6398. @@ -1,5 +1,28 @@
  6399. -#if defined(__arch64__)
  6400. -#include "sparc64/pthread_spin_trylock.c"
  6401. -#else
  6402. -#include "sparc32/pthread_spin_trylock.c"
  6403. -#endif
  6404. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6405. + This file is part of the GNU C Library.
  6406. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6407. +
  6408. + The GNU C Library is free software; you can redistribute it and/or
  6409. + modify it under the terms of the GNU Lesser General Public
  6410. + License as published by the Free Software Foundation; either
  6411. + version 2.1 of the License, or (at your option) any later version.
  6412. +
  6413. + The GNU C Library is distributed in the hope that it will be useful,
  6414. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6415. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6416. + Lesser General Public License for more details.
  6417. +
  6418. + You should have received a copy of the GNU Lesser General Public
  6419. + License along with the GNU C Library; if not, see
  6420. + <http://www.gnu.org/licenses/>. */
  6421. +
  6422. +#include <errno.h>
  6423. +#include "pthreadP.h"
  6424. +
  6425. +int
  6426. +pthread_spin_trylock (pthread_spinlock_t *lock)
  6427. +{
  6428. + int res;
  6429. + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6430. + return res == 0 ? 0 : EBUSY;
  6431. +}
  6432. diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6433. index d4695c4..435fedc 100644
  6434. --- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6435. +++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6436. @@ -1,5 +1,39 @@
  6437. -#if defined(__arch64__)
  6438. -#include "sparc64/pthreaddef.h"
  6439. -#else
  6440. -#include "sparc32/pthreaddef.h"
  6441. -#endif
  6442. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6443. + This file is part of the GNU C Library.
  6444. +
  6445. + The GNU C Library is free software; you can redistribute it and/or
  6446. + modify it under the terms of the GNU Lesser General Public
  6447. + License as published by the Free Software Foundation; either
  6448. + version 2.1 of the License, or (at your option) any later version.
  6449. +
  6450. + The GNU C Library is distributed in the hope that it will be useful,
  6451. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6452. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6453. + Lesser General Public License for more details.
  6454. +
  6455. + You should have received a copy of the GNU Lesser General Public
  6456. + License along with the GNU C Library; if not, see
  6457. + <http://www.gnu.org/licenses/>. */
  6458. +
  6459. +/* Default stack size. */
  6460. +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6461. +
  6462. +/* Required stack pointer alignment at beginning. */
  6463. +#define STACK_ALIGN 16
  6464. +
  6465. +/* Minimal stack size after allocating thread descriptor and guard size. */
  6466. +#define MINIMAL_REST_STACK 2048
  6467. +
  6468. +/* Alignment requirement for TCB. */
  6469. +#define TCB_ALIGNMENT 16
  6470. +
  6471. +
  6472. +/* Location of current stack frame. */
  6473. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6474. +register char *stack_pointer __asm__("%sp");
  6475. +
  6476. +/* XXX Until we have a better place keep the definitions here. */
  6477. +
  6478. +/* While there is no such syscall. */
  6479. +#define __exit_thread_inline(val) \
  6480. + INLINE_SYSCALL (exit, 1, (val))
  6481. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
  6482. deleted file mode 100644
  6483. index 2f64e7d..0000000
  6484. --- a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
  6485. +++ /dev/null
  6486. @@ -1,27 +0,0 @@
  6487. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6488. - This file is part of the GNU C Library.
  6489. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6490. -
  6491. - The GNU C Library is free software; you can redistribute it and/or
  6492. - modify it under the terms of the GNU Lesser General Public
  6493. - License as published by the Free Software Foundation; either
  6494. - version 2.1 of the License, or (at your option) any later version.
  6495. -
  6496. - The GNU C Library is distributed in the hope that it will be useful,
  6497. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6498. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6499. - Lesser General Public License for more details.
  6500. -
  6501. - You should have received a copy of the GNU Lesser General Public
  6502. - License along with the GNU C Library; if not, see
  6503. - <http://www.gnu.org/licenses/>. */
  6504. -
  6505. -#include <setjmp.h>
  6506. -#include <stdint.h>
  6507. -#include <unwind.h>
  6508. -
  6509. -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6510. - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6511. -
  6512. -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6513. - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6514. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
  6515. deleted file mode 100644
  6516. index 2dfcd3c..0000000
  6517. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
  6518. +++ /dev/null
  6519. @@ -1,39 +0,0 @@
  6520. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6521. - This file is part of the GNU C Library.
  6522. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6523. -
  6524. - The GNU C Library is free software; you can redistribute it and/or
  6525. - modify it under the terms of the GNU Lesser General Public
  6526. - License as published by the Free Software Foundation; either
  6527. - version 2.1 of the License, or (at your option) any later version.
  6528. -
  6529. - The GNU C Library is distributed in the hope that it will be useful,
  6530. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6531. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6532. - Lesser General Public License for more details.
  6533. -
  6534. - You should have received a copy of the GNU Lesser General Public
  6535. - License along with the GNU C Library; if not, see
  6536. - <http://www.gnu.org/licenses/>. */
  6537. -
  6538. -#include "pthreadP.h"
  6539. -
  6540. -int
  6541. -pthread_spin_lock (pthread_spinlock_t *lock)
  6542. -{
  6543. - __asm__ __volatile__
  6544. - ("1: ldstub [%0], %%g2\n"
  6545. - " orcc %%g2, 0x0, %%g0\n"
  6546. - " bne,a 2f\n"
  6547. - " ldub [%0], %%g2\n"
  6548. - ".subsection 2\n"
  6549. - "2: orcc %%g2, 0x0, %%g0\n"
  6550. - " bne,a 2b\n"
  6551. - " ldub [%0], %%g2\n"
  6552. - " b,a 1b\n"
  6553. - ".previous"
  6554. - : /* no outputs */
  6555. - : "r" (lock)
  6556. - : "g2", "memory", "cc");
  6557. - return 0;
  6558. -}
  6559. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
  6560. deleted file mode 100644
  6561. index c1b7b23..0000000
  6562. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
  6563. +++ /dev/null
  6564. @@ -1,28 +0,0 @@
  6565. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6566. - This file is part of the GNU C Library.
  6567. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6568. -
  6569. - The GNU C Library is free software; you can redistribute it and/or
  6570. - modify it under the terms of the GNU Lesser General Public
  6571. - License as published by the Free Software Foundation; either
  6572. - version 2.1 of the License, or (at your option) any later version.
  6573. -
  6574. - The GNU C Library is distributed in the hope that it will be useful,
  6575. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6576. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6577. - Lesser General Public License for more details.
  6578. -
  6579. - You should have received a copy of the GNU Lesser General Public
  6580. - License along with the GNU C Library; if not, see
  6581. - <http://www.gnu.org/licenses/>. */
  6582. -
  6583. -#include <errno.h>
  6584. -#include "pthreadP.h"
  6585. -
  6586. -int
  6587. -pthread_spin_trylock (pthread_spinlock_t *lock)
  6588. -{
  6589. - int res;
  6590. - __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6591. - return res == 0 ? 0 : EBUSY;
  6592. -}
  6593. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
  6594. deleted file mode 100644
  6595. index 435fedc..0000000
  6596. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
  6597. +++ /dev/null
  6598. @@ -1,39 +0,0 @@
  6599. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6600. - This file is part of the GNU C Library.
  6601. -
  6602. - The GNU C Library is free software; you can redistribute it and/or
  6603. - modify it under the terms of the GNU Lesser General Public
  6604. - License as published by the Free Software Foundation; either
  6605. - version 2.1 of the License, or (at your option) any later version.
  6606. -
  6607. - The GNU C Library is distributed in the hope that it will be useful,
  6608. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6609. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6610. - Lesser General Public License for more details.
  6611. -
  6612. - You should have received a copy of the GNU Lesser General Public
  6613. - License along with the GNU C Library; if not, see
  6614. - <http://www.gnu.org/licenses/>. */
  6615. -
  6616. -/* Default stack size. */
  6617. -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6618. -
  6619. -/* Required stack pointer alignment at beginning. */
  6620. -#define STACK_ALIGN 16
  6621. -
  6622. -/* Minimal stack size after allocating thread descriptor and guard size. */
  6623. -#define MINIMAL_REST_STACK 2048
  6624. -
  6625. -/* Alignment requirement for TCB. */
  6626. -#define TCB_ALIGNMENT 16
  6627. -
  6628. -
  6629. -/* Location of current stack frame. */
  6630. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6631. -register char *stack_pointer __asm__("%sp");
  6632. -
  6633. -/* XXX Until we have a better place keep the definitions here. */
  6634. -
  6635. -/* While there is no such syscall. */
  6636. -#define __exit_thread_inline(val) \
  6637. - INLINE_SYSCALL (exit, 1, (val))
  6638. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
  6639. deleted file mode 100644
  6640. index 3d314be..0000000
  6641. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
  6642. +++ /dev/null
  6643. @@ -1,38 +0,0 @@
  6644. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6645. - This file is part of the GNU C Library.
  6646. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6647. -
  6648. - The GNU C Library is free software; you can redistribute it and/or
  6649. - modify it under the terms of the GNU Lesser General Public
  6650. - License as published by the Free Software Foundation; either
  6651. - version 2.1 of the License, or (at your option) any later version.
  6652. -
  6653. - The GNU C Library is distributed in the hope that it will be useful,
  6654. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6655. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6656. - Lesser General Public License for more details.
  6657. -
  6658. - You should have received a copy of the GNU Lesser General Public
  6659. - License along with the GNU C Library; if not, see
  6660. - <http://www.gnu.org/licenses/>. */
  6661. -
  6662. -#include "pthreadP.h"
  6663. -
  6664. -int
  6665. -pthread_spin_lock (pthread_spinlock_t *lock)
  6666. -{
  6667. - __asm__ __volatile__
  6668. - ("1: ldstub [%0], %%g2\n"
  6669. - " brnz,pn %%g2, 2f\n"
  6670. - " membar #StoreLoad | #StoreStore\n"
  6671. - ".subsection 2\n"
  6672. - "2: ldub [%0], %%g2\n"
  6673. - " brnz,pt %%g2, 2b\n"
  6674. - " membar #LoadLoad\n"
  6675. - " b,a,pt %%xcc, 1b\n"
  6676. - ".previous"
  6677. - : /* no outputs */
  6678. - : "r" (lock)
  6679. - : "g2", "memory");
  6680. - return 0;
  6681. -}
  6682. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
  6683. deleted file mode 100644
  6684. index 3b20a21..0000000
  6685. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
  6686. +++ /dev/null
  6687. @@ -1 +0,0 @@
  6688. -#include <sparc64/pthread_spin_trylock.c>
  6689. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
  6690. deleted file mode 100644
  6691. index 482cbe3..0000000
  6692. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
  6693. +++ /dev/null
  6694. @@ -1 +0,0 @@
  6695. -#include <sparc64/pthread_spin_unlock.c>
  6696. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
  6697. deleted file mode 100644
  6698. index 2f64e7d..0000000
  6699. --- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
  6700. +++ /dev/null
  6701. @@ -1,27 +0,0 @@
  6702. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6703. - This file is part of the GNU C Library.
  6704. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6705. -
  6706. - The GNU C Library is free software; you can redistribute it and/or
  6707. - modify it under the terms of the GNU Lesser General Public
  6708. - License as published by the Free Software Foundation; either
  6709. - version 2.1 of the License, or (at your option) any later version.
  6710. -
  6711. - The GNU C Library is distributed in the hope that it will be useful,
  6712. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6713. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6714. - Lesser General Public License for more details.
  6715. -
  6716. - You should have received a copy of the GNU Lesser General Public
  6717. - License along with the GNU C Library; if not, see
  6718. - <http://www.gnu.org/licenses/>. */
  6719. -
  6720. -#include <setjmp.h>
  6721. -#include <stdint.h>
  6722. -#include <unwind.h>
  6723. -
  6724. -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6725. - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6726. -
  6727. -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6728. - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6729. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
  6730. deleted file mode 100644
  6731. index 0235056..0000000
  6732. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
  6733. +++ /dev/null
  6734. @@ -1,38 +0,0 @@
  6735. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6736. - This file is part of the GNU C Library.
  6737. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6738. -
  6739. - The GNU C Library is free software; you can redistribute it and/or
  6740. - modify it under the terms of the GNU Lesser General Public
  6741. - License as published by the Free Software Foundation; either
  6742. - version 2.1 of the License, or (at your option) any later version.
  6743. -
  6744. - The GNU C Library is distributed in the hope that it will be useful,
  6745. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6746. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6747. - Lesser General Public License for more details.
  6748. -
  6749. - You should have received a copy of the GNU Lesser General Public
  6750. - License along with the GNU C Library; if not, see
  6751. - <http://www.gnu.org/licenses/>. */
  6752. -
  6753. -#include "pthreadP.h"
  6754. -
  6755. -int
  6756. -pthread_spin_lock (pthread_spinlock_t *lock)
  6757. -{
  6758. - __asm__ __volatile__
  6759. - ("1: ldstub [%0], %%g5\n"
  6760. - " brnz,pn %%g5, 2f\n"
  6761. - " membar #StoreLoad | #StoreStore\n"
  6762. - ".subsection 2\n"
  6763. - "2: ldub [%0], %%g5\n"
  6764. - " brnz,pt %%g5, 2b\n"
  6765. - " membar #LoadLoad\n"
  6766. - " b,a,pt %%xcc, 1b\n"
  6767. - ".previous"
  6768. - : /* no outputs */
  6769. - : "r" (lock)
  6770. - : "g5", "memory");
  6771. - return 0;
  6772. -}
  6773. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
  6774. deleted file mode 100644
  6775. index b14621b..0000000
  6776. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
  6777. +++ /dev/null
  6778. @@ -1,33 +0,0 @@
  6779. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6780. - This file is part of the GNU C Library.
  6781. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6782. -
  6783. - The GNU C Library is free software; you can redistribute it and/or
  6784. - modify it under the terms of the GNU Lesser General Public
  6785. - License as published by the Free Software Foundation; either
  6786. - version 2.1 of the License, or (at your option) any later version.
  6787. -
  6788. - The GNU C Library is distributed in the hope that it will be useful,
  6789. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6790. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6791. - Lesser General Public License for more details.
  6792. -
  6793. - You should have received a copy of the GNU Lesser General Public
  6794. - License along with the GNU C Library; if not, see
  6795. - <http://www.gnu.org/licenses/>. */
  6796. -
  6797. -#include <errno.h>
  6798. -#include "pthreadP.h"
  6799. -
  6800. -int
  6801. -pthread_spin_trylock (pthread_spinlock_t *lock)
  6802. -{
  6803. - int res;
  6804. - __asm__ __volatile__
  6805. - ("ldstub [%1], %0\n"
  6806. - "membar #StoreLoad | #StoreStore"
  6807. - : "=r" (res)
  6808. - : "r" (lock)
  6809. - : "memory");
  6810. - return res == 0 ? 0 : EBUSY;
  6811. -}
  6812. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
  6813. deleted file mode 100644
  6814. index a00fad3..0000000
  6815. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
  6816. +++ /dev/null
  6817. @@ -1,29 +0,0 @@
  6818. -/* pthread_spin_unlock -- unlock a spin lock. Generic version.
  6819. - Copyright (C) 2003 Free Software Foundation, Inc.
  6820. - This file is part of the GNU C Library.
  6821. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  6822. -
  6823. - The GNU C Library is free software; you can redistribute it and/or
  6824. - modify it under the terms of the GNU Lesser General Public
  6825. - License as published by the Free Software Foundation; either
  6826. - version 2.1 of the License, or (at your option) any later version.
  6827. -
  6828. - The GNU C Library is distributed in the hope that it will be useful,
  6829. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6830. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6831. - Lesser General Public License for more details.
  6832. -
  6833. - You should have received a copy of the GNU Lesser General Public
  6834. - License along with the GNU C Library; if not, see
  6835. - <http://www.gnu.org/licenses/>. */
  6836. -
  6837. -#include "pthreadP.h"
  6838. -#include <atomic.h>
  6839. -
  6840. -int
  6841. -pthread_spin_unlock (pthread_spinlock_t *lock)
  6842. -{
  6843. - __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
  6844. - *lock = 0;
  6845. - return 0;
  6846. -}
  6847. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
  6848. deleted file mode 100644
  6849. index 845f4bf..0000000
  6850. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
  6851. +++ /dev/null
  6852. @@ -1,39 +0,0 @@
  6853. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6854. - This file is part of the GNU C Library.
  6855. -
  6856. - The GNU C Library is free software; you can redistribute it and/or
  6857. - modify it under the terms of the GNU Lesser General Public
  6858. - License as published by the Free Software Foundation; either
  6859. - version 2.1 of the License, or (at your option) any later version.
  6860. -
  6861. - The GNU C Library is distributed in the hope that it will be useful,
  6862. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6863. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6864. - Lesser General Public License for more details.
  6865. -
  6866. - You should have received a copy of the GNU Lesser General Public
  6867. - License along with the GNU C Library; if not, see
  6868. - <http://www.gnu.org/licenses/>. */
  6869. -
  6870. -/* Default stack size. */
  6871. -#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
  6872. -
  6873. -/* Required stack pointer alignment at beginning. */
  6874. -#define STACK_ALIGN 16
  6875. -
  6876. -/* Minimal stack size after allocating thread descriptor and guard size. */
  6877. -#define MINIMAL_REST_STACK 4096
  6878. -
  6879. -/* Alignment requirement for TCB. */
  6880. -#define TCB_ALIGNMENT 16
  6881. -
  6882. -
  6883. -/* Location of current stack frame. */
  6884. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  6885. -register char *stack_pointer __asm__("%sp");
  6886. -
  6887. -/* XXX Until we have a better place keep the definitions here. */
  6888. -
  6889. -/* While there is no such syscall. */
  6890. -#define __exit_thread_inline(val) \
  6891. - INLINE_SYSCALL (exit, 1, (val))
  6892. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6893. index dfc5e82..a6142aa 100644
  6894. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6895. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6896. @@ -1,5 +1,2 @@
  6897. -#if defined(__arch64__)
  6898. -#include "./sparc64/clone.S"
  6899. -#else
  6900. -#include "./sparc32/clone.S"
  6901. -#endif
  6902. +#define RESET_PID
  6903. +#include <libc/sysdeps/linux/sparc/clone.S>
  6904. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6905. index e8705c5..37231a8 100644
  6906. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6907. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6908. @@ -1,5 +1,44 @@
  6909. -#if defined(__arch64__)
  6910. -#include "sparc64/pt-vfork.S"
  6911. -#else
  6912. -#include "sparc32/pt-vfork.S"
  6913. -#endif
  6914. +/* Copyright (C) 2004 Free Software Foundation, Inc.
  6915. + This file is part of the GNU C Library.
  6916. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  6917. +
  6918. + The GNU C Library is free software; you can redistribute it and/or
  6919. + modify it under the terms of the GNU Lesser General Public
  6920. + License as published by the Free Software Foundation; either
  6921. + version 2.1 of the License, or (at your option) any later version.
  6922. +
  6923. + The GNU C Library is distributed in the hope that it will be useful,
  6924. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6925. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6926. + Lesser General Public License for more details.
  6927. +
  6928. + You should have received a copy of the GNU Lesser General Public
  6929. + License along with the GNU C Library; if not, see
  6930. + <http://www.gnu.org/licenses/>. */
  6931. +
  6932. +#include <sysdep.h>
  6933. +#include <tcb-offsets.h>
  6934. +
  6935. + .text
  6936. + .globl __syscall_error
  6937. +ENTRY(__vfork)
  6938. + ld [%g7 + PID], %o5
  6939. + sub %g0, %o5, %o4
  6940. + st %o4, [%g7 + PID]
  6941. +
  6942. + LOADSYSCALL(vfork)
  6943. + ta 0x10
  6944. + bcc 2f
  6945. + mov %o7, %g1
  6946. + st %o5, [%g7 + PID]
  6947. + call __syscall_error
  6948. + mov %g1, %o7
  6949. +2: sub %o1, 1, %o1
  6950. + andcc %o0, %o1, %o0
  6951. + bne,a 1f
  6952. + st %o5, [%g7 + PID]
  6953. +1: retl
  6954. + nop
  6955. +END(__vfork)
  6956. +
  6957. +weak_alias (__vfork, vfork)
  6958. 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
  6959. index 73eaa69..169f6e7 100644
  6960. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
  6961. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
  6962. @@ -1 +1,93 @@
  6963. -#include "sparc32/pthread_barrier_wait.c"
  6964. +/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  6965. + This file is part of the GNU C Library.
  6966. + Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
  6967. +
  6968. + The GNU C Library is free software; you can redistribute it and/or
  6969. + modify it under the terms of the GNU Lesser General Public
  6970. + License as published by the Free Software Foundation; either
  6971. + version 2.1 of the License, or (at your option) any later version.
  6972. +
  6973. + The GNU C Library is distributed in the hope that it will be useful,
  6974. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6975. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6976. + Lesser General Public License for more details.
  6977. +
  6978. + You should have received a copy of the GNU Lesser General Public
  6979. + License along with the GNU C Library; if not, see
  6980. + <http://www.gnu.org/licenses/>. */
  6981. +
  6982. +#include <errno.h>
  6983. +#include <sysdep.h>
  6984. +#include <lowlevellock.h>
  6985. +#include <pthreadP.h>
  6986. +
  6987. +/* Wait on barrier. */
  6988. +int
  6989. +pthread_barrier_wait (
  6990. + pthread_barrier_t *barrier)
  6991. +{
  6992. + union sparc_pthread_barrier *ibarrier
  6993. + = (union sparc_pthread_barrier *) barrier;
  6994. + int result = 0;
  6995. + int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
  6996. +
  6997. + /* Make sure we are alone. */
  6998. + lll_lock (ibarrier->b.lock, private);
  6999. +
  7000. + /* One more arrival. */
  7001. + --ibarrier->b.left;
  7002. +
  7003. + /* Are these all? */
  7004. + if (ibarrier->b.left == 0)
  7005. + {
  7006. + /* Yes. Increment the event counter to avoid invalid wake-ups and
  7007. + tell the current waiters that it is their turn. */
  7008. + ++ibarrier->b.curr_event;
  7009. +
  7010. + /* Wake up everybody. */
  7011. + lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
  7012. +
  7013. + /* This is the thread which finished the serialization. */
  7014. + result = PTHREAD_BARRIER_SERIAL_THREAD;
  7015. + }
  7016. + else
  7017. + {
  7018. + /* The number of the event we are waiting for. The barrier's event
  7019. + number must be bumped before we continue. */
  7020. + unsigned int event = ibarrier->b.curr_event;
  7021. +
  7022. + /* Before suspending, make the barrier available to others. */
  7023. + lll_unlock (ibarrier->b.lock, private);
  7024. +
  7025. + /* Wait for the event counter of the barrier to change. */
  7026. + do
  7027. + lll_futex_wait (&ibarrier->b.curr_event, event, private);
  7028. + while (event == ibarrier->b.curr_event);
  7029. + }
  7030. +
  7031. + /* Make sure the init_count is stored locally or in a register. */
  7032. + unsigned int init_count = ibarrier->b.init_count;
  7033. +
  7034. + /* If this was the last woken thread, unlock. */
  7035. + if (__atomic_is_v9 || ibarrier->s.pshared == 0)
  7036. + {
  7037. + if (atomic_increment_val (&ibarrier->b.left) == init_count)
  7038. + /* We are done. */
  7039. + lll_unlock (ibarrier->b.lock, private);
  7040. + }
  7041. + else
  7042. + {
  7043. + unsigned int left;
  7044. + /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
  7045. + is only atomic for threads within the same process, not for
  7046. + multiple processes. */
  7047. + __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
  7048. + left = ++ibarrier->b.left;
  7049. + __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
  7050. + if (left == init_count)
  7051. + /* We are done. */
  7052. + lll_unlock (ibarrier->b.lock, private);
  7053. + }
  7054. +
  7055. + return result;
  7056. +}
  7057. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
  7058. new file mode 100644
  7059. index 0000000..8da4193
  7060. --- /dev/null
  7061. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
  7062. @@ -0,0 +1,52 @@
  7063. +/* sem_post -- post to a POSIX semaphore. SPARC version.
  7064. + Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7065. + This file is part of the GNU C Library.
  7066. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  7067. +
  7068. + The GNU C Library is free software; you can redistribute it and/or
  7069. + modify it under the terms of the GNU Lesser General Public
  7070. + License as published by the Free Software Foundation; either
  7071. + version 2.1 of the License, or (at your option) any later version.
  7072. +
  7073. + The GNU C Library is distributed in the hope that it will be useful,
  7074. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7075. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7076. + Lesser General Public License for more details.
  7077. +
  7078. + You should have received a copy of the GNU Lesser General Public
  7079. + License along with the GNU C Library; if not, see
  7080. + <http://www.gnu.org/licenses/>. */
  7081. +
  7082. +#include <errno.h>
  7083. +#include <sysdep.h>
  7084. +#include <lowlevellock.h>
  7085. +#include <internaltypes.h>
  7086. +#include <semaphore.h>
  7087. +
  7088. +int
  7089. +sem_post (sem_t *sem)
  7090. +{
  7091. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7092. + int nr;
  7093. +
  7094. + if (__atomic_is_v9)
  7095. + nr = atomic_increment_val (&isem->value);
  7096. + else
  7097. + {
  7098. + __sparc32_atomic_do_lock24 (&isem->lock);
  7099. + nr = ++(isem->value);
  7100. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7101. + }
  7102. + atomic_full_barrier ();
  7103. + if (isem->nwaiters > 0)
  7104. + {
  7105. + int err = lll_futex_wake (&isem->value, 1,
  7106. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7107. + if (__builtin_expect (err, 0) < 0)
  7108. + {
  7109. + __set_errno (-err);
  7110. + return -1;
  7111. + }
  7112. + }
  7113. + return 0;
  7114. +}
  7115. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
  7116. new file mode 100644
  7117. index 0000000..64c9abf
  7118. --- /dev/null
  7119. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
  7120. @@ -0,0 +1,147 @@
  7121. +/* sem_timedwait -- wait on a semaphore. SPARC version.
  7122. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7123. + This file is part of the GNU C Library.
  7124. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7125. +
  7126. + The GNU C Library is free software; you can redistribute it and/or
  7127. + modify it under the terms of the GNU Lesser General Public
  7128. + License as published by the Free Software Foundation; either
  7129. + version 2.1 of the License, or (at your option) any later version.
  7130. +
  7131. + The GNU C Library is distributed in the hope that it will be useful,
  7132. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7133. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7134. + Lesser General Public License for more details.
  7135. +
  7136. + You should have received a copy of the GNU Lesser General Public
  7137. + License along with the GNU C Library; if not, see
  7138. + <http://www.gnu.org/licenses/>. */
  7139. +
  7140. +#include <errno.h>
  7141. +#include <sysdep.h>
  7142. +#include <lowlevellock.h>
  7143. +#include <internaltypes.h>
  7144. +#include <semaphore.h>
  7145. +
  7146. +#include <pthreadP.h>
  7147. +
  7148. +
  7149. +extern void __sem_wait_cleanup (void *arg) attribute_hidden;
  7150. +
  7151. +
  7152. +int
  7153. +sem_timedwait (sem_t *sem, const struct timespec *abstime)
  7154. +{
  7155. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7156. + int err;
  7157. + int val;
  7158. +
  7159. + if (__atomic_is_v9)
  7160. + val = atomic_decrement_if_positive (&isem->value);
  7161. + else
  7162. + {
  7163. + __sparc32_atomic_do_lock24 (&isem->lock);
  7164. + val = isem->value;
  7165. + if (val > 0)
  7166. + isem->value = val - 1;
  7167. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7168. + }
  7169. +
  7170. + if (val > 0)
  7171. + return 0;
  7172. +
  7173. + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
  7174. + {
  7175. + __set_errno (EINVAL);
  7176. + return -1;
  7177. + }
  7178. +
  7179. + if (__atomic_is_v9)
  7180. + atomic_increment (&isem->nwaiters);
  7181. + else
  7182. + {
  7183. + __sparc32_atomic_do_lock24 (&isem->lock);
  7184. + isem->nwaiters++;
  7185. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7186. + }
  7187. +
  7188. + pthread_cleanup_push (__sem_wait_cleanup, isem);
  7189. +
  7190. + while (1)
  7191. + {
  7192. + struct timeval tv;
  7193. + struct timespec rt;
  7194. + int sec, nsec;
  7195. +
  7196. + /* Get the current time. */
  7197. + __gettimeofday (&tv, NULL);
  7198. +
  7199. + /* Compute relative timeout. */
  7200. + sec = abstime->tv_sec - tv.tv_sec;
  7201. + nsec = abstime->tv_nsec - tv.tv_usec * 1000;
  7202. + if (nsec < 0)
  7203. + {
  7204. + nsec += 1000000000;
  7205. + --sec;
  7206. + }
  7207. +
  7208. + /* Already timed out? */
  7209. + err = -ETIMEDOUT;
  7210. + if (sec < 0)
  7211. + {
  7212. + __set_errno (ETIMEDOUT);
  7213. + err = -1;
  7214. + break;
  7215. + }
  7216. +
  7217. + /* Do wait. */
  7218. + rt.tv_sec = sec;
  7219. + rt.tv_nsec = nsec;
  7220. +
  7221. + /* Enable asynchronous cancellation. Required by the standard. */
  7222. + int oldtype = __pthread_enable_asynccancel ();
  7223. +
  7224. + err = lll_futex_timed_wait (&isem->value, 0, &rt,
  7225. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7226. +
  7227. + /* Disable asynchronous cancellation. */
  7228. + __pthread_disable_asynccancel (oldtype);
  7229. +
  7230. + if (err != 0 && err != -EWOULDBLOCK)
  7231. + {
  7232. + __set_errno (-err);
  7233. + err = -1;
  7234. + break;
  7235. + }
  7236. +
  7237. + if (__atomic_is_v9)
  7238. + val = atomic_decrement_if_positive (&isem->value);
  7239. + else
  7240. + {
  7241. + __sparc32_atomic_do_lock24 (&isem->lock);
  7242. + val = isem->value;
  7243. + if (val > 0)
  7244. + isem->value = val - 1;
  7245. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7246. + }
  7247. +
  7248. + if (val > 0)
  7249. + {
  7250. + err = 0;
  7251. + break;
  7252. + }
  7253. + }
  7254. +
  7255. + pthread_cleanup_pop (0);
  7256. +
  7257. + if (__atomic_is_v9)
  7258. + atomic_decrement (&isem->nwaiters);
  7259. + else
  7260. + {
  7261. + __sparc32_atomic_do_lock24 (&isem->lock);
  7262. + isem->nwaiters--;
  7263. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7264. + }
  7265. +
  7266. + return err;
  7267. +}
  7268. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
  7269. new file mode 100644
  7270. index 0000000..36e859b
  7271. --- /dev/null
  7272. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
  7273. @@ -0,0 +1,51 @@
  7274. +/* sem_trywait -- wait on a semaphore. SPARC version.
  7275. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7276. + This file is part of the GNU C Library.
  7277. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7278. +
  7279. + The GNU C Library is free software; you can redistribute it and/or
  7280. + modify it under the terms of the GNU Lesser General Public
  7281. + License as published by the Free Software Foundation; either
  7282. + version 2.1 of the License, or (at your option) any later version.
  7283. +
  7284. + The GNU C Library is distributed in the hope that it will be useful,
  7285. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7286. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7287. + Lesser General Public License for more details.
  7288. +
  7289. + You should have received a copy of the GNU Lesser General Public
  7290. + License along with the GNU C Library; if not, see
  7291. + <http://www.gnu.org/licenses/>. */
  7292. +
  7293. +#include <errno.h>
  7294. +#include <sysdep.h>
  7295. +#include <lowlevellock.h>
  7296. +#include <internaltypes.h>
  7297. +#include <semaphore.h>
  7298. +
  7299. +
  7300. +int
  7301. +sem_trywait (sem_t *sem)
  7302. +{
  7303. + struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
  7304. + int val;
  7305. +
  7306. + if (isem->value > 0)
  7307. + {
  7308. + if (__atomic_is_v9)
  7309. + val = atomic_decrement_if_positive (&isem->value);
  7310. + else
  7311. + {
  7312. + __sparc32_atomic_do_lock24 (&isem->lock);
  7313. + val = isem->value;
  7314. + if (val > 0)
  7315. + isem->value = val - 1;
  7316. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7317. + }
  7318. + if (val > 0)
  7319. + return 0;
  7320. + }
  7321. +
  7322. + __set_errno (EAGAIN);
  7323. + return -1;
  7324. +}
  7325. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
  7326. new file mode 100644
  7327. index 0000000..5d887ab
  7328. --- /dev/null
  7329. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
  7330. @@ -0,0 +1,124 @@
  7331. +/* sem_wait -- wait on a semaphore. Generic futex-using version.
  7332. + Copyright (C) 2003, 2007 Free Software Foundation, Inc.
  7333. + This file is part of the GNU C Library.
  7334. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7335. +
  7336. + The GNU C Library is free software; you can redistribute it and/or
  7337. + modify it under the terms of the GNU Lesser General Public
  7338. + License as published by the Free Software Foundation; either
  7339. + version 2.1 of the License, or (at your option) any later version.
  7340. +
  7341. + The GNU C Library is distributed in the hope that it will be useful,
  7342. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7343. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7344. + Lesser General Public License for more details.
  7345. +
  7346. + You should have received a copy of the GNU Lesser General Public
  7347. + License along with the GNU C Library; if not, see
  7348. + <http://www.gnu.org/licenses/>. */
  7349. +
  7350. +#include <errno.h>
  7351. +#include <sysdep.h>
  7352. +#include <lowlevellock.h>
  7353. +#include <internaltypes.h>
  7354. +#include <semaphore.h>
  7355. +
  7356. +#include <pthreadP.h>
  7357. +
  7358. +
  7359. +void
  7360. +attribute_hidden
  7361. +__sem_wait_cleanup (void *arg)
  7362. +{
  7363. + struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
  7364. +
  7365. + if (__atomic_is_v9)
  7366. + atomic_decrement (&isem->nwaiters);
  7367. + else
  7368. + {
  7369. + __sparc32_atomic_do_lock24 (&isem->lock);
  7370. + isem->nwaiters--;
  7371. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7372. + }
  7373. +}
  7374. +
  7375. +
  7376. +int
  7377. +sem_wait (sem_t *sem)
  7378. +{
  7379. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7380. + int err;
  7381. + int val;
  7382. +
  7383. + if (__atomic_is_v9)
  7384. + val = atomic_decrement_if_positive (&isem->value);
  7385. + else
  7386. + {
  7387. + __sparc32_atomic_do_lock24 (&isem->lock);
  7388. + val = isem->value;
  7389. + if (val > 0)
  7390. + isem->value = val - 1;
  7391. + else
  7392. + isem->nwaiters++;
  7393. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7394. + }
  7395. +
  7396. + if (val > 0)
  7397. + return 0;
  7398. +
  7399. + if (__atomic_is_v9)
  7400. + atomic_increment (&isem->nwaiters);
  7401. + else
  7402. + /* Already done above while still holding isem->lock. */;
  7403. +
  7404. + pthread_cleanup_push (__sem_wait_cleanup, isem);
  7405. +
  7406. + while (1)
  7407. + {
  7408. + /* Enable asynchronous cancellation. Required by the standard. */
  7409. + int oldtype = __pthread_enable_asynccancel ();
  7410. +
  7411. + err = lll_futex_wait (&isem->value, 0,
  7412. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7413. +
  7414. + /* Disable asynchronous cancellation. */
  7415. + __pthread_disable_asynccancel (oldtype);
  7416. +
  7417. + if (err != 0 && err != -EWOULDBLOCK)
  7418. + {
  7419. + __set_errno (-err);
  7420. + err = -1;
  7421. + break;
  7422. + }
  7423. +
  7424. + if (__atomic_is_v9)
  7425. + val = atomic_decrement_if_positive (&isem->value);
  7426. + else
  7427. + {
  7428. + __sparc32_atomic_do_lock24 (&isem->lock);
  7429. + val = isem->value;
  7430. + if (val > 0)
  7431. + isem->value = val - 1;
  7432. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7433. + }
  7434. +
  7435. + if (val > 0)
  7436. + {
  7437. + err = 0;
  7438. + break;
  7439. + }
  7440. + }
  7441. +
  7442. + pthread_cleanup_pop (0);
  7443. +
  7444. + if (__atomic_is_v9)
  7445. + atomic_decrement (&isem->nwaiters);
  7446. + else
  7447. + {
  7448. + __sparc32_atomic_do_lock24 (&isem->lock);
  7449. + isem->nwaiters--;
  7450. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7451. + }
  7452. +
  7453. + return err;
  7454. +}
  7455. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
  7456. deleted file mode 100644
  7457. index a6142aa..0000000
  7458. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
  7459. +++ /dev/null
  7460. @@ -1,2 +0,0 @@
  7461. -#define RESET_PID
  7462. -#include <libc/sysdeps/linux/sparc/clone.S>
  7463. 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
  7464. deleted file mode 100644
  7465. index 37231a8..0000000
  7466. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
  7467. +++ /dev/null
  7468. @@ -1,44 +0,0 @@
  7469. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  7470. - This file is part of the GNU C Library.
  7471. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  7472. -
  7473. - The GNU C Library is free software; you can redistribute it and/or
  7474. - modify it under the terms of the GNU Lesser General Public
  7475. - License as published by the Free Software Foundation; either
  7476. - version 2.1 of the License, or (at your option) any later version.
  7477. -
  7478. - The GNU C Library is distributed in the hope that it will be useful,
  7479. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7480. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7481. - Lesser General Public License for more details.
  7482. -
  7483. - You should have received a copy of the GNU Lesser General Public
  7484. - License along with the GNU C Library; if not, see
  7485. - <http://www.gnu.org/licenses/>. */
  7486. -
  7487. -#include <sysdep.h>
  7488. -#include <tcb-offsets.h>
  7489. -
  7490. - .text
  7491. - .globl __syscall_error
  7492. -ENTRY(__vfork)
  7493. - ld [%g7 + PID], %o5
  7494. - sub %g0, %o5, %o4
  7495. - st %o4, [%g7 + PID]
  7496. -
  7497. - LOADSYSCALL(vfork)
  7498. - ta 0x10
  7499. - bcc 2f
  7500. - mov %o7, %g1
  7501. - st %o5, [%g7 + PID]
  7502. - call __syscall_error
  7503. - mov %g1, %o7
  7504. -2: sub %o1, 1, %o1
  7505. - andcc %o0, %o1, %o0
  7506. - bne,a 1f
  7507. - st %o5, [%g7 + PID]
  7508. -1: retl
  7509. - nop
  7510. -END(__vfork)
  7511. -
  7512. -weak_alias (__vfork, vfork)
  7513. 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
  7514. deleted file mode 100644
  7515. index 169f6e7..0000000
  7516. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
  7517. +++ /dev/null
  7518. @@ -1,93 +0,0 @@
  7519. -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7520. - This file is part of the GNU C Library.
  7521. - Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
  7522. -
  7523. - The GNU C Library is free software; you can redistribute it and/or
  7524. - modify it under the terms of the GNU Lesser General Public
  7525. - License as published by the Free Software Foundation; either
  7526. - version 2.1 of the License, or (at your option) any later version.
  7527. -
  7528. - The GNU C Library is distributed in the hope that it will be useful,
  7529. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7530. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7531. - Lesser General Public License for more details.
  7532. -
  7533. - You should have received a copy of the GNU Lesser General Public
  7534. - License along with the GNU C Library; if not, see
  7535. - <http://www.gnu.org/licenses/>. */
  7536. -
  7537. -#include <errno.h>
  7538. -#include <sysdep.h>
  7539. -#include <lowlevellock.h>
  7540. -#include <pthreadP.h>
  7541. -
  7542. -/* Wait on barrier. */
  7543. -int
  7544. -pthread_barrier_wait (
  7545. - pthread_barrier_t *barrier)
  7546. -{
  7547. - union sparc_pthread_barrier *ibarrier
  7548. - = (union sparc_pthread_barrier *) barrier;
  7549. - int result = 0;
  7550. - int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
  7551. -
  7552. - /* Make sure we are alone. */
  7553. - lll_lock (ibarrier->b.lock, private);
  7554. -
  7555. - /* One more arrival. */
  7556. - --ibarrier->b.left;
  7557. -
  7558. - /* Are these all? */
  7559. - if (ibarrier->b.left == 0)
  7560. - {
  7561. - /* Yes. Increment the event counter to avoid invalid wake-ups and
  7562. - tell the current waiters that it is their turn. */
  7563. - ++ibarrier->b.curr_event;
  7564. -
  7565. - /* Wake up everybody. */
  7566. - lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
  7567. -
  7568. - /* This is the thread which finished the serialization. */
  7569. - result = PTHREAD_BARRIER_SERIAL_THREAD;
  7570. - }
  7571. - else
  7572. - {
  7573. - /* The number of the event we are waiting for. The barrier's event
  7574. - number must be bumped before we continue. */
  7575. - unsigned int event = ibarrier->b.curr_event;
  7576. -
  7577. - /* Before suspending, make the barrier available to others. */
  7578. - lll_unlock (ibarrier->b.lock, private);
  7579. -
  7580. - /* Wait for the event counter of the barrier to change. */
  7581. - do
  7582. - lll_futex_wait (&ibarrier->b.curr_event, event, private);
  7583. - while (event == ibarrier->b.curr_event);
  7584. - }
  7585. -
  7586. - /* Make sure the init_count is stored locally or in a register. */
  7587. - unsigned int init_count = ibarrier->b.init_count;
  7588. -
  7589. - /* If this was the last woken thread, unlock. */
  7590. - if (__atomic_is_v9 || ibarrier->s.pshared == 0)
  7591. - {
  7592. - if (atomic_increment_val (&ibarrier->b.left) == init_count)
  7593. - /* We are done. */
  7594. - lll_unlock (ibarrier->b.lock, private);
  7595. - }
  7596. - else
  7597. - {
  7598. - unsigned int left;
  7599. - /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
  7600. - is only atomic for threads within the same process, not for
  7601. - multiple processes. */
  7602. - __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
  7603. - left = ++ibarrier->b.left;
  7604. - __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
  7605. - if (left == init_count)
  7606. - /* We are done. */
  7607. - lll_unlock (ibarrier->b.lock, private);
  7608. - }
  7609. -
  7610. - return result;
  7611. -}
  7612. 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
  7613. deleted file mode 100644
  7614. index 8da4193..0000000
  7615. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
  7616. +++ /dev/null
  7617. @@ -1,52 +0,0 @@
  7618. -/* sem_post -- post to a POSIX semaphore. SPARC version.
  7619. - Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7620. - This file is part of the GNU C Library.
  7621. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  7622. -
  7623. - The GNU C Library is free software; you can redistribute it and/or
  7624. - modify it under the terms of the GNU Lesser General Public
  7625. - License as published by the Free Software Foundation; either
  7626. - version 2.1 of the License, or (at your option) any later version.
  7627. -
  7628. - The GNU C Library is distributed in the hope that it will be useful,
  7629. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7630. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7631. - Lesser General Public License for more details.
  7632. -
  7633. - You should have received a copy of the GNU Lesser General Public
  7634. - License along with the GNU C Library; if not, see
  7635. - <http://www.gnu.org/licenses/>. */
  7636. -
  7637. -#include <errno.h>
  7638. -#include <sysdep.h>
  7639. -#include <lowlevellock.h>
  7640. -#include <internaltypes.h>
  7641. -#include <semaphore.h>
  7642. -
  7643. -int
  7644. -sem_post (sem_t *sem)
  7645. -{
  7646. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7647. - int nr;
  7648. -
  7649. - if (__atomic_is_v9)
  7650. - nr = atomic_increment_val (&isem->value);
  7651. - else
  7652. - {
  7653. - __sparc32_atomic_do_lock24 (&isem->lock);
  7654. - nr = ++(isem->value);
  7655. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7656. - }
  7657. - atomic_full_barrier ();
  7658. - if (isem->nwaiters > 0)
  7659. - {
  7660. - int err = lll_futex_wake (&isem->value, 1,
  7661. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7662. - if (__builtin_expect (err, 0) < 0)
  7663. - {
  7664. - __set_errno (-err);
  7665. - return -1;
  7666. - }
  7667. - }
  7668. - return 0;
  7669. -}
  7670. 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
  7671. deleted file mode 100644
  7672. index 64c9abf..0000000
  7673. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
  7674. +++ /dev/null
  7675. @@ -1,147 +0,0 @@
  7676. -/* sem_timedwait -- wait on a semaphore. SPARC version.
  7677. - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7678. - This file is part of the GNU C Library.
  7679. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7680. -
  7681. - The GNU C Library is free software; you can redistribute it and/or
  7682. - modify it under the terms of the GNU Lesser General Public
  7683. - License as published by the Free Software Foundation; either
  7684. - version 2.1 of the License, or (at your option) any later version.
  7685. -
  7686. - The GNU C Library is distributed in the hope that it will be useful,
  7687. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7688. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7689. - Lesser General Public License for more details.
  7690. -
  7691. - You should have received a copy of the GNU Lesser General Public
  7692. - License along with the GNU C Library; if not, see
  7693. - <http://www.gnu.org/licenses/>. */
  7694. -
  7695. -#include <errno.h>
  7696. -#include <sysdep.h>
  7697. -#include <lowlevellock.h>
  7698. -#include <internaltypes.h>
  7699. -#include <semaphore.h>
  7700. -
  7701. -#include <pthreadP.h>
  7702. -
  7703. -
  7704. -extern void __sem_wait_cleanup (void *arg) attribute_hidden;
  7705. -
  7706. -
  7707. -int
  7708. -sem_timedwait (sem_t *sem, const struct timespec *abstime)
  7709. -{
  7710. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7711. - int err;
  7712. - int val;
  7713. -
  7714. - if (__atomic_is_v9)
  7715. - val = atomic_decrement_if_positive (&isem->value);
  7716. - else
  7717. - {
  7718. - __sparc32_atomic_do_lock24 (&isem->lock);
  7719. - val = isem->value;
  7720. - if (val > 0)
  7721. - isem->value = val - 1;
  7722. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7723. - }
  7724. -
  7725. - if (val > 0)
  7726. - return 0;
  7727. -
  7728. - if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
  7729. - {
  7730. - __set_errno (EINVAL);
  7731. - return -1;
  7732. - }
  7733. -
  7734. - if (__atomic_is_v9)
  7735. - atomic_increment (&isem->nwaiters);
  7736. - else
  7737. - {
  7738. - __sparc32_atomic_do_lock24 (&isem->lock);
  7739. - isem->nwaiters++;
  7740. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7741. - }
  7742. -
  7743. - pthread_cleanup_push (__sem_wait_cleanup, isem);
  7744. -
  7745. - while (1)
  7746. - {
  7747. - struct timeval tv;
  7748. - struct timespec rt;
  7749. - int sec, nsec;
  7750. -
  7751. - /* Get the current time. */
  7752. - __gettimeofday (&tv, NULL);
  7753. -
  7754. - /* Compute relative timeout. */
  7755. - sec = abstime->tv_sec - tv.tv_sec;
  7756. - nsec = abstime->tv_nsec - tv.tv_usec * 1000;
  7757. - if (nsec < 0)
  7758. - {
  7759. - nsec += 1000000000;
  7760. - --sec;
  7761. - }
  7762. -
  7763. - /* Already timed out? */
  7764. - err = -ETIMEDOUT;
  7765. - if (sec < 0)
  7766. - {
  7767. - __set_errno (ETIMEDOUT);
  7768. - err = -1;
  7769. - break;
  7770. - }
  7771. -
  7772. - /* Do wait. */
  7773. - rt.tv_sec = sec;
  7774. - rt.tv_nsec = nsec;
  7775. -
  7776. - /* Enable asynchronous cancellation. Required by the standard. */
  7777. - int oldtype = __pthread_enable_asynccancel ();
  7778. -
  7779. - err = lll_futex_timed_wait (&isem->value, 0, &rt,
  7780. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7781. -
  7782. - /* Disable asynchronous cancellation. */
  7783. - __pthread_disable_asynccancel (oldtype);
  7784. -
  7785. - if (err != 0 && err != -EWOULDBLOCK)
  7786. - {
  7787. - __set_errno (-err);
  7788. - err = -1;
  7789. - break;
  7790. - }
  7791. -
  7792. - if (__atomic_is_v9)
  7793. - val = atomic_decrement_if_positive (&isem->value);
  7794. - else
  7795. - {
  7796. - __sparc32_atomic_do_lock24 (&isem->lock);
  7797. - val = isem->value;
  7798. - if (val > 0)
  7799. - isem->value = val - 1;
  7800. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7801. - }
  7802. -
  7803. - if (val > 0)
  7804. - {
  7805. - err = 0;
  7806. - break;
  7807. - }
  7808. - }
  7809. -
  7810. - pthread_cleanup_pop (0);
  7811. -
  7812. - if (__atomic_is_v9)
  7813. - atomic_decrement (&isem->nwaiters);
  7814. - else
  7815. - {
  7816. - __sparc32_atomic_do_lock24 (&isem->lock);
  7817. - isem->nwaiters--;
  7818. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7819. - }
  7820. -
  7821. - return err;
  7822. -}
  7823. 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
  7824. deleted file mode 100644
  7825. index 36e859b..0000000
  7826. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
  7827. +++ /dev/null
  7828. @@ -1,51 +0,0 @@
  7829. -/* sem_trywait -- wait on a semaphore. SPARC version.
  7830. - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7831. - This file is part of the GNU C Library.
  7832. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7833. -
  7834. - The GNU C Library is free software; you can redistribute it and/or
  7835. - modify it under the terms of the GNU Lesser General Public
  7836. - License as published by the Free Software Foundation; either
  7837. - version 2.1 of the License, or (at your option) any later version.
  7838. -
  7839. - The GNU C Library is distributed in the hope that it will be useful,
  7840. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7841. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7842. - Lesser General Public License for more details.
  7843. -
  7844. - You should have received a copy of the GNU Lesser General Public
  7845. - License along with the GNU C Library; if not, see
  7846. - <http://www.gnu.org/licenses/>. */
  7847. -
  7848. -#include <errno.h>
  7849. -#include <sysdep.h>
  7850. -#include <lowlevellock.h>
  7851. -#include <internaltypes.h>
  7852. -#include <semaphore.h>
  7853. -
  7854. -
  7855. -int
  7856. -sem_trywait (sem_t *sem)
  7857. -{
  7858. - struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
  7859. - int val;
  7860. -
  7861. - if (isem->value > 0)
  7862. - {
  7863. - if (__atomic_is_v9)
  7864. - val = atomic_decrement_if_positive (&isem->value);
  7865. - else
  7866. - {
  7867. - __sparc32_atomic_do_lock24 (&isem->lock);
  7868. - val = isem->value;
  7869. - if (val > 0)
  7870. - isem->value = val - 1;
  7871. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7872. - }
  7873. - if (val > 0)
  7874. - return 0;
  7875. - }
  7876. -
  7877. - __set_errno (EAGAIN);
  7878. - return -1;
  7879. -}
  7880. 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
  7881. deleted file mode 100644
  7882. index 5d887ab..0000000
  7883. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
  7884. +++ /dev/null
  7885. @@ -1,124 +0,0 @@
  7886. -/* sem_wait -- wait on a semaphore. Generic futex-using version.
  7887. - Copyright (C) 2003, 2007 Free Software Foundation, Inc.
  7888. - This file is part of the GNU C Library.
  7889. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7890. -
  7891. - The GNU C Library is free software; you can redistribute it and/or
  7892. - modify it under the terms of the GNU Lesser General Public
  7893. - License as published by the Free Software Foundation; either
  7894. - version 2.1 of the License, or (at your option) any later version.
  7895. -
  7896. - The GNU C Library is distributed in the hope that it will be useful,
  7897. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7898. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7899. - Lesser General Public License for more details.
  7900. -
  7901. - You should have received a copy of the GNU Lesser General Public
  7902. - License along with the GNU C Library; if not, see
  7903. - <http://www.gnu.org/licenses/>. */
  7904. -
  7905. -#include <errno.h>
  7906. -#include <sysdep.h>
  7907. -#include <lowlevellock.h>
  7908. -#include <internaltypes.h>
  7909. -#include <semaphore.h>
  7910. -
  7911. -#include <pthreadP.h>
  7912. -
  7913. -
  7914. -void
  7915. -attribute_hidden
  7916. -__sem_wait_cleanup (void *arg)
  7917. -{
  7918. - struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
  7919. -
  7920. - if (__atomic_is_v9)
  7921. - atomic_decrement (&isem->nwaiters);
  7922. - else
  7923. - {
  7924. - __sparc32_atomic_do_lock24 (&isem->lock);
  7925. - isem->nwaiters--;
  7926. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7927. - }
  7928. -}
  7929. -
  7930. -
  7931. -int
  7932. -sem_wait (sem_t *sem)
  7933. -{
  7934. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7935. - int err;
  7936. - int val;
  7937. -
  7938. - if (__atomic_is_v9)
  7939. - val = atomic_decrement_if_positive (&isem->value);
  7940. - else
  7941. - {
  7942. - __sparc32_atomic_do_lock24 (&isem->lock);
  7943. - val = isem->value;
  7944. - if (val > 0)
  7945. - isem->value = val - 1;
  7946. - else
  7947. - isem->nwaiters++;
  7948. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7949. - }
  7950. -
  7951. - if (val > 0)
  7952. - return 0;
  7953. -
  7954. - if (__atomic_is_v9)
  7955. - atomic_increment (&isem->nwaiters);
  7956. - else
  7957. - /* Already done above while still holding isem->lock. */;
  7958. -
  7959. - pthread_cleanup_push (__sem_wait_cleanup, isem);
  7960. -
  7961. - while (1)
  7962. - {
  7963. - /* Enable asynchronous cancellation. Required by the standard. */
  7964. - int oldtype = __pthread_enable_asynccancel ();
  7965. -
  7966. - err = lll_futex_wait (&isem->value, 0,
  7967. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7968. -
  7969. - /* Disable asynchronous cancellation. */
  7970. - __pthread_disable_asynccancel (oldtype);
  7971. -
  7972. - if (err != 0 && err != -EWOULDBLOCK)
  7973. - {
  7974. - __set_errno (-err);
  7975. - err = -1;
  7976. - break;
  7977. - }
  7978. -
  7979. - if (__atomic_is_v9)
  7980. - val = atomic_decrement_if_positive (&isem->value);
  7981. - else
  7982. - {
  7983. - __sparc32_atomic_do_lock24 (&isem->lock);
  7984. - val = isem->value;
  7985. - if (val > 0)
  7986. - isem->value = val - 1;
  7987. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7988. - }
  7989. -
  7990. - if (val > 0)
  7991. - {
  7992. - err = 0;
  7993. - break;
  7994. - }
  7995. - }
  7996. -
  7997. - pthread_cleanup_pop (0);
  7998. -
  7999. - if (__atomic_is_v9)
  8000. - atomic_decrement (&isem->nwaiters);
  8001. - else
  8002. - {
  8003. - __sparc32_atomic_do_lock24 (&isem->lock);
  8004. - isem->nwaiters--;
  8005. - __sparc32_atomic_do_unlock24 (&isem->lock);
  8006. - }
  8007. -
  8008. - return err;
  8009. -}
  8010. 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
  8011. deleted file mode 100644
  8012. index b61ca7b..0000000
  8013. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  8014. +++ /dev/null
  8015. @@ -1,111 +0,0 @@
  8016. -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8017. - This file is part of the GNU C Library.
  8018. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8019. -
  8020. - The GNU C Library is free software; you can redistribute it and/or
  8021. - modify it under the terms of the GNU Lesser General Public
  8022. - License as published by the Free Software Foundation; either
  8023. - version 2.1 of the License, or (at your option) any later version.
  8024. -
  8025. - The GNU C Library is distributed in the hope that it will be useful,
  8026. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8027. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8028. - Lesser General Public License for more details.
  8029. -
  8030. - You should have received a copy of the GNU Lesser General Public
  8031. - License along with the GNU C Library; if not, see
  8032. - <http://www.gnu.org/licenses/>. */
  8033. -
  8034. -#include <tls.h>
  8035. -#include <sysdep.h>
  8036. -#ifndef __ASSEMBLER__
  8037. -# include <pthreadP.h>
  8038. -#endif
  8039. -
  8040. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8041. -
  8042. -# undef PSEUDO
  8043. -# define PSEUDO(name, syscall_name, args) \
  8044. - .text; \
  8045. - .globl __syscall_error; \
  8046. -ENTRY(name) \
  8047. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8048. - cmp %g1, 0; \
  8049. - bne 1f; \
  8050. -.type __##syscall_name##_nocancel,@function; \
  8051. -.globl __##syscall_name##_nocancel; \
  8052. -__##syscall_name##_nocancel: \
  8053. - mov SYS_ify(syscall_name), %g1; \
  8054. - ta 0x10; \
  8055. - bcc 8f; \
  8056. - mov %o7, %g1; \
  8057. - call __syscall_error; \
  8058. - mov %g1, %o7; \
  8059. -8: jmpl %o7 + 8, %g0; \
  8060. - nop; \
  8061. -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8062. -1: save %sp, -96, %sp; \
  8063. - cfi_def_cfa_register(%fp); \
  8064. - cfi_window_save; \
  8065. - cfi_register(%o7, %i7); \
  8066. - CENABLE; \
  8067. - nop; \
  8068. - mov %o0, %l0; \
  8069. - COPY_ARGS_##args \
  8070. - mov SYS_ify(syscall_name), %g1; \
  8071. - ta 0x10; \
  8072. - bcc 1f; \
  8073. - mov %o0, %l1; \
  8074. - CDISABLE; \
  8075. - mov %l0, %o0; \
  8076. - call __syscall_error; \
  8077. - mov %l1, %o0; \
  8078. - b 2f; \
  8079. - mov -1, %l1; \
  8080. -1: CDISABLE; \
  8081. - mov %l0, %o0; \
  8082. -2: jmpl %i7 + 8, %g0; \
  8083. - restore %g0, %l1, %o0;
  8084. -
  8085. -
  8086. -# ifdef IS_IN_libpthread
  8087. -# define CENABLE call __pthread_enable_asynccancel
  8088. -# define CDISABLE call __pthread_disable_asynccancel
  8089. -# elif !defined NOT_IN_libc
  8090. -# define CENABLE call __libc_enable_asynccancel
  8091. -# define CDISABLE call __libc_disable_asynccancel
  8092. -# elif defined IS_IN_librt
  8093. -# define CENABLE call __librt_enable_asynccancel
  8094. -# define CDISABLE call __librt_disable_asynccancel
  8095. -# else
  8096. -# error Unsupported library
  8097. -# endif
  8098. -
  8099. -#define COPY_ARGS_0 /* Nothing */
  8100. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8101. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8102. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8103. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8104. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8105. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8106. -
  8107. -# ifndef __ASSEMBLER__
  8108. -# define SINGLE_THREAD_P \
  8109. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8110. - header.multiple_threads) == 0, 1)
  8111. -# else
  8112. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8113. -# endif
  8114. -
  8115. -#elif !defined __ASSEMBLER__
  8116. -
  8117. -# define SINGLE_THREAD_P (1)
  8118. -# define NO_CANCELLATION 1
  8119. -
  8120. -#endif
  8121. -
  8122. -#ifndef __ASSEMBLER__
  8123. -# define RTLD_SINGLE_THREAD_P \
  8124. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8125. - header.multiple_threads) == 0, 1)
  8126. -#endif
  8127. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  8128. deleted file mode 100644
  8129. index 71f0662..0000000
  8130. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  8131. +++ /dev/null
  8132. @@ -1,48 +0,0 @@
  8133. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8134. - This file is part of the GNU C Library.
  8135. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8136. -
  8137. - The GNU C Library is free software; you can redistribute it and/or
  8138. - modify it under the terms of the GNU Lesser General Public
  8139. - License as published by the Free Software Foundation; either
  8140. - version 2.1 of the License, or (at your option) any later version.
  8141. -
  8142. - The GNU C Library is distributed in the hope that it will be useful,
  8143. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8144. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8145. - Lesser General Public License for more details.
  8146. -
  8147. - You should have received a copy of the GNU Lesser General Public
  8148. - License along with the GNU C Library; if not, see
  8149. - <http://www.gnu.org/licenses/>. */
  8150. -
  8151. -#include <sysdep.h>
  8152. -#include <tcb-offsets.h>
  8153. -
  8154. - .text
  8155. - .globl __syscall_error
  8156. -ENTRY(__vfork)
  8157. - ld [%g7 + PID], %o5
  8158. - cmp %o5, 0
  8159. - bne 1f
  8160. - sub %g0, %o5, %o4
  8161. - sethi %hi(0x80000000), %o4
  8162. -1: st %o4, [%g7 + PID]
  8163. -
  8164. - LOADSYSCALL(vfork)
  8165. - ta 0x10
  8166. - bcc 2f
  8167. - mov %o7, %g1
  8168. - st %o5, [%g7 + PID]
  8169. - call __syscall_error
  8170. - mov %g1, %o7
  8171. -2: sub %o1, 1, %o1
  8172. - andcc %o0, %o1, %o0
  8173. - bne,a 1f
  8174. - st %o5, [%g7 + PID]
  8175. -1: retl
  8176. - nop
  8177. -END(__vfork)
  8178. -
  8179. -libc_hidden_def (vfork)
  8180. -weak_alias (__vfork, vfork)
  8181. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
  8182. deleted file mode 100644
  8183. index 64e3bfc..0000000
  8184. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
  8185. +++ /dev/null
  8186. @@ -1,2 +0,0 @@
  8187. -#define RESET_PID
  8188. -#include <libc/sysdeps/linux/sparc/sparcv9/clone.S>
  8189. 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
  8190. deleted file mode 100644
  8191. index a058d89..0000000
  8192. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
  8193. +++ /dev/null
  8194. @@ -1,44 +0,0 @@
  8195. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8196. - This file is part of the GNU C Library.
  8197. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8198. -
  8199. - The GNU C Library is free software; you can redistribute it and/or
  8200. - modify it under the terms of the GNU Lesser General Public
  8201. - License as published by the Free Software Foundation; either
  8202. - version 2.1 of the License, or (at your option) any later version.
  8203. -
  8204. - The GNU C Library is distributed in the hope that it will be useful,
  8205. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8206. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8207. - Lesser General Public License for more details.
  8208. -
  8209. - You should have received a copy of the GNU Lesser General Public
  8210. - License along with the GNU C Library; if not, see
  8211. - <http://www.gnu.org/licenses/>. */
  8212. -
  8213. -#include <sysdep.h>
  8214. -#include <tcb-offsets.h>
  8215. -
  8216. - .text
  8217. - .globl __syscall_error
  8218. -ENTRY(__vfork)
  8219. - ld [%g7 + PID], %o5
  8220. - sub %g0, %o5, %o4
  8221. - st %o4, [%g7 + PID]
  8222. -
  8223. - LOADSYSCALL(vfork)
  8224. - ta 0x6d
  8225. - bcc,pt %xcc, 2f
  8226. - mov %o7, %g1
  8227. - st %o5, [%g7 + PID]
  8228. - call __syscall_error
  8229. - mov %g1, %o7
  8230. -2: sub %o1, 1, %o1
  8231. - andcc %o0, %o1, %o0
  8232. - bne,a,pt %icc, 1f
  8233. - st %o5, [%g7 + PID]
  8234. -1: retl
  8235. - nop
  8236. -END(__vfork)
  8237. -
  8238. -weak_alias (__vfork, vfork)
  8239. 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
  8240. deleted file mode 100644
  8241. index 0e9d263..0000000
  8242. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  8243. +++ /dev/null
  8244. @@ -1,109 +0,0 @@
  8245. -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8246. - This file is part of the GNU C Library.
  8247. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8248. -
  8249. - The GNU C Library is free software; you can redistribute it and/or
  8250. - modify it under the terms of the GNU Lesser General Public
  8251. - License as published by the Free Software Foundation; either
  8252. - version 2.1 of the License, or (at your option) any later version.
  8253. -
  8254. - The GNU C Library is distributed in the hope that it will be useful,
  8255. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8256. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8257. - Lesser General Public License for more details.
  8258. -
  8259. - You should have received a copy of the GNU Lesser General Public
  8260. - License along with the GNU C Library; if not, see
  8261. - <http://www.gnu.org/licenses/>. */
  8262. -
  8263. -#include <sysdep.h>
  8264. -#include <tls.h>
  8265. -#ifndef __ASSEMBLER__
  8266. -# include <pthreadP.h>
  8267. -#endif
  8268. -
  8269. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8270. -
  8271. -# undef PSEUDO
  8272. -# define PSEUDO(name, syscall_name, args) \
  8273. - .text; \
  8274. - .globl __syscall_error; \
  8275. -ENTRY(name) \
  8276. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8277. - brnz,pn %g1, 1f; \
  8278. -.type __##syscall_name##_nocancel,@function; \
  8279. -.globl __##syscall_name##_nocancel; \
  8280. -__##syscall_name##_nocancel: \
  8281. - mov SYS_ify(syscall_name), %g1; \
  8282. - ta 0x6d; \
  8283. - bcc,pt %xcc, 8f; \
  8284. - mov %o7, %g1; \
  8285. - call __syscall_error; \
  8286. - mov %g1, %o7; \
  8287. -8: jmpl %o7 + 8, %g0; \
  8288. - nop; \
  8289. -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8290. -1: save %sp, -192, %sp; \
  8291. - cfi_def_cfa_register(%fp); \
  8292. - cfi_window_save; \
  8293. - cfi_register(%o7, %i7); \
  8294. - CENABLE; \
  8295. - nop; \
  8296. - mov %o0, %l0; \
  8297. - COPY_ARGS_##args \
  8298. - mov SYS_ify(syscall_name), %g1; \
  8299. - ta 0x6d; \
  8300. - bcc,pt %xcc, 1f; \
  8301. - mov %o0, %l1; \
  8302. - CDISABLE; \
  8303. - mov %l0, %o0; \
  8304. - call __syscall_error; \
  8305. - mov %l1, %o0; \
  8306. - ba,pt %xcc, 2f; \
  8307. - mov -1, %l1; \
  8308. -1: CDISABLE; \
  8309. - mov %l0, %o0; \
  8310. -2: jmpl %i7 + 8, %g0; \
  8311. - restore %g0, %l1, %o0;
  8312. -
  8313. -# ifdef IS_IN_libpthread
  8314. -# define CENABLE call __pthread_enable_asynccancel
  8315. -# define CDISABLE call __pthread_disable_asynccancel
  8316. -# elif !defined NOT_IN_libc
  8317. -# define CENABLE call __libc_enable_asynccancel
  8318. -# define CDISABLE call __libc_disable_asynccancel
  8319. -# elif defined IS_IN_librt
  8320. -# define CENABLE call __librt_enable_asynccancel
  8321. -# define CDISABLE call __librt_disable_asynccancel
  8322. -# else
  8323. -# error Unsupported library
  8324. -# endif
  8325. -
  8326. -#define COPY_ARGS_0 /* Nothing */
  8327. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8328. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8329. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8330. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8331. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8332. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8333. -
  8334. -# ifndef __ASSEMBLER__
  8335. -# define SINGLE_THREAD_P \
  8336. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8337. - header.multiple_threads) == 0, 1)
  8338. -# else
  8339. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8340. -# endif
  8341. -
  8342. -#elif !defined __ASSEMBLER__
  8343. -
  8344. -# define SINGLE_THREAD_P (1)
  8345. -# define NO_CANCELLATION 1
  8346. -
  8347. -#endif
  8348. -
  8349. -#ifndef __ASSEMBLER__
  8350. -# define RTLD_SINGLE_THREAD_P \
  8351. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8352. - header.multiple_threads) == 0, 1)
  8353. -#endif
  8354. 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
  8355. deleted file mode 100644
  8356. index 0a9c337..0000000
  8357. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
  8358. +++ /dev/null
  8359. @@ -1 +0,0 @@
  8360. -#include "../../x86_64/timer_create.c"
  8361. 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
  8362. deleted file mode 100644
  8363. index f0d4fd2..0000000
  8364. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
  8365. +++ /dev/null
  8366. @@ -1 +0,0 @@
  8367. -#include "../../x86_64/timer_delete.c"
  8368. 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
  8369. deleted file mode 100644
  8370. index 82121a7..0000000
  8371. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
  8372. +++ /dev/null
  8373. @@ -1 +0,0 @@
  8374. -#include "../../x86_64/timer_getoverr.c"
  8375. 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
  8376. deleted file mode 100644
  8377. index 313c05f..0000000
  8378. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
  8379. +++ /dev/null
  8380. @@ -1 +0,0 @@
  8381. -#include "../../x86_64/timer_gettime.c"
  8382. 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
  8383. deleted file mode 100644
  8384. index 76f549c..0000000
  8385. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
  8386. +++ /dev/null
  8387. @@ -1 +0,0 @@
  8388. -#include "../../x86_64/timer_settime.c"
  8389. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  8390. deleted file mode 100644
  8391. index bea4f2f..0000000
  8392. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  8393. +++ /dev/null
  8394. @@ -1,48 +0,0 @@
  8395. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8396. - This file is part of the GNU C Library.
  8397. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8398. -
  8399. - The GNU C Library is free software; you can redistribute it and/or
  8400. - modify it under the terms of the GNU Lesser General Public
  8401. - License as published by the Free Software Foundation; either
  8402. - version 2.1 of the License, or (at your option) any later version.
  8403. -
  8404. - The GNU C Library is distributed in the hope that it will be useful,
  8405. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8406. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8407. - Lesser General Public License for more details.
  8408. -
  8409. - You should have received a copy of the GNU Lesser General Public
  8410. - License along with the GNU C Library; if not, see
  8411. - <http://www.gnu.org/licenses/>. */
  8412. -
  8413. -#include <sysdep.h>
  8414. -#include <tcb-offsets.h>
  8415. -
  8416. - .text
  8417. - .globl __syscall_error
  8418. -ENTRY(__vfork)
  8419. - ld [%g7 + PID], %o5
  8420. - sethi %hi(0x80000000), %o3
  8421. - cmp %o5, 0
  8422. - sub %g0, %o5, %o4
  8423. - move %icc, %o3, %o4
  8424. - st %o4, [%g7 + PID]
  8425. -
  8426. - LOADSYSCALL(vfork)
  8427. - ta 0x6d
  8428. - bcc,pt %xcc, 2f
  8429. - mov %o7, %g1
  8430. - st %o5, [%g7 + PID]
  8431. - call __syscall_error
  8432. - mov %g1, %o7
  8433. -2: sub %o1, 1, %o1
  8434. - andcc %o0, %o1, %o0
  8435. - bne,a,pt %icc, 1f
  8436. - st %o5, [%g7 + PID]
  8437. -1: retl
  8438. - nop
  8439. -END(__vfork)
  8440. -
  8441. -hidden_def (vfork)
  8442. -weak_alias (__vfork, vfork)
  8443. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8444. index 5be9beb..b61ca7b 100644
  8445. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8446. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8447. @@ -1,5 +1,111 @@
  8448. -#if defined(__arch64__)
  8449. -#include "sparc64/sysdep-cancel.h"
  8450. -#else
  8451. -#include "sparc32/sysdep-cancel.h"
  8452. +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8453. + This file is part of the GNU C Library.
  8454. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8455. +
  8456. + The GNU C Library is free software; you can redistribute it and/or
  8457. + modify it under the terms of the GNU Lesser General Public
  8458. + License as published by the Free Software Foundation; either
  8459. + version 2.1 of the License, or (at your option) any later version.
  8460. +
  8461. + The GNU C Library is distributed in the hope that it will be useful,
  8462. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  8463. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8464. + Lesser General Public License for more details.
  8465. +
  8466. + You should have received a copy of the GNU Lesser General Public
  8467. + License along with the GNU C Library; if not, see
  8468. + <http://www.gnu.org/licenses/>. */
  8469. +
  8470. +#include <tls.h>
  8471. +#include <sysdep.h>
  8472. +#ifndef __ASSEMBLER__
  8473. +# include <pthreadP.h>
  8474. +#endif
  8475. +
  8476. +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8477. +
  8478. +# undef PSEUDO
  8479. +# define PSEUDO(name, syscall_name, args) \
  8480. + .text; \
  8481. + .globl __syscall_error; \
  8482. +ENTRY(name) \
  8483. + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8484. + cmp %g1, 0; \
  8485. + bne 1f; \
  8486. +.type __##syscall_name##_nocancel,@function; \
  8487. +.globl __##syscall_name##_nocancel; \
  8488. +__##syscall_name##_nocancel: \
  8489. + mov SYS_ify(syscall_name), %g1; \
  8490. + ta 0x10; \
  8491. + bcc 8f; \
  8492. + mov %o7, %g1; \
  8493. + call __syscall_error; \
  8494. + mov %g1, %o7; \
  8495. +8: jmpl %o7 + 8, %g0; \
  8496. + nop; \
  8497. +.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8498. +1: save %sp, -96, %sp; \
  8499. + cfi_def_cfa_register(%fp); \
  8500. + cfi_window_save; \
  8501. + cfi_register(%o7, %i7); \
  8502. + CENABLE; \
  8503. + nop; \
  8504. + mov %o0, %l0; \
  8505. + COPY_ARGS_##args \
  8506. + mov SYS_ify(syscall_name), %g1; \
  8507. + ta 0x10; \
  8508. + bcc 1f; \
  8509. + mov %o0, %l1; \
  8510. + CDISABLE; \
  8511. + mov %l0, %o0; \
  8512. + call __syscall_error; \
  8513. + mov %l1, %o0; \
  8514. + b 2f; \
  8515. + mov -1, %l1; \
  8516. +1: CDISABLE; \
  8517. + mov %l0, %o0; \
  8518. +2: jmpl %i7 + 8, %g0; \
  8519. + restore %g0, %l1, %o0;
  8520. +
  8521. +
  8522. +# ifdef IS_IN_libpthread
  8523. +# define CENABLE call __pthread_enable_asynccancel
  8524. +# define CDISABLE call __pthread_disable_asynccancel
  8525. +# elif !defined NOT_IN_libc
  8526. +# define CENABLE call __libc_enable_asynccancel
  8527. +# define CDISABLE call __libc_disable_asynccancel
  8528. +# elif defined IS_IN_librt
  8529. +# define CENABLE call __librt_enable_asynccancel
  8530. +# define CDISABLE call __librt_disable_asynccancel
  8531. +# else
  8532. +# error Unsupported library
  8533. +# endif
  8534. +
  8535. +#define COPY_ARGS_0 /* Nothing */
  8536. +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8537. +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8538. +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8539. +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8540. +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8541. +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8542. +
  8543. +# ifndef __ASSEMBLER__
  8544. +# define SINGLE_THREAD_P \
  8545. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8546. + header.multiple_threads) == 0, 1)
  8547. +# else
  8548. +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8549. +# endif
  8550. +
  8551. +#elif !defined __ASSEMBLER__
  8552. +
  8553. +# define SINGLE_THREAD_P (1)
  8554. +# define NO_CANCELLATION 1
  8555. +
  8556. +#endif
  8557. +
  8558. +#ifndef __ASSEMBLER__
  8559. +# define RTLD_SINGLE_THREAD_P \
  8560. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8561. + header.multiple_threads) == 0, 1)
  8562. #endif
  8563. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8564. index 160cd0b..71f0662 100644
  8565. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8566. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8567. @@ -1,5 +1,48 @@
  8568. -#if defined(__arch64__)
  8569. -#include "sparc64/vfork.S"
  8570. -#else
  8571. -#include "sparc32/vfork.S"
  8572. -#endif
  8573. +/* Copyright (C) 2004 Free Software Foundation, Inc.
  8574. + This file is part of the GNU C Library.
  8575. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8576. +
  8577. + The GNU C Library is free software; you can redistribute it and/or
  8578. + modify it under the terms of the GNU Lesser General Public
  8579. + License as published by the Free Software Foundation; either
  8580. + version 2.1 of the License, or (at your option) any later version.
  8581. +
  8582. + The GNU C Library is distributed in the hope that it will be useful,
  8583. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  8584. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8585. + Lesser General Public License for more details.
  8586. +
  8587. + You should have received a copy of the GNU Lesser General Public
  8588. + License along with the GNU C Library; if not, see
  8589. + <http://www.gnu.org/licenses/>. */
  8590. +
  8591. +#include <sysdep.h>
  8592. +#include <tcb-offsets.h>
  8593. +
  8594. + .text
  8595. + .globl __syscall_error
  8596. +ENTRY(__vfork)
  8597. + ld [%g7 + PID], %o5
  8598. + cmp %o5, 0
  8599. + bne 1f
  8600. + sub %g0, %o5, %o4
  8601. + sethi %hi(0x80000000), %o4
  8602. +1: st %o4, [%g7 + PID]
  8603. +
  8604. + LOADSYSCALL(vfork)
  8605. + ta 0x10
  8606. + bcc 2f
  8607. + mov %o7, %g1
  8608. + st %o5, [%g7 + PID]
  8609. + call __syscall_error
  8610. + mov %g1, %o7
  8611. +2: sub %o1, 1, %o1
  8612. + andcc %o0, %o1, %o0
  8613. + bne,a 1f
  8614. + st %o5, [%g7 + PID]
  8615. +1: retl
  8616. + nop
  8617. +END(__vfork)
  8618. +
  8619. +libc_hidden_def (vfork)
  8620. +weak_alias (__vfork, vfork)
  8621. --
  8622. 1.8.5.2 (Apple Git-48)