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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666
  1. From b523318f205c88a1f9871b8acbda999150242e36 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/5] 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 | 25 +-
  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, 1350 insertions(+), 6534 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..90efb77 100644
  4249. --- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
  4250. +++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
  4251. @@ -6,26 +6,19 @@
  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. +#include <setjmp.h>
  4276. +#include <stdint.h>
  4277. +#include <unwind.h>
  4278. +
  4279. +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  4280. + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  4281. +
  4282. +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  4283. + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  4284. #endif
  4285. diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c
  4286. index 123be53..97f98da 100644
  4287. --- a/libc/sysdeps/linux/sparc/qp_ops.c
  4288. +++ b/libc/sysdeps/linux/sparc/qp_ops.c
  4289. @@ -1,5 +1,3 @@
  4290. -/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
  4291. -
  4292. #include <stdio.h>
  4293. #include <stdlib.h>
  4294. @@ -9,11 +7,7 @@ static void fakedef(void)
  4295. exit(-1);
  4296. }
  4297. -#ifdef __sparc_v9__
  4298. -# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
  4299. -#else
  4300. # define fakedef(sym) strong_alias(fakedef, _Q_##sym)
  4301. -#endif
  4302. fakedef(fne)
  4303. fakedef(feq)
  4304. @@ -31,7 +25,6 @@ fakedef(qtos)
  4305. fakedef(stoq)
  4306. fakedef(itoq)
  4307. fakedef(add)
  4308. -#ifndef __sparc_v9__
  4309. fakedef(qtou)
  4310. fakedef(utoq)
  4311. fakedef(cmp)
  4312. @@ -44,4 +37,3 @@ fakedef(qtoll)
  4313. fakedef(qtoull)
  4314. fakedef(sqrt)
  4315. fakedef(ulltoq)
  4316. -#endif
  4317. diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S
  4318. deleted file mode 100644
  4319. index 2ee62a0..0000000
  4320. --- a/libc/sysdeps/linux/sparc/sparcv9/clone.S
  4321. +++ /dev/null
  4322. @@ -1,101 +0,0 @@
  4323. -/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
  4324. - This file is part of the GNU C Library.
  4325. - Contributed by Richard Henderson (rth@tamu.edu).
  4326. -
  4327. - The GNU C Library is free software; you can redistribute it and/or
  4328. - modify it under the terms of the GNU Lesser General Public
  4329. - License as published by the Free Software Foundation; either
  4330. - version 2.1 of the License, or (at your option) any later version.
  4331. -
  4332. - The GNU C Library is distributed in the hope that it will be useful,
  4333. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4334. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4335. - Lesser General Public License for more details.
  4336. -
  4337. - You should have received a copy of the GNU Lesser General Public
  4338. - License along with the GNU C Library; if not, see
  4339. - <http://www.gnu.org/licenses/>. */
  4340. -
  4341. -/* clone() is even more special than fork() as it mucks with stacks
  4342. - and invokes a function in the right context after its all over. */
  4343. -
  4344. -#include <asm/errno.h>
  4345. -#include <asm/unistd.h>
  4346. -#include <tcb-offsets.h>
  4347. -#include <sysdep.h>
  4348. -
  4349. -#define CLONE_VM 0x00000100
  4350. -#define CLONE_THREAD 0x00010000
  4351. -
  4352. -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
  4353. - pid_t *ptid, void *tls, pid_t *ctid); */
  4354. -
  4355. - .register %g2,#scratch
  4356. - .register %g3,#scratch
  4357. -
  4358. - .text
  4359. -
  4360. -ENTRY (__clone)
  4361. - save %sp, -192, %sp
  4362. - cfi_def_cfa_register(%fp)
  4363. - cfi_window_save
  4364. - cfi_register(%o7, %i7)
  4365. -
  4366. - /* sanity check arguments */
  4367. - brz,pn %i0, 99f /* fn non-NULL? */
  4368. - mov %i0, %g2
  4369. - brz,pn %i1, 99f /* child_stack non-NULL? */
  4370. - mov %i2, %o0 /* clone flags */
  4371. -
  4372. - /* The child_stack is the top of the stack, allocate one
  4373. - whole stack frame from that as this is what the kernel
  4374. - expects. Also, subtract STACK_BIAS. */
  4375. - sub %i1, 192 + 0x7ff, %o1
  4376. - mov %i3, %g3
  4377. - mov %i2, %g4
  4378. -
  4379. - mov %i4,%o2 /* PTID */
  4380. - mov %i5,%o3 /* TLS */
  4381. - ldx [%fp+0x7ff+176],%o4 /* CTID */
  4382. -
  4383. - /* Do the system call */
  4384. - set __NR_clone, %g1
  4385. - ta 0x6d
  4386. - bcs,pn %xcc, 98f
  4387. - nop
  4388. - brnz,pn %o1, __thread_start
  4389. - nop
  4390. - jmpl %i7 + 8, %g0
  4391. - restore %o0, %g0, %o0
  4392. -99: mov EINVAL, %o0
  4393. -98: call HIDDEN_JUMPTARGET(__errno_location)
  4394. - mov %o0, %i0
  4395. - st %i0, [%o0]
  4396. - jmpl %i7 + 8, %g0
  4397. - restore %g0,-1,%o0
  4398. -END(__clone)
  4399. -
  4400. - .type __thread_start,@function
  4401. -__thread_start:
  4402. -#ifdef RESET_PID
  4403. - sethi %hi(CLONE_THREAD), %l0
  4404. - andcc %g4, %l0, %g0
  4405. - bne,pt %icc, 1f
  4406. - andcc %g4, CLONE_VM, %g0
  4407. - bne,a,pn %icc, 2f
  4408. - mov -1,%o0
  4409. - set __NR_getpid,%g1
  4410. - ta 0x6d
  4411. -2: st %o0,[%g7 + PID]
  4412. - st %o0,[%g7 + TID]
  4413. -1:
  4414. -#endif
  4415. - mov %g0, %fp /* terminate backtrace */
  4416. - call %g2
  4417. - mov %g3,%o0
  4418. - call HIDDEN_JUMPTARGET(_exit),0
  4419. - nop
  4420. -
  4421. - .size __thread_start, .-__thread_start
  4422. -
  4423. -weak_alias (__clone, clone)
  4424. diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S
  4425. deleted file mode 100644
  4426. index 1474e32..0000000
  4427. --- a/libc/sysdeps/linux/sparc/sparcv9/rem.S
  4428. +++ /dev/null
  4429. @@ -1,20 +0,0 @@
  4430. -/*
  4431. - * Sparc v9 has divide.
  4432. - * As divx takes 68 cycles and sdivcc only 36,
  4433. - * we use sdivcc eventhough it is deprecated.
  4434. - */
  4435. -
  4436. - .text
  4437. - .align 32
  4438. -ENTRY(.rem)
  4439. -
  4440. - sra %o0, 31, %o2
  4441. - wr %o2, 0, %y
  4442. - sdivcc %o0, %o1, %o2
  4443. - xnor %o2, %g0, %o3
  4444. - movvs %icc, %o3, %o2
  4445. - smul %o2, %o1, %o2
  4446. - retl
  4447. - sub %o0, %o2, %o0
  4448. -
  4449. -END(.rem)
  4450. diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
  4451. deleted file mode 100644
  4452. index 45535bb..0000000
  4453. --- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
  4454. +++ /dev/null
  4455. @@ -1,18 +0,0 @@
  4456. -/*
  4457. - * Sparc v9 has divide.
  4458. - * As divx takes 68 cycles and sdivcc only 36,
  4459. - * we use sdivcc eventhough it is deprecated.
  4460. - */
  4461. -
  4462. - .text
  4463. - .align 32
  4464. -ENTRY(.div)
  4465. -
  4466. - sra %o0, 31, %o2
  4467. - wr %o2, 0, %y
  4468. - sdivcc %o0, %o1, %o0
  4469. - xnor %o0, %g0, %o2
  4470. - retl
  4471. - movvs %icc, %o2, %o0
  4472. -
  4473. -END(.div)
  4474. diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S
  4475. deleted file mode 100644
  4476. index 303f29b..0000000
  4477. --- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S
  4478. +++ /dev/null
  4479. @@ -1,15 +0,0 @@
  4480. -/*
  4481. - * Sparc v9 has divide.
  4482. - * As divx takes 68 cycles and udiv only 37,
  4483. - * we use udiv eventhough it is deprecated.
  4484. - */
  4485. -
  4486. - .text
  4487. - .align 32
  4488. -ENTRY(.udiv)
  4489. -
  4490. - wr %g0, 0, %y
  4491. - retl
  4492. - udiv %o0, %o1, %o0
  4493. -
  4494. -END(.udiv)
  4495. diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S
  4496. deleted file mode 100644
  4497. index e65e4b9..0000000
  4498. --- a/libc/sysdeps/linux/sparc/sparcv9/umul.S
  4499. +++ /dev/null
  4500. @@ -1,15 +0,0 @@
  4501. -/*
  4502. - * Sparc v9 has multiply.
  4503. - */
  4504. -
  4505. - .text
  4506. - .align 32
  4507. -ENTRY(.umul)
  4508. -
  4509. - srl %o0, 0, %o0
  4510. - srl %o1, 0, %o1
  4511. - mulx %o0, %o1, %o0
  4512. - retl
  4513. - srlx %o0, 32, %o1
  4514. -
  4515. -END(.umul)
  4516. diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S
  4517. deleted file mode 100644
  4518. index 9354269..0000000
  4519. --- a/libc/sysdeps/linux/sparc/sparcv9/urem.S
  4520. +++ /dev/null
  4521. @@ -1,17 +0,0 @@
  4522. -/*
  4523. - * Sparc v9 has divide.
  4524. - * As divx takes 68 cycles and udiv only 37,
  4525. - * we use udiv eventhough it is deprecated.
  4526. - */
  4527. -
  4528. - .text
  4529. - .align 32
  4530. -ENTRY(.urem)
  4531. -
  4532. - wr %g0, 0, %y
  4533. - udiv %o0, %o1, %o2
  4534. - umul %o2, %o1, %o2
  4535. - retl
  4536. - sub %o0, %o2, %o0
  4537. -
  4538. -END(.urem)
  4539. diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h
  4540. index 37d6a61..edbd5a5 100644
  4541. --- a/libc/sysdeps/linux/sparc/sys/procfs.h
  4542. +++ b/libc/sysdeps/linux/sparc/sys/procfs.h
  4543. @@ -32,20 +32,6 @@
  4544. __BEGIN_DECLS
  4545. -#if __WORDSIZE == 64
  4546. -
  4547. -#define ELF_NGREG 36
  4548. -
  4549. -typedef struct
  4550. - {
  4551. - unsigned long pr_regs[32];
  4552. - unsigned long pr_fsr;
  4553. - unsigned long pr_gsr;
  4554. - unsigned long pr_fprs;
  4555. - } elf_fpregset_t;
  4556. -
  4557. -#else /* sparc32 */
  4558. -
  4559. #define ELF_NGREG 38
  4560. typedef struct
  4561. @@ -63,8 +49,6 @@ typedef struct
  4562. unsigned int pr_q[64];
  4563. } elf_fpregset_t;
  4564. -#endif /* sparc32 */
  4565. -
  4566. typedef unsigned long elf_greg_t;
  4567. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  4568. @@ -110,13 +94,8 @@ struct elf_prpsinfo
  4569. char pr_zomb; /* Zombie. */
  4570. char pr_nice; /* Nice val. */
  4571. unsigned long int pr_flag; /* Flags. */
  4572. -#if __WORDSIZE == 64
  4573. - unsigned int pr_uid;
  4574. - unsigned int pr_gid;
  4575. -#else
  4576. unsigned short int pr_uid;
  4577. unsigned short int pr_gid;
  4578. -#endif
  4579. int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  4580. /* Lots missing */
  4581. char pr_fname[16]; /* Filename of executable. */
  4582. @@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;
  4583. typedef struct elf_prstatus prstatus_t;
  4584. typedef struct elf_prpsinfo prpsinfo_t;
  4585. -#if __WORDSIZE == 64
  4586. -
  4587. -/* Provide 32-bit variants so that BFD can read 32-bit
  4588. - core files. */
  4589. -#define ELF_NGREG32 38
  4590. -typedef struct
  4591. - {
  4592. - union
  4593. - {
  4594. - unsigned int pr_regs[32];
  4595. - double pr_dregs[16];
  4596. - } pr_fr;
  4597. - unsigned int __unused;
  4598. - unsigned int pr_fsr;
  4599. - unsigned char pr_qcnt;
  4600. - unsigned char pr_q_entrysize;
  4601. - unsigned char pr_en;
  4602. - unsigned int pr_q[64];
  4603. - } elf_fpregset_t32;
  4604. -
  4605. -typedef unsigned int elf_greg_t32;
  4606. -typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
  4607. -
  4608. -struct elf_prstatus32
  4609. - {
  4610. - struct elf_siginfo pr_info; /* Info associated with signal. */
  4611. - short int pr_cursig; /* Current signal. */
  4612. - unsigned int pr_sigpend; /* Set of pending signals. */
  4613. - unsigned int pr_sighold; /* Set of held signals. */
  4614. - __pid_t pr_pid;
  4615. - __pid_t pr_ppid;
  4616. - __pid_t pr_pgrp;
  4617. - __pid_t pr_sid;
  4618. - struct
  4619. - {
  4620. - int tv_sec, tv_usec;
  4621. - } pr_utime, /* User time. */
  4622. - pr_stime, /* System time. */
  4623. - pr_cutime, /* Cumulative user time. */
  4624. - pr_cstime; /* Cumulative system time. */
  4625. - elf_gregset_t32 pr_reg; /* GP registers. */
  4626. - int pr_fpvalid; /* True if math copro being used. */
  4627. - };
  4628. -
  4629. -struct elf_prpsinfo32
  4630. - {
  4631. - char pr_state; /* Numeric process state. */
  4632. - char pr_sname; /* Char for pr_state. */
  4633. - char pr_zomb; /* Zombie. */
  4634. - char pr_nice; /* Nice val. */
  4635. - unsigned int pr_flag; /* Flags. */
  4636. - unsigned short int pr_uid;
  4637. - unsigned short int pr_gid;
  4638. - int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  4639. - /* Lots missing */
  4640. - char pr_fname[16]; /* Filename of executable. */
  4641. - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
  4642. - };
  4643. -
  4644. -typedef elf_gregset_t32 prgregset32_t;
  4645. -typedef elf_fpregset_t32 prfpregset32_t;
  4646. -
  4647. -typedef struct elf_prstatus32 prstatus32_t;
  4648. -typedef struct elf_prpsinfo32 prpsinfo32_t;
  4649. -
  4650. -#endif /* sparc64 */
  4651. -
  4652. __END_DECLS
  4653. #endif /* sys/procfs.h */
  4654. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4655. index ab90810..d502c75 100644
  4656. --- a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4657. +++ b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
  4658. @@ -1,8 +1,82 @@
  4659. -#include <features.h>
  4660. -#include <bits/wordsize.h>
  4661. +/* Machine-dependent pthreads configuration and inline functions.
  4662. + sparc version.
  4663. + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  4664. + This file is part of the GNU C Library.
  4665. + Contributed by Richard Henderson <rth@tamu.edu>.
  4666. -#if __WORDSIZE == 32
  4667. -# include "sparc32/pt-machine.h"
  4668. -#else
  4669. -# include "sparc64/pt-machine.h"
  4670. + The GNU C Library is free software; you can redistribute it and/or
  4671. + modify it under the terms of the GNU Lesser General Public License as
  4672. + published by the Free Software Foundation; either version 2.1 of the
  4673. + License, or (at your option) any later version.
  4674. +
  4675. + The GNU C Library is distributed in the hope that it will be useful,
  4676. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  4677. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4678. + Lesser General Public License for more details.
  4679. +
  4680. + You should have received a copy of the GNU Lesser General Public
  4681. + License along with the GNU C Library; see the file COPYING.LIB. If
  4682. + not, see <http://www.gnu.org/licenses/>. */
  4683. +
  4684. +#ifndef _PT_MACHINE_H
  4685. +#define _PT_MACHINE_H 1
  4686. +
  4687. +#ifndef PT_EI
  4688. +# define PT_EI __extern_always_inline
  4689. #endif
  4690. +
  4691. +extern long int testandset (int *spinlock);
  4692. +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4693. +
  4694. +/* Spinlock implementation; required. */
  4695. +PT_EI long int
  4696. +testandset (int *spinlock)
  4697. +{
  4698. + int ret;
  4699. +
  4700. + __asm__ __volatile__("ldstub %1,%0"
  4701. + : "=r"(ret), "=m"(*spinlock)
  4702. + : "m"(*spinlock));
  4703. +
  4704. + return ret;
  4705. +}
  4706. +
  4707. +
  4708. +/* Memory barrier; default is to do nothing */
  4709. +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  4710. +
  4711. +
  4712. +/* Get some notion of the current stack. Need not be exactly the top
  4713. + of the stack, just something somewhere in the current frame. */
  4714. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  4715. +register char *stack_pointer __asm__("%sp");
  4716. +
  4717. +
  4718. +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  4719. + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  4720. +struct _pthread_descr_struct;
  4721. +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  4722. +
  4723. +/* Return the thread descriptor for the current thread. */
  4724. +#define THREAD_SELF __thread_self
  4725. +
  4726. +/* Initialize the thread-unique value. */
  4727. +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4728. +
  4729. +/* Access to data in the thread descriptor is easy. */
  4730. +#define THREAD_GETMEM(descr, member) \
  4731. + ((void) sizeof (descr), THREAD_SELF->member)
  4732. +#define THREAD_GETMEM_NC(descr, member) \
  4733. + ((void) sizeof (descr), THREAD_SELF->member)
  4734. +#define THREAD_SETMEM(descr, member, value) \
  4735. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  4736. +#define THREAD_SETMEM_NC(descr, member, value) \
  4737. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  4738. +
  4739. +/* We want the OS to assign stack addresses. */
  4740. +#define FLOATING_STACKS 1
  4741. +
  4742. +/* Maximum size of the stack if the rlimit is unlimited. */
  4743. +#define ARCH_STACK_MAX_SIZE 8*1024*1024
  4744. +
  4745. +#endif /* pt-machine.h */
  4746. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
  4747. deleted file mode 100644
  4748. index d502c75..0000000
  4749. --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
  4750. +++ /dev/null
  4751. @@ -1,82 +0,0 @@
  4752. -/* Machine-dependent pthreads configuration and inline functions.
  4753. - sparc version.
  4754. - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  4755. - This file is part of the GNU C Library.
  4756. - Contributed by Richard Henderson <rth@tamu.edu>.
  4757. -
  4758. - The GNU C Library is free software; you can redistribute it and/or
  4759. - modify it under the terms of the GNU Lesser General Public License as
  4760. - published by the Free Software Foundation; either version 2.1 of the
  4761. - License, or (at your option) any later version.
  4762. -
  4763. - The GNU C Library is distributed in the hope that it will be useful,
  4764. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4765. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4766. - Lesser General Public License for more details.
  4767. -
  4768. - You should have received a copy of the GNU Lesser General Public
  4769. - License along with the GNU C Library; see the file COPYING.LIB. If
  4770. - not, see <http://www.gnu.org/licenses/>. */
  4771. -
  4772. -#ifndef _PT_MACHINE_H
  4773. -#define _PT_MACHINE_H 1
  4774. -
  4775. -#ifndef PT_EI
  4776. -# define PT_EI __extern_always_inline
  4777. -#endif
  4778. -
  4779. -extern long int testandset (int *spinlock);
  4780. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4781. -
  4782. -/* Spinlock implementation; required. */
  4783. -PT_EI long int
  4784. -testandset (int *spinlock)
  4785. -{
  4786. - int ret;
  4787. -
  4788. - __asm__ __volatile__("ldstub %1,%0"
  4789. - : "=r"(ret), "=m"(*spinlock)
  4790. - : "m"(*spinlock));
  4791. -
  4792. - return ret;
  4793. -}
  4794. -
  4795. -
  4796. -/* Memory barrier; default is to do nothing */
  4797. -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  4798. -
  4799. -
  4800. -/* Get some notion of the current stack. Need not be exactly the top
  4801. - of the stack, just something somewhere in the current frame. */
  4802. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  4803. -register char *stack_pointer __asm__("%sp");
  4804. -
  4805. -
  4806. -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  4807. - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  4808. -struct _pthread_descr_struct;
  4809. -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  4810. -
  4811. -/* Return the thread descriptor for the current thread. */
  4812. -#define THREAD_SELF __thread_self
  4813. -
  4814. -/* Initialize the thread-unique value. */
  4815. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4816. -
  4817. -/* Access to data in the thread descriptor is easy. */
  4818. -#define THREAD_GETMEM(descr, member) \
  4819. - ((void) sizeof (descr), THREAD_SELF->member)
  4820. -#define THREAD_GETMEM_NC(descr, member) \
  4821. - ((void) sizeof (descr), THREAD_SELF->member)
  4822. -#define THREAD_SETMEM(descr, member, value) \
  4823. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4824. -#define THREAD_SETMEM_NC(descr, member, value) \
  4825. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4826. -
  4827. -/* We want the OS to assign stack addresses. */
  4828. -#define FLOATING_STACKS 1
  4829. -
  4830. -/* Maximum size of the stack if the rlimit is unlimited. */
  4831. -#define ARCH_STACK_MAX_SIZE 8*1024*1024
  4832. -
  4833. -#endif /* pt-machine.h */
  4834. diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
  4835. deleted file mode 100644
  4836. index e3c73d9..0000000
  4837. --- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
  4838. +++ /dev/null
  4839. @@ -1,104 +0,0 @@
  4840. -/* Machine-dependent pthreads configuration and inline functions.
  4841. - Sparc v9 version.
  4842. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
  4843. - This file is part of the GNU C Library.
  4844. - Contributed by Richard Henderson <rth@tamu.edu>.
  4845. -
  4846. - The GNU C Library is free software; you can redistribute it and/or
  4847. - modify it under the terms of the GNU Lesser General Public License as
  4848. - published by the Free Software Foundation; either version 2.1 of the
  4849. - License, or (at your option) any later version.
  4850. -
  4851. - The GNU C Library is distributed in the hope that it will be useful,
  4852. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  4853. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4854. - Lesser General Public License for more details.
  4855. -
  4856. - You should have received a copy of the GNU Lesser General Public
  4857. - License along with the GNU C Library; see the file COPYING.LIB. If
  4858. - not, see <http://www.gnu.org/licenses/>. */
  4859. -
  4860. -#ifndef _PT_MACHINE_H
  4861. -#define _PT_MACHINE_H 1
  4862. -
  4863. -#ifndef PT_EI
  4864. -# define PT_EI __extern_always_inline
  4865. -#endif
  4866. -
  4867. -extern long int testandset (int *spinlock);
  4868. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  4869. -
  4870. -/* Spinlock implementation; required. */
  4871. -PT_EI long int
  4872. -testandset (int *spinlock)
  4873. -{
  4874. - int ret;
  4875. -
  4876. - __asm__ __volatile__("ldstub %1,%0"
  4877. - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
  4878. -
  4879. - return ret;
  4880. -}
  4881. -
  4882. -
  4883. -/* Memory barrier; default is to do nothing */
  4884. -#define MEMORY_BARRIER() \
  4885. - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
  4886. -/* Read barrier. */
  4887. -#define READ_MEMORY_BARRIER() \
  4888. - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
  4889. -/* Write barrier. */
  4890. -#define WRITE_MEMORY_BARRIER() \
  4891. - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
  4892. -
  4893. -
  4894. -/* Get some notion of the current stack. Need not be exactly the top
  4895. - of the stack, just something somewhere in the current frame. */
  4896. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  4897. -register char *stack_pointer __asm__ ("%sp");
  4898. -
  4899. -
  4900. -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
  4901. - TLS ABI specifies %g7 as the thread pointer. */
  4902. -struct _pthread_descr_struct;
  4903. -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
  4904. -
  4905. -/* Return the thread descriptor for the current thread. */
  4906. -#define THREAD_SELF __thread_self
  4907. -
  4908. -/* Initialize the thread-unique value. */
  4909. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  4910. -
  4911. -
  4912. -/* Compare-and-swap for semaphores. */
  4913. -
  4914. -#define HAS_COMPARE_AND_SWAP
  4915. -PT_EI int
  4916. -__compare_and_swap (long int *p, long int oldval, long int newval)
  4917. -{
  4918. - long int readval;
  4919. -
  4920. - __asm__ __volatile__ ("casx [%4], %2, %0"
  4921. - : "=r"(readval), "=m"(*p)
  4922. - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
  4923. - MEMORY_BARRIER();
  4924. - return readval == oldval;
  4925. -}
  4926. -
  4927. -/* Access to data in the thread descriptor is easy. */
  4928. -#define THREAD_GETMEM(descr, member) \
  4929. - ((void) sizeof (descr), THREAD_SELF->member)
  4930. -#define THREAD_GETMEM_NC(descr, member) \
  4931. - ((void) sizeof (descr), THREAD_SELF->member)
  4932. -#define THREAD_SETMEM(descr, member, value) \
  4933. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4934. -#define THREAD_SETMEM_NC(descr, member, value) \
  4935. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  4936. -
  4937. -/* We want the OS to assign stack addresses. */
  4938. -#define FLOATING_STACKS 1
  4939. -
  4940. -/* Maximum size of the stack if the rlimit is unlimited. */
  4941. -#define ARCH_STACK_MAX_SIZE 32*1024*1024
  4942. -
  4943. -#endif /* pt-machine.h */
  4944. diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4945. index 72a9af5..4de152b 100644
  4946. --- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4947. +++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
  4948. @@ -1,14 +1,87 @@
  4949. -#include <features.h>
  4950. -#include <bits/wordsize.h>
  4951. +/* POSIX spinlock implementation. SPARC32 version.
  4952. + Copyright (C) 2000 Free Software Foundation, Inc.
  4953. + This file is part of the GNU C Library.
  4954. -#if __WORDSIZE == 32
  4955. + The GNU C Library is free software; you can redistribute it and/or
  4956. + modify it under the terms of the GNU Lesser General Public License as
  4957. + published by the Free Software Foundation; either version 2.1 of the
  4958. + License, or (at your option) any later version.
  4959. -# if defined(__CONFIG_SPARC_V9B__)
  4960. -# include "sparc32/sparcv9b/pspinlock.c"
  4961. -# else
  4962. -# include "sparc32/pspinlock.c"
  4963. -# endif
  4964. + The GNU C Library is distributed in the hope that it will be useful,
  4965. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  4966. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4967. + Lesser General Public License for more details.
  4968. -#else
  4969. -# include "sparc64/pspinlock.c"
  4970. -#endif
  4971. + You should have received a copy of the GNU Lesser General Public
  4972. + License along with the GNU C Library; see the file COPYING.LIB. If
  4973. + not, see <http://www.gnu.org/licenses/>. */
  4974. +
  4975. +#include <errno.h>
  4976. +#include <pthread.h>
  4977. +#include "internals.h"
  4978. +
  4979. +/* This implementation is similar to the one used in the Linux kernel. */
  4980. +int
  4981. +__pthread_spin_lock (pthread_spinlock_t *lock)
  4982. +{
  4983. + __asm__ __volatile__
  4984. + ("1: ldstub [%0], %%g2\n"
  4985. + " orcc %%g2, 0x0, %%g0\n"
  4986. + " bne,a 2f\n"
  4987. + " ldub [%0], %%g2\n"
  4988. + ".subsection 2\n"
  4989. + "2: orcc %%g2, 0x0, %%g0\n"
  4990. + " bne,a 2b\n"
  4991. + " ldub [%0], %%g2\n"
  4992. + " b,a 1b\n"
  4993. + ".previous"
  4994. + : /* no outputs */
  4995. + : "r" (lock)
  4996. + : "g2", "memory", "cc");
  4997. + return 0;
  4998. +}
  4999. +weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5000. +
  5001. +
  5002. +int
  5003. +__pthread_spin_trylock (pthread_spinlock_t *lock)
  5004. +{
  5005. + int result;
  5006. + __asm__ __volatile__
  5007. + ("ldstub [%1], %0"
  5008. + : "=r" (result)
  5009. + : "r" (lock)
  5010. + : "memory");
  5011. + return result == 0 ? 0 : EBUSY;
  5012. +}
  5013. +weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5014. +
  5015. +
  5016. +int
  5017. +__pthread_spin_unlock (pthread_spinlock_t *lock)
  5018. +{
  5019. + *lock = 0;
  5020. + return 0;
  5021. +}
  5022. +weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5023. +
  5024. +
  5025. +int
  5026. +__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5027. +{
  5028. + /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5029. + all processes which can access the memory location `lock' points
  5030. + to can use the spinlock. */
  5031. + *lock = 0;
  5032. + return 0;
  5033. +}
  5034. +weak_alias (__pthread_spin_init, pthread_spin_init)
  5035. +
  5036. +
  5037. +int
  5038. +__pthread_spin_destroy (pthread_spinlock_t *lock)
  5039. +{
  5040. + /* Nothing to do. */
  5041. + return 0;
  5042. +}
  5043. +weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5044. diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5045. index ab90810..d502c75 100644
  5046. --- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5047. +++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
  5048. @@ -1,8 +1,82 @@
  5049. -#include <features.h>
  5050. -#include <bits/wordsize.h>
  5051. +/* Machine-dependent pthreads configuration and inline functions.
  5052. + sparc version.
  5053. + Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  5054. + This file is part of the GNU C Library.
  5055. + Contributed by Richard Henderson <rth@tamu.edu>.
  5056. -#if __WORDSIZE == 32
  5057. -# include "sparc32/pt-machine.h"
  5058. -#else
  5059. -# include "sparc64/pt-machine.h"
  5060. + The GNU C Library is free software; you can redistribute it and/or
  5061. + modify it under the terms of the GNU Lesser General Public License as
  5062. + published by the Free Software Foundation; either version 2.1 of the
  5063. + License, or (at your option) any later version.
  5064. +
  5065. + The GNU C Library is distributed in the hope that it will be useful,
  5066. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  5067. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5068. + Lesser General Public License for more details.
  5069. +
  5070. + You should have received a copy of the GNU Lesser General Public
  5071. + License along with the GNU C Library; see the file COPYING.LIB. If
  5072. + not, see <http://www.gnu.org/licenses/>. */
  5073. +
  5074. +#ifndef _PT_MACHINE_H
  5075. +#define _PT_MACHINE_H 1
  5076. +
  5077. +#ifndef PT_EI
  5078. +# define PT_EI __extern_always_inline
  5079. #endif
  5080. +
  5081. +extern long int testandset (int *spinlock);
  5082. +extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5083. +
  5084. +/* Spinlock implementation; required. */
  5085. +PT_EI long int
  5086. +testandset (int *spinlock)
  5087. +{
  5088. + int ret;
  5089. +
  5090. + __asm__ __volatile__("ldstub %1,%0"
  5091. + : "=r"(ret), "=m"(*spinlock)
  5092. + : "m"(*spinlock));
  5093. +
  5094. + return ret;
  5095. +}
  5096. +
  5097. +
  5098. +/* Memory barrier; default is to do nothing */
  5099. +#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  5100. +
  5101. +
  5102. +/* Get some notion of the current stack. Need not be exactly the top
  5103. + of the stack, just something somewhere in the current frame. */
  5104. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  5105. +register char *stack_pointer __asm__("%sp");
  5106. +
  5107. +
  5108. +/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  5109. + %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  5110. +struct _pthread_descr_struct;
  5111. +register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  5112. +
  5113. +/* Return the thread descriptor for the current thread. */
  5114. +#define THREAD_SELF __thread_self
  5115. +
  5116. +/* Initialize the thread-unique value. */
  5117. +#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5118. +
  5119. +/* Access to data in the thread descriptor is easy. */
  5120. +#define THREAD_GETMEM(descr, member) \
  5121. + ((void) sizeof (descr), THREAD_SELF->member)
  5122. +#define THREAD_GETMEM_NC(descr, member) \
  5123. + ((void) sizeof (descr), THREAD_SELF->member)
  5124. +#define THREAD_SETMEM(descr, member, value) \
  5125. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  5126. +#define THREAD_SETMEM_NC(descr, member, value) \
  5127. + ((void) sizeof (descr), THREAD_SELF->member = (value))
  5128. +
  5129. +/* We want the OS to assign stack addresses. */
  5130. +#define FLOATING_STACKS 1
  5131. +
  5132. +/* Maximum size of the stack if the rlimit is unlimited. */
  5133. +#define ARCH_STACK_MAX_SIZE 8*1024*1024
  5134. +
  5135. +#endif /* pt-machine.h */
  5136. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
  5137. deleted file mode 100644
  5138. index 4de152b..0000000
  5139. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
  5140. +++ /dev/null
  5141. @@ -1,87 +0,0 @@
  5142. -/* POSIX spinlock implementation. SPARC32 version.
  5143. - Copyright (C) 2000 Free Software Foundation, Inc.
  5144. - This file is part of the GNU C Library.
  5145. -
  5146. - The GNU C Library is free software; you can redistribute it and/or
  5147. - modify it under the terms of the GNU Lesser General Public License as
  5148. - published by the Free Software Foundation; either version 2.1 of the
  5149. - License, or (at your option) any later version.
  5150. -
  5151. - The GNU C Library is distributed in the hope that it will be useful,
  5152. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5153. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5154. - Lesser General Public License for more details.
  5155. -
  5156. - You should have received a copy of the GNU Lesser General Public
  5157. - License along with the GNU C Library; see the file COPYING.LIB. If
  5158. - not, see <http://www.gnu.org/licenses/>. */
  5159. -
  5160. -#include <errno.h>
  5161. -#include <pthread.h>
  5162. -#include "internals.h"
  5163. -
  5164. -/* This implementation is similar to the one used in the Linux kernel. */
  5165. -int
  5166. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5167. -{
  5168. - __asm__ __volatile__
  5169. - ("1: ldstub [%0], %%g2\n"
  5170. - " orcc %%g2, 0x0, %%g0\n"
  5171. - " bne,a 2f\n"
  5172. - " ldub [%0], %%g2\n"
  5173. - ".subsection 2\n"
  5174. - "2: orcc %%g2, 0x0, %%g0\n"
  5175. - " bne,a 2b\n"
  5176. - " ldub [%0], %%g2\n"
  5177. - " b,a 1b\n"
  5178. - ".previous"
  5179. - : /* no outputs */
  5180. - : "r" (lock)
  5181. - : "g2", "memory", "cc");
  5182. - return 0;
  5183. -}
  5184. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5185. -
  5186. -
  5187. -int
  5188. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5189. -{
  5190. - int result;
  5191. - __asm__ __volatile__
  5192. - ("ldstub [%1], %0"
  5193. - : "=r" (result)
  5194. - : "r" (lock)
  5195. - : "memory");
  5196. - return result == 0 ? 0 : EBUSY;
  5197. -}
  5198. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5199. -
  5200. -
  5201. -int
  5202. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5203. -{
  5204. - *lock = 0;
  5205. - return 0;
  5206. -}
  5207. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5208. -
  5209. -
  5210. -int
  5211. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5212. -{
  5213. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5214. - all processes which can access the memory location `lock' points
  5215. - to can use the spinlock. */
  5216. - *lock = 0;
  5217. - return 0;
  5218. -}
  5219. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5220. -
  5221. -
  5222. -int
  5223. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5224. -{
  5225. - /* Nothing to do. */
  5226. - return 0;
  5227. -}
  5228. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5229. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
  5230. deleted file mode 100644
  5231. index d502c75..0000000
  5232. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
  5233. +++ /dev/null
  5234. @@ -1,82 +0,0 @@
  5235. -/* Machine-dependent pthreads configuration and inline functions.
  5236. - sparc version.
  5237. - Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
  5238. - This file is part of the GNU C Library.
  5239. - Contributed by Richard Henderson <rth@tamu.edu>.
  5240. -
  5241. - The GNU C Library is free software; you can redistribute it and/or
  5242. - modify it under the terms of the GNU Lesser General Public License as
  5243. - published by the Free Software Foundation; either version 2.1 of the
  5244. - License, or (at your option) any later version.
  5245. -
  5246. - The GNU C Library is distributed in the hope that it will be useful,
  5247. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5248. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5249. - Lesser General Public License for more details.
  5250. -
  5251. - You should have received a copy of the GNU Lesser General Public
  5252. - License along with the GNU C Library; see the file COPYING.LIB. If
  5253. - not, see <http://www.gnu.org/licenses/>. */
  5254. -
  5255. -#ifndef _PT_MACHINE_H
  5256. -#define _PT_MACHINE_H 1
  5257. -
  5258. -#ifndef PT_EI
  5259. -# define PT_EI __extern_always_inline
  5260. -#endif
  5261. -
  5262. -extern long int testandset (int *spinlock);
  5263. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5264. -
  5265. -/* Spinlock implementation; required. */
  5266. -PT_EI long int
  5267. -testandset (int *spinlock)
  5268. -{
  5269. - int ret;
  5270. -
  5271. - __asm__ __volatile__("ldstub %1,%0"
  5272. - : "=r"(ret), "=m"(*spinlock)
  5273. - : "m"(*spinlock));
  5274. -
  5275. - return ret;
  5276. -}
  5277. -
  5278. -
  5279. -/* Memory barrier; default is to do nothing */
  5280. -#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
  5281. -
  5282. -
  5283. -/* Get some notion of the current stack. Need not be exactly the top
  5284. - of the stack, just something somewhere in the current frame. */
  5285. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  5286. -register char *stack_pointer __asm__("%sp");
  5287. -
  5288. -
  5289. -/* Registers %g6 and %g7 are reserved by the ABI for "system use".
  5290. - %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
  5291. -struct _pthread_descr_struct;
  5292. -register struct _pthread_descr_struct *__thread_self __asm__("%g7");
  5293. -
  5294. -/* Return the thread descriptor for the current thread. */
  5295. -#define THREAD_SELF __thread_self
  5296. -
  5297. -/* Initialize the thread-unique value. */
  5298. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5299. -
  5300. -/* Access to data in the thread descriptor is easy. */
  5301. -#define THREAD_GETMEM(descr, member) \
  5302. - ((void) sizeof (descr), THREAD_SELF->member)
  5303. -#define THREAD_GETMEM_NC(descr, member) \
  5304. - ((void) sizeof (descr), THREAD_SELF->member)
  5305. -#define THREAD_SETMEM(descr, member, value) \
  5306. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5307. -#define THREAD_SETMEM_NC(descr, member, value) \
  5308. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5309. -
  5310. -/* We want the OS to assign stack addresses. */
  5311. -#define FLOATING_STACKS 1
  5312. -
  5313. -/* Maximum size of the stack if the rlimit is unlimited. */
  5314. -#define ARCH_STACK_MAX_SIZE 8*1024*1024
  5315. -
  5316. -#endif /* pt-machine.h */
  5317. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
  5318. deleted file mode 100644
  5319. index fb49ca3..0000000
  5320. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
  5321. +++ /dev/null
  5322. @@ -1,93 +0,0 @@
  5323. -/* POSIX spinlock implementation. SPARC v9 version.
  5324. - Copyright (C) 2000 Free Software Foundation, Inc.
  5325. - This file is part of the GNU C Library.
  5326. -
  5327. - The GNU C Library is free software; you can redistribute it and/or
  5328. - modify it under the terms of the GNU Lesser General Public License as
  5329. - published by the Free Software Foundation; either version 2.1 of the
  5330. - License, or (at your option) any later version.
  5331. -
  5332. - The GNU C Library is distributed in the hope that it will be useful,
  5333. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5334. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5335. - Lesser General Public License for more details.
  5336. -
  5337. - You should have received a copy of the GNU Lesser General Public
  5338. - License along with the GNU C Library; see the file COPYING.LIB. If
  5339. - not, see <http://www.gnu.org/licenses/>. */
  5340. -
  5341. -#include <errno.h>
  5342. -#include <pthread.h>
  5343. -#include "internals.h"
  5344. -
  5345. -
  5346. -/* This implementation is similar to the one used in the Linux kernel. */
  5347. -int
  5348. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5349. -{
  5350. - __asm__ __volatile__
  5351. - ("1: ldstub [%0], %%g2\n"
  5352. - " brnz,pn %%g2, 2f\n"
  5353. - " membar #StoreLoad | #StoreStore\n"
  5354. - ".subsection 2\n"
  5355. - "2: ldub [%0], %%g2\n"
  5356. - " brnz,pt %%g2, 2b\n"
  5357. - " membar #LoadLoad\n"
  5358. - " b,a,pt %%xcc, 1b\n"
  5359. - ".previous"
  5360. - : /* no outputs */
  5361. - : "r" (lock)
  5362. - : "g2", "memory");
  5363. - return 0;
  5364. -}
  5365. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5366. -
  5367. -
  5368. -int
  5369. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5370. -{
  5371. - int result;
  5372. - __asm__ __volatile__
  5373. - ("ldstub [%1], %0\n"
  5374. - "membar #StoreLoad | #StoreStore"
  5375. - : "=r" (result)
  5376. - : "r" (lock)
  5377. - : "memory");
  5378. - return result == 0 ? 0 : EBUSY;
  5379. -}
  5380. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5381. -
  5382. -
  5383. -int
  5384. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5385. -{
  5386. - __asm__ __volatile__
  5387. - ("membar #StoreStore | #LoadStore\n"
  5388. - "stb %%g0, [%0]"
  5389. - :
  5390. - : "r" (lock)
  5391. - : "memory");
  5392. - return 0;
  5393. -}
  5394. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5395. -
  5396. -
  5397. -int
  5398. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5399. -{
  5400. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5401. - all processes which can access the memory location `lock' points
  5402. - to can use the spinlock. */
  5403. - *lock = 0;
  5404. - return 0;
  5405. -}
  5406. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5407. -
  5408. -
  5409. -int
  5410. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5411. -{
  5412. - /* Nothing to do. */
  5413. - return 0;
  5414. -}
  5415. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5416. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
  5417. deleted file mode 100644
  5418. index 743cb77..0000000
  5419. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
  5420. +++ /dev/null
  5421. @@ -1,92 +0,0 @@
  5422. -/* POSIX spinlock implementation. SPARC64 version.
  5423. - Copyright (C) 2000 Free Software Foundation, Inc.
  5424. - This file is part of the GNU C Library.
  5425. -
  5426. - The GNU C Library is free software; you can redistribute it and/or
  5427. - modify it under the terms of the GNU Lesser General Public License as
  5428. - published by the Free Software Foundation; either version 2.1 of the
  5429. - License, or (at your option) any later version.
  5430. -
  5431. - The GNU C Library is distributed in the hope that it will be useful,
  5432. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5433. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5434. - Lesser General Public License for more details.
  5435. -
  5436. - You should have received a copy of the GNU Lesser General Public
  5437. - License along with the GNU C Library; see the file COPYING.LIB. If
  5438. - not, see <http://www.gnu.org/licenses/>. */
  5439. -
  5440. -#include <errno.h>
  5441. -#include <pthread.h>
  5442. -#include "internals.h"
  5443. -
  5444. -/* This implementation is similar to the one used in the Linux kernel. */
  5445. -int
  5446. -__pthread_spin_lock (pthread_spinlock_t *lock)
  5447. -{
  5448. - __asm__ __volatile__
  5449. - ("1: ldstub [%0], %%g5\n"
  5450. - " brnz,pn %%g5, 2f\n"
  5451. - " membar #StoreLoad | #StoreStore\n"
  5452. - ".subsection 2\n"
  5453. - "2: ldub [%0], %%g5\n"
  5454. - " brnz,pt %%g5, 2b\n"
  5455. - " membar #LoadLoad\n"
  5456. - " b,a,pt %%xcc, 1b\n"
  5457. - ".previous"
  5458. - : /* no outputs */
  5459. - : "r" (lock)
  5460. - : "g5", "memory");
  5461. - return 0;
  5462. -}
  5463. -weak_alias (__pthread_spin_lock, pthread_spin_lock)
  5464. -
  5465. -
  5466. -int
  5467. -__pthread_spin_trylock (pthread_spinlock_t *lock)
  5468. -{
  5469. - int result;
  5470. - __asm__ __volatile__
  5471. - ("ldstub [%1], %0\n"
  5472. - "membar #StoreLoad | #StoreStore"
  5473. - : "=r" (result)
  5474. - : "r" (lock)
  5475. - : "memory");
  5476. - return result == 0 ? 0 : EBUSY;
  5477. -}
  5478. -weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
  5479. -
  5480. -
  5481. -int
  5482. -__pthread_spin_unlock (pthread_spinlock_t *lock)
  5483. -{
  5484. - __asm__ __volatile__
  5485. - ("membar #StoreStore | #LoadStore\n"
  5486. - "stb %%g0, [%0]"
  5487. - :
  5488. - : "r" (lock)
  5489. - : "memory");
  5490. - return 0;
  5491. -}
  5492. -weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
  5493. -
  5494. -
  5495. -int
  5496. -__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
  5497. -{
  5498. - /* We can ignore the `pshared' parameter. Since we are busy-waiting
  5499. - all processes which can access the memory location `lock' points
  5500. - to can use the spinlock. */
  5501. - *lock = 0;
  5502. - return 0;
  5503. -}
  5504. -weak_alias (__pthread_spin_init, pthread_spin_init)
  5505. -
  5506. -
  5507. -int
  5508. -__pthread_spin_destroy (pthread_spinlock_t *lock)
  5509. -{
  5510. - /* Nothing to do. */
  5511. - return 0;
  5512. -}
  5513. -weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
  5514. diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
  5515. deleted file mode 100644
  5516. index e3c73d9..0000000
  5517. --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
  5518. +++ /dev/null
  5519. @@ -1,104 +0,0 @@
  5520. -/* Machine-dependent pthreads configuration and inline functions.
  5521. - Sparc v9 version.
  5522. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
  5523. - This file is part of the GNU C Library.
  5524. - Contributed by Richard Henderson <rth@tamu.edu>.
  5525. -
  5526. - The GNU C Library is free software; you can redistribute it and/or
  5527. - modify it under the terms of the GNU Lesser General Public License as
  5528. - published by the Free Software Foundation; either version 2.1 of the
  5529. - License, or (at your option) any later version.
  5530. -
  5531. - The GNU C Library is distributed in the hope that it will be useful,
  5532. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5533. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5534. - Lesser General Public License for more details.
  5535. -
  5536. - You should have received a copy of the GNU Lesser General Public
  5537. - License along with the GNU C Library; see the file COPYING.LIB. If
  5538. - not, see <http://www.gnu.org/licenses/>. */
  5539. -
  5540. -#ifndef _PT_MACHINE_H
  5541. -#define _PT_MACHINE_H 1
  5542. -
  5543. -#ifndef PT_EI
  5544. -# define PT_EI __extern_always_inline
  5545. -#endif
  5546. -
  5547. -extern long int testandset (int *spinlock);
  5548. -extern int __compare_and_swap (long int *p, long int oldval, long int newval);
  5549. -
  5550. -/* Spinlock implementation; required. */
  5551. -PT_EI long int
  5552. -testandset (int *spinlock)
  5553. -{
  5554. - int ret;
  5555. -
  5556. - __asm__ __volatile__("ldstub %1,%0"
  5557. - : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
  5558. -
  5559. - return ret;
  5560. -}
  5561. -
  5562. -
  5563. -/* Memory barrier; default is to do nothing */
  5564. -#define MEMORY_BARRIER() \
  5565. - __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
  5566. -/* Read barrier. */
  5567. -#define READ_MEMORY_BARRIER() \
  5568. - __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
  5569. -/* Write barrier. */
  5570. -#define WRITE_MEMORY_BARRIER() \
  5571. - __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
  5572. -
  5573. -
  5574. -/* Get some notion of the current stack. Need not be exactly the top
  5575. - of the stack, just something somewhere in the current frame. */
  5576. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  5577. -register char *stack_pointer __asm__ ("%sp");
  5578. -
  5579. -
  5580. -/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
  5581. - TLS ABI specifies %g7 as the thread pointer. */
  5582. -struct _pthread_descr_struct;
  5583. -register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
  5584. -
  5585. -/* Return the thread descriptor for the current thread. */
  5586. -#define THREAD_SELF __thread_self
  5587. -
  5588. -/* Initialize the thread-unique value. */
  5589. -#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
  5590. -
  5591. -
  5592. -/* Compare-and-swap for semaphores. */
  5593. -
  5594. -#define HAS_COMPARE_AND_SWAP
  5595. -PT_EI int
  5596. -__compare_and_swap (long int *p, long int oldval, long int newval)
  5597. -{
  5598. - long int readval;
  5599. -
  5600. - __asm__ __volatile__ ("casx [%4], %2, %0"
  5601. - : "=r"(readval), "=m"(*p)
  5602. - : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
  5603. - MEMORY_BARRIER();
  5604. - return readval == oldval;
  5605. -}
  5606. -
  5607. -/* Access to data in the thread descriptor is easy. */
  5608. -#define THREAD_GETMEM(descr, member) \
  5609. - ((void) sizeof (descr), THREAD_SELF->member)
  5610. -#define THREAD_GETMEM_NC(descr, member) \
  5611. - ((void) sizeof (descr), THREAD_SELF->member)
  5612. -#define THREAD_SETMEM(descr, member, value) \
  5613. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5614. -#define THREAD_SETMEM_NC(descr, member, value) \
  5615. - ((void) sizeof (descr), THREAD_SELF->member = (value))
  5616. -
  5617. -/* We want the OS to assign stack addresses. */
  5618. -#define FLOATING_STACKS 1
  5619. -
  5620. -/* Maximum size of the stack if the rlimit is unlimited. */
  5621. -#define ARCH_STACK_MAX_SIZE 32*1024*1024
  5622. -
  5623. -#endif /* pt-machine.h */
  5624. 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
  5625. deleted file mode 100644
  5626. index bd9bb0d..0000000
  5627. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  5628. +++ /dev/null
  5629. @@ -1,100 +0,0 @@
  5630. -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5631. - This file is part of the GNU C Library.
  5632. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5633. -
  5634. - The GNU C Library is free software; you can redistribute it and/or
  5635. - modify it under the terms of the GNU Lesser General Public
  5636. - License as published by the Free Software Foundation; either
  5637. - version 2.1 of the License, or (at your option) any later version.
  5638. -
  5639. - The GNU C Library is distributed in the hope that it will be useful,
  5640. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5641. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5642. - Lesser General Public License for more details.
  5643. -
  5644. - You should have received a copy of the GNU Lesser General Public
  5645. - License along with the GNU C Library; if not, see
  5646. - <http://www.gnu.org/licenses/>. */
  5647. -
  5648. -#include <tls.h>
  5649. -#ifndef __ASSEMBLER__
  5650. -# include <linuxthreads/internals.h>
  5651. -#endif
  5652. -
  5653. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  5654. -
  5655. -# undef PSEUDO
  5656. -# define PSEUDO(name, syscall_name, args) \
  5657. - .text; \
  5658. -ENTRY(name) \
  5659. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  5660. - cmp %g1, 0; \
  5661. - bne 1f; \
  5662. - mov SYS_ify(syscall_name), %g1; \
  5663. - ta 0x10; \
  5664. - bcs __syscall_error_handler; \
  5665. - nop; \
  5666. - .subsection 2; \
  5667. -1: save %sp, -96, %sp; \
  5668. - CENABLE; \
  5669. - nop; \
  5670. - mov %o0, %l0; \
  5671. - COPY_ARGS_##args \
  5672. - mov SYS_ify(syscall_name), %g1; \
  5673. - ta 0x10; \
  5674. - bcs __syscall_error_handler2; \
  5675. - mov %o0, %l1; \
  5676. - CDISABLE; \
  5677. - mov %l0, %o0; \
  5678. - jmpl %i7 + 8, %g0; \
  5679. - restore %g0, %l1, %o0; \
  5680. - .previous; \
  5681. - SYSCALL_ERROR_HANDLER \
  5682. - SYSCALL_ERROR_HANDLER2
  5683. -
  5684. -#define SYSCALL_ERROR_HANDLER2 \
  5685. -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  5686. - .global __errno_location; \
  5687. - .type __errno_location,@function; \
  5688. - CDISABLE; \
  5689. - mov %l0, %o0; \
  5690. - call __errno_location; \
  5691. - nop; \
  5692. - st %l1, [%o0]; \
  5693. - jmpl %i7 + 8, %g0; \
  5694. - restore %g0, -1, %o0; \
  5695. - .previous;
  5696. -
  5697. -# ifdef IS_IN_libpthread
  5698. -# define CENABLE call __pthread_enable_asynccancel
  5699. -# define CDISABLE call __pthread_disable_asynccancel
  5700. -# elif !defined NOT_IN_libc
  5701. -# define CENABLE call __libc_enable_asynccancel
  5702. -# define CDISABLE call __libc_disable_asynccancel
  5703. -# else
  5704. -# define CENABLE call __librt_enable_asynccancel
  5705. -# define CDISABLE call __librt_disable_asynccancel
  5706. -# endif
  5707. -
  5708. -#define COPY_ARGS_0 /* Nothing */
  5709. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  5710. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  5711. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  5712. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  5713. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  5714. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  5715. -
  5716. -# ifndef __ASSEMBLER__
  5717. -# define SINGLE_THREAD_P \
  5718. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  5719. - p_header.data.multiple_threads) == 0, 1)
  5720. -# else
  5721. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  5722. -# endif
  5723. -
  5724. -#elif !defined __ASSEMBLER__
  5725. -
  5726. -/* This code should never be used but we define it anyhow. */
  5727. -# define SINGLE_THREAD_P (1)
  5728. -
  5729. -#endif
  5730. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  5731. deleted file mode 100644
  5732. index ab2286e..0000000
  5733. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  5734. +++ /dev/null
  5735. @@ -1,64 +0,0 @@
  5736. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  5737. - This file is part of the GNU C Library.
  5738. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  5739. -
  5740. - The GNU C Library is free software; you can redistribute it and/or
  5741. - modify it under the terms of the GNU Lesser General Public
  5742. - License as published by the Free Software Foundation; either
  5743. - version 2.1 of the License, or (at your option) any later version.
  5744. -
  5745. - The GNU C Library is distributed in the hope that it will be useful,
  5746. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5747. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5748. - Lesser General Public License for more details.
  5749. -
  5750. - You should have received a copy of the GNU Lesser General Public
  5751. - License along with the GNU C Library; if not, see
  5752. - <http://www.gnu.org/licenses/>. */
  5753. -
  5754. -#include <sysdep-cancel.h>
  5755. -
  5756. - .text
  5757. -#ifdef SHARED
  5758. -.LLGETPC0:
  5759. - retl
  5760. - add %o7, %o0, %o0
  5761. -#endif
  5762. -ENTRY(__vfork)
  5763. -#ifdef SHARED
  5764. - mov %o7, %o1
  5765. - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  5766. - call .LLGETPC0
  5767. - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  5768. - sethi %hi(__libc_pthread_functions), %o2
  5769. - mov %o1, %o7
  5770. - or %o2, %lo(__libc_pthread_functions), %o2
  5771. - ld [%o0 + %o2], %o2
  5772. - ld [%o2], %o2
  5773. - cmp %o2, 0
  5774. -#else
  5775. - .weak pthread_create
  5776. - sethi %hi(pthread_create), %o0
  5777. - orcc %o0, %lo(pthread_create), %o0
  5778. -#endif
  5779. -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  5780. - bne HIDDEN_JUMPTARGET(fork)
  5781. -#else
  5782. - bne 1f
  5783. -#endif
  5784. - mov __NR_vfork, %g1
  5785. - ta 0x10
  5786. - bcs __syscall_error_handler
  5787. - nop
  5788. - sub %o1, 1, %o1
  5789. - retl
  5790. - and %o0, %o1, %o0
  5791. -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  5792. -1: mov %o7, %g1
  5793. - call HIDDEN_JUMPTARGET(fork)
  5794. - mov %g1, %o7
  5795. -#endif
  5796. - SYSCALL_ERROR_HANDLER
  5797. -PSEUDO_END (__vfork)
  5798. -libc_hidden_def (__vfork)
  5799. -weak_alias (__vfork, vfork)
  5800. 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
  5801. deleted file mode 100644
  5802. index d57283a..0000000
  5803. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
  5804. +++ /dev/null
  5805. @@ -1 +0,0 @@
  5806. -#include "../../ia64/pt-sigsuspend.c"
  5807. 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
  5808. deleted file mode 100644
  5809. index 9972ee4..0000000
  5810. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  5811. +++ /dev/null
  5812. @@ -1,99 +0,0 @@
  5813. -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5814. - This file is part of the GNU C Library.
  5815. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5816. -
  5817. - The GNU C Library is free software; you can redistribute it and/or
  5818. - modify it under the terms of the GNU Lesser General Public
  5819. - License as published by the Free Software Foundation; either
  5820. - version 2.1 of the License, or (at your option) any later version.
  5821. -
  5822. - The GNU C Library is distributed in the hope that it will be useful,
  5823. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5824. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5825. - Lesser General Public License for more details.
  5826. -
  5827. - You should have received a copy of the GNU Lesser General Public
  5828. - License along with the GNU C Library; if not, see
  5829. - <http://www.gnu.org/licenses/>. */
  5830. -
  5831. -#include <tls.h>
  5832. -#ifndef __ASSEMBLER__
  5833. -# include <linuxthreads/internals.h>
  5834. -#endif
  5835. -
  5836. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  5837. -
  5838. -# undef PSEUDO
  5839. -# define PSEUDO(name, syscall_name, args) \
  5840. - .text; \
  5841. -ENTRY(name) \
  5842. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  5843. - brnz,pn %g1, 1f; \
  5844. - mov SYS_ify(syscall_name), %g1; \
  5845. - ta 0x6d; \
  5846. - bcs,pn %xcc, __syscall_error_handler; \
  5847. - nop; \
  5848. - .subsection 2; \
  5849. -1: save %sp, -192, %sp; \
  5850. - CENABLE; \
  5851. - nop; \
  5852. - mov %o0, %l0; \
  5853. - COPY_ARGS_##args \
  5854. - mov SYS_ify(syscall_name), %g1; \
  5855. - ta 0x6d; \
  5856. - bcs,pn %xcc, __syscall_error_handler2; \
  5857. - mov %o0, %l1; \
  5858. - CDISABLE; \
  5859. - mov %l0, %o0; \
  5860. - jmpl %i7 + 8, %g0; \
  5861. - restore %g0, %l1, %o0; \
  5862. - .previous; \
  5863. - SYSCALL_ERROR_HANDLER \
  5864. - SYSCALL_ERROR_HANDLER2
  5865. -
  5866. -#define SYSCALL_ERROR_HANDLER2 \
  5867. -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  5868. - .global __errno_location; \
  5869. - .type __errno_location,@function; \
  5870. - CDISABLE; \
  5871. - mov %l0, %o0; \
  5872. - call __errno_location; \
  5873. - nop; \
  5874. - st %l1, [%o0]; \
  5875. - jmpl %i7 + 8, %g0; \
  5876. - restore %g0, -1, %o0; \
  5877. - .previous;
  5878. -
  5879. -# ifdef IS_IN_libpthread
  5880. -# define CENABLE call __pthread_enable_asynccancel
  5881. -# define CDISABLE call __pthread_disable_asynccancel
  5882. -# elif !defined NOT_IN_libc
  5883. -# define CENABLE call __libc_enable_asynccancel
  5884. -# define CDISABLE call __libc_disable_asynccancel
  5885. -# else
  5886. -# define CENABLE call __librt_enable_asynccancel
  5887. -# define CDISABLE call __librt_disable_asynccancel
  5888. -# endif
  5889. -
  5890. -#define COPY_ARGS_0 /* Nothing */
  5891. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  5892. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  5893. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  5894. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  5895. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  5896. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  5897. -
  5898. -# ifndef __ASSEMBLER__
  5899. -# define SINGLE_THREAD_P \
  5900. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  5901. - p_header.data.multiple_threads) == 0, 1)
  5902. -# else
  5903. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  5904. -# endif
  5905. -
  5906. -#elif !defined __ASSEMBLER__
  5907. -
  5908. -/* This code should never be used but we define it anyhow. */
  5909. -# define SINGLE_THREAD_P (1)
  5910. -
  5911. -#endif
  5912. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  5913. deleted file mode 100644
  5914. index 3ff16b1..0000000
  5915. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  5916. +++ /dev/null
  5917. @@ -1,63 +0,0 @@
  5918. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  5919. - This file is part of the GNU C Library.
  5920. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  5921. -
  5922. - The GNU C Library is free software; you can redistribute it and/or
  5923. - modify it under the terms of the GNU Lesser General Public
  5924. - License as published by the Free Software Foundation; either
  5925. - version 2.1 of the License, or (at your option) any later version.
  5926. -
  5927. - The GNU C Library is distributed in the hope that it will be useful,
  5928. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  5929. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5930. - Lesser General Public License for more details.
  5931. -
  5932. - You should have received a copy of the GNU Lesser General Public
  5933. - License along with the GNU C Library; if not, see
  5934. - <http://www.gnu.org/licenses/>. */
  5935. -
  5936. -#include <sysdep-cancel.h>
  5937. -
  5938. -#ifdef SHARED
  5939. -.LLGETPC0:
  5940. - retl
  5941. - add %o7, %o0, %o0
  5942. -#endif
  5943. -ENTRY(__vfork)
  5944. -#ifdef SHARED
  5945. - mov %o7, %o1
  5946. - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  5947. - call .LLGETPC0
  5948. - add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  5949. - sethi %hi(__libc_pthread_functions), %o2
  5950. - mov %o1, %o7
  5951. - or %o2, %lo(__libc_pthread_functions), %o2
  5952. - ldx [%o0 + %o2], %o2
  5953. - ldx [%o2], %o0
  5954. -#else
  5955. - .weak pthread_create
  5956. - sethi %hi(pthread_create), %o0
  5957. - or %o0, %lo(pthread_create), %o0
  5958. -#endif
  5959. -#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  5960. - cmp %o0, 0
  5961. - bne HIDDEN_JUMPTARGET(fork)
  5962. -#else
  5963. - brnz,pn %o0, 1f
  5964. -#endif
  5965. - mov __NR_vfork, %g1
  5966. - ta 0x6d
  5967. - bcs,pn %xcc, __syscall_error_handler
  5968. - nop
  5969. - sub %o1, 1, %o1
  5970. - retl
  5971. - and %o0, %o1, %o0
  5972. -#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  5973. -1: mov %o7, %g1
  5974. - call HIDDEN_JUMPTARGET(fork)
  5975. - mov %g1, %o7
  5976. -#endif
  5977. - SYSCALL_ERROR_HANDLER
  5978. -PSEUDO_END (__vfork)
  5979. -libc_hidden_def (__vfork)
  5980. -weak_alias (__vfork, vfork)
  5981. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5982. index fa656b3..bd9bb0d 100644
  5983. --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5984. +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  5985. @@ -1,10 +1,100 @@
  5986. -#ifndef SPARC_SYSDEP_CANCEL_H
  5987. -#define SPARC_SYSDEP_CANCEL_H
  5988. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  5989. + This file is part of the GNU C Library.
  5990. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  5991. -#if defined(__arch64__)
  5992. -#include <sparc64/sysdep-cancel.h>
  5993. -#else
  5994. -#include <sparc32/sysdep-cancel.h>
  5995. + The GNU C Library is free software; you can redistribute it and/or
  5996. + modify it under the terms of the GNU Lesser General Public
  5997. + License as published by the Free Software Foundation; either
  5998. + version 2.1 of the License, or (at your option) any later version.
  5999. +
  6000. + The GNU C Library is distributed in the hope that it will be useful,
  6001. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6002. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6003. + Lesser General Public License for more details.
  6004. +
  6005. + You should have received a copy of the GNU Lesser General Public
  6006. + License along with the GNU C Library; if not, see
  6007. + <http://www.gnu.org/licenses/>. */
  6008. +
  6009. +#include <tls.h>
  6010. +#ifndef __ASSEMBLER__
  6011. +# include <linuxthreads/internals.h>
  6012. #endif
  6013. +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  6014. +
  6015. +# undef PSEUDO
  6016. +# define PSEUDO(name, syscall_name, args) \
  6017. + .text; \
  6018. +ENTRY(name) \
  6019. + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
  6020. + cmp %g1, 0; \
  6021. + bne 1f; \
  6022. + mov SYS_ify(syscall_name), %g1; \
  6023. + ta 0x10; \
  6024. + bcs __syscall_error_handler; \
  6025. + nop; \
  6026. + .subsection 2; \
  6027. +1: save %sp, -96, %sp; \
  6028. + CENABLE; \
  6029. + nop; \
  6030. + mov %o0, %l0; \
  6031. + COPY_ARGS_##args \
  6032. + mov SYS_ify(syscall_name), %g1; \
  6033. + ta 0x10; \
  6034. + bcs __syscall_error_handler2; \
  6035. + mov %o0, %l1; \
  6036. + CDISABLE; \
  6037. + mov %l0, %o0; \
  6038. + jmpl %i7 + 8, %g0; \
  6039. + restore %g0, %l1, %o0; \
  6040. + .previous; \
  6041. + SYSCALL_ERROR_HANDLER \
  6042. + SYSCALL_ERROR_HANDLER2
  6043. +
  6044. +#define SYSCALL_ERROR_HANDLER2 \
  6045. +SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
  6046. + .global __errno_location; \
  6047. + .type __errno_location,@function; \
  6048. + CDISABLE; \
  6049. + mov %l0, %o0; \
  6050. + call __errno_location; \
  6051. + nop; \
  6052. + st %l1, [%o0]; \
  6053. + jmpl %i7 + 8, %g0; \
  6054. + restore %g0, -1, %o0; \
  6055. + .previous;
  6056. +
  6057. +# ifdef IS_IN_libpthread
  6058. +# define CENABLE call __pthread_enable_asynccancel
  6059. +# define CDISABLE call __pthread_disable_asynccancel
  6060. +# elif !defined NOT_IN_libc
  6061. +# define CENABLE call __libc_enable_asynccancel
  6062. +# define CDISABLE call __libc_disable_asynccancel
  6063. +# else
  6064. +# define CENABLE call __librt_enable_asynccancel
  6065. +# define CDISABLE call __librt_disable_asynccancel
  6066. +# endif
  6067. +
  6068. +#define COPY_ARGS_0 /* Nothing */
  6069. +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  6070. +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  6071. +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  6072. +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  6073. +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  6074. +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  6075. +
  6076. +# ifndef __ASSEMBLER__
  6077. +# define SINGLE_THREAD_P \
  6078. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  6079. + p_header.data.multiple_threads) == 0, 1)
  6080. +# else
  6081. +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  6082. +# endif
  6083. +
  6084. +#elif !defined __ASSEMBLER__
  6085. +
  6086. +/* This code should never be used but we define it anyhow. */
  6087. +# define SINGLE_THREAD_P (1)
  6088. +
  6089. #endif
  6090. diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
  6091. new file mode 100644
  6092. index 0000000..ab2286e
  6093. --- /dev/null
  6094. +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
  6095. @@ -0,0 +1,64 @@
  6096. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6097. + This file is part of the GNU C Library.
  6098. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6099. +
  6100. + The GNU C Library is free software; you can redistribute it and/or
  6101. + modify it under the terms of the GNU Lesser General Public
  6102. + License as published by the Free Software Foundation; either
  6103. + version 2.1 of the License, or (at your option) any later version.
  6104. +
  6105. + The GNU C Library is distributed in the hope that it will be useful,
  6106. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6107. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6108. + Lesser General Public License for more details.
  6109. +
  6110. + You should have received a copy of the GNU Lesser General Public
  6111. + License along with the GNU C Library; if not, see
  6112. + <http://www.gnu.org/licenses/>. */
  6113. +
  6114. +#include <sysdep-cancel.h>
  6115. +
  6116. + .text
  6117. +#ifdef SHARED
  6118. +.LLGETPC0:
  6119. + retl
  6120. + add %o7, %o0, %o0
  6121. +#endif
  6122. +ENTRY(__vfork)
  6123. +#ifdef SHARED
  6124. + mov %o7, %o1
  6125. + sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
  6126. + call .LLGETPC0
  6127. + add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
  6128. + sethi %hi(__libc_pthread_functions), %o2
  6129. + mov %o1, %o7
  6130. + or %o2, %lo(__libc_pthread_functions), %o2
  6131. + ld [%o0 + %o2], %o2
  6132. + ld [%o2], %o2
  6133. + cmp %o2, 0
  6134. +#else
  6135. + .weak pthread_create
  6136. + sethi %hi(pthread_create), %o0
  6137. + orcc %o0, %lo(pthread_create), %o0
  6138. +#endif
  6139. +#if defined SHARED && !defined BROKEN_SPARC_WDISP22
  6140. + bne HIDDEN_JUMPTARGET(fork)
  6141. +#else
  6142. + bne 1f
  6143. +#endif
  6144. + mov __NR_vfork, %g1
  6145. + ta 0x10
  6146. + bcs __syscall_error_handler
  6147. + nop
  6148. + sub %o1, 1, %o1
  6149. + retl
  6150. + and %o0, %o1, %o0
  6151. +#if !defined SHARED || defined BROKEN_SPARC_WDISP22
  6152. +1: mov %o7, %g1
  6153. + call HIDDEN_JUMPTARGET(fork)
  6154. + mov %g1, %o7
  6155. +#endif
  6156. + SYSCALL_ERROR_HANDLER
  6157. +PSEUDO_END (__vfork)
  6158. +libc_hidden_def (__vfork)
  6159. +weak_alias (__vfork, vfork)
  6160. diff --git a/libpthread/nptl/sysdeps/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
  6161. new file mode 100644
  6162. index 0000000..2f64e7d
  6163. --- /dev/null
  6164. +++ b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
  6165. @@ -0,0 +1,27 @@
  6166. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6167. + This file is part of the GNU C Library.
  6168. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6169. +
  6170. + The GNU C Library is free software; you can redistribute it and/or
  6171. + modify it under the terms of the GNU Lesser General Public
  6172. + License as published by the Free Software Foundation; either
  6173. + version 2.1 of the License, or (at your option) any later version.
  6174. +
  6175. + The GNU C Library is distributed in the hope that it will be useful,
  6176. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6177. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6178. + Lesser General Public License for more details.
  6179. +
  6180. + You should have received a copy of the GNU Lesser General Public
  6181. + License along with the GNU C Library; if not, see
  6182. + <http://www.gnu.org/licenses/>. */
  6183. +
  6184. +#include <setjmp.h>
  6185. +#include <stdint.h>
  6186. +#include <unwind.h>
  6187. +
  6188. +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6189. + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6190. +
  6191. +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6192. + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6193. diff --git a/libpthread/nptl/sysdeps/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
  6194. new file mode 100644
  6195. index 0000000..2dfcd3c
  6196. --- /dev/null
  6197. +++ b/libpthread/nptl/sysdeps/pthread_spin_lock.c
  6198. @@ -0,0 +1,39 @@
  6199. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6200. + This file is part of the GNU C Library.
  6201. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6202. +
  6203. + The GNU C Library is free software; you can redistribute it and/or
  6204. + modify it under the terms of the GNU Lesser General Public
  6205. + License as published by the Free Software Foundation; either
  6206. + version 2.1 of the License, or (at your option) any later version.
  6207. +
  6208. + The GNU C Library is distributed in the hope that it will be useful,
  6209. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6210. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6211. + Lesser General Public License for more details.
  6212. +
  6213. + You should have received a copy of the GNU Lesser General Public
  6214. + License along with the GNU C Library; if not, see
  6215. + <http://www.gnu.org/licenses/>. */
  6216. +
  6217. +#include "pthreadP.h"
  6218. +
  6219. +int
  6220. +pthread_spin_lock (pthread_spinlock_t *lock)
  6221. +{
  6222. + __asm__ __volatile__
  6223. + ("1: ldstub [%0], %%g2\n"
  6224. + " orcc %%g2, 0x0, %%g0\n"
  6225. + " bne,a 2f\n"
  6226. + " ldub [%0], %%g2\n"
  6227. + ".subsection 2\n"
  6228. + "2: orcc %%g2, 0x0, %%g0\n"
  6229. + " bne,a 2b\n"
  6230. + " ldub [%0], %%g2\n"
  6231. + " b,a 1b\n"
  6232. + ".previous"
  6233. + : /* no outputs */
  6234. + : "r" (lock)
  6235. + : "g2", "memory", "cc");
  6236. + return 0;
  6237. +}
  6238. diff --git a/libpthread/nptl/sysdeps/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
  6239. new file mode 100644
  6240. index 0000000..c1b7b23
  6241. --- /dev/null
  6242. +++ b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
  6243. @@ -0,0 +1,28 @@
  6244. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6245. + This file is part of the GNU C Library.
  6246. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6247. +
  6248. + The GNU C Library is free software; you can redistribute it and/or
  6249. + modify it under the terms of the GNU Lesser General Public
  6250. + License as published by the Free Software Foundation; either
  6251. + version 2.1 of the License, or (at your option) any later version.
  6252. +
  6253. + The GNU C Library is distributed in the hope that it will be useful,
  6254. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6255. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6256. + Lesser General Public License for more details.
  6257. +
  6258. + You should have received a copy of the GNU Lesser General Public
  6259. + License along with the GNU C Library; if not, see
  6260. + <http://www.gnu.org/licenses/>. */
  6261. +
  6262. +#include <errno.h>
  6263. +#include "pthreadP.h"
  6264. +
  6265. +int
  6266. +pthread_spin_trylock (pthread_spinlock_t *lock)
  6267. +{
  6268. + int res;
  6269. + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6270. + return res == 0 ? 0 : EBUSY;
  6271. +}
  6272. diff --git a/libpthread/nptl/sysdeps/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
  6273. new file mode 100644
  6274. index 0000000..435fedc
  6275. --- /dev/null
  6276. +++ b/libpthread/nptl/sysdeps/pthreaddef.h
  6277. @@ -0,0 +1,39 @@
  6278. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6279. + This file is part of the GNU C Library.
  6280. +
  6281. + The GNU C Library is free software; you can redistribute it and/or
  6282. + modify it under the terms of the GNU Lesser General Public
  6283. + License as published by the Free Software Foundation; either
  6284. + version 2.1 of the License, or (at your option) any later version.
  6285. +
  6286. + The GNU C Library is distributed in the hope that it will be useful,
  6287. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6288. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6289. + Lesser General Public License for more details.
  6290. +
  6291. + You should have received a copy of the GNU Lesser General Public
  6292. + License along with the GNU C Library; if not, see
  6293. + <http://www.gnu.org/licenses/>. */
  6294. +
  6295. +/* Default stack size. */
  6296. +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6297. +
  6298. +/* Required stack pointer alignment at beginning. */
  6299. +#define STACK_ALIGN 16
  6300. +
  6301. +/* Minimal stack size after allocating thread descriptor and guard size. */
  6302. +#define MINIMAL_REST_STACK 2048
  6303. +
  6304. +/* Alignment requirement for TCB. */
  6305. +#define TCB_ALIGNMENT 16
  6306. +
  6307. +
  6308. +/* Location of current stack frame. */
  6309. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6310. +register char *stack_pointer __asm__("%sp");
  6311. +
  6312. +/* XXX Until we have a better place keep the definitions here. */
  6313. +
  6314. +/* While there is no such syscall. */
  6315. +#define __exit_thread_inline(val) \
  6316. + INLINE_SYSCALL (exit, 1, (val))
  6317. diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6318. index 6cbb37b..2f64e7d 100644
  6319. --- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6320. +++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
  6321. @@ -1,5 +1,27 @@
  6322. -#if defined(__arch64__)
  6323. -#include "sparc64/jmpbuf-unwind.h"
  6324. -#else
  6325. -#include "sparc32/jmpbuf-unwind.h"
  6326. -#endif
  6327. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6328. + This file is part of the GNU C Library.
  6329. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6330. +
  6331. + The GNU C Library is free software; you can redistribute it and/or
  6332. + modify it under the terms of the GNU Lesser General Public
  6333. + License as published by the Free Software Foundation; either
  6334. + version 2.1 of the License, or (at your option) any later version.
  6335. +
  6336. + The GNU C Library is distributed in the hope that it will be useful,
  6337. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6338. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6339. + Lesser General Public License for more details.
  6340. +
  6341. + You should have received a copy of the GNU Lesser General Public
  6342. + License along with the GNU C Library; if not, see
  6343. + <http://www.gnu.org/licenses/>. */
  6344. +
  6345. +#include <setjmp.h>
  6346. +#include <stdint.h>
  6347. +#include <unwind.h>
  6348. +
  6349. +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6350. + _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6351. +
  6352. +#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6353. + ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6354. diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6355. index dcc5ae2..2dfcd3c 100644
  6356. --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6357. +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
  6358. @@ -1,5 +1,39 @@
  6359. -#if defined(__arch64__)
  6360. -#include "sparc64/pthread_spin_lock.c"
  6361. -#else
  6362. -#include "sparc32/pthread_spin_lock.c"
  6363. -#endif
  6364. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6365. + This file is part of the GNU C Library.
  6366. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6367. +
  6368. + The GNU C Library is free software; you can redistribute it and/or
  6369. + modify it under the terms of the GNU Lesser General Public
  6370. + License as published by the Free Software Foundation; either
  6371. + version 2.1 of the License, or (at your option) any later version.
  6372. +
  6373. + The GNU C Library is distributed in the hope that it will be useful,
  6374. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6375. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6376. + Lesser General Public License for more details.
  6377. +
  6378. + You should have received a copy of the GNU Lesser General Public
  6379. + License along with the GNU C Library; if not, see
  6380. + <http://www.gnu.org/licenses/>. */
  6381. +
  6382. +#include "pthreadP.h"
  6383. +
  6384. +int
  6385. +pthread_spin_lock (pthread_spinlock_t *lock)
  6386. +{
  6387. + __asm__ __volatile__
  6388. + ("1: ldstub [%0], %%g2\n"
  6389. + " orcc %%g2, 0x0, %%g0\n"
  6390. + " bne,a 2f\n"
  6391. + " ldub [%0], %%g2\n"
  6392. + ".subsection 2\n"
  6393. + "2: orcc %%g2, 0x0, %%g0\n"
  6394. + " bne,a 2b\n"
  6395. + " ldub [%0], %%g2\n"
  6396. + " b,a 1b\n"
  6397. + ".previous"
  6398. + : /* no outputs */
  6399. + : "r" (lock)
  6400. + : "g2", "memory", "cc");
  6401. + return 0;
  6402. +}
  6403. diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6404. index af63eec..c1b7b23 100644
  6405. --- a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6406. +++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
  6407. @@ -1,5 +1,28 @@
  6408. -#if defined(__arch64__)
  6409. -#include "sparc64/pthread_spin_trylock.c"
  6410. -#else
  6411. -#include "sparc32/pthread_spin_trylock.c"
  6412. -#endif
  6413. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6414. + This file is part of the GNU C Library.
  6415. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6416. +
  6417. + The GNU C Library is free software; you can redistribute it and/or
  6418. + modify it under the terms of the GNU Lesser General Public
  6419. + License as published by the Free Software Foundation; either
  6420. + version 2.1 of the License, or (at your option) any later version.
  6421. +
  6422. + The GNU C Library is distributed in the hope that it will be useful,
  6423. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6424. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6425. + Lesser General Public License for more details.
  6426. +
  6427. + You should have received a copy of the GNU Lesser General Public
  6428. + License along with the GNU C Library; if not, see
  6429. + <http://www.gnu.org/licenses/>. */
  6430. +
  6431. +#include <errno.h>
  6432. +#include "pthreadP.h"
  6433. +
  6434. +int
  6435. +pthread_spin_trylock (pthread_spinlock_t *lock)
  6436. +{
  6437. + int res;
  6438. + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6439. + return res == 0 ? 0 : EBUSY;
  6440. +}
  6441. diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6442. index d4695c4..435fedc 100644
  6443. --- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6444. +++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
  6445. @@ -1,5 +1,39 @@
  6446. -#if defined(__arch64__)
  6447. -#include "sparc64/pthreaddef.h"
  6448. -#else
  6449. -#include "sparc32/pthreaddef.h"
  6450. -#endif
  6451. +/* Copyright (C) 2003 Free Software Foundation, Inc.
  6452. + This file is part of the GNU C Library.
  6453. +
  6454. + The GNU C Library is free software; you can redistribute it and/or
  6455. + modify it under the terms of the GNU Lesser General Public
  6456. + License as published by the Free Software Foundation; either
  6457. + version 2.1 of the License, or (at your option) any later version.
  6458. +
  6459. + The GNU C Library is distributed in the hope that it will be useful,
  6460. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6461. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6462. + Lesser General Public License for more details.
  6463. +
  6464. + You should have received a copy of the GNU Lesser General Public
  6465. + License along with the GNU C Library; if not, see
  6466. + <http://www.gnu.org/licenses/>. */
  6467. +
  6468. +/* Default stack size. */
  6469. +#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6470. +
  6471. +/* Required stack pointer alignment at beginning. */
  6472. +#define STACK_ALIGN 16
  6473. +
  6474. +/* Minimal stack size after allocating thread descriptor and guard size. */
  6475. +#define MINIMAL_REST_STACK 2048
  6476. +
  6477. +/* Alignment requirement for TCB. */
  6478. +#define TCB_ALIGNMENT 16
  6479. +
  6480. +
  6481. +/* Location of current stack frame. */
  6482. +#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6483. +register char *stack_pointer __asm__("%sp");
  6484. +
  6485. +/* XXX Until we have a better place keep the definitions here. */
  6486. +
  6487. +/* While there is no such syscall. */
  6488. +#define __exit_thread_inline(val) \
  6489. + INLINE_SYSCALL (exit, 1, (val))
  6490. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
  6491. deleted file mode 100644
  6492. index 2f64e7d..0000000
  6493. --- a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
  6494. +++ /dev/null
  6495. @@ -1,27 +0,0 @@
  6496. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6497. - This file is part of the GNU C Library.
  6498. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6499. -
  6500. - The GNU C Library is free software; you can redistribute it and/or
  6501. - modify it under the terms of the GNU Lesser General Public
  6502. - License as published by the Free Software Foundation; either
  6503. - version 2.1 of the License, or (at your option) any later version.
  6504. -
  6505. - The GNU C Library is distributed in the hope that it will be useful,
  6506. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6507. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6508. - Lesser General Public License for more details.
  6509. -
  6510. - You should have received a copy of the GNU Lesser General Public
  6511. - License along with the GNU C Library; if not, see
  6512. - <http://www.gnu.org/licenses/>. */
  6513. -
  6514. -#include <setjmp.h>
  6515. -#include <stdint.h>
  6516. -#include <unwind.h>
  6517. -
  6518. -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6519. - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6520. -
  6521. -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6522. - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6523. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
  6524. deleted file mode 100644
  6525. index 2dfcd3c..0000000
  6526. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
  6527. +++ /dev/null
  6528. @@ -1,39 +0,0 @@
  6529. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6530. - This file is part of the GNU C Library.
  6531. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6532. -
  6533. - The GNU C Library is free software; you can redistribute it and/or
  6534. - modify it under the terms of the GNU Lesser General Public
  6535. - License as published by the Free Software Foundation; either
  6536. - version 2.1 of the License, or (at your option) any later version.
  6537. -
  6538. - The GNU C Library is distributed in the hope that it will be useful,
  6539. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6540. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6541. - Lesser General Public License for more details.
  6542. -
  6543. - You should have received a copy of the GNU Lesser General Public
  6544. - License along with the GNU C Library; if not, see
  6545. - <http://www.gnu.org/licenses/>. */
  6546. -
  6547. -#include "pthreadP.h"
  6548. -
  6549. -int
  6550. -pthread_spin_lock (pthread_spinlock_t *lock)
  6551. -{
  6552. - __asm__ __volatile__
  6553. - ("1: ldstub [%0], %%g2\n"
  6554. - " orcc %%g2, 0x0, %%g0\n"
  6555. - " bne,a 2f\n"
  6556. - " ldub [%0], %%g2\n"
  6557. - ".subsection 2\n"
  6558. - "2: orcc %%g2, 0x0, %%g0\n"
  6559. - " bne,a 2b\n"
  6560. - " ldub [%0], %%g2\n"
  6561. - " b,a 1b\n"
  6562. - ".previous"
  6563. - : /* no outputs */
  6564. - : "r" (lock)
  6565. - : "g2", "memory", "cc");
  6566. - return 0;
  6567. -}
  6568. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
  6569. deleted file mode 100644
  6570. index c1b7b23..0000000
  6571. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
  6572. +++ /dev/null
  6573. @@ -1,28 +0,0 @@
  6574. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6575. - This file is part of the GNU C Library.
  6576. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6577. -
  6578. - The GNU C Library is free software; you can redistribute it and/or
  6579. - modify it under the terms of the GNU Lesser General Public
  6580. - License as published by the Free Software Foundation; either
  6581. - version 2.1 of the License, or (at your option) any later version.
  6582. -
  6583. - The GNU C Library is distributed in the hope that it will be useful,
  6584. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6585. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6586. - Lesser General Public License for more details.
  6587. -
  6588. - You should have received a copy of the GNU Lesser General Public
  6589. - License along with the GNU C Library; if not, see
  6590. - <http://www.gnu.org/licenses/>. */
  6591. -
  6592. -#include <errno.h>
  6593. -#include "pthreadP.h"
  6594. -
  6595. -int
  6596. -pthread_spin_trylock (pthread_spinlock_t *lock)
  6597. -{
  6598. - int res;
  6599. - __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
  6600. - return res == 0 ? 0 : EBUSY;
  6601. -}
  6602. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
  6603. deleted file mode 100644
  6604. index 435fedc..0000000
  6605. --- a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
  6606. +++ /dev/null
  6607. @@ -1,39 +0,0 @@
  6608. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6609. - This file is part of the GNU C Library.
  6610. -
  6611. - The GNU C Library is free software; you can redistribute it and/or
  6612. - modify it under the terms of the GNU Lesser General Public
  6613. - License as published by the Free Software Foundation; either
  6614. - version 2.1 of the License, or (at your option) any later version.
  6615. -
  6616. - The GNU C Library is distributed in the hope that it will be useful,
  6617. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6618. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6619. - Lesser General Public License for more details.
  6620. -
  6621. - You should have received a copy of the GNU Lesser General Public
  6622. - License along with the GNU C Library; if not, see
  6623. - <http://www.gnu.org/licenses/>. */
  6624. -
  6625. -/* Default stack size. */
  6626. -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
  6627. -
  6628. -/* Required stack pointer alignment at beginning. */
  6629. -#define STACK_ALIGN 16
  6630. -
  6631. -/* Minimal stack size after allocating thread descriptor and guard size. */
  6632. -#define MINIMAL_REST_STACK 2048
  6633. -
  6634. -/* Alignment requirement for TCB. */
  6635. -#define TCB_ALIGNMENT 16
  6636. -
  6637. -
  6638. -/* Location of current stack frame. */
  6639. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
  6640. -register char *stack_pointer __asm__("%sp");
  6641. -
  6642. -/* XXX Until we have a better place keep the definitions here. */
  6643. -
  6644. -/* While there is no such syscall. */
  6645. -#define __exit_thread_inline(val) \
  6646. - INLINE_SYSCALL (exit, 1, (val))
  6647. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
  6648. deleted file mode 100644
  6649. index 3d314be..0000000
  6650. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
  6651. +++ /dev/null
  6652. @@ -1,38 +0,0 @@
  6653. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6654. - This file is part of the GNU C Library.
  6655. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6656. -
  6657. - The GNU C Library is free software; you can redistribute it and/or
  6658. - modify it under the terms of the GNU Lesser General Public
  6659. - License as published by the Free Software Foundation; either
  6660. - version 2.1 of the License, or (at your option) any later version.
  6661. -
  6662. - The GNU C Library is distributed in the hope that it will be useful,
  6663. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6664. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6665. - Lesser General Public License for more details.
  6666. -
  6667. - You should have received a copy of the GNU Lesser General Public
  6668. - License along with the GNU C Library; if not, see
  6669. - <http://www.gnu.org/licenses/>. */
  6670. -
  6671. -#include "pthreadP.h"
  6672. -
  6673. -int
  6674. -pthread_spin_lock (pthread_spinlock_t *lock)
  6675. -{
  6676. - __asm__ __volatile__
  6677. - ("1: ldstub [%0], %%g2\n"
  6678. - " brnz,pn %%g2, 2f\n"
  6679. - " membar #StoreLoad | #StoreStore\n"
  6680. - ".subsection 2\n"
  6681. - "2: ldub [%0], %%g2\n"
  6682. - " brnz,pt %%g2, 2b\n"
  6683. - " membar #LoadLoad\n"
  6684. - " b,a,pt %%xcc, 1b\n"
  6685. - ".previous"
  6686. - : /* no outputs */
  6687. - : "r" (lock)
  6688. - : "g2", "memory");
  6689. - return 0;
  6690. -}
  6691. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
  6692. deleted file mode 100644
  6693. index 3b20a21..0000000
  6694. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
  6695. +++ /dev/null
  6696. @@ -1 +0,0 @@
  6697. -#include <sparc64/pthread_spin_trylock.c>
  6698. diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
  6699. deleted file mode 100644
  6700. index 482cbe3..0000000
  6701. --- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
  6702. +++ /dev/null
  6703. @@ -1 +0,0 @@
  6704. -#include <sparc64/pthread_spin_unlock.c>
  6705. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
  6706. deleted file mode 100644
  6707. index 2f64e7d..0000000
  6708. --- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
  6709. +++ /dev/null
  6710. @@ -1,27 +0,0 @@
  6711. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  6712. - This file is part of the GNU C Library.
  6713. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6714. -
  6715. - The GNU C Library is free software; you can redistribute it and/or
  6716. - modify it under the terms of the GNU Lesser General Public
  6717. - License as published by the Free Software Foundation; either
  6718. - version 2.1 of the License, or (at your option) any later version.
  6719. -
  6720. - The GNU C Library is distributed in the hope that it will be useful,
  6721. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6722. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6723. - Lesser General Public License for more details.
  6724. -
  6725. - You should have received a copy of the GNU Lesser General Public
  6726. - License along with the GNU C Library; if not, see
  6727. - <http://www.gnu.org/licenses/>. */
  6728. -
  6729. -#include <setjmp.h>
  6730. -#include <stdint.h>
  6731. -#include <unwind.h>
  6732. -
  6733. -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  6734. - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  6735. -
  6736. -#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  6737. - ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  6738. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
  6739. deleted file mode 100644
  6740. index 0235056..0000000
  6741. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
  6742. +++ /dev/null
  6743. @@ -1,38 +0,0 @@
  6744. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6745. - This file is part of the GNU C Library.
  6746. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6747. -
  6748. - The GNU C Library is free software; you can redistribute it and/or
  6749. - modify it under the terms of the GNU Lesser General Public
  6750. - License as published by the Free Software Foundation; either
  6751. - version 2.1 of the License, or (at your option) any later version.
  6752. -
  6753. - The GNU C Library is distributed in the hope that it will be useful,
  6754. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6755. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6756. - Lesser General Public License for more details.
  6757. -
  6758. - You should have received a copy of the GNU Lesser General Public
  6759. - License along with the GNU C Library; if not, see
  6760. - <http://www.gnu.org/licenses/>. */
  6761. -
  6762. -#include "pthreadP.h"
  6763. -
  6764. -int
  6765. -pthread_spin_lock (pthread_spinlock_t *lock)
  6766. -{
  6767. - __asm__ __volatile__
  6768. - ("1: ldstub [%0], %%g5\n"
  6769. - " brnz,pn %%g5, 2f\n"
  6770. - " membar #StoreLoad | #StoreStore\n"
  6771. - ".subsection 2\n"
  6772. - "2: ldub [%0], %%g5\n"
  6773. - " brnz,pt %%g5, 2b\n"
  6774. - " membar #LoadLoad\n"
  6775. - " b,a,pt %%xcc, 1b\n"
  6776. - ".previous"
  6777. - : /* no outputs */
  6778. - : "r" (lock)
  6779. - : "g5", "memory");
  6780. - return 0;
  6781. -}
  6782. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
  6783. deleted file mode 100644
  6784. index b14621b..0000000
  6785. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
  6786. +++ /dev/null
  6787. @@ -1,33 +0,0 @@
  6788. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6789. - This file is part of the GNU C Library.
  6790. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  6791. -
  6792. - The GNU C Library is free software; you can redistribute it and/or
  6793. - modify it under the terms of the GNU Lesser General Public
  6794. - License as published by the Free Software Foundation; either
  6795. - version 2.1 of the License, or (at your option) any later version.
  6796. -
  6797. - The GNU C Library is distributed in the hope that it will be useful,
  6798. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6799. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6800. - Lesser General Public License for more details.
  6801. -
  6802. - You should have received a copy of the GNU Lesser General Public
  6803. - License along with the GNU C Library; if not, see
  6804. - <http://www.gnu.org/licenses/>. */
  6805. -
  6806. -#include <errno.h>
  6807. -#include "pthreadP.h"
  6808. -
  6809. -int
  6810. -pthread_spin_trylock (pthread_spinlock_t *lock)
  6811. -{
  6812. - int res;
  6813. - __asm__ __volatile__
  6814. - ("ldstub [%1], %0\n"
  6815. - "membar #StoreLoad | #StoreStore"
  6816. - : "=r" (res)
  6817. - : "r" (lock)
  6818. - : "memory");
  6819. - return res == 0 ? 0 : EBUSY;
  6820. -}
  6821. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
  6822. deleted file mode 100644
  6823. index a00fad3..0000000
  6824. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
  6825. +++ /dev/null
  6826. @@ -1,29 +0,0 @@
  6827. -/* pthread_spin_unlock -- unlock a spin lock. Generic version.
  6828. - Copyright (C) 2003 Free Software Foundation, Inc.
  6829. - This file is part of the GNU C Library.
  6830. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  6831. -
  6832. - The GNU C Library is free software; you can redistribute it and/or
  6833. - modify it under the terms of the GNU Lesser General Public
  6834. - License as published by the Free Software Foundation; either
  6835. - version 2.1 of the License, or (at your option) any later version.
  6836. -
  6837. - The GNU C Library is distributed in the hope that it will be useful,
  6838. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6839. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6840. - Lesser General Public License for more details.
  6841. -
  6842. - You should have received a copy of the GNU Lesser General Public
  6843. - License along with the GNU C Library; if not, see
  6844. - <http://www.gnu.org/licenses/>. */
  6845. -
  6846. -#include "pthreadP.h"
  6847. -#include <atomic.h>
  6848. -
  6849. -int
  6850. -pthread_spin_unlock (pthread_spinlock_t *lock)
  6851. -{
  6852. - __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
  6853. - *lock = 0;
  6854. - return 0;
  6855. -}
  6856. diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
  6857. deleted file mode 100644
  6858. index 845f4bf..0000000
  6859. --- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
  6860. +++ /dev/null
  6861. @@ -1,39 +0,0 @@
  6862. -/* Copyright (C) 2003 Free Software Foundation, Inc.
  6863. - This file is part of the GNU C Library.
  6864. -
  6865. - The GNU C Library is free software; you can redistribute it and/or
  6866. - modify it under the terms of the GNU Lesser General Public
  6867. - License as published by the Free Software Foundation; either
  6868. - version 2.1 of the License, or (at your option) any later version.
  6869. -
  6870. - The GNU C Library is distributed in the hope that it will be useful,
  6871. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  6872. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6873. - Lesser General Public License for more details.
  6874. -
  6875. - You should have received a copy of the GNU Lesser General Public
  6876. - License along with the GNU C Library; if not, see
  6877. - <http://www.gnu.org/licenses/>. */
  6878. -
  6879. -/* Default stack size. */
  6880. -#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
  6881. -
  6882. -/* Required stack pointer alignment at beginning. */
  6883. -#define STACK_ALIGN 16
  6884. -
  6885. -/* Minimal stack size after allocating thread descriptor and guard size. */
  6886. -#define MINIMAL_REST_STACK 4096
  6887. -
  6888. -/* Alignment requirement for TCB. */
  6889. -#define TCB_ALIGNMENT 16
  6890. -
  6891. -
  6892. -/* Location of current stack frame. */
  6893. -#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
  6894. -register char *stack_pointer __asm__("%sp");
  6895. -
  6896. -/* XXX Until we have a better place keep the definitions here. */
  6897. -
  6898. -/* While there is no such syscall. */
  6899. -#define __exit_thread_inline(val) \
  6900. - INLINE_SYSCALL (exit, 1, (val))
  6901. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6902. index dfc5e82..a6142aa 100644
  6903. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6904. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
  6905. @@ -1,5 +1,2 @@
  6906. -#if defined(__arch64__)
  6907. -#include "./sparc64/clone.S"
  6908. -#else
  6909. -#include "./sparc32/clone.S"
  6910. -#endif
  6911. +#define RESET_PID
  6912. +#include <libc/sysdeps/linux/sparc/clone.S>
  6913. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6914. index e8705c5..37231a8 100644
  6915. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6916. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  6917. @@ -1,5 +1,44 @@
  6918. -#if defined(__arch64__)
  6919. -#include "sparc64/pt-vfork.S"
  6920. -#else
  6921. -#include "sparc32/pt-vfork.S"
  6922. -#endif
  6923. +/* Copyright (C) 2004 Free Software Foundation, Inc.
  6924. + This file is part of the GNU C Library.
  6925. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  6926. +
  6927. + The GNU C Library is free software; you can redistribute it and/or
  6928. + modify it under the terms of the GNU Lesser General Public
  6929. + License as published by the Free Software Foundation; either
  6930. + version 2.1 of the License, or (at your option) any later version.
  6931. +
  6932. + The GNU C Library is distributed in the hope that it will be useful,
  6933. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6934. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6935. + Lesser General Public License for more details.
  6936. +
  6937. + You should have received a copy of the GNU Lesser General Public
  6938. + License along with the GNU C Library; if not, see
  6939. + <http://www.gnu.org/licenses/>. */
  6940. +
  6941. +#include <sysdep.h>
  6942. +#include <tcb-offsets.h>
  6943. +
  6944. + .text
  6945. + .globl __syscall_error
  6946. +ENTRY(__vfork)
  6947. + ld [%g7 + PID], %o5
  6948. + sub %g0, %o5, %o4
  6949. + st %o4, [%g7 + PID]
  6950. +
  6951. + LOADSYSCALL(vfork)
  6952. + ta 0x10
  6953. + bcc 2f
  6954. + mov %o7, %g1
  6955. + st %o5, [%g7 + PID]
  6956. + call __syscall_error
  6957. + mov %g1, %o7
  6958. +2: sub %o1, 1, %o1
  6959. + andcc %o0, %o1, %o0
  6960. + bne,a 1f
  6961. + st %o5, [%g7 + PID]
  6962. +1: retl
  6963. + nop
  6964. +END(__vfork)
  6965. +
  6966. +weak_alias (__vfork, vfork)
  6967. 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
  6968. index 73eaa69..169f6e7 100644
  6969. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
  6970. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
  6971. @@ -1 +1,93 @@
  6972. -#include "sparc32/pthread_barrier_wait.c"
  6973. +/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  6974. + This file is part of the GNU C Library.
  6975. + Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
  6976. +
  6977. + The GNU C Library is free software; you can redistribute it and/or
  6978. + modify it under the terms of the GNU Lesser General Public
  6979. + License as published by the Free Software Foundation; either
  6980. + version 2.1 of the License, or (at your option) any later version.
  6981. +
  6982. + The GNU C Library is distributed in the hope that it will be useful,
  6983. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  6984. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6985. + Lesser General Public License for more details.
  6986. +
  6987. + You should have received a copy of the GNU Lesser General Public
  6988. + License along with the GNU C Library; if not, see
  6989. + <http://www.gnu.org/licenses/>. */
  6990. +
  6991. +#include <errno.h>
  6992. +#include <sysdep.h>
  6993. +#include <lowlevellock.h>
  6994. +#include <pthreadP.h>
  6995. +
  6996. +/* Wait on barrier. */
  6997. +int
  6998. +pthread_barrier_wait (
  6999. + pthread_barrier_t *barrier)
  7000. +{
  7001. + union sparc_pthread_barrier *ibarrier
  7002. + = (union sparc_pthread_barrier *) barrier;
  7003. + int result = 0;
  7004. + int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
  7005. +
  7006. + /* Make sure we are alone. */
  7007. + lll_lock (ibarrier->b.lock, private);
  7008. +
  7009. + /* One more arrival. */
  7010. + --ibarrier->b.left;
  7011. +
  7012. + /* Are these all? */
  7013. + if (ibarrier->b.left == 0)
  7014. + {
  7015. + /* Yes. Increment the event counter to avoid invalid wake-ups and
  7016. + tell the current waiters that it is their turn. */
  7017. + ++ibarrier->b.curr_event;
  7018. +
  7019. + /* Wake up everybody. */
  7020. + lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
  7021. +
  7022. + /* This is the thread which finished the serialization. */
  7023. + result = PTHREAD_BARRIER_SERIAL_THREAD;
  7024. + }
  7025. + else
  7026. + {
  7027. + /* The number of the event we are waiting for. The barrier's event
  7028. + number must be bumped before we continue. */
  7029. + unsigned int event = ibarrier->b.curr_event;
  7030. +
  7031. + /* Before suspending, make the barrier available to others. */
  7032. + lll_unlock (ibarrier->b.lock, private);
  7033. +
  7034. + /* Wait for the event counter of the barrier to change. */
  7035. + do
  7036. + lll_futex_wait (&ibarrier->b.curr_event, event, private);
  7037. + while (event == ibarrier->b.curr_event);
  7038. + }
  7039. +
  7040. + /* Make sure the init_count is stored locally or in a register. */
  7041. + unsigned int init_count = ibarrier->b.init_count;
  7042. +
  7043. + /* If this was the last woken thread, unlock. */
  7044. + if (__atomic_is_v9 || ibarrier->s.pshared == 0)
  7045. + {
  7046. + if (atomic_increment_val (&ibarrier->b.left) == init_count)
  7047. + /* We are done. */
  7048. + lll_unlock (ibarrier->b.lock, private);
  7049. + }
  7050. + else
  7051. + {
  7052. + unsigned int left;
  7053. + /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
  7054. + is only atomic for threads within the same process, not for
  7055. + multiple processes. */
  7056. + __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
  7057. + left = ++ibarrier->b.left;
  7058. + __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
  7059. + if (left == init_count)
  7060. + /* We are done. */
  7061. + lll_unlock (ibarrier->b.lock, private);
  7062. + }
  7063. +
  7064. + return result;
  7065. +}
  7066. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
  7067. new file mode 100644
  7068. index 0000000..8da4193
  7069. --- /dev/null
  7070. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
  7071. @@ -0,0 +1,52 @@
  7072. +/* sem_post -- post to a POSIX semaphore. SPARC version.
  7073. + Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7074. + This file is part of the GNU C Library.
  7075. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  7076. +
  7077. + The GNU C Library is free software; you can redistribute it and/or
  7078. + modify it under the terms of the GNU Lesser General Public
  7079. + License as published by the Free Software Foundation; either
  7080. + version 2.1 of the License, or (at your option) any later version.
  7081. +
  7082. + The GNU C Library is distributed in the hope that it will be useful,
  7083. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7084. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7085. + Lesser General Public License for more details.
  7086. +
  7087. + You should have received a copy of the GNU Lesser General Public
  7088. + License along with the GNU C Library; if not, see
  7089. + <http://www.gnu.org/licenses/>. */
  7090. +
  7091. +#include <errno.h>
  7092. +#include <sysdep.h>
  7093. +#include <lowlevellock.h>
  7094. +#include <internaltypes.h>
  7095. +#include <semaphore.h>
  7096. +
  7097. +int
  7098. +sem_post (sem_t *sem)
  7099. +{
  7100. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7101. + int nr;
  7102. +
  7103. + if (__atomic_is_v9)
  7104. + nr = atomic_increment_val (&isem->value);
  7105. + else
  7106. + {
  7107. + __sparc32_atomic_do_lock24 (&isem->lock);
  7108. + nr = ++(isem->value);
  7109. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7110. + }
  7111. + atomic_full_barrier ();
  7112. + if (isem->nwaiters > 0)
  7113. + {
  7114. + int err = lll_futex_wake (&isem->value, 1,
  7115. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7116. + if (__builtin_expect (err, 0) < 0)
  7117. + {
  7118. + __set_errno (-err);
  7119. + return -1;
  7120. + }
  7121. + }
  7122. + return 0;
  7123. +}
  7124. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
  7125. new file mode 100644
  7126. index 0000000..64c9abf
  7127. --- /dev/null
  7128. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
  7129. @@ -0,0 +1,147 @@
  7130. +/* sem_timedwait -- wait on a semaphore. SPARC version.
  7131. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7132. + This file is part of the GNU C Library.
  7133. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7134. +
  7135. + The GNU C Library is free software; you can redistribute it and/or
  7136. + modify it under the terms of the GNU Lesser General Public
  7137. + License as published by the Free Software Foundation; either
  7138. + version 2.1 of the License, or (at your option) any later version.
  7139. +
  7140. + The GNU C Library is distributed in the hope that it will be useful,
  7141. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7142. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7143. + Lesser General Public License for more details.
  7144. +
  7145. + You should have received a copy of the GNU Lesser General Public
  7146. + License along with the GNU C Library; if not, see
  7147. + <http://www.gnu.org/licenses/>. */
  7148. +
  7149. +#include <errno.h>
  7150. +#include <sysdep.h>
  7151. +#include <lowlevellock.h>
  7152. +#include <internaltypes.h>
  7153. +#include <semaphore.h>
  7154. +
  7155. +#include <pthreadP.h>
  7156. +
  7157. +
  7158. +extern void __sem_wait_cleanup (void *arg) attribute_hidden;
  7159. +
  7160. +
  7161. +int
  7162. +sem_timedwait (sem_t *sem, const struct timespec *abstime)
  7163. +{
  7164. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7165. + int err;
  7166. + int val;
  7167. +
  7168. + if (__atomic_is_v9)
  7169. + val = atomic_decrement_if_positive (&isem->value);
  7170. + else
  7171. + {
  7172. + __sparc32_atomic_do_lock24 (&isem->lock);
  7173. + val = isem->value;
  7174. + if (val > 0)
  7175. + isem->value = val - 1;
  7176. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7177. + }
  7178. +
  7179. + if (val > 0)
  7180. + return 0;
  7181. +
  7182. + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
  7183. + {
  7184. + __set_errno (EINVAL);
  7185. + return -1;
  7186. + }
  7187. +
  7188. + if (__atomic_is_v9)
  7189. + atomic_increment (&isem->nwaiters);
  7190. + else
  7191. + {
  7192. + __sparc32_atomic_do_lock24 (&isem->lock);
  7193. + isem->nwaiters++;
  7194. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7195. + }
  7196. +
  7197. + pthread_cleanup_push (__sem_wait_cleanup, isem);
  7198. +
  7199. + while (1)
  7200. + {
  7201. + struct timeval tv;
  7202. + struct timespec rt;
  7203. + int sec, nsec;
  7204. +
  7205. + /* Get the current time. */
  7206. + __gettimeofday (&tv, NULL);
  7207. +
  7208. + /* Compute relative timeout. */
  7209. + sec = abstime->tv_sec - tv.tv_sec;
  7210. + nsec = abstime->tv_nsec - tv.tv_usec * 1000;
  7211. + if (nsec < 0)
  7212. + {
  7213. + nsec += 1000000000;
  7214. + --sec;
  7215. + }
  7216. +
  7217. + /* Already timed out? */
  7218. + err = -ETIMEDOUT;
  7219. + if (sec < 0)
  7220. + {
  7221. + __set_errno (ETIMEDOUT);
  7222. + err = -1;
  7223. + break;
  7224. + }
  7225. +
  7226. + /* Do wait. */
  7227. + rt.tv_sec = sec;
  7228. + rt.tv_nsec = nsec;
  7229. +
  7230. + /* Enable asynchronous cancellation. Required by the standard. */
  7231. + int oldtype = __pthread_enable_asynccancel ();
  7232. +
  7233. + err = lll_futex_timed_wait (&isem->value, 0, &rt,
  7234. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7235. +
  7236. + /* Disable asynchronous cancellation. */
  7237. + __pthread_disable_asynccancel (oldtype);
  7238. +
  7239. + if (err != 0 && err != -EWOULDBLOCK)
  7240. + {
  7241. + __set_errno (-err);
  7242. + err = -1;
  7243. + break;
  7244. + }
  7245. +
  7246. + if (__atomic_is_v9)
  7247. + val = atomic_decrement_if_positive (&isem->value);
  7248. + else
  7249. + {
  7250. + __sparc32_atomic_do_lock24 (&isem->lock);
  7251. + val = isem->value;
  7252. + if (val > 0)
  7253. + isem->value = val - 1;
  7254. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7255. + }
  7256. +
  7257. + if (val > 0)
  7258. + {
  7259. + err = 0;
  7260. + break;
  7261. + }
  7262. + }
  7263. +
  7264. + pthread_cleanup_pop (0);
  7265. +
  7266. + if (__atomic_is_v9)
  7267. + atomic_decrement (&isem->nwaiters);
  7268. + else
  7269. + {
  7270. + __sparc32_atomic_do_lock24 (&isem->lock);
  7271. + isem->nwaiters--;
  7272. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7273. + }
  7274. +
  7275. + return err;
  7276. +}
  7277. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
  7278. new file mode 100644
  7279. index 0000000..36e859b
  7280. --- /dev/null
  7281. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
  7282. @@ -0,0 +1,51 @@
  7283. +/* sem_trywait -- wait on a semaphore. SPARC version.
  7284. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7285. + This file is part of the GNU C Library.
  7286. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7287. +
  7288. + The GNU C Library is free software; you can redistribute it and/or
  7289. + modify it under the terms of the GNU Lesser General Public
  7290. + License as published by the Free Software Foundation; either
  7291. + version 2.1 of the License, or (at your option) any later version.
  7292. +
  7293. + The GNU C Library is distributed in the hope that it will be useful,
  7294. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7295. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7296. + Lesser General Public License for more details.
  7297. +
  7298. + You should have received a copy of the GNU Lesser General Public
  7299. + License along with the GNU C Library; if not, see
  7300. + <http://www.gnu.org/licenses/>. */
  7301. +
  7302. +#include <errno.h>
  7303. +#include <sysdep.h>
  7304. +#include <lowlevellock.h>
  7305. +#include <internaltypes.h>
  7306. +#include <semaphore.h>
  7307. +
  7308. +
  7309. +int
  7310. +sem_trywait (sem_t *sem)
  7311. +{
  7312. + struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
  7313. + int val;
  7314. +
  7315. + if (isem->value > 0)
  7316. + {
  7317. + if (__atomic_is_v9)
  7318. + val = atomic_decrement_if_positive (&isem->value);
  7319. + else
  7320. + {
  7321. + __sparc32_atomic_do_lock24 (&isem->lock);
  7322. + val = isem->value;
  7323. + if (val > 0)
  7324. + isem->value = val - 1;
  7325. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7326. + }
  7327. + if (val > 0)
  7328. + return 0;
  7329. + }
  7330. +
  7331. + __set_errno (EAGAIN);
  7332. + return -1;
  7333. +}
  7334. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
  7335. new file mode 100644
  7336. index 0000000..5d887ab
  7337. --- /dev/null
  7338. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
  7339. @@ -0,0 +1,124 @@
  7340. +/* sem_wait -- wait on a semaphore. Generic futex-using version.
  7341. + Copyright (C) 2003, 2007 Free Software Foundation, Inc.
  7342. + This file is part of the GNU C Library.
  7343. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7344. +
  7345. + The GNU C Library is free software; you can redistribute it and/or
  7346. + modify it under the terms of the GNU Lesser General Public
  7347. + License as published by the Free Software Foundation; either
  7348. + version 2.1 of the License, or (at your option) any later version.
  7349. +
  7350. + The GNU C Library is distributed in the hope that it will be useful,
  7351. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  7352. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7353. + Lesser General Public License for more details.
  7354. +
  7355. + You should have received a copy of the GNU Lesser General Public
  7356. + License along with the GNU C Library; if not, see
  7357. + <http://www.gnu.org/licenses/>. */
  7358. +
  7359. +#include <errno.h>
  7360. +#include <sysdep.h>
  7361. +#include <lowlevellock.h>
  7362. +#include <internaltypes.h>
  7363. +#include <semaphore.h>
  7364. +
  7365. +#include <pthreadP.h>
  7366. +
  7367. +
  7368. +void
  7369. +attribute_hidden
  7370. +__sem_wait_cleanup (void *arg)
  7371. +{
  7372. + struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
  7373. +
  7374. + if (__atomic_is_v9)
  7375. + atomic_decrement (&isem->nwaiters);
  7376. + else
  7377. + {
  7378. + __sparc32_atomic_do_lock24 (&isem->lock);
  7379. + isem->nwaiters--;
  7380. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7381. + }
  7382. +}
  7383. +
  7384. +
  7385. +int
  7386. +sem_wait (sem_t *sem)
  7387. +{
  7388. + struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7389. + int err;
  7390. + int val;
  7391. +
  7392. + if (__atomic_is_v9)
  7393. + val = atomic_decrement_if_positive (&isem->value);
  7394. + else
  7395. + {
  7396. + __sparc32_atomic_do_lock24 (&isem->lock);
  7397. + val = isem->value;
  7398. + if (val > 0)
  7399. + isem->value = val - 1;
  7400. + else
  7401. + isem->nwaiters++;
  7402. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7403. + }
  7404. +
  7405. + if (val > 0)
  7406. + return 0;
  7407. +
  7408. + if (__atomic_is_v9)
  7409. + atomic_increment (&isem->nwaiters);
  7410. + else
  7411. + /* Already done above while still holding isem->lock. */;
  7412. +
  7413. + pthread_cleanup_push (__sem_wait_cleanup, isem);
  7414. +
  7415. + while (1)
  7416. + {
  7417. + /* Enable asynchronous cancellation. Required by the standard. */
  7418. + int oldtype = __pthread_enable_asynccancel ();
  7419. +
  7420. + err = lll_futex_wait (&isem->value, 0,
  7421. + isem->private ^ FUTEX_PRIVATE_FLAG);
  7422. +
  7423. + /* Disable asynchronous cancellation. */
  7424. + __pthread_disable_asynccancel (oldtype);
  7425. +
  7426. + if (err != 0 && err != -EWOULDBLOCK)
  7427. + {
  7428. + __set_errno (-err);
  7429. + err = -1;
  7430. + break;
  7431. + }
  7432. +
  7433. + if (__atomic_is_v9)
  7434. + val = atomic_decrement_if_positive (&isem->value);
  7435. + else
  7436. + {
  7437. + __sparc32_atomic_do_lock24 (&isem->lock);
  7438. + val = isem->value;
  7439. + if (val > 0)
  7440. + isem->value = val - 1;
  7441. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7442. + }
  7443. +
  7444. + if (val > 0)
  7445. + {
  7446. + err = 0;
  7447. + break;
  7448. + }
  7449. + }
  7450. +
  7451. + pthread_cleanup_pop (0);
  7452. +
  7453. + if (__atomic_is_v9)
  7454. + atomic_decrement (&isem->nwaiters);
  7455. + else
  7456. + {
  7457. + __sparc32_atomic_do_lock24 (&isem->lock);
  7458. + isem->nwaiters--;
  7459. + __sparc32_atomic_do_unlock24 (&isem->lock);
  7460. + }
  7461. +
  7462. + return err;
  7463. +}
  7464. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
  7465. deleted file mode 100644
  7466. index a6142aa..0000000
  7467. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
  7468. +++ /dev/null
  7469. @@ -1,2 +0,0 @@
  7470. -#define RESET_PID
  7471. -#include <libc/sysdeps/linux/sparc/clone.S>
  7472. 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
  7473. deleted file mode 100644
  7474. index 37231a8..0000000
  7475. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
  7476. +++ /dev/null
  7477. @@ -1,44 +0,0 @@
  7478. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  7479. - This file is part of the GNU C Library.
  7480. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  7481. -
  7482. - The GNU C Library is free software; you can redistribute it and/or
  7483. - modify it under the terms of the GNU Lesser General Public
  7484. - License as published by the Free Software Foundation; either
  7485. - version 2.1 of the License, or (at your option) any later version.
  7486. -
  7487. - The GNU C Library is distributed in the hope that it will be useful,
  7488. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7489. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7490. - Lesser General Public License for more details.
  7491. -
  7492. - You should have received a copy of the GNU Lesser General Public
  7493. - License along with the GNU C Library; if not, see
  7494. - <http://www.gnu.org/licenses/>. */
  7495. -
  7496. -#include <sysdep.h>
  7497. -#include <tcb-offsets.h>
  7498. -
  7499. - .text
  7500. - .globl __syscall_error
  7501. -ENTRY(__vfork)
  7502. - ld [%g7 + PID], %o5
  7503. - sub %g0, %o5, %o4
  7504. - st %o4, [%g7 + PID]
  7505. -
  7506. - LOADSYSCALL(vfork)
  7507. - ta 0x10
  7508. - bcc 2f
  7509. - mov %o7, %g1
  7510. - st %o5, [%g7 + PID]
  7511. - call __syscall_error
  7512. - mov %g1, %o7
  7513. -2: sub %o1, 1, %o1
  7514. - andcc %o0, %o1, %o0
  7515. - bne,a 1f
  7516. - st %o5, [%g7 + PID]
  7517. -1: retl
  7518. - nop
  7519. -END(__vfork)
  7520. -
  7521. -weak_alias (__vfork, vfork)
  7522. 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
  7523. deleted file mode 100644
  7524. index 169f6e7..0000000
  7525. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
  7526. +++ /dev/null
  7527. @@ -1,93 +0,0 @@
  7528. -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7529. - This file is part of the GNU C Library.
  7530. - Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
  7531. -
  7532. - The GNU C Library is free software; you can redistribute it and/or
  7533. - modify it under the terms of the GNU Lesser General Public
  7534. - License as published by the Free Software Foundation; either
  7535. - version 2.1 of the License, or (at your option) any later version.
  7536. -
  7537. - The GNU C Library is distributed in the hope that it will be useful,
  7538. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7539. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7540. - Lesser General Public License for more details.
  7541. -
  7542. - You should have received a copy of the GNU Lesser General Public
  7543. - License along with the GNU C Library; if not, see
  7544. - <http://www.gnu.org/licenses/>. */
  7545. -
  7546. -#include <errno.h>
  7547. -#include <sysdep.h>
  7548. -#include <lowlevellock.h>
  7549. -#include <pthreadP.h>
  7550. -
  7551. -/* Wait on barrier. */
  7552. -int
  7553. -pthread_barrier_wait (
  7554. - pthread_barrier_t *barrier)
  7555. -{
  7556. - union sparc_pthread_barrier *ibarrier
  7557. - = (union sparc_pthread_barrier *) barrier;
  7558. - int result = 0;
  7559. - int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
  7560. -
  7561. - /* Make sure we are alone. */
  7562. - lll_lock (ibarrier->b.lock, private);
  7563. -
  7564. - /* One more arrival. */
  7565. - --ibarrier->b.left;
  7566. -
  7567. - /* Are these all? */
  7568. - if (ibarrier->b.left == 0)
  7569. - {
  7570. - /* Yes. Increment the event counter to avoid invalid wake-ups and
  7571. - tell the current waiters that it is their turn. */
  7572. - ++ibarrier->b.curr_event;
  7573. -
  7574. - /* Wake up everybody. */
  7575. - lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
  7576. -
  7577. - /* This is the thread which finished the serialization. */
  7578. - result = PTHREAD_BARRIER_SERIAL_THREAD;
  7579. - }
  7580. - else
  7581. - {
  7582. - /* The number of the event we are waiting for. The barrier's event
  7583. - number must be bumped before we continue. */
  7584. - unsigned int event = ibarrier->b.curr_event;
  7585. -
  7586. - /* Before suspending, make the barrier available to others. */
  7587. - lll_unlock (ibarrier->b.lock, private);
  7588. -
  7589. - /* Wait for the event counter of the barrier to change. */
  7590. - do
  7591. - lll_futex_wait (&ibarrier->b.curr_event, event, private);
  7592. - while (event == ibarrier->b.curr_event);
  7593. - }
  7594. -
  7595. - /* Make sure the init_count is stored locally or in a register. */
  7596. - unsigned int init_count = ibarrier->b.init_count;
  7597. -
  7598. - /* If this was the last woken thread, unlock. */
  7599. - if (__atomic_is_v9 || ibarrier->s.pshared == 0)
  7600. - {
  7601. - if (atomic_increment_val (&ibarrier->b.left) == init_count)
  7602. - /* We are done. */
  7603. - lll_unlock (ibarrier->b.lock, private);
  7604. - }
  7605. - else
  7606. - {
  7607. - unsigned int left;
  7608. - /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
  7609. - is only atomic for threads within the same process, not for
  7610. - multiple processes. */
  7611. - __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
  7612. - left = ++ibarrier->b.left;
  7613. - __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
  7614. - if (left == init_count)
  7615. - /* We are done. */
  7616. - lll_unlock (ibarrier->b.lock, private);
  7617. - }
  7618. -
  7619. - return result;
  7620. -}
  7621. 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
  7622. deleted file mode 100644
  7623. index 8da4193..0000000
  7624. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
  7625. +++ /dev/null
  7626. @@ -1,52 +0,0 @@
  7627. -/* sem_post -- post to a POSIX semaphore. SPARC version.
  7628. - Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  7629. - This file is part of the GNU C Library.
  7630. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
  7631. -
  7632. - The GNU C Library is free software; you can redistribute it and/or
  7633. - modify it under the terms of the GNU Lesser General Public
  7634. - License as published by the Free Software Foundation; either
  7635. - version 2.1 of the License, or (at your option) any later version.
  7636. -
  7637. - The GNU C Library is distributed in the hope that it will be useful,
  7638. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7639. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7640. - Lesser General Public License for more details.
  7641. -
  7642. - You should have received a copy of the GNU Lesser General Public
  7643. - License along with the GNU C Library; if not, see
  7644. - <http://www.gnu.org/licenses/>. */
  7645. -
  7646. -#include <errno.h>
  7647. -#include <sysdep.h>
  7648. -#include <lowlevellock.h>
  7649. -#include <internaltypes.h>
  7650. -#include <semaphore.h>
  7651. -
  7652. -int
  7653. -sem_post (sem_t *sem)
  7654. -{
  7655. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7656. - int nr;
  7657. -
  7658. - if (__atomic_is_v9)
  7659. - nr = atomic_increment_val (&isem->value);
  7660. - else
  7661. - {
  7662. - __sparc32_atomic_do_lock24 (&isem->lock);
  7663. - nr = ++(isem->value);
  7664. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7665. - }
  7666. - atomic_full_barrier ();
  7667. - if (isem->nwaiters > 0)
  7668. - {
  7669. - int err = lll_futex_wake (&isem->value, 1,
  7670. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7671. - if (__builtin_expect (err, 0) < 0)
  7672. - {
  7673. - __set_errno (-err);
  7674. - return -1;
  7675. - }
  7676. - }
  7677. - return 0;
  7678. -}
  7679. 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
  7680. deleted file mode 100644
  7681. index 64c9abf..0000000
  7682. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
  7683. +++ /dev/null
  7684. @@ -1,147 +0,0 @@
  7685. -/* sem_timedwait -- wait on a semaphore. SPARC version.
  7686. - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7687. - This file is part of the GNU C Library.
  7688. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7689. -
  7690. - The GNU C Library is free software; you can redistribute it and/or
  7691. - modify it under the terms of the GNU Lesser General Public
  7692. - License as published by the Free Software Foundation; either
  7693. - version 2.1 of the License, or (at your option) any later version.
  7694. -
  7695. - The GNU C Library is distributed in the hope that it will be useful,
  7696. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7697. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7698. - Lesser General Public License for more details.
  7699. -
  7700. - You should have received a copy of the GNU Lesser General Public
  7701. - License along with the GNU C Library; if not, see
  7702. - <http://www.gnu.org/licenses/>. */
  7703. -
  7704. -#include <errno.h>
  7705. -#include <sysdep.h>
  7706. -#include <lowlevellock.h>
  7707. -#include <internaltypes.h>
  7708. -#include <semaphore.h>
  7709. -
  7710. -#include <pthreadP.h>
  7711. -
  7712. -
  7713. -extern void __sem_wait_cleanup (void *arg) attribute_hidden;
  7714. -
  7715. -
  7716. -int
  7717. -sem_timedwait (sem_t *sem, const struct timespec *abstime)
  7718. -{
  7719. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7720. - int err;
  7721. - int val;
  7722. -
  7723. - if (__atomic_is_v9)
  7724. - val = atomic_decrement_if_positive (&isem->value);
  7725. - else
  7726. - {
  7727. - __sparc32_atomic_do_lock24 (&isem->lock);
  7728. - val = isem->value;
  7729. - if (val > 0)
  7730. - isem->value = val - 1;
  7731. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7732. - }
  7733. -
  7734. - if (val > 0)
  7735. - return 0;
  7736. -
  7737. - if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
  7738. - {
  7739. - __set_errno (EINVAL);
  7740. - return -1;
  7741. - }
  7742. -
  7743. - if (__atomic_is_v9)
  7744. - atomic_increment (&isem->nwaiters);
  7745. - else
  7746. - {
  7747. - __sparc32_atomic_do_lock24 (&isem->lock);
  7748. - isem->nwaiters++;
  7749. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7750. - }
  7751. -
  7752. - pthread_cleanup_push (__sem_wait_cleanup, isem);
  7753. -
  7754. - while (1)
  7755. - {
  7756. - struct timeval tv;
  7757. - struct timespec rt;
  7758. - int sec, nsec;
  7759. -
  7760. - /* Get the current time. */
  7761. - __gettimeofday (&tv, NULL);
  7762. -
  7763. - /* Compute relative timeout. */
  7764. - sec = abstime->tv_sec - tv.tv_sec;
  7765. - nsec = abstime->tv_nsec - tv.tv_usec * 1000;
  7766. - if (nsec < 0)
  7767. - {
  7768. - nsec += 1000000000;
  7769. - --sec;
  7770. - }
  7771. -
  7772. - /* Already timed out? */
  7773. - err = -ETIMEDOUT;
  7774. - if (sec < 0)
  7775. - {
  7776. - __set_errno (ETIMEDOUT);
  7777. - err = -1;
  7778. - break;
  7779. - }
  7780. -
  7781. - /* Do wait. */
  7782. - rt.tv_sec = sec;
  7783. - rt.tv_nsec = nsec;
  7784. -
  7785. - /* Enable asynchronous cancellation. Required by the standard. */
  7786. - int oldtype = __pthread_enable_asynccancel ();
  7787. -
  7788. - err = lll_futex_timed_wait (&isem->value, 0, &rt,
  7789. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7790. -
  7791. - /* Disable asynchronous cancellation. */
  7792. - __pthread_disable_asynccancel (oldtype);
  7793. -
  7794. - if (err != 0 && err != -EWOULDBLOCK)
  7795. - {
  7796. - __set_errno (-err);
  7797. - err = -1;
  7798. - break;
  7799. - }
  7800. -
  7801. - if (__atomic_is_v9)
  7802. - val = atomic_decrement_if_positive (&isem->value);
  7803. - else
  7804. - {
  7805. - __sparc32_atomic_do_lock24 (&isem->lock);
  7806. - val = isem->value;
  7807. - if (val > 0)
  7808. - isem->value = val - 1;
  7809. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7810. - }
  7811. -
  7812. - if (val > 0)
  7813. - {
  7814. - err = 0;
  7815. - break;
  7816. - }
  7817. - }
  7818. -
  7819. - pthread_cleanup_pop (0);
  7820. -
  7821. - if (__atomic_is_v9)
  7822. - atomic_decrement (&isem->nwaiters);
  7823. - else
  7824. - {
  7825. - __sparc32_atomic_do_lock24 (&isem->lock);
  7826. - isem->nwaiters--;
  7827. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7828. - }
  7829. -
  7830. - return err;
  7831. -}
  7832. 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
  7833. deleted file mode 100644
  7834. index 36e859b..0000000
  7835. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
  7836. +++ /dev/null
  7837. @@ -1,51 +0,0 @@
  7838. -/* sem_trywait -- wait on a semaphore. SPARC version.
  7839. - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
  7840. - This file is part of the GNU C Library.
  7841. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7842. -
  7843. - The GNU C Library is free software; you can redistribute it and/or
  7844. - modify it under the terms of the GNU Lesser General Public
  7845. - License as published by the Free Software Foundation; either
  7846. - version 2.1 of the License, or (at your option) any later version.
  7847. -
  7848. - The GNU C Library is distributed in the hope that it will be useful,
  7849. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7850. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7851. - Lesser General Public License for more details.
  7852. -
  7853. - You should have received a copy of the GNU Lesser General Public
  7854. - License along with the GNU C Library; if not, see
  7855. - <http://www.gnu.org/licenses/>. */
  7856. -
  7857. -#include <errno.h>
  7858. -#include <sysdep.h>
  7859. -#include <lowlevellock.h>
  7860. -#include <internaltypes.h>
  7861. -#include <semaphore.h>
  7862. -
  7863. -
  7864. -int
  7865. -sem_trywait (sem_t *sem)
  7866. -{
  7867. - struct sparc_old_sem *isem = (struct sparc_old_sem *) sem;
  7868. - int val;
  7869. -
  7870. - if (isem->value > 0)
  7871. - {
  7872. - if (__atomic_is_v9)
  7873. - val = atomic_decrement_if_positive (&isem->value);
  7874. - else
  7875. - {
  7876. - __sparc32_atomic_do_lock24 (&isem->lock);
  7877. - val = isem->value;
  7878. - if (val > 0)
  7879. - isem->value = val - 1;
  7880. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7881. - }
  7882. - if (val > 0)
  7883. - return 0;
  7884. - }
  7885. -
  7886. - __set_errno (EAGAIN);
  7887. - return -1;
  7888. -}
  7889. 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
  7890. deleted file mode 100644
  7891. index 5d887ab..0000000
  7892. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
  7893. +++ /dev/null
  7894. @@ -1,124 +0,0 @@
  7895. -/* sem_wait -- wait on a semaphore. Generic futex-using version.
  7896. - Copyright (C) 2003, 2007 Free Software Foundation, Inc.
  7897. - This file is part of the GNU C Library.
  7898. - Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
  7899. -
  7900. - The GNU C Library is free software; you can redistribute it and/or
  7901. - modify it under the terms of the GNU Lesser General Public
  7902. - License as published by the Free Software Foundation; either
  7903. - version 2.1 of the License, or (at your option) any later version.
  7904. -
  7905. - The GNU C Library is distributed in the hope that it will be useful,
  7906. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  7907. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7908. - Lesser General Public License for more details.
  7909. -
  7910. - You should have received a copy of the GNU Lesser General Public
  7911. - License along with the GNU C Library; if not, see
  7912. - <http://www.gnu.org/licenses/>. */
  7913. -
  7914. -#include <errno.h>
  7915. -#include <sysdep.h>
  7916. -#include <lowlevellock.h>
  7917. -#include <internaltypes.h>
  7918. -#include <semaphore.h>
  7919. -
  7920. -#include <pthreadP.h>
  7921. -
  7922. -
  7923. -void
  7924. -attribute_hidden
  7925. -__sem_wait_cleanup (void *arg)
  7926. -{
  7927. - struct sparc_new_sem *isem = (struct sparc_new_sem *) arg;
  7928. -
  7929. - if (__atomic_is_v9)
  7930. - atomic_decrement (&isem->nwaiters);
  7931. - else
  7932. - {
  7933. - __sparc32_atomic_do_lock24 (&isem->lock);
  7934. - isem->nwaiters--;
  7935. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7936. - }
  7937. -}
  7938. -
  7939. -
  7940. -int
  7941. -sem_wait (sem_t *sem)
  7942. -{
  7943. - struct sparc_new_sem *isem = (struct sparc_new_sem *) sem;
  7944. - int err;
  7945. - int val;
  7946. -
  7947. - if (__atomic_is_v9)
  7948. - val = atomic_decrement_if_positive (&isem->value);
  7949. - else
  7950. - {
  7951. - __sparc32_atomic_do_lock24 (&isem->lock);
  7952. - val = isem->value;
  7953. - if (val > 0)
  7954. - isem->value = val - 1;
  7955. - else
  7956. - isem->nwaiters++;
  7957. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7958. - }
  7959. -
  7960. - if (val > 0)
  7961. - return 0;
  7962. -
  7963. - if (__atomic_is_v9)
  7964. - atomic_increment (&isem->nwaiters);
  7965. - else
  7966. - /* Already done above while still holding isem->lock. */;
  7967. -
  7968. - pthread_cleanup_push (__sem_wait_cleanup, isem);
  7969. -
  7970. - while (1)
  7971. - {
  7972. - /* Enable asynchronous cancellation. Required by the standard. */
  7973. - int oldtype = __pthread_enable_asynccancel ();
  7974. -
  7975. - err = lll_futex_wait (&isem->value, 0,
  7976. - isem->private ^ FUTEX_PRIVATE_FLAG);
  7977. -
  7978. - /* Disable asynchronous cancellation. */
  7979. - __pthread_disable_asynccancel (oldtype);
  7980. -
  7981. - if (err != 0 && err != -EWOULDBLOCK)
  7982. - {
  7983. - __set_errno (-err);
  7984. - err = -1;
  7985. - break;
  7986. - }
  7987. -
  7988. - if (__atomic_is_v9)
  7989. - val = atomic_decrement_if_positive (&isem->value);
  7990. - else
  7991. - {
  7992. - __sparc32_atomic_do_lock24 (&isem->lock);
  7993. - val = isem->value;
  7994. - if (val > 0)
  7995. - isem->value = val - 1;
  7996. - __sparc32_atomic_do_unlock24 (&isem->lock);
  7997. - }
  7998. -
  7999. - if (val > 0)
  8000. - {
  8001. - err = 0;
  8002. - break;
  8003. - }
  8004. - }
  8005. -
  8006. - pthread_cleanup_pop (0);
  8007. -
  8008. - if (__atomic_is_v9)
  8009. - atomic_decrement (&isem->nwaiters);
  8010. - else
  8011. - {
  8012. - __sparc32_atomic_do_lock24 (&isem->lock);
  8013. - isem->nwaiters--;
  8014. - __sparc32_atomic_do_unlock24 (&isem->lock);
  8015. - }
  8016. -
  8017. - return err;
  8018. -}
  8019. 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
  8020. deleted file mode 100644
  8021. index b61ca7b..0000000
  8022. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
  8023. +++ /dev/null
  8024. @@ -1,111 +0,0 @@
  8025. -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8026. - This file is part of the GNU C Library.
  8027. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8028. -
  8029. - The GNU C Library is free software; you can redistribute it and/or
  8030. - modify it under the terms of the GNU Lesser General Public
  8031. - License as published by the Free Software Foundation; either
  8032. - version 2.1 of the License, or (at your option) any later version.
  8033. -
  8034. - The GNU C Library is distributed in the hope that it will be useful,
  8035. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8036. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8037. - Lesser General Public License for more details.
  8038. -
  8039. - You should have received a copy of the GNU Lesser General Public
  8040. - License along with the GNU C Library; if not, see
  8041. - <http://www.gnu.org/licenses/>. */
  8042. -
  8043. -#include <tls.h>
  8044. -#include <sysdep.h>
  8045. -#ifndef __ASSEMBLER__
  8046. -# include <pthreadP.h>
  8047. -#endif
  8048. -
  8049. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8050. -
  8051. -# undef PSEUDO
  8052. -# define PSEUDO(name, syscall_name, args) \
  8053. - .text; \
  8054. - .globl __syscall_error; \
  8055. -ENTRY(name) \
  8056. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8057. - cmp %g1, 0; \
  8058. - bne 1f; \
  8059. -.type __##syscall_name##_nocancel,@function; \
  8060. -.globl __##syscall_name##_nocancel; \
  8061. -__##syscall_name##_nocancel: \
  8062. - mov SYS_ify(syscall_name), %g1; \
  8063. - ta 0x10; \
  8064. - bcc 8f; \
  8065. - mov %o7, %g1; \
  8066. - call __syscall_error; \
  8067. - mov %g1, %o7; \
  8068. -8: jmpl %o7 + 8, %g0; \
  8069. - nop; \
  8070. -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8071. -1: save %sp, -96, %sp; \
  8072. - cfi_def_cfa_register(%fp); \
  8073. - cfi_window_save; \
  8074. - cfi_register(%o7, %i7); \
  8075. - CENABLE; \
  8076. - nop; \
  8077. - mov %o0, %l0; \
  8078. - COPY_ARGS_##args \
  8079. - mov SYS_ify(syscall_name), %g1; \
  8080. - ta 0x10; \
  8081. - bcc 1f; \
  8082. - mov %o0, %l1; \
  8083. - CDISABLE; \
  8084. - mov %l0, %o0; \
  8085. - call __syscall_error; \
  8086. - mov %l1, %o0; \
  8087. - b 2f; \
  8088. - mov -1, %l1; \
  8089. -1: CDISABLE; \
  8090. - mov %l0, %o0; \
  8091. -2: jmpl %i7 + 8, %g0; \
  8092. - restore %g0, %l1, %o0;
  8093. -
  8094. -
  8095. -# ifdef IS_IN_libpthread
  8096. -# define CENABLE call __pthread_enable_asynccancel
  8097. -# define CDISABLE call __pthread_disable_asynccancel
  8098. -# elif !defined NOT_IN_libc
  8099. -# define CENABLE call __libc_enable_asynccancel
  8100. -# define CDISABLE call __libc_disable_asynccancel
  8101. -# elif defined IS_IN_librt
  8102. -# define CENABLE call __librt_enable_asynccancel
  8103. -# define CDISABLE call __librt_disable_asynccancel
  8104. -# else
  8105. -# error Unsupported library
  8106. -# endif
  8107. -
  8108. -#define COPY_ARGS_0 /* Nothing */
  8109. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8110. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8111. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8112. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8113. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8114. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8115. -
  8116. -# ifndef __ASSEMBLER__
  8117. -# define SINGLE_THREAD_P \
  8118. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8119. - header.multiple_threads) == 0, 1)
  8120. -# else
  8121. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8122. -# endif
  8123. -
  8124. -#elif !defined __ASSEMBLER__
  8125. -
  8126. -# define SINGLE_THREAD_P (1)
  8127. -# define NO_CANCELLATION 1
  8128. -
  8129. -#endif
  8130. -
  8131. -#ifndef __ASSEMBLER__
  8132. -# define RTLD_SINGLE_THREAD_P \
  8133. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8134. - header.multiple_threads) == 0, 1)
  8135. -#endif
  8136. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  8137. deleted file mode 100644
  8138. index 71f0662..0000000
  8139. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
  8140. +++ /dev/null
  8141. @@ -1,48 +0,0 @@
  8142. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8143. - This file is part of the GNU C Library.
  8144. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8145. -
  8146. - The GNU C Library is free software; you can redistribute it and/or
  8147. - modify it under the terms of the GNU Lesser General Public
  8148. - License as published by the Free Software Foundation; either
  8149. - version 2.1 of the License, or (at your option) any later version.
  8150. -
  8151. - The GNU C Library is distributed in the hope that it will be useful,
  8152. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8153. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8154. - Lesser General Public License for more details.
  8155. -
  8156. - You should have received a copy of the GNU Lesser General Public
  8157. - License along with the GNU C Library; if not, see
  8158. - <http://www.gnu.org/licenses/>. */
  8159. -
  8160. -#include <sysdep.h>
  8161. -#include <tcb-offsets.h>
  8162. -
  8163. - .text
  8164. - .globl __syscall_error
  8165. -ENTRY(__vfork)
  8166. - ld [%g7 + PID], %o5
  8167. - cmp %o5, 0
  8168. - bne 1f
  8169. - sub %g0, %o5, %o4
  8170. - sethi %hi(0x80000000), %o4
  8171. -1: st %o4, [%g7 + PID]
  8172. -
  8173. - LOADSYSCALL(vfork)
  8174. - ta 0x10
  8175. - bcc 2f
  8176. - mov %o7, %g1
  8177. - st %o5, [%g7 + PID]
  8178. - call __syscall_error
  8179. - mov %g1, %o7
  8180. -2: sub %o1, 1, %o1
  8181. - andcc %o0, %o1, %o0
  8182. - bne,a 1f
  8183. - st %o5, [%g7 + PID]
  8184. -1: retl
  8185. - nop
  8186. -END(__vfork)
  8187. -
  8188. -libc_hidden_def (vfork)
  8189. -weak_alias (__vfork, vfork)
  8190. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
  8191. deleted file mode 100644
  8192. index 64e3bfc..0000000
  8193. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
  8194. +++ /dev/null
  8195. @@ -1,2 +0,0 @@
  8196. -#define RESET_PID
  8197. -#include <libc/sysdeps/linux/sparc/sparcv9/clone.S>
  8198. 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
  8199. deleted file mode 100644
  8200. index a058d89..0000000
  8201. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
  8202. +++ /dev/null
  8203. @@ -1,44 +0,0 @@
  8204. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8205. - This file is part of the GNU C Library.
  8206. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8207. -
  8208. - The GNU C Library is free software; you can redistribute it and/or
  8209. - modify it under the terms of the GNU Lesser General Public
  8210. - License as published by the Free Software Foundation; either
  8211. - version 2.1 of the License, or (at your option) any later version.
  8212. -
  8213. - The GNU C Library is distributed in the hope that it will be useful,
  8214. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8215. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8216. - Lesser General Public License for more details.
  8217. -
  8218. - You should have received a copy of the GNU Lesser General Public
  8219. - License along with the GNU C Library; if not, see
  8220. - <http://www.gnu.org/licenses/>. */
  8221. -
  8222. -#include <sysdep.h>
  8223. -#include <tcb-offsets.h>
  8224. -
  8225. - .text
  8226. - .globl __syscall_error
  8227. -ENTRY(__vfork)
  8228. - ld [%g7 + PID], %o5
  8229. - sub %g0, %o5, %o4
  8230. - st %o4, [%g7 + PID]
  8231. -
  8232. - LOADSYSCALL(vfork)
  8233. - ta 0x6d
  8234. - bcc,pt %xcc, 2f
  8235. - mov %o7, %g1
  8236. - st %o5, [%g7 + PID]
  8237. - call __syscall_error
  8238. - mov %g1, %o7
  8239. -2: sub %o1, 1, %o1
  8240. - andcc %o0, %o1, %o0
  8241. - bne,a,pt %icc, 1f
  8242. - st %o5, [%g7 + PID]
  8243. -1: retl
  8244. - nop
  8245. -END(__vfork)
  8246. -
  8247. -weak_alias (__vfork, vfork)
  8248. 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
  8249. deleted file mode 100644
  8250. index 0e9d263..0000000
  8251. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
  8252. +++ /dev/null
  8253. @@ -1,109 +0,0 @@
  8254. -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8255. - This file is part of the GNU C Library.
  8256. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8257. -
  8258. - The GNU C Library is free software; you can redistribute it and/or
  8259. - modify it under the terms of the GNU Lesser General Public
  8260. - License as published by the Free Software Foundation; either
  8261. - version 2.1 of the License, or (at your option) any later version.
  8262. -
  8263. - The GNU C Library is distributed in the hope that it will be useful,
  8264. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8265. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8266. - Lesser General Public License for more details.
  8267. -
  8268. - You should have received a copy of the GNU Lesser General Public
  8269. - License along with the GNU C Library; if not, see
  8270. - <http://www.gnu.org/licenses/>. */
  8271. -
  8272. -#include <sysdep.h>
  8273. -#include <tls.h>
  8274. -#ifndef __ASSEMBLER__
  8275. -# include <pthreadP.h>
  8276. -#endif
  8277. -
  8278. -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8279. -
  8280. -# undef PSEUDO
  8281. -# define PSEUDO(name, syscall_name, args) \
  8282. - .text; \
  8283. - .globl __syscall_error; \
  8284. -ENTRY(name) \
  8285. - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8286. - brnz,pn %g1, 1f; \
  8287. -.type __##syscall_name##_nocancel,@function; \
  8288. -.globl __##syscall_name##_nocancel; \
  8289. -__##syscall_name##_nocancel: \
  8290. - mov SYS_ify(syscall_name), %g1; \
  8291. - ta 0x6d; \
  8292. - bcc,pt %xcc, 8f; \
  8293. - mov %o7, %g1; \
  8294. - call __syscall_error; \
  8295. - mov %g1, %o7; \
  8296. -8: jmpl %o7 + 8, %g0; \
  8297. - nop; \
  8298. -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8299. -1: save %sp, -192, %sp; \
  8300. - cfi_def_cfa_register(%fp); \
  8301. - cfi_window_save; \
  8302. - cfi_register(%o7, %i7); \
  8303. - CENABLE; \
  8304. - nop; \
  8305. - mov %o0, %l0; \
  8306. - COPY_ARGS_##args \
  8307. - mov SYS_ify(syscall_name), %g1; \
  8308. - ta 0x6d; \
  8309. - bcc,pt %xcc, 1f; \
  8310. - mov %o0, %l1; \
  8311. - CDISABLE; \
  8312. - mov %l0, %o0; \
  8313. - call __syscall_error; \
  8314. - mov %l1, %o0; \
  8315. - ba,pt %xcc, 2f; \
  8316. - mov -1, %l1; \
  8317. -1: CDISABLE; \
  8318. - mov %l0, %o0; \
  8319. -2: jmpl %i7 + 8, %g0; \
  8320. - restore %g0, %l1, %o0;
  8321. -
  8322. -# ifdef IS_IN_libpthread
  8323. -# define CENABLE call __pthread_enable_asynccancel
  8324. -# define CDISABLE call __pthread_disable_asynccancel
  8325. -# elif !defined NOT_IN_libc
  8326. -# define CENABLE call __libc_enable_asynccancel
  8327. -# define CDISABLE call __libc_disable_asynccancel
  8328. -# elif defined IS_IN_librt
  8329. -# define CENABLE call __librt_enable_asynccancel
  8330. -# define CDISABLE call __librt_disable_asynccancel
  8331. -# else
  8332. -# error Unsupported library
  8333. -# endif
  8334. -
  8335. -#define COPY_ARGS_0 /* Nothing */
  8336. -#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8337. -#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8338. -#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8339. -#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8340. -#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8341. -#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8342. -
  8343. -# ifndef __ASSEMBLER__
  8344. -# define SINGLE_THREAD_P \
  8345. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8346. - header.multiple_threads) == 0, 1)
  8347. -# else
  8348. -# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8349. -# endif
  8350. -
  8351. -#elif !defined __ASSEMBLER__
  8352. -
  8353. -# define SINGLE_THREAD_P (1)
  8354. -# define NO_CANCELLATION 1
  8355. -
  8356. -#endif
  8357. -
  8358. -#ifndef __ASSEMBLER__
  8359. -# define RTLD_SINGLE_THREAD_P \
  8360. - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8361. - header.multiple_threads) == 0, 1)
  8362. -#endif
  8363. 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
  8364. deleted file mode 100644
  8365. index 0a9c337..0000000
  8366. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
  8367. +++ /dev/null
  8368. @@ -1 +0,0 @@
  8369. -#include "../../x86_64/timer_create.c"
  8370. 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
  8371. deleted file mode 100644
  8372. index f0d4fd2..0000000
  8373. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
  8374. +++ /dev/null
  8375. @@ -1 +0,0 @@
  8376. -#include "../../x86_64/timer_delete.c"
  8377. 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
  8378. deleted file mode 100644
  8379. index 82121a7..0000000
  8380. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
  8381. +++ /dev/null
  8382. @@ -1 +0,0 @@
  8383. -#include "../../x86_64/timer_getoverr.c"
  8384. 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
  8385. deleted file mode 100644
  8386. index 313c05f..0000000
  8387. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
  8388. +++ /dev/null
  8389. @@ -1 +0,0 @@
  8390. -#include "../../x86_64/timer_gettime.c"
  8391. 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
  8392. deleted file mode 100644
  8393. index 76f549c..0000000
  8394. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
  8395. +++ /dev/null
  8396. @@ -1 +0,0 @@
  8397. -#include "../../x86_64/timer_settime.c"
  8398. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  8399. deleted file mode 100644
  8400. index bea4f2f..0000000
  8401. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
  8402. +++ /dev/null
  8403. @@ -1,48 +0,0 @@
  8404. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  8405. - This file is part of the GNU C Library.
  8406. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8407. -
  8408. - The GNU C Library is free software; you can redistribute it and/or
  8409. - modify it under the terms of the GNU Lesser General Public
  8410. - License as published by the Free Software Foundation; either
  8411. - version 2.1 of the License, or (at your option) any later version.
  8412. -
  8413. - The GNU C Library is distributed in the hope that it will be useful,
  8414. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  8415. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8416. - Lesser General Public License for more details.
  8417. -
  8418. - You should have received a copy of the GNU Lesser General Public
  8419. - License along with the GNU C Library; if not, see
  8420. - <http://www.gnu.org/licenses/>. */
  8421. -
  8422. -#include <sysdep.h>
  8423. -#include <tcb-offsets.h>
  8424. -
  8425. - .text
  8426. - .globl __syscall_error
  8427. -ENTRY(__vfork)
  8428. - ld [%g7 + PID], %o5
  8429. - sethi %hi(0x80000000), %o3
  8430. - cmp %o5, 0
  8431. - sub %g0, %o5, %o4
  8432. - move %icc, %o3, %o4
  8433. - st %o4, [%g7 + PID]
  8434. -
  8435. - LOADSYSCALL(vfork)
  8436. - ta 0x6d
  8437. - bcc,pt %xcc, 2f
  8438. - mov %o7, %g1
  8439. - st %o5, [%g7 + PID]
  8440. - call __syscall_error
  8441. - mov %g1, %o7
  8442. -2: sub %o1, 1, %o1
  8443. - andcc %o0, %o1, %o0
  8444. - bne,a,pt %icc, 1f
  8445. - st %o5, [%g7 + PID]
  8446. -1: retl
  8447. - nop
  8448. -END(__vfork)
  8449. -
  8450. -hidden_def (vfork)
  8451. -weak_alias (__vfork, vfork)
  8452. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8453. index 5be9beb..b61ca7b 100644
  8454. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8455. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
  8456. @@ -1,5 +1,111 @@
  8457. -#if defined(__arch64__)
  8458. -#include "sparc64/sysdep-cancel.h"
  8459. -#else
  8460. -#include "sparc32/sysdep-cancel.h"
  8461. +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  8462. + This file is part of the GNU C Library.
  8463. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
  8464. +
  8465. + The GNU C Library is free software; you can redistribute it and/or
  8466. + modify it under the terms of the GNU Lesser General Public
  8467. + License as published by the Free Software Foundation; either
  8468. + version 2.1 of the License, or (at your option) any later version.
  8469. +
  8470. + The GNU C Library is distributed in the hope that it will be useful,
  8471. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  8472. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8473. + Lesser General Public License for more details.
  8474. +
  8475. + You should have received a copy of the GNU Lesser General Public
  8476. + License along with the GNU C Library; if not, see
  8477. + <http://www.gnu.org/licenses/>. */
  8478. +
  8479. +#include <tls.h>
  8480. +#include <sysdep.h>
  8481. +#ifndef __ASSEMBLER__
  8482. +# include <pthreadP.h>
  8483. +#endif
  8484. +
  8485. +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  8486. +
  8487. +# undef PSEUDO
  8488. +# define PSEUDO(name, syscall_name, args) \
  8489. + .text; \
  8490. + .globl __syscall_error; \
  8491. +ENTRY(name) \
  8492. + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
  8493. + cmp %g1, 0; \
  8494. + bne 1f; \
  8495. +.type __##syscall_name##_nocancel,@function; \
  8496. +.globl __##syscall_name##_nocancel; \
  8497. +__##syscall_name##_nocancel: \
  8498. + mov SYS_ify(syscall_name), %g1; \
  8499. + ta 0x10; \
  8500. + bcc 8f; \
  8501. + mov %o7, %g1; \
  8502. + call __syscall_error; \
  8503. + mov %g1, %o7; \
  8504. +8: jmpl %o7 + 8, %g0; \
  8505. + nop; \
  8506. +.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
  8507. +1: save %sp, -96, %sp; \
  8508. + cfi_def_cfa_register(%fp); \
  8509. + cfi_window_save; \
  8510. + cfi_register(%o7, %i7); \
  8511. + CENABLE; \
  8512. + nop; \
  8513. + mov %o0, %l0; \
  8514. + COPY_ARGS_##args \
  8515. + mov SYS_ify(syscall_name), %g1; \
  8516. + ta 0x10; \
  8517. + bcc 1f; \
  8518. + mov %o0, %l1; \
  8519. + CDISABLE; \
  8520. + mov %l0, %o0; \
  8521. + call __syscall_error; \
  8522. + mov %l1, %o0; \
  8523. + b 2f; \
  8524. + mov -1, %l1; \
  8525. +1: CDISABLE; \
  8526. + mov %l0, %o0; \
  8527. +2: jmpl %i7 + 8, %g0; \
  8528. + restore %g0, %l1, %o0;
  8529. +
  8530. +
  8531. +# ifdef IS_IN_libpthread
  8532. +# define CENABLE call __pthread_enable_asynccancel
  8533. +# define CDISABLE call __pthread_disable_asynccancel
  8534. +# elif !defined NOT_IN_libc
  8535. +# define CENABLE call __libc_enable_asynccancel
  8536. +# define CDISABLE call __libc_disable_asynccancel
  8537. +# elif defined IS_IN_librt
  8538. +# define CENABLE call __librt_enable_asynccancel
  8539. +# define CDISABLE call __librt_disable_asynccancel
  8540. +# else
  8541. +# error Unsupported library
  8542. +# endif
  8543. +
  8544. +#define COPY_ARGS_0 /* Nothing */
  8545. +#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
  8546. +#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
  8547. +#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
  8548. +#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
  8549. +#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
  8550. +#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
  8551. +
  8552. +# ifndef __ASSEMBLER__
  8553. +# define SINGLE_THREAD_P \
  8554. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8555. + header.multiple_threads) == 0, 1)
  8556. +# else
  8557. +# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
  8558. +# endif
  8559. +
  8560. +#elif !defined __ASSEMBLER__
  8561. +
  8562. +# define SINGLE_THREAD_P (1)
  8563. +# define NO_CANCELLATION 1
  8564. +
  8565. +#endif
  8566. +
  8567. +#ifndef __ASSEMBLER__
  8568. +# define RTLD_SINGLE_THREAD_P \
  8569. + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  8570. + header.multiple_threads) == 0, 1)
  8571. #endif
  8572. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8573. index 160cd0b..71f0662 100644
  8574. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8575. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
  8576. @@ -1,5 +1,48 @@
  8577. -#if defined(__arch64__)
  8578. -#include "sparc64/vfork.S"
  8579. -#else
  8580. -#include "sparc32/vfork.S"
  8581. -#endif
  8582. +/* Copyright (C) 2004 Free Software Foundation, Inc.
  8583. + This file is part of the GNU C Library.
  8584. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  8585. +
  8586. + The GNU C Library is free software; you can redistribute it and/or
  8587. + modify it under the terms of the GNU Lesser General Public
  8588. + License as published by the Free Software Foundation; either
  8589. + version 2.1 of the License, or (at your option) any later version.
  8590. +
  8591. + The GNU C Library is distributed in the hope that it will be useful,
  8592. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  8593. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8594. + Lesser General Public License for more details.
  8595. +
  8596. + You should have received a copy of the GNU Lesser General Public
  8597. + License along with the GNU C Library; if not, see
  8598. + <http://www.gnu.org/licenses/>. */
  8599. +
  8600. +#include <sysdep.h>
  8601. +#include <tcb-offsets.h>
  8602. +
  8603. + .text
  8604. + .globl __syscall_error
  8605. +ENTRY(__vfork)
  8606. + ld [%g7 + PID], %o5
  8607. + cmp %o5, 0
  8608. + bne 1f
  8609. + sub %g0, %o5, %o4
  8610. + sethi %hi(0x80000000), %o4
  8611. +1: st %o4, [%g7 + PID]
  8612. +
  8613. + LOADSYSCALL(vfork)
  8614. + ta 0x10
  8615. + bcc 2f
  8616. + mov %o7, %g1
  8617. + st %o5, [%g7 + PID]
  8618. + call __syscall_error
  8619. + mov %g1, %o7
  8620. +2: sub %o1, 1, %o1
  8621. + andcc %o0, %o1, %o0
  8622. + bne,a 1f
  8623. + st %o5, [%g7 + PID]
  8624. +1: retl
  8625. + nop
  8626. +END(__vfork)
  8627. +
  8628. +libc_hidden_def (vfork)
  8629. +weak_alias (__vfork, vfork)
  8630. --
  8631. 1.8.5.2 (Apple Git-48)