altivec.h 485 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528
  1. /*===---- altivec.h - Standard header for type generic math ---------------===*\
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. *
  21. \*===----------------------------------------------------------------------===*/
  22. #ifndef __ALTIVEC_H
  23. #define __ALTIVEC_H
  24. #ifndef __ALTIVEC__
  25. #error "AltiVec support not enabled"
  26. #endif
  27. /* constants for mapping CR6 bits to predicate result. */
  28. #define __CR6_EQ 0
  29. #define __CR6_EQ_REV 1
  30. #define __CR6_LT 2
  31. #define __CR6_LT_REV 3
  32. #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
  33. static vector signed char __ATTRS_o_ai vec_perm(vector signed char __a,
  34. vector signed char __b,
  35. vector unsigned char __c);
  36. static vector unsigned char __ATTRS_o_ai vec_perm(vector unsigned char __a,
  37. vector unsigned char __b,
  38. vector unsigned char __c);
  39. static vector bool char __ATTRS_o_ai vec_perm(vector bool char __a,
  40. vector bool char __b,
  41. vector unsigned char __c);
  42. static vector short __ATTRS_o_ai vec_perm(vector signed short __a,
  43. vector signed short __b,
  44. vector unsigned char __c);
  45. static vector unsigned short __ATTRS_o_ai vec_perm(vector unsigned short __a,
  46. vector unsigned short __b,
  47. vector unsigned char __c);
  48. static vector bool short __ATTRS_o_ai vec_perm(vector bool short __a,
  49. vector bool short __b,
  50. vector unsigned char __c);
  51. static vector pixel __ATTRS_o_ai vec_perm(vector pixel __a, vector pixel __b,
  52. vector unsigned char __c);
  53. static vector int __ATTRS_o_ai vec_perm(vector signed int __a,
  54. vector signed int __b,
  55. vector unsigned char __c);
  56. static vector unsigned int __ATTRS_o_ai vec_perm(vector unsigned int __a,
  57. vector unsigned int __b,
  58. vector unsigned char __c);
  59. static vector bool int __ATTRS_o_ai vec_perm(vector bool int __a,
  60. vector bool int __b,
  61. vector unsigned char __c);
  62. static vector float __ATTRS_o_ai vec_perm(vector float __a, vector float __b,
  63. vector unsigned char __c);
  64. #ifdef __VSX__
  65. static vector long long __ATTRS_o_ai vec_perm(vector signed long long __a,
  66. vector signed long long __b,
  67. vector unsigned char __c);
  68. static vector unsigned long long __ATTRS_o_ai
  69. vec_perm(vector unsigned long long __a, vector unsigned long long __b,
  70. vector unsigned char __c);
  71. static vector bool long long __ATTRS_o_ai
  72. vec_perm(vector bool long long __a, vector bool long long __b,
  73. vector unsigned char __c);
  74. static vector double __ATTRS_o_ai vec_perm(vector double __a, vector double __b,
  75. vector unsigned char __c);
  76. #endif
  77. static vector unsigned char __ATTRS_o_ai vec_xor(vector unsigned char __a,
  78. vector unsigned char __b);
  79. /* vec_abs */
  80. #define __builtin_altivec_abs_v16qi vec_abs
  81. #define __builtin_altivec_abs_v8hi vec_abs
  82. #define __builtin_altivec_abs_v4si vec_abs
  83. static vector signed char __ATTRS_o_ai vec_abs(vector signed char __a) {
  84. return __builtin_altivec_vmaxsb(__a, -__a);
  85. }
  86. static vector signed short __ATTRS_o_ai vec_abs(vector signed short __a) {
  87. return __builtin_altivec_vmaxsh(__a, -__a);
  88. }
  89. static vector signed int __ATTRS_o_ai vec_abs(vector signed int __a) {
  90. return __builtin_altivec_vmaxsw(__a, -__a);
  91. }
  92. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  93. static vector signed long long __ATTRS_o_ai
  94. vec_abs(vector signed long long __a) {
  95. return __builtin_altivec_vmaxsd(__a, -__a);
  96. }
  97. #endif
  98. static vector float __ATTRS_o_ai vec_abs(vector float __a) {
  99. vector unsigned int __res =
  100. (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
  101. return (vector float)__res;
  102. }
  103. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  104. static vector double __ATTRS_o_ai vec_abs(vector double __a) {
  105. vector unsigned long long __res = { 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF };
  106. __res &= (vector unsigned int)__a;
  107. return (vector double)__res;
  108. }
  109. #endif
  110. /* vec_abss */
  111. #define __builtin_altivec_abss_v16qi vec_abss
  112. #define __builtin_altivec_abss_v8hi vec_abss
  113. #define __builtin_altivec_abss_v4si vec_abss
  114. static vector signed char __ATTRS_o_ai vec_abss(vector signed char __a) {
  115. return __builtin_altivec_vmaxsb(
  116. __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
  117. }
  118. static vector signed short __ATTRS_o_ai vec_abss(vector signed short __a) {
  119. return __builtin_altivec_vmaxsh(
  120. __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
  121. }
  122. static vector signed int __ATTRS_o_ai vec_abss(vector signed int __a) {
  123. return __builtin_altivec_vmaxsw(
  124. __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
  125. }
  126. /* vec_add */
  127. static vector signed char __ATTRS_o_ai vec_add(vector signed char __a,
  128. vector signed char __b) {
  129. return __a + __b;
  130. }
  131. static vector signed char __ATTRS_o_ai vec_add(vector bool char __a,
  132. vector signed char __b) {
  133. return (vector signed char)__a + __b;
  134. }
  135. static vector signed char __ATTRS_o_ai vec_add(vector signed char __a,
  136. vector bool char __b) {
  137. return __a + (vector signed char)__b;
  138. }
  139. static vector unsigned char __ATTRS_o_ai vec_add(vector unsigned char __a,
  140. vector unsigned char __b) {
  141. return __a + __b;
  142. }
  143. static vector unsigned char __ATTRS_o_ai vec_add(vector bool char __a,
  144. vector unsigned char __b) {
  145. return (vector unsigned char)__a + __b;
  146. }
  147. static vector unsigned char __ATTRS_o_ai vec_add(vector unsigned char __a,
  148. vector bool char __b) {
  149. return __a + (vector unsigned char)__b;
  150. }
  151. static vector short __ATTRS_o_ai vec_add(vector short __a, vector short __b) {
  152. return __a + __b;
  153. }
  154. static vector short __ATTRS_o_ai vec_add(vector bool short __a,
  155. vector short __b) {
  156. return (vector short)__a + __b;
  157. }
  158. static vector short __ATTRS_o_ai vec_add(vector short __a,
  159. vector bool short __b) {
  160. return __a + (vector short)__b;
  161. }
  162. static vector unsigned short __ATTRS_o_ai vec_add(vector unsigned short __a,
  163. vector unsigned short __b) {
  164. return __a + __b;
  165. }
  166. static vector unsigned short __ATTRS_o_ai vec_add(vector bool short __a,
  167. vector unsigned short __b) {
  168. return (vector unsigned short)__a + __b;
  169. }
  170. static vector unsigned short __ATTRS_o_ai vec_add(vector unsigned short __a,
  171. vector bool short __b) {
  172. return __a + (vector unsigned short)__b;
  173. }
  174. static vector int __ATTRS_o_ai vec_add(vector int __a, vector int __b) {
  175. return __a + __b;
  176. }
  177. static vector int __ATTRS_o_ai vec_add(vector bool int __a, vector int __b) {
  178. return (vector int)__a + __b;
  179. }
  180. static vector int __ATTRS_o_ai vec_add(vector int __a, vector bool int __b) {
  181. return __a + (vector int)__b;
  182. }
  183. static vector unsigned int __ATTRS_o_ai vec_add(vector unsigned int __a,
  184. vector unsigned int __b) {
  185. return __a + __b;
  186. }
  187. static vector unsigned int __ATTRS_o_ai vec_add(vector bool int __a,
  188. vector unsigned int __b) {
  189. return (vector unsigned int)__a + __b;
  190. }
  191. static vector unsigned int __ATTRS_o_ai vec_add(vector unsigned int __a,
  192. vector bool int __b) {
  193. return __a + (vector unsigned int)__b;
  194. }
  195. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  196. static vector signed long long __ATTRS_o_ai
  197. vec_add(vector signed long long __a, vector signed long long __b) {
  198. return __a + __b;
  199. }
  200. static vector unsigned long long __ATTRS_o_ai
  201. vec_add(vector unsigned long long __a, vector unsigned long long __b) {
  202. return __a + __b;
  203. }
  204. static vector signed __int128 __ATTRS_o_ai vec_add(vector signed __int128 __a,
  205. vector signed __int128 __b) {
  206. return __a + __b;
  207. }
  208. static vector unsigned __int128 __ATTRS_o_ai
  209. vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  210. return __a + __b;
  211. }
  212. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  213. static vector float __ATTRS_o_ai vec_add(vector float __a, vector float __b) {
  214. return __a + __b;
  215. }
  216. #ifdef __VSX__
  217. static vector double __ATTRS_o_ai
  218. vec_add(vector double __a, vector double __b) {
  219. return __a + __b;
  220. }
  221. #endif // __VSX__
  222. /* vec_vaddubm */
  223. #define __builtin_altivec_vaddubm vec_vaddubm
  224. static vector signed char __ATTRS_o_ai vec_vaddubm(vector signed char __a,
  225. vector signed char __b) {
  226. return __a + __b;
  227. }
  228. static vector signed char __ATTRS_o_ai vec_vaddubm(vector bool char __a,
  229. vector signed char __b) {
  230. return (vector signed char)__a + __b;
  231. }
  232. static vector signed char __ATTRS_o_ai vec_vaddubm(vector signed char __a,
  233. vector bool char __b) {
  234. return __a + (vector signed char)__b;
  235. }
  236. static vector unsigned char __ATTRS_o_ai vec_vaddubm(vector unsigned char __a,
  237. vector unsigned char __b) {
  238. return __a + __b;
  239. }
  240. static vector unsigned char __ATTRS_o_ai vec_vaddubm(vector bool char __a,
  241. vector unsigned char __b) {
  242. return (vector unsigned char)__a + __b;
  243. }
  244. static vector unsigned char __ATTRS_o_ai vec_vaddubm(vector unsigned char __a,
  245. vector bool char __b) {
  246. return __a + (vector unsigned char)__b;
  247. }
  248. /* vec_vadduhm */
  249. #define __builtin_altivec_vadduhm vec_vadduhm
  250. static vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
  251. vector short __b) {
  252. return __a + __b;
  253. }
  254. static vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
  255. vector short __b) {
  256. return (vector short)__a + __b;
  257. }
  258. static vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
  259. vector bool short __b) {
  260. return __a + (vector short)__b;
  261. }
  262. static vector unsigned short __ATTRS_o_ai
  263. vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
  264. return __a + __b;
  265. }
  266. static vector unsigned short __ATTRS_o_ai
  267. vec_vadduhm(vector bool short __a, vector unsigned short __b) {
  268. return (vector unsigned short)__a + __b;
  269. }
  270. static vector unsigned short __ATTRS_o_ai vec_vadduhm(vector unsigned short __a,
  271. vector bool short __b) {
  272. return __a + (vector unsigned short)__b;
  273. }
  274. /* vec_vadduwm */
  275. #define __builtin_altivec_vadduwm vec_vadduwm
  276. static vector int __ATTRS_o_ai vec_vadduwm(vector int __a, vector int __b) {
  277. return __a + __b;
  278. }
  279. static vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
  280. vector int __b) {
  281. return (vector int)__a + __b;
  282. }
  283. static vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
  284. vector bool int __b) {
  285. return __a + (vector int)__b;
  286. }
  287. static vector unsigned int __ATTRS_o_ai vec_vadduwm(vector unsigned int __a,
  288. vector unsigned int __b) {
  289. return __a + __b;
  290. }
  291. static vector unsigned int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
  292. vector unsigned int __b) {
  293. return (vector unsigned int)__a + __b;
  294. }
  295. static vector unsigned int __ATTRS_o_ai vec_vadduwm(vector unsigned int __a,
  296. vector bool int __b) {
  297. return __a + (vector unsigned int)__b;
  298. }
  299. /* vec_vaddfp */
  300. #define __builtin_altivec_vaddfp vec_vaddfp
  301. static vector float __attribute__((__always_inline__))
  302. vec_vaddfp(vector float __a, vector float __b) {
  303. return __a + __b;
  304. }
  305. /* vec_addc */
  306. static vector unsigned int __ATTRS_o_ai vec_addc(vector unsigned int __a,
  307. vector unsigned int __b) {
  308. return __builtin_altivec_vaddcuw(__a, __b);
  309. }
  310. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  311. static vector signed __int128 __ATTRS_o_ai
  312. vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
  313. return __builtin_altivec_vaddcuq(__a, __b);
  314. }
  315. static vector unsigned __int128 __ATTRS_o_ai
  316. vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  317. return __builtin_altivec_vaddcuq(__a, __b);
  318. }
  319. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  320. /* vec_vaddcuw */
  321. static vector unsigned int __attribute__((__always_inline__))
  322. vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
  323. return __builtin_altivec_vaddcuw(__a, __b);
  324. }
  325. /* vec_adds */
  326. static vector signed char __ATTRS_o_ai vec_adds(vector signed char __a,
  327. vector signed char __b) {
  328. return __builtin_altivec_vaddsbs(__a, __b);
  329. }
  330. static vector signed char __ATTRS_o_ai vec_adds(vector bool char __a,
  331. vector signed char __b) {
  332. return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
  333. }
  334. static vector signed char __ATTRS_o_ai vec_adds(vector signed char __a,
  335. vector bool char __b) {
  336. return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
  337. }
  338. static vector unsigned char __ATTRS_o_ai vec_adds(vector unsigned char __a,
  339. vector unsigned char __b) {
  340. return __builtin_altivec_vaddubs(__a, __b);
  341. }
  342. static vector unsigned char __ATTRS_o_ai vec_adds(vector bool char __a,
  343. vector unsigned char __b) {
  344. return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
  345. }
  346. static vector unsigned char __ATTRS_o_ai vec_adds(vector unsigned char __a,
  347. vector bool char __b) {
  348. return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
  349. }
  350. static vector short __ATTRS_o_ai vec_adds(vector short __a, vector short __b) {
  351. return __builtin_altivec_vaddshs(__a, __b);
  352. }
  353. static vector short __ATTRS_o_ai vec_adds(vector bool short __a,
  354. vector short __b) {
  355. return __builtin_altivec_vaddshs((vector short)__a, __b);
  356. }
  357. static vector short __ATTRS_o_ai vec_adds(vector short __a,
  358. vector bool short __b) {
  359. return __builtin_altivec_vaddshs(__a, (vector short)__b);
  360. }
  361. static vector unsigned short __ATTRS_o_ai vec_adds(vector unsigned short __a,
  362. vector unsigned short __b) {
  363. return __builtin_altivec_vadduhs(__a, __b);
  364. }
  365. static vector unsigned short __ATTRS_o_ai vec_adds(vector bool short __a,
  366. vector unsigned short __b) {
  367. return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
  368. }
  369. static vector unsigned short __ATTRS_o_ai vec_adds(vector unsigned short __a,
  370. vector bool short __b) {
  371. return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
  372. }
  373. static vector int __ATTRS_o_ai vec_adds(vector int __a, vector int __b) {
  374. return __builtin_altivec_vaddsws(__a, __b);
  375. }
  376. static vector int __ATTRS_o_ai vec_adds(vector bool int __a, vector int __b) {
  377. return __builtin_altivec_vaddsws((vector int)__a, __b);
  378. }
  379. static vector int __ATTRS_o_ai vec_adds(vector int __a, vector bool int __b) {
  380. return __builtin_altivec_vaddsws(__a, (vector int)__b);
  381. }
  382. static vector unsigned int __ATTRS_o_ai vec_adds(vector unsigned int __a,
  383. vector unsigned int __b) {
  384. return __builtin_altivec_vadduws(__a, __b);
  385. }
  386. static vector unsigned int __ATTRS_o_ai vec_adds(vector bool int __a,
  387. vector unsigned int __b) {
  388. return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
  389. }
  390. static vector unsigned int __ATTRS_o_ai vec_adds(vector unsigned int __a,
  391. vector bool int __b) {
  392. return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
  393. }
  394. /* vec_vaddsbs */
  395. static vector signed char __ATTRS_o_ai vec_vaddsbs(vector signed char __a,
  396. vector signed char __b) {
  397. return __builtin_altivec_vaddsbs(__a, __b);
  398. }
  399. static vector signed char __ATTRS_o_ai vec_vaddsbs(vector bool char __a,
  400. vector signed char __b) {
  401. return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
  402. }
  403. static vector signed char __ATTRS_o_ai vec_vaddsbs(vector signed char __a,
  404. vector bool char __b) {
  405. return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
  406. }
  407. /* vec_vaddubs */
  408. static vector unsigned char __ATTRS_o_ai vec_vaddubs(vector unsigned char __a,
  409. vector unsigned char __b) {
  410. return __builtin_altivec_vaddubs(__a, __b);
  411. }
  412. static vector unsigned char __ATTRS_o_ai vec_vaddubs(vector bool char __a,
  413. vector unsigned char __b) {
  414. return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
  415. }
  416. static vector unsigned char __ATTRS_o_ai vec_vaddubs(vector unsigned char __a,
  417. vector bool char __b) {
  418. return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
  419. }
  420. /* vec_vaddshs */
  421. static vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
  422. vector short __b) {
  423. return __builtin_altivec_vaddshs(__a, __b);
  424. }
  425. static vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
  426. vector short __b) {
  427. return __builtin_altivec_vaddshs((vector short)__a, __b);
  428. }
  429. static vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
  430. vector bool short __b) {
  431. return __builtin_altivec_vaddshs(__a, (vector short)__b);
  432. }
  433. /* vec_vadduhs */
  434. static vector unsigned short __ATTRS_o_ai
  435. vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
  436. return __builtin_altivec_vadduhs(__a, __b);
  437. }
  438. static vector unsigned short __ATTRS_o_ai
  439. vec_vadduhs(vector bool short __a, vector unsigned short __b) {
  440. return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
  441. }
  442. static vector unsigned short __ATTRS_o_ai vec_vadduhs(vector unsigned short __a,
  443. vector bool short __b) {
  444. return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
  445. }
  446. /* vec_vaddsws */
  447. static vector int __ATTRS_o_ai vec_vaddsws(vector int __a, vector int __b) {
  448. return __builtin_altivec_vaddsws(__a, __b);
  449. }
  450. static vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
  451. vector int __b) {
  452. return __builtin_altivec_vaddsws((vector int)__a, __b);
  453. }
  454. static vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
  455. vector bool int __b) {
  456. return __builtin_altivec_vaddsws(__a, (vector int)__b);
  457. }
  458. /* vec_vadduws */
  459. static vector unsigned int __ATTRS_o_ai vec_vadduws(vector unsigned int __a,
  460. vector unsigned int __b) {
  461. return __builtin_altivec_vadduws(__a, __b);
  462. }
  463. static vector unsigned int __ATTRS_o_ai vec_vadduws(vector bool int __a,
  464. vector unsigned int __b) {
  465. return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
  466. }
  467. static vector unsigned int __ATTRS_o_ai vec_vadduws(vector unsigned int __a,
  468. vector bool int __b) {
  469. return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
  470. }
  471. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  472. /* vec_vadduqm */
  473. static vector signed __int128 __ATTRS_o_ai
  474. vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
  475. return __a + __b;
  476. }
  477. static vector unsigned __int128 __ATTRS_o_ai
  478. vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  479. return __a + __b;
  480. }
  481. /* vec_vaddeuqm */
  482. static vector signed __int128 __ATTRS_o_ai
  483. vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
  484. vector signed __int128 __c) {
  485. return __builtin_altivec_vaddeuqm(__a, __b, __c);
  486. }
  487. static vector unsigned __int128 __ATTRS_o_ai
  488. vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
  489. vector unsigned __int128 __c) {
  490. return __builtin_altivec_vaddeuqm(__a, __b, __c);
  491. }
  492. /* vec_vaddcuq */
  493. static vector signed __int128 __ATTRS_o_ai
  494. vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
  495. return __builtin_altivec_vaddcuq(__a, __b);
  496. }
  497. static vector unsigned __int128 __ATTRS_o_ai
  498. vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  499. return __builtin_altivec_vaddcuq(__a, __b);
  500. }
  501. /* vec_vaddecuq */
  502. static vector signed __int128 __ATTRS_o_ai
  503. vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
  504. vector signed __int128 __c) {
  505. return __builtin_altivec_vaddecuq(__a, __b, __c);
  506. }
  507. static vector unsigned __int128 __ATTRS_o_ai
  508. vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
  509. vector unsigned __int128 __c) {
  510. return __builtin_altivec_vaddecuq(__a, __b, __c);
  511. }
  512. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  513. /* vec_and */
  514. #define __builtin_altivec_vand vec_and
  515. static vector signed char __ATTRS_o_ai vec_and(vector signed char __a,
  516. vector signed char __b) {
  517. return __a & __b;
  518. }
  519. static vector signed char __ATTRS_o_ai vec_and(vector bool char __a,
  520. vector signed char __b) {
  521. return (vector signed char)__a & __b;
  522. }
  523. static vector signed char __ATTRS_o_ai vec_and(vector signed char __a,
  524. vector bool char __b) {
  525. return __a & (vector signed char)__b;
  526. }
  527. static vector unsigned char __ATTRS_o_ai vec_and(vector unsigned char __a,
  528. vector unsigned char __b) {
  529. return __a & __b;
  530. }
  531. static vector unsigned char __ATTRS_o_ai vec_and(vector bool char __a,
  532. vector unsigned char __b) {
  533. return (vector unsigned char)__a & __b;
  534. }
  535. static vector unsigned char __ATTRS_o_ai vec_and(vector unsigned char __a,
  536. vector bool char __b) {
  537. return __a & (vector unsigned char)__b;
  538. }
  539. static vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
  540. vector bool char __b) {
  541. return __a & __b;
  542. }
  543. static vector short __ATTRS_o_ai vec_and(vector short __a, vector short __b) {
  544. return __a & __b;
  545. }
  546. static vector short __ATTRS_o_ai vec_and(vector bool short __a,
  547. vector short __b) {
  548. return (vector short)__a & __b;
  549. }
  550. static vector short __ATTRS_o_ai vec_and(vector short __a,
  551. vector bool short __b) {
  552. return __a & (vector short)__b;
  553. }
  554. static vector unsigned short __ATTRS_o_ai vec_and(vector unsigned short __a,
  555. vector unsigned short __b) {
  556. return __a & __b;
  557. }
  558. static vector unsigned short __ATTRS_o_ai vec_and(vector bool short __a,
  559. vector unsigned short __b) {
  560. return (vector unsigned short)__a & __b;
  561. }
  562. static vector unsigned short __ATTRS_o_ai vec_and(vector unsigned short __a,
  563. vector bool short __b) {
  564. return __a & (vector unsigned short)__b;
  565. }
  566. static vector bool short __ATTRS_o_ai vec_and(vector bool short __a,
  567. vector bool short __b) {
  568. return __a & __b;
  569. }
  570. static vector int __ATTRS_o_ai vec_and(vector int __a, vector int __b) {
  571. return __a & __b;
  572. }
  573. static vector int __ATTRS_o_ai vec_and(vector bool int __a, vector int __b) {
  574. return (vector int)__a & __b;
  575. }
  576. static vector int __ATTRS_o_ai vec_and(vector int __a, vector bool int __b) {
  577. return __a & (vector int)__b;
  578. }
  579. static vector unsigned int __ATTRS_o_ai vec_and(vector unsigned int __a,
  580. vector unsigned int __b) {
  581. return __a & __b;
  582. }
  583. static vector unsigned int __ATTRS_o_ai vec_and(vector bool int __a,
  584. vector unsigned int __b) {
  585. return (vector unsigned int)__a & __b;
  586. }
  587. static vector unsigned int __ATTRS_o_ai vec_and(vector unsigned int __a,
  588. vector bool int __b) {
  589. return __a & (vector unsigned int)__b;
  590. }
  591. static vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
  592. vector bool int __b) {
  593. return __a & __b;
  594. }
  595. static vector float __ATTRS_o_ai vec_and(vector float __a, vector float __b) {
  596. vector unsigned int __res =
  597. (vector unsigned int)__a & (vector unsigned int)__b;
  598. return (vector float)__res;
  599. }
  600. static vector float __ATTRS_o_ai vec_and(vector bool int __a,
  601. vector float __b) {
  602. vector unsigned int __res =
  603. (vector unsigned int)__a & (vector unsigned int)__b;
  604. return (vector float)__res;
  605. }
  606. static vector float __ATTRS_o_ai vec_and(vector float __a,
  607. vector bool int __b) {
  608. vector unsigned int __res =
  609. (vector unsigned int)__a & (vector unsigned int)__b;
  610. return (vector float)__res;
  611. }
  612. #ifdef __VSX__
  613. static vector double __ATTRS_o_ai vec_and(vector bool long long __a, vector double __b) {
  614. vector unsigned long long __res =
  615. (vector unsigned long long)__a & (vector unsigned long long)__b;
  616. return (vector double)__res;
  617. }
  618. static vector double __ATTRS_o_ai vec_and(vector double __a, vector bool long long __b) {
  619. vector unsigned long long __res =
  620. (vector unsigned long long)__a & (vector unsigned long long)__b;
  621. return (vector double)__res;
  622. }
  623. static vector double __ATTRS_o_ai vec_and(vector double __a, vector double __b) {
  624. vector unsigned long long __res =
  625. (vector unsigned long long)__a & (vector unsigned long long)__b;
  626. return (vector double)__res;
  627. }
  628. static vector signed long long __ATTRS_o_ai
  629. vec_and(vector signed long long __a, vector signed long long __b) {
  630. return __a & __b;
  631. }
  632. static vector signed long long __ATTRS_o_ai
  633. vec_and(vector bool long long __a, vector signed long long __b) {
  634. return (vector signed long long)__a & __b;
  635. }
  636. static vector signed long long __ATTRS_o_ai vec_and(vector signed long long __a,
  637. vector bool long long __b) {
  638. return __a & (vector signed long long)__b;
  639. }
  640. static vector unsigned long long __ATTRS_o_ai
  641. vec_and(vector unsigned long long __a, vector unsigned long long __b) {
  642. return __a & __b;
  643. }
  644. static vector unsigned long long __ATTRS_o_ai
  645. vec_and(vector bool long long __a, vector unsigned long long __b) {
  646. return (vector unsigned long long)__a & __b;
  647. }
  648. static vector unsigned long long __ATTRS_o_ai
  649. vec_and(vector unsigned long long __a, vector bool long long __b) {
  650. return __a & (vector unsigned long long)__b;
  651. }
  652. static vector bool long long __ATTRS_o_ai vec_and(vector bool long long __a,
  653. vector bool long long __b) {
  654. return __a & __b;
  655. }
  656. #endif
  657. /* vec_vand */
  658. static vector signed char __ATTRS_o_ai vec_vand(vector signed char __a,
  659. vector signed char __b) {
  660. return __a & __b;
  661. }
  662. static vector signed char __ATTRS_o_ai vec_vand(vector bool char __a,
  663. vector signed char __b) {
  664. return (vector signed char)__a & __b;
  665. }
  666. static vector signed char __ATTRS_o_ai vec_vand(vector signed char __a,
  667. vector bool char __b) {
  668. return __a & (vector signed char)__b;
  669. }
  670. static vector unsigned char __ATTRS_o_ai vec_vand(vector unsigned char __a,
  671. vector unsigned char __b) {
  672. return __a & __b;
  673. }
  674. static vector unsigned char __ATTRS_o_ai vec_vand(vector bool char __a,
  675. vector unsigned char __b) {
  676. return (vector unsigned char)__a & __b;
  677. }
  678. static vector unsigned char __ATTRS_o_ai vec_vand(vector unsigned char __a,
  679. vector bool char __b) {
  680. return __a & (vector unsigned char)__b;
  681. }
  682. static vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
  683. vector bool char __b) {
  684. return __a & __b;
  685. }
  686. static vector short __ATTRS_o_ai vec_vand(vector short __a, vector short __b) {
  687. return __a & __b;
  688. }
  689. static vector short __ATTRS_o_ai vec_vand(vector bool short __a,
  690. vector short __b) {
  691. return (vector short)__a & __b;
  692. }
  693. static vector short __ATTRS_o_ai vec_vand(vector short __a,
  694. vector bool short __b) {
  695. return __a & (vector short)__b;
  696. }
  697. static vector unsigned short __ATTRS_o_ai vec_vand(vector unsigned short __a,
  698. vector unsigned short __b) {
  699. return __a & __b;
  700. }
  701. static vector unsigned short __ATTRS_o_ai vec_vand(vector bool short __a,
  702. vector unsigned short __b) {
  703. return (vector unsigned short)__a & __b;
  704. }
  705. static vector unsigned short __ATTRS_o_ai vec_vand(vector unsigned short __a,
  706. vector bool short __b) {
  707. return __a & (vector unsigned short)__b;
  708. }
  709. static vector bool short __ATTRS_o_ai vec_vand(vector bool short __a,
  710. vector bool short __b) {
  711. return __a & __b;
  712. }
  713. static vector int __ATTRS_o_ai vec_vand(vector int __a, vector int __b) {
  714. return __a & __b;
  715. }
  716. static vector int __ATTRS_o_ai vec_vand(vector bool int __a, vector int __b) {
  717. return (vector int)__a & __b;
  718. }
  719. static vector int __ATTRS_o_ai vec_vand(vector int __a, vector bool int __b) {
  720. return __a & (vector int)__b;
  721. }
  722. static vector unsigned int __ATTRS_o_ai vec_vand(vector unsigned int __a,
  723. vector unsigned int __b) {
  724. return __a & __b;
  725. }
  726. static vector unsigned int __ATTRS_o_ai vec_vand(vector bool int __a,
  727. vector unsigned int __b) {
  728. return (vector unsigned int)__a & __b;
  729. }
  730. static vector unsigned int __ATTRS_o_ai vec_vand(vector unsigned int __a,
  731. vector bool int __b) {
  732. return __a & (vector unsigned int)__b;
  733. }
  734. static vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
  735. vector bool int __b) {
  736. return __a & __b;
  737. }
  738. static vector float __ATTRS_o_ai vec_vand(vector float __a, vector float __b) {
  739. vector unsigned int __res =
  740. (vector unsigned int)__a & (vector unsigned int)__b;
  741. return (vector float)__res;
  742. }
  743. static vector float __ATTRS_o_ai vec_vand(vector bool int __a,
  744. vector float __b) {
  745. vector unsigned int __res =
  746. (vector unsigned int)__a & (vector unsigned int)__b;
  747. return (vector float)__res;
  748. }
  749. static vector float __ATTRS_o_ai vec_vand(vector float __a,
  750. vector bool int __b) {
  751. vector unsigned int __res =
  752. (vector unsigned int)__a & (vector unsigned int)__b;
  753. return (vector float)__res;
  754. }
  755. #ifdef __VSX__
  756. static vector signed long long __ATTRS_o_ai
  757. vec_vand(vector signed long long __a, vector signed long long __b) {
  758. return __a & __b;
  759. }
  760. static vector signed long long __ATTRS_o_ai
  761. vec_vand(vector bool long long __a, vector signed long long __b) {
  762. return (vector signed long long)__a & __b;
  763. }
  764. static vector signed long long __ATTRS_o_ai
  765. vec_vand(vector signed long long __a, vector bool long long __b) {
  766. return __a & (vector signed long long)__b;
  767. }
  768. static vector unsigned long long __ATTRS_o_ai
  769. vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
  770. return __a & __b;
  771. }
  772. static vector unsigned long long __ATTRS_o_ai
  773. vec_vand(vector bool long long __a, vector unsigned long long __b) {
  774. return (vector unsigned long long)__a & __b;
  775. }
  776. static vector unsigned long long __ATTRS_o_ai
  777. vec_vand(vector unsigned long long __a, vector bool long long __b) {
  778. return __a & (vector unsigned long long)__b;
  779. }
  780. static vector bool long long __ATTRS_o_ai vec_vand(vector bool long long __a,
  781. vector bool long long __b) {
  782. return __a & __b;
  783. }
  784. #endif
  785. /* vec_andc */
  786. #define __builtin_altivec_vandc vec_andc
  787. static vector signed char __ATTRS_o_ai vec_andc(vector signed char __a,
  788. vector signed char __b) {
  789. return __a & ~__b;
  790. }
  791. static vector signed char __ATTRS_o_ai vec_andc(vector bool char __a,
  792. vector signed char __b) {
  793. return (vector signed char)__a & ~__b;
  794. }
  795. static vector signed char __ATTRS_o_ai vec_andc(vector signed char __a,
  796. vector bool char __b) {
  797. return __a & ~(vector signed char)__b;
  798. }
  799. static vector unsigned char __ATTRS_o_ai vec_andc(vector unsigned char __a,
  800. vector unsigned char __b) {
  801. return __a & ~__b;
  802. }
  803. static vector unsigned char __ATTRS_o_ai vec_andc(vector bool char __a,
  804. vector unsigned char __b) {
  805. return (vector unsigned char)__a & ~__b;
  806. }
  807. static vector unsigned char __ATTRS_o_ai vec_andc(vector unsigned char __a,
  808. vector bool char __b) {
  809. return __a & ~(vector unsigned char)__b;
  810. }
  811. static vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
  812. vector bool char __b) {
  813. return __a & ~__b;
  814. }
  815. static vector short __ATTRS_o_ai vec_andc(vector short __a, vector short __b) {
  816. return __a & ~__b;
  817. }
  818. static vector short __ATTRS_o_ai vec_andc(vector bool short __a,
  819. vector short __b) {
  820. return (vector short)__a & ~__b;
  821. }
  822. static vector short __ATTRS_o_ai vec_andc(vector short __a,
  823. vector bool short __b) {
  824. return __a & ~(vector short)__b;
  825. }
  826. static vector unsigned short __ATTRS_o_ai vec_andc(vector unsigned short __a,
  827. vector unsigned short __b) {
  828. return __a & ~__b;
  829. }
  830. static vector unsigned short __ATTRS_o_ai vec_andc(vector bool short __a,
  831. vector unsigned short __b) {
  832. return (vector unsigned short)__a & ~__b;
  833. }
  834. static vector unsigned short __ATTRS_o_ai vec_andc(vector unsigned short __a,
  835. vector bool short __b) {
  836. return __a & ~(vector unsigned short)__b;
  837. }
  838. static vector bool short __ATTRS_o_ai vec_andc(vector bool short __a,
  839. vector bool short __b) {
  840. return __a & ~__b;
  841. }
  842. static vector int __ATTRS_o_ai vec_andc(vector int __a, vector int __b) {
  843. return __a & ~__b;
  844. }
  845. static vector int __ATTRS_o_ai vec_andc(vector bool int __a, vector int __b) {
  846. return (vector int)__a & ~__b;
  847. }
  848. static vector int __ATTRS_o_ai vec_andc(vector int __a, vector bool int __b) {
  849. return __a & ~(vector int)__b;
  850. }
  851. static vector unsigned int __ATTRS_o_ai vec_andc(vector unsigned int __a,
  852. vector unsigned int __b) {
  853. return __a & ~__b;
  854. }
  855. static vector unsigned int __ATTRS_o_ai vec_andc(vector bool int __a,
  856. vector unsigned int __b) {
  857. return (vector unsigned int)__a & ~__b;
  858. }
  859. static vector unsigned int __ATTRS_o_ai vec_andc(vector unsigned int __a,
  860. vector bool int __b) {
  861. return __a & ~(vector unsigned int)__b;
  862. }
  863. static vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
  864. vector bool int __b) {
  865. return __a & ~__b;
  866. }
  867. static vector float __ATTRS_o_ai vec_andc(vector float __a, vector float __b) {
  868. vector unsigned int __res =
  869. (vector unsigned int)__a & ~(vector unsigned int)__b;
  870. return (vector float)__res;
  871. }
  872. static vector float __ATTRS_o_ai vec_andc(vector bool int __a,
  873. vector float __b) {
  874. vector unsigned int __res =
  875. (vector unsigned int)__a & ~(vector unsigned int)__b;
  876. return (vector float)__res;
  877. }
  878. static vector float __ATTRS_o_ai vec_andc(vector float __a,
  879. vector bool int __b) {
  880. vector unsigned int __res =
  881. (vector unsigned int)__a & ~(vector unsigned int)__b;
  882. return (vector float)__res;
  883. }
  884. #ifdef __VSX__
  885. static vector double __ATTRS_o_ai
  886. vec_andc(vector bool long long __a, vector double __b) {
  887. vector unsigned long long __res =
  888. (vector unsigned long long)__a & ~(vector unsigned long long)__b;
  889. return (vector double)__res;
  890. }
  891. static vector double __ATTRS_o_ai
  892. vec_andc(vector double __a, vector bool long long __b) {
  893. vector unsigned long long __res =
  894. (vector unsigned long long)__a & ~(vector unsigned long long)__b;
  895. return (vector double)__res;
  896. }
  897. static vector double __ATTRS_o_ai vec_andc(vector double __a, vector double __b) {
  898. vector unsigned long long __res =
  899. (vector unsigned long long)__a & ~(vector unsigned long long)__b;
  900. return (vector double)__res;
  901. }
  902. static vector signed long long __ATTRS_o_ai
  903. vec_andc(vector signed long long __a, vector signed long long __b) {
  904. return __a & ~__b;
  905. }
  906. static vector signed long long __ATTRS_o_ai
  907. vec_andc(vector bool long long __a, vector signed long long __b) {
  908. return (vector signed long long)__a & ~__b;
  909. }
  910. static vector signed long long __ATTRS_o_ai
  911. vec_andc(vector signed long long __a, vector bool long long __b) {
  912. return __a & ~(vector signed long long)__b;
  913. }
  914. static vector unsigned long long __ATTRS_o_ai
  915. vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
  916. return __a & ~__b;
  917. }
  918. static vector unsigned long long __ATTRS_o_ai
  919. vec_andc(vector bool long long __a, vector unsigned long long __b) {
  920. return (vector unsigned long long)__a & ~__b;
  921. }
  922. static vector unsigned long long __ATTRS_o_ai
  923. vec_andc(vector unsigned long long __a, vector bool long long __b) {
  924. return __a & ~(vector unsigned long long)__b;
  925. }
  926. static vector bool long long __ATTRS_o_ai vec_andc(vector bool long long __a,
  927. vector bool long long __b) {
  928. return __a & ~__b;
  929. }
  930. #endif
  931. /* vec_vandc */
  932. static vector signed char __ATTRS_o_ai vec_vandc(vector signed char __a,
  933. vector signed char __b) {
  934. return __a & ~__b;
  935. }
  936. static vector signed char __ATTRS_o_ai vec_vandc(vector bool char __a,
  937. vector signed char __b) {
  938. return (vector signed char)__a & ~__b;
  939. }
  940. static vector signed char __ATTRS_o_ai vec_vandc(vector signed char __a,
  941. vector bool char __b) {
  942. return __a & ~(vector signed char)__b;
  943. }
  944. static vector unsigned char __ATTRS_o_ai vec_vandc(vector unsigned char __a,
  945. vector unsigned char __b) {
  946. return __a & ~__b;
  947. }
  948. static vector unsigned char __ATTRS_o_ai vec_vandc(vector bool char __a,
  949. vector unsigned char __b) {
  950. return (vector unsigned char)__a & ~__b;
  951. }
  952. static vector unsigned char __ATTRS_o_ai vec_vandc(vector unsigned char __a,
  953. vector bool char __b) {
  954. return __a & ~(vector unsigned char)__b;
  955. }
  956. static vector bool char __ATTRS_o_ai vec_vandc(vector bool char __a,
  957. vector bool char __b) {
  958. return __a & ~__b;
  959. }
  960. static vector short __ATTRS_o_ai vec_vandc(vector short __a, vector short __b) {
  961. return __a & ~__b;
  962. }
  963. static vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
  964. vector short __b) {
  965. return (vector short)__a & ~__b;
  966. }
  967. static vector short __ATTRS_o_ai vec_vandc(vector short __a,
  968. vector bool short __b) {
  969. return __a & ~(vector short)__b;
  970. }
  971. static vector unsigned short __ATTRS_o_ai vec_vandc(vector unsigned short __a,
  972. vector unsigned short __b) {
  973. return __a & ~__b;
  974. }
  975. static vector unsigned short __ATTRS_o_ai vec_vandc(vector bool short __a,
  976. vector unsigned short __b) {
  977. return (vector unsigned short)__a & ~__b;
  978. }
  979. static vector unsigned short __ATTRS_o_ai vec_vandc(vector unsigned short __a,
  980. vector bool short __b) {
  981. return __a & ~(vector unsigned short)__b;
  982. }
  983. static vector bool short __ATTRS_o_ai vec_vandc(vector bool short __a,
  984. vector bool short __b) {
  985. return __a & ~__b;
  986. }
  987. static vector int __ATTRS_o_ai vec_vandc(vector int __a, vector int __b) {
  988. return __a & ~__b;
  989. }
  990. static vector int __ATTRS_o_ai vec_vandc(vector bool int __a, vector int __b) {
  991. return (vector int)__a & ~__b;
  992. }
  993. static vector int __ATTRS_o_ai vec_vandc(vector int __a, vector bool int __b) {
  994. return __a & ~(vector int)__b;
  995. }
  996. static vector unsigned int __ATTRS_o_ai vec_vandc(vector unsigned int __a,
  997. vector unsigned int __b) {
  998. return __a & ~__b;
  999. }
  1000. static vector unsigned int __ATTRS_o_ai vec_vandc(vector bool int __a,
  1001. vector unsigned int __b) {
  1002. return (vector unsigned int)__a & ~__b;
  1003. }
  1004. static vector unsigned int __ATTRS_o_ai vec_vandc(vector unsigned int __a,
  1005. vector bool int __b) {
  1006. return __a & ~(vector unsigned int)__b;
  1007. }
  1008. static vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
  1009. vector bool int __b) {
  1010. return __a & ~__b;
  1011. }
  1012. static vector float __ATTRS_o_ai vec_vandc(vector float __a, vector float __b) {
  1013. vector unsigned int __res =
  1014. (vector unsigned int)__a & ~(vector unsigned int)__b;
  1015. return (vector float)__res;
  1016. }
  1017. static vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
  1018. vector float __b) {
  1019. vector unsigned int __res =
  1020. (vector unsigned int)__a & ~(vector unsigned int)__b;
  1021. return (vector float)__res;
  1022. }
  1023. static vector float __ATTRS_o_ai vec_vandc(vector float __a,
  1024. vector bool int __b) {
  1025. vector unsigned int __res =
  1026. (vector unsigned int)__a & ~(vector unsigned int)__b;
  1027. return (vector float)__res;
  1028. }
  1029. #ifdef __VSX__
  1030. static vector signed long long __ATTRS_o_ai
  1031. vec_vandc(vector signed long long __a, vector signed long long __b) {
  1032. return __a & ~__b;
  1033. }
  1034. static vector signed long long __ATTRS_o_ai
  1035. vec_vandc(vector bool long long __a, vector signed long long __b) {
  1036. return (vector signed long long)__a & ~__b;
  1037. }
  1038. static vector signed long long __ATTRS_o_ai
  1039. vec_vandc(vector signed long long __a, vector bool long long __b) {
  1040. return __a & ~(vector signed long long)__b;
  1041. }
  1042. static vector unsigned long long __ATTRS_o_ai
  1043. vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
  1044. return __a & ~__b;
  1045. }
  1046. static vector unsigned long long __ATTRS_o_ai
  1047. vec_vandc(vector bool long long __a, vector unsigned long long __b) {
  1048. return (vector unsigned long long)__a & ~__b;
  1049. }
  1050. static vector unsigned long long __ATTRS_o_ai
  1051. vec_vandc(vector unsigned long long __a, vector bool long long __b) {
  1052. return __a & ~(vector unsigned long long)__b;
  1053. }
  1054. static vector bool long long __ATTRS_o_ai vec_vandc(vector bool long long __a,
  1055. vector bool long long __b) {
  1056. return __a & ~__b;
  1057. }
  1058. #endif
  1059. /* vec_avg */
  1060. static vector signed char __ATTRS_o_ai vec_avg(vector signed char __a,
  1061. vector signed char __b) {
  1062. return __builtin_altivec_vavgsb(__a, __b);
  1063. }
  1064. static vector unsigned char __ATTRS_o_ai vec_avg(vector unsigned char __a,
  1065. vector unsigned char __b) {
  1066. return __builtin_altivec_vavgub(__a, __b);
  1067. }
  1068. static vector short __ATTRS_o_ai vec_avg(vector short __a, vector short __b) {
  1069. return __builtin_altivec_vavgsh(__a, __b);
  1070. }
  1071. static vector unsigned short __ATTRS_o_ai vec_avg(vector unsigned short __a,
  1072. vector unsigned short __b) {
  1073. return __builtin_altivec_vavguh(__a, __b);
  1074. }
  1075. static vector int __ATTRS_o_ai vec_avg(vector int __a, vector int __b) {
  1076. return __builtin_altivec_vavgsw(__a, __b);
  1077. }
  1078. static vector unsigned int __ATTRS_o_ai vec_avg(vector unsigned int __a,
  1079. vector unsigned int __b) {
  1080. return __builtin_altivec_vavguw(__a, __b);
  1081. }
  1082. /* vec_vavgsb */
  1083. static vector signed char __attribute__((__always_inline__))
  1084. vec_vavgsb(vector signed char __a, vector signed char __b) {
  1085. return __builtin_altivec_vavgsb(__a, __b);
  1086. }
  1087. /* vec_vavgub */
  1088. static vector unsigned char __attribute__((__always_inline__))
  1089. vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
  1090. return __builtin_altivec_vavgub(__a, __b);
  1091. }
  1092. /* vec_vavgsh */
  1093. static vector short __attribute__((__always_inline__))
  1094. vec_vavgsh(vector short __a, vector short __b) {
  1095. return __builtin_altivec_vavgsh(__a, __b);
  1096. }
  1097. /* vec_vavguh */
  1098. static vector unsigned short __attribute__((__always_inline__))
  1099. vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
  1100. return __builtin_altivec_vavguh(__a, __b);
  1101. }
  1102. /* vec_vavgsw */
  1103. static vector int __attribute__((__always_inline__))
  1104. vec_vavgsw(vector int __a, vector int __b) {
  1105. return __builtin_altivec_vavgsw(__a, __b);
  1106. }
  1107. /* vec_vavguw */
  1108. static vector unsigned int __attribute__((__always_inline__))
  1109. vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
  1110. return __builtin_altivec_vavguw(__a, __b);
  1111. }
  1112. /* vec_ceil */
  1113. static vector float __ATTRS_o_ai vec_ceil(vector float __a) {
  1114. #ifdef __VSX__
  1115. return __builtin_vsx_xvrspip(__a);
  1116. #else
  1117. return __builtin_altivec_vrfip(__a);
  1118. #endif
  1119. }
  1120. #ifdef __VSX__
  1121. static vector double __ATTRS_o_ai vec_ceil(vector double __a) {
  1122. return __builtin_vsx_xvrdpip(__a);
  1123. }
  1124. #endif
  1125. /* vec_vrfip */
  1126. static vector float __attribute__((__always_inline__))
  1127. vec_vrfip(vector float __a) {
  1128. return __builtin_altivec_vrfip(__a);
  1129. }
  1130. /* vec_cmpb */
  1131. static vector int __attribute__((__always_inline__))
  1132. vec_cmpb(vector float __a, vector float __b) {
  1133. return __builtin_altivec_vcmpbfp(__a, __b);
  1134. }
  1135. /* vec_vcmpbfp */
  1136. static vector int __attribute__((__always_inline__))
  1137. vec_vcmpbfp(vector float __a, vector float __b) {
  1138. return __builtin_altivec_vcmpbfp(__a, __b);
  1139. }
  1140. /* vec_cmpeq */
  1141. static vector bool char __ATTRS_o_ai vec_cmpeq(vector signed char __a,
  1142. vector signed char __b) {
  1143. return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
  1144. (vector char)__b);
  1145. }
  1146. static vector bool char __ATTRS_o_ai vec_cmpeq(vector unsigned char __a,
  1147. vector unsigned char __b) {
  1148. return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
  1149. (vector char)__b);
  1150. }
  1151. static vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
  1152. vector short __b) {
  1153. return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
  1154. }
  1155. static vector bool short __ATTRS_o_ai vec_cmpeq(vector unsigned short __a,
  1156. vector unsigned short __b) {
  1157. return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
  1158. (vector short)__b);
  1159. }
  1160. static vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a, vector int __b) {
  1161. return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
  1162. }
  1163. static vector bool int __ATTRS_o_ai vec_cmpeq(vector unsigned int __a,
  1164. vector unsigned int __b) {
  1165. return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
  1166. (vector int)__b);
  1167. }
  1168. #ifdef __POWER8_VECTOR__
  1169. static vector bool long long __ATTRS_o_ai
  1170. vec_cmpeq(vector signed long long __a, vector signed long long __b) {
  1171. return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
  1172. }
  1173. static vector bool long long __ATTRS_o_ai
  1174. vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
  1175. return (vector bool long long)__builtin_altivec_vcmpequd(
  1176. (vector long long)__a, (vector long long)__b);
  1177. }
  1178. #endif
  1179. static vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
  1180. vector float __b) {
  1181. #ifdef __VSX__
  1182. return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
  1183. #else
  1184. return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
  1185. #endif
  1186. }
  1187. #ifdef __VSX__
  1188. static vector bool long long __ATTRS_o_ai
  1189. vec_cmpeq(vector double __a, vector double __b) {
  1190. return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
  1191. }
  1192. #endif
  1193. /* vec_cmpge */
  1194. static vector bool int __ATTRS_o_ai
  1195. vec_cmpge(vector float __a, vector float __b) {
  1196. #ifdef __VSX__
  1197. return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
  1198. #else
  1199. return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
  1200. #endif
  1201. }
  1202. #ifdef __VSX__
  1203. static vector bool long long __ATTRS_o_ai
  1204. vec_cmpge(vector double __a, vector double __b) {
  1205. return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
  1206. }
  1207. #endif
  1208. #ifdef __POWER8_VECTOR__
  1209. /* Forwrad declarations as the functions are used here */
  1210. static vector bool long long __ATTRS_o_ai
  1211. vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b);
  1212. static vector bool long long __ATTRS_o_ai
  1213. vec_cmpgt(vector signed long long __a, vector signed long long __b);
  1214. static vector bool long long __ATTRS_o_ai
  1215. vec_cmpge(vector signed long long __a, vector signed long long __b) {
  1216. return ~(vec_cmpgt(__b, __a));
  1217. }
  1218. static vector bool long long __ATTRS_o_ai
  1219. vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
  1220. return ~(vec_cmpgt(__b, __a));
  1221. }
  1222. #endif
  1223. /* vec_vcmpgefp */
  1224. static vector bool int __attribute__((__always_inline__))
  1225. vec_vcmpgefp(vector float __a, vector float __b) {
  1226. return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
  1227. }
  1228. /* vec_cmpgt */
  1229. static vector bool char __ATTRS_o_ai vec_cmpgt(vector signed char __a,
  1230. vector signed char __b) {
  1231. return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
  1232. }
  1233. static vector bool char __ATTRS_o_ai vec_cmpgt(vector unsigned char __a,
  1234. vector unsigned char __b) {
  1235. return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
  1236. }
  1237. static vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
  1238. vector short __b) {
  1239. return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
  1240. }
  1241. static vector bool short __ATTRS_o_ai vec_cmpgt(vector unsigned short __a,
  1242. vector unsigned short __b) {
  1243. return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
  1244. }
  1245. static vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a, vector int __b) {
  1246. return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
  1247. }
  1248. static vector bool int __ATTRS_o_ai vec_cmpgt(vector unsigned int __a,
  1249. vector unsigned int __b) {
  1250. return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
  1251. }
  1252. #ifdef __POWER8_VECTOR__
  1253. static vector bool long long __ATTRS_o_ai
  1254. vec_cmpgt(vector signed long long __a, vector signed long long __b) {
  1255. return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
  1256. }
  1257. static vector bool long long __ATTRS_o_ai
  1258. vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
  1259. return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
  1260. }
  1261. #endif
  1262. static vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
  1263. vector float __b) {
  1264. #ifdef __VSX__
  1265. return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
  1266. #else
  1267. return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
  1268. #endif
  1269. }
  1270. #ifdef __VSX__
  1271. static vector bool long long __ATTRS_o_ai
  1272. vec_cmpgt(vector double __a, vector double __b) {
  1273. return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
  1274. }
  1275. #endif
  1276. /* vec_vcmpgtsb */
  1277. static vector bool char __attribute__((__always_inline__))
  1278. vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
  1279. return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
  1280. }
  1281. /* vec_vcmpgtub */
  1282. static vector bool char __attribute__((__always_inline__))
  1283. vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
  1284. return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
  1285. }
  1286. /* vec_vcmpgtsh */
  1287. static vector bool short __attribute__((__always_inline__))
  1288. vec_vcmpgtsh(vector short __a, vector short __b) {
  1289. return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
  1290. }
  1291. /* vec_vcmpgtuh */
  1292. static vector bool short __attribute__((__always_inline__))
  1293. vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
  1294. return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
  1295. }
  1296. /* vec_vcmpgtsw */
  1297. static vector bool int __attribute__((__always_inline__))
  1298. vec_vcmpgtsw(vector int __a, vector int __b) {
  1299. return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
  1300. }
  1301. /* vec_vcmpgtuw */
  1302. static vector bool int __attribute__((__always_inline__))
  1303. vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
  1304. return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
  1305. }
  1306. /* vec_vcmpgtfp */
  1307. static vector bool int __attribute__((__always_inline__))
  1308. vec_vcmpgtfp(vector float __a, vector float __b) {
  1309. return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
  1310. }
  1311. /* vec_cmple */
  1312. static vector bool int __ATTRS_o_ai
  1313. vec_cmple(vector float __a, vector float __b) {
  1314. return vec_cmpge(__b, __a);
  1315. }
  1316. #ifdef __VSX__
  1317. static vector bool long long __ATTRS_o_ai
  1318. vec_cmple(vector double __a, vector double __b) {
  1319. return vec_cmpge(__b, __a);
  1320. }
  1321. #endif
  1322. #ifdef __POWER8_VECTOR__
  1323. static vector bool long long __ATTRS_o_ai
  1324. vec_cmple(vector signed long long __a, vector signed long long __b) {
  1325. return vec_cmpge(__b, __a);
  1326. }
  1327. static vector bool long long __ATTRS_o_ai
  1328. vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
  1329. return vec_cmpge(__b, __a);
  1330. }
  1331. #endif
  1332. /* vec_cmplt */
  1333. static vector bool char __ATTRS_o_ai vec_cmplt(vector signed char __a,
  1334. vector signed char __b) {
  1335. return vec_cmpgt(__b, __a);
  1336. }
  1337. static vector bool char __ATTRS_o_ai vec_cmplt(vector unsigned char __a,
  1338. vector unsigned char __b) {
  1339. return vec_cmpgt(__b, __a);
  1340. }
  1341. static vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
  1342. vector short __b) {
  1343. return vec_cmpgt(__b, __a);
  1344. }
  1345. static vector bool short __ATTRS_o_ai vec_cmplt(vector unsigned short __a,
  1346. vector unsigned short __b) {
  1347. return vec_cmpgt(__b, __a);
  1348. }
  1349. static vector bool int __ATTRS_o_ai vec_cmplt(vector int __a, vector int __b) {
  1350. return vec_cmpgt(__b, __a);
  1351. }
  1352. static vector bool int __ATTRS_o_ai vec_cmplt(vector unsigned int __a,
  1353. vector unsigned int __b) {
  1354. return vec_cmpgt(__b, __a);
  1355. }
  1356. static vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
  1357. vector float __b) {
  1358. return vec_cmpgt(__b, __a);
  1359. }
  1360. #ifdef __VSX__
  1361. static vector bool long long __ATTRS_o_ai
  1362. vec_cmplt(vector double __a, vector double __b) {
  1363. return vec_cmpgt(__b, __a);
  1364. }
  1365. #endif
  1366. #ifdef __POWER8_VECTOR__
  1367. static vector bool long long __ATTRS_o_ai
  1368. vec_cmplt(vector signed long long __a, vector signed long long __b) {
  1369. return vec_cmpgt(__b, __a);
  1370. }
  1371. static vector bool long long __ATTRS_o_ai
  1372. vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
  1373. return vec_cmpgt(__b, __a);
  1374. }
  1375. /* vec_cntlz */
  1376. static vector signed char __ATTRS_o_ai vec_cntlz(vector signed char __a) {
  1377. return __builtin_altivec_vclzb(__a);
  1378. }
  1379. static vector unsigned char __ATTRS_o_ai vec_cntlz(vector unsigned char __a) {
  1380. return __builtin_altivec_vclzb(__a);
  1381. }
  1382. static vector signed short __ATTRS_o_ai vec_cntlz(vector signed short __a) {
  1383. return __builtin_altivec_vclzh(__a);
  1384. }
  1385. static vector unsigned short __ATTRS_o_ai vec_cntlz(vector unsigned short __a) {
  1386. return __builtin_altivec_vclzh(__a);
  1387. }
  1388. static vector signed int __ATTRS_o_ai vec_cntlz(vector signed int __a) {
  1389. return __builtin_altivec_vclzw(__a);
  1390. }
  1391. static vector unsigned int __ATTRS_o_ai vec_cntlz(vector unsigned int __a) {
  1392. return __builtin_altivec_vclzw(__a);
  1393. }
  1394. static vector signed long long __ATTRS_o_ai
  1395. vec_cntlz(vector signed long long __a) {
  1396. return __builtin_altivec_vclzd(__a);
  1397. }
  1398. static vector unsigned long long __ATTRS_o_ai
  1399. vec_cntlz(vector unsigned long long __a) {
  1400. return __builtin_altivec_vclzd(__a);
  1401. }
  1402. #endif
  1403. /* vec_cpsgn */
  1404. #ifdef __VSX__
  1405. static vector float __ATTRS_o_ai vec_cpsgn(vector float __a, vector float __b) {
  1406. return __builtin_vsx_xvcpsgnsp(__a, __b);
  1407. }
  1408. static vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
  1409. vector double __b) {
  1410. return __builtin_vsx_xvcpsgndp(__a, __b);
  1411. }
  1412. #endif
  1413. /* vec_ctf */
  1414. static vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {
  1415. return __builtin_altivec_vcfsx(__a, __b);
  1416. }
  1417. static vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a, int __b) {
  1418. return __builtin_altivec_vcfux((vector int)__a, __b);
  1419. }
  1420. /* vec_vcfsx */
  1421. static vector float __attribute__((__always_inline__))
  1422. vec_vcfsx(vector int __a, int __b) {
  1423. return __builtin_altivec_vcfsx(__a, __b);
  1424. }
  1425. /* vec_vcfux */
  1426. static vector float __attribute__((__always_inline__))
  1427. vec_vcfux(vector unsigned int __a, int __b) {
  1428. return __builtin_altivec_vcfux((vector int)__a, __b);
  1429. }
  1430. /* vec_cts */
  1431. static vector int __attribute__((__always_inline__))
  1432. vec_cts(vector float __a, int __b) {
  1433. return __builtin_altivec_vctsxs(__a, __b);
  1434. }
  1435. /* vec_vctsxs */
  1436. static vector int __attribute__((__always_inline__))
  1437. vec_vctsxs(vector float __a, int __b) {
  1438. return __builtin_altivec_vctsxs(__a, __b);
  1439. }
  1440. /* vec_ctu */
  1441. static vector unsigned int __attribute__((__always_inline__))
  1442. vec_ctu(vector float __a, int __b) {
  1443. return __builtin_altivec_vctuxs(__a, __b);
  1444. }
  1445. /* vec_vctuxs */
  1446. static vector unsigned int __attribute__((__always_inline__))
  1447. vec_vctuxs(vector float __a, int __b) {
  1448. return __builtin_altivec_vctuxs(__a, __b);
  1449. }
  1450. /* vec_div */
  1451. /* Integer vector divides (vectors are scalarized, elements divided
  1452. and the vectors reassembled).
  1453. */
  1454. static vector signed char __ATTRS_o_ai vec_div(vector signed char __a,
  1455. vector signed char __b) {
  1456. return __a / __b;
  1457. }
  1458. static vector unsigned char __ATTRS_o_ai vec_div(vector unsigned char __a,
  1459. vector unsigned char __b) {
  1460. return __a / __b;
  1461. }
  1462. static vector signed short __ATTRS_o_ai vec_div(vector signed short __a,
  1463. vector signed short __b) {
  1464. return __a / __b;
  1465. }
  1466. static vector unsigned short __ATTRS_o_ai vec_div(vector unsigned short __a,
  1467. vector unsigned short __b) {
  1468. return __a / __b;
  1469. }
  1470. static vector signed int __ATTRS_o_ai vec_div(vector signed int __a,
  1471. vector signed int __b) {
  1472. return __a / __b;
  1473. }
  1474. static vector unsigned int __ATTRS_o_ai vec_div(vector unsigned int __a,
  1475. vector unsigned int __b) {
  1476. return __a / __b;
  1477. }
  1478. #ifdef __VSX__
  1479. static vector signed long long __ATTRS_o_ai
  1480. vec_div(vector signed long long __a, vector signed long long __b) {
  1481. return __a / __b;
  1482. }
  1483. static vector unsigned long long __ATTRS_o_ai
  1484. vec_div(vector unsigned long long __a, vector unsigned long long __b) {
  1485. return __a / __b;
  1486. }
  1487. static vector float __ATTRS_o_ai vec_div(vector float __a, vector float __b) {
  1488. return __a / __b;
  1489. }
  1490. static vector double __ATTRS_o_ai vec_div(vector double __a,
  1491. vector double __b) {
  1492. return __a / __b;
  1493. }
  1494. #endif
  1495. /* vec_dss */
  1496. static void __attribute__((__always_inline__)) vec_dss(int __a) {
  1497. __builtin_altivec_dss(__a);
  1498. }
  1499. /* vec_dssall */
  1500. static void __attribute__((__always_inline__)) vec_dssall(void) {
  1501. __builtin_altivec_dssall();
  1502. }
  1503. /* vec_dst */
  1504. static void __attribute__((__always_inline__))
  1505. vec_dst(const void *__a, int __b, int __c) {
  1506. __builtin_altivec_dst(__a, __b, __c);
  1507. }
  1508. /* vec_dstst */
  1509. static void __attribute__((__always_inline__))
  1510. vec_dstst(const void *__a, int __b, int __c) {
  1511. __builtin_altivec_dstst(__a, __b, __c);
  1512. }
  1513. /* vec_dststt */
  1514. static void __attribute__((__always_inline__))
  1515. vec_dststt(const void *__a, int __b, int __c) {
  1516. __builtin_altivec_dststt(__a, __b, __c);
  1517. }
  1518. /* vec_dstt */
  1519. static void __attribute__((__always_inline__))
  1520. vec_dstt(const void *__a, int __b, int __c) {
  1521. __builtin_altivec_dstt(__a, __b, __c);
  1522. }
  1523. /* vec_eqv */
  1524. #ifdef __POWER8_VECTOR__
  1525. static vector signed char __ATTRS_o_ai vec_eqv(vector signed char __a,
  1526. vector signed char __b) {
  1527. return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1528. (vector unsigned int)__b);
  1529. }
  1530. static vector signed char __ATTRS_o_ai vec_eqv(vector bool char __a,
  1531. vector signed char __b) {
  1532. return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1533. (vector unsigned int)__b);
  1534. }
  1535. static vector signed char __ATTRS_o_ai vec_eqv(vector signed char __a,
  1536. vector bool char __b) {
  1537. return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1538. (vector unsigned int)__b);
  1539. }
  1540. static vector unsigned char __ATTRS_o_ai vec_eqv(vector unsigned char __a,
  1541. vector unsigned char __b) {
  1542. return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1543. (vector unsigned int)__b);
  1544. }
  1545. static vector unsigned char __ATTRS_o_ai vec_eqv(vector bool char __a,
  1546. vector unsigned char __b) {
  1547. return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1548. (vector unsigned int)__b);
  1549. }
  1550. static vector unsigned char __ATTRS_o_ai vec_eqv(vector unsigned char __a,
  1551. vector bool char __b) {
  1552. return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1553. (vector unsigned int)__b);
  1554. }
  1555. static vector signed short __ATTRS_o_ai vec_eqv(vector signed short __a,
  1556. vector signed short __b) {
  1557. return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1558. (vector unsigned int)__b);
  1559. }
  1560. static vector signed short __ATTRS_o_ai vec_eqv(vector bool short __a,
  1561. vector signed short __b) {
  1562. return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1563. (vector unsigned int)__b);
  1564. }
  1565. static vector signed short __ATTRS_o_ai vec_eqv(vector signed short __a,
  1566. vector bool short __b) {
  1567. return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1568. (vector unsigned int)__b);
  1569. }
  1570. static vector unsigned short __ATTRS_o_ai vec_eqv(vector unsigned short __a,
  1571. vector unsigned short __b) {
  1572. return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1573. (vector unsigned int)__b);
  1574. }
  1575. static vector unsigned short __ATTRS_o_ai vec_eqv(vector bool short __a,
  1576. vector unsigned short __b) {
  1577. return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1578. (vector unsigned int)__b);
  1579. }
  1580. static vector unsigned short __ATTRS_o_ai vec_eqv(vector unsigned short __a,
  1581. vector bool short __b) {
  1582. return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1583. (vector unsigned int)__b);
  1584. }
  1585. static vector signed int __ATTRS_o_ai vec_eqv(vector signed int __a,
  1586. vector signed int __b) {
  1587. return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1588. (vector unsigned int)__b);
  1589. }
  1590. static vector signed int __ATTRS_o_ai vec_eqv(vector bool int __a,
  1591. vector signed int __b) {
  1592. return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1593. (vector unsigned int)__b);
  1594. }
  1595. static vector signed int __ATTRS_o_ai vec_eqv(vector signed int __a,
  1596. vector bool int __b) {
  1597. return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1598. (vector unsigned int)__b);
  1599. }
  1600. static vector unsigned int __ATTRS_o_ai vec_eqv(vector unsigned int __a,
  1601. vector unsigned int __b) {
  1602. return __builtin_vsx_xxleqv((vector unsigned int)__a,
  1603. (vector unsigned int)__b);
  1604. }
  1605. static vector unsigned int __ATTRS_o_ai vec_eqv(vector bool int __a,
  1606. vector unsigned int __b) {
  1607. return __builtin_vsx_xxleqv((vector unsigned int)__a,
  1608. (vector unsigned int)__b);
  1609. }
  1610. static vector unsigned int __ATTRS_o_ai vec_eqv(vector unsigned int __a,
  1611. vector bool int __b) {
  1612. return __builtin_vsx_xxleqv((vector unsigned int)__a,
  1613. (vector unsigned int)__b);
  1614. }
  1615. static vector signed long long __ATTRS_o_ai
  1616. vec_eqv(vector signed long long __a, vector signed long long __b) {
  1617. return (vector signed long long)
  1618. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1619. }
  1620. static vector signed long long __ATTRS_o_ai
  1621. vec_eqv(vector bool long long __a, vector signed long long __b) {
  1622. return (vector signed long long)
  1623. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1624. }
  1625. static vector signed long long __ATTRS_o_ai
  1626. vec_eqv(vector signed long long __a, vector bool long long __b) {
  1627. return (vector signed long long)
  1628. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1629. }
  1630. static vector unsigned long long __ATTRS_o_ai
  1631. vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
  1632. return (vector unsigned long long)
  1633. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1634. }
  1635. static vector unsigned long long __ATTRS_o_ai
  1636. vec_eqv(vector bool long long __a, vector unsigned long long __b) {
  1637. return (vector unsigned long long)
  1638. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1639. }
  1640. static vector unsigned long long __ATTRS_o_ai
  1641. vec_eqv(vector unsigned long long __a, vector bool long long __b) {
  1642. return (vector unsigned long long)
  1643. __builtin_vsx_xxleqv((vector unsigned int)__a, (vector unsigned int)__b);
  1644. }
  1645. static vector float __ATTRS_o_ai vec_eqv(vector float __a, vector float __b) {
  1646. return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1647. (vector unsigned int)__b);
  1648. }
  1649. static vector float __ATTRS_o_ai vec_eqv(vector bool int __a,
  1650. vector float __b) {
  1651. return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1652. (vector unsigned int)__b);
  1653. }
  1654. static vector float __ATTRS_o_ai vec_eqv(vector float __a,
  1655. vector bool int __b) {
  1656. return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1657. (vector unsigned int)__b);
  1658. }
  1659. static vector double __ATTRS_o_ai vec_eqv(vector double __a,
  1660. vector double __b) {
  1661. return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1662. (vector unsigned int)__b);
  1663. }
  1664. static vector double __ATTRS_o_ai vec_eqv(vector bool long long __a,
  1665. vector double __b) {
  1666. return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1667. (vector unsigned int)__b);
  1668. }
  1669. static vector double __ATTRS_o_ai vec_eqv(vector double __a,
  1670. vector bool long long __b) {
  1671. return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
  1672. (vector unsigned int)__b);
  1673. }
  1674. #endif
  1675. /* vec_expte */
  1676. static vector float __attribute__((__always_inline__))
  1677. vec_expte(vector float __a) {
  1678. return __builtin_altivec_vexptefp(__a);
  1679. }
  1680. /* vec_vexptefp */
  1681. static vector float __attribute__((__always_inline__))
  1682. vec_vexptefp(vector float __a) {
  1683. return __builtin_altivec_vexptefp(__a);
  1684. }
  1685. /* vec_floor */
  1686. static vector float __ATTRS_o_ai vec_floor(vector float __a) {
  1687. #ifdef __VSX__
  1688. return __builtin_vsx_xvrspim(__a);
  1689. #else
  1690. return __builtin_altivec_vrfim(__a);
  1691. #endif
  1692. }
  1693. #ifdef __VSX__
  1694. static vector double __ATTRS_o_ai vec_floor(vector double __a) {
  1695. return __builtin_vsx_xvrdpim(__a);
  1696. }
  1697. #endif
  1698. /* vec_vrfim */
  1699. static vector float __attribute__((__always_inline__))
  1700. vec_vrfim(vector float __a) {
  1701. return __builtin_altivec_vrfim(__a);
  1702. }
  1703. /* vec_ld */
  1704. static vector signed char __ATTRS_o_ai vec_ld(int __a,
  1705. const vector signed char *__b) {
  1706. return (vector signed char)__builtin_altivec_lvx(__a, __b);
  1707. }
  1708. static vector signed char __ATTRS_o_ai vec_ld(int __a, const signed char *__b) {
  1709. return (vector signed char)__builtin_altivec_lvx(__a, __b);
  1710. }
  1711. static vector unsigned char __ATTRS_o_ai
  1712. vec_ld(int __a, const vector unsigned char *__b) {
  1713. return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
  1714. }
  1715. static vector unsigned char __ATTRS_o_ai vec_ld(int __a,
  1716. const unsigned char *__b) {
  1717. return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
  1718. }
  1719. static vector bool char __ATTRS_o_ai vec_ld(int __a,
  1720. const vector bool char *__b) {
  1721. return (vector bool char)__builtin_altivec_lvx(__a, __b);
  1722. }
  1723. static vector short __ATTRS_o_ai vec_ld(int __a, const vector short *__b) {
  1724. return (vector short)__builtin_altivec_lvx(__a, __b);
  1725. }
  1726. static vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
  1727. return (vector short)__builtin_altivec_lvx(__a, __b);
  1728. }
  1729. static vector unsigned short __ATTRS_o_ai
  1730. vec_ld(int __a, const vector unsigned short *__b) {
  1731. return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
  1732. }
  1733. static vector unsigned short __ATTRS_o_ai vec_ld(int __a,
  1734. const unsigned short *__b) {
  1735. return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
  1736. }
  1737. static vector bool short __ATTRS_o_ai vec_ld(int __a,
  1738. const vector bool short *__b) {
  1739. return (vector bool short)__builtin_altivec_lvx(__a, __b);
  1740. }
  1741. static vector pixel __ATTRS_o_ai vec_ld(int __a, const vector pixel *__b) {
  1742. return (vector pixel)__builtin_altivec_lvx(__a, __b);
  1743. }
  1744. static vector int __ATTRS_o_ai vec_ld(int __a, const vector int *__b) {
  1745. return (vector int)__builtin_altivec_lvx(__a, __b);
  1746. }
  1747. static vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
  1748. return (vector int)__builtin_altivec_lvx(__a, __b);
  1749. }
  1750. static vector unsigned int __ATTRS_o_ai vec_ld(int __a,
  1751. const vector unsigned int *__b) {
  1752. return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
  1753. }
  1754. static vector unsigned int __ATTRS_o_ai vec_ld(int __a,
  1755. const unsigned int *__b) {
  1756. return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
  1757. }
  1758. static vector bool int __ATTRS_o_ai vec_ld(int __a,
  1759. const vector bool int *__b) {
  1760. return (vector bool int)__builtin_altivec_lvx(__a, __b);
  1761. }
  1762. static vector float __ATTRS_o_ai vec_ld(int __a, const vector float *__b) {
  1763. return (vector float)__builtin_altivec_lvx(__a, __b);
  1764. }
  1765. static vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
  1766. return (vector float)__builtin_altivec_lvx(__a, __b);
  1767. }
  1768. /* vec_lvx */
  1769. static vector signed char __ATTRS_o_ai vec_lvx(int __a,
  1770. const vector signed char *__b) {
  1771. return (vector signed char)__builtin_altivec_lvx(__a, __b);
  1772. }
  1773. static vector signed char __ATTRS_o_ai vec_lvx(int __a,
  1774. const signed char *__b) {
  1775. return (vector signed char)__builtin_altivec_lvx(__a, __b);
  1776. }
  1777. static vector unsigned char __ATTRS_o_ai
  1778. vec_lvx(int __a, const vector unsigned char *__b) {
  1779. return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
  1780. }
  1781. static vector unsigned char __ATTRS_o_ai vec_lvx(int __a,
  1782. const unsigned char *__b) {
  1783. return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
  1784. }
  1785. static vector bool char __ATTRS_o_ai vec_lvx(int __a,
  1786. const vector bool char *__b) {
  1787. return (vector bool char)__builtin_altivec_lvx(__a, __b);
  1788. }
  1789. static vector short __ATTRS_o_ai vec_lvx(int __a, const vector short *__b) {
  1790. return (vector short)__builtin_altivec_lvx(__a, __b);
  1791. }
  1792. static vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
  1793. return (vector short)__builtin_altivec_lvx(__a, __b);
  1794. }
  1795. static vector unsigned short __ATTRS_o_ai
  1796. vec_lvx(int __a, const vector unsigned short *__b) {
  1797. return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
  1798. }
  1799. static vector unsigned short __ATTRS_o_ai vec_lvx(int __a,
  1800. const unsigned short *__b) {
  1801. return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
  1802. }
  1803. static vector bool short __ATTRS_o_ai vec_lvx(int __a,
  1804. const vector bool short *__b) {
  1805. return (vector bool short)__builtin_altivec_lvx(__a, __b);
  1806. }
  1807. static vector pixel __ATTRS_o_ai vec_lvx(int __a, const vector pixel *__b) {
  1808. return (vector pixel)__builtin_altivec_lvx(__a, __b);
  1809. }
  1810. static vector int __ATTRS_o_ai vec_lvx(int __a, const vector int *__b) {
  1811. return (vector int)__builtin_altivec_lvx(__a, __b);
  1812. }
  1813. static vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
  1814. return (vector int)__builtin_altivec_lvx(__a, __b);
  1815. }
  1816. static vector unsigned int __ATTRS_o_ai
  1817. vec_lvx(int __a, const vector unsigned int *__b) {
  1818. return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
  1819. }
  1820. static vector unsigned int __ATTRS_o_ai vec_lvx(int __a,
  1821. const unsigned int *__b) {
  1822. return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
  1823. }
  1824. static vector bool int __ATTRS_o_ai vec_lvx(int __a,
  1825. const vector bool int *__b) {
  1826. return (vector bool int)__builtin_altivec_lvx(__a, __b);
  1827. }
  1828. static vector float __ATTRS_o_ai vec_lvx(int __a, const vector float *__b) {
  1829. return (vector float)__builtin_altivec_lvx(__a, __b);
  1830. }
  1831. static vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
  1832. return (vector float)__builtin_altivec_lvx(__a, __b);
  1833. }
  1834. /* vec_lde */
  1835. static vector signed char __ATTRS_o_ai vec_lde(int __a,
  1836. const signed char *__b) {
  1837. return (vector signed char)__builtin_altivec_lvebx(__a, __b);
  1838. }
  1839. static vector unsigned char __ATTRS_o_ai vec_lde(int __a,
  1840. const unsigned char *__b) {
  1841. return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
  1842. }
  1843. static vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
  1844. return (vector short)__builtin_altivec_lvehx(__a, __b);
  1845. }
  1846. static vector unsigned short __ATTRS_o_ai vec_lde(int __a,
  1847. const unsigned short *__b) {
  1848. return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
  1849. }
  1850. static vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
  1851. return (vector int)__builtin_altivec_lvewx(__a, __b);
  1852. }
  1853. static vector unsigned int __ATTRS_o_ai vec_lde(int __a,
  1854. const unsigned int *__b) {
  1855. return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
  1856. }
  1857. static vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
  1858. return (vector float)__builtin_altivec_lvewx(__a, __b);
  1859. }
  1860. /* vec_lvebx */
  1861. static vector signed char __ATTRS_o_ai vec_lvebx(int __a,
  1862. const signed char *__b) {
  1863. return (vector signed char)__builtin_altivec_lvebx(__a, __b);
  1864. }
  1865. static vector unsigned char __ATTRS_o_ai vec_lvebx(int __a,
  1866. const unsigned char *__b) {
  1867. return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
  1868. }
  1869. /* vec_lvehx */
  1870. static vector short __ATTRS_o_ai vec_lvehx(int __a, const short *__b) {
  1871. return (vector short)__builtin_altivec_lvehx(__a, __b);
  1872. }
  1873. static vector unsigned short __ATTRS_o_ai vec_lvehx(int __a,
  1874. const unsigned short *__b) {
  1875. return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
  1876. }
  1877. /* vec_lvewx */
  1878. static vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
  1879. return (vector int)__builtin_altivec_lvewx(__a, __b);
  1880. }
  1881. static vector unsigned int __ATTRS_o_ai vec_lvewx(int __a,
  1882. const unsigned int *__b) {
  1883. return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
  1884. }
  1885. static vector float __ATTRS_o_ai vec_lvewx(int __a, const float *__b) {
  1886. return (vector float)__builtin_altivec_lvewx(__a, __b);
  1887. }
  1888. /* vec_ldl */
  1889. static vector signed char __ATTRS_o_ai vec_ldl(int __a,
  1890. const vector signed char *__b) {
  1891. return (vector signed char)__builtin_altivec_lvxl(__a, __b);
  1892. }
  1893. static vector signed char __ATTRS_o_ai vec_ldl(int __a,
  1894. const signed char *__b) {
  1895. return (vector signed char)__builtin_altivec_lvxl(__a, __b);
  1896. }
  1897. static vector unsigned char __ATTRS_o_ai
  1898. vec_ldl(int __a, const vector unsigned char *__b) {
  1899. return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
  1900. }
  1901. static vector unsigned char __ATTRS_o_ai vec_ldl(int __a,
  1902. const unsigned char *__b) {
  1903. return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
  1904. }
  1905. static vector bool char __ATTRS_o_ai vec_ldl(int __a,
  1906. const vector bool char *__b) {
  1907. return (vector bool char)__builtin_altivec_lvxl(__a, __b);
  1908. }
  1909. static vector short __ATTRS_o_ai vec_ldl(int __a, const vector short *__b) {
  1910. return (vector short)__builtin_altivec_lvxl(__a, __b);
  1911. }
  1912. static vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
  1913. return (vector short)__builtin_altivec_lvxl(__a, __b);
  1914. }
  1915. static vector unsigned short __ATTRS_o_ai
  1916. vec_ldl(int __a, const vector unsigned short *__b) {
  1917. return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
  1918. }
  1919. static vector unsigned short __ATTRS_o_ai vec_ldl(int __a,
  1920. const unsigned short *__b) {
  1921. return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
  1922. }
  1923. static vector bool short __ATTRS_o_ai vec_ldl(int __a,
  1924. const vector bool short *__b) {
  1925. return (vector bool short)__builtin_altivec_lvxl(__a, __b);
  1926. }
  1927. static vector pixel __ATTRS_o_ai vec_ldl(int __a, const vector pixel *__b) {
  1928. return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
  1929. }
  1930. static vector int __ATTRS_o_ai vec_ldl(int __a, const vector int *__b) {
  1931. return (vector int)__builtin_altivec_lvxl(__a, __b);
  1932. }
  1933. static vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
  1934. return (vector int)__builtin_altivec_lvxl(__a, __b);
  1935. }
  1936. static vector unsigned int __ATTRS_o_ai
  1937. vec_ldl(int __a, const vector unsigned int *__b) {
  1938. return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
  1939. }
  1940. static vector unsigned int __ATTRS_o_ai vec_ldl(int __a,
  1941. const unsigned int *__b) {
  1942. return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
  1943. }
  1944. static vector bool int __ATTRS_o_ai vec_ldl(int __a,
  1945. const vector bool int *__b) {
  1946. return (vector bool int)__builtin_altivec_lvxl(__a, __b);
  1947. }
  1948. static vector float __ATTRS_o_ai vec_ldl(int __a, const vector float *__b) {
  1949. return (vector float)__builtin_altivec_lvxl(__a, __b);
  1950. }
  1951. static vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
  1952. return (vector float)__builtin_altivec_lvxl(__a, __b);
  1953. }
  1954. /* vec_lvxl */
  1955. static vector signed char __ATTRS_o_ai vec_lvxl(int __a,
  1956. const vector signed char *__b) {
  1957. return (vector signed char)__builtin_altivec_lvxl(__a, __b);
  1958. }
  1959. static vector signed char __ATTRS_o_ai vec_lvxl(int __a,
  1960. const signed char *__b) {
  1961. return (vector signed char)__builtin_altivec_lvxl(__a, __b);
  1962. }
  1963. static vector unsigned char __ATTRS_o_ai
  1964. vec_lvxl(int __a, const vector unsigned char *__b) {
  1965. return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
  1966. }
  1967. static vector unsigned char __ATTRS_o_ai vec_lvxl(int __a,
  1968. const unsigned char *__b) {
  1969. return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
  1970. }
  1971. static vector bool char __ATTRS_o_ai vec_lvxl(int __a,
  1972. const vector bool char *__b) {
  1973. return (vector bool char)__builtin_altivec_lvxl(__a, __b);
  1974. }
  1975. static vector short __ATTRS_o_ai vec_lvxl(int __a, const vector short *__b) {
  1976. return (vector short)__builtin_altivec_lvxl(__a, __b);
  1977. }
  1978. static vector short __ATTRS_o_ai vec_lvxl(int __a, const short *__b) {
  1979. return (vector short)__builtin_altivec_lvxl(__a, __b);
  1980. }
  1981. static vector unsigned short __ATTRS_o_ai
  1982. vec_lvxl(int __a, const vector unsigned short *__b) {
  1983. return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
  1984. }
  1985. static vector unsigned short __ATTRS_o_ai vec_lvxl(int __a,
  1986. const unsigned short *__b) {
  1987. return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
  1988. }
  1989. static vector bool short __ATTRS_o_ai vec_lvxl(int __a,
  1990. const vector bool short *__b) {
  1991. return (vector bool short)__builtin_altivec_lvxl(__a, __b);
  1992. }
  1993. static vector pixel __ATTRS_o_ai vec_lvxl(int __a, const vector pixel *__b) {
  1994. return (vector pixel)__builtin_altivec_lvxl(__a, __b);
  1995. }
  1996. static vector int __ATTRS_o_ai vec_lvxl(int __a, const vector int *__b) {
  1997. return (vector int)__builtin_altivec_lvxl(__a, __b);
  1998. }
  1999. static vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
  2000. return (vector int)__builtin_altivec_lvxl(__a, __b);
  2001. }
  2002. static vector unsigned int __ATTRS_o_ai
  2003. vec_lvxl(int __a, const vector unsigned int *__b) {
  2004. return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
  2005. }
  2006. static vector unsigned int __ATTRS_o_ai vec_lvxl(int __a,
  2007. const unsigned int *__b) {
  2008. return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
  2009. }
  2010. static vector bool int __ATTRS_o_ai vec_lvxl(int __a,
  2011. const vector bool int *__b) {
  2012. return (vector bool int)__builtin_altivec_lvxl(__a, __b);
  2013. }
  2014. static vector float __ATTRS_o_ai vec_lvxl(int __a, const vector float *__b) {
  2015. return (vector float)__builtin_altivec_lvxl(__a, __b);
  2016. }
  2017. static vector float __ATTRS_o_ai vec_lvxl(int __a, const float *__b) {
  2018. return (vector float)__builtin_altivec_lvxl(__a, __b);
  2019. }
  2020. /* vec_loge */
  2021. static vector float __attribute__((__always_inline__))
  2022. vec_loge(vector float __a) {
  2023. return __builtin_altivec_vlogefp(__a);
  2024. }
  2025. /* vec_vlogefp */
  2026. static vector float __attribute__((__always_inline__))
  2027. vec_vlogefp(vector float __a) {
  2028. return __builtin_altivec_vlogefp(__a);
  2029. }
  2030. /* vec_lvsl */
  2031. #ifdef __LITTLE_ENDIAN__
  2032. static vector unsigned char __ATTRS_o_ai
  2033. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2034. loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
  2035. vector unsigned char mask =
  2036. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2037. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2038. 7, 6, 5, 4, 3, 2, 1, 0};
  2039. return vec_perm(mask, mask, reverse);
  2040. }
  2041. #else
  2042. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
  2043. const signed char *__b) {
  2044. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2045. }
  2046. #endif
  2047. #ifdef __LITTLE_ENDIAN__
  2048. static vector unsigned char __ATTRS_o_ai
  2049. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2050. loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
  2051. vector unsigned char mask =
  2052. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2053. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2054. 7, 6, 5, 4, 3, 2, 1, 0};
  2055. return vec_perm(mask, mask, reverse);
  2056. }
  2057. #else
  2058. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
  2059. const unsigned char *__b) {
  2060. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2061. }
  2062. #endif
  2063. #ifdef __LITTLE_ENDIAN__
  2064. static vector unsigned char __ATTRS_o_ai
  2065. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2066. loads/stores"))) vec_lvsl(int __a, const short *__b) {
  2067. vector unsigned char mask =
  2068. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2069. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2070. 7, 6, 5, 4, 3, 2, 1, 0};
  2071. return vec_perm(mask, mask, reverse);
  2072. }
  2073. #else
  2074. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a, const short *__b) {
  2075. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2076. }
  2077. #endif
  2078. #ifdef __LITTLE_ENDIAN__
  2079. static vector unsigned char __ATTRS_o_ai
  2080. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2081. loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
  2082. vector unsigned char mask =
  2083. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2084. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2085. 7, 6, 5, 4, 3, 2, 1, 0};
  2086. return vec_perm(mask, mask, reverse);
  2087. }
  2088. #else
  2089. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
  2090. const unsigned short *__b) {
  2091. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2092. }
  2093. #endif
  2094. #ifdef __LITTLE_ENDIAN__
  2095. static vector unsigned char __ATTRS_o_ai
  2096. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2097. loads/stores"))) vec_lvsl(int __a, const int *__b) {
  2098. vector unsigned char mask =
  2099. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2100. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2101. 7, 6, 5, 4, 3, 2, 1, 0};
  2102. return vec_perm(mask, mask, reverse);
  2103. }
  2104. #else
  2105. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a, const int *__b) {
  2106. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2107. }
  2108. #endif
  2109. #ifdef __LITTLE_ENDIAN__
  2110. static vector unsigned char __ATTRS_o_ai
  2111. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2112. loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
  2113. vector unsigned char mask =
  2114. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2115. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2116. 7, 6, 5, 4, 3, 2, 1, 0};
  2117. return vec_perm(mask, mask, reverse);
  2118. }
  2119. #else
  2120. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
  2121. const unsigned int *__b) {
  2122. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2123. }
  2124. #endif
  2125. #ifdef __LITTLE_ENDIAN__
  2126. static vector unsigned char __ATTRS_o_ai
  2127. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2128. loads/stores"))) vec_lvsl(int __a, const float *__b) {
  2129. vector unsigned char mask =
  2130. (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2131. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2132. 7, 6, 5, 4, 3, 2, 1, 0};
  2133. return vec_perm(mask, mask, reverse);
  2134. }
  2135. #else
  2136. static vector unsigned char __ATTRS_o_ai vec_lvsl(int __a, const float *__b) {
  2137. return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
  2138. }
  2139. #endif
  2140. /* vec_lvsr */
  2141. #ifdef __LITTLE_ENDIAN__
  2142. static vector unsigned char __ATTRS_o_ai
  2143. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2144. loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
  2145. vector unsigned char mask =
  2146. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2147. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2148. 7, 6, 5, 4, 3, 2, 1, 0};
  2149. return vec_perm(mask, mask, reverse);
  2150. }
  2151. #else
  2152. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
  2153. const signed char *__b) {
  2154. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2155. }
  2156. #endif
  2157. #ifdef __LITTLE_ENDIAN__
  2158. static vector unsigned char __ATTRS_o_ai
  2159. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2160. loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
  2161. vector unsigned char mask =
  2162. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2163. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2164. 7, 6, 5, 4, 3, 2, 1, 0};
  2165. return vec_perm(mask, mask, reverse);
  2166. }
  2167. #else
  2168. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
  2169. const unsigned char *__b) {
  2170. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2171. }
  2172. #endif
  2173. #ifdef __LITTLE_ENDIAN__
  2174. static vector unsigned char __ATTRS_o_ai
  2175. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2176. loads/stores"))) vec_lvsr(int __a, const short *__b) {
  2177. vector unsigned char mask =
  2178. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2179. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2180. 7, 6, 5, 4, 3, 2, 1, 0};
  2181. return vec_perm(mask, mask, reverse);
  2182. }
  2183. #else
  2184. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a, const short *__b) {
  2185. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2186. }
  2187. #endif
  2188. #ifdef __LITTLE_ENDIAN__
  2189. static vector unsigned char __ATTRS_o_ai
  2190. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2191. loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
  2192. vector unsigned char mask =
  2193. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2194. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2195. 7, 6, 5, 4, 3, 2, 1, 0};
  2196. return vec_perm(mask, mask, reverse);
  2197. }
  2198. #else
  2199. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
  2200. const unsigned short *__b) {
  2201. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2202. }
  2203. #endif
  2204. #ifdef __LITTLE_ENDIAN__
  2205. static vector unsigned char __ATTRS_o_ai
  2206. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2207. loads/stores"))) vec_lvsr(int __a, const int *__b) {
  2208. vector unsigned char mask =
  2209. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2210. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2211. 7, 6, 5, 4, 3, 2, 1, 0};
  2212. return vec_perm(mask, mask, reverse);
  2213. }
  2214. #else
  2215. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a, const int *__b) {
  2216. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2217. }
  2218. #endif
  2219. #ifdef __LITTLE_ENDIAN__
  2220. static vector unsigned char __ATTRS_o_ai
  2221. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2222. loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
  2223. vector unsigned char mask =
  2224. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2225. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2226. 7, 6, 5, 4, 3, 2, 1, 0};
  2227. return vec_perm(mask, mask, reverse);
  2228. }
  2229. #else
  2230. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
  2231. const unsigned int *__b) {
  2232. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2233. }
  2234. #endif
  2235. #ifdef __LITTLE_ENDIAN__
  2236. static vector unsigned char __ATTRS_o_ai
  2237. __attribute__((__deprecated__("use assignment for unaligned little endian \
  2238. loads/stores"))) vec_lvsr(int __a, const float *__b) {
  2239. vector unsigned char mask =
  2240. (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2241. vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
  2242. 7, 6, 5, 4, 3, 2, 1, 0};
  2243. return vec_perm(mask, mask, reverse);
  2244. }
  2245. #else
  2246. static vector unsigned char __ATTRS_o_ai vec_lvsr(int __a, const float *__b) {
  2247. return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
  2248. }
  2249. #endif
  2250. /* vec_madd */
  2251. static vector float __ATTRS_o_ai
  2252. vec_madd(vector float __a, vector float __b, vector float __c) {
  2253. #ifdef __VSX__
  2254. return __builtin_vsx_xvmaddasp(__a, __b, __c);
  2255. #else
  2256. return __builtin_altivec_vmaddfp(__a, __b, __c);
  2257. #endif
  2258. }
  2259. #ifdef __VSX__
  2260. static vector double __ATTRS_o_ai
  2261. vec_madd(vector double __a, vector double __b, vector double __c) {
  2262. return __builtin_vsx_xvmaddadp(__a, __b, __c);
  2263. }
  2264. #endif
  2265. /* vec_vmaddfp */
  2266. static vector float __attribute__((__always_inline__))
  2267. vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
  2268. return __builtin_altivec_vmaddfp(__a, __b, __c);
  2269. }
  2270. /* vec_madds */
  2271. static vector signed short __attribute__((__always_inline__))
  2272. vec_madds(vector signed short __a, vector signed short __b,
  2273. vector signed short __c) {
  2274. return __builtin_altivec_vmhaddshs(__a, __b, __c);
  2275. }
  2276. /* vec_vmhaddshs */
  2277. static vector signed short __attribute__((__always_inline__))
  2278. vec_vmhaddshs(vector signed short __a, vector signed short __b,
  2279. vector signed short __c) {
  2280. return __builtin_altivec_vmhaddshs(__a, __b, __c);
  2281. }
  2282. /* vec_msub */
  2283. #ifdef __VSX__
  2284. static vector float __ATTRS_o_ai
  2285. vec_msub(vector float __a, vector float __b, vector float __c) {
  2286. return __builtin_vsx_xvmsubasp(__a, __b, __c);
  2287. }
  2288. static vector double __ATTRS_o_ai
  2289. vec_msub(vector double __a, vector double __b, vector double __c) {
  2290. return __builtin_vsx_xvmsubadp(__a, __b, __c);
  2291. }
  2292. #endif
  2293. /* vec_max */
  2294. static vector signed char __ATTRS_o_ai vec_max(vector signed char __a,
  2295. vector signed char __b) {
  2296. return __builtin_altivec_vmaxsb(__a, __b);
  2297. }
  2298. static vector signed char __ATTRS_o_ai vec_max(vector bool char __a,
  2299. vector signed char __b) {
  2300. return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
  2301. }
  2302. static vector signed char __ATTRS_o_ai vec_max(vector signed char __a,
  2303. vector bool char __b) {
  2304. return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
  2305. }
  2306. static vector unsigned char __ATTRS_o_ai vec_max(vector unsigned char __a,
  2307. vector unsigned char __b) {
  2308. return __builtin_altivec_vmaxub(__a, __b);
  2309. }
  2310. static vector unsigned char __ATTRS_o_ai vec_max(vector bool char __a,
  2311. vector unsigned char __b) {
  2312. return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
  2313. }
  2314. static vector unsigned char __ATTRS_o_ai vec_max(vector unsigned char __a,
  2315. vector bool char __b) {
  2316. return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
  2317. }
  2318. static vector short __ATTRS_o_ai vec_max(vector short __a, vector short __b) {
  2319. return __builtin_altivec_vmaxsh(__a, __b);
  2320. }
  2321. static vector short __ATTRS_o_ai vec_max(vector bool short __a,
  2322. vector short __b) {
  2323. return __builtin_altivec_vmaxsh((vector short)__a, __b);
  2324. }
  2325. static vector short __ATTRS_o_ai vec_max(vector short __a,
  2326. vector bool short __b) {
  2327. return __builtin_altivec_vmaxsh(__a, (vector short)__b);
  2328. }
  2329. static vector unsigned short __ATTRS_o_ai vec_max(vector unsigned short __a,
  2330. vector unsigned short __b) {
  2331. return __builtin_altivec_vmaxuh(__a, __b);
  2332. }
  2333. static vector unsigned short __ATTRS_o_ai vec_max(vector bool short __a,
  2334. vector unsigned short __b) {
  2335. return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
  2336. }
  2337. static vector unsigned short __ATTRS_o_ai vec_max(vector unsigned short __a,
  2338. vector bool short __b) {
  2339. return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
  2340. }
  2341. static vector int __ATTRS_o_ai vec_max(vector int __a, vector int __b) {
  2342. return __builtin_altivec_vmaxsw(__a, __b);
  2343. }
  2344. static vector int __ATTRS_o_ai vec_max(vector bool int __a, vector int __b) {
  2345. return __builtin_altivec_vmaxsw((vector int)__a, __b);
  2346. }
  2347. static vector int __ATTRS_o_ai vec_max(vector int __a, vector bool int __b) {
  2348. return __builtin_altivec_vmaxsw(__a, (vector int)__b);
  2349. }
  2350. static vector unsigned int __ATTRS_o_ai vec_max(vector unsigned int __a,
  2351. vector unsigned int __b) {
  2352. return __builtin_altivec_vmaxuw(__a, __b);
  2353. }
  2354. static vector unsigned int __ATTRS_o_ai vec_max(vector bool int __a,
  2355. vector unsigned int __b) {
  2356. return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
  2357. }
  2358. static vector unsigned int __ATTRS_o_ai vec_max(vector unsigned int __a,
  2359. vector bool int __b) {
  2360. return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
  2361. }
  2362. #ifdef __POWER8_VECTOR__
  2363. static vector signed long long __ATTRS_o_ai
  2364. vec_max(vector signed long long __a, vector signed long long __b) {
  2365. return __builtin_altivec_vmaxsd(__a, __b);
  2366. }
  2367. static vector signed long long __ATTRS_o_ai
  2368. vec_max(vector bool long long __a, vector signed long long __b) {
  2369. return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
  2370. }
  2371. static vector signed long long __ATTRS_o_ai vec_max(vector signed long long __a,
  2372. vector bool long long __b) {
  2373. return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
  2374. }
  2375. static vector unsigned long long __ATTRS_o_ai
  2376. vec_max(vector unsigned long long __a, vector unsigned long long __b) {
  2377. return __builtin_altivec_vmaxud(__a, __b);
  2378. }
  2379. static vector unsigned long long __ATTRS_o_ai
  2380. vec_max(vector bool long long __a, vector unsigned long long __b) {
  2381. return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
  2382. }
  2383. static vector unsigned long long __ATTRS_o_ai
  2384. vec_max(vector unsigned long long __a, vector bool long long __b) {
  2385. return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
  2386. }
  2387. #endif
  2388. static vector float __ATTRS_o_ai vec_max(vector float __a, vector float __b) {
  2389. #ifdef __VSX__
  2390. return __builtin_vsx_xvmaxsp(__a, __b);
  2391. #else
  2392. return __builtin_altivec_vmaxfp(__a, __b);
  2393. #endif
  2394. }
  2395. #ifdef __VSX__
  2396. static vector double __ATTRS_o_ai vec_max(vector double __a,
  2397. vector double __b) {
  2398. return __builtin_vsx_xvmaxdp(__a, __b);
  2399. }
  2400. #endif
  2401. /* vec_vmaxsb */
  2402. static vector signed char __ATTRS_o_ai vec_vmaxsb(vector signed char __a,
  2403. vector signed char __b) {
  2404. return __builtin_altivec_vmaxsb(__a, __b);
  2405. }
  2406. static vector signed char __ATTRS_o_ai vec_vmaxsb(vector bool char __a,
  2407. vector signed char __b) {
  2408. return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
  2409. }
  2410. static vector signed char __ATTRS_o_ai vec_vmaxsb(vector signed char __a,
  2411. vector bool char __b) {
  2412. return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
  2413. }
  2414. /* vec_vmaxub */
  2415. static vector unsigned char __ATTRS_o_ai vec_vmaxub(vector unsigned char __a,
  2416. vector unsigned char __b) {
  2417. return __builtin_altivec_vmaxub(__a, __b);
  2418. }
  2419. static vector unsigned char __ATTRS_o_ai vec_vmaxub(vector bool char __a,
  2420. vector unsigned char __b) {
  2421. return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
  2422. }
  2423. static vector unsigned char __ATTRS_o_ai vec_vmaxub(vector unsigned char __a,
  2424. vector bool char __b) {
  2425. return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
  2426. }
  2427. /* vec_vmaxsh */
  2428. static vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
  2429. vector short __b) {
  2430. return __builtin_altivec_vmaxsh(__a, __b);
  2431. }
  2432. static vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
  2433. vector short __b) {
  2434. return __builtin_altivec_vmaxsh((vector short)__a, __b);
  2435. }
  2436. static vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
  2437. vector bool short __b) {
  2438. return __builtin_altivec_vmaxsh(__a, (vector short)__b);
  2439. }
  2440. /* vec_vmaxuh */
  2441. static vector unsigned short __ATTRS_o_ai
  2442. vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
  2443. return __builtin_altivec_vmaxuh(__a, __b);
  2444. }
  2445. static vector unsigned short __ATTRS_o_ai
  2446. vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
  2447. return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
  2448. }
  2449. static vector unsigned short __ATTRS_o_ai vec_vmaxuh(vector unsigned short __a,
  2450. vector bool short __b) {
  2451. return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
  2452. }
  2453. /* vec_vmaxsw */
  2454. static vector int __ATTRS_o_ai vec_vmaxsw(vector int __a, vector int __b) {
  2455. return __builtin_altivec_vmaxsw(__a, __b);
  2456. }
  2457. static vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a, vector int __b) {
  2458. return __builtin_altivec_vmaxsw((vector int)__a, __b);
  2459. }
  2460. static vector int __ATTRS_o_ai vec_vmaxsw(vector int __a, vector bool int __b) {
  2461. return __builtin_altivec_vmaxsw(__a, (vector int)__b);
  2462. }
  2463. /* vec_vmaxuw */
  2464. static vector unsigned int __ATTRS_o_ai vec_vmaxuw(vector unsigned int __a,
  2465. vector unsigned int __b) {
  2466. return __builtin_altivec_vmaxuw(__a, __b);
  2467. }
  2468. static vector unsigned int __ATTRS_o_ai vec_vmaxuw(vector bool int __a,
  2469. vector unsigned int __b) {
  2470. return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
  2471. }
  2472. static vector unsigned int __ATTRS_o_ai vec_vmaxuw(vector unsigned int __a,
  2473. vector bool int __b) {
  2474. return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
  2475. }
  2476. /* vec_vmaxfp */
  2477. static vector float __attribute__((__always_inline__))
  2478. vec_vmaxfp(vector float __a, vector float __b) {
  2479. #ifdef __VSX__
  2480. return __builtin_vsx_xvmaxsp(__a, __b);
  2481. #else
  2482. return __builtin_altivec_vmaxfp(__a, __b);
  2483. #endif
  2484. }
  2485. /* vec_mergeh */
  2486. static vector signed char __ATTRS_o_ai vec_mergeh(vector signed char __a,
  2487. vector signed char __b) {
  2488. return vec_perm(__a, __b,
  2489. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2490. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2491. 0x06, 0x16, 0x07, 0x17));
  2492. }
  2493. static vector unsigned char __ATTRS_o_ai vec_mergeh(vector unsigned char __a,
  2494. vector unsigned char __b) {
  2495. return vec_perm(__a, __b,
  2496. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2497. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2498. 0x06, 0x16, 0x07, 0x17));
  2499. }
  2500. static vector bool char __ATTRS_o_ai vec_mergeh(vector bool char __a,
  2501. vector bool char __b) {
  2502. return vec_perm(__a, __b,
  2503. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2504. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2505. 0x06, 0x16, 0x07, 0x17));
  2506. }
  2507. static vector short __ATTRS_o_ai vec_mergeh(vector short __a,
  2508. vector short __b) {
  2509. return vec_perm(__a, __b,
  2510. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2511. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2512. 0x06, 0x07, 0x16, 0x17));
  2513. }
  2514. static vector unsigned short __ATTRS_o_ai
  2515. vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
  2516. return vec_perm(__a, __b,
  2517. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2518. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2519. 0x06, 0x07, 0x16, 0x17));
  2520. }
  2521. static vector bool short __ATTRS_o_ai vec_mergeh(vector bool short __a,
  2522. vector bool short __b) {
  2523. return vec_perm(__a, __b,
  2524. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2525. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2526. 0x06, 0x07, 0x16, 0x17));
  2527. }
  2528. static vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
  2529. vector pixel __b) {
  2530. return vec_perm(__a, __b,
  2531. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2532. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2533. 0x06, 0x07, 0x16, 0x17));
  2534. }
  2535. static vector int __ATTRS_o_ai vec_mergeh(vector int __a, vector int __b) {
  2536. return vec_perm(__a, __b,
  2537. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2538. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2539. 0x14, 0x15, 0x16, 0x17));
  2540. }
  2541. static vector unsigned int __ATTRS_o_ai vec_mergeh(vector unsigned int __a,
  2542. vector unsigned int __b) {
  2543. return vec_perm(__a, __b,
  2544. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2545. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2546. 0x14, 0x15, 0x16, 0x17));
  2547. }
  2548. static vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
  2549. vector bool int __b) {
  2550. return vec_perm(__a, __b,
  2551. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2552. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2553. 0x14, 0x15, 0x16, 0x17));
  2554. }
  2555. static vector float __ATTRS_o_ai vec_mergeh(vector float __a,
  2556. vector float __b) {
  2557. return vec_perm(__a, __b,
  2558. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2559. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2560. 0x14, 0x15, 0x16, 0x17));
  2561. }
  2562. #ifdef __VSX__
  2563. static vector signed long long __ATTRS_o_ai
  2564. vec_mergeh(vector signed long long __a, vector signed long long __b) {
  2565. return vec_perm(__a, __b,
  2566. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2567. 0x04, 0x05, 0x06, 0x07,
  2568. 0x10, 0x11, 0x12, 0x13,
  2569. 0x14, 0x15, 0x16, 0x17));
  2570. }
  2571. static vector signed long long __ATTRS_o_ai
  2572. vec_mergeh(vector signed long long __a, vector bool long long __b) {
  2573. return vec_perm(__a, (vector signed long long)__b,
  2574. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2575. 0x04, 0x05, 0x06, 0x07,
  2576. 0x10, 0x11, 0x12, 0x13,
  2577. 0x14, 0x15, 0x16, 0x17));
  2578. }
  2579. static vector signed long long __ATTRS_o_ai
  2580. vec_mergeh(vector bool long long __a, vector signed long long __b) {
  2581. return vec_perm((vector signed long long)__a, __b,
  2582. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2583. 0x04, 0x05, 0x06, 0x07,
  2584. 0x10, 0x11, 0x12, 0x13,
  2585. 0x14, 0x15, 0x16, 0x17));
  2586. }
  2587. static vector unsigned long long __ATTRS_o_ai
  2588. vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
  2589. return vec_perm(__a, __b,
  2590. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2591. 0x04, 0x05, 0x06, 0x07,
  2592. 0x10, 0x11, 0x12, 0x13,
  2593. 0x14, 0x15, 0x16, 0x17));
  2594. }
  2595. static vector unsigned long long __ATTRS_o_ai
  2596. vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
  2597. return vec_perm(__a, (vector unsigned long long)__b,
  2598. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2599. 0x04, 0x05, 0x06, 0x07,
  2600. 0x10, 0x11, 0x12, 0x13,
  2601. 0x14, 0x15, 0x16, 0x17));
  2602. }
  2603. static vector unsigned long long __ATTRS_o_ai
  2604. vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
  2605. return vec_perm((vector unsigned long long)__a, __b,
  2606. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2607. 0x04, 0x05, 0x06, 0x07,
  2608. 0x10, 0x11, 0x12, 0x13,
  2609. 0x14, 0x15, 0x16, 0x17));
  2610. }
  2611. static vector double __ATTRS_o_ai vec_mergeh(vector double __a,
  2612. vector double __b) {
  2613. return vec_perm(__a, __b,
  2614. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2615. 0x04, 0x05, 0x06, 0x07,
  2616. 0x10, 0x11, 0x12, 0x13,
  2617. 0x14, 0x15, 0x16, 0x17));
  2618. }
  2619. static vector double __ATTRS_o_ai vec_mergeh(vector double __a,
  2620. vector bool long long __b) {
  2621. return vec_perm(__a, (vector double)__b,
  2622. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2623. 0x04, 0x05, 0x06, 0x07,
  2624. 0x10, 0x11, 0x12, 0x13,
  2625. 0x14, 0x15, 0x16, 0x17));
  2626. }
  2627. static vector double __ATTRS_o_ai vec_mergeh(vector bool long long __a,
  2628. vector double __b) {
  2629. return vec_perm((vector double)__a, __b,
  2630. (vector unsigned char)(0x00, 0x01, 0x02, 0x03,
  2631. 0x04, 0x05, 0x06, 0x07,
  2632. 0x10, 0x11, 0x12, 0x13,
  2633. 0x14, 0x15, 0x16, 0x17));
  2634. }
  2635. #endif
  2636. /* vec_vmrghb */
  2637. #define __builtin_altivec_vmrghb vec_vmrghb
  2638. static vector signed char __ATTRS_o_ai vec_vmrghb(vector signed char __a,
  2639. vector signed char __b) {
  2640. return vec_perm(__a, __b,
  2641. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2642. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2643. 0x06, 0x16, 0x07, 0x17));
  2644. }
  2645. static vector unsigned char __ATTRS_o_ai vec_vmrghb(vector unsigned char __a,
  2646. vector unsigned char __b) {
  2647. return vec_perm(__a, __b,
  2648. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2649. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2650. 0x06, 0x16, 0x07, 0x17));
  2651. }
  2652. static vector bool char __ATTRS_o_ai vec_vmrghb(vector bool char __a,
  2653. vector bool char __b) {
  2654. return vec_perm(__a, __b,
  2655. (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
  2656. 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
  2657. 0x06, 0x16, 0x07, 0x17));
  2658. }
  2659. /* vec_vmrghh */
  2660. #define __builtin_altivec_vmrghh vec_vmrghh
  2661. static vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
  2662. vector short __b) {
  2663. return vec_perm(__a, __b,
  2664. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2665. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2666. 0x06, 0x07, 0x16, 0x17));
  2667. }
  2668. static vector unsigned short __ATTRS_o_ai
  2669. vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
  2670. return vec_perm(__a, __b,
  2671. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2672. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2673. 0x06, 0x07, 0x16, 0x17));
  2674. }
  2675. static vector bool short __ATTRS_o_ai vec_vmrghh(vector bool short __a,
  2676. vector bool short __b) {
  2677. return vec_perm(__a, __b,
  2678. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2679. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2680. 0x06, 0x07, 0x16, 0x17));
  2681. }
  2682. static vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
  2683. vector pixel __b) {
  2684. return vec_perm(__a, __b,
  2685. (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
  2686. 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
  2687. 0x06, 0x07, 0x16, 0x17));
  2688. }
  2689. /* vec_vmrghw */
  2690. #define __builtin_altivec_vmrghw vec_vmrghw
  2691. static vector int __ATTRS_o_ai vec_vmrghw(vector int __a, vector int __b) {
  2692. return vec_perm(__a, __b,
  2693. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2694. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2695. 0x14, 0x15, 0x16, 0x17));
  2696. }
  2697. static vector unsigned int __ATTRS_o_ai vec_vmrghw(vector unsigned int __a,
  2698. vector unsigned int __b) {
  2699. return vec_perm(__a, __b,
  2700. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2701. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2702. 0x14, 0x15, 0x16, 0x17));
  2703. }
  2704. static vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
  2705. vector bool int __b) {
  2706. return vec_perm(__a, __b,
  2707. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2708. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2709. 0x14, 0x15, 0x16, 0x17));
  2710. }
  2711. static vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
  2712. vector float __b) {
  2713. return vec_perm(__a, __b,
  2714. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
  2715. 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
  2716. 0x14, 0x15, 0x16, 0x17));
  2717. }
  2718. /* vec_mergel */
  2719. static vector signed char __ATTRS_o_ai vec_mergel(vector signed char __a,
  2720. vector signed char __b) {
  2721. return vec_perm(__a, __b,
  2722. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2723. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2724. 0x0E, 0x1E, 0x0F, 0x1F));
  2725. }
  2726. static vector unsigned char __ATTRS_o_ai vec_mergel(vector unsigned char __a,
  2727. vector unsigned char __b) {
  2728. return vec_perm(__a, __b,
  2729. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2730. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2731. 0x0E, 0x1E, 0x0F, 0x1F));
  2732. }
  2733. static vector bool char __ATTRS_o_ai vec_mergel(vector bool char __a,
  2734. vector bool char __b) {
  2735. return vec_perm(__a, __b,
  2736. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2737. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2738. 0x0E, 0x1E, 0x0F, 0x1F));
  2739. }
  2740. static vector short __ATTRS_o_ai vec_mergel(vector short __a,
  2741. vector short __b) {
  2742. return vec_perm(__a, __b,
  2743. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2744. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2745. 0x0E, 0x0F, 0x1E, 0x1F));
  2746. }
  2747. static vector unsigned short __ATTRS_o_ai
  2748. vec_mergel(vector unsigned short __a, vector unsigned short __b) {
  2749. return vec_perm(__a, __b,
  2750. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2751. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2752. 0x0E, 0x0F, 0x1E, 0x1F));
  2753. }
  2754. static vector bool short __ATTRS_o_ai vec_mergel(vector bool short __a,
  2755. vector bool short __b) {
  2756. return vec_perm(__a, __b,
  2757. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2758. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2759. 0x0E, 0x0F, 0x1E, 0x1F));
  2760. }
  2761. static vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
  2762. vector pixel __b) {
  2763. return vec_perm(__a, __b,
  2764. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2765. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2766. 0x0E, 0x0F, 0x1E, 0x1F));
  2767. }
  2768. static vector int __ATTRS_o_ai vec_mergel(vector int __a, vector int __b) {
  2769. return vec_perm(__a, __b,
  2770. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2771. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2772. 0x1C, 0x1D, 0x1E, 0x1F));
  2773. }
  2774. static vector unsigned int __ATTRS_o_ai vec_mergel(vector unsigned int __a,
  2775. vector unsigned int __b) {
  2776. return vec_perm(__a, __b,
  2777. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2778. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2779. 0x1C, 0x1D, 0x1E, 0x1F));
  2780. }
  2781. static vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
  2782. vector bool int __b) {
  2783. return vec_perm(__a, __b,
  2784. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2785. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2786. 0x1C, 0x1D, 0x1E, 0x1F));
  2787. }
  2788. static vector float __ATTRS_o_ai vec_mergel(vector float __a,
  2789. vector float __b) {
  2790. return vec_perm(__a, __b,
  2791. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2792. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2793. 0x1C, 0x1D, 0x1E, 0x1F));
  2794. }
  2795. #ifdef __VSX__
  2796. static vector signed long long __ATTRS_o_ai
  2797. vec_mergel(vector signed long long __a, vector signed long long __b) {
  2798. return vec_perm(__a, __b,
  2799. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2800. 0x0C, 0x0D, 0x0E, 0x0F,
  2801. 0x18, 0X19, 0x1A, 0x1B,
  2802. 0x1C, 0x1D, 0x1E, 0x1F));
  2803. }
  2804. static vector signed long long __ATTRS_o_ai
  2805. vec_mergel(vector signed long long __a, vector bool long long __b) {
  2806. return vec_perm(__a, (vector signed long long)__b,
  2807. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2808. 0x0C, 0x0D, 0x0E, 0x0F,
  2809. 0x18, 0X19, 0x1A, 0x1B,
  2810. 0x1C, 0x1D, 0x1E, 0x1F));
  2811. }
  2812. static vector signed long long __ATTRS_o_ai
  2813. vec_mergel(vector bool long long __a, vector signed long long __b) {
  2814. return vec_perm((vector signed long long)__a, __b,
  2815. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2816. 0x0C, 0x0D, 0x0E, 0x0F,
  2817. 0x18, 0X19, 0x1A, 0x1B,
  2818. 0x1C, 0x1D, 0x1E, 0x1F));
  2819. }
  2820. static vector unsigned long long __ATTRS_o_ai
  2821. vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
  2822. return vec_perm(__a, __b,
  2823. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2824. 0x0C, 0x0D, 0x0E, 0x0F,
  2825. 0x18, 0X19, 0x1A, 0x1B,
  2826. 0x1C, 0x1D, 0x1E, 0x1F));
  2827. }
  2828. static vector unsigned long long __ATTRS_o_ai
  2829. vec_mergel(vector unsigned long long __a, vector bool long long __b) {
  2830. return vec_perm(__a, (vector unsigned long long)__b,
  2831. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2832. 0x0C, 0x0D, 0x0E, 0x0F,
  2833. 0x18, 0X19, 0x1A, 0x1B,
  2834. 0x1C, 0x1D, 0x1E, 0x1F));
  2835. }
  2836. static vector unsigned long long __ATTRS_o_ai
  2837. vec_mergel(vector bool long long __a, vector unsigned long long __b) {
  2838. return vec_perm((vector unsigned long long)__a, __b,
  2839. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2840. 0x0C, 0x0D, 0x0E, 0x0F,
  2841. 0x18, 0X19, 0x1A, 0x1B,
  2842. 0x1C, 0x1D, 0x1E, 0x1F));
  2843. }
  2844. static vector double __ATTRS_o_ai
  2845. vec_mergel(vector double __a, vector double __b) {
  2846. return vec_perm(__a, __b,
  2847. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2848. 0x0C, 0x0D, 0x0E, 0x0F,
  2849. 0x18, 0X19, 0x1A, 0x1B,
  2850. 0x1C, 0x1D, 0x1E, 0x1F));
  2851. }
  2852. static vector double __ATTRS_o_ai
  2853. vec_mergel(vector double __a, vector bool long long __b) {
  2854. return vec_perm(__a, (vector double)__b,
  2855. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2856. 0x0C, 0x0D, 0x0E, 0x0F,
  2857. 0x18, 0X19, 0x1A, 0x1B,
  2858. 0x1C, 0x1D, 0x1E, 0x1F));
  2859. }
  2860. static vector double __ATTRS_o_ai
  2861. vec_mergel(vector bool long long __a, vector double __b) {
  2862. return vec_perm((vector double)__a, __b,
  2863. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B,
  2864. 0x0C, 0x0D, 0x0E, 0x0F,
  2865. 0x18, 0X19, 0x1A, 0x1B,
  2866. 0x1C, 0x1D, 0x1E, 0x1F));
  2867. }
  2868. #endif
  2869. /* vec_vmrglb */
  2870. #define __builtin_altivec_vmrglb vec_vmrglb
  2871. static vector signed char __ATTRS_o_ai vec_vmrglb(vector signed char __a,
  2872. vector signed char __b) {
  2873. return vec_perm(__a, __b,
  2874. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2875. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2876. 0x0E, 0x1E, 0x0F, 0x1F));
  2877. }
  2878. static vector unsigned char __ATTRS_o_ai vec_vmrglb(vector unsigned char __a,
  2879. vector unsigned char __b) {
  2880. return vec_perm(__a, __b,
  2881. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2882. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2883. 0x0E, 0x1E, 0x0F, 0x1F));
  2884. }
  2885. static vector bool char __ATTRS_o_ai vec_vmrglb(vector bool char __a,
  2886. vector bool char __b) {
  2887. return vec_perm(__a, __b,
  2888. (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
  2889. 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
  2890. 0x0E, 0x1E, 0x0F, 0x1F));
  2891. }
  2892. /* vec_vmrglh */
  2893. #define __builtin_altivec_vmrglh vec_vmrglh
  2894. static vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
  2895. vector short __b) {
  2896. return vec_perm(__a, __b,
  2897. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2898. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2899. 0x0E, 0x0F, 0x1E, 0x1F));
  2900. }
  2901. static vector unsigned short __ATTRS_o_ai
  2902. vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
  2903. return vec_perm(__a, __b,
  2904. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2905. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2906. 0x0E, 0x0F, 0x1E, 0x1F));
  2907. }
  2908. static vector bool short __ATTRS_o_ai vec_vmrglh(vector bool short __a,
  2909. vector bool short __b) {
  2910. return vec_perm(__a, __b,
  2911. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2912. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2913. 0x0E, 0x0F, 0x1E, 0x1F));
  2914. }
  2915. static vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
  2916. vector pixel __b) {
  2917. return vec_perm(__a, __b,
  2918. (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
  2919. 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
  2920. 0x0E, 0x0F, 0x1E, 0x1F));
  2921. }
  2922. /* vec_vmrglw */
  2923. #define __builtin_altivec_vmrglw vec_vmrglw
  2924. static vector int __ATTRS_o_ai vec_vmrglw(vector int __a, vector int __b) {
  2925. return vec_perm(__a, __b,
  2926. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2927. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2928. 0x1C, 0x1D, 0x1E, 0x1F));
  2929. }
  2930. static vector unsigned int __ATTRS_o_ai vec_vmrglw(vector unsigned int __a,
  2931. vector unsigned int __b) {
  2932. return vec_perm(__a, __b,
  2933. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2934. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2935. 0x1C, 0x1D, 0x1E, 0x1F));
  2936. }
  2937. static vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
  2938. vector bool int __b) {
  2939. return vec_perm(__a, __b,
  2940. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2941. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2942. 0x1C, 0x1D, 0x1E, 0x1F));
  2943. }
  2944. static vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
  2945. vector float __b) {
  2946. return vec_perm(__a, __b,
  2947. (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
  2948. 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
  2949. 0x1C, 0x1D, 0x1E, 0x1F));
  2950. }
  2951. #ifdef __POWER8_VECTOR__
  2952. /* vec_mergee */
  2953. static vector bool int __ATTRS_o_ai
  2954. vec_mergee(vector bool int __a, vector bool int __b) {
  2955. return vec_perm(__a, __b, (vector unsigned char)
  2956. (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
  2957. 0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B));
  2958. }
  2959. static vector signed int __ATTRS_o_ai
  2960. vec_mergee(vector signed int __a, vector signed int __b) {
  2961. return vec_perm(__a, __b, (vector unsigned char)
  2962. (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
  2963. 0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B));
  2964. }
  2965. static vector unsigned int __ATTRS_o_ai
  2966. vec_mergee(vector unsigned int __a, vector unsigned int __b) {
  2967. return vec_perm(__a, __b, (vector unsigned char)
  2968. (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
  2969. 0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B));
  2970. }
  2971. /* vec_mergeo */
  2972. static vector bool int __ATTRS_o_ai
  2973. vec_mergeo(vector bool int __a, vector bool int __b) {
  2974. return vec_perm(__a, __b, (vector unsigned char)
  2975. (0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17,
  2976. 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
  2977. }
  2978. static vector signed int __ATTRS_o_ai
  2979. vec_mergeo(vector signed int __a, vector signed int __b) {
  2980. return vec_perm(__a, __b, (vector unsigned char)
  2981. (0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17,
  2982. 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
  2983. }
  2984. static vector unsigned int __ATTRS_o_ai
  2985. vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
  2986. return vec_perm(__a, __b, (vector unsigned char)
  2987. (0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17,
  2988. 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
  2989. }
  2990. #endif
  2991. /* vec_mfvscr */
  2992. static vector unsigned short __attribute__((__always_inline__))
  2993. vec_mfvscr(void) {
  2994. return __builtin_altivec_mfvscr();
  2995. }
  2996. /* vec_min */
  2997. static vector signed char __ATTRS_o_ai vec_min(vector signed char __a,
  2998. vector signed char __b) {
  2999. return __builtin_altivec_vminsb(__a, __b);
  3000. }
  3001. static vector signed char __ATTRS_o_ai vec_min(vector bool char __a,
  3002. vector signed char __b) {
  3003. return __builtin_altivec_vminsb((vector signed char)__a, __b);
  3004. }
  3005. static vector signed char __ATTRS_o_ai vec_min(vector signed char __a,
  3006. vector bool char __b) {
  3007. return __builtin_altivec_vminsb(__a, (vector signed char)__b);
  3008. }
  3009. static vector unsigned char __ATTRS_o_ai vec_min(vector unsigned char __a,
  3010. vector unsigned char __b) {
  3011. return __builtin_altivec_vminub(__a, __b);
  3012. }
  3013. static vector unsigned char __ATTRS_o_ai vec_min(vector bool char __a,
  3014. vector unsigned char __b) {
  3015. return __builtin_altivec_vminub((vector unsigned char)__a, __b);
  3016. }
  3017. static vector unsigned char __ATTRS_o_ai vec_min(vector unsigned char __a,
  3018. vector bool char __b) {
  3019. return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
  3020. }
  3021. static vector short __ATTRS_o_ai vec_min(vector short __a, vector short __b) {
  3022. return __builtin_altivec_vminsh(__a, __b);
  3023. }
  3024. static vector short __ATTRS_o_ai vec_min(vector bool short __a,
  3025. vector short __b) {
  3026. return __builtin_altivec_vminsh((vector short)__a, __b);
  3027. }
  3028. static vector short __ATTRS_o_ai vec_min(vector short __a,
  3029. vector bool short __b) {
  3030. return __builtin_altivec_vminsh(__a, (vector short)__b);
  3031. }
  3032. static vector unsigned short __ATTRS_o_ai vec_min(vector unsigned short __a,
  3033. vector unsigned short __b) {
  3034. return __builtin_altivec_vminuh(__a, __b);
  3035. }
  3036. static vector unsigned short __ATTRS_o_ai vec_min(vector bool short __a,
  3037. vector unsigned short __b) {
  3038. return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
  3039. }
  3040. static vector unsigned short __ATTRS_o_ai vec_min(vector unsigned short __a,
  3041. vector bool short __b) {
  3042. return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
  3043. }
  3044. static vector int __ATTRS_o_ai vec_min(vector int __a, vector int __b) {
  3045. return __builtin_altivec_vminsw(__a, __b);
  3046. }
  3047. static vector int __ATTRS_o_ai vec_min(vector bool int __a, vector int __b) {
  3048. return __builtin_altivec_vminsw((vector int)__a, __b);
  3049. }
  3050. static vector int __ATTRS_o_ai vec_min(vector int __a, vector bool int __b) {
  3051. return __builtin_altivec_vminsw(__a, (vector int)__b);
  3052. }
  3053. static vector unsigned int __ATTRS_o_ai vec_min(vector unsigned int __a,
  3054. vector unsigned int __b) {
  3055. return __builtin_altivec_vminuw(__a, __b);
  3056. }
  3057. static vector unsigned int __ATTRS_o_ai vec_min(vector bool int __a,
  3058. vector unsigned int __b) {
  3059. return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
  3060. }
  3061. static vector unsigned int __ATTRS_o_ai vec_min(vector unsigned int __a,
  3062. vector bool int __b) {
  3063. return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
  3064. }
  3065. #ifdef __POWER8_VECTOR__
  3066. static vector signed long long __ATTRS_o_ai
  3067. vec_min(vector signed long long __a, vector signed long long __b) {
  3068. return __builtin_altivec_vminsd(__a, __b);
  3069. }
  3070. static vector signed long long __ATTRS_o_ai
  3071. vec_min(vector bool long long __a, vector signed long long __b) {
  3072. return __builtin_altivec_vminsd((vector signed long long)__a, __b);
  3073. }
  3074. static vector signed long long __ATTRS_o_ai vec_min(vector signed long long __a,
  3075. vector bool long long __b) {
  3076. return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
  3077. }
  3078. static vector unsigned long long __ATTRS_o_ai
  3079. vec_min(vector unsigned long long __a, vector unsigned long long __b) {
  3080. return __builtin_altivec_vminud(__a, __b);
  3081. }
  3082. static vector unsigned long long __ATTRS_o_ai
  3083. vec_min(vector bool long long __a, vector unsigned long long __b) {
  3084. return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
  3085. }
  3086. static vector unsigned long long __ATTRS_o_ai
  3087. vec_min(vector unsigned long long __a, vector bool long long __b) {
  3088. return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
  3089. }
  3090. #endif
  3091. static vector float __ATTRS_o_ai vec_min(vector float __a, vector float __b) {
  3092. #ifdef __VSX__
  3093. return __builtin_vsx_xvminsp(__a, __b);
  3094. #else
  3095. return __builtin_altivec_vminfp(__a, __b);
  3096. #endif
  3097. }
  3098. #ifdef __VSX__
  3099. static vector double __ATTRS_o_ai vec_min(vector double __a,
  3100. vector double __b) {
  3101. return __builtin_vsx_xvmindp(__a, __b);
  3102. }
  3103. #endif
  3104. /* vec_vminsb */
  3105. static vector signed char __ATTRS_o_ai vec_vminsb(vector signed char __a,
  3106. vector signed char __b) {
  3107. return __builtin_altivec_vminsb(__a, __b);
  3108. }
  3109. static vector signed char __ATTRS_o_ai vec_vminsb(vector bool char __a,
  3110. vector signed char __b) {
  3111. return __builtin_altivec_vminsb((vector signed char)__a, __b);
  3112. }
  3113. static vector signed char __ATTRS_o_ai vec_vminsb(vector signed char __a,
  3114. vector bool char __b) {
  3115. return __builtin_altivec_vminsb(__a, (vector signed char)__b);
  3116. }
  3117. /* vec_vminub */
  3118. static vector unsigned char __ATTRS_o_ai vec_vminub(vector unsigned char __a,
  3119. vector unsigned char __b) {
  3120. return __builtin_altivec_vminub(__a, __b);
  3121. }
  3122. static vector unsigned char __ATTRS_o_ai vec_vminub(vector bool char __a,
  3123. vector unsigned char __b) {
  3124. return __builtin_altivec_vminub((vector unsigned char)__a, __b);
  3125. }
  3126. static vector unsigned char __ATTRS_o_ai vec_vminub(vector unsigned char __a,
  3127. vector bool char __b) {
  3128. return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
  3129. }
  3130. /* vec_vminsh */
  3131. static vector short __ATTRS_o_ai vec_vminsh(vector short __a,
  3132. vector short __b) {
  3133. return __builtin_altivec_vminsh(__a, __b);
  3134. }
  3135. static vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
  3136. vector short __b) {
  3137. return __builtin_altivec_vminsh((vector short)__a, __b);
  3138. }
  3139. static vector short __ATTRS_o_ai vec_vminsh(vector short __a,
  3140. vector bool short __b) {
  3141. return __builtin_altivec_vminsh(__a, (vector short)__b);
  3142. }
  3143. /* vec_vminuh */
  3144. static vector unsigned short __ATTRS_o_ai
  3145. vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
  3146. return __builtin_altivec_vminuh(__a, __b);
  3147. }
  3148. static vector unsigned short __ATTRS_o_ai
  3149. vec_vminuh(vector bool short __a, vector unsigned short __b) {
  3150. return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
  3151. }
  3152. static vector unsigned short __ATTRS_o_ai vec_vminuh(vector unsigned short __a,
  3153. vector bool short __b) {
  3154. return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
  3155. }
  3156. /* vec_vminsw */
  3157. static vector int __ATTRS_o_ai vec_vminsw(vector int __a, vector int __b) {
  3158. return __builtin_altivec_vminsw(__a, __b);
  3159. }
  3160. static vector int __ATTRS_o_ai vec_vminsw(vector bool int __a, vector int __b) {
  3161. return __builtin_altivec_vminsw((vector int)__a, __b);
  3162. }
  3163. static vector int __ATTRS_o_ai vec_vminsw(vector int __a, vector bool int __b) {
  3164. return __builtin_altivec_vminsw(__a, (vector int)__b);
  3165. }
  3166. /* vec_vminuw */
  3167. static vector unsigned int __ATTRS_o_ai vec_vminuw(vector unsigned int __a,
  3168. vector unsigned int __b) {
  3169. return __builtin_altivec_vminuw(__a, __b);
  3170. }
  3171. static vector unsigned int __ATTRS_o_ai vec_vminuw(vector bool int __a,
  3172. vector unsigned int __b) {
  3173. return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
  3174. }
  3175. static vector unsigned int __ATTRS_o_ai vec_vminuw(vector unsigned int __a,
  3176. vector bool int __b) {
  3177. return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
  3178. }
  3179. /* vec_vminfp */
  3180. static vector float __attribute__((__always_inline__))
  3181. vec_vminfp(vector float __a, vector float __b) {
  3182. #ifdef __VSX__
  3183. return __builtin_vsx_xvminsp(__a, __b);
  3184. #else
  3185. return __builtin_altivec_vminfp(__a, __b);
  3186. #endif
  3187. }
  3188. /* vec_mladd */
  3189. #define __builtin_altivec_vmladduhm vec_mladd
  3190. static vector short __ATTRS_o_ai vec_mladd(vector short __a, vector short __b,
  3191. vector short __c) {
  3192. return __a * __b + __c;
  3193. }
  3194. static vector short __ATTRS_o_ai vec_mladd(vector short __a,
  3195. vector unsigned short __b,
  3196. vector unsigned short __c) {
  3197. return __a * (vector short)__b + (vector short)__c;
  3198. }
  3199. static vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
  3200. vector short __b, vector short __c) {
  3201. return (vector short)__a * __b + __c;
  3202. }
  3203. static vector unsigned short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
  3204. vector unsigned short __b,
  3205. vector unsigned short __c) {
  3206. return __a * __b + __c;
  3207. }
  3208. /* vec_vmladduhm */
  3209. static vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
  3210. vector short __b,
  3211. vector short __c) {
  3212. return __a * __b + __c;
  3213. }
  3214. static vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
  3215. vector unsigned short __b,
  3216. vector unsigned short __c) {
  3217. return __a * (vector short)__b + (vector short)__c;
  3218. }
  3219. static vector short __ATTRS_o_ai vec_vmladduhm(vector unsigned short __a,
  3220. vector short __b,
  3221. vector short __c) {
  3222. return (vector short)__a * __b + __c;
  3223. }
  3224. static vector unsigned short __ATTRS_o_ai
  3225. vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
  3226. vector unsigned short __c) {
  3227. return __a * __b + __c;
  3228. }
  3229. /* vec_mradds */
  3230. static vector short __attribute__((__always_inline__))
  3231. vec_mradds(vector short __a, vector short __b, vector short __c) {
  3232. return __builtin_altivec_vmhraddshs(__a, __b, __c);
  3233. }
  3234. /* vec_vmhraddshs */
  3235. static vector short __attribute__((__always_inline__))
  3236. vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
  3237. return __builtin_altivec_vmhraddshs(__a, __b, __c);
  3238. }
  3239. /* vec_msum */
  3240. static vector int __ATTRS_o_ai vec_msum(vector signed char __a,
  3241. vector unsigned char __b,
  3242. vector int __c) {
  3243. return __builtin_altivec_vmsummbm(__a, __b, __c);
  3244. }
  3245. static vector unsigned int __ATTRS_o_ai vec_msum(vector unsigned char __a,
  3246. vector unsigned char __b,
  3247. vector unsigned int __c) {
  3248. return __builtin_altivec_vmsumubm(__a, __b, __c);
  3249. }
  3250. static vector int __ATTRS_o_ai vec_msum(vector short __a, vector short __b,
  3251. vector int __c) {
  3252. return __builtin_altivec_vmsumshm(__a, __b, __c);
  3253. }
  3254. static vector unsigned int __ATTRS_o_ai vec_msum(vector unsigned short __a,
  3255. vector unsigned short __b,
  3256. vector unsigned int __c) {
  3257. return __builtin_altivec_vmsumuhm(__a, __b, __c);
  3258. }
  3259. /* vec_vmsummbm */
  3260. static vector int __attribute__((__always_inline__))
  3261. vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
  3262. return __builtin_altivec_vmsummbm(__a, __b, __c);
  3263. }
  3264. /* vec_vmsumubm */
  3265. static vector unsigned int __attribute__((__always_inline__))
  3266. vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
  3267. vector unsigned int __c) {
  3268. return __builtin_altivec_vmsumubm(__a, __b, __c);
  3269. }
  3270. /* vec_vmsumshm */
  3271. static vector int __attribute__((__always_inline__))
  3272. vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
  3273. return __builtin_altivec_vmsumshm(__a, __b, __c);
  3274. }
  3275. /* vec_vmsumuhm */
  3276. static vector unsigned int __attribute__((__always_inline__))
  3277. vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
  3278. vector unsigned int __c) {
  3279. return __builtin_altivec_vmsumuhm(__a, __b, __c);
  3280. }
  3281. /* vec_msums */
  3282. static vector int __ATTRS_o_ai vec_msums(vector short __a, vector short __b,
  3283. vector int __c) {
  3284. return __builtin_altivec_vmsumshs(__a, __b, __c);
  3285. }
  3286. static vector unsigned int __ATTRS_o_ai vec_msums(vector unsigned short __a,
  3287. vector unsigned short __b,
  3288. vector unsigned int __c) {
  3289. return __builtin_altivec_vmsumuhs(__a, __b, __c);
  3290. }
  3291. /* vec_vmsumshs */
  3292. static vector int __attribute__((__always_inline__))
  3293. vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
  3294. return __builtin_altivec_vmsumshs(__a, __b, __c);
  3295. }
  3296. /* vec_vmsumuhs */
  3297. static vector unsigned int __attribute__((__always_inline__))
  3298. vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
  3299. vector unsigned int __c) {
  3300. return __builtin_altivec_vmsumuhs(__a, __b, __c);
  3301. }
  3302. /* vec_mtvscr */
  3303. static void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
  3304. __builtin_altivec_mtvscr((vector int)__a);
  3305. }
  3306. static void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
  3307. __builtin_altivec_mtvscr((vector int)__a);
  3308. }
  3309. static void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
  3310. __builtin_altivec_mtvscr((vector int)__a);
  3311. }
  3312. static void __ATTRS_o_ai vec_mtvscr(vector short __a) {
  3313. __builtin_altivec_mtvscr((vector int)__a);
  3314. }
  3315. static void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
  3316. __builtin_altivec_mtvscr((vector int)__a);
  3317. }
  3318. static void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
  3319. __builtin_altivec_mtvscr((vector int)__a);
  3320. }
  3321. static void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
  3322. __builtin_altivec_mtvscr((vector int)__a);
  3323. }
  3324. static void __ATTRS_o_ai vec_mtvscr(vector int __a) {
  3325. __builtin_altivec_mtvscr((vector int)__a);
  3326. }
  3327. static void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
  3328. __builtin_altivec_mtvscr((vector int)__a);
  3329. }
  3330. static void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
  3331. __builtin_altivec_mtvscr((vector int)__a);
  3332. }
  3333. static void __ATTRS_o_ai vec_mtvscr(vector float __a) {
  3334. __builtin_altivec_mtvscr((vector int)__a);
  3335. }
  3336. /* vec_mul */
  3337. /* Integer vector multiplication will involve multiplication of the odd/even
  3338. elements separately, then truncating the results and moving to the
  3339. result vector.
  3340. */
  3341. static vector signed char __ATTRS_o_ai vec_mul(vector signed char __a,
  3342. vector signed char __b) {
  3343. return __a * __b;
  3344. }
  3345. static vector unsigned char __ATTRS_o_ai vec_mul(vector unsigned char __a,
  3346. vector unsigned char __b) {
  3347. return __a * __b;
  3348. }
  3349. static vector signed short __ATTRS_o_ai vec_mul(vector signed short __a,
  3350. vector signed short __b) {
  3351. return __a * __b;
  3352. }
  3353. static vector unsigned short __ATTRS_o_ai vec_mul(vector unsigned short __a,
  3354. vector unsigned short __b) {
  3355. return __a * __b;
  3356. }
  3357. static vector signed int __ATTRS_o_ai vec_mul(vector signed int __a,
  3358. vector signed int __b) {
  3359. return __a * __b;
  3360. }
  3361. static vector unsigned int __ATTRS_o_ai vec_mul(vector unsigned int __a,
  3362. vector unsigned int __b) {
  3363. return __a * __b;
  3364. }
  3365. #ifdef __VSX__
  3366. static vector signed long long __ATTRS_o_ai
  3367. vec_mul(vector signed long long __a, vector signed long long __b) {
  3368. return __a * __b;
  3369. }
  3370. static vector unsigned long long __ATTRS_o_ai
  3371. vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
  3372. return __a * __b;
  3373. }
  3374. #endif
  3375. static vector float __ATTRS_o_ai vec_mul(vector float __a, vector float __b) {
  3376. return __a * __b;
  3377. }
  3378. #ifdef __VSX__
  3379. static vector double __ATTRS_o_ai
  3380. vec_mul(vector double __a, vector double __b) {
  3381. return __a * __b;
  3382. }
  3383. #endif
  3384. /* The vmulos* and vmules* instructions have a big endian bias, so
  3385. we must reverse the meaning of "even" and "odd" for little endian. */
  3386. /* vec_mule */
  3387. static vector short __ATTRS_o_ai vec_mule(vector signed char __a,
  3388. vector signed char __b) {
  3389. #ifdef __LITTLE_ENDIAN__
  3390. return __builtin_altivec_vmulosb(__a, __b);
  3391. #else
  3392. return __builtin_altivec_vmulesb(__a, __b);
  3393. #endif
  3394. }
  3395. static vector unsigned short __ATTRS_o_ai vec_mule(vector unsigned char __a,
  3396. vector unsigned char __b) {
  3397. #ifdef __LITTLE_ENDIAN__
  3398. return __builtin_altivec_vmuloub(__a, __b);
  3399. #else
  3400. return __builtin_altivec_vmuleub(__a, __b);
  3401. #endif
  3402. }
  3403. static vector int __ATTRS_o_ai vec_mule(vector short __a, vector short __b) {
  3404. #ifdef __LITTLE_ENDIAN__
  3405. return __builtin_altivec_vmulosh(__a, __b);
  3406. #else
  3407. return __builtin_altivec_vmulesh(__a, __b);
  3408. #endif
  3409. }
  3410. static vector unsigned int __ATTRS_o_ai vec_mule(vector unsigned short __a,
  3411. vector unsigned short __b) {
  3412. #ifdef __LITTLE_ENDIAN__
  3413. return __builtin_altivec_vmulouh(__a, __b);
  3414. #else
  3415. return __builtin_altivec_vmuleuh(__a, __b);
  3416. #endif
  3417. }
  3418. #ifdef __POWER8_VECTOR__
  3419. static vector signed long long __ATTRS_o_ai vec_mule(vector signed int __a,
  3420. vector signed int __b) {
  3421. #ifdef __LITTLE_ENDIAN__
  3422. return __builtin_altivec_vmulosw(__a, __b);
  3423. #else
  3424. return __builtin_altivec_vmulesw(__a, __b);
  3425. #endif
  3426. }
  3427. static vector unsigned long long __ATTRS_o_ai
  3428. vec_mule(vector unsigned int __a, vector unsigned int __b) {
  3429. #ifdef __LITTLE_ENDIAN__
  3430. return __builtin_altivec_vmulouw(__a, __b);
  3431. #else
  3432. return __builtin_altivec_vmuleuw(__a, __b);
  3433. #endif
  3434. }
  3435. #endif
  3436. /* vec_vmulesb */
  3437. static vector short __attribute__((__always_inline__))
  3438. vec_vmulesb(vector signed char __a, vector signed char __b) {
  3439. #ifdef __LITTLE_ENDIAN__
  3440. return __builtin_altivec_vmulosb(__a, __b);
  3441. #else
  3442. return __builtin_altivec_vmulesb(__a, __b);
  3443. #endif
  3444. }
  3445. /* vec_vmuleub */
  3446. static vector unsigned short __attribute__((__always_inline__))
  3447. vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
  3448. #ifdef __LITTLE_ENDIAN__
  3449. return __builtin_altivec_vmuloub(__a, __b);
  3450. #else
  3451. return __builtin_altivec_vmuleub(__a, __b);
  3452. #endif
  3453. }
  3454. /* vec_vmulesh */
  3455. static vector int __attribute__((__always_inline__))
  3456. vec_vmulesh(vector short __a, vector short __b) {
  3457. #ifdef __LITTLE_ENDIAN__
  3458. return __builtin_altivec_vmulosh(__a, __b);
  3459. #else
  3460. return __builtin_altivec_vmulesh(__a, __b);
  3461. #endif
  3462. }
  3463. /* vec_vmuleuh */
  3464. static vector unsigned int __attribute__((__always_inline__))
  3465. vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
  3466. #ifdef __LITTLE_ENDIAN__
  3467. return __builtin_altivec_vmulouh(__a, __b);
  3468. #else
  3469. return __builtin_altivec_vmuleuh(__a, __b);
  3470. #endif
  3471. }
  3472. /* vec_mulo */
  3473. static vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
  3474. vector signed char __b) {
  3475. #ifdef __LITTLE_ENDIAN__
  3476. return __builtin_altivec_vmulesb(__a, __b);
  3477. #else
  3478. return __builtin_altivec_vmulosb(__a, __b);
  3479. #endif
  3480. }
  3481. static vector unsigned short __ATTRS_o_ai vec_mulo(vector unsigned char __a,
  3482. vector unsigned char __b) {
  3483. #ifdef __LITTLE_ENDIAN__
  3484. return __builtin_altivec_vmuleub(__a, __b);
  3485. #else
  3486. return __builtin_altivec_vmuloub(__a, __b);
  3487. #endif
  3488. }
  3489. static vector int __ATTRS_o_ai vec_mulo(vector short __a, vector short __b) {
  3490. #ifdef __LITTLE_ENDIAN__
  3491. return __builtin_altivec_vmulesh(__a, __b);
  3492. #else
  3493. return __builtin_altivec_vmulosh(__a, __b);
  3494. #endif
  3495. }
  3496. static vector unsigned int __ATTRS_o_ai vec_mulo(vector unsigned short __a,
  3497. vector unsigned short __b) {
  3498. #ifdef __LITTLE_ENDIAN__
  3499. return __builtin_altivec_vmuleuh(__a, __b);
  3500. #else
  3501. return __builtin_altivec_vmulouh(__a, __b);
  3502. #endif
  3503. }
  3504. #ifdef __POWER8_VECTOR__
  3505. static vector signed long long __ATTRS_o_ai vec_mulo(vector signed int __a,
  3506. vector signed int __b) {
  3507. #ifdef __LITTLE_ENDIAN__
  3508. return __builtin_altivec_vmulesw(__a, __b);
  3509. #else
  3510. return __builtin_altivec_vmulosw(__a, __b);
  3511. #endif
  3512. }
  3513. static vector unsigned long long __ATTRS_o_ai
  3514. vec_mulo(vector unsigned int __a, vector unsigned int __b) {
  3515. #ifdef __LITTLE_ENDIAN__
  3516. return __builtin_altivec_vmuleuw(__a, __b);
  3517. #else
  3518. return __builtin_altivec_vmulouw(__a, __b);
  3519. #endif
  3520. }
  3521. #endif
  3522. /* vec_vmulosb */
  3523. static vector short __attribute__((__always_inline__))
  3524. vec_vmulosb(vector signed char __a, vector signed char __b) {
  3525. #ifdef __LITTLE_ENDIAN__
  3526. return __builtin_altivec_vmulesb(__a, __b);
  3527. #else
  3528. return __builtin_altivec_vmulosb(__a, __b);
  3529. #endif
  3530. }
  3531. /* vec_vmuloub */
  3532. static vector unsigned short __attribute__((__always_inline__))
  3533. vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
  3534. #ifdef __LITTLE_ENDIAN__
  3535. return __builtin_altivec_vmuleub(__a, __b);
  3536. #else
  3537. return __builtin_altivec_vmuloub(__a, __b);
  3538. #endif
  3539. }
  3540. /* vec_vmulosh */
  3541. static vector int __attribute__((__always_inline__))
  3542. vec_vmulosh(vector short __a, vector short __b) {
  3543. #ifdef __LITTLE_ENDIAN__
  3544. return __builtin_altivec_vmulesh(__a, __b);
  3545. #else
  3546. return __builtin_altivec_vmulosh(__a, __b);
  3547. #endif
  3548. }
  3549. /* vec_vmulouh */
  3550. static vector unsigned int __attribute__((__always_inline__))
  3551. vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
  3552. #ifdef __LITTLE_ENDIAN__
  3553. return __builtin_altivec_vmuleuh(__a, __b);
  3554. #else
  3555. return __builtin_altivec_vmulouh(__a, __b);
  3556. #endif
  3557. }
  3558. /* vec_nand */
  3559. #ifdef __POWER8_VECTOR__
  3560. static vector signed char __ATTRS_o_ai vec_nand(vector signed char __a,
  3561. vector signed char __b) {
  3562. return ~(__a & __b);
  3563. }
  3564. static vector signed char __ATTRS_o_ai vec_nand(vector signed char __a,
  3565. vector bool char __b) {
  3566. return ~(__a & __b);
  3567. }
  3568. static vector signed char __ATTRS_o_ai vec_nand(vector bool char __a,
  3569. vector signed char __b) {
  3570. return ~(__a & __b);
  3571. }
  3572. static vector unsigned char __ATTRS_o_ai vec_nand(vector unsigned char __a,
  3573. vector unsigned char __b) {
  3574. return ~(__a & __b);
  3575. }
  3576. static vector unsigned char __ATTRS_o_ai vec_nand(vector unsigned char __a,
  3577. vector bool char __b) {
  3578. return ~(__a & __b);
  3579. }
  3580. static vector unsigned char __ATTRS_o_ai vec_nand(vector bool char __a,
  3581. vector unsigned char __b) {
  3582. return ~(__a & __b);
  3583. }
  3584. static vector signed short __ATTRS_o_ai vec_nand(vector signed short __a,
  3585. vector signed short __b) {
  3586. return ~(__a & __b);
  3587. }
  3588. static vector signed short __ATTRS_o_ai vec_nand(vector signed short __a,
  3589. vector bool short __b) {
  3590. return ~(__a & __b);
  3591. }
  3592. static vector signed short __ATTRS_o_ai vec_nand(vector bool short __a,
  3593. vector signed short __b) {
  3594. return ~(__a & __b);
  3595. }
  3596. static vector unsigned short __ATTRS_o_ai vec_nand(vector unsigned short __a,
  3597. vector unsigned short __b) {
  3598. return ~(__a & __b);
  3599. }
  3600. static vector unsigned short __ATTRS_o_ai vec_nand(vector unsigned short __a,
  3601. vector bool short __b) {
  3602. return ~(__a & __b);
  3603. }
  3604. static vector unsigned short __ATTRS_o_ai vec_nand(vector bool short __a,
  3605. vector unsigned short __b) {
  3606. return ~(__a & __b);
  3607. }
  3608. static vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
  3609. vector signed int __b) {
  3610. return ~(__a & __b);
  3611. }
  3612. static vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
  3613. vector bool int __b) {
  3614. return ~(__a & __b);
  3615. }
  3616. static vector signed int __ATTRS_o_ai vec_nand(vector bool int __a,
  3617. vector signed int __b) {
  3618. return ~(__a & __b);
  3619. }
  3620. static vector unsigned int __ATTRS_o_ai vec_nand(vector unsigned int __a,
  3621. vector unsigned int __b) {
  3622. return ~(__a & __b);
  3623. }
  3624. static vector unsigned int __ATTRS_o_ai vec_nand(vector unsigned int __a,
  3625. vector bool int __b) {
  3626. return ~(__a & __b);
  3627. }
  3628. static vector unsigned int __ATTRS_o_ai vec_nand(vector bool int __a,
  3629. vector unsigned int __b) {
  3630. return ~(__a & __b);
  3631. }
  3632. static vector signed long long __ATTRS_o_ai
  3633. vec_nand(vector signed long long __a, vector signed long long __b) {
  3634. return ~(__a & __b);
  3635. }
  3636. static vector signed long long __ATTRS_o_ai
  3637. vec_nand(vector signed long long __a, vector bool long long __b) {
  3638. return ~(__a & __b);
  3639. }
  3640. static vector signed long long __ATTRS_o_ai
  3641. vec_nand(vector bool long long __a, vector signed long long __b) {
  3642. return ~(__a & __b);
  3643. }
  3644. static vector unsigned long long __ATTRS_o_ai
  3645. vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
  3646. return ~(__a & __b);
  3647. }
  3648. static vector unsigned long long __ATTRS_o_ai
  3649. vec_nand(vector unsigned long long __a, vector bool long long __b) {
  3650. return ~(__a & __b);
  3651. }
  3652. static vector unsigned long long __ATTRS_o_ai
  3653. vec_nand(vector bool long long __a, vector unsigned long long __b) {
  3654. return ~(__a & __b);
  3655. }
  3656. #endif
  3657. /* vec_nmadd */
  3658. #ifdef __VSX__
  3659. static vector float __ATTRS_o_ai
  3660. vec_nmadd(vector float __a, vector float __b, vector float __c) {
  3661. return __builtin_vsx_xvnmaddasp(__a, __b, __c);
  3662. }
  3663. static vector double __ATTRS_o_ai
  3664. vec_nmadd(vector double __a, vector double __b, vector double __c) {
  3665. return __builtin_vsx_xvnmaddadp(__a, __b, __c);
  3666. }
  3667. #endif
  3668. /* vec_nmsub */
  3669. static vector float __ATTRS_o_ai
  3670. vec_nmsub(vector float __a, vector float __b, vector float __c) {
  3671. #ifdef __VSX__
  3672. return __builtin_vsx_xvnmsubasp(__a, __b, __c);
  3673. #else
  3674. return __builtin_altivec_vnmsubfp(__a, __b, __c);
  3675. #endif
  3676. }
  3677. #ifdef __VSX__
  3678. static vector double __ATTRS_o_ai
  3679. vec_nmsub(vector double __a, vector double __b, vector double __c) {
  3680. return __builtin_vsx_xvnmsubadp(__a, __b, __c);
  3681. }
  3682. #endif
  3683. /* vec_vnmsubfp */
  3684. static vector float __attribute__((__always_inline__))
  3685. vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
  3686. return __builtin_altivec_vnmsubfp(__a, __b, __c);
  3687. }
  3688. /* vec_nor */
  3689. #define __builtin_altivec_vnor vec_nor
  3690. static vector signed char __ATTRS_o_ai vec_nor(vector signed char __a,
  3691. vector signed char __b) {
  3692. return ~(__a | __b);
  3693. }
  3694. static vector unsigned char __ATTRS_o_ai vec_nor(vector unsigned char __a,
  3695. vector unsigned char __b) {
  3696. return ~(__a | __b);
  3697. }
  3698. static vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
  3699. vector bool char __b) {
  3700. return ~(__a | __b);
  3701. }
  3702. static vector short __ATTRS_o_ai vec_nor(vector short __a, vector short __b) {
  3703. return ~(__a | __b);
  3704. }
  3705. static vector unsigned short __ATTRS_o_ai vec_nor(vector unsigned short __a,
  3706. vector unsigned short __b) {
  3707. return ~(__a | __b);
  3708. }
  3709. static vector bool short __ATTRS_o_ai vec_nor(vector bool short __a,
  3710. vector bool short __b) {
  3711. return ~(__a | __b);
  3712. }
  3713. static vector int __ATTRS_o_ai vec_nor(vector int __a, vector int __b) {
  3714. return ~(__a | __b);
  3715. }
  3716. static vector unsigned int __ATTRS_o_ai vec_nor(vector unsigned int __a,
  3717. vector unsigned int __b) {
  3718. return ~(__a | __b);
  3719. }
  3720. static vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
  3721. vector bool int __b) {
  3722. return ~(__a | __b);
  3723. }
  3724. static vector float __ATTRS_o_ai vec_nor(vector float __a, vector float __b) {
  3725. vector unsigned int __res =
  3726. ~((vector unsigned int)__a | (vector unsigned int)__b);
  3727. return (vector float)__res;
  3728. }
  3729. #ifdef __VSX__
  3730. static vector double __ATTRS_o_ai
  3731. vec_nor(vector double __a, vector double __b) {
  3732. vector unsigned long long __res =
  3733. ~((vector unsigned long long)__a | (vector unsigned long long)__b);
  3734. return (vector double)__res;
  3735. }
  3736. #endif
  3737. /* vec_vnor */
  3738. static vector signed char __ATTRS_o_ai vec_vnor(vector signed char __a,
  3739. vector signed char __b) {
  3740. return ~(__a | __b);
  3741. }
  3742. static vector unsigned char __ATTRS_o_ai vec_vnor(vector unsigned char __a,
  3743. vector unsigned char __b) {
  3744. return ~(__a | __b);
  3745. }
  3746. static vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
  3747. vector bool char __b) {
  3748. return ~(__a | __b);
  3749. }
  3750. static vector short __ATTRS_o_ai vec_vnor(vector short __a, vector short __b) {
  3751. return ~(__a | __b);
  3752. }
  3753. static vector unsigned short __ATTRS_o_ai vec_vnor(vector unsigned short __a,
  3754. vector unsigned short __b) {
  3755. return ~(__a | __b);
  3756. }
  3757. static vector bool short __ATTRS_o_ai vec_vnor(vector bool short __a,
  3758. vector bool short __b) {
  3759. return ~(__a | __b);
  3760. }
  3761. static vector int __ATTRS_o_ai vec_vnor(vector int __a, vector int __b) {
  3762. return ~(__a | __b);
  3763. }
  3764. static vector unsigned int __ATTRS_o_ai vec_vnor(vector unsigned int __a,
  3765. vector unsigned int __b) {
  3766. return ~(__a | __b);
  3767. }
  3768. static vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
  3769. vector bool int __b) {
  3770. return ~(__a | __b);
  3771. }
  3772. static vector float __ATTRS_o_ai vec_vnor(vector float __a, vector float __b) {
  3773. vector unsigned int __res =
  3774. ~((vector unsigned int)__a | (vector unsigned int)__b);
  3775. return (vector float)__res;
  3776. }
  3777. #ifdef __VSX__
  3778. static vector signed long long __ATTRS_o_ai
  3779. vec_nor(vector signed long long __a, vector signed long long __b) {
  3780. return ~(__a | __b);
  3781. }
  3782. static vector unsigned long long __ATTRS_o_ai
  3783. vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
  3784. return ~(__a | __b);
  3785. }
  3786. static vector bool long long __ATTRS_o_ai vec_nor(vector bool long long __a,
  3787. vector bool long long __b) {
  3788. return ~(__a | __b);
  3789. }
  3790. #endif
  3791. /* vec_or */
  3792. #define __builtin_altivec_vor vec_or
  3793. static vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
  3794. vector signed char __b) {
  3795. return __a | __b;
  3796. }
  3797. static vector signed char __ATTRS_o_ai vec_or(vector bool char __a,
  3798. vector signed char __b) {
  3799. return (vector signed char)__a | __b;
  3800. }
  3801. static vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
  3802. vector bool char __b) {
  3803. return __a | (vector signed char)__b;
  3804. }
  3805. static vector unsigned char __ATTRS_o_ai vec_or(vector unsigned char __a,
  3806. vector unsigned char __b) {
  3807. return __a | __b;
  3808. }
  3809. static vector unsigned char __ATTRS_o_ai vec_or(vector bool char __a,
  3810. vector unsigned char __b) {
  3811. return (vector unsigned char)__a | __b;
  3812. }
  3813. static vector unsigned char __ATTRS_o_ai vec_or(vector unsigned char __a,
  3814. vector bool char __b) {
  3815. return __a | (vector unsigned char)__b;
  3816. }
  3817. static vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
  3818. vector bool char __b) {
  3819. return __a | __b;
  3820. }
  3821. static vector short __ATTRS_o_ai vec_or(vector short __a, vector short __b) {
  3822. return __a | __b;
  3823. }
  3824. static vector short __ATTRS_o_ai vec_or(vector bool short __a,
  3825. vector short __b) {
  3826. return (vector short)__a | __b;
  3827. }
  3828. static vector short __ATTRS_o_ai vec_or(vector short __a,
  3829. vector bool short __b) {
  3830. return __a | (vector short)__b;
  3831. }
  3832. static vector unsigned short __ATTRS_o_ai vec_or(vector unsigned short __a,
  3833. vector unsigned short __b) {
  3834. return __a | __b;
  3835. }
  3836. static vector unsigned short __ATTRS_o_ai vec_or(vector bool short __a,
  3837. vector unsigned short __b) {
  3838. return (vector unsigned short)__a | __b;
  3839. }
  3840. static vector unsigned short __ATTRS_o_ai vec_or(vector unsigned short __a,
  3841. vector bool short __b) {
  3842. return __a | (vector unsigned short)__b;
  3843. }
  3844. static vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
  3845. vector bool short __b) {
  3846. return __a | __b;
  3847. }
  3848. static vector int __ATTRS_o_ai vec_or(vector int __a, vector int __b) {
  3849. return __a | __b;
  3850. }
  3851. static vector int __ATTRS_o_ai vec_or(vector bool int __a, vector int __b) {
  3852. return (vector int)__a | __b;
  3853. }
  3854. static vector int __ATTRS_o_ai vec_or(vector int __a, vector bool int __b) {
  3855. return __a | (vector int)__b;
  3856. }
  3857. static vector unsigned int __ATTRS_o_ai vec_or(vector unsigned int __a,
  3858. vector unsigned int __b) {
  3859. return __a | __b;
  3860. }
  3861. static vector unsigned int __ATTRS_o_ai vec_or(vector bool int __a,
  3862. vector unsigned int __b) {
  3863. return (vector unsigned int)__a | __b;
  3864. }
  3865. static vector unsigned int __ATTRS_o_ai vec_or(vector unsigned int __a,
  3866. vector bool int __b) {
  3867. return __a | (vector unsigned int)__b;
  3868. }
  3869. static vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
  3870. vector bool int __b) {
  3871. return __a | __b;
  3872. }
  3873. static vector float __ATTRS_o_ai vec_or(vector float __a, vector float __b) {
  3874. vector unsigned int __res =
  3875. (vector unsigned int)__a | (vector unsigned int)__b;
  3876. return (vector float)__res;
  3877. }
  3878. static vector float __ATTRS_o_ai vec_or(vector bool int __a, vector float __b) {
  3879. vector unsigned int __res =
  3880. (vector unsigned int)__a | (vector unsigned int)__b;
  3881. return (vector float)__res;
  3882. }
  3883. static vector float __ATTRS_o_ai vec_or(vector float __a, vector bool int __b) {
  3884. vector unsigned int __res =
  3885. (vector unsigned int)__a | (vector unsigned int)__b;
  3886. return (vector float)__res;
  3887. }
  3888. #ifdef __VSX__
  3889. static vector double __ATTRS_o_ai vec_or(vector bool long long __a,
  3890. vector double __b) {
  3891. return (vector unsigned long long)__a | (vector unsigned long long)__b;
  3892. }
  3893. static vector double __ATTRS_o_ai vec_or(vector double __a,
  3894. vector bool long long __b) {
  3895. return (vector unsigned long long)__a | (vector unsigned long long)__b;
  3896. }
  3897. static vector double __ATTRS_o_ai vec_or(vector double __a, vector double __b) {
  3898. vector unsigned long long __res =
  3899. (vector unsigned long long)__a | (vector unsigned long long)__b;
  3900. return (vector double)__res;
  3901. }
  3902. static vector signed long long __ATTRS_o_ai
  3903. vec_or(vector signed long long __a, vector signed long long __b) {
  3904. return __a | __b;
  3905. }
  3906. static vector signed long long __ATTRS_o_ai
  3907. vec_or(vector bool long long __a, vector signed long long __b) {
  3908. return (vector signed long long)__a | __b;
  3909. }
  3910. static vector signed long long __ATTRS_o_ai vec_or(vector signed long long __a,
  3911. vector bool long long __b) {
  3912. return __a | (vector signed long long)__b;
  3913. }
  3914. static vector unsigned long long __ATTRS_o_ai
  3915. vec_or(vector unsigned long long __a, vector unsigned long long __b) {
  3916. return __a | __b;
  3917. }
  3918. static vector unsigned long long __ATTRS_o_ai
  3919. vec_or(vector bool long long __a, vector unsigned long long __b) {
  3920. return (vector unsigned long long)__a | __b;
  3921. }
  3922. static vector unsigned long long __ATTRS_o_ai
  3923. vec_or(vector unsigned long long __a, vector bool long long __b) {
  3924. return __a | (vector unsigned long long)__b;
  3925. }
  3926. static vector bool long long __ATTRS_o_ai vec_or(vector bool long long __a,
  3927. vector bool long long __b) {
  3928. return __a | __b;
  3929. }
  3930. #endif
  3931. #ifdef __POWER8_VECTOR__
  3932. static vector signed char __ATTRS_o_ai vec_orc(vector signed char __a,
  3933. vector signed char __b) {
  3934. return __a | ~__b;
  3935. }
  3936. static vector signed char __ATTRS_o_ai vec_orc(vector signed char __a,
  3937. vector bool char __b) {
  3938. return __a | ~__b;
  3939. }
  3940. static vector signed char __ATTRS_o_ai vec_orc(vector bool char __a,
  3941. vector signed char __b) {
  3942. return __a | ~__b;
  3943. }
  3944. static vector unsigned char __ATTRS_o_ai vec_orc(vector unsigned char __a,
  3945. vector unsigned char __b) {
  3946. return __a | ~__b;
  3947. }
  3948. static vector unsigned char __ATTRS_o_ai vec_orc(vector unsigned char __a,
  3949. vector bool char __b) {
  3950. return __a | ~__b;
  3951. }
  3952. static vector unsigned char __ATTRS_o_ai vec_orc(vector bool char __a,
  3953. vector unsigned char __b) {
  3954. return __a | ~__b;
  3955. }
  3956. static vector signed short __ATTRS_o_ai vec_orc(vector signed short __a,
  3957. vector signed short __b) {
  3958. return __a | ~__b;
  3959. }
  3960. static vector signed short __ATTRS_o_ai vec_orc(vector signed short __a,
  3961. vector bool short __b) {
  3962. return __a | ~__b;
  3963. }
  3964. static vector signed short __ATTRS_o_ai vec_orc(vector bool short __a,
  3965. vector signed short __b) {
  3966. return __a | ~__b;
  3967. }
  3968. static vector unsigned short __ATTRS_o_ai vec_orc(vector unsigned short __a,
  3969. vector unsigned short __b) {
  3970. return __a | ~__b;
  3971. }
  3972. static vector unsigned short __ATTRS_o_ai vec_orc(vector unsigned short __a,
  3973. vector bool short __b) {
  3974. return __a | ~__b;
  3975. }
  3976. static vector unsigned short __ATTRS_o_ai
  3977. vec_orc(vector bool short __a, vector unsigned short __b) {
  3978. return __a | ~__b;
  3979. }
  3980. static vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
  3981. vector signed int __b) {
  3982. return __a | ~__b;
  3983. }
  3984. static vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
  3985. vector bool int __b) {
  3986. return __a | ~__b;
  3987. }
  3988. static vector signed int __ATTRS_o_ai vec_orc(vector bool int __a,
  3989. vector signed int __b) {
  3990. return __a | ~__b;
  3991. }
  3992. static vector unsigned int __ATTRS_o_ai vec_orc(vector unsigned int __a,
  3993. vector unsigned int __b) {
  3994. return __a | ~__b;
  3995. }
  3996. static vector unsigned int __ATTRS_o_ai vec_orc(vector unsigned int __a,
  3997. vector bool int __b) {
  3998. return __a | ~__b;
  3999. }
  4000. static vector unsigned int __ATTRS_o_ai vec_orc(vector bool int __a,
  4001. vector unsigned int __b) {
  4002. return __a | ~__b;
  4003. }
  4004. static vector signed long long __ATTRS_o_ai
  4005. vec_orc(vector signed long long __a, vector signed long long __b) {
  4006. return __a | ~__b;
  4007. }
  4008. static vector signed long long __ATTRS_o_ai vec_orc(vector signed long long __a,
  4009. vector bool long long __b) {
  4010. return __a | ~__b;
  4011. }
  4012. static vector signed long long __ATTRS_o_ai
  4013. vec_orc(vector bool long long __a, vector signed long long __b) {
  4014. return __a | ~__b;
  4015. }
  4016. static vector unsigned long long __ATTRS_o_ai
  4017. vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
  4018. return __a | ~__b;
  4019. }
  4020. static vector unsigned long long __ATTRS_o_ai
  4021. vec_orc(vector unsigned long long __a, vector bool long long __b) {
  4022. return __a | ~__b;
  4023. }
  4024. static vector unsigned long long __ATTRS_o_ai
  4025. vec_orc(vector bool long long __a, vector unsigned long long __b) {
  4026. return __a | ~__b;
  4027. }
  4028. #endif
  4029. /* vec_vor */
  4030. static vector signed char __ATTRS_o_ai vec_vor(vector signed char __a,
  4031. vector signed char __b) {
  4032. return __a | __b;
  4033. }
  4034. static vector signed char __ATTRS_o_ai vec_vor(vector bool char __a,
  4035. vector signed char __b) {
  4036. return (vector signed char)__a | __b;
  4037. }
  4038. static vector signed char __ATTRS_o_ai vec_vor(vector signed char __a,
  4039. vector bool char __b) {
  4040. return __a | (vector signed char)__b;
  4041. }
  4042. static vector unsigned char __ATTRS_o_ai vec_vor(vector unsigned char __a,
  4043. vector unsigned char __b) {
  4044. return __a | __b;
  4045. }
  4046. static vector unsigned char __ATTRS_o_ai vec_vor(vector bool char __a,
  4047. vector unsigned char __b) {
  4048. return (vector unsigned char)__a | __b;
  4049. }
  4050. static vector unsigned char __ATTRS_o_ai vec_vor(vector unsigned char __a,
  4051. vector bool char __b) {
  4052. return __a | (vector unsigned char)__b;
  4053. }
  4054. static vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
  4055. vector bool char __b) {
  4056. return __a | __b;
  4057. }
  4058. static vector short __ATTRS_o_ai vec_vor(vector short __a, vector short __b) {
  4059. return __a | __b;
  4060. }
  4061. static vector short __ATTRS_o_ai vec_vor(vector bool short __a,
  4062. vector short __b) {
  4063. return (vector short)__a | __b;
  4064. }
  4065. static vector short __ATTRS_o_ai vec_vor(vector short __a,
  4066. vector bool short __b) {
  4067. return __a | (vector short)__b;
  4068. }
  4069. static vector unsigned short __ATTRS_o_ai vec_vor(vector unsigned short __a,
  4070. vector unsigned short __b) {
  4071. return __a | __b;
  4072. }
  4073. static vector unsigned short __ATTRS_o_ai vec_vor(vector bool short __a,
  4074. vector unsigned short __b) {
  4075. return (vector unsigned short)__a | __b;
  4076. }
  4077. static vector unsigned short __ATTRS_o_ai vec_vor(vector unsigned short __a,
  4078. vector bool short __b) {
  4079. return __a | (vector unsigned short)__b;
  4080. }
  4081. static vector bool short __ATTRS_o_ai vec_vor(vector bool short __a,
  4082. vector bool short __b) {
  4083. return __a | __b;
  4084. }
  4085. static vector int __ATTRS_o_ai vec_vor(vector int __a, vector int __b) {
  4086. return __a | __b;
  4087. }
  4088. static vector int __ATTRS_o_ai vec_vor(vector bool int __a, vector int __b) {
  4089. return (vector int)__a | __b;
  4090. }
  4091. static vector int __ATTRS_o_ai vec_vor(vector int __a, vector bool int __b) {
  4092. return __a | (vector int)__b;
  4093. }
  4094. static vector unsigned int __ATTRS_o_ai vec_vor(vector unsigned int __a,
  4095. vector unsigned int __b) {
  4096. return __a | __b;
  4097. }
  4098. static vector unsigned int __ATTRS_o_ai vec_vor(vector bool int __a,
  4099. vector unsigned int __b) {
  4100. return (vector unsigned int)__a | __b;
  4101. }
  4102. static vector unsigned int __ATTRS_o_ai vec_vor(vector unsigned int __a,
  4103. vector bool int __b) {
  4104. return __a | (vector unsigned int)__b;
  4105. }
  4106. static vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
  4107. vector bool int __b) {
  4108. return __a | __b;
  4109. }
  4110. static vector float __ATTRS_o_ai vec_vor(vector float __a, vector float __b) {
  4111. vector unsigned int __res =
  4112. (vector unsigned int)__a | (vector unsigned int)__b;
  4113. return (vector float)__res;
  4114. }
  4115. static vector float __ATTRS_o_ai vec_vor(vector bool int __a,
  4116. vector float __b) {
  4117. vector unsigned int __res =
  4118. (vector unsigned int)__a | (vector unsigned int)__b;
  4119. return (vector float)__res;
  4120. }
  4121. static vector float __ATTRS_o_ai vec_vor(vector float __a,
  4122. vector bool int __b) {
  4123. vector unsigned int __res =
  4124. (vector unsigned int)__a | (vector unsigned int)__b;
  4125. return (vector float)__res;
  4126. }
  4127. #ifdef __VSX__
  4128. static vector signed long long __ATTRS_o_ai
  4129. vec_vor(vector signed long long __a, vector signed long long __b) {
  4130. return __a | __b;
  4131. }
  4132. static vector signed long long __ATTRS_o_ai
  4133. vec_vor(vector bool long long __a, vector signed long long __b) {
  4134. return (vector signed long long)__a | __b;
  4135. }
  4136. static vector signed long long __ATTRS_o_ai vec_vor(vector signed long long __a,
  4137. vector bool long long __b) {
  4138. return __a | (vector signed long long)__b;
  4139. }
  4140. static vector unsigned long long __ATTRS_o_ai
  4141. vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
  4142. return __a | __b;
  4143. }
  4144. static vector unsigned long long __ATTRS_o_ai
  4145. vec_vor(vector bool long long __a, vector unsigned long long __b) {
  4146. return (vector unsigned long long)__a | __b;
  4147. }
  4148. static vector unsigned long long __ATTRS_o_ai
  4149. vec_vor(vector unsigned long long __a, vector bool long long __b) {
  4150. return __a | (vector unsigned long long)__b;
  4151. }
  4152. static vector bool long long __ATTRS_o_ai vec_vor(vector bool long long __a,
  4153. vector bool long long __b) {
  4154. return __a | __b;
  4155. }
  4156. #endif
  4157. /* vec_pack */
  4158. /* The various vector pack instructions have a big-endian bias, so for
  4159. little endian we must handle reversed element numbering. */
  4160. static vector signed char __ATTRS_o_ai vec_pack(vector signed short __a,
  4161. vector signed short __b) {
  4162. #ifdef __LITTLE_ENDIAN__
  4163. return (vector signed char)vec_perm(
  4164. __a, __b,
  4165. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4166. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4167. #else
  4168. return (vector signed char)vec_perm(
  4169. __a, __b,
  4170. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4171. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4172. #endif
  4173. }
  4174. static vector unsigned char __ATTRS_o_ai vec_pack(vector unsigned short __a,
  4175. vector unsigned short __b) {
  4176. #ifdef __LITTLE_ENDIAN__
  4177. return (vector unsigned char)vec_perm(
  4178. __a, __b,
  4179. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4180. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4181. #else
  4182. return (vector unsigned char)vec_perm(
  4183. __a, __b,
  4184. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4185. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4186. #endif
  4187. }
  4188. static vector bool char __ATTRS_o_ai vec_pack(vector bool short __a,
  4189. vector bool short __b) {
  4190. #ifdef __LITTLE_ENDIAN__
  4191. return (vector bool char)vec_perm(
  4192. __a, __b,
  4193. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4194. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4195. #else
  4196. return (vector bool char)vec_perm(
  4197. __a, __b,
  4198. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4199. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4200. #endif
  4201. }
  4202. static vector short __ATTRS_o_ai vec_pack(vector int __a, vector int __b) {
  4203. #ifdef __LITTLE_ENDIAN__
  4204. return (vector short)vec_perm(
  4205. __a, __b,
  4206. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4207. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4208. #else
  4209. return (vector short)vec_perm(
  4210. __a, __b,
  4211. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4212. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4213. #endif
  4214. }
  4215. static vector unsigned short __ATTRS_o_ai vec_pack(vector unsigned int __a,
  4216. vector unsigned int __b) {
  4217. #ifdef __LITTLE_ENDIAN__
  4218. return (vector unsigned short)vec_perm(
  4219. __a, __b,
  4220. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4221. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4222. #else
  4223. return (vector unsigned short)vec_perm(
  4224. __a, __b,
  4225. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4226. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4227. #endif
  4228. }
  4229. static vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
  4230. vector bool int __b) {
  4231. #ifdef __LITTLE_ENDIAN__
  4232. return (vector bool short)vec_perm(
  4233. __a, __b,
  4234. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4235. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4236. #else
  4237. return (vector bool short)vec_perm(
  4238. __a, __b,
  4239. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4240. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4241. #endif
  4242. }
  4243. #ifdef __VSX__
  4244. static vector signed int __ATTRS_o_ai vec_pack(vector signed long long __a,
  4245. vector signed long long __b) {
  4246. #ifdef __LITTLE_ENDIAN__
  4247. return (vector signed int)vec_perm(
  4248. __a, __b,
  4249. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4250. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4251. #else
  4252. return (vector signed int)vec_perm(
  4253. __a, __b,
  4254. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4255. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4256. #endif
  4257. }
  4258. static vector unsigned int __ATTRS_o_ai
  4259. vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
  4260. #ifdef __LITTLE_ENDIAN__
  4261. return (vector unsigned int)vec_perm(
  4262. __a, __b,
  4263. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4264. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4265. #else
  4266. return (vector unsigned int)vec_perm(
  4267. __a, __b,
  4268. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4269. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4270. #endif
  4271. }
  4272. static vector bool int __ATTRS_o_ai vec_pack(vector bool long long __a,
  4273. vector bool long long __b) {
  4274. #ifdef __LITTLE_ENDIAN__
  4275. return (vector bool int)vec_perm(
  4276. __a, __b,
  4277. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4278. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4279. #else
  4280. return (vector bool int)vec_perm(
  4281. __a, __b,
  4282. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4283. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4284. #endif
  4285. }
  4286. #endif
  4287. /* vec_vpkuhum */
  4288. #define __builtin_altivec_vpkuhum vec_vpkuhum
  4289. static vector signed char __ATTRS_o_ai vec_vpkuhum(vector signed short __a,
  4290. vector signed short __b) {
  4291. #ifdef __LITTLE_ENDIAN__
  4292. return (vector signed char)vec_perm(
  4293. __a, __b,
  4294. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4295. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4296. #else
  4297. return (vector signed char)vec_perm(
  4298. __a, __b,
  4299. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4300. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4301. #endif
  4302. }
  4303. static vector unsigned char __ATTRS_o_ai
  4304. vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
  4305. #ifdef __LITTLE_ENDIAN__
  4306. return (vector unsigned char)vec_perm(
  4307. __a, __b,
  4308. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4309. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4310. #else
  4311. return (vector unsigned char)vec_perm(
  4312. __a, __b,
  4313. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4314. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4315. #endif
  4316. }
  4317. static vector bool char __ATTRS_o_ai vec_vpkuhum(vector bool short __a,
  4318. vector bool short __b) {
  4319. #ifdef __LITTLE_ENDIAN__
  4320. return (vector bool char)vec_perm(
  4321. __a, __b,
  4322. (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
  4323. 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
  4324. #else
  4325. return (vector bool char)vec_perm(
  4326. __a, __b,
  4327. (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
  4328. 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
  4329. #endif
  4330. }
  4331. /* vec_vpkuwum */
  4332. #define __builtin_altivec_vpkuwum vec_vpkuwum
  4333. static vector short __ATTRS_o_ai vec_vpkuwum(vector int __a, vector int __b) {
  4334. #ifdef __LITTLE_ENDIAN__
  4335. return (vector short)vec_perm(
  4336. __a, __b,
  4337. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4338. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4339. #else
  4340. return (vector short)vec_perm(
  4341. __a, __b,
  4342. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4343. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4344. #endif
  4345. }
  4346. static vector unsigned short __ATTRS_o_ai vec_vpkuwum(vector unsigned int __a,
  4347. vector unsigned int __b) {
  4348. #ifdef __LITTLE_ENDIAN__
  4349. return (vector unsigned short)vec_perm(
  4350. __a, __b,
  4351. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4352. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4353. #else
  4354. return (vector unsigned short)vec_perm(
  4355. __a, __b,
  4356. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4357. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4358. #endif
  4359. }
  4360. static vector bool short __ATTRS_o_ai vec_vpkuwum(vector bool int __a,
  4361. vector bool int __b) {
  4362. #ifdef __LITTLE_ENDIAN__
  4363. return (vector bool short)vec_perm(
  4364. __a, __b,
  4365. (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
  4366. 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
  4367. #else
  4368. return (vector bool short)vec_perm(
  4369. __a, __b,
  4370. (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
  4371. 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
  4372. #endif
  4373. }
  4374. /* vec_vpkudum */
  4375. #ifdef __POWER8_VECTOR__
  4376. #define __builtin_altivec_vpkudum vec_vpkudum
  4377. static vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
  4378. vector long long __b) {
  4379. #ifdef __LITTLE_ENDIAN__
  4380. return (vector int)vec_perm(
  4381. __a, __b,
  4382. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4383. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4384. #else
  4385. return (vector int)vec_perm(
  4386. __a, __b,
  4387. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4388. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4389. #endif
  4390. }
  4391. static vector unsigned int __ATTRS_o_ai
  4392. vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
  4393. #ifdef __LITTLE_ENDIAN__
  4394. return (vector unsigned int)vec_perm(
  4395. __a, __b,
  4396. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4397. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4398. #else
  4399. return (vector unsigned int)vec_perm(
  4400. __a, __b,
  4401. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4402. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4403. #endif
  4404. }
  4405. static vector bool int __ATTRS_o_ai vec_vpkudum(vector bool long long __a,
  4406. vector bool long long __b) {
  4407. #ifdef __LITTLE_ENDIAN__
  4408. return (vector bool int)vec_perm(
  4409. (vector long long)__a, (vector long long)__b,
  4410. (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
  4411. 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
  4412. #else
  4413. return (vector bool int)vec_perm(
  4414. (vector long long)__a, (vector long long)__b,
  4415. (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
  4416. 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
  4417. #endif
  4418. }
  4419. #endif
  4420. /* vec_packpx */
  4421. static vector pixel __attribute__((__always_inline__))
  4422. vec_packpx(vector unsigned int __a, vector unsigned int __b) {
  4423. #ifdef __LITTLE_ENDIAN__
  4424. return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
  4425. #else
  4426. return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
  4427. #endif
  4428. }
  4429. /* vec_vpkpx */
  4430. static vector pixel __attribute__((__always_inline__))
  4431. vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
  4432. #ifdef __LITTLE_ENDIAN__
  4433. return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
  4434. #else
  4435. return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
  4436. #endif
  4437. }
  4438. /* vec_packs */
  4439. static vector signed char __ATTRS_o_ai vec_packs(vector short __a,
  4440. vector short __b) {
  4441. #ifdef __LITTLE_ENDIAN__
  4442. return __builtin_altivec_vpkshss(__b, __a);
  4443. #else
  4444. return __builtin_altivec_vpkshss(__a, __b);
  4445. #endif
  4446. }
  4447. static vector unsigned char __ATTRS_o_ai vec_packs(vector unsigned short __a,
  4448. vector unsigned short __b) {
  4449. #ifdef __LITTLE_ENDIAN__
  4450. return __builtin_altivec_vpkuhus(__b, __a);
  4451. #else
  4452. return __builtin_altivec_vpkuhus(__a, __b);
  4453. #endif
  4454. }
  4455. static vector signed short __ATTRS_o_ai vec_packs(vector int __a,
  4456. vector int __b) {
  4457. #ifdef __LITTLE_ENDIAN__
  4458. return __builtin_altivec_vpkswss(__b, __a);
  4459. #else
  4460. return __builtin_altivec_vpkswss(__a, __b);
  4461. #endif
  4462. }
  4463. static vector unsigned short __ATTRS_o_ai vec_packs(vector unsigned int __a,
  4464. vector unsigned int __b) {
  4465. #ifdef __LITTLE_ENDIAN__
  4466. return __builtin_altivec_vpkuwus(__b, __a);
  4467. #else
  4468. return __builtin_altivec_vpkuwus(__a, __b);
  4469. #endif
  4470. }
  4471. #ifdef __POWER8_VECTOR__
  4472. static vector int __ATTRS_o_ai vec_packs(vector long long __a,
  4473. vector long long __b) {
  4474. #ifdef __LITTLE_ENDIAN__
  4475. return __builtin_altivec_vpksdss(__b, __a);
  4476. #else
  4477. return __builtin_altivec_vpksdss(__a, __b);
  4478. #endif
  4479. }
  4480. static vector unsigned int __ATTRS_o_ai
  4481. vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
  4482. #ifdef __LITTLE_ENDIAN__
  4483. return __builtin_altivec_vpkudus(__b, __a);
  4484. #else
  4485. return __builtin_altivec_vpkudus(__a, __b);
  4486. #endif
  4487. }
  4488. #endif
  4489. /* vec_vpkshss */
  4490. static vector signed char __attribute__((__always_inline__))
  4491. vec_vpkshss(vector short __a, vector short __b) {
  4492. #ifdef __LITTLE_ENDIAN__
  4493. return __builtin_altivec_vpkshss(__b, __a);
  4494. #else
  4495. return __builtin_altivec_vpkshss(__a, __b);
  4496. #endif
  4497. }
  4498. /* vec_vpksdss */
  4499. #ifdef __POWER8_VECTOR__
  4500. static vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
  4501. vector long long __b) {
  4502. #ifdef __LITTLE_ENDIAN__
  4503. return __builtin_altivec_vpksdss(__b, __a);
  4504. #else
  4505. return __builtin_altivec_vpksdss(__a, __b);
  4506. #endif
  4507. }
  4508. #endif
  4509. /* vec_vpkuhus */
  4510. static vector unsigned char __attribute__((__always_inline__))
  4511. vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
  4512. #ifdef __LITTLE_ENDIAN__
  4513. return __builtin_altivec_vpkuhus(__b, __a);
  4514. #else
  4515. return __builtin_altivec_vpkuhus(__a, __b);
  4516. #endif
  4517. }
  4518. /* vec_vpkudus */
  4519. #ifdef __POWER8_VECTOR__
  4520. static vector unsigned int __attribute__((__always_inline__))
  4521. vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
  4522. #ifdef __LITTLE_ENDIAN__
  4523. return __builtin_altivec_vpkudus(__b, __a);
  4524. #else
  4525. return __builtin_altivec_vpkudus(__a, __b);
  4526. #endif
  4527. }
  4528. #endif
  4529. /* vec_vpkswss */
  4530. static vector signed short __attribute__((__always_inline__))
  4531. vec_vpkswss(vector int __a, vector int __b) {
  4532. #ifdef __LITTLE_ENDIAN__
  4533. return __builtin_altivec_vpkswss(__b, __a);
  4534. #else
  4535. return __builtin_altivec_vpkswss(__a, __b);
  4536. #endif
  4537. }
  4538. /* vec_vpkuwus */
  4539. static vector unsigned short __attribute__((__always_inline__))
  4540. vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
  4541. #ifdef __LITTLE_ENDIAN__
  4542. return __builtin_altivec_vpkuwus(__b, __a);
  4543. #else
  4544. return __builtin_altivec_vpkuwus(__a, __b);
  4545. #endif
  4546. }
  4547. /* vec_packsu */
  4548. static vector unsigned char __ATTRS_o_ai vec_packsu(vector short __a,
  4549. vector short __b) {
  4550. #ifdef __LITTLE_ENDIAN__
  4551. return __builtin_altivec_vpkshus(__b, __a);
  4552. #else
  4553. return __builtin_altivec_vpkshus(__a, __b);
  4554. #endif
  4555. }
  4556. static vector unsigned char __ATTRS_o_ai vec_packsu(vector unsigned short __a,
  4557. vector unsigned short __b) {
  4558. #ifdef __LITTLE_ENDIAN__
  4559. return __builtin_altivec_vpkuhus(__b, __a);
  4560. #else
  4561. return __builtin_altivec_vpkuhus(__a, __b);
  4562. #endif
  4563. }
  4564. static vector unsigned short __ATTRS_o_ai vec_packsu(vector int __a,
  4565. vector int __b) {
  4566. #ifdef __LITTLE_ENDIAN__
  4567. return __builtin_altivec_vpkswus(__b, __a);
  4568. #else
  4569. return __builtin_altivec_vpkswus(__a, __b);
  4570. #endif
  4571. }
  4572. static vector unsigned short __ATTRS_o_ai vec_packsu(vector unsigned int __a,
  4573. vector unsigned int __b) {
  4574. #ifdef __LITTLE_ENDIAN__
  4575. return __builtin_altivec_vpkuwus(__b, __a);
  4576. #else
  4577. return __builtin_altivec_vpkuwus(__a, __b);
  4578. #endif
  4579. }
  4580. #ifdef __POWER8_VECTOR__
  4581. static vector unsigned int __ATTRS_o_ai vec_packsu(vector long long __a,
  4582. vector long long __b) {
  4583. #ifdef __LITTLE_ENDIAN__
  4584. return __builtin_altivec_vpksdus(__b, __a);
  4585. #else
  4586. return __builtin_altivec_vpksdus(__a, __b);
  4587. #endif
  4588. }
  4589. static vector unsigned int __ATTRS_o_ai
  4590. vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
  4591. #ifdef __LITTLE_ENDIAN__
  4592. return __builtin_altivec_vpkudus(__b, __a);
  4593. #else
  4594. return __builtin_altivec_vpkudus(__a, __b);
  4595. #endif
  4596. }
  4597. #endif
  4598. /* vec_vpkshus */
  4599. static vector unsigned char __ATTRS_o_ai vec_vpkshus(vector short __a,
  4600. vector short __b) {
  4601. #ifdef __LITTLE_ENDIAN__
  4602. return __builtin_altivec_vpkshus(__b, __a);
  4603. #else
  4604. return __builtin_altivec_vpkshus(__a, __b);
  4605. #endif
  4606. }
  4607. static vector unsigned char __ATTRS_o_ai
  4608. vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
  4609. #ifdef __LITTLE_ENDIAN__
  4610. return __builtin_altivec_vpkuhus(__b, __a);
  4611. #else
  4612. return __builtin_altivec_vpkuhus(__a, __b);
  4613. #endif
  4614. }
  4615. /* vec_vpkswus */
  4616. static vector unsigned short __ATTRS_o_ai vec_vpkswus(vector int __a,
  4617. vector int __b) {
  4618. #ifdef __LITTLE_ENDIAN__
  4619. return __builtin_altivec_vpkswus(__b, __a);
  4620. #else
  4621. return __builtin_altivec_vpkswus(__a, __b);
  4622. #endif
  4623. }
  4624. static vector unsigned short __ATTRS_o_ai vec_vpkswus(vector unsigned int __a,
  4625. vector unsigned int __b) {
  4626. #ifdef __LITTLE_ENDIAN__
  4627. return __builtin_altivec_vpkuwus(__b, __a);
  4628. #else
  4629. return __builtin_altivec_vpkuwus(__a, __b);
  4630. #endif
  4631. }
  4632. /* vec_vpksdus */
  4633. #ifdef __POWER8_VECTOR__
  4634. static vector unsigned int __ATTRS_o_ai vec_vpksdus(vector long long __a,
  4635. vector long long __b) {
  4636. #ifdef __LITTLE_ENDIAN__
  4637. return __builtin_altivec_vpksdus(__b, __a);
  4638. #else
  4639. return __builtin_altivec_vpksdus(__a, __b);
  4640. #endif
  4641. }
  4642. #endif
  4643. /* vec_perm */
  4644. // The vperm instruction is defined architecturally with a big-endian bias.
  4645. // For little endian, we swap the input operands and invert the permute
  4646. // control vector. Only the rightmost 5 bits matter, so we could use
  4647. // a vector of all 31s instead of all 255s to perform the inversion.
  4648. // However, when the PCV is not a constant, using 255 has an advantage
  4649. // in that the vec_xor can be recognized as a vec_nor (and for P8 and
  4650. // later, possibly a vec_nand).
  4651. static vector signed char __ATTRS_o_ai vec_perm(vector signed char __a,
  4652. vector signed char __b,
  4653. vector unsigned char __c) {
  4654. #ifdef __LITTLE_ENDIAN__
  4655. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4656. 255, 255, 255, 255, 255, 255, 255, 255};
  4657. __d = vec_xor(__c, __d);
  4658. return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
  4659. (vector int)__a, __d);
  4660. #else
  4661. return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
  4662. (vector int)__b, __c);
  4663. #endif
  4664. }
  4665. static vector unsigned char __ATTRS_o_ai vec_perm(vector unsigned char __a,
  4666. vector unsigned char __b,
  4667. vector unsigned char __c) {
  4668. #ifdef __LITTLE_ENDIAN__
  4669. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4670. 255, 255, 255, 255, 255, 255, 255, 255};
  4671. __d = vec_xor(__c, __d);
  4672. return (vector unsigned char)__builtin_altivec_vperm_4si(
  4673. (vector int)__b, (vector int)__a, __d);
  4674. #else
  4675. return (vector unsigned char)__builtin_altivec_vperm_4si(
  4676. (vector int)__a, (vector int)__b, __c);
  4677. #endif
  4678. }
  4679. static vector bool char __ATTRS_o_ai vec_perm(vector bool char __a,
  4680. vector bool char __b,
  4681. vector unsigned char __c) {
  4682. #ifdef __LITTLE_ENDIAN__
  4683. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4684. 255, 255, 255, 255, 255, 255, 255, 255};
  4685. __d = vec_xor(__c, __d);
  4686. return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
  4687. (vector int)__a, __d);
  4688. #else
  4689. return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
  4690. (vector int)__b, __c);
  4691. #endif
  4692. }
  4693. static vector short __ATTRS_o_ai vec_perm(vector signed short __a,
  4694. vector signed short __b,
  4695. vector unsigned char __c) {
  4696. #ifdef __LITTLE_ENDIAN__
  4697. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4698. 255, 255, 255, 255, 255, 255, 255, 255};
  4699. __d = vec_xor(__c, __d);
  4700. return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
  4701. (vector int)__a, __d);
  4702. #else
  4703. return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
  4704. (vector int)__b, __c);
  4705. #endif
  4706. }
  4707. static vector unsigned short __ATTRS_o_ai vec_perm(vector unsigned short __a,
  4708. vector unsigned short __b,
  4709. vector unsigned char __c) {
  4710. #ifdef __LITTLE_ENDIAN__
  4711. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4712. 255, 255, 255, 255, 255, 255, 255, 255};
  4713. __d = vec_xor(__c, __d);
  4714. return (vector unsigned short)__builtin_altivec_vperm_4si(
  4715. (vector int)__b, (vector int)__a, __d);
  4716. #else
  4717. return (vector unsigned short)__builtin_altivec_vperm_4si(
  4718. (vector int)__a, (vector int)__b, __c);
  4719. #endif
  4720. }
  4721. static vector bool short __ATTRS_o_ai vec_perm(vector bool short __a,
  4722. vector bool short __b,
  4723. vector unsigned char __c) {
  4724. #ifdef __LITTLE_ENDIAN__
  4725. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4726. 255, 255, 255, 255, 255, 255, 255, 255};
  4727. __d = vec_xor(__c, __d);
  4728. return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
  4729. (vector int)__a, __d);
  4730. #else
  4731. return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
  4732. (vector int)__b, __c);
  4733. #endif
  4734. }
  4735. static vector pixel __ATTRS_o_ai vec_perm(vector pixel __a, vector pixel __b,
  4736. vector unsigned char __c) {
  4737. #ifdef __LITTLE_ENDIAN__
  4738. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4739. 255, 255, 255, 255, 255, 255, 255, 255};
  4740. __d = vec_xor(__c, __d);
  4741. return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
  4742. (vector int)__a, __d);
  4743. #else
  4744. return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
  4745. (vector int)__b, __c);
  4746. #endif
  4747. }
  4748. static vector int __ATTRS_o_ai vec_perm(vector signed int __a,
  4749. vector signed int __b,
  4750. vector unsigned char __c) {
  4751. #ifdef __LITTLE_ENDIAN__
  4752. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4753. 255, 255, 255, 255, 255, 255, 255, 255};
  4754. __d = vec_xor(__c, __d);
  4755. return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
  4756. #else
  4757. return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
  4758. #endif
  4759. }
  4760. static vector unsigned int __ATTRS_o_ai vec_perm(vector unsigned int __a,
  4761. vector unsigned int __b,
  4762. vector unsigned char __c) {
  4763. #ifdef __LITTLE_ENDIAN__
  4764. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4765. 255, 255, 255, 255, 255, 255, 255, 255};
  4766. __d = vec_xor(__c, __d);
  4767. return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
  4768. (vector int)__a, __d);
  4769. #else
  4770. return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
  4771. (vector int)__b, __c);
  4772. #endif
  4773. }
  4774. static vector bool int __ATTRS_o_ai vec_perm(vector bool int __a,
  4775. vector bool int __b,
  4776. vector unsigned char __c) {
  4777. #ifdef __LITTLE_ENDIAN__
  4778. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4779. 255, 255, 255, 255, 255, 255, 255, 255};
  4780. __d = vec_xor(__c, __d);
  4781. return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
  4782. (vector int)__a, __d);
  4783. #else
  4784. return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
  4785. (vector int)__b, __c);
  4786. #endif
  4787. }
  4788. static vector float __ATTRS_o_ai vec_perm(vector float __a, vector float __b,
  4789. vector unsigned char __c) {
  4790. #ifdef __LITTLE_ENDIAN__
  4791. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4792. 255, 255, 255, 255, 255, 255, 255, 255};
  4793. __d = vec_xor(__c, __d);
  4794. return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
  4795. (vector int)__a, __d);
  4796. #else
  4797. return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
  4798. (vector int)__b, __c);
  4799. #endif
  4800. }
  4801. #ifdef __VSX__
  4802. static vector long long __ATTRS_o_ai vec_perm(vector signed long long __a,
  4803. vector signed long long __b,
  4804. vector unsigned char __c) {
  4805. #ifdef __LITTLE_ENDIAN__
  4806. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4807. 255, 255, 255, 255, 255, 255, 255, 255};
  4808. __d = vec_xor(__c, __d);
  4809. return (vector signed long long)__builtin_altivec_vperm_4si(
  4810. (vector int)__b, (vector int)__a, __d);
  4811. #else
  4812. return (vector signed long long)__builtin_altivec_vperm_4si(
  4813. (vector int)__a, (vector int)__b, __c);
  4814. #endif
  4815. }
  4816. static vector unsigned long long __ATTRS_o_ai
  4817. vec_perm(vector unsigned long long __a, vector unsigned long long __b,
  4818. vector unsigned char __c) {
  4819. #ifdef __LITTLE_ENDIAN__
  4820. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4821. 255, 255, 255, 255, 255, 255, 255, 255};
  4822. __d = vec_xor(__c, __d);
  4823. return (vector unsigned long long)__builtin_altivec_vperm_4si(
  4824. (vector int)__b, (vector int)__a, __d);
  4825. #else
  4826. return (vector unsigned long long)__builtin_altivec_vperm_4si(
  4827. (vector int)__a, (vector int)__b, __c);
  4828. #endif
  4829. }
  4830. static vector bool long long __ATTRS_o_ai
  4831. vec_perm(vector bool long long __a, vector bool long long __b,
  4832. vector unsigned char __c) {
  4833. #ifdef __LITTLE_ENDIAN__
  4834. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4835. 255, 255, 255, 255, 255, 255, 255, 255};
  4836. __d = vec_xor(__c, __d);
  4837. return (vector bool long long)__builtin_altivec_vperm_4si(
  4838. (vector int)__b, (vector int)__a, __d);
  4839. #else
  4840. return (vector bool long long)__builtin_altivec_vperm_4si(
  4841. (vector int)__a, (vector int)__b, __c);
  4842. #endif
  4843. }
  4844. static vector double __ATTRS_o_ai vec_perm(vector double __a, vector double __b,
  4845. vector unsigned char __c) {
  4846. #ifdef __LITTLE_ENDIAN__
  4847. vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
  4848. 255, 255, 255, 255, 255, 255, 255, 255};
  4849. __d = vec_xor(__c, __d);
  4850. return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
  4851. (vector int)__a, __d);
  4852. #else
  4853. return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
  4854. (vector int)__b, __c);
  4855. #endif
  4856. }
  4857. #endif
  4858. /* vec_vperm */
  4859. static vector signed char __ATTRS_o_ai vec_vperm(vector signed char __a,
  4860. vector signed char __b,
  4861. vector unsigned char __c) {
  4862. return vec_perm(__a, __b, __c);
  4863. }
  4864. static vector unsigned char __ATTRS_o_ai vec_vperm(vector unsigned char __a,
  4865. vector unsigned char __b,
  4866. vector unsigned char __c) {
  4867. return vec_perm(__a, __b, __c);
  4868. }
  4869. static vector bool char __ATTRS_o_ai vec_vperm(vector bool char __a,
  4870. vector bool char __b,
  4871. vector unsigned char __c) {
  4872. return vec_perm(__a, __b, __c);
  4873. }
  4874. static vector short __ATTRS_o_ai vec_vperm(vector short __a, vector short __b,
  4875. vector unsigned char __c) {
  4876. return vec_perm(__a, __b, __c);
  4877. }
  4878. static vector unsigned short __ATTRS_o_ai vec_vperm(vector unsigned short __a,
  4879. vector unsigned short __b,
  4880. vector unsigned char __c) {
  4881. return vec_perm(__a, __b, __c);
  4882. }
  4883. static vector bool short __ATTRS_o_ai vec_vperm(vector bool short __a,
  4884. vector bool short __b,
  4885. vector unsigned char __c) {
  4886. return vec_perm(__a, __b, __c);
  4887. }
  4888. static vector pixel __ATTRS_o_ai vec_vperm(vector pixel __a, vector pixel __b,
  4889. vector unsigned char __c) {
  4890. return vec_perm(__a, __b, __c);
  4891. }
  4892. static vector int __ATTRS_o_ai vec_vperm(vector int __a, vector int __b,
  4893. vector unsigned char __c) {
  4894. return vec_perm(__a, __b, __c);
  4895. }
  4896. static vector unsigned int __ATTRS_o_ai vec_vperm(vector unsigned int __a,
  4897. vector unsigned int __b,
  4898. vector unsigned char __c) {
  4899. return vec_perm(__a, __b, __c);
  4900. }
  4901. static vector bool int __ATTRS_o_ai vec_vperm(vector bool int __a,
  4902. vector bool int __b,
  4903. vector unsigned char __c) {
  4904. return vec_perm(__a, __b, __c);
  4905. }
  4906. static vector float __ATTRS_o_ai vec_vperm(vector float __a, vector float __b,
  4907. vector unsigned char __c) {
  4908. return vec_perm(__a, __b, __c);
  4909. }
  4910. #ifdef __VSX__
  4911. static vector long long __ATTRS_o_ai vec_vperm(vector long long __a,
  4912. vector long long __b,
  4913. vector unsigned char __c) {
  4914. return vec_perm(__a, __b, __c);
  4915. }
  4916. static vector unsigned long long __ATTRS_o_ai
  4917. vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
  4918. vector unsigned char __c) {
  4919. return vec_perm(__a, __b, __c);
  4920. }
  4921. static vector double __ATTRS_o_ai vec_vperm(vector double __a,
  4922. vector double __b,
  4923. vector unsigned char __c) {
  4924. return vec_perm(__a, __b, __c);
  4925. }
  4926. #endif
  4927. /* vec_re */
  4928. static vector float __ATTRS_o_ai
  4929. vec_re(vector float __a) {
  4930. #ifdef __VSX__
  4931. return __builtin_vsx_xvresp(__a);
  4932. #else
  4933. return __builtin_altivec_vrefp(__a);
  4934. #endif
  4935. }
  4936. #ifdef __VSX__
  4937. static vector double __ATTRS_o_ai vec_re(vector double __a) {
  4938. return __builtin_vsx_xvredp(__a);
  4939. }
  4940. #endif
  4941. /* vec_vrefp */
  4942. static vector float __attribute__((__always_inline__))
  4943. vec_vrefp(vector float __a) {
  4944. return __builtin_altivec_vrefp(__a);
  4945. }
  4946. /* vec_rl */
  4947. static vector signed char __ATTRS_o_ai vec_rl(vector signed char __a,
  4948. vector unsigned char __b) {
  4949. return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
  4950. }
  4951. static vector unsigned char __ATTRS_o_ai vec_rl(vector unsigned char __a,
  4952. vector unsigned char __b) {
  4953. return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
  4954. }
  4955. static vector short __ATTRS_o_ai vec_rl(vector short __a,
  4956. vector unsigned short __b) {
  4957. return __builtin_altivec_vrlh(__a, __b);
  4958. }
  4959. static vector unsigned short __ATTRS_o_ai vec_rl(vector unsigned short __a,
  4960. vector unsigned short __b) {
  4961. return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
  4962. }
  4963. static vector int __ATTRS_o_ai vec_rl(vector int __a, vector unsigned int __b) {
  4964. return __builtin_altivec_vrlw(__a, __b);
  4965. }
  4966. static vector unsigned int __ATTRS_o_ai vec_rl(vector unsigned int __a,
  4967. vector unsigned int __b) {
  4968. return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
  4969. }
  4970. #ifdef __POWER8_VECTOR__
  4971. static vector signed long long __ATTRS_o_ai
  4972. vec_rl(vector signed long long __a, vector unsigned long long __b) {
  4973. return __builtin_altivec_vrld(__a, __b);
  4974. }
  4975. static vector unsigned long long __ATTRS_o_ai
  4976. vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
  4977. return __builtin_altivec_vrld(__a, __b);
  4978. }
  4979. #endif
  4980. /* vec_vrlb */
  4981. static vector signed char __ATTRS_o_ai vec_vrlb(vector signed char __a,
  4982. vector unsigned char __b) {
  4983. return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
  4984. }
  4985. static vector unsigned char __ATTRS_o_ai vec_vrlb(vector unsigned char __a,
  4986. vector unsigned char __b) {
  4987. return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
  4988. }
  4989. /* vec_vrlh */
  4990. static vector short __ATTRS_o_ai vec_vrlh(vector short __a,
  4991. vector unsigned short __b) {
  4992. return __builtin_altivec_vrlh(__a, __b);
  4993. }
  4994. static vector unsigned short __ATTRS_o_ai vec_vrlh(vector unsigned short __a,
  4995. vector unsigned short __b) {
  4996. return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
  4997. }
  4998. /* vec_vrlw */
  4999. static vector int __ATTRS_o_ai vec_vrlw(vector int __a,
  5000. vector unsigned int __b) {
  5001. return __builtin_altivec_vrlw(__a, __b);
  5002. }
  5003. static vector unsigned int __ATTRS_o_ai vec_vrlw(vector unsigned int __a,
  5004. vector unsigned int __b) {
  5005. return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
  5006. }
  5007. /* vec_round */
  5008. static vector float __ATTRS_o_ai vec_round(vector float __a) {
  5009. #ifdef __VSX__
  5010. return __builtin_vsx_xvrspi(__a);
  5011. #else
  5012. return __builtin_altivec_vrfin(__a);
  5013. #endif
  5014. }
  5015. #ifdef __VSX__
  5016. static vector double __ATTRS_o_ai vec_round(vector double __a) {
  5017. return __builtin_vsx_xvrdpi(__a);
  5018. }
  5019. /* vec_rint */
  5020. static vector float __ATTRS_o_ai
  5021. vec_rint(vector float __a) {
  5022. return __builtin_vsx_xvrspic(__a);
  5023. }
  5024. static vector double __ATTRS_o_ai
  5025. vec_rint(vector double __a) {
  5026. return __builtin_vsx_xvrdpic(__a);
  5027. }
  5028. /* vec_nearbyint */
  5029. static vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
  5030. return __builtin_vsx_xvrspi(__a);
  5031. }
  5032. static vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
  5033. return __builtin_vsx_xvrdpi(__a);
  5034. }
  5035. #endif
  5036. /* vec_vrfin */
  5037. static vector float __attribute__((__always_inline__))
  5038. vec_vrfin(vector float __a) {
  5039. return __builtin_altivec_vrfin(__a);
  5040. }
  5041. /* vec_sqrt */
  5042. #ifdef __VSX__
  5043. static vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
  5044. return __builtin_vsx_xvsqrtsp(__a);
  5045. }
  5046. static vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
  5047. return __builtin_vsx_xvsqrtdp(__a);
  5048. }
  5049. #endif
  5050. /* vec_rsqrte */
  5051. static vector float __ATTRS_o_ai
  5052. vec_rsqrte(vector float __a) {
  5053. #ifdef __VSX__
  5054. return __builtin_vsx_xvrsqrtesp(__a);
  5055. #else
  5056. return __builtin_altivec_vrsqrtefp(__a);
  5057. #endif
  5058. }
  5059. #ifdef __VSX__
  5060. static vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
  5061. return __builtin_vsx_xvrsqrtedp(__a);
  5062. }
  5063. #endif
  5064. /* vec_vrsqrtefp */
  5065. static __vector float __attribute__((__always_inline__))
  5066. vec_vrsqrtefp(vector float __a) {
  5067. return __builtin_altivec_vrsqrtefp(__a);
  5068. }
  5069. /* vec_sel */
  5070. #define __builtin_altivec_vsel_4si vec_sel
  5071. static vector signed char __ATTRS_o_ai vec_sel(vector signed char __a,
  5072. vector signed char __b,
  5073. vector unsigned char __c) {
  5074. return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
  5075. }
  5076. static vector signed char __ATTRS_o_ai vec_sel(vector signed char __a,
  5077. vector signed char __b,
  5078. vector bool char __c) {
  5079. return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
  5080. }
  5081. static vector unsigned char __ATTRS_o_ai vec_sel(vector unsigned char __a,
  5082. vector unsigned char __b,
  5083. vector unsigned char __c) {
  5084. return (__a & ~__c) | (__b & __c);
  5085. }
  5086. static vector unsigned char __ATTRS_o_ai vec_sel(vector unsigned char __a,
  5087. vector unsigned char __b,
  5088. vector bool char __c) {
  5089. return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
  5090. }
  5091. static vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
  5092. vector bool char __b,
  5093. vector unsigned char __c) {
  5094. return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
  5095. }
  5096. static vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
  5097. vector bool char __b,
  5098. vector bool char __c) {
  5099. return (__a & ~__c) | (__b & __c);
  5100. }
  5101. static vector short __ATTRS_o_ai vec_sel(vector short __a, vector short __b,
  5102. vector unsigned short __c) {
  5103. return (__a & ~(vector short)__c) | (__b & (vector short)__c);
  5104. }
  5105. static vector short __ATTRS_o_ai vec_sel(vector short __a, vector short __b,
  5106. vector bool short __c) {
  5107. return (__a & ~(vector short)__c) | (__b & (vector short)__c);
  5108. }
  5109. static vector unsigned short __ATTRS_o_ai vec_sel(vector unsigned short __a,
  5110. vector unsigned short __b,
  5111. vector unsigned short __c) {
  5112. return (__a & ~__c) | (__b & __c);
  5113. }
  5114. static vector unsigned short __ATTRS_o_ai vec_sel(vector unsigned short __a,
  5115. vector unsigned short __b,
  5116. vector bool short __c) {
  5117. return (__a & ~(vector unsigned short)__c) |
  5118. (__b & (vector unsigned short)__c);
  5119. }
  5120. static vector bool short __ATTRS_o_ai vec_sel(vector bool short __a,
  5121. vector bool short __b,
  5122. vector unsigned short __c) {
  5123. return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
  5124. }
  5125. static vector bool short __ATTRS_o_ai vec_sel(vector bool short __a,
  5126. vector bool short __b,
  5127. vector bool short __c) {
  5128. return (__a & ~__c) | (__b & __c);
  5129. }
  5130. static vector int __ATTRS_o_ai vec_sel(vector int __a, vector int __b,
  5131. vector unsigned int __c) {
  5132. return (__a & ~(vector int)__c) | (__b & (vector int)__c);
  5133. }
  5134. static vector int __ATTRS_o_ai vec_sel(vector int __a, vector int __b,
  5135. vector bool int __c) {
  5136. return (__a & ~(vector int)__c) | (__b & (vector int)__c);
  5137. }
  5138. static vector unsigned int __ATTRS_o_ai vec_sel(vector unsigned int __a,
  5139. vector unsigned int __b,
  5140. vector unsigned int __c) {
  5141. return (__a & ~__c) | (__b & __c);
  5142. }
  5143. static vector unsigned int __ATTRS_o_ai vec_sel(vector unsigned int __a,
  5144. vector unsigned int __b,
  5145. vector bool int __c) {
  5146. return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
  5147. }
  5148. static vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
  5149. vector bool int __b,
  5150. vector unsigned int __c) {
  5151. return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
  5152. }
  5153. static vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
  5154. vector bool int __b,
  5155. vector bool int __c) {
  5156. return (__a & ~__c) | (__b & __c);
  5157. }
  5158. static vector float __ATTRS_o_ai vec_sel(vector float __a, vector float __b,
  5159. vector unsigned int __c) {
  5160. vector int __res = ((vector int)__a & ~(vector int)__c) |
  5161. ((vector int)__b & (vector int)__c);
  5162. return (vector float)__res;
  5163. }
  5164. static vector float __ATTRS_o_ai vec_sel(vector float __a, vector float __b,
  5165. vector bool int __c) {
  5166. vector int __res = ((vector int)__a & ~(vector int)__c) |
  5167. ((vector int)__b & (vector int)__c);
  5168. return (vector float)__res;
  5169. }
  5170. #ifdef __VSX__
  5171. static vector double __ATTRS_o_ai vec_sel(vector double __a, vector double __b,
  5172. vector bool long long __c) {
  5173. vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
  5174. ((vector long long)__b & (vector long long)__c);
  5175. return (vector double)__res;
  5176. }
  5177. static vector double __ATTRS_o_ai vec_sel(vector double __a, vector double __b,
  5178. vector unsigned long long __c) {
  5179. vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
  5180. ((vector long long)__b & (vector long long)__c);
  5181. return (vector double)__res;
  5182. }
  5183. #endif
  5184. /* vec_vsel */
  5185. static vector signed char __ATTRS_o_ai vec_vsel(vector signed char __a,
  5186. vector signed char __b,
  5187. vector unsigned char __c) {
  5188. return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
  5189. }
  5190. static vector signed char __ATTRS_o_ai vec_vsel(vector signed char __a,
  5191. vector signed char __b,
  5192. vector bool char __c) {
  5193. return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
  5194. }
  5195. static vector unsigned char __ATTRS_o_ai vec_vsel(vector unsigned char __a,
  5196. vector unsigned char __b,
  5197. vector unsigned char __c) {
  5198. return (__a & ~__c) | (__b & __c);
  5199. }
  5200. static vector unsigned char __ATTRS_o_ai vec_vsel(vector unsigned char __a,
  5201. vector unsigned char __b,
  5202. vector bool char __c) {
  5203. return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
  5204. }
  5205. static vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
  5206. vector bool char __b,
  5207. vector unsigned char __c) {
  5208. return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
  5209. }
  5210. static vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
  5211. vector bool char __b,
  5212. vector bool char __c) {
  5213. return (__a & ~__c) | (__b & __c);
  5214. }
  5215. static vector short __ATTRS_o_ai vec_vsel(vector short __a, vector short __b,
  5216. vector unsigned short __c) {
  5217. return (__a & ~(vector short)__c) | (__b & (vector short)__c);
  5218. }
  5219. static vector short __ATTRS_o_ai vec_vsel(vector short __a, vector short __b,
  5220. vector bool short __c) {
  5221. return (__a & ~(vector short)__c) | (__b & (vector short)__c);
  5222. }
  5223. static vector unsigned short __ATTRS_o_ai vec_vsel(vector unsigned short __a,
  5224. vector unsigned short __b,
  5225. vector unsigned short __c) {
  5226. return (__a & ~__c) | (__b & __c);
  5227. }
  5228. static vector unsigned short __ATTRS_o_ai vec_vsel(vector unsigned short __a,
  5229. vector unsigned short __b,
  5230. vector bool short __c) {
  5231. return (__a & ~(vector unsigned short)__c) |
  5232. (__b & (vector unsigned short)__c);
  5233. }
  5234. static vector bool short __ATTRS_o_ai vec_vsel(vector bool short __a,
  5235. vector bool short __b,
  5236. vector unsigned short __c) {
  5237. return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
  5238. }
  5239. static vector bool short __ATTRS_o_ai vec_vsel(vector bool short __a,
  5240. vector bool short __b,
  5241. vector bool short __c) {
  5242. return (__a & ~__c) | (__b & __c);
  5243. }
  5244. static vector int __ATTRS_o_ai vec_vsel(vector int __a, vector int __b,
  5245. vector unsigned int __c) {
  5246. return (__a & ~(vector int)__c) | (__b & (vector int)__c);
  5247. }
  5248. static vector int __ATTRS_o_ai vec_vsel(vector int __a, vector int __b,
  5249. vector bool int __c) {
  5250. return (__a & ~(vector int)__c) | (__b & (vector int)__c);
  5251. }
  5252. static vector unsigned int __ATTRS_o_ai vec_vsel(vector unsigned int __a,
  5253. vector unsigned int __b,
  5254. vector unsigned int __c) {
  5255. return (__a & ~__c) | (__b & __c);
  5256. }
  5257. static vector unsigned int __ATTRS_o_ai vec_vsel(vector unsigned int __a,
  5258. vector unsigned int __b,
  5259. vector bool int __c) {
  5260. return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
  5261. }
  5262. static vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
  5263. vector bool int __b,
  5264. vector unsigned int __c) {
  5265. return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
  5266. }
  5267. static vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
  5268. vector bool int __b,
  5269. vector bool int __c) {
  5270. return (__a & ~__c) | (__b & __c);
  5271. }
  5272. static vector float __ATTRS_o_ai vec_vsel(vector float __a, vector float __b,
  5273. vector unsigned int __c) {
  5274. vector int __res = ((vector int)__a & ~(vector int)__c) |
  5275. ((vector int)__b & (vector int)__c);
  5276. return (vector float)__res;
  5277. }
  5278. static vector float __ATTRS_o_ai vec_vsel(vector float __a, vector float __b,
  5279. vector bool int __c) {
  5280. vector int __res = ((vector int)__a & ~(vector int)__c) |
  5281. ((vector int)__b & (vector int)__c);
  5282. return (vector float)__res;
  5283. }
  5284. /* vec_sl */
  5285. static vector signed char __ATTRS_o_ai vec_sl(vector signed char __a,
  5286. vector unsigned char __b) {
  5287. return __a << (vector signed char)__b;
  5288. }
  5289. static vector unsigned char __ATTRS_o_ai vec_sl(vector unsigned char __a,
  5290. vector unsigned char __b) {
  5291. return __a << __b;
  5292. }
  5293. static vector short __ATTRS_o_ai vec_sl(vector short __a,
  5294. vector unsigned short __b) {
  5295. return __a << (vector short)__b;
  5296. }
  5297. static vector unsigned short __ATTRS_o_ai vec_sl(vector unsigned short __a,
  5298. vector unsigned short __b) {
  5299. return __a << __b;
  5300. }
  5301. static vector int __ATTRS_o_ai vec_sl(vector int __a, vector unsigned int __b) {
  5302. return __a << (vector int)__b;
  5303. }
  5304. static vector unsigned int __ATTRS_o_ai vec_sl(vector unsigned int __a,
  5305. vector unsigned int __b) {
  5306. return __a << __b;
  5307. }
  5308. #ifdef __POWER8_VECTOR__
  5309. static vector signed long long __ATTRS_o_ai
  5310. vec_sl(vector signed long long __a, vector unsigned long long __b) {
  5311. return __a << (vector long long)__b;
  5312. }
  5313. static vector unsigned long long __ATTRS_o_ai
  5314. vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
  5315. return __a << __b;
  5316. }
  5317. #endif
  5318. /* vec_vslb */
  5319. #define __builtin_altivec_vslb vec_vslb
  5320. static vector signed char __ATTRS_o_ai vec_vslb(vector signed char __a,
  5321. vector unsigned char __b) {
  5322. return vec_sl(__a, __b);
  5323. }
  5324. static vector unsigned char __ATTRS_o_ai vec_vslb(vector unsigned char __a,
  5325. vector unsigned char __b) {
  5326. return vec_sl(__a, __b);
  5327. }
  5328. /* vec_vslh */
  5329. #define __builtin_altivec_vslh vec_vslh
  5330. static vector short __ATTRS_o_ai vec_vslh(vector short __a,
  5331. vector unsigned short __b) {
  5332. return vec_sl(__a, __b);
  5333. }
  5334. static vector unsigned short __ATTRS_o_ai vec_vslh(vector unsigned short __a,
  5335. vector unsigned short __b) {
  5336. return vec_sl(__a, __b);
  5337. }
  5338. /* vec_vslw */
  5339. #define __builtin_altivec_vslw vec_vslw
  5340. static vector int __ATTRS_o_ai vec_vslw(vector int __a,
  5341. vector unsigned int __b) {
  5342. return vec_sl(__a, __b);
  5343. }
  5344. static vector unsigned int __ATTRS_o_ai vec_vslw(vector unsigned int __a,
  5345. vector unsigned int __b) {
  5346. return vec_sl(__a, __b);
  5347. }
  5348. /* vec_sld */
  5349. #define __builtin_altivec_vsldoi_4si vec_sld
  5350. static vector signed char __ATTRS_o_ai vec_sld(vector signed char __a,
  5351. vector signed char __b,
  5352. unsigned const int __c) {
  5353. unsigned char __d = __c & 0x0F;
  5354. #ifdef __LITTLE_ENDIAN__
  5355. return vec_perm(
  5356. __b, __a,
  5357. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5358. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5359. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5360. 31 - __d));
  5361. #else
  5362. return vec_perm(
  5363. __a, __b,
  5364. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5365. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5366. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5367. #endif
  5368. }
  5369. static vector unsigned char __ATTRS_o_ai vec_sld(vector unsigned char __a,
  5370. vector unsigned char __b,
  5371. unsigned const int __c) {
  5372. unsigned char __d = __c & 0x0F;
  5373. #ifdef __LITTLE_ENDIAN__
  5374. return vec_perm(
  5375. __b, __a,
  5376. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5377. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5378. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5379. 31 - __d));
  5380. #else
  5381. return vec_perm(
  5382. __a, __b,
  5383. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5384. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5385. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5386. #endif
  5387. }
  5388. static vector bool char __ATTRS_o_ai vec_sld(vector bool char __a,
  5389. vector bool char __b,
  5390. unsigned const int __c) {
  5391. unsigned char __d = __c & 0x0F;
  5392. #ifdef __LITTLE_ENDIAN__
  5393. return vec_perm(
  5394. __b, __a,
  5395. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5396. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5397. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5398. 31 - __d));
  5399. #else
  5400. return vec_perm(
  5401. __a, __b,
  5402. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5403. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5404. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5405. #endif
  5406. }
  5407. static vector signed short __ATTRS_o_ai vec_sld(vector signed short __a,
  5408. vector signed short __b,
  5409. unsigned const int __c) {
  5410. unsigned char __d = __c & 0x0F;
  5411. #ifdef __LITTLE_ENDIAN__
  5412. return vec_perm(
  5413. __b, __a,
  5414. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5415. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5416. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5417. 31 - __d));
  5418. #else
  5419. return vec_perm(
  5420. __a, __b,
  5421. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5422. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5423. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5424. #endif
  5425. }
  5426. static vector unsigned short __ATTRS_o_ai vec_sld(vector unsigned short __a,
  5427. vector unsigned short __b,
  5428. unsigned const int __c) {
  5429. unsigned char __d = __c & 0x0F;
  5430. #ifdef __LITTLE_ENDIAN__
  5431. return vec_perm(
  5432. __b, __a,
  5433. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5434. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5435. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5436. 31 - __d));
  5437. #else
  5438. return vec_perm(
  5439. __a, __b,
  5440. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5441. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5442. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5443. #endif
  5444. }
  5445. static vector bool short __ATTRS_o_ai vec_sld(vector bool short __a,
  5446. vector bool short __b,
  5447. unsigned const int __c) {
  5448. unsigned char __d = __c & 0x0F;
  5449. #ifdef __LITTLE_ENDIAN__
  5450. return vec_perm(
  5451. __b, __a,
  5452. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5453. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5454. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5455. 31 - __d));
  5456. #else
  5457. return vec_perm(
  5458. __a, __b,
  5459. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5460. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5461. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5462. #endif
  5463. }
  5464. static vector pixel __ATTRS_o_ai vec_sld(vector pixel __a, vector pixel __b,
  5465. unsigned const int __c) {
  5466. unsigned char __d = __c & 0x0F;
  5467. #ifdef __LITTLE_ENDIAN__
  5468. return vec_perm(
  5469. __b, __a,
  5470. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5471. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5472. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5473. 31 - __d));
  5474. #else
  5475. return vec_perm(
  5476. __a, __b,
  5477. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5478. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5479. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5480. #endif
  5481. }
  5482. static vector signed int __ATTRS_o_ai vec_sld(vector signed int __a,
  5483. vector signed int __b,
  5484. unsigned const int __c) {
  5485. unsigned char __d = __c & 0x0F;
  5486. #ifdef __LITTLE_ENDIAN__
  5487. return vec_perm(
  5488. __b, __a,
  5489. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5490. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5491. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5492. 31 - __d));
  5493. #else
  5494. return vec_perm(
  5495. __a, __b,
  5496. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5497. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5498. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5499. #endif
  5500. }
  5501. static vector unsigned int __ATTRS_o_ai vec_sld(vector unsigned int __a,
  5502. vector unsigned int __b,
  5503. unsigned const int __c) {
  5504. unsigned char __d = __c & 0x0F;
  5505. #ifdef __LITTLE_ENDIAN__
  5506. return vec_perm(
  5507. __b, __a,
  5508. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5509. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5510. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5511. 31 - __d));
  5512. #else
  5513. return vec_perm(
  5514. __a, __b,
  5515. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5516. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5517. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5518. #endif
  5519. }
  5520. static vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
  5521. vector bool int __b,
  5522. unsigned const int __c) {
  5523. unsigned char __d = __c & 0x0F;
  5524. #ifdef __LITTLE_ENDIAN__
  5525. return vec_perm(
  5526. __b, __a,
  5527. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5528. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5529. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5530. 31 - __d));
  5531. #else
  5532. return vec_perm(
  5533. __a, __b,
  5534. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5535. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5536. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5537. #endif
  5538. }
  5539. static vector float __ATTRS_o_ai vec_sld(vector float __a, vector float __b,
  5540. unsigned const int __c) {
  5541. unsigned char __d = __c & 0x0F;
  5542. #ifdef __LITTLE_ENDIAN__
  5543. return vec_perm(
  5544. __b, __a,
  5545. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5546. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5547. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5548. 31 - __d));
  5549. #else
  5550. return vec_perm(
  5551. __a, __b,
  5552. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5553. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5554. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5555. #endif
  5556. }
  5557. /* vec_vsldoi */
  5558. static vector signed char __ATTRS_o_ai vec_vsldoi(vector signed char __a,
  5559. vector signed char __b,
  5560. unsigned char __c) {
  5561. unsigned char __d = __c & 0x0F;
  5562. #ifdef __LITTLE_ENDIAN__
  5563. return vec_perm(
  5564. __b, __a,
  5565. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5566. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5567. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5568. 31 - __d));
  5569. #else
  5570. return vec_perm(
  5571. __a, __b,
  5572. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5573. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5574. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5575. #endif
  5576. }
  5577. static vector unsigned char __ATTRS_o_ai vec_vsldoi(vector unsigned char __a,
  5578. vector unsigned char __b,
  5579. unsigned char __c) {
  5580. unsigned char __d = __c & 0x0F;
  5581. #ifdef __LITTLE_ENDIAN__
  5582. return vec_perm(
  5583. __b, __a,
  5584. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5585. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5586. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5587. 31 - __d));
  5588. #else
  5589. return vec_perm(
  5590. __a, __b,
  5591. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5592. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5593. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5594. #endif
  5595. }
  5596. static vector short __ATTRS_o_ai vec_vsldoi(vector short __a, vector short __b,
  5597. unsigned char __c) {
  5598. unsigned char __d = __c & 0x0F;
  5599. #ifdef __LITTLE_ENDIAN__
  5600. return vec_perm(
  5601. __b, __a,
  5602. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5603. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5604. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5605. 31 - __d));
  5606. #else
  5607. return vec_perm(
  5608. __a, __b,
  5609. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5610. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5611. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5612. #endif
  5613. }
  5614. static vector unsigned short __ATTRS_o_ai vec_vsldoi(vector unsigned short __a,
  5615. vector unsigned short __b,
  5616. unsigned char __c) {
  5617. unsigned char __d = __c & 0x0F;
  5618. #ifdef __LITTLE_ENDIAN__
  5619. return vec_perm(
  5620. __b, __a,
  5621. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5622. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5623. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5624. 31 - __d));
  5625. #else
  5626. return vec_perm(
  5627. __a, __b,
  5628. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5629. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5630. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5631. #endif
  5632. }
  5633. static vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a, vector pixel __b,
  5634. unsigned char __c) {
  5635. unsigned char __d = __c & 0x0F;
  5636. #ifdef __LITTLE_ENDIAN__
  5637. return vec_perm(
  5638. __b, __a,
  5639. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5640. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5641. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5642. 31 - __d));
  5643. #else
  5644. return vec_perm(
  5645. __a, __b,
  5646. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5647. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5648. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5649. #endif
  5650. }
  5651. static vector int __ATTRS_o_ai vec_vsldoi(vector int __a, vector int __b,
  5652. unsigned char __c) {
  5653. unsigned char __d = __c & 0x0F;
  5654. #ifdef __LITTLE_ENDIAN__
  5655. return vec_perm(
  5656. __b, __a,
  5657. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5658. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5659. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5660. 31 - __d));
  5661. #else
  5662. return vec_perm(
  5663. __a, __b,
  5664. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5665. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5666. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5667. #endif
  5668. }
  5669. static vector unsigned int __ATTRS_o_ai vec_vsldoi(vector unsigned int __a,
  5670. vector unsigned int __b,
  5671. unsigned char __c) {
  5672. unsigned char __d = __c & 0x0F;
  5673. #ifdef __LITTLE_ENDIAN__
  5674. return vec_perm(
  5675. __b, __a,
  5676. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5677. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5678. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5679. 31 - __d));
  5680. #else
  5681. return vec_perm(
  5682. __a, __b,
  5683. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5684. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5685. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5686. #endif
  5687. }
  5688. static vector float __ATTRS_o_ai vec_vsldoi(vector float __a, vector float __b,
  5689. unsigned char __c) {
  5690. unsigned char __d = __c & 0x0F;
  5691. #ifdef __LITTLE_ENDIAN__
  5692. return vec_perm(
  5693. __b, __a,
  5694. (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d, 20 - __d,
  5695. 21 - __d, 22 - __d, 23 - __d, 24 - __d, 25 - __d,
  5696. 26 - __d, 27 - __d, 28 - __d, 29 - __d, 30 - __d,
  5697. 31 - __d));
  5698. #else
  5699. return vec_perm(
  5700. __a, __b,
  5701. (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
  5702. __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
  5703. __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
  5704. #endif
  5705. }
  5706. /* vec_sll */
  5707. static vector signed char __ATTRS_o_ai vec_sll(vector signed char __a,
  5708. vector unsigned char __b) {
  5709. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5710. (vector int)__b);
  5711. }
  5712. static vector signed char __ATTRS_o_ai vec_sll(vector signed char __a,
  5713. vector unsigned short __b) {
  5714. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5715. (vector int)__b);
  5716. }
  5717. static vector signed char __ATTRS_o_ai vec_sll(vector signed char __a,
  5718. vector unsigned int __b) {
  5719. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5720. (vector int)__b);
  5721. }
  5722. static vector unsigned char __ATTRS_o_ai vec_sll(vector unsigned char __a,
  5723. vector unsigned char __b) {
  5724. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5725. (vector int)__b);
  5726. }
  5727. static vector unsigned char __ATTRS_o_ai vec_sll(vector unsigned char __a,
  5728. vector unsigned short __b) {
  5729. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5730. (vector int)__b);
  5731. }
  5732. static vector unsigned char __ATTRS_o_ai vec_sll(vector unsigned char __a,
  5733. vector unsigned int __b) {
  5734. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5735. (vector int)__b);
  5736. }
  5737. static vector bool char __ATTRS_o_ai vec_sll(vector bool char __a,
  5738. vector unsigned char __b) {
  5739. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5740. (vector int)__b);
  5741. }
  5742. static vector bool char __ATTRS_o_ai vec_sll(vector bool char __a,
  5743. vector unsigned short __b) {
  5744. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5745. (vector int)__b);
  5746. }
  5747. static vector bool char __ATTRS_o_ai vec_sll(vector bool char __a,
  5748. vector unsigned int __b) {
  5749. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5750. (vector int)__b);
  5751. }
  5752. static vector short __ATTRS_o_ai vec_sll(vector short __a,
  5753. vector unsigned char __b) {
  5754. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5755. }
  5756. static vector short __ATTRS_o_ai vec_sll(vector short __a,
  5757. vector unsigned short __b) {
  5758. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5759. }
  5760. static vector short __ATTRS_o_ai vec_sll(vector short __a,
  5761. vector unsigned int __b) {
  5762. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5763. }
  5764. static vector unsigned short __ATTRS_o_ai vec_sll(vector unsigned short __a,
  5765. vector unsigned char __b) {
  5766. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5767. (vector int)__b);
  5768. }
  5769. static vector unsigned short __ATTRS_o_ai vec_sll(vector unsigned short __a,
  5770. vector unsigned short __b) {
  5771. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5772. (vector int)__b);
  5773. }
  5774. static vector unsigned short __ATTRS_o_ai vec_sll(vector unsigned short __a,
  5775. vector unsigned int __b) {
  5776. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5777. (vector int)__b);
  5778. }
  5779. static vector bool short __ATTRS_o_ai vec_sll(vector bool short __a,
  5780. vector unsigned char __b) {
  5781. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5782. (vector int)__b);
  5783. }
  5784. static vector bool short __ATTRS_o_ai vec_sll(vector bool short __a,
  5785. vector unsigned short __b) {
  5786. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5787. (vector int)__b);
  5788. }
  5789. static vector bool short __ATTRS_o_ai vec_sll(vector bool short __a,
  5790. vector unsigned int __b) {
  5791. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5792. (vector int)__b);
  5793. }
  5794. static vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
  5795. vector unsigned char __b) {
  5796. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5797. }
  5798. static vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
  5799. vector unsigned short __b) {
  5800. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5801. }
  5802. static vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
  5803. vector unsigned int __b) {
  5804. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5805. }
  5806. static vector int __ATTRS_o_ai vec_sll(vector int __a,
  5807. vector unsigned char __b) {
  5808. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5809. }
  5810. static vector int __ATTRS_o_ai vec_sll(vector int __a,
  5811. vector unsigned short __b) {
  5812. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5813. }
  5814. static vector int __ATTRS_o_ai vec_sll(vector int __a,
  5815. vector unsigned int __b) {
  5816. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5817. }
  5818. static vector unsigned int __ATTRS_o_ai vec_sll(vector unsigned int __a,
  5819. vector unsigned char __b) {
  5820. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5821. (vector int)__b);
  5822. }
  5823. static vector unsigned int __ATTRS_o_ai vec_sll(vector unsigned int __a,
  5824. vector unsigned short __b) {
  5825. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5826. (vector int)__b);
  5827. }
  5828. static vector unsigned int __ATTRS_o_ai vec_sll(vector unsigned int __a,
  5829. vector unsigned int __b) {
  5830. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5831. (vector int)__b);
  5832. }
  5833. static vector bool int __ATTRS_o_ai vec_sll(vector bool int __a,
  5834. vector unsigned char __b) {
  5835. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5836. (vector int)__b);
  5837. }
  5838. static vector bool int __ATTRS_o_ai vec_sll(vector bool int __a,
  5839. vector unsigned short __b) {
  5840. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5841. (vector int)__b);
  5842. }
  5843. static vector bool int __ATTRS_o_ai vec_sll(vector bool int __a,
  5844. vector unsigned int __b) {
  5845. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5846. (vector int)__b);
  5847. }
  5848. /* vec_vsl */
  5849. static vector signed char __ATTRS_o_ai vec_vsl(vector signed char __a,
  5850. vector unsigned char __b) {
  5851. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5852. (vector int)__b);
  5853. }
  5854. static vector signed char __ATTRS_o_ai vec_vsl(vector signed char __a,
  5855. vector unsigned short __b) {
  5856. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5857. (vector int)__b);
  5858. }
  5859. static vector signed char __ATTRS_o_ai vec_vsl(vector signed char __a,
  5860. vector unsigned int __b) {
  5861. return (vector signed char)__builtin_altivec_vsl((vector int)__a,
  5862. (vector int)__b);
  5863. }
  5864. static vector unsigned char __ATTRS_o_ai vec_vsl(vector unsigned char __a,
  5865. vector unsigned char __b) {
  5866. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5867. (vector int)__b);
  5868. }
  5869. static vector unsigned char __ATTRS_o_ai vec_vsl(vector unsigned char __a,
  5870. vector unsigned short __b) {
  5871. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5872. (vector int)__b);
  5873. }
  5874. static vector unsigned char __ATTRS_o_ai vec_vsl(vector unsigned char __a,
  5875. vector unsigned int __b) {
  5876. return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
  5877. (vector int)__b);
  5878. }
  5879. static vector bool char __ATTRS_o_ai vec_vsl(vector bool char __a,
  5880. vector unsigned char __b) {
  5881. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5882. (vector int)__b);
  5883. }
  5884. static vector bool char __ATTRS_o_ai vec_vsl(vector bool char __a,
  5885. vector unsigned short __b) {
  5886. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5887. (vector int)__b);
  5888. }
  5889. static vector bool char __ATTRS_o_ai vec_vsl(vector bool char __a,
  5890. vector unsigned int __b) {
  5891. return (vector bool char)__builtin_altivec_vsl((vector int)__a,
  5892. (vector int)__b);
  5893. }
  5894. static vector short __ATTRS_o_ai vec_vsl(vector short __a,
  5895. vector unsigned char __b) {
  5896. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5897. }
  5898. static vector short __ATTRS_o_ai vec_vsl(vector short __a,
  5899. vector unsigned short __b) {
  5900. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5901. }
  5902. static vector short __ATTRS_o_ai vec_vsl(vector short __a,
  5903. vector unsigned int __b) {
  5904. return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5905. }
  5906. static vector unsigned short __ATTRS_o_ai vec_vsl(vector unsigned short __a,
  5907. vector unsigned char __b) {
  5908. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5909. (vector int)__b);
  5910. }
  5911. static vector unsigned short __ATTRS_o_ai vec_vsl(vector unsigned short __a,
  5912. vector unsigned short __b) {
  5913. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5914. (vector int)__b);
  5915. }
  5916. static vector unsigned short __ATTRS_o_ai vec_vsl(vector unsigned short __a,
  5917. vector unsigned int __b) {
  5918. return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
  5919. (vector int)__b);
  5920. }
  5921. static vector bool short __ATTRS_o_ai vec_vsl(vector bool short __a,
  5922. vector unsigned char __b) {
  5923. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5924. (vector int)__b);
  5925. }
  5926. static vector bool short __ATTRS_o_ai vec_vsl(vector bool short __a,
  5927. vector unsigned short __b) {
  5928. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5929. (vector int)__b);
  5930. }
  5931. static vector bool short __ATTRS_o_ai vec_vsl(vector bool short __a,
  5932. vector unsigned int __b) {
  5933. return (vector bool short)__builtin_altivec_vsl((vector int)__a,
  5934. (vector int)__b);
  5935. }
  5936. static vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
  5937. vector unsigned char __b) {
  5938. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5939. }
  5940. static vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
  5941. vector unsigned short __b) {
  5942. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5943. }
  5944. static vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
  5945. vector unsigned int __b) {
  5946. return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
  5947. }
  5948. static vector int __ATTRS_o_ai vec_vsl(vector int __a,
  5949. vector unsigned char __b) {
  5950. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5951. }
  5952. static vector int __ATTRS_o_ai vec_vsl(vector int __a,
  5953. vector unsigned short __b) {
  5954. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5955. }
  5956. static vector int __ATTRS_o_ai vec_vsl(vector int __a,
  5957. vector unsigned int __b) {
  5958. return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
  5959. }
  5960. static vector unsigned int __ATTRS_o_ai vec_vsl(vector unsigned int __a,
  5961. vector unsigned char __b) {
  5962. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5963. (vector int)__b);
  5964. }
  5965. static vector unsigned int __ATTRS_o_ai vec_vsl(vector unsigned int __a,
  5966. vector unsigned short __b) {
  5967. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5968. (vector int)__b);
  5969. }
  5970. static vector unsigned int __ATTRS_o_ai vec_vsl(vector unsigned int __a,
  5971. vector unsigned int __b) {
  5972. return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
  5973. (vector int)__b);
  5974. }
  5975. static vector bool int __ATTRS_o_ai vec_vsl(vector bool int __a,
  5976. vector unsigned char __b) {
  5977. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5978. (vector int)__b);
  5979. }
  5980. static vector bool int __ATTRS_o_ai vec_vsl(vector bool int __a,
  5981. vector unsigned short __b) {
  5982. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5983. (vector int)__b);
  5984. }
  5985. static vector bool int __ATTRS_o_ai vec_vsl(vector bool int __a,
  5986. vector unsigned int __b) {
  5987. return (vector bool int)__builtin_altivec_vsl((vector int)__a,
  5988. (vector int)__b);
  5989. }
  5990. /* vec_slo */
  5991. static vector signed char __ATTRS_o_ai vec_slo(vector signed char __a,
  5992. vector signed char __b) {
  5993. return (vector signed char)__builtin_altivec_vslo((vector int)__a,
  5994. (vector int)__b);
  5995. }
  5996. static vector signed char __ATTRS_o_ai vec_slo(vector signed char __a,
  5997. vector unsigned char __b) {
  5998. return (vector signed char)__builtin_altivec_vslo((vector int)__a,
  5999. (vector int)__b);
  6000. }
  6001. static vector unsigned char __ATTRS_o_ai vec_slo(vector unsigned char __a,
  6002. vector signed char __b) {
  6003. return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
  6004. (vector int)__b);
  6005. }
  6006. static vector unsigned char __ATTRS_o_ai vec_slo(vector unsigned char __a,
  6007. vector unsigned char __b) {
  6008. return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
  6009. (vector int)__b);
  6010. }
  6011. static vector short __ATTRS_o_ai vec_slo(vector short __a,
  6012. vector signed char __b) {
  6013. return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6014. }
  6015. static vector short __ATTRS_o_ai vec_slo(vector short __a,
  6016. vector unsigned char __b) {
  6017. return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6018. }
  6019. static vector unsigned short __ATTRS_o_ai vec_slo(vector unsigned short __a,
  6020. vector signed char __b) {
  6021. return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
  6022. (vector int)__b);
  6023. }
  6024. static vector unsigned short __ATTRS_o_ai vec_slo(vector unsigned short __a,
  6025. vector unsigned char __b) {
  6026. return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
  6027. (vector int)__b);
  6028. }
  6029. static vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
  6030. vector signed char __b) {
  6031. return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6032. }
  6033. static vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
  6034. vector unsigned char __b) {
  6035. return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6036. }
  6037. static vector int __ATTRS_o_ai vec_slo(vector int __a, vector signed char __b) {
  6038. return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
  6039. }
  6040. static vector int __ATTRS_o_ai vec_slo(vector int __a,
  6041. vector unsigned char __b) {
  6042. return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
  6043. }
  6044. static vector unsigned int __ATTRS_o_ai vec_slo(vector unsigned int __a,
  6045. vector signed char __b) {
  6046. return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
  6047. (vector int)__b);
  6048. }
  6049. static vector unsigned int __ATTRS_o_ai vec_slo(vector unsigned int __a,
  6050. vector unsigned char __b) {
  6051. return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
  6052. (vector int)__b);
  6053. }
  6054. static vector float __ATTRS_o_ai vec_slo(vector float __a,
  6055. vector signed char __b) {
  6056. return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6057. }
  6058. static vector float __ATTRS_o_ai vec_slo(vector float __a,
  6059. vector unsigned char __b) {
  6060. return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6061. }
  6062. /* vec_vslo */
  6063. static vector signed char __ATTRS_o_ai vec_vslo(vector signed char __a,
  6064. vector signed char __b) {
  6065. return (vector signed char)__builtin_altivec_vslo((vector int)__a,
  6066. (vector int)__b);
  6067. }
  6068. static vector signed char __ATTRS_o_ai vec_vslo(vector signed char __a,
  6069. vector unsigned char __b) {
  6070. return (vector signed char)__builtin_altivec_vslo((vector int)__a,
  6071. (vector int)__b);
  6072. }
  6073. static vector unsigned char __ATTRS_o_ai vec_vslo(vector unsigned char __a,
  6074. vector signed char __b) {
  6075. return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
  6076. (vector int)__b);
  6077. }
  6078. static vector unsigned char __ATTRS_o_ai vec_vslo(vector unsigned char __a,
  6079. vector unsigned char __b) {
  6080. return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
  6081. (vector int)__b);
  6082. }
  6083. static vector short __ATTRS_o_ai vec_vslo(vector short __a,
  6084. vector signed char __b) {
  6085. return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6086. }
  6087. static vector short __ATTRS_o_ai vec_vslo(vector short __a,
  6088. vector unsigned char __b) {
  6089. return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6090. }
  6091. static vector unsigned short __ATTRS_o_ai vec_vslo(vector unsigned short __a,
  6092. vector signed char __b) {
  6093. return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
  6094. (vector int)__b);
  6095. }
  6096. static vector unsigned short __ATTRS_o_ai vec_vslo(vector unsigned short __a,
  6097. vector unsigned char __b) {
  6098. return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
  6099. (vector int)__b);
  6100. }
  6101. static vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
  6102. vector signed char __b) {
  6103. return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6104. }
  6105. static vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
  6106. vector unsigned char __b) {
  6107. return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6108. }
  6109. static vector int __ATTRS_o_ai vec_vslo(vector int __a,
  6110. vector signed char __b) {
  6111. return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
  6112. }
  6113. static vector int __ATTRS_o_ai vec_vslo(vector int __a,
  6114. vector unsigned char __b) {
  6115. return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
  6116. }
  6117. static vector unsigned int __ATTRS_o_ai vec_vslo(vector unsigned int __a,
  6118. vector signed char __b) {
  6119. return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
  6120. (vector int)__b);
  6121. }
  6122. static vector unsigned int __ATTRS_o_ai vec_vslo(vector unsigned int __a,
  6123. vector unsigned char __b) {
  6124. return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
  6125. (vector int)__b);
  6126. }
  6127. static vector float __ATTRS_o_ai vec_vslo(vector float __a,
  6128. vector signed char __b) {
  6129. return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6130. }
  6131. static vector float __ATTRS_o_ai vec_vslo(vector float __a,
  6132. vector unsigned char __b) {
  6133. return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
  6134. }
  6135. /* vec_splat */
  6136. static vector signed char __ATTRS_o_ai vec_splat(vector signed char __a,
  6137. unsigned const int __b) {
  6138. return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
  6139. }
  6140. static vector unsigned char __ATTRS_o_ai vec_splat(vector unsigned char __a,
  6141. unsigned const int __b) {
  6142. return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
  6143. }
  6144. static vector bool char __ATTRS_o_ai vec_splat(vector bool char __a,
  6145. unsigned const int __b) {
  6146. return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
  6147. }
  6148. static vector signed short __ATTRS_o_ai vec_splat(vector signed short __a,
  6149. unsigned const int __b) {
  6150. unsigned char b0 = (__b & 0x07) * 2;
  6151. unsigned char b1 = b0 + 1;
  6152. return vec_perm(__a, __a,
  6153. (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1,
  6154. b0, b1, b0, b1, b0, b1, b0, b1));
  6155. }
  6156. static vector unsigned short __ATTRS_o_ai vec_splat(vector unsigned short __a,
  6157. unsigned const int __b) {
  6158. unsigned char b0 = (__b & 0x07) * 2;
  6159. unsigned char b1 = b0 + 1;
  6160. return vec_perm(__a, __a,
  6161. (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1,
  6162. b0, b1, b0, b1, b0, b1, b0, b1));
  6163. }
  6164. static vector bool short __ATTRS_o_ai vec_splat(vector bool short __a,
  6165. unsigned const int __b) {
  6166. unsigned char b0 = (__b & 0x07) * 2;
  6167. unsigned char b1 = b0 + 1;
  6168. return vec_perm(__a, __a,
  6169. (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1,
  6170. b0, b1, b0, b1, b0, b1, b0, b1));
  6171. }
  6172. static vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
  6173. unsigned const int __b) {
  6174. unsigned char b0 = (__b & 0x07) * 2;
  6175. unsigned char b1 = b0 + 1;
  6176. return vec_perm(__a, __a,
  6177. (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1,
  6178. b0, b1, b0, b1, b0, b1, b0, b1));
  6179. }
  6180. static vector signed int __ATTRS_o_ai vec_splat(vector signed int __a,
  6181. unsigned const int __b) {
  6182. unsigned char b0 = (__b & 0x03) * 4;
  6183. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
  6184. return vec_perm(__a, __a,
  6185. (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0,
  6186. b1, b2, b3, b0, b1, b2, b3));
  6187. }
  6188. static vector unsigned int __ATTRS_o_ai vec_splat(vector unsigned int __a,
  6189. unsigned const int __b) {
  6190. unsigned char b0 = (__b & 0x03) * 4;
  6191. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
  6192. return vec_perm(__a, __a,
  6193. (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0,
  6194. b1, b2, b3, b0, b1, b2, b3));
  6195. }
  6196. static vector bool int __ATTRS_o_ai vec_splat(vector bool int __a,
  6197. unsigned const int __b) {
  6198. unsigned char b0 = (__b & 0x03) * 4;
  6199. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
  6200. return vec_perm(__a, __a,
  6201. (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0,
  6202. b1, b2, b3, b0, b1, b2, b3));
  6203. }
  6204. static vector float __ATTRS_o_ai vec_splat(vector float __a,
  6205. unsigned const int __b) {
  6206. unsigned char b0 = (__b & 0x03) * 4;
  6207. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
  6208. return vec_perm(__a, __a,
  6209. (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0,
  6210. b1, b2, b3, b0, b1, b2, b3));
  6211. }
  6212. #ifdef __VSX__
  6213. static vector double __ATTRS_o_ai vec_splat(vector double __a,
  6214. unsigned const int __b) {
  6215. unsigned char b0 = (__b & 0x01) * 8;
  6216. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4,
  6217. b5 = b0 + 5, b6 = b0 + 6, b7 = b0 + 7;
  6218. return vec_perm(__a, __a,
  6219. (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7,
  6220. b0, b1, b2, b3, b4, b5, b6, b7));
  6221. }
  6222. static vector bool long long __ATTRS_o_ai vec_splat(vector bool long long __a,
  6223. unsigned const int __b) {
  6224. unsigned char b0 = (__b & 0x01) * 8;
  6225. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4,
  6226. b5 = b0 + 5, b6 = b0 + 6, b7 = b0 + 7;
  6227. return vec_perm(__a, __a,
  6228. (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7,
  6229. b0, b1, b2, b3, b4, b5, b6, b7));
  6230. }
  6231. static vector signed long long __ATTRS_o_ai
  6232. vec_splat(vector signed long long __a, unsigned const int __b) {
  6233. unsigned char b0 = (__b & 0x01) * 8;
  6234. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4,
  6235. b5 = b0 + 5, b6 = b0 + 6, b7 = b0 + 7;
  6236. return vec_perm(__a, __a,
  6237. (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7,
  6238. b0, b1, b2, b3, b4, b5, b6, b7));
  6239. }
  6240. static vector unsigned long long __ATTRS_o_ai
  6241. vec_splat(vector unsigned long long __a, unsigned const int __b) {
  6242. unsigned char b0 = (__b & 0x01) * 8;
  6243. unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4,
  6244. b5 = b0 + 5, b6 = b0 + 6, b7 = b0 + 7;
  6245. return vec_perm(__a, __a,
  6246. (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7,
  6247. b0, b1, b2, b3, b4, b5, b6, b7));
  6248. }
  6249. #endif
  6250. /* vec_vspltb */
  6251. #define __builtin_altivec_vspltb vec_vspltb
  6252. static vector signed char __ATTRS_o_ai vec_vspltb(vector signed char __a,
  6253. unsigned char __b) {
  6254. return vec_perm(__a, __a, (vector unsigned char)(__b));
  6255. }
  6256. static vector unsigned char __ATTRS_o_ai vec_vspltb(vector unsigned char __a,
  6257. unsigned char __b) {
  6258. return vec_perm(__a, __a, (vector unsigned char)(__b));
  6259. }
  6260. static vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
  6261. unsigned char __b) {
  6262. return vec_perm(__a, __a, (vector unsigned char)(__b));
  6263. }
  6264. /* vec_vsplth */
  6265. #define __builtin_altivec_vsplth vec_vsplth
  6266. static vector short __ATTRS_o_ai vec_vsplth(vector short __a,
  6267. unsigned char __b) {
  6268. __b *= 2;
  6269. unsigned char b1 = __b + 1;
  6270. return vec_perm(__a, __a,
  6271. (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
  6272. __b, b1, __b, b1, __b, b1, __b, b1));
  6273. }
  6274. static vector unsigned short __ATTRS_o_ai vec_vsplth(vector unsigned short __a,
  6275. unsigned char __b) {
  6276. __b *= 2;
  6277. unsigned char b1 = __b + 1;
  6278. return vec_perm(__a, __a,
  6279. (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
  6280. __b, b1, __b, b1, __b, b1, __b, b1));
  6281. }
  6282. static vector bool short __ATTRS_o_ai vec_vsplth(vector bool short __a,
  6283. unsigned char __b) {
  6284. __b *= 2;
  6285. unsigned char b1 = __b + 1;
  6286. return vec_perm(__a, __a,
  6287. (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
  6288. __b, b1, __b, b1, __b, b1, __b, b1));
  6289. }
  6290. static vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
  6291. unsigned char __b) {
  6292. __b *= 2;
  6293. unsigned char b1 = __b + 1;
  6294. return vec_perm(__a, __a,
  6295. (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
  6296. __b, b1, __b, b1, __b, b1, __b, b1));
  6297. }
  6298. /* vec_vspltw */
  6299. #define __builtin_altivec_vspltw vec_vspltw
  6300. static vector int __ATTRS_o_ai vec_vspltw(vector int __a, unsigned char __b) {
  6301. __b *= 4;
  6302. unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
  6303. return vec_perm(__a, __a,
  6304. (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
  6305. b1, b2, b3, __b, b1, b2, b3));
  6306. }
  6307. static vector unsigned int __ATTRS_o_ai vec_vspltw(vector unsigned int __a,
  6308. unsigned char __b) {
  6309. __b *= 4;
  6310. unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
  6311. return vec_perm(__a, __a,
  6312. (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
  6313. b1, b2, b3, __b, b1, b2, b3));
  6314. }
  6315. static vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
  6316. unsigned char __b) {
  6317. __b *= 4;
  6318. unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
  6319. return vec_perm(__a, __a,
  6320. (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
  6321. b1, b2, b3, __b, b1, b2, b3));
  6322. }
  6323. static vector float __ATTRS_o_ai vec_vspltw(vector float __a,
  6324. unsigned char __b) {
  6325. __b *= 4;
  6326. unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
  6327. return vec_perm(__a, __a,
  6328. (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
  6329. b1, b2, b3, __b, b1, b2, b3));
  6330. }
  6331. /* vec_splat_s8 */
  6332. #define __builtin_altivec_vspltisb vec_splat_s8
  6333. // FIXME: parameter should be treated as 5-bit signed literal
  6334. static vector signed char __ATTRS_o_ai vec_splat_s8(signed char __a) {
  6335. return (vector signed char)(__a);
  6336. }
  6337. /* vec_vspltisb */
  6338. // FIXME: parameter should be treated as 5-bit signed literal
  6339. static vector signed char __ATTRS_o_ai vec_vspltisb(signed char __a) {
  6340. return (vector signed char)(__a);
  6341. }
  6342. /* vec_splat_s16 */
  6343. #define __builtin_altivec_vspltish vec_splat_s16
  6344. // FIXME: parameter should be treated as 5-bit signed literal
  6345. static vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
  6346. return (vector short)(__a);
  6347. }
  6348. /* vec_vspltish */
  6349. // FIXME: parameter should be treated as 5-bit signed literal
  6350. static vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
  6351. return (vector short)(__a);
  6352. }
  6353. /* vec_splat_s32 */
  6354. #define __builtin_altivec_vspltisw vec_splat_s32
  6355. // FIXME: parameter should be treated as 5-bit signed literal
  6356. static vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
  6357. return (vector int)(__a);
  6358. }
  6359. /* vec_vspltisw */
  6360. // FIXME: parameter should be treated as 5-bit signed literal
  6361. static vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
  6362. return (vector int)(__a);
  6363. }
  6364. /* vec_splat_u8 */
  6365. // FIXME: parameter should be treated as 5-bit signed literal
  6366. static vector unsigned char __ATTRS_o_ai vec_splat_u8(unsigned char __a) {
  6367. return (vector unsigned char)(__a);
  6368. }
  6369. /* vec_splat_u16 */
  6370. // FIXME: parameter should be treated as 5-bit signed literal
  6371. static vector unsigned short __ATTRS_o_ai vec_splat_u16(signed char __a) {
  6372. return (vector unsigned short)(__a);
  6373. }
  6374. /* vec_splat_u32 */
  6375. // FIXME: parameter should be treated as 5-bit signed literal
  6376. static vector unsigned int __ATTRS_o_ai vec_splat_u32(signed char __a) {
  6377. return (vector unsigned int)(__a);
  6378. }
  6379. /* vec_sr */
  6380. static vector signed char __ATTRS_o_ai vec_sr(vector signed char __a,
  6381. vector unsigned char __b) {
  6382. vector unsigned char __res = (vector unsigned char)__a >> __b;
  6383. return (vector signed char)__res;
  6384. }
  6385. static vector unsigned char __ATTRS_o_ai vec_sr(vector unsigned char __a,
  6386. vector unsigned char __b) {
  6387. return __a >> __b;
  6388. }
  6389. static vector signed short __ATTRS_o_ai vec_sr(vector signed short __a,
  6390. vector unsigned short __b) {
  6391. vector unsigned short __res = (vector unsigned short)__a >> __b;
  6392. return (vector signed short)__res;
  6393. }
  6394. static vector unsigned short __ATTRS_o_ai vec_sr(vector unsigned short __a,
  6395. vector unsigned short __b) {
  6396. return __a >> __b;
  6397. }
  6398. static vector signed int __ATTRS_o_ai vec_sr(vector signed int __a,
  6399. vector unsigned int __b) {
  6400. vector unsigned int __res = (vector unsigned int)__a >> __b;
  6401. return (vector signed int)__res;
  6402. }
  6403. static vector unsigned int __ATTRS_o_ai vec_sr(vector unsigned int __a,
  6404. vector unsigned int __b) {
  6405. return __a >> __b;
  6406. }
  6407. #ifdef __POWER8_VECTOR__
  6408. static vector signed long long __ATTRS_o_ai
  6409. vec_sr(vector signed long long __a, vector unsigned long long __b) {
  6410. vector unsigned long long __res = (vector unsigned long long)__a >> __b;
  6411. return (vector signed long long)__res;
  6412. }
  6413. static vector unsigned long long __ATTRS_o_ai
  6414. vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
  6415. return __a >> __b;
  6416. }
  6417. #endif
  6418. /* vec_vsrb */
  6419. #define __builtin_altivec_vsrb vec_vsrb
  6420. static vector signed char __ATTRS_o_ai vec_vsrb(vector signed char __a,
  6421. vector unsigned char __b) {
  6422. return __a >> (vector signed char)__b;
  6423. }
  6424. static vector unsigned char __ATTRS_o_ai vec_vsrb(vector unsigned char __a,
  6425. vector unsigned char __b) {
  6426. return __a >> __b;
  6427. }
  6428. /* vec_vsrh */
  6429. #define __builtin_altivec_vsrh vec_vsrh
  6430. static vector short __ATTRS_o_ai vec_vsrh(vector short __a,
  6431. vector unsigned short __b) {
  6432. return __a >> (vector short)__b;
  6433. }
  6434. static vector unsigned short __ATTRS_o_ai vec_vsrh(vector unsigned short __a,
  6435. vector unsigned short __b) {
  6436. return __a >> __b;
  6437. }
  6438. /* vec_vsrw */
  6439. #define __builtin_altivec_vsrw vec_vsrw
  6440. static vector int __ATTRS_o_ai vec_vsrw(vector int __a,
  6441. vector unsigned int __b) {
  6442. return __a >> (vector int)__b;
  6443. }
  6444. static vector unsigned int __ATTRS_o_ai vec_vsrw(vector unsigned int __a,
  6445. vector unsigned int __b) {
  6446. return __a >> __b;
  6447. }
  6448. /* vec_sra */
  6449. static vector signed char __ATTRS_o_ai vec_sra(vector signed char __a,
  6450. vector unsigned char __b) {
  6451. return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
  6452. }
  6453. static vector unsigned char __ATTRS_o_ai vec_sra(vector unsigned char __a,
  6454. vector unsigned char __b) {
  6455. return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
  6456. }
  6457. static vector short __ATTRS_o_ai vec_sra(vector short __a,
  6458. vector unsigned short __b) {
  6459. return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
  6460. }
  6461. static vector unsigned short __ATTRS_o_ai vec_sra(vector unsigned short __a,
  6462. vector unsigned short __b) {
  6463. return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
  6464. }
  6465. static vector int __ATTRS_o_ai vec_sra(vector int __a,
  6466. vector unsigned int __b) {
  6467. return __builtin_altivec_vsraw(__a, __b);
  6468. }
  6469. static vector unsigned int __ATTRS_o_ai vec_sra(vector unsigned int __a,
  6470. vector unsigned int __b) {
  6471. return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
  6472. }
  6473. #ifdef __POWER8_VECTOR__
  6474. static vector signed long long __ATTRS_o_ai
  6475. vec_sra(vector signed long long __a, vector unsigned long long __b) {
  6476. return __a >> __b;
  6477. }
  6478. static vector unsigned long long __ATTRS_o_ai
  6479. vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
  6480. return (vector unsigned long long)((vector signed long long)__a >> __b);
  6481. }
  6482. #endif
  6483. /* vec_vsrab */
  6484. static vector signed char __ATTRS_o_ai vec_vsrab(vector signed char __a,
  6485. vector unsigned char __b) {
  6486. return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
  6487. }
  6488. static vector unsigned char __ATTRS_o_ai vec_vsrab(vector unsigned char __a,
  6489. vector unsigned char __b) {
  6490. return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
  6491. }
  6492. /* vec_vsrah */
  6493. static vector short __ATTRS_o_ai vec_vsrah(vector short __a,
  6494. vector unsigned short __b) {
  6495. return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
  6496. }
  6497. static vector unsigned short __ATTRS_o_ai vec_vsrah(vector unsigned short __a,
  6498. vector unsigned short __b) {
  6499. return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
  6500. }
  6501. /* vec_vsraw */
  6502. static vector int __ATTRS_o_ai vec_vsraw(vector int __a,
  6503. vector unsigned int __b) {
  6504. return __builtin_altivec_vsraw(__a, __b);
  6505. }
  6506. static vector unsigned int __ATTRS_o_ai vec_vsraw(vector unsigned int __a,
  6507. vector unsigned int __b) {
  6508. return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
  6509. }
  6510. /* vec_srl */
  6511. static vector signed char __ATTRS_o_ai vec_srl(vector signed char __a,
  6512. vector unsigned char __b) {
  6513. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6514. (vector int)__b);
  6515. }
  6516. static vector signed char __ATTRS_o_ai vec_srl(vector signed char __a,
  6517. vector unsigned short __b) {
  6518. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6519. (vector int)__b);
  6520. }
  6521. static vector signed char __ATTRS_o_ai vec_srl(vector signed char __a,
  6522. vector unsigned int __b) {
  6523. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6524. (vector int)__b);
  6525. }
  6526. static vector unsigned char __ATTRS_o_ai vec_srl(vector unsigned char __a,
  6527. vector unsigned char __b) {
  6528. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6529. (vector int)__b);
  6530. }
  6531. static vector unsigned char __ATTRS_o_ai vec_srl(vector unsigned char __a,
  6532. vector unsigned short __b) {
  6533. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6534. (vector int)__b);
  6535. }
  6536. static vector unsigned char __ATTRS_o_ai vec_srl(vector unsigned char __a,
  6537. vector unsigned int __b) {
  6538. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6539. (vector int)__b);
  6540. }
  6541. static vector bool char __ATTRS_o_ai vec_srl(vector bool char __a,
  6542. vector unsigned char __b) {
  6543. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6544. (vector int)__b);
  6545. }
  6546. static vector bool char __ATTRS_o_ai vec_srl(vector bool char __a,
  6547. vector unsigned short __b) {
  6548. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6549. (vector int)__b);
  6550. }
  6551. static vector bool char __ATTRS_o_ai vec_srl(vector bool char __a,
  6552. vector unsigned int __b) {
  6553. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6554. (vector int)__b);
  6555. }
  6556. static vector short __ATTRS_o_ai vec_srl(vector short __a,
  6557. vector unsigned char __b) {
  6558. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6559. }
  6560. static vector short __ATTRS_o_ai vec_srl(vector short __a,
  6561. vector unsigned short __b) {
  6562. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6563. }
  6564. static vector short __ATTRS_o_ai vec_srl(vector short __a,
  6565. vector unsigned int __b) {
  6566. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6567. }
  6568. static vector unsigned short __ATTRS_o_ai vec_srl(vector unsigned short __a,
  6569. vector unsigned char __b) {
  6570. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6571. (vector int)__b);
  6572. }
  6573. static vector unsigned short __ATTRS_o_ai vec_srl(vector unsigned short __a,
  6574. vector unsigned short __b) {
  6575. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6576. (vector int)__b);
  6577. }
  6578. static vector unsigned short __ATTRS_o_ai vec_srl(vector unsigned short __a,
  6579. vector unsigned int __b) {
  6580. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6581. (vector int)__b);
  6582. }
  6583. static vector bool short __ATTRS_o_ai vec_srl(vector bool short __a,
  6584. vector unsigned char __b) {
  6585. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6586. (vector int)__b);
  6587. }
  6588. static vector bool short __ATTRS_o_ai vec_srl(vector bool short __a,
  6589. vector unsigned short __b) {
  6590. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6591. (vector int)__b);
  6592. }
  6593. static vector bool short __ATTRS_o_ai vec_srl(vector bool short __a,
  6594. vector unsigned int __b) {
  6595. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6596. (vector int)__b);
  6597. }
  6598. static vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
  6599. vector unsigned char __b) {
  6600. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6601. }
  6602. static vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
  6603. vector unsigned short __b) {
  6604. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6605. }
  6606. static vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
  6607. vector unsigned int __b) {
  6608. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6609. }
  6610. static vector int __ATTRS_o_ai vec_srl(vector int __a,
  6611. vector unsigned char __b) {
  6612. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6613. }
  6614. static vector int __ATTRS_o_ai vec_srl(vector int __a,
  6615. vector unsigned short __b) {
  6616. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6617. }
  6618. static vector int __ATTRS_o_ai vec_srl(vector int __a,
  6619. vector unsigned int __b) {
  6620. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6621. }
  6622. static vector unsigned int __ATTRS_o_ai vec_srl(vector unsigned int __a,
  6623. vector unsigned char __b) {
  6624. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6625. (vector int)__b);
  6626. }
  6627. static vector unsigned int __ATTRS_o_ai vec_srl(vector unsigned int __a,
  6628. vector unsigned short __b) {
  6629. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6630. (vector int)__b);
  6631. }
  6632. static vector unsigned int __ATTRS_o_ai vec_srl(vector unsigned int __a,
  6633. vector unsigned int __b) {
  6634. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6635. (vector int)__b);
  6636. }
  6637. static vector bool int __ATTRS_o_ai vec_srl(vector bool int __a,
  6638. vector unsigned char __b) {
  6639. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6640. (vector int)__b);
  6641. }
  6642. static vector bool int __ATTRS_o_ai vec_srl(vector bool int __a,
  6643. vector unsigned short __b) {
  6644. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6645. (vector int)__b);
  6646. }
  6647. static vector bool int __ATTRS_o_ai vec_srl(vector bool int __a,
  6648. vector unsigned int __b) {
  6649. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6650. (vector int)__b);
  6651. }
  6652. /* vec_vsr */
  6653. static vector signed char __ATTRS_o_ai vec_vsr(vector signed char __a,
  6654. vector unsigned char __b) {
  6655. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6656. (vector int)__b);
  6657. }
  6658. static vector signed char __ATTRS_o_ai vec_vsr(vector signed char __a,
  6659. vector unsigned short __b) {
  6660. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6661. (vector int)__b);
  6662. }
  6663. static vector signed char __ATTRS_o_ai vec_vsr(vector signed char __a,
  6664. vector unsigned int __b) {
  6665. return (vector signed char)__builtin_altivec_vsr((vector int)__a,
  6666. (vector int)__b);
  6667. }
  6668. static vector unsigned char __ATTRS_o_ai vec_vsr(vector unsigned char __a,
  6669. vector unsigned char __b) {
  6670. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6671. (vector int)__b);
  6672. }
  6673. static vector unsigned char __ATTRS_o_ai vec_vsr(vector unsigned char __a,
  6674. vector unsigned short __b) {
  6675. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6676. (vector int)__b);
  6677. }
  6678. static vector unsigned char __ATTRS_o_ai vec_vsr(vector unsigned char __a,
  6679. vector unsigned int __b) {
  6680. return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
  6681. (vector int)__b);
  6682. }
  6683. static vector bool char __ATTRS_o_ai vec_vsr(vector bool char __a,
  6684. vector unsigned char __b) {
  6685. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6686. (vector int)__b);
  6687. }
  6688. static vector bool char __ATTRS_o_ai vec_vsr(vector bool char __a,
  6689. vector unsigned short __b) {
  6690. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6691. (vector int)__b);
  6692. }
  6693. static vector bool char __ATTRS_o_ai vec_vsr(vector bool char __a,
  6694. vector unsigned int __b) {
  6695. return (vector bool char)__builtin_altivec_vsr((vector int)__a,
  6696. (vector int)__b);
  6697. }
  6698. static vector short __ATTRS_o_ai vec_vsr(vector short __a,
  6699. vector unsigned char __b) {
  6700. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6701. }
  6702. static vector short __ATTRS_o_ai vec_vsr(vector short __a,
  6703. vector unsigned short __b) {
  6704. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6705. }
  6706. static vector short __ATTRS_o_ai vec_vsr(vector short __a,
  6707. vector unsigned int __b) {
  6708. return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6709. }
  6710. static vector unsigned short __ATTRS_o_ai vec_vsr(vector unsigned short __a,
  6711. vector unsigned char __b) {
  6712. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6713. (vector int)__b);
  6714. }
  6715. static vector unsigned short __ATTRS_o_ai vec_vsr(vector unsigned short __a,
  6716. vector unsigned short __b) {
  6717. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6718. (vector int)__b);
  6719. }
  6720. static vector unsigned short __ATTRS_o_ai vec_vsr(vector unsigned short __a,
  6721. vector unsigned int __b) {
  6722. return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
  6723. (vector int)__b);
  6724. }
  6725. static vector bool short __ATTRS_o_ai vec_vsr(vector bool short __a,
  6726. vector unsigned char __b) {
  6727. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6728. (vector int)__b);
  6729. }
  6730. static vector bool short __ATTRS_o_ai vec_vsr(vector bool short __a,
  6731. vector unsigned short __b) {
  6732. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6733. (vector int)__b);
  6734. }
  6735. static vector bool short __ATTRS_o_ai vec_vsr(vector bool short __a,
  6736. vector unsigned int __b) {
  6737. return (vector bool short)__builtin_altivec_vsr((vector int)__a,
  6738. (vector int)__b);
  6739. }
  6740. static vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
  6741. vector unsigned char __b) {
  6742. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6743. }
  6744. static vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
  6745. vector unsigned short __b) {
  6746. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6747. }
  6748. static vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
  6749. vector unsigned int __b) {
  6750. return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
  6751. }
  6752. static vector int __ATTRS_o_ai vec_vsr(vector int __a,
  6753. vector unsigned char __b) {
  6754. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6755. }
  6756. static vector int __ATTRS_o_ai vec_vsr(vector int __a,
  6757. vector unsigned short __b) {
  6758. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6759. }
  6760. static vector int __ATTRS_o_ai vec_vsr(vector int __a,
  6761. vector unsigned int __b) {
  6762. return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
  6763. }
  6764. static vector unsigned int __ATTRS_o_ai vec_vsr(vector unsigned int __a,
  6765. vector unsigned char __b) {
  6766. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6767. (vector int)__b);
  6768. }
  6769. static vector unsigned int __ATTRS_o_ai vec_vsr(vector unsigned int __a,
  6770. vector unsigned short __b) {
  6771. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6772. (vector int)__b);
  6773. }
  6774. static vector unsigned int __ATTRS_o_ai vec_vsr(vector unsigned int __a,
  6775. vector unsigned int __b) {
  6776. return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
  6777. (vector int)__b);
  6778. }
  6779. static vector bool int __ATTRS_o_ai vec_vsr(vector bool int __a,
  6780. vector unsigned char __b) {
  6781. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6782. (vector int)__b);
  6783. }
  6784. static vector bool int __ATTRS_o_ai vec_vsr(vector bool int __a,
  6785. vector unsigned short __b) {
  6786. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6787. (vector int)__b);
  6788. }
  6789. static vector bool int __ATTRS_o_ai vec_vsr(vector bool int __a,
  6790. vector unsigned int __b) {
  6791. return (vector bool int)__builtin_altivec_vsr((vector int)__a,
  6792. (vector int)__b);
  6793. }
  6794. /* vec_sro */
  6795. static vector signed char __ATTRS_o_ai vec_sro(vector signed char __a,
  6796. vector signed char __b) {
  6797. return (vector signed char)__builtin_altivec_vsro((vector int)__a,
  6798. (vector int)__b);
  6799. }
  6800. static vector signed char __ATTRS_o_ai vec_sro(vector signed char __a,
  6801. vector unsigned char __b) {
  6802. return (vector signed char)__builtin_altivec_vsro((vector int)__a,
  6803. (vector int)__b);
  6804. }
  6805. static vector unsigned char __ATTRS_o_ai vec_sro(vector unsigned char __a,
  6806. vector signed char __b) {
  6807. return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
  6808. (vector int)__b);
  6809. }
  6810. static vector unsigned char __ATTRS_o_ai vec_sro(vector unsigned char __a,
  6811. vector unsigned char __b) {
  6812. return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
  6813. (vector int)__b);
  6814. }
  6815. static vector short __ATTRS_o_ai vec_sro(vector short __a,
  6816. vector signed char __b) {
  6817. return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6818. }
  6819. static vector short __ATTRS_o_ai vec_sro(vector short __a,
  6820. vector unsigned char __b) {
  6821. return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6822. }
  6823. static vector unsigned short __ATTRS_o_ai vec_sro(vector unsigned short __a,
  6824. vector signed char __b) {
  6825. return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
  6826. (vector int)__b);
  6827. }
  6828. static vector unsigned short __ATTRS_o_ai vec_sro(vector unsigned short __a,
  6829. vector unsigned char __b) {
  6830. return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
  6831. (vector int)__b);
  6832. }
  6833. static vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
  6834. vector signed char __b) {
  6835. return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6836. }
  6837. static vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
  6838. vector unsigned char __b) {
  6839. return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6840. }
  6841. static vector int __ATTRS_o_ai vec_sro(vector int __a, vector signed char __b) {
  6842. return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
  6843. }
  6844. static vector int __ATTRS_o_ai vec_sro(vector int __a,
  6845. vector unsigned char __b) {
  6846. return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
  6847. }
  6848. static vector unsigned int __ATTRS_o_ai vec_sro(vector unsigned int __a,
  6849. vector signed char __b) {
  6850. return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
  6851. (vector int)__b);
  6852. }
  6853. static vector unsigned int __ATTRS_o_ai vec_sro(vector unsigned int __a,
  6854. vector unsigned char __b) {
  6855. return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
  6856. (vector int)__b);
  6857. }
  6858. static vector float __ATTRS_o_ai vec_sro(vector float __a,
  6859. vector signed char __b) {
  6860. return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6861. }
  6862. static vector float __ATTRS_o_ai vec_sro(vector float __a,
  6863. vector unsigned char __b) {
  6864. return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6865. }
  6866. /* vec_vsro */
  6867. static vector signed char __ATTRS_o_ai vec_vsro(vector signed char __a,
  6868. vector signed char __b) {
  6869. return (vector signed char)__builtin_altivec_vsro((vector int)__a,
  6870. (vector int)__b);
  6871. }
  6872. static vector signed char __ATTRS_o_ai vec_vsro(vector signed char __a,
  6873. vector unsigned char __b) {
  6874. return (vector signed char)__builtin_altivec_vsro((vector int)__a,
  6875. (vector int)__b);
  6876. }
  6877. static vector unsigned char __ATTRS_o_ai vec_vsro(vector unsigned char __a,
  6878. vector signed char __b) {
  6879. return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
  6880. (vector int)__b);
  6881. }
  6882. static vector unsigned char __ATTRS_o_ai vec_vsro(vector unsigned char __a,
  6883. vector unsigned char __b) {
  6884. return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
  6885. (vector int)__b);
  6886. }
  6887. static vector short __ATTRS_o_ai vec_vsro(vector short __a,
  6888. vector signed char __b) {
  6889. return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6890. }
  6891. static vector short __ATTRS_o_ai vec_vsro(vector short __a,
  6892. vector unsigned char __b) {
  6893. return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6894. }
  6895. static vector unsigned short __ATTRS_o_ai vec_vsro(vector unsigned short __a,
  6896. vector signed char __b) {
  6897. return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
  6898. (vector int)__b);
  6899. }
  6900. static vector unsigned short __ATTRS_o_ai vec_vsro(vector unsigned short __a,
  6901. vector unsigned char __b) {
  6902. return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
  6903. (vector int)__b);
  6904. }
  6905. static vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
  6906. vector signed char __b) {
  6907. return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6908. }
  6909. static vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
  6910. vector unsigned char __b) {
  6911. return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6912. }
  6913. static vector int __ATTRS_o_ai vec_vsro(vector int __a,
  6914. vector signed char __b) {
  6915. return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
  6916. }
  6917. static vector int __ATTRS_o_ai vec_vsro(vector int __a,
  6918. vector unsigned char __b) {
  6919. return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
  6920. }
  6921. static vector unsigned int __ATTRS_o_ai vec_vsro(vector unsigned int __a,
  6922. vector signed char __b) {
  6923. return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
  6924. (vector int)__b);
  6925. }
  6926. static vector unsigned int __ATTRS_o_ai vec_vsro(vector unsigned int __a,
  6927. vector unsigned char __b) {
  6928. return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
  6929. (vector int)__b);
  6930. }
  6931. static vector float __ATTRS_o_ai vec_vsro(vector float __a,
  6932. vector signed char __b) {
  6933. return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6934. }
  6935. static vector float __ATTRS_o_ai vec_vsro(vector float __a,
  6936. vector unsigned char __b) {
  6937. return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
  6938. }
  6939. /* vec_st */
  6940. static void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
  6941. vector signed char *__c) {
  6942. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6943. }
  6944. static void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
  6945. signed char *__c) {
  6946. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6947. }
  6948. static void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
  6949. vector unsigned char *__c) {
  6950. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6951. }
  6952. static void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
  6953. unsigned char *__c) {
  6954. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6955. }
  6956. static void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
  6957. signed char *__c) {
  6958. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6959. }
  6960. static void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
  6961. unsigned char *__c) {
  6962. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6963. }
  6964. static void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
  6965. vector bool char *__c) {
  6966. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6967. }
  6968. static void __ATTRS_o_ai vec_st(vector short __a, int __b, vector short *__c) {
  6969. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6970. }
  6971. static void __ATTRS_o_ai vec_st(vector short __a, int __b, short *__c) {
  6972. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6973. }
  6974. static void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
  6975. vector unsigned short *__c) {
  6976. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6977. }
  6978. static void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
  6979. unsigned short *__c) {
  6980. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6981. }
  6982. static void __ATTRS_o_ai vec_st(vector bool short __a, int __b, short *__c) {
  6983. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6984. }
  6985. static void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
  6986. unsigned short *__c) {
  6987. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6988. }
  6989. static void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
  6990. vector bool short *__c) {
  6991. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6992. }
  6993. static void __ATTRS_o_ai vec_st(vector pixel __a, int __b, short *__c) {
  6994. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6995. }
  6996. static void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
  6997. unsigned short *__c) {
  6998. __builtin_altivec_stvx((vector int)__a, __b, __c);
  6999. }
  7000. static void __ATTRS_o_ai vec_st(vector pixel __a, int __b, vector pixel *__c) {
  7001. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7002. }
  7003. static void __ATTRS_o_ai vec_st(vector int __a, int __b, vector int *__c) {
  7004. __builtin_altivec_stvx(__a, __b, __c);
  7005. }
  7006. static void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
  7007. __builtin_altivec_stvx(__a, __b, __c);
  7008. }
  7009. static void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
  7010. vector unsigned int *__c) {
  7011. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7012. }
  7013. static void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
  7014. unsigned int *__c) {
  7015. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7016. }
  7017. static void __ATTRS_o_ai vec_st(vector bool int __a, int __b, int *__c) {
  7018. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7019. }
  7020. static void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
  7021. unsigned int *__c) {
  7022. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7023. }
  7024. static void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
  7025. vector bool int *__c) {
  7026. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7027. }
  7028. static void __ATTRS_o_ai vec_st(vector float __a, int __b, vector float *__c) {
  7029. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7030. }
  7031. static void __ATTRS_o_ai vec_st(vector float __a, int __b, float *__c) {
  7032. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7033. }
  7034. /* vec_stvx */
  7035. static void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
  7036. vector signed char *__c) {
  7037. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7038. }
  7039. static void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
  7040. signed char *__c) {
  7041. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7042. }
  7043. static void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
  7044. vector unsigned char *__c) {
  7045. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7046. }
  7047. static void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
  7048. unsigned char *__c) {
  7049. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7050. }
  7051. static void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
  7052. signed char *__c) {
  7053. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7054. }
  7055. static void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
  7056. unsigned char *__c) {
  7057. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7058. }
  7059. static void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
  7060. vector bool char *__c) {
  7061. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7062. }
  7063. static void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
  7064. vector short *__c) {
  7065. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7066. }
  7067. static void __ATTRS_o_ai vec_stvx(vector short __a, int __b, short *__c) {
  7068. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7069. }
  7070. static void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
  7071. vector unsigned short *__c) {
  7072. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7073. }
  7074. static void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
  7075. unsigned short *__c) {
  7076. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7077. }
  7078. static void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b, short *__c) {
  7079. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7080. }
  7081. static void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
  7082. unsigned short *__c) {
  7083. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7084. }
  7085. static void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
  7086. vector bool short *__c) {
  7087. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7088. }
  7089. static void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b, short *__c) {
  7090. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7091. }
  7092. static void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
  7093. unsigned short *__c) {
  7094. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7095. }
  7096. static void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
  7097. vector pixel *__c) {
  7098. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7099. }
  7100. static void __ATTRS_o_ai vec_stvx(vector int __a, int __b, vector int *__c) {
  7101. __builtin_altivec_stvx(__a, __b, __c);
  7102. }
  7103. static void __ATTRS_o_ai vec_stvx(vector int __a, int __b, int *__c) {
  7104. __builtin_altivec_stvx(__a, __b, __c);
  7105. }
  7106. static void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
  7107. vector unsigned int *__c) {
  7108. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7109. }
  7110. static void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
  7111. unsigned int *__c) {
  7112. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7113. }
  7114. static void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b, int *__c) {
  7115. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7116. }
  7117. static void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
  7118. unsigned int *__c) {
  7119. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7120. }
  7121. static void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
  7122. vector bool int *__c) {
  7123. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7124. }
  7125. static void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
  7126. vector float *__c) {
  7127. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7128. }
  7129. static void __ATTRS_o_ai vec_stvx(vector float __a, int __b, float *__c) {
  7130. __builtin_altivec_stvx((vector int)__a, __b, __c);
  7131. }
  7132. /* vec_ste */
  7133. static void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
  7134. signed char *__c) {
  7135. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7136. }
  7137. static void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
  7138. unsigned char *__c) {
  7139. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7140. }
  7141. static void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
  7142. signed char *__c) {
  7143. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7144. }
  7145. static void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
  7146. unsigned char *__c) {
  7147. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7148. }
  7149. static void __ATTRS_o_ai vec_ste(vector short __a, int __b, short *__c) {
  7150. __builtin_altivec_stvehx(__a, __b, __c);
  7151. }
  7152. static void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
  7153. unsigned short *__c) {
  7154. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7155. }
  7156. static void __ATTRS_o_ai vec_ste(vector bool short __a, int __b, short *__c) {
  7157. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7158. }
  7159. static void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
  7160. unsigned short *__c) {
  7161. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7162. }
  7163. static void __ATTRS_o_ai vec_ste(vector pixel __a, int __b, short *__c) {
  7164. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7165. }
  7166. static void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
  7167. unsigned short *__c) {
  7168. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7169. }
  7170. static void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
  7171. __builtin_altivec_stvewx(__a, __b, __c);
  7172. }
  7173. static void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
  7174. unsigned int *__c) {
  7175. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7176. }
  7177. static void __ATTRS_o_ai vec_ste(vector bool int __a, int __b, int *__c) {
  7178. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7179. }
  7180. static void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
  7181. unsigned int *__c) {
  7182. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7183. }
  7184. static void __ATTRS_o_ai vec_ste(vector float __a, int __b, float *__c) {
  7185. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7186. }
  7187. /* vec_stvebx */
  7188. static void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
  7189. signed char *__c) {
  7190. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7191. }
  7192. static void __ATTRS_o_ai vec_stvebx(vector unsigned char __a, int __b,
  7193. unsigned char *__c) {
  7194. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7195. }
  7196. static void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
  7197. signed char *__c) {
  7198. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7199. }
  7200. static void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
  7201. unsigned char *__c) {
  7202. __builtin_altivec_stvebx((vector char)__a, __b, __c);
  7203. }
  7204. /* vec_stvehx */
  7205. static void __ATTRS_o_ai vec_stvehx(vector short __a, int __b, short *__c) {
  7206. __builtin_altivec_stvehx(__a, __b, __c);
  7207. }
  7208. static void __ATTRS_o_ai vec_stvehx(vector unsigned short __a, int __b,
  7209. unsigned short *__c) {
  7210. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7211. }
  7212. static void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
  7213. short *__c) {
  7214. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7215. }
  7216. static void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
  7217. unsigned short *__c) {
  7218. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7219. }
  7220. static void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b, short *__c) {
  7221. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7222. }
  7223. static void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
  7224. unsigned short *__c) {
  7225. __builtin_altivec_stvehx((vector short)__a, __b, __c);
  7226. }
  7227. /* vec_stvewx */
  7228. static void __ATTRS_o_ai vec_stvewx(vector int __a, int __b, int *__c) {
  7229. __builtin_altivec_stvewx(__a, __b, __c);
  7230. }
  7231. static void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
  7232. unsigned int *__c) {
  7233. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7234. }
  7235. static void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b, int *__c) {
  7236. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7237. }
  7238. static void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
  7239. unsigned int *__c) {
  7240. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7241. }
  7242. static void __ATTRS_o_ai vec_stvewx(vector float __a, int __b, float *__c) {
  7243. __builtin_altivec_stvewx((vector int)__a, __b, __c);
  7244. }
  7245. /* vec_stl */
  7246. static void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
  7247. vector signed char *__c) {
  7248. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7249. }
  7250. static void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
  7251. signed char *__c) {
  7252. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7253. }
  7254. static void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
  7255. vector unsigned char *__c) {
  7256. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7257. }
  7258. static void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
  7259. unsigned char *__c) {
  7260. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7261. }
  7262. static void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
  7263. signed char *__c) {
  7264. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7265. }
  7266. static void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
  7267. unsigned char *__c) {
  7268. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7269. }
  7270. static void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
  7271. vector bool char *__c) {
  7272. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7273. }
  7274. static void __ATTRS_o_ai vec_stl(vector short __a, int __b, vector short *__c) {
  7275. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7276. }
  7277. static void __ATTRS_o_ai vec_stl(vector short __a, int __b, short *__c) {
  7278. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7279. }
  7280. static void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
  7281. vector unsigned short *__c) {
  7282. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7283. }
  7284. static void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
  7285. unsigned short *__c) {
  7286. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7287. }
  7288. static void __ATTRS_o_ai vec_stl(vector bool short __a, int __b, short *__c) {
  7289. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7290. }
  7291. static void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
  7292. unsigned short *__c) {
  7293. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7294. }
  7295. static void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
  7296. vector bool short *__c) {
  7297. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7298. }
  7299. static void __ATTRS_o_ai vec_stl(vector pixel __a, int __b, short *__c) {
  7300. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7301. }
  7302. static void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
  7303. unsigned short *__c) {
  7304. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7305. }
  7306. static void __ATTRS_o_ai vec_stl(vector pixel __a, int __b, vector pixel *__c) {
  7307. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7308. }
  7309. static void __ATTRS_o_ai vec_stl(vector int __a, int __b, vector int *__c) {
  7310. __builtin_altivec_stvxl(__a, __b, __c);
  7311. }
  7312. static void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
  7313. __builtin_altivec_stvxl(__a, __b, __c);
  7314. }
  7315. static void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
  7316. vector unsigned int *__c) {
  7317. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7318. }
  7319. static void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
  7320. unsigned int *__c) {
  7321. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7322. }
  7323. static void __ATTRS_o_ai vec_stl(vector bool int __a, int __b, int *__c) {
  7324. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7325. }
  7326. static void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
  7327. unsigned int *__c) {
  7328. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7329. }
  7330. static void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
  7331. vector bool int *__c) {
  7332. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7333. }
  7334. static void __ATTRS_o_ai vec_stl(vector float __a, int __b, vector float *__c) {
  7335. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7336. }
  7337. static void __ATTRS_o_ai vec_stl(vector float __a, int __b, float *__c) {
  7338. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7339. }
  7340. /* vec_stvxl */
  7341. static void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
  7342. vector signed char *__c) {
  7343. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7344. }
  7345. static void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
  7346. signed char *__c) {
  7347. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7348. }
  7349. static void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
  7350. vector unsigned char *__c) {
  7351. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7352. }
  7353. static void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
  7354. unsigned char *__c) {
  7355. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7356. }
  7357. static void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
  7358. signed char *__c) {
  7359. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7360. }
  7361. static void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
  7362. unsigned char *__c) {
  7363. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7364. }
  7365. static void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
  7366. vector bool char *__c) {
  7367. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7368. }
  7369. static void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
  7370. vector short *__c) {
  7371. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7372. }
  7373. static void __ATTRS_o_ai vec_stvxl(vector short __a, int __b, short *__c) {
  7374. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7375. }
  7376. static void __ATTRS_o_ai vec_stvxl(vector unsigned short __a, int __b,
  7377. vector unsigned short *__c) {
  7378. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7379. }
  7380. static void __ATTRS_o_ai vec_stvxl(vector unsigned short __a, int __b,
  7381. unsigned short *__c) {
  7382. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7383. }
  7384. static void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b, short *__c) {
  7385. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7386. }
  7387. static void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
  7388. unsigned short *__c) {
  7389. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7390. }
  7391. static void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
  7392. vector bool short *__c) {
  7393. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7394. }
  7395. static void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b, short *__c) {
  7396. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7397. }
  7398. static void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
  7399. unsigned short *__c) {
  7400. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7401. }
  7402. static void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
  7403. vector pixel *__c) {
  7404. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7405. }
  7406. static void __ATTRS_o_ai vec_stvxl(vector int __a, int __b, vector int *__c) {
  7407. __builtin_altivec_stvxl(__a, __b, __c);
  7408. }
  7409. static void __ATTRS_o_ai vec_stvxl(vector int __a, int __b, int *__c) {
  7410. __builtin_altivec_stvxl(__a, __b, __c);
  7411. }
  7412. static void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
  7413. vector unsigned int *__c) {
  7414. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7415. }
  7416. static void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
  7417. unsigned int *__c) {
  7418. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7419. }
  7420. static void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b, int *__c) {
  7421. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7422. }
  7423. static void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
  7424. unsigned int *__c) {
  7425. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7426. }
  7427. static void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
  7428. vector bool int *__c) {
  7429. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7430. }
  7431. static void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
  7432. vector float *__c) {
  7433. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7434. }
  7435. static void __ATTRS_o_ai vec_stvxl(vector float __a, int __b, float *__c) {
  7436. __builtin_altivec_stvxl((vector int)__a, __b, __c);
  7437. }
  7438. /* vec_sub */
  7439. static vector signed char __ATTRS_o_ai vec_sub(vector signed char __a,
  7440. vector signed char __b) {
  7441. return __a - __b;
  7442. }
  7443. static vector signed char __ATTRS_o_ai vec_sub(vector bool char __a,
  7444. vector signed char __b) {
  7445. return (vector signed char)__a - __b;
  7446. }
  7447. static vector signed char __ATTRS_o_ai vec_sub(vector signed char __a,
  7448. vector bool char __b) {
  7449. return __a - (vector signed char)__b;
  7450. }
  7451. static vector unsigned char __ATTRS_o_ai vec_sub(vector unsigned char __a,
  7452. vector unsigned char __b) {
  7453. return __a - __b;
  7454. }
  7455. static vector unsigned char __ATTRS_o_ai vec_sub(vector bool char __a,
  7456. vector unsigned char __b) {
  7457. return (vector unsigned char)__a - __b;
  7458. }
  7459. static vector unsigned char __ATTRS_o_ai vec_sub(vector unsigned char __a,
  7460. vector bool char __b) {
  7461. return __a - (vector unsigned char)__b;
  7462. }
  7463. static vector short __ATTRS_o_ai vec_sub(vector short __a, vector short __b) {
  7464. return __a - __b;
  7465. }
  7466. static vector short __ATTRS_o_ai vec_sub(vector bool short __a,
  7467. vector short __b) {
  7468. return (vector short)__a - __b;
  7469. }
  7470. static vector short __ATTRS_o_ai vec_sub(vector short __a,
  7471. vector bool short __b) {
  7472. return __a - (vector short)__b;
  7473. }
  7474. static vector unsigned short __ATTRS_o_ai vec_sub(vector unsigned short __a,
  7475. vector unsigned short __b) {
  7476. return __a - __b;
  7477. }
  7478. static vector unsigned short __ATTRS_o_ai vec_sub(vector bool short __a,
  7479. vector unsigned short __b) {
  7480. return (vector unsigned short)__a - __b;
  7481. }
  7482. static vector unsigned short __ATTRS_o_ai vec_sub(vector unsigned short __a,
  7483. vector bool short __b) {
  7484. return __a - (vector unsigned short)__b;
  7485. }
  7486. static vector int __ATTRS_o_ai vec_sub(vector int __a, vector int __b) {
  7487. return __a - __b;
  7488. }
  7489. static vector int __ATTRS_o_ai vec_sub(vector bool int __a, vector int __b) {
  7490. return (vector int)__a - __b;
  7491. }
  7492. static vector int __ATTRS_o_ai vec_sub(vector int __a, vector bool int __b) {
  7493. return __a - (vector int)__b;
  7494. }
  7495. static vector unsigned int __ATTRS_o_ai vec_sub(vector unsigned int __a,
  7496. vector unsigned int __b) {
  7497. return __a - __b;
  7498. }
  7499. static vector unsigned int __ATTRS_o_ai vec_sub(vector bool int __a,
  7500. vector unsigned int __b) {
  7501. return (vector unsigned int)__a - __b;
  7502. }
  7503. static vector unsigned int __ATTRS_o_ai vec_sub(vector unsigned int __a,
  7504. vector bool int __b) {
  7505. return __a - (vector unsigned int)__b;
  7506. }
  7507. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7508. static vector signed __int128 __ATTRS_o_ai vec_sub(vector signed __int128 __a,
  7509. vector signed __int128 __b) {
  7510. return __a - __b;
  7511. }
  7512. static vector unsigned __int128 __ATTRS_o_ai
  7513. vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  7514. return __a - __b;
  7515. }
  7516. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7517. static vector float __ATTRS_o_ai vec_sub(vector float __a, vector float __b) {
  7518. return __a - __b;
  7519. }
  7520. #ifdef __VSX__
  7521. static vector double __ATTRS_o_ai
  7522. vec_sub(vector double __a, vector double __b) {
  7523. return __a - __b;
  7524. }
  7525. #endif
  7526. /* vec_vsububm */
  7527. #define __builtin_altivec_vsububm vec_vsububm
  7528. static vector signed char __ATTRS_o_ai vec_vsububm(vector signed char __a,
  7529. vector signed char __b) {
  7530. return __a - __b;
  7531. }
  7532. static vector signed char __ATTRS_o_ai vec_vsububm(vector bool char __a,
  7533. vector signed char __b) {
  7534. return (vector signed char)__a - __b;
  7535. }
  7536. static vector signed char __ATTRS_o_ai vec_vsububm(vector signed char __a,
  7537. vector bool char __b) {
  7538. return __a - (vector signed char)__b;
  7539. }
  7540. static vector unsigned char __ATTRS_o_ai vec_vsububm(vector unsigned char __a,
  7541. vector unsigned char __b) {
  7542. return __a - __b;
  7543. }
  7544. static vector unsigned char __ATTRS_o_ai vec_vsububm(vector bool char __a,
  7545. vector unsigned char __b) {
  7546. return (vector unsigned char)__a - __b;
  7547. }
  7548. static vector unsigned char __ATTRS_o_ai vec_vsububm(vector unsigned char __a,
  7549. vector bool char __b) {
  7550. return __a - (vector unsigned char)__b;
  7551. }
  7552. /* vec_vsubuhm */
  7553. #define __builtin_altivec_vsubuhm vec_vsubuhm
  7554. static vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
  7555. vector short __b) {
  7556. return __a - __b;
  7557. }
  7558. static vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
  7559. vector short __b) {
  7560. return (vector short)__a - __b;
  7561. }
  7562. static vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
  7563. vector bool short __b) {
  7564. return __a - (vector short)__b;
  7565. }
  7566. static vector unsigned short __ATTRS_o_ai
  7567. vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
  7568. return __a - __b;
  7569. }
  7570. static vector unsigned short __ATTRS_o_ai
  7571. vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
  7572. return (vector unsigned short)__a - __b;
  7573. }
  7574. static vector unsigned short __ATTRS_o_ai vec_vsubuhm(vector unsigned short __a,
  7575. vector bool short __b) {
  7576. return __a - (vector unsigned short)__b;
  7577. }
  7578. /* vec_vsubuwm */
  7579. #define __builtin_altivec_vsubuwm vec_vsubuwm
  7580. static vector int __ATTRS_o_ai vec_vsubuwm(vector int __a, vector int __b) {
  7581. return __a - __b;
  7582. }
  7583. static vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
  7584. vector int __b) {
  7585. return (vector int)__a - __b;
  7586. }
  7587. static vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
  7588. vector bool int __b) {
  7589. return __a - (vector int)__b;
  7590. }
  7591. static vector unsigned int __ATTRS_o_ai vec_vsubuwm(vector unsigned int __a,
  7592. vector unsigned int __b) {
  7593. return __a - __b;
  7594. }
  7595. static vector unsigned int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
  7596. vector unsigned int __b) {
  7597. return (vector unsigned int)__a - __b;
  7598. }
  7599. static vector unsigned int __ATTRS_o_ai vec_vsubuwm(vector unsigned int __a,
  7600. vector bool int __b) {
  7601. return __a - (vector unsigned int)__b;
  7602. }
  7603. /* vec_vsubfp */
  7604. #define __builtin_altivec_vsubfp vec_vsubfp
  7605. static vector float __attribute__((__always_inline__))
  7606. vec_vsubfp(vector float __a, vector float __b) {
  7607. return __a - __b;
  7608. }
  7609. /* vec_subc */
  7610. static vector unsigned int __ATTRS_o_ai vec_subc(vector unsigned int __a,
  7611. vector unsigned int __b) {
  7612. return __builtin_altivec_vsubcuw(__a, __b);
  7613. }
  7614. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7615. static vector unsigned __int128 __ATTRS_o_ai
  7616. vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  7617. return __builtin_altivec_vsubcuq(__a, __b);
  7618. }
  7619. static vector signed __int128 __ATTRS_o_ai
  7620. vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
  7621. return __builtin_altivec_vsubcuq(__a, __b);
  7622. }
  7623. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7624. /* vec_vsubcuw */
  7625. static vector unsigned int __attribute__((__always_inline__))
  7626. vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
  7627. return __builtin_altivec_vsubcuw(__a, __b);
  7628. }
  7629. /* vec_subs */
  7630. static vector signed char __ATTRS_o_ai vec_subs(vector signed char __a,
  7631. vector signed char __b) {
  7632. return __builtin_altivec_vsubsbs(__a, __b);
  7633. }
  7634. static vector signed char __ATTRS_o_ai vec_subs(vector bool char __a,
  7635. vector signed char __b) {
  7636. return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
  7637. }
  7638. static vector signed char __ATTRS_o_ai vec_subs(vector signed char __a,
  7639. vector bool char __b) {
  7640. return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
  7641. }
  7642. static vector unsigned char __ATTRS_o_ai vec_subs(vector unsigned char __a,
  7643. vector unsigned char __b) {
  7644. return __builtin_altivec_vsububs(__a, __b);
  7645. }
  7646. static vector unsigned char __ATTRS_o_ai vec_subs(vector bool char __a,
  7647. vector unsigned char __b) {
  7648. return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
  7649. }
  7650. static vector unsigned char __ATTRS_o_ai vec_subs(vector unsigned char __a,
  7651. vector bool char __b) {
  7652. return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
  7653. }
  7654. static vector short __ATTRS_o_ai vec_subs(vector short __a, vector short __b) {
  7655. return __builtin_altivec_vsubshs(__a, __b);
  7656. }
  7657. static vector short __ATTRS_o_ai vec_subs(vector bool short __a,
  7658. vector short __b) {
  7659. return __builtin_altivec_vsubshs((vector short)__a, __b);
  7660. }
  7661. static vector short __ATTRS_o_ai vec_subs(vector short __a,
  7662. vector bool short __b) {
  7663. return __builtin_altivec_vsubshs(__a, (vector short)__b);
  7664. }
  7665. static vector unsigned short __ATTRS_o_ai vec_subs(vector unsigned short __a,
  7666. vector unsigned short __b) {
  7667. return __builtin_altivec_vsubuhs(__a, __b);
  7668. }
  7669. static vector unsigned short __ATTRS_o_ai vec_subs(vector bool short __a,
  7670. vector unsigned short __b) {
  7671. return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
  7672. }
  7673. static vector unsigned short __ATTRS_o_ai vec_subs(vector unsigned short __a,
  7674. vector bool short __b) {
  7675. return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
  7676. }
  7677. static vector int __ATTRS_o_ai vec_subs(vector int __a, vector int __b) {
  7678. return __builtin_altivec_vsubsws(__a, __b);
  7679. }
  7680. static vector int __ATTRS_o_ai vec_subs(vector bool int __a, vector int __b) {
  7681. return __builtin_altivec_vsubsws((vector int)__a, __b);
  7682. }
  7683. static vector int __ATTRS_o_ai vec_subs(vector int __a, vector bool int __b) {
  7684. return __builtin_altivec_vsubsws(__a, (vector int)__b);
  7685. }
  7686. static vector unsigned int __ATTRS_o_ai vec_subs(vector unsigned int __a,
  7687. vector unsigned int __b) {
  7688. return __builtin_altivec_vsubuws(__a, __b);
  7689. }
  7690. static vector unsigned int __ATTRS_o_ai vec_subs(vector bool int __a,
  7691. vector unsigned int __b) {
  7692. return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
  7693. }
  7694. static vector unsigned int __ATTRS_o_ai vec_subs(vector unsigned int __a,
  7695. vector bool int __b) {
  7696. return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
  7697. }
  7698. /* vec_vsubsbs */
  7699. static vector signed char __ATTRS_o_ai vec_vsubsbs(vector signed char __a,
  7700. vector signed char __b) {
  7701. return __builtin_altivec_vsubsbs(__a, __b);
  7702. }
  7703. static vector signed char __ATTRS_o_ai vec_vsubsbs(vector bool char __a,
  7704. vector signed char __b) {
  7705. return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
  7706. }
  7707. static vector signed char __ATTRS_o_ai vec_vsubsbs(vector signed char __a,
  7708. vector bool char __b) {
  7709. return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
  7710. }
  7711. /* vec_vsububs */
  7712. static vector unsigned char __ATTRS_o_ai vec_vsububs(vector unsigned char __a,
  7713. vector unsigned char __b) {
  7714. return __builtin_altivec_vsububs(__a, __b);
  7715. }
  7716. static vector unsigned char __ATTRS_o_ai vec_vsububs(vector bool char __a,
  7717. vector unsigned char __b) {
  7718. return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
  7719. }
  7720. static vector unsigned char __ATTRS_o_ai vec_vsububs(vector unsigned char __a,
  7721. vector bool char __b) {
  7722. return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
  7723. }
  7724. /* vec_vsubshs */
  7725. static vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
  7726. vector short __b) {
  7727. return __builtin_altivec_vsubshs(__a, __b);
  7728. }
  7729. static vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
  7730. vector short __b) {
  7731. return __builtin_altivec_vsubshs((vector short)__a, __b);
  7732. }
  7733. static vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
  7734. vector bool short __b) {
  7735. return __builtin_altivec_vsubshs(__a, (vector short)__b);
  7736. }
  7737. /* vec_vsubuhs */
  7738. static vector unsigned short __ATTRS_o_ai
  7739. vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
  7740. return __builtin_altivec_vsubuhs(__a, __b);
  7741. }
  7742. static vector unsigned short __ATTRS_o_ai
  7743. vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
  7744. return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
  7745. }
  7746. static vector unsigned short __ATTRS_o_ai vec_vsubuhs(vector unsigned short __a,
  7747. vector bool short __b) {
  7748. return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
  7749. }
  7750. /* vec_vsubsws */
  7751. static vector int __ATTRS_o_ai vec_vsubsws(vector int __a, vector int __b) {
  7752. return __builtin_altivec_vsubsws(__a, __b);
  7753. }
  7754. static vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
  7755. vector int __b) {
  7756. return __builtin_altivec_vsubsws((vector int)__a, __b);
  7757. }
  7758. static vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
  7759. vector bool int __b) {
  7760. return __builtin_altivec_vsubsws(__a, (vector int)__b);
  7761. }
  7762. /* vec_vsubuws */
  7763. static vector unsigned int __ATTRS_o_ai vec_vsubuws(vector unsigned int __a,
  7764. vector unsigned int __b) {
  7765. return __builtin_altivec_vsubuws(__a, __b);
  7766. }
  7767. static vector unsigned int __ATTRS_o_ai vec_vsubuws(vector bool int __a,
  7768. vector unsigned int __b) {
  7769. return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
  7770. }
  7771. static vector unsigned int __ATTRS_o_ai vec_vsubuws(vector unsigned int __a,
  7772. vector bool int __b) {
  7773. return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
  7774. }
  7775. #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7776. /* vec_vsubuqm */
  7777. static vector signed __int128 __ATTRS_o_ai
  7778. vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
  7779. return __a - __b;
  7780. }
  7781. static vector unsigned __int128 __ATTRS_o_ai
  7782. vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  7783. return __a - __b;
  7784. }
  7785. /* vec_vsubeuqm */
  7786. static vector signed __int128 __ATTRS_o_ai
  7787. vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
  7788. vector signed __int128 __c) {
  7789. return __builtin_altivec_vsubeuqm(__a, __b, __c);
  7790. }
  7791. static vector unsigned __int128 __ATTRS_o_ai
  7792. vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
  7793. vector unsigned __int128 __c) {
  7794. return __builtin_altivec_vsubeuqm(__a, __b, __c);
  7795. }
  7796. /* vec_vsubcuq */
  7797. static vector signed __int128 __ATTRS_o_ai
  7798. vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
  7799. return __builtin_altivec_vsubcuq(__a, __b);
  7800. }
  7801. static vector unsigned __int128 __ATTRS_o_ai
  7802. vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
  7803. return __builtin_altivec_vsubcuq(__a, __b);
  7804. }
  7805. /* vec_vsubecuq */
  7806. static vector signed __int128 __ATTRS_o_ai
  7807. vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
  7808. vector signed __int128 __c) {
  7809. return __builtin_altivec_vsubecuq(__a, __b, __c);
  7810. }
  7811. static vector unsigned __int128 __ATTRS_o_ai
  7812. vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
  7813. vector unsigned __int128 __c) {
  7814. return __builtin_altivec_vsubecuq(__a, __b, __c);
  7815. }
  7816. #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
  7817. /* vec_sum4s */
  7818. static vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
  7819. vector int __b) {
  7820. return __builtin_altivec_vsum4sbs(__a, __b);
  7821. }
  7822. static vector unsigned int __ATTRS_o_ai vec_sum4s(vector unsigned char __a,
  7823. vector unsigned int __b) {
  7824. return __builtin_altivec_vsum4ubs(__a, __b);
  7825. }
  7826. static vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
  7827. vector int __b) {
  7828. return __builtin_altivec_vsum4shs(__a, __b);
  7829. }
  7830. /* vec_vsum4sbs */
  7831. static vector int __attribute__((__always_inline__))
  7832. vec_vsum4sbs(vector signed char __a, vector int __b) {
  7833. return __builtin_altivec_vsum4sbs(__a, __b);
  7834. }
  7835. /* vec_vsum4ubs */
  7836. static vector unsigned int __attribute__((__always_inline__))
  7837. vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
  7838. return __builtin_altivec_vsum4ubs(__a, __b);
  7839. }
  7840. /* vec_vsum4shs */
  7841. static vector int __attribute__((__always_inline__))
  7842. vec_vsum4shs(vector signed short __a, vector int __b) {
  7843. return __builtin_altivec_vsum4shs(__a, __b);
  7844. }
  7845. /* vec_sum2s */
  7846. /* The vsum2sws instruction has a big-endian bias, so that the second
  7847. input vector and the result always reference big-endian elements
  7848. 1 and 3 (little-endian element 0 and 2). For ease of porting the
  7849. programmer wants elements 1 and 3 in both cases, so for little
  7850. endian we must perform some permutes. */
  7851. static vector signed int __attribute__((__always_inline__))
  7852. vec_sum2s(vector int __a, vector int __b) {
  7853. #ifdef __LITTLE_ENDIAN__
  7854. vector int __c = (vector signed int)vec_perm(
  7855. __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
  7856. 8, 9, 10, 11));
  7857. __c = __builtin_altivec_vsum2sws(__a, __c);
  7858. return (vector signed int)vec_perm(
  7859. __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
  7860. 8, 9, 10, 11));
  7861. #else
  7862. return __builtin_altivec_vsum2sws(__a, __b);
  7863. #endif
  7864. }
  7865. /* vec_vsum2sws */
  7866. static vector signed int __attribute__((__always_inline__))
  7867. vec_vsum2sws(vector int __a, vector int __b) {
  7868. #ifdef __LITTLE_ENDIAN__
  7869. vector int __c = (vector signed int)vec_perm(
  7870. __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
  7871. 8, 9, 10, 11));
  7872. __c = __builtin_altivec_vsum2sws(__a, __c);
  7873. return (vector signed int)vec_perm(
  7874. __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
  7875. 8, 9, 10, 11));
  7876. #else
  7877. return __builtin_altivec_vsum2sws(__a, __b);
  7878. #endif
  7879. }
  7880. /* vec_sums */
  7881. /* The vsumsws instruction has a big-endian bias, so that the second
  7882. input vector and the result always reference big-endian element 3
  7883. (little-endian element 0). For ease of porting the programmer
  7884. wants element 3 in both cases, so for little endian we must perform
  7885. some permutes. */
  7886. static vector signed int __attribute__((__always_inline__))
  7887. vec_sums(vector signed int __a, vector signed int __b) {
  7888. #ifdef __LITTLE_ENDIAN__
  7889. __b = (vector signed int)vec_splat(__b, 3);
  7890. __b = __builtin_altivec_vsumsws(__a, __b);
  7891. return (vector signed int)(0, 0, 0, __b[0]);
  7892. #else
  7893. return __builtin_altivec_vsumsws(__a, __b);
  7894. #endif
  7895. }
  7896. /* vec_vsumsws */
  7897. static vector signed int __attribute__((__always_inline__))
  7898. vec_vsumsws(vector signed int __a, vector signed int __b) {
  7899. #ifdef __LITTLE_ENDIAN__
  7900. __b = (vector signed int)vec_splat(__b, 3);
  7901. __b = __builtin_altivec_vsumsws(__a, __b);
  7902. return (vector signed int)(0, 0, 0, __b[0]);
  7903. #else
  7904. return __builtin_altivec_vsumsws(__a, __b);
  7905. #endif
  7906. }
  7907. /* vec_trunc */
  7908. static vector float __ATTRS_o_ai
  7909. vec_trunc(vector float __a) {
  7910. #ifdef __VSX__
  7911. return __builtin_vsx_xvrspiz(__a);
  7912. #else
  7913. return __builtin_altivec_vrfiz(__a);
  7914. #endif
  7915. }
  7916. #ifdef __VSX__
  7917. static vector double __ATTRS_o_ai vec_trunc(vector double __a) {
  7918. return __builtin_vsx_xvrdpiz(__a);
  7919. }
  7920. #endif
  7921. /* vec_vrfiz */
  7922. static vector float __attribute__((__always_inline__))
  7923. vec_vrfiz(vector float __a) {
  7924. return __builtin_altivec_vrfiz(__a);
  7925. }
  7926. /* vec_unpackh */
  7927. /* The vector unpack instructions all have a big-endian bias, so for
  7928. little endian we must reverse the meanings of "high" and "low." */
  7929. static vector short __ATTRS_o_ai vec_unpackh(vector signed char __a) {
  7930. #ifdef __LITTLE_ENDIAN__
  7931. return __builtin_altivec_vupklsb((vector char)__a);
  7932. #else
  7933. return __builtin_altivec_vupkhsb((vector char)__a);
  7934. #endif
  7935. }
  7936. static vector bool short __ATTRS_o_ai vec_unpackh(vector bool char __a) {
  7937. #ifdef __LITTLE_ENDIAN__
  7938. return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
  7939. #else
  7940. return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
  7941. #endif
  7942. }
  7943. static vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
  7944. #ifdef __LITTLE_ENDIAN__
  7945. return __builtin_altivec_vupklsh(__a);
  7946. #else
  7947. return __builtin_altivec_vupkhsh(__a);
  7948. #endif
  7949. }
  7950. static vector bool int __ATTRS_o_ai vec_unpackh(vector bool short __a) {
  7951. #ifdef __LITTLE_ENDIAN__
  7952. return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
  7953. #else
  7954. return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
  7955. #endif
  7956. }
  7957. static vector unsigned int __ATTRS_o_ai vec_unpackh(vector pixel __a) {
  7958. #ifdef __LITTLE_ENDIAN__
  7959. return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
  7960. #else
  7961. return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
  7962. #endif
  7963. }
  7964. #ifdef __POWER8_VECTOR__
  7965. static vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
  7966. #ifdef __LITTLE_ENDIAN__
  7967. return __builtin_altivec_vupklsw(__a);
  7968. #else
  7969. return __builtin_altivec_vupkhsw(__a);
  7970. #endif
  7971. }
  7972. static vector bool long long __ATTRS_o_ai vec_unpackh(vector bool int __a) {
  7973. #ifdef __LITTLE_ENDIAN__
  7974. return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
  7975. #else
  7976. return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
  7977. #endif
  7978. }
  7979. #endif
  7980. /* vec_vupkhsb */
  7981. static vector short __ATTRS_o_ai vec_vupkhsb(vector signed char __a) {
  7982. #ifdef __LITTLE_ENDIAN__
  7983. return __builtin_altivec_vupklsb((vector char)__a);
  7984. #else
  7985. return __builtin_altivec_vupkhsb((vector char)__a);
  7986. #endif
  7987. }
  7988. static vector bool short __ATTRS_o_ai vec_vupkhsb(vector bool char __a) {
  7989. #ifdef __LITTLE_ENDIAN__
  7990. return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
  7991. #else
  7992. return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
  7993. #endif
  7994. }
  7995. /* vec_vupkhsh */
  7996. static vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
  7997. #ifdef __LITTLE_ENDIAN__
  7998. return __builtin_altivec_vupklsh(__a);
  7999. #else
  8000. return __builtin_altivec_vupkhsh(__a);
  8001. #endif
  8002. }
  8003. static vector bool int __ATTRS_o_ai vec_vupkhsh(vector bool short __a) {
  8004. #ifdef __LITTLE_ENDIAN__
  8005. return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
  8006. #else
  8007. return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
  8008. #endif
  8009. }
  8010. static vector unsigned int __ATTRS_o_ai vec_vupkhsh(vector pixel __a) {
  8011. #ifdef __LITTLE_ENDIAN__
  8012. return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
  8013. #else
  8014. return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
  8015. #endif
  8016. }
  8017. /* vec_vupkhsw */
  8018. #ifdef __POWER8_VECTOR__
  8019. static vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
  8020. #ifdef __LITTLE_ENDIAN__
  8021. return __builtin_altivec_vupklsw(__a);
  8022. #else
  8023. return __builtin_altivec_vupkhsw(__a);
  8024. #endif
  8025. }
  8026. static vector bool long long __ATTRS_o_ai vec_vupkhsw(vector bool int __a) {
  8027. #ifdef __LITTLE_ENDIAN__
  8028. return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
  8029. #else
  8030. return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
  8031. #endif
  8032. }
  8033. #endif
  8034. /* vec_unpackl */
  8035. static vector short __ATTRS_o_ai vec_unpackl(vector signed char __a) {
  8036. #ifdef __LITTLE_ENDIAN__
  8037. return __builtin_altivec_vupkhsb((vector char)__a);
  8038. #else
  8039. return __builtin_altivec_vupklsb((vector char)__a);
  8040. #endif
  8041. }
  8042. static vector bool short __ATTRS_o_ai vec_unpackl(vector bool char __a) {
  8043. #ifdef __LITTLE_ENDIAN__
  8044. return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
  8045. #else
  8046. return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
  8047. #endif
  8048. }
  8049. static vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
  8050. #ifdef __LITTLE_ENDIAN__
  8051. return __builtin_altivec_vupkhsh(__a);
  8052. #else
  8053. return __builtin_altivec_vupklsh(__a);
  8054. #endif
  8055. }
  8056. static vector bool int __ATTRS_o_ai vec_unpackl(vector bool short __a) {
  8057. #ifdef __LITTLE_ENDIAN__
  8058. return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
  8059. #else
  8060. return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
  8061. #endif
  8062. }
  8063. static vector unsigned int __ATTRS_o_ai vec_unpackl(vector pixel __a) {
  8064. #ifdef __LITTLE_ENDIAN__
  8065. return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
  8066. #else
  8067. return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
  8068. #endif
  8069. }
  8070. #ifdef __POWER8_VECTOR__
  8071. static vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
  8072. #ifdef __LITTLE_ENDIAN__
  8073. return __builtin_altivec_vupkhsw(__a);
  8074. #else
  8075. return __builtin_altivec_vupklsw(__a);
  8076. #endif
  8077. }
  8078. static vector bool long long __ATTRS_o_ai vec_unpackl(vector bool int __a) {
  8079. #ifdef __LITTLE_ENDIAN__
  8080. return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
  8081. #else
  8082. return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
  8083. #endif
  8084. }
  8085. #endif
  8086. /* vec_vupklsb */
  8087. static vector short __ATTRS_o_ai vec_vupklsb(vector signed char __a) {
  8088. #ifdef __LITTLE_ENDIAN__
  8089. return __builtin_altivec_vupkhsb((vector char)__a);
  8090. #else
  8091. return __builtin_altivec_vupklsb((vector char)__a);
  8092. #endif
  8093. }
  8094. static vector bool short __ATTRS_o_ai vec_vupklsb(vector bool char __a) {
  8095. #ifdef __LITTLE_ENDIAN__
  8096. return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
  8097. #else
  8098. return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
  8099. #endif
  8100. }
  8101. /* vec_vupklsh */
  8102. static vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
  8103. #ifdef __LITTLE_ENDIAN__
  8104. return __builtin_altivec_vupkhsh(__a);
  8105. #else
  8106. return __builtin_altivec_vupklsh(__a);
  8107. #endif
  8108. }
  8109. static vector bool int __ATTRS_o_ai vec_vupklsh(vector bool short __a) {
  8110. #ifdef __LITTLE_ENDIAN__
  8111. return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
  8112. #else
  8113. return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
  8114. #endif
  8115. }
  8116. static vector unsigned int __ATTRS_o_ai vec_vupklsh(vector pixel __a) {
  8117. #ifdef __LITTLE_ENDIAN__
  8118. return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
  8119. #else
  8120. return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
  8121. #endif
  8122. }
  8123. /* vec_vupklsw */
  8124. #ifdef __POWER8_VECTOR__
  8125. static vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
  8126. #ifdef __LITTLE_ENDIAN__
  8127. return __builtin_altivec_vupkhsw(__a);
  8128. #else
  8129. return __builtin_altivec_vupklsw(__a);
  8130. #endif
  8131. }
  8132. static vector bool long long __ATTRS_o_ai vec_vupklsw(vector bool int __a) {
  8133. #ifdef __LITTLE_ENDIAN__
  8134. return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
  8135. #else
  8136. return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
  8137. #endif
  8138. }
  8139. #endif
  8140. /* vec_vsx_ld */
  8141. #ifdef __VSX__
  8142. static vector signed int __ATTRS_o_ai vec_vsx_ld(int __a,
  8143. const vector signed int *__b) {
  8144. return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
  8145. }
  8146. static vector unsigned int __ATTRS_o_ai
  8147. vec_vsx_ld(int __a, const vector unsigned int *__b) {
  8148. return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
  8149. }
  8150. static vector float __ATTRS_o_ai vec_vsx_ld(int __a, const vector float *__b) {
  8151. return (vector float)__builtin_vsx_lxvw4x(__a, __b);
  8152. }
  8153. static vector signed long long __ATTRS_o_ai
  8154. vec_vsx_ld(int __a, const vector signed long long *__b) {
  8155. return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
  8156. }
  8157. static vector unsigned long long __ATTRS_o_ai
  8158. vec_vsx_ld(int __a, const vector unsigned long long *__b) {
  8159. return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
  8160. }
  8161. static vector double __ATTRS_o_ai vec_vsx_ld(int __a,
  8162. const vector double *__b) {
  8163. return (vector double)__builtin_vsx_lxvd2x(__a, __b);
  8164. }
  8165. #endif
  8166. /* vec_vsx_st */
  8167. #ifdef __VSX__
  8168. static void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
  8169. vector signed int *__c) {
  8170. __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
  8171. }
  8172. static void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
  8173. vector unsigned int *__c) {
  8174. __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
  8175. }
  8176. static void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
  8177. vector float *__c) {
  8178. __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
  8179. }
  8180. static void __ATTRS_o_ai vec_vsx_st(vector signed long long __a, int __b,
  8181. vector signed long long *__c) {
  8182. __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
  8183. }
  8184. static void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a, int __b,
  8185. vector unsigned long long *__c) {
  8186. __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
  8187. }
  8188. static void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
  8189. vector double *__c) {
  8190. __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
  8191. }
  8192. #endif
  8193. /* vec_xor */
  8194. #define __builtin_altivec_vxor vec_xor
  8195. static vector signed char __ATTRS_o_ai vec_xor(vector signed char __a,
  8196. vector signed char __b) {
  8197. return __a ^ __b;
  8198. }
  8199. static vector signed char __ATTRS_o_ai vec_xor(vector bool char __a,
  8200. vector signed char __b) {
  8201. return (vector signed char)__a ^ __b;
  8202. }
  8203. static vector signed char __ATTRS_o_ai vec_xor(vector signed char __a,
  8204. vector bool char __b) {
  8205. return __a ^ (vector signed char)__b;
  8206. }
  8207. static vector unsigned char __ATTRS_o_ai vec_xor(vector unsigned char __a,
  8208. vector unsigned char __b) {
  8209. return __a ^ __b;
  8210. }
  8211. static vector unsigned char __ATTRS_o_ai vec_xor(vector bool char __a,
  8212. vector unsigned char __b) {
  8213. return (vector unsigned char)__a ^ __b;
  8214. }
  8215. static vector unsigned char __ATTRS_o_ai vec_xor(vector unsigned char __a,
  8216. vector bool char __b) {
  8217. return __a ^ (vector unsigned char)__b;
  8218. }
  8219. static vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
  8220. vector bool char __b) {
  8221. return __a ^ __b;
  8222. }
  8223. static vector short __ATTRS_o_ai vec_xor(vector short __a, vector short __b) {
  8224. return __a ^ __b;
  8225. }
  8226. static vector short __ATTRS_o_ai vec_xor(vector bool short __a,
  8227. vector short __b) {
  8228. return (vector short)__a ^ __b;
  8229. }
  8230. static vector short __ATTRS_o_ai vec_xor(vector short __a,
  8231. vector bool short __b) {
  8232. return __a ^ (vector short)__b;
  8233. }
  8234. static vector unsigned short __ATTRS_o_ai vec_xor(vector unsigned short __a,
  8235. vector unsigned short __b) {
  8236. return __a ^ __b;
  8237. }
  8238. static vector unsigned short __ATTRS_o_ai vec_xor(vector bool short __a,
  8239. vector unsigned short __b) {
  8240. return (vector unsigned short)__a ^ __b;
  8241. }
  8242. static vector unsigned short __ATTRS_o_ai vec_xor(vector unsigned short __a,
  8243. vector bool short __b) {
  8244. return __a ^ (vector unsigned short)__b;
  8245. }
  8246. static vector bool short __ATTRS_o_ai vec_xor(vector bool short __a,
  8247. vector bool short __b) {
  8248. return __a ^ __b;
  8249. }
  8250. static vector int __ATTRS_o_ai vec_xor(vector int __a, vector int __b) {
  8251. return __a ^ __b;
  8252. }
  8253. static vector int __ATTRS_o_ai vec_xor(vector bool int __a, vector int __b) {
  8254. return (vector int)__a ^ __b;
  8255. }
  8256. static vector int __ATTRS_o_ai vec_xor(vector int __a, vector bool int __b) {
  8257. return __a ^ (vector int)__b;
  8258. }
  8259. static vector unsigned int __ATTRS_o_ai vec_xor(vector unsigned int __a,
  8260. vector unsigned int __b) {
  8261. return __a ^ __b;
  8262. }
  8263. static vector unsigned int __ATTRS_o_ai vec_xor(vector bool int __a,
  8264. vector unsigned int __b) {
  8265. return (vector unsigned int)__a ^ __b;
  8266. }
  8267. static vector unsigned int __ATTRS_o_ai vec_xor(vector unsigned int __a,
  8268. vector bool int __b) {
  8269. return __a ^ (vector unsigned int)__b;
  8270. }
  8271. static vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
  8272. vector bool int __b) {
  8273. return __a ^ __b;
  8274. }
  8275. static vector float __ATTRS_o_ai vec_xor(vector float __a, vector float __b) {
  8276. vector unsigned int __res =
  8277. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8278. return (vector float)__res;
  8279. }
  8280. static vector float __ATTRS_o_ai vec_xor(vector bool int __a,
  8281. vector float __b) {
  8282. vector unsigned int __res =
  8283. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8284. return (vector float)__res;
  8285. }
  8286. static vector float __ATTRS_o_ai vec_xor(vector float __a,
  8287. vector bool int __b) {
  8288. vector unsigned int __res =
  8289. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8290. return (vector float)__res;
  8291. }
  8292. #ifdef __VSX__
  8293. static vector signed long long __ATTRS_o_ai
  8294. vec_xor(vector signed long long __a, vector signed long long __b) {
  8295. return __a ^ __b;
  8296. }
  8297. static vector signed long long __ATTRS_o_ai
  8298. vec_xor(vector bool long long __a, vector signed long long __b) {
  8299. return (vector signed long long)__a ^ __b;
  8300. }
  8301. static vector signed long long __ATTRS_o_ai vec_xor(vector signed long long __a,
  8302. vector bool long long __b) {
  8303. return __a ^ (vector signed long long)__b;
  8304. }
  8305. static vector unsigned long long __ATTRS_o_ai
  8306. vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
  8307. return __a ^ __b;
  8308. }
  8309. static vector unsigned long long __ATTRS_o_ai
  8310. vec_xor(vector bool long long __a, vector unsigned long long __b) {
  8311. return (vector unsigned long long)__a ^ __b;
  8312. }
  8313. static vector unsigned long long __ATTRS_o_ai
  8314. vec_xor(vector unsigned long long __a, vector bool long long __b) {
  8315. return __a ^ (vector unsigned long long)__b;
  8316. }
  8317. static vector bool long long __ATTRS_o_ai vec_xor(vector bool long long __a,
  8318. vector bool long long __b) {
  8319. return __a ^ __b;
  8320. }
  8321. static vector double __ATTRS_o_ai
  8322. vec_xor(vector double __a, vector double __b) {
  8323. return (vector double)((vector unsigned long long)__a ^
  8324. (vector unsigned long long)__b);
  8325. }
  8326. static vector double __ATTRS_o_ai
  8327. vec_xor(vector double __a, vector bool long long __b) {
  8328. return (vector double)((vector unsigned long long)__a ^
  8329. (vector unsigned long long) __b);
  8330. }
  8331. static vector double __ATTRS_o_ai
  8332. vec_xor(vector bool long long __a, vector double __b) {
  8333. return (vector double)((vector unsigned long long)__a ^
  8334. (vector unsigned long long)__b);
  8335. }
  8336. #endif
  8337. /* vec_vxor */
  8338. static vector signed char __ATTRS_o_ai vec_vxor(vector signed char __a,
  8339. vector signed char __b) {
  8340. return __a ^ __b;
  8341. }
  8342. static vector signed char __ATTRS_o_ai vec_vxor(vector bool char __a,
  8343. vector signed char __b) {
  8344. return (vector signed char)__a ^ __b;
  8345. }
  8346. static vector signed char __ATTRS_o_ai vec_vxor(vector signed char __a,
  8347. vector bool char __b) {
  8348. return __a ^ (vector signed char)__b;
  8349. }
  8350. static vector unsigned char __ATTRS_o_ai vec_vxor(vector unsigned char __a,
  8351. vector unsigned char __b) {
  8352. return __a ^ __b;
  8353. }
  8354. static vector unsigned char __ATTRS_o_ai vec_vxor(vector bool char __a,
  8355. vector unsigned char __b) {
  8356. return (vector unsigned char)__a ^ __b;
  8357. }
  8358. static vector unsigned char __ATTRS_o_ai vec_vxor(vector unsigned char __a,
  8359. vector bool char __b) {
  8360. return __a ^ (vector unsigned char)__b;
  8361. }
  8362. static vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
  8363. vector bool char __b) {
  8364. return __a ^ __b;
  8365. }
  8366. static vector short __ATTRS_o_ai vec_vxor(vector short __a, vector short __b) {
  8367. return __a ^ __b;
  8368. }
  8369. static vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
  8370. vector short __b) {
  8371. return (vector short)__a ^ __b;
  8372. }
  8373. static vector short __ATTRS_o_ai vec_vxor(vector short __a,
  8374. vector bool short __b) {
  8375. return __a ^ (vector short)__b;
  8376. }
  8377. static vector unsigned short __ATTRS_o_ai vec_vxor(vector unsigned short __a,
  8378. vector unsigned short __b) {
  8379. return __a ^ __b;
  8380. }
  8381. static vector unsigned short __ATTRS_o_ai vec_vxor(vector bool short __a,
  8382. vector unsigned short __b) {
  8383. return (vector unsigned short)__a ^ __b;
  8384. }
  8385. static vector unsigned short __ATTRS_o_ai vec_vxor(vector unsigned short __a,
  8386. vector bool short __b) {
  8387. return __a ^ (vector unsigned short)__b;
  8388. }
  8389. static vector bool short __ATTRS_o_ai vec_vxor(vector bool short __a,
  8390. vector bool short __b) {
  8391. return __a ^ __b;
  8392. }
  8393. static vector int __ATTRS_o_ai vec_vxor(vector int __a, vector int __b) {
  8394. return __a ^ __b;
  8395. }
  8396. static vector int __ATTRS_o_ai vec_vxor(vector bool int __a, vector int __b) {
  8397. return (vector int)__a ^ __b;
  8398. }
  8399. static vector int __ATTRS_o_ai vec_vxor(vector int __a, vector bool int __b) {
  8400. return __a ^ (vector int)__b;
  8401. }
  8402. static vector unsigned int __ATTRS_o_ai vec_vxor(vector unsigned int __a,
  8403. vector unsigned int __b) {
  8404. return __a ^ __b;
  8405. }
  8406. static vector unsigned int __ATTRS_o_ai vec_vxor(vector bool int __a,
  8407. vector unsigned int __b) {
  8408. return (vector unsigned int)__a ^ __b;
  8409. }
  8410. static vector unsigned int __ATTRS_o_ai vec_vxor(vector unsigned int __a,
  8411. vector bool int __b) {
  8412. return __a ^ (vector unsigned int)__b;
  8413. }
  8414. static vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
  8415. vector bool int __b) {
  8416. return __a ^ __b;
  8417. }
  8418. static vector float __ATTRS_o_ai vec_vxor(vector float __a, vector float __b) {
  8419. vector unsigned int __res =
  8420. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8421. return (vector float)__res;
  8422. }
  8423. static vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
  8424. vector float __b) {
  8425. vector unsigned int __res =
  8426. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8427. return (vector float)__res;
  8428. }
  8429. static vector float __ATTRS_o_ai vec_vxor(vector float __a,
  8430. vector bool int __b) {
  8431. vector unsigned int __res =
  8432. (vector unsigned int)__a ^ (vector unsigned int)__b;
  8433. return (vector float)__res;
  8434. }
  8435. #ifdef __VSX__
  8436. static vector signed long long __ATTRS_o_ai
  8437. vec_vxor(vector signed long long __a, vector signed long long __b) {
  8438. return __a ^ __b;
  8439. }
  8440. static vector signed long long __ATTRS_o_ai
  8441. vec_vxor(vector bool long long __a, vector signed long long __b) {
  8442. return (vector signed long long)__a ^ __b;
  8443. }
  8444. static vector signed long long __ATTRS_o_ai
  8445. vec_vxor(vector signed long long __a, vector bool long long __b) {
  8446. return __a ^ (vector signed long long)__b;
  8447. }
  8448. static vector unsigned long long __ATTRS_o_ai
  8449. vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
  8450. return __a ^ __b;
  8451. }
  8452. static vector unsigned long long __ATTRS_o_ai
  8453. vec_vxor(vector bool long long __a, vector unsigned long long __b) {
  8454. return (vector unsigned long long)__a ^ __b;
  8455. }
  8456. static vector unsigned long long __ATTRS_o_ai
  8457. vec_vxor(vector unsigned long long __a, vector bool long long __b) {
  8458. return __a ^ (vector unsigned long long)__b;
  8459. }
  8460. static vector bool long long __ATTRS_o_ai vec_vxor(vector bool long long __a,
  8461. vector bool long long __b) {
  8462. return __a ^ __b;
  8463. }
  8464. #endif
  8465. /* ------------------------ extensions for CBEA ----------------------------- */
  8466. /* vec_extract */
  8467. static signed char __ATTRS_o_ai vec_extract(vector signed char __a, int __b) {
  8468. return __a[__b];
  8469. }
  8470. static unsigned char __ATTRS_o_ai vec_extract(vector unsigned char __a,
  8471. int __b) {
  8472. return __a[__b];
  8473. }
  8474. static short __ATTRS_o_ai vec_extract(vector short __a, int __b) {
  8475. return __a[__b];
  8476. }
  8477. static unsigned short __ATTRS_o_ai vec_extract(vector unsigned short __a,
  8478. int __b) {
  8479. return __a[__b];
  8480. }
  8481. static int __ATTRS_o_ai vec_extract(vector int __a, int __b) {
  8482. return __a[__b];
  8483. }
  8484. static unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a, int __b) {
  8485. return __a[__b];
  8486. }
  8487. static float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
  8488. return __a[__b];
  8489. }
  8490. /* vec_insert */
  8491. static vector signed char __ATTRS_o_ai vec_insert(signed char __a,
  8492. vector signed char __b,
  8493. int __c) {
  8494. __b[__c] = __a;
  8495. return __b;
  8496. }
  8497. static vector unsigned char __ATTRS_o_ai vec_insert(unsigned char __a,
  8498. vector unsigned char __b,
  8499. int __c) {
  8500. __b[__c] = __a;
  8501. return __b;
  8502. }
  8503. static vector short __ATTRS_o_ai vec_insert(short __a, vector short __b,
  8504. int __c) {
  8505. __b[__c] = __a;
  8506. return __b;
  8507. }
  8508. static vector unsigned short __ATTRS_o_ai vec_insert(unsigned short __a,
  8509. vector unsigned short __b,
  8510. int __c) {
  8511. __b[__c] = __a;
  8512. return __b;
  8513. }
  8514. static vector int __ATTRS_o_ai vec_insert(int __a, vector int __b, int __c) {
  8515. __b[__c] = __a;
  8516. return __b;
  8517. }
  8518. static vector unsigned int __ATTRS_o_ai vec_insert(unsigned int __a,
  8519. vector unsigned int __b,
  8520. int __c) {
  8521. __b[__c] = __a;
  8522. return __b;
  8523. }
  8524. static vector float __ATTRS_o_ai vec_insert(float __a, vector float __b,
  8525. int __c) {
  8526. __b[__c] = __a;
  8527. return __b;
  8528. }
  8529. /* vec_lvlx */
  8530. static vector signed char __ATTRS_o_ai vec_lvlx(int __a,
  8531. const signed char *__b) {
  8532. return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
  8533. vec_lvsl(__a, __b));
  8534. }
  8535. static vector signed char __ATTRS_o_ai vec_lvlx(int __a,
  8536. const vector signed char *__b) {
  8537. return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
  8538. vec_lvsl(__a, (unsigned char *)__b));
  8539. }
  8540. static vector unsigned char __ATTRS_o_ai vec_lvlx(int __a,
  8541. const unsigned char *__b) {
  8542. return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
  8543. vec_lvsl(__a, __b));
  8544. }
  8545. static vector unsigned char __ATTRS_o_ai
  8546. vec_lvlx(int __a, const vector unsigned char *__b) {
  8547. return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
  8548. vec_lvsl(__a, (unsigned char *)__b));
  8549. }
  8550. static vector bool char __ATTRS_o_ai vec_lvlx(int __a,
  8551. const vector bool char *__b) {
  8552. return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
  8553. vec_lvsl(__a, (unsigned char *)__b));
  8554. }
  8555. static vector short __ATTRS_o_ai vec_lvlx(int __a, const short *__b) {
  8556. return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
  8557. }
  8558. static vector short __ATTRS_o_ai vec_lvlx(int __a, const vector short *__b) {
  8559. return vec_perm(vec_ld(__a, __b), (vector short)(0),
  8560. vec_lvsl(__a, (unsigned char *)__b));
  8561. }
  8562. static vector unsigned short __ATTRS_o_ai vec_lvlx(int __a,
  8563. const unsigned short *__b) {
  8564. return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
  8565. vec_lvsl(__a, __b));
  8566. }
  8567. static vector unsigned short __ATTRS_o_ai
  8568. vec_lvlx(int __a, const vector unsigned short *__b) {
  8569. return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
  8570. vec_lvsl(__a, (unsigned char *)__b));
  8571. }
  8572. static vector bool short __ATTRS_o_ai vec_lvlx(int __a,
  8573. const vector bool short *__b) {
  8574. return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
  8575. vec_lvsl(__a, (unsigned char *)__b));
  8576. }
  8577. static vector pixel __ATTRS_o_ai vec_lvlx(int __a, const vector pixel *__b) {
  8578. return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
  8579. vec_lvsl(__a, (unsigned char *)__b));
  8580. }
  8581. static vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
  8582. return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
  8583. }
  8584. static vector int __ATTRS_o_ai vec_lvlx(int __a, const vector int *__b) {
  8585. return vec_perm(vec_ld(__a, __b), (vector int)(0),
  8586. vec_lvsl(__a, (unsigned char *)__b));
  8587. }
  8588. static vector unsigned int __ATTRS_o_ai vec_lvlx(int __a,
  8589. const unsigned int *__b) {
  8590. return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
  8591. vec_lvsl(__a, __b));
  8592. }
  8593. static vector unsigned int __ATTRS_o_ai
  8594. vec_lvlx(int __a, const vector unsigned int *__b) {
  8595. return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
  8596. vec_lvsl(__a, (unsigned char *)__b));
  8597. }
  8598. static vector bool int __ATTRS_o_ai vec_lvlx(int __a,
  8599. const vector bool int *__b) {
  8600. return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
  8601. vec_lvsl(__a, (unsigned char *)__b));
  8602. }
  8603. static vector float __ATTRS_o_ai vec_lvlx(int __a, const float *__b) {
  8604. return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
  8605. }
  8606. static vector float __ATTRS_o_ai vec_lvlx(int __a, const vector float *__b) {
  8607. return vec_perm(vec_ld(__a, __b), (vector float)(0),
  8608. vec_lvsl(__a, (unsigned char *)__b));
  8609. }
  8610. /* vec_lvlxl */
  8611. static vector signed char __ATTRS_o_ai vec_lvlxl(int __a,
  8612. const signed char *__b) {
  8613. return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
  8614. vec_lvsl(__a, __b));
  8615. }
  8616. static vector signed char __ATTRS_o_ai
  8617. vec_lvlxl(int __a, const vector signed char *__b) {
  8618. return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
  8619. vec_lvsl(__a, (unsigned char *)__b));
  8620. }
  8621. static vector unsigned char __ATTRS_o_ai vec_lvlxl(int __a,
  8622. const unsigned char *__b) {
  8623. return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
  8624. vec_lvsl(__a, __b));
  8625. }
  8626. static vector unsigned char __ATTRS_o_ai
  8627. vec_lvlxl(int __a, const vector unsigned char *__b) {
  8628. return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
  8629. vec_lvsl(__a, (unsigned char *)__b));
  8630. }
  8631. static vector bool char __ATTRS_o_ai vec_lvlxl(int __a,
  8632. const vector bool char *__b) {
  8633. return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
  8634. vec_lvsl(__a, (unsigned char *)__b));
  8635. }
  8636. static vector short __ATTRS_o_ai vec_lvlxl(int __a, const short *__b) {
  8637. return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
  8638. }
  8639. static vector short __ATTRS_o_ai vec_lvlxl(int __a, const vector short *__b) {
  8640. return vec_perm(vec_ldl(__a, __b), (vector short)(0),
  8641. vec_lvsl(__a, (unsigned char *)__b));
  8642. }
  8643. static vector unsigned short __ATTRS_o_ai vec_lvlxl(int __a,
  8644. const unsigned short *__b) {
  8645. return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
  8646. vec_lvsl(__a, __b));
  8647. }
  8648. static vector unsigned short __ATTRS_o_ai
  8649. vec_lvlxl(int __a, const vector unsigned short *__b) {
  8650. return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
  8651. vec_lvsl(__a, (unsigned char *)__b));
  8652. }
  8653. static vector bool short __ATTRS_o_ai vec_lvlxl(int __a,
  8654. const vector bool short *__b) {
  8655. return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
  8656. vec_lvsl(__a, (unsigned char *)__b));
  8657. }
  8658. static vector pixel __ATTRS_o_ai vec_lvlxl(int __a, const vector pixel *__b) {
  8659. return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
  8660. vec_lvsl(__a, (unsigned char *)__b));
  8661. }
  8662. static vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
  8663. return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
  8664. }
  8665. static vector int __ATTRS_o_ai vec_lvlxl(int __a, const vector int *__b) {
  8666. return vec_perm(vec_ldl(__a, __b), (vector int)(0),
  8667. vec_lvsl(__a, (unsigned char *)__b));
  8668. }
  8669. static vector unsigned int __ATTRS_o_ai vec_lvlxl(int __a,
  8670. const unsigned int *__b) {
  8671. return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
  8672. vec_lvsl(__a, __b));
  8673. }
  8674. static vector unsigned int __ATTRS_o_ai
  8675. vec_lvlxl(int __a, const vector unsigned int *__b) {
  8676. return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
  8677. vec_lvsl(__a, (unsigned char *)__b));
  8678. }
  8679. static vector bool int __ATTRS_o_ai vec_lvlxl(int __a,
  8680. const vector bool int *__b) {
  8681. return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
  8682. vec_lvsl(__a, (unsigned char *)__b));
  8683. }
  8684. static vector float __ATTRS_o_ai vec_lvlxl(int __a, const float *__b) {
  8685. return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
  8686. }
  8687. static vector float __ATTRS_o_ai vec_lvlxl(int __a, vector float *__b) {
  8688. return vec_perm(vec_ldl(__a, __b), (vector float)(0),
  8689. vec_lvsl(__a, (unsigned char *)__b));
  8690. }
  8691. /* vec_lvrx */
  8692. static vector signed char __ATTRS_o_ai vec_lvrx(int __a,
  8693. const signed char *__b) {
  8694. return vec_perm((vector signed char)(0), vec_ld(__a, __b),
  8695. vec_lvsl(__a, __b));
  8696. }
  8697. static vector signed char __ATTRS_o_ai vec_lvrx(int __a,
  8698. const vector signed char *__b) {
  8699. return vec_perm((vector signed char)(0), vec_ld(__a, __b),
  8700. vec_lvsl(__a, (unsigned char *)__b));
  8701. }
  8702. static vector unsigned char __ATTRS_o_ai vec_lvrx(int __a,
  8703. const unsigned char *__b) {
  8704. return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
  8705. vec_lvsl(__a, __b));
  8706. }
  8707. static vector unsigned char __ATTRS_o_ai
  8708. vec_lvrx(int __a, const vector unsigned char *__b) {
  8709. return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
  8710. vec_lvsl(__a, (unsigned char *)__b));
  8711. }
  8712. static vector bool char __ATTRS_o_ai vec_lvrx(int __a,
  8713. const vector bool char *__b) {
  8714. return vec_perm((vector bool char)(0), vec_ld(__a, __b),
  8715. vec_lvsl(__a, (unsigned char *)__b));
  8716. }
  8717. static vector short __ATTRS_o_ai vec_lvrx(int __a, const short *__b) {
  8718. return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
  8719. }
  8720. static vector short __ATTRS_o_ai vec_lvrx(int __a, const vector short *__b) {
  8721. return vec_perm((vector short)(0), vec_ld(__a, __b),
  8722. vec_lvsl(__a, (unsigned char *)__b));
  8723. }
  8724. static vector unsigned short __ATTRS_o_ai vec_lvrx(int __a,
  8725. const unsigned short *__b) {
  8726. return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
  8727. vec_lvsl(__a, __b));
  8728. }
  8729. static vector unsigned short __ATTRS_o_ai
  8730. vec_lvrx(int __a, const vector unsigned short *__b) {
  8731. return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
  8732. vec_lvsl(__a, (unsigned char *)__b));
  8733. }
  8734. static vector bool short __ATTRS_o_ai vec_lvrx(int __a,
  8735. const vector bool short *__b) {
  8736. return vec_perm((vector bool short)(0), vec_ld(__a, __b),
  8737. vec_lvsl(__a, (unsigned char *)__b));
  8738. }
  8739. static vector pixel __ATTRS_o_ai vec_lvrx(int __a, const vector pixel *__b) {
  8740. return vec_perm((vector pixel)(0), vec_ld(__a, __b),
  8741. vec_lvsl(__a, (unsigned char *)__b));
  8742. }
  8743. static vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
  8744. return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
  8745. }
  8746. static vector int __ATTRS_o_ai vec_lvrx(int __a, const vector int *__b) {
  8747. return vec_perm((vector int)(0), vec_ld(__a, __b),
  8748. vec_lvsl(__a, (unsigned char *)__b));
  8749. }
  8750. static vector unsigned int __ATTRS_o_ai vec_lvrx(int __a,
  8751. const unsigned int *__b) {
  8752. return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
  8753. vec_lvsl(__a, __b));
  8754. }
  8755. static vector unsigned int __ATTRS_o_ai
  8756. vec_lvrx(int __a, const vector unsigned int *__b) {
  8757. return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
  8758. vec_lvsl(__a, (unsigned char *)__b));
  8759. }
  8760. static vector bool int __ATTRS_o_ai vec_lvrx(int __a,
  8761. const vector bool int *__b) {
  8762. return vec_perm((vector bool int)(0), vec_ld(__a, __b),
  8763. vec_lvsl(__a, (unsigned char *)__b));
  8764. }
  8765. static vector float __ATTRS_o_ai vec_lvrx(int __a, const float *__b) {
  8766. return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
  8767. }
  8768. static vector float __ATTRS_o_ai vec_lvrx(int __a, const vector float *__b) {
  8769. return vec_perm((vector float)(0), vec_ld(__a, __b),
  8770. vec_lvsl(__a, (unsigned char *)__b));
  8771. }
  8772. /* vec_lvrxl */
  8773. static vector signed char __ATTRS_o_ai vec_lvrxl(int __a,
  8774. const signed char *__b) {
  8775. return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
  8776. vec_lvsl(__a, __b));
  8777. }
  8778. static vector signed char __ATTRS_o_ai
  8779. vec_lvrxl(int __a, const vector signed char *__b) {
  8780. return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
  8781. vec_lvsl(__a, (unsigned char *)__b));
  8782. }
  8783. static vector unsigned char __ATTRS_o_ai vec_lvrxl(int __a,
  8784. const unsigned char *__b) {
  8785. return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
  8786. vec_lvsl(__a, __b));
  8787. }
  8788. static vector unsigned char __ATTRS_o_ai
  8789. vec_lvrxl(int __a, const vector unsigned char *__b) {
  8790. return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
  8791. vec_lvsl(__a, (unsigned char *)__b));
  8792. }
  8793. static vector bool char __ATTRS_o_ai vec_lvrxl(int __a,
  8794. const vector bool char *__b) {
  8795. return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
  8796. vec_lvsl(__a, (unsigned char *)__b));
  8797. }
  8798. static vector short __ATTRS_o_ai vec_lvrxl(int __a, const short *__b) {
  8799. return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
  8800. }
  8801. static vector short __ATTRS_o_ai vec_lvrxl(int __a, const vector short *__b) {
  8802. return vec_perm((vector short)(0), vec_ldl(__a, __b),
  8803. vec_lvsl(__a, (unsigned char *)__b));
  8804. }
  8805. static vector unsigned short __ATTRS_o_ai vec_lvrxl(int __a,
  8806. const unsigned short *__b) {
  8807. return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
  8808. vec_lvsl(__a, __b));
  8809. }
  8810. static vector unsigned short __ATTRS_o_ai
  8811. vec_lvrxl(int __a, const vector unsigned short *__b) {
  8812. return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
  8813. vec_lvsl(__a, (unsigned char *)__b));
  8814. }
  8815. static vector bool short __ATTRS_o_ai vec_lvrxl(int __a,
  8816. const vector bool short *__b) {
  8817. return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
  8818. vec_lvsl(__a, (unsigned char *)__b));
  8819. }
  8820. static vector pixel __ATTRS_o_ai vec_lvrxl(int __a, const vector pixel *__b) {
  8821. return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
  8822. vec_lvsl(__a, (unsigned char *)__b));
  8823. }
  8824. static vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
  8825. return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
  8826. }
  8827. static vector int __ATTRS_o_ai vec_lvrxl(int __a, const vector int *__b) {
  8828. return vec_perm((vector int)(0), vec_ldl(__a, __b),
  8829. vec_lvsl(__a, (unsigned char *)__b));
  8830. }
  8831. static vector unsigned int __ATTRS_o_ai vec_lvrxl(int __a,
  8832. const unsigned int *__b) {
  8833. return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
  8834. vec_lvsl(__a, __b));
  8835. }
  8836. static vector unsigned int __ATTRS_o_ai
  8837. vec_lvrxl(int __a, const vector unsigned int *__b) {
  8838. return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
  8839. vec_lvsl(__a, (unsigned char *)__b));
  8840. }
  8841. static vector bool int __ATTRS_o_ai vec_lvrxl(int __a,
  8842. const vector bool int *__b) {
  8843. return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
  8844. vec_lvsl(__a, (unsigned char *)__b));
  8845. }
  8846. static vector float __ATTRS_o_ai vec_lvrxl(int __a, const float *__b) {
  8847. return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
  8848. }
  8849. static vector float __ATTRS_o_ai vec_lvrxl(int __a, const vector float *__b) {
  8850. return vec_perm((vector float)(0), vec_ldl(__a, __b),
  8851. vec_lvsl(__a, (unsigned char *)__b));
  8852. }
  8853. /* vec_stvlx */
  8854. static void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
  8855. signed char *__c) {
  8856. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8857. __c);
  8858. }
  8859. static void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
  8860. vector signed char *__c) {
  8861. return vec_st(
  8862. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8863. __b, __c);
  8864. }
  8865. static void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
  8866. unsigned char *__c) {
  8867. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8868. __c);
  8869. }
  8870. static void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
  8871. vector unsigned char *__c) {
  8872. return vec_st(
  8873. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8874. __b, __c);
  8875. }
  8876. static void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
  8877. vector bool char *__c) {
  8878. return vec_st(
  8879. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8880. __b, __c);
  8881. }
  8882. static void __ATTRS_o_ai vec_stvlx(vector short __a, int __b, short *__c) {
  8883. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8884. __c);
  8885. }
  8886. static void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
  8887. vector short *__c) {
  8888. return vec_st(
  8889. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8890. __b, __c);
  8891. }
  8892. static void __ATTRS_o_ai vec_stvlx(vector unsigned short __a, int __b,
  8893. unsigned short *__c) {
  8894. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8895. __c);
  8896. }
  8897. static void __ATTRS_o_ai vec_stvlx(vector unsigned short __a, int __b,
  8898. vector unsigned short *__c) {
  8899. return vec_st(
  8900. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8901. __b, __c);
  8902. }
  8903. static void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
  8904. vector bool short *__c) {
  8905. return vec_st(
  8906. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8907. __b, __c);
  8908. }
  8909. static void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
  8910. vector pixel *__c) {
  8911. return vec_st(
  8912. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8913. __b, __c);
  8914. }
  8915. static void __ATTRS_o_ai vec_stvlx(vector int __a, int __b, int *__c) {
  8916. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8917. __c);
  8918. }
  8919. static void __ATTRS_o_ai vec_stvlx(vector int __a, int __b, vector int *__c) {
  8920. return vec_st(
  8921. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8922. __b, __c);
  8923. }
  8924. static void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
  8925. unsigned int *__c) {
  8926. return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8927. __c);
  8928. }
  8929. static void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
  8930. vector unsigned int *__c) {
  8931. return vec_st(
  8932. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8933. __b, __c);
  8934. }
  8935. static void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
  8936. vector bool int *__c) {
  8937. return vec_st(
  8938. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8939. __b, __c);
  8940. }
  8941. static void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
  8942. vector float *__c) {
  8943. return vec_st(
  8944. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8945. __b, __c);
  8946. }
  8947. /* vec_stvlxl */
  8948. static void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
  8949. signed char *__c) {
  8950. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8951. __c);
  8952. }
  8953. static void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
  8954. vector signed char *__c) {
  8955. return vec_stl(
  8956. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8957. __b, __c);
  8958. }
  8959. static void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a, int __b,
  8960. unsigned char *__c) {
  8961. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8962. __c);
  8963. }
  8964. static void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a, int __b,
  8965. vector unsigned char *__c) {
  8966. return vec_stl(
  8967. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8968. __b, __c);
  8969. }
  8970. static void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
  8971. vector bool char *__c) {
  8972. return vec_stl(
  8973. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8974. __b, __c);
  8975. }
  8976. static void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b, short *__c) {
  8977. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8978. __c);
  8979. }
  8980. static void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
  8981. vector short *__c) {
  8982. return vec_stl(
  8983. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8984. __b, __c);
  8985. }
  8986. static void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a, int __b,
  8987. unsigned short *__c) {
  8988. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  8989. __c);
  8990. }
  8991. static void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a, int __b,
  8992. vector unsigned short *__c) {
  8993. return vec_stl(
  8994. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  8995. __b, __c);
  8996. }
  8997. static void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
  8998. vector bool short *__c) {
  8999. return vec_stl(
  9000. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9001. __b, __c);
  9002. }
  9003. static void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
  9004. vector pixel *__c) {
  9005. return vec_stl(
  9006. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9007. __b, __c);
  9008. }
  9009. static void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b, int *__c) {
  9010. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  9011. __c);
  9012. }
  9013. static void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b, vector int *__c) {
  9014. return vec_stl(
  9015. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9016. __b, __c);
  9017. }
  9018. static void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
  9019. unsigned int *__c) {
  9020. return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
  9021. __c);
  9022. }
  9023. static void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
  9024. vector unsigned int *__c) {
  9025. return vec_stl(
  9026. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9027. __b, __c);
  9028. }
  9029. static void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
  9030. vector bool int *__c) {
  9031. return vec_stl(
  9032. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9033. __b, __c);
  9034. }
  9035. static void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
  9036. vector float *__c) {
  9037. return vec_stl(
  9038. vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
  9039. __b, __c);
  9040. }
  9041. /* vec_stvrx */
  9042. static void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
  9043. signed char *__c) {
  9044. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9045. __c);
  9046. }
  9047. static void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
  9048. vector signed char *__c) {
  9049. return vec_st(
  9050. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9051. __b, __c);
  9052. }
  9053. static void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
  9054. unsigned char *__c) {
  9055. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9056. __c);
  9057. }
  9058. static void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
  9059. vector unsigned char *__c) {
  9060. return vec_st(
  9061. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9062. __b, __c);
  9063. }
  9064. static void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
  9065. vector bool char *__c) {
  9066. return vec_st(
  9067. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9068. __b, __c);
  9069. }
  9070. static void __ATTRS_o_ai vec_stvrx(vector short __a, int __b, short *__c) {
  9071. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9072. __c);
  9073. }
  9074. static void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
  9075. vector short *__c) {
  9076. return vec_st(
  9077. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9078. __b, __c);
  9079. }
  9080. static void __ATTRS_o_ai vec_stvrx(vector unsigned short __a, int __b,
  9081. unsigned short *__c) {
  9082. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9083. __c);
  9084. }
  9085. static void __ATTRS_o_ai vec_stvrx(vector unsigned short __a, int __b,
  9086. vector unsigned short *__c) {
  9087. return vec_st(
  9088. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9089. __b, __c);
  9090. }
  9091. static void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
  9092. vector bool short *__c) {
  9093. return vec_st(
  9094. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9095. __b, __c);
  9096. }
  9097. static void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
  9098. vector pixel *__c) {
  9099. return vec_st(
  9100. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9101. __b, __c);
  9102. }
  9103. static void __ATTRS_o_ai vec_stvrx(vector int __a, int __b, int *__c) {
  9104. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9105. __c);
  9106. }
  9107. static void __ATTRS_o_ai vec_stvrx(vector int __a, int __b, vector int *__c) {
  9108. return vec_st(
  9109. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9110. __b, __c);
  9111. }
  9112. static void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
  9113. unsigned int *__c) {
  9114. return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9115. __c);
  9116. }
  9117. static void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
  9118. vector unsigned int *__c) {
  9119. return vec_st(
  9120. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9121. __b, __c);
  9122. }
  9123. static void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
  9124. vector bool int *__c) {
  9125. return vec_st(
  9126. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9127. __b, __c);
  9128. }
  9129. static void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
  9130. vector float *__c) {
  9131. return vec_st(
  9132. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9133. __b, __c);
  9134. }
  9135. /* vec_stvrxl */
  9136. static void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
  9137. signed char *__c) {
  9138. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9139. __c);
  9140. }
  9141. static void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
  9142. vector signed char *__c) {
  9143. return vec_stl(
  9144. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9145. __b, __c);
  9146. }
  9147. static void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a, int __b,
  9148. unsigned char *__c) {
  9149. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9150. __c);
  9151. }
  9152. static void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a, int __b,
  9153. vector unsigned char *__c) {
  9154. return vec_stl(
  9155. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9156. __b, __c);
  9157. }
  9158. static void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
  9159. vector bool char *__c) {
  9160. return vec_stl(
  9161. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9162. __b, __c);
  9163. }
  9164. static void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b, short *__c) {
  9165. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9166. __c);
  9167. }
  9168. static void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
  9169. vector short *__c) {
  9170. return vec_stl(
  9171. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9172. __b, __c);
  9173. }
  9174. static void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a, int __b,
  9175. unsigned short *__c) {
  9176. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9177. __c);
  9178. }
  9179. static void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a, int __b,
  9180. vector unsigned short *__c) {
  9181. return vec_stl(
  9182. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9183. __b, __c);
  9184. }
  9185. static void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
  9186. vector bool short *__c) {
  9187. return vec_stl(
  9188. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9189. __b, __c);
  9190. }
  9191. static void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
  9192. vector pixel *__c) {
  9193. return vec_stl(
  9194. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9195. __b, __c);
  9196. }
  9197. static void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b, int *__c) {
  9198. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9199. __c);
  9200. }
  9201. static void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b, vector int *__c) {
  9202. return vec_stl(
  9203. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9204. __b, __c);
  9205. }
  9206. static void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
  9207. unsigned int *__c) {
  9208. return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
  9209. __c);
  9210. }
  9211. static void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
  9212. vector unsigned int *__c) {
  9213. return vec_stl(
  9214. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9215. __b, __c);
  9216. }
  9217. static void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
  9218. vector bool int *__c) {
  9219. return vec_stl(
  9220. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9221. __b, __c);
  9222. }
  9223. static void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
  9224. vector float *__c) {
  9225. return vec_stl(
  9226. vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
  9227. __b, __c);
  9228. }
  9229. /* vec_promote */
  9230. static vector signed char __ATTRS_o_ai vec_promote(signed char __a, int __b) {
  9231. vector signed char __res = (vector signed char)(0);
  9232. __res[__b] = __a;
  9233. return __res;
  9234. }
  9235. static vector unsigned char __ATTRS_o_ai vec_promote(unsigned char __a,
  9236. int __b) {
  9237. vector unsigned char __res = (vector unsigned char)(0);
  9238. __res[__b] = __a;
  9239. return __res;
  9240. }
  9241. static vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
  9242. vector short __res = (vector short)(0);
  9243. __res[__b] = __a;
  9244. return __res;
  9245. }
  9246. static vector unsigned short __ATTRS_o_ai vec_promote(unsigned short __a,
  9247. int __b) {
  9248. vector unsigned short __res = (vector unsigned short)(0);
  9249. __res[__b] = __a;
  9250. return __res;
  9251. }
  9252. static vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
  9253. vector int __res = (vector int)(0);
  9254. __res[__b] = __a;
  9255. return __res;
  9256. }
  9257. static vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a, int __b) {
  9258. vector unsigned int __res = (vector unsigned int)(0);
  9259. __res[__b] = __a;
  9260. return __res;
  9261. }
  9262. static vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
  9263. vector float __res = (vector float)(0);
  9264. __res[__b] = __a;
  9265. return __res;
  9266. }
  9267. /* vec_splats */
  9268. static vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
  9269. return (vector signed char)(__a);
  9270. }
  9271. static vector unsigned char __ATTRS_o_ai vec_splats(unsigned char __a) {
  9272. return (vector unsigned char)(__a);
  9273. }
  9274. static vector short __ATTRS_o_ai vec_splats(short __a) {
  9275. return (vector short)(__a);
  9276. }
  9277. static vector unsigned short __ATTRS_o_ai vec_splats(unsigned short __a) {
  9278. return (vector unsigned short)(__a);
  9279. }
  9280. static vector int __ATTRS_o_ai vec_splats(int __a) { return (vector int)(__a); }
  9281. static vector unsigned int __ATTRS_o_ai vec_splats(unsigned int __a) {
  9282. return (vector unsigned int)(__a);
  9283. }
  9284. static vector float __ATTRS_o_ai vec_splats(float __a) {
  9285. return (vector float)(__a);
  9286. }
  9287. /* ----------------------------- predicates --------------------------------- */
  9288. /* vec_all_eq */
  9289. static int __ATTRS_o_ai vec_all_eq(vector signed char __a,
  9290. vector signed char __b) {
  9291. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9292. (vector char)__b);
  9293. }
  9294. static int __ATTRS_o_ai vec_all_eq(vector signed char __a,
  9295. vector bool char __b) {
  9296. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9297. (vector char)__b);
  9298. }
  9299. static int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
  9300. vector unsigned char __b) {
  9301. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9302. (vector char)__b);
  9303. }
  9304. static int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
  9305. vector bool char __b) {
  9306. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9307. (vector char)__b);
  9308. }
  9309. static int __ATTRS_o_ai vec_all_eq(vector bool char __a,
  9310. vector signed char __b) {
  9311. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9312. (vector char)__b);
  9313. }
  9314. static int __ATTRS_o_ai vec_all_eq(vector bool char __a,
  9315. vector unsigned char __b) {
  9316. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9317. (vector char)__b);
  9318. }
  9319. static int __ATTRS_o_ai vec_all_eq(vector bool char __a, vector bool char __b) {
  9320. return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
  9321. (vector char)__b);
  9322. }
  9323. static int __ATTRS_o_ai vec_all_eq(vector short __a, vector short __b) {
  9324. return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
  9325. }
  9326. static int __ATTRS_o_ai vec_all_eq(vector short __a, vector bool short __b) {
  9327. return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
  9328. }
  9329. static int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
  9330. vector unsigned short __b) {
  9331. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9332. (vector short)__b);
  9333. }
  9334. static int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
  9335. vector bool short __b) {
  9336. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9337. (vector short)__b);
  9338. }
  9339. static int __ATTRS_o_ai vec_all_eq(vector bool short __a, vector short __b) {
  9340. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9341. (vector short)__b);
  9342. }
  9343. static int __ATTRS_o_ai vec_all_eq(vector bool short __a,
  9344. vector unsigned short __b) {
  9345. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9346. (vector short)__b);
  9347. }
  9348. static int __ATTRS_o_ai vec_all_eq(vector bool short __a,
  9349. vector bool short __b) {
  9350. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9351. (vector short)__b);
  9352. }
  9353. static int __ATTRS_o_ai vec_all_eq(vector pixel __a, vector pixel __b) {
  9354. return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
  9355. (vector short)__b);
  9356. }
  9357. static int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
  9358. return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
  9359. }
  9360. static int __ATTRS_o_ai vec_all_eq(vector int __a, vector bool int __b) {
  9361. return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
  9362. }
  9363. static int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
  9364. vector unsigned int __b) {
  9365. return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
  9366. (vector int)__b);
  9367. }
  9368. static int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
  9369. vector bool int __b) {
  9370. return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
  9371. (vector int)__b);
  9372. }
  9373. static int __ATTRS_o_ai vec_all_eq(vector bool int __a, vector int __b) {
  9374. return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
  9375. (vector int)__b);
  9376. }
  9377. static int __ATTRS_o_ai vec_all_eq(vector bool int __a,
  9378. vector unsigned int __b) {
  9379. return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
  9380. (vector int)__b);
  9381. }
  9382. static int __ATTRS_o_ai vec_all_eq(vector bool int __a, vector bool int __b) {
  9383. return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
  9384. (vector int)__b);
  9385. }
  9386. #ifdef __POWER8_VECTOR__
  9387. static int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
  9388. vector signed long long __b) {
  9389. return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
  9390. }
  9391. static int __ATTRS_o_ai vec_all_eq(vector long long __a,
  9392. vector bool long long __b) {
  9393. return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
  9394. }
  9395. static int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
  9396. vector unsigned long long __b) {
  9397. return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
  9398. (vector long long)__b);
  9399. }
  9400. static int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
  9401. vector bool long long __b) {
  9402. return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
  9403. (vector long long)__b);
  9404. }
  9405. static int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
  9406. vector long long __b) {
  9407. return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
  9408. (vector long long)__b);
  9409. }
  9410. static int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
  9411. vector unsigned long long __b) {
  9412. return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
  9413. (vector long long)__b);
  9414. }
  9415. static int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
  9416. vector bool long long __b) {
  9417. return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
  9418. (vector long long)__b);
  9419. }
  9420. #endif
  9421. static int __ATTRS_o_ai vec_all_eq(vector float __a, vector float __b) {
  9422. return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
  9423. }
  9424. /* vec_all_ge */
  9425. static int __ATTRS_o_ai vec_all_ge(vector signed char __a,
  9426. vector signed char __b) {
  9427. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
  9428. }
  9429. static int __ATTRS_o_ai vec_all_ge(vector signed char __a,
  9430. vector bool char __b) {
  9431. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
  9432. }
  9433. static int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
  9434. vector unsigned char __b) {
  9435. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
  9436. }
  9437. static int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
  9438. vector bool char __b) {
  9439. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
  9440. }
  9441. static int __ATTRS_o_ai vec_all_ge(vector bool char __a,
  9442. vector signed char __b) {
  9443. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
  9444. (vector unsigned char)__a);
  9445. }
  9446. static int __ATTRS_o_ai vec_all_ge(vector bool char __a,
  9447. vector unsigned char __b) {
  9448. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
  9449. }
  9450. static int __ATTRS_o_ai vec_all_ge(vector bool char __a, vector bool char __b) {
  9451. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
  9452. (vector unsigned char)__a);
  9453. }
  9454. static int __ATTRS_o_ai vec_all_ge(vector short __a, vector short __b) {
  9455. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
  9456. }
  9457. static int __ATTRS_o_ai vec_all_ge(vector short __a, vector bool short __b) {
  9458. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
  9459. }
  9460. static int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
  9461. vector unsigned short __b) {
  9462. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
  9463. }
  9464. static int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
  9465. vector bool short __b) {
  9466. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
  9467. __a);
  9468. }
  9469. static int __ATTRS_o_ai vec_all_ge(vector bool short __a, vector short __b) {
  9470. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
  9471. (vector unsigned short)__a);
  9472. }
  9473. static int __ATTRS_o_ai vec_all_ge(vector bool short __a,
  9474. vector unsigned short __b) {
  9475. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
  9476. (vector unsigned short)__a);
  9477. }
  9478. static int __ATTRS_o_ai vec_all_ge(vector bool short __a,
  9479. vector bool short __b) {
  9480. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
  9481. (vector unsigned short)__a);
  9482. }
  9483. static int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
  9484. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
  9485. }
  9486. static int __ATTRS_o_ai vec_all_ge(vector int __a, vector bool int __b) {
  9487. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
  9488. }
  9489. static int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
  9490. vector unsigned int __b) {
  9491. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
  9492. }
  9493. static int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
  9494. vector bool int __b) {
  9495. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
  9496. }
  9497. static int __ATTRS_o_ai vec_all_ge(vector bool int __a, vector int __b) {
  9498. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
  9499. (vector unsigned int)__a);
  9500. }
  9501. static int __ATTRS_o_ai vec_all_ge(vector bool int __a,
  9502. vector unsigned int __b) {
  9503. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
  9504. }
  9505. static int __ATTRS_o_ai vec_all_ge(vector bool int __a, vector bool int __b) {
  9506. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
  9507. (vector unsigned int)__a);
  9508. }
  9509. #ifdef __POWER8_VECTOR__
  9510. static int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
  9511. vector signed long long __b) {
  9512. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
  9513. }
  9514. static int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
  9515. vector bool long long __b) {
  9516. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
  9517. __a);
  9518. }
  9519. static int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
  9520. vector unsigned long long __b) {
  9521. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
  9522. }
  9523. static int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
  9524. vector bool long long __b) {
  9525. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
  9526. __a);
  9527. }
  9528. static int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
  9529. vector signed long long __b) {
  9530. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
  9531. (vector unsigned long long)__a);
  9532. }
  9533. static int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
  9534. vector unsigned long long __b) {
  9535. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
  9536. (vector unsigned long long)__a);
  9537. }
  9538. static int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
  9539. vector bool long long __b) {
  9540. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
  9541. (vector unsigned long long)__a);
  9542. }
  9543. #endif
  9544. static int __ATTRS_o_ai vec_all_ge(vector float __a, vector float __b) {
  9545. return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
  9546. }
  9547. /* vec_all_gt */
  9548. static int __ATTRS_o_ai vec_all_gt(vector signed char __a,
  9549. vector signed char __b) {
  9550. return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
  9551. }
  9552. static int __ATTRS_o_ai vec_all_gt(vector signed char __a,
  9553. vector bool char __b) {
  9554. return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
  9555. }
  9556. static int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
  9557. vector unsigned char __b) {
  9558. return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
  9559. }
  9560. static int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
  9561. vector bool char __b) {
  9562. return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
  9563. }
  9564. static int __ATTRS_o_ai vec_all_gt(vector bool char __a,
  9565. vector signed char __b) {
  9566. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
  9567. (vector unsigned char)__b);
  9568. }
  9569. static int __ATTRS_o_ai vec_all_gt(vector bool char __a,
  9570. vector unsigned char __b) {
  9571. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
  9572. }
  9573. static int __ATTRS_o_ai vec_all_gt(vector bool char __a, vector bool char __b) {
  9574. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
  9575. (vector unsigned char)__b);
  9576. }
  9577. static int __ATTRS_o_ai vec_all_gt(vector short __a, vector short __b) {
  9578. return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
  9579. }
  9580. static int __ATTRS_o_ai vec_all_gt(vector short __a, vector bool short __b) {
  9581. return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
  9582. }
  9583. static int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
  9584. vector unsigned short __b) {
  9585. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
  9586. }
  9587. static int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
  9588. vector bool short __b) {
  9589. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
  9590. (vector unsigned short)__b);
  9591. }
  9592. static int __ATTRS_o_ai vec_all_gt(vector bool short __a, vector short __b) {
  9593. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
  9594. (vector unsigned short)__b);
  9595. }
  9596. static int __ATTRS_o_ai vec_all_gt(vector bool short __a,
  9597. vector unsigned short __b) {
  9598. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
  9599. __b);
  9600. }
  9601. static int __ATTRS_o_ai vec_all_gt(vector bool short __a,
  9602. vector bool short __b) {
  9603. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
  9604. (vector unsigned short)__b);
  9605. }
  9606. static int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
  9607. return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
  9608. }
  9609. static int __ATTRS_o_ai vec_all_gt(vector int __a, vector bool int __b) {
  9610. return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
  9611. }
  9612. static int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
  9613. vector unsigned int __b) {
  9614. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
  9615. }
  9616. static int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
  9617. vector bool int __b) {
  9618. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
  9619. }
  9620. static int __ATTRS_o_ai vec_all_gt(vector bool int __a, vector int __b) {
  9621. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
  9622. (vector unsigned int)__b);
  9623. }
  9624. static int __ATTRS_o_ai vec_all_gt(vector bool int __a,
  9625. vector unsigned int __b) {
  9626. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
  9627. }
  9628. static int __ATTRS_o_ai vec_all_gt(vector bool int __a, vector bool int __b) {
  9629. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
  9630. (vector unsigned int)__b);
  9631. }
  9632. #ifdef __POWER8_VECTOR__
  9633. static int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
  9634. vector signed long long __b) {
  9635. return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
  9636. }
  9637. static int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
  9638. vector bool long long __b) {
  9639. return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
  9640. (vector signed long long)__b);
  9641. }
  9642. static int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
  9643. vector unsigned long long __b) {
  9644. return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
  9645. }
  9646. static int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
  9647. vector bool long long __b) {
  9648. return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
  9649. (vector unsigned long long)__b);
  9650. }
  9651. static int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
  9652. vector signed long long __b) {
  9653. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
  9654. (vector unsigned long long)__b);
  9655. }
  9656. static int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
  9657. vector unsigned long long __b) {
  9658. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
  9659. __b);
  9660. }
  9661. static int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
  9662. vector bool long long __b) {
  9663. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
  9664. (vector unsigned long long)__b);
  9665. }
  9666. #endif
  9667. static int __ATTRS_o_ai vec_all_gt(vector float __a, vector float __b) {
  9668. return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
  9669. }
  9670. /* vec_all_in */
  9671. static int __attribute__((__always_inline__))
  9672. vec_all_in(vector float __a, vector float __b) {
  9673. return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
  9674. }
  9675. /* vec_all_le */
  9676. static int __ATTRS_o_ai vec_all_le(vector signed char __a,
  9677. vector signed char __b) {
  9678. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
  9679. }
  9680. static int __ATTRS_o_ai vec_all_le(vector signed char __a,
  9681. vector bool char __b) {
  9682. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
  9683. }
  9684. static int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
  9685. vector unsigned char __b) {
  9686. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
  9687. }
  9688. static int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
  9689. vector bool char __b) {
  9690. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
  9691. }
  9692. static int __ATTRS_o_ai vec_all_le(vector bool char __a,
  9693. vector signed char __b) {
  9694. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
  9695. (vector unsigned char)__b);
  9696. }
  9697. static int __ATTRS_o_ai vec_all_le(vector bool char __a,
  9698. vector unsigned char __b) {
  9699. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
  9700. }
  9701. static int __ATTRS_o_ai vec_all_le(vector bool char __a, vector bool char __b) {
  9702. return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
  9703. (vector unsigned char)__b);
  9704. }
  9705. static int __ATTRS_o_ai vec_all_le(vector short __a, vector short __b) {
  9706. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
  9707. }
  9708. static int __ATTRS_o_ai vec_all_le(vector short __a, vector bool short __b) {
  9709. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
  9710. }
  9711. static int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
  9712. vector unsigned short __b) {
  9713. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
  9714. }
  9715. static int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
  9716. vector bool short __b) {
  9717. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
  9718. (vector unsigned short)__b);
  9719. }
  9720. static int __ATTRS_o_ai vec_all_le(vector bool short __a, vector short __b) {
  9721. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
  9722. (vector unsigned short)__b);
  9723. }
  9724. static int __ATTRS_o_ai vec_all_le(vector bool short __a,
  9725. vector unsigned short __b) {
  9726. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
  9727. __b);
  9728. }
  9729. static int __ATTRS_o_ai vec_all_le(vector bool short __a,
  9730. vector bool short __b) {
  9731. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
  9732. (vector unsigned short)__b);
  9733. }
  9734. static int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
  9735. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
  9736. }
  9737. static int __ATTRS_o_ai vec_all_le(vector int __a, vector bool int __b) {
  9738. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
  9739. }
  9740. static int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
  9741. vector unsigned int __b) {
  9742. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
  9743. }
  9744. static int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
  9745. vector bool int __b) {
  9746. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
  9747. }
  9748. static int __ATTRS_o_ai vec_all_le(vector bool int __a, vector int __b) {
  9749. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
  9750. (vector unsigned int)__b);
  9751. }
  9752. static int __ATTRS_o_ai vec_all_le(vector bool int __a,
  9753. vector unsigned int __b) {
  9754. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
  9755. }
  9756. static int __ATTRS_o_ai vec_all_le(vector bool int __a, vector bool int __b) {
  9757. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
  9758. (vector unsigned int)__b);
  9759. }
  9760. #ifdef __POWER8_VECTOR__
  9761. static int __ATTRS_o_ai vec_all_le(vector signed long long __a,
  9762. vector signed long long __b) {
  9763. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
  9764. }
  9765. static int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
  9766. vector unsigned long long __b) {
  9767. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
  9768. }
  9769. static int __ATTRS_o_ai vec_all_le(vector signed long long __a,
  9770. vector bool long long __b) {
  9771. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
  9772. (vector signed long long)__b);
  9773. }
  9774. static int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
  9775. vector bool long long __b) {
  9776. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
  9777. (vector unsigned long long)__b);
  9778. }
  9779. static int __ATTRS_o_ai vec_all_le(vector bool long long __a,
  9780. vector signed long long __b) {
  9781. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
  9782. (vector unsigned long long)__b);
  9783. }
  9784. static int __ATTRS_o_ai vec_all_le(vector bool long long __a,
  9785. vector unsigned long long __b) {
  9786. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
  9787. __b);
  9788. }
  9789. static int __ATTRS_o_ai vec_all_le(vector bool long long __a,
  9790. vector bool long long __b) {
  9791. return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
  9792. (vector unsigned long long)__b);
  9793. }
  9794. #endif
  9795. static int __ATTRS_o_ai vec_all_le(vector float __a, vector float __b) {
  9796. return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
  9797. }
  9798. /* vec_all_lt */
  9799. static int __ATTRS_o_ai vec_all_lt(vector signed char __a,
  9800. vector signed char __b) {
  9801. return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
  9802. }
  9803. static int __ATTRS_o_ai vec_all_lt(vector signed char __a,
  9804. vector bool char __b) {
  9805. return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
  9806. }
  9807. static int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
  9808. vector unsigned char __b) {
  9809. return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
  9810. }
  9811. static int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
  9812. vector bool char __b) {
  9813. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
  9814. }
  9815. static int __ATTRS_o_ai vec_all_lt(vector bool char __a,
  9816. vector signed char __b) {
  9817. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
  9818. (vector unsigned char)__a);
  9819. }
  9820. static int __ATTRS_o_ai vec_all_lt(vector bool char __a,
  9821. vector unsigned char __b) {
  9822. return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
  9823. }
  9824. static int __ATTRS_o_ai vec_all_lt(vector bool char __a, vector bool char __b) {
  9825. return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
  9826. (vector unsigned char)__a);
  9827. }
  9828. static int __ATTRS_o_ai vec_all_lt(vector short __a, vector short __b) {
  9829. return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
  9830. }
  9831. static int __ATTRS_o_ai vec_all_lt(vector short __a, vector bool short __b) {
  9832. return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
  9833. }
  9834. static int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
  9835. vector unsigned short __b) {
  9836. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
  9837. }
  9838. static int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
  9839. vector bool short __b) {
  9840. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
  9841. __a);
  9842. }
  9843. static int __ATTRS_o_ai vec_all_lt(vector bool short __a, vector short __b) {
  9844. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
  9845. (vector unsigned short)__a);
  9846. }
  9847. static int __ATTRS_o_ai vec_all_lt(vector bool short __a,
  9848. vector unsigned short __b) {
  9849. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
  9850. (vector unsigned short)__a);
  9851. }
  9852. static int __ATTRS_o_ai vec_all_lt(vector bool short __a,
  9853. vector bool short __b) {
  9854. return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
  9855. (vector unsigned short)__a);
  9856. }
  9857. static int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
  9858. return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
  9859. }
  9860. static int __ATTRS_o_ai vec_all_lt(vector int __a, vector bool int __b) {
  9861. return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
  9862. }
  9863. static int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
  9864. vector unsigned int __b) {
  9865. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
  9866. }
  9867. static int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
  9868. vector bool int __b) {
  9869. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
  9870. }
  9871. static int __ATTRS_o_ai vec_all_lt(vector bool int __a, vector int __b) {
  9872. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
  9873. (vector unsigned int)__a);
  9874. }
  9875. static int __ATTRS_o_ai vec_all_lt(vector bool int __a,
  9876. vector unsigned int __b) {
  9877. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
  9878. }
  9879. static int __ATTRS_o_ai vec_all_lt(vector bool int __a, vector bool int __b) {
  9880. return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
  9881. (vector unsigned int)__a);
  9882. }
  9883. #ifdef __POWER8_VECTOR__
  9884. static int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
  9885. vector signed long long __b) {
  9886. return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
  9887. }
  9888. static int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
  9889. vector unsigned long long __b) {
  9890. return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
  9891. }
  9892. static int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
  9893. vector bool long long __b) {
  9894. return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
  9895. __a);
  9896. }
  9897. static int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
  9898. vector bool long long __b) {
  9899. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
  9900. __a);
  9901. }
  9902. static int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
  9903. vector signed long long __b) {
  9904. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
  9905. (vector unsigned long long)__a);
  9906. }
  9907. static int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
  9908. vector unsigned long long __b) {
  9909. return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
  9910. (vector unsigned long long)__a);
  9911. }
  9912. static int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
  9913. vector bool long long __b) {
  9914. return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
  9915. (vector unsigned long long)__a);
  9916. }
  9917. #endif
  9918. static int __ATTRS_o_ai vec_all_lt(vector float __a, vector float __b) {
  9919. return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
  9920. }
  9921. /* vec_all_nan */
  9922. static int __attribute__((__always_inline__)) vec_all_nan(vector float __a) {
  9923. return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
  9924. }
  9925. /* vec_all_ne */
  9926. static int __ATTRS_o_ai vec_all_ne(vector signed char __a,
  9927. vector signed char __b) {
  9928. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9929. (vector char)__b);
  9930. }
  9931. static int __ATTRS_o_ai vec_all_ne(vector signed char __a,
  9932. vector bool char __b) {
  9933. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9934. (vector char)__b);
  9935. }
  9936. static int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
  9937. vector unsigned char __b) {
  9938. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9939. (vector char)__b);
  9940. }
  9941. static int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
  9942. vector bool char __b) {
  9943. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9944. (vector char)__b);
  9945. }
  9946. static int __ATTRS_o_ai vec_all_ne(vector bool char __a,
  9947. vector signed char __b) {
  9948. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9949. (vector char)__b);
  9950. }
  9951. static int __ATTRS_o_ai vec_all_ne(vector bool char __a,
  9952. vector unsigned char __b) {
  9953. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9954. (vector char)__b);
  9955. }
  9956. static int __ATTRS_o_ai vec_all_ne(vector bool char __a, vector bool char __b) {
  9957. return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
  9958. (vector char)__b);
  9959. }
  9960. static int __ATTRS_o_ai vec_all_ne(vector short __a, vector short __b) {
  9961. return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
  9962. }
  9963. static int __ATTRS_o_ai vec_all_ne(vector short __a, vector bool short __b) {
  9964. return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
  9965. }
  9966. static int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
  9967. vector unsigned short __b) {
  9968. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9969. (vector short)__b);
  9970. }
  9971. static int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
  9972. vector bool short __b) {
  9973. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9974. (vector short)__b);
  9975. }
  9976. static int __ATTRS_o_ai vec_all_ne(vector bool short __a, vector short __b) {
  9977. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9978. (vector short)__b);
  9979. }
  9980. static int __ATTRS_o_ai vec_all_ne(vector bool short __a,
  9981. vector unsigned short __b) {
  9982. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9983. (vector short)__b);
  9984. }
  9985. static int __ATTRS_o_ai vec_all_ne(vector bool short __a,
  9986. vector bool short __b) {
  9987. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9988. (vector short)__b);
  9989. }
  9990. static int __ATTRS_o_ai vec_all_ne(vector pixel __a, vector pixel __b) {
  9991. return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
  9992. (vector short)__b);
  9993. }
  9994. static int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
  9995. return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
  9996. }
  9997. static int __ATTRS_o_ai vec_all_ne(vector int __a, vector bool int __b) {
  9998. return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
  9999. }
  10000. static int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
  10001. vector unsigned int __b) {
  10002. return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
  10003. (vector int)__b);
  10004. }
  10005. static int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
  10006. vector bool int __b) {
  10007. return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
  10008. (vector int)__b);
  10009. }
  10010. static int __ATTRS_o_ai vec_all_ne(vector bool int __a, vector int __b) {
  10011. return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
  10012. (vector int)__b);
  10013. }
  10014. static int __ATTRS_o_ai vec_all_ne(vector bool int __a,
  10015. vector unsigned int __b) {
  10016. return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
  10017. (vector int)__b);
  10018. }
  10019. static int __ATTRS_o_ai vec_all_ne(vector bool int __a, vector bool int __b) {
  10020. return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
  10021. (vector int)__b);
  10022. }
  10023. #ifdef __POWER8_VECTOR__
  10024. static int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
  10025. vector signed long long __b) {
  10026. return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
  10027. }
  10028. static int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
  10029. vector unsigned long long __b) {
  10030. return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
  10031. (vector long long)__b);
  10032. }
  10033. static int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
  10034. vector bool long long __b) {
  10035. return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
  10036. (vector signed long long)__b);
  10037. }
  10038. static int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
  10039. vector bool long long __b) {
  10040. return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
  10041. (vector signed long long)__b);
  10042. }
  10043. static int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
  10044. vector signed long long __b) {
  10045. return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
  10046. (vector signed long long)__b);
  10047. }
  10048. static int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
  10049. vector unsigned long long __b) {
  10050. return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
  10051. (vector signed long long)__b);
  10052. }
  10053. static int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
  10054. vector bool long long __b) {
  10055. return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
  10056. (vector signed long long)__b);
  10057. }
  10058. #endif
  10059. static int __ATTRS_o_ai vec_all_ne(vector float __a, vector float __b) {
  10060. return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
  10061. }
  10062. /* vec_all_nge */
  10063. static int __attribute__((__always_inline__))
  10064. vec_all_nge(vector float __a, vector float __b) {
  10065. return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
  10066. }
  10067. /* vec_all_ngt */
  10068. static int __attribute__((__always_inline__))
  10069. vec_all_ngt(vector float __a, vector float __b) {
  10070. return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
  10071. }
  10072. /* vec_all_nle */
  10073. static int __attribute__((__always_inline__))
  10074. vec_all_nle(vector float __a, vector float __b) {
  10075. return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
  10076. }
  10077. /* vec_all_nlt */
  10078. static int __attribute__((__always_inline__))
  10079. vec_all_nlt(vector float __a, vector float __b) {
  10080. return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
  10081. }
  10082. /* vec_all_numeric */
  10083. static int __attribute__((__always_inline__))
  10084. vec_all_numeric(vector float __a) {
  10085. return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
  10086. }
  10087. /* vec_any_eq */
  10088. static int __ATTRS_o_ai vec_any_eq(vector signed char __a,
  10089. vector signed char __b) {
  10090. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10091. (vector char)__b);
  10092. }
  10093. static int __ATTRS_o_ai vec_any_eq(vector signed char __a,
  10094. vector bool char __b) {
  10095. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10096. (vector char)__b);
  10097. }
  10098. static int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
  10099. vector unsigned char __b) {
  10100. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10101. (vector char)__b);
  10102. }
  10103. static int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
  10104. vector bool char __b) {
  10105. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10106. (vector char)__b);
  10107. }
  10108. static int __ATTRS_o_ai vec_any_eq(vector bool char __a,
  10109. vector signed char __b) {
  10110. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10111. (vector char)__b);
  10112. }
  10113. static int __ATTRS_o_ai vec_any_eq(vector bool char __a,
  10114. vector unsigned char __b) {
  10115. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10116. (vector char)__b);
  10117. }
  10118. static int __ATTRS_o_ai vec_any_eq(vector bool char __a, vector bool char __b) {
  10119. return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
  10120. (vector char)__b);
  10121. }
  10122. static int __ATTRS_o_ai vec_any_eq(vector short __a, vector short __b) {
  10123. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
  10124. }
  10125. static int __ATTRS_o_ai vec_any_eq(vector short __a, vector bool short __b) {
  10126. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
  10127. }
  10128. static int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
  10129. vector unsigned short __b) {
  10130. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10131. (vector short)__b);
  10132. }
  10133. static int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
  10134. vector bool short __b) {
  10135. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10136. (vector short)__b);
  10137. }
  10138. static int __ATTRS_o_ai vec_any_eq(vector bool short __a, vector short __b) {
  10139. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10140. (vector short)__b);
  10141. }
  10142. static int __ATTRS_o_ai vec_any_eq(vector bool short __a,
  10143. vector unsigned short __b) {
  10144. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10145. (vector short)__b);
  10146. }
  10147. static int __ATTRS_o_ai vec_any_eq(vector bool short __a,
  10148. vector bool short __b) {
  10149. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10150. (vector short)__b);
  10151. }
  10152. static int __ATTRS_o_ai vec_any_eq(vector pixel __a, vector pixel __b) {
  10153. return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
  10154. (vector short)__b);
  10155. }
  10156. static int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
  10157. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
  10158. }
  10159. static int __ATTRS_o_ai vec_any_eq(vector int __a, vector bool int __b) {
  10160. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
  10161. }
  10162. static int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
  10163. vector unsigned int __b) {
  10164. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
  10165. (vector int)__b);
  10166. }
  10167. static int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
  10168. vector bool int __b) {
  10169. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
  10170. (vector int)__b);
  10171. }
  10172. static int __ATTRS_o_ai vec_any_eq(vector bool int __a, vector int __b) {
  10173. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
  10174. (vector int)__b);
  10175. }
  10176. static int __ATTRS_o_ai vec_any_eq(vector bool int __a,
  10177. vector unsigned int __b) {
  10178. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
  10179. (vector int)__b);
  10180. }
  10181. static int __ATTRS_o_ai vec_any_eq(vector bool int __a, vector bool int __b) {
  10182. return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
  10183. (vector int)__b);
  10184. }
  10185. #ifdef __POWER8_VECTOR__
  10186. static int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
  10187. vector signed long long __b) {
  10188. return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
  10189. }
  10190. static int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
  10191. vector unsigned long long __b) {
  10192. return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
  10193. (vector long long)__b);
  10194. }
  10195. static int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
  10196. vector bool long long __b) {
  10197. return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
  10198. (vector signed long long)__b);
  10199. }
  10200. static int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
  10201. vector bool long long __b) {
  10202. return __builtin_altivec_vcmpequd_p(
  10203. __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
  10204. }
  10205. static int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
  10206. vector signed long long __b) {
  10207. return __builtin_altivec_vcmpequd_p(
  10208. __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
  10209. }
  10210. static int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
  10211. vector unsigned long long __b) {
  10212. return __builtin_altivec_vcmpequd_p(
  10213. __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
  10214. }
  10215. static int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
  10216. vector bool long long __b) {
  10217. return __builtin_altivec_vcmpequd_p(
  10218. __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
  10219. }
  10220. #endif
  10221. static int __ATTRS_o_ai vec_any_eq(vector float __a, vector float __b) {
  10222. return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
  10223. }
  10224. /* vec_any_ge */
  10225. static int __ATTRS_o_ai vec_any_ge(vector signed char __a,
  10226. vector signed char __b) {
  10227. return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
  10228. }
  10229. static int __ATTRS_o_ai vec_any_ge(vector signed char __a,
  10230. vector bool char __b) {
  10231. return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
  10232. __a);
  10233. }
  10234. static int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
  10235. vector unsigned char __b) {
  10236. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
  10237. }
  10238. static int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
  10239. vector bool char __b) {
  10240. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
  10241. __a);
  10242. }
  10243. static int __ATTRS_o_ai vec_any_ge(vector bool char __a,
  10244. vector signed char __b) {
  10245. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
  10246. (vector unsigned char)__a);
  10247. }
  10248. static int __ATTRS_o_ai vec_any_ge(vector bool char __a,
  10249. vector unsigned char __b) {
  10250. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
  10251. (vector unsigned char)__a);
  10252. }
  10253. static int __ATTRS_o_ai vec_any_ge(vector bool char __a, vector bool char __b) {
  10254. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
  10255. (vector unsigned char)__a);
  10256. }
  10257. static int __ATTRS_o_ai vec_any_ge(vector short __a, vector short __b) {
  10258. return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
  10259. }
  10260. static int __ATTRS_o_ai vec_any_ge(vector short __a, vector bool short __b) {
  10261. return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
  10262. }
  10263. static int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
  10264. vector unsigned short __b) {
  10265. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
  10266. }
  10267. static int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
  10268. vector bool short __b) {
  10269. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
  10270. __a);
  10271. }
  10272. static int __ATTRS_o_ai vec_any_ge(vector bool short __a, vector short __b) {
  10273. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
  10274. (vector unsigned short)__a);
  10275. }
  10276. static int __ATTRS_o_ai vec_any_ge(vector bool short __a,
  10277. vector unsigned short __b) {
  10278. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
  10279. (vector unsigned short)__a);
  10280. }
  10281. static int __ATTRS_o_ai vec_any_ge(vector bool short __a,
  10282. vector bool short __b) {
  10283. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
  10284. (vector unsigned short)__a);
  10285. }
  10286. static int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
  10287. return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
  10288. }
  10289. static int __ATTRS_o_ai vec_any_ge(vector int __a, vector bool int __b) {
  10290. return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
  10291. }
  10292. static int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
  10293. vector unsigned int __b) {
  10294. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
  10295. }
  10296. static int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
  10297. vector bool int __b) {
  10298. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
  10299. __a);
  10300. }
  10301. static int __ATTRS_o_ai vec_any_ge(vector bool int __a, vector int __b) {
  10302. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
  10303. (vector unsigned int)__a);
  10304. }
  10305. static int __ATTRS_o_ai vec_any_ge(vector bool int __a,
  10306. vector unsigned int __b) {
  10307. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
  10308. (vector unsigned int)__a);
  10309. }
  10310. static int __ATTRS_o_ai vec_any_ge(vector bool int __a, vector bool int __b) {
  10311. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
  10312. (vector unsigned int)__a);
  10313. }
  10314. #ifdef __POWER8_VECTOR__
  10315. static int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
  10316. vector signed long long __b) {
  10317. return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
  10318. }
  10319. static int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
  10320. vector unsigned long long __b) {
  10321. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
  10322. }
  10323. static int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
  10324. vector bool long long __b) {
  10325. return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
  10326. (vector signed long long)__b, __a);
  10327. }
  10328. static int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
  10329. vector bool long long __b) {
  10330. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10331. (vector unsigned long long)__b, __a);
  10332. }
  10333. static int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
  10334. vector signed long long __b) {
  10335. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10336. (vector unsigned long long)__b,
  10337. (vector unsigned long long)__a);
  10338. }
  10339. static int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
  10340. vector unsigned long long __b) {
  10341. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
  10342. (vector unsigned long long)__a);
  10343. }
  10344. static int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
  10345. vector bool long long __b) {
  10346. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10347. (vector unsigned long long)__b,
  10348. (vector unsigned long long)__a);
  10349. }
  10350. #endif
  10351. static int __ATTRS_o_ai vec_any_ge(vector float __a, vector float __b) {
  10352. return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
  10353. }
  10354. /* vec_any_gt */
  10355. static int __ATTRS_o_ai vec_any_gt(vector signed char __a,
  10356. vector signed char __b) {
  10357. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
  10358. }
  10359. static int __ATTRS_o_ai vec_any_gt(vector signed char __a,
  10360. vector bool char __b) {
  10361. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
  10362. (vector signed char)__b);
  10363. }
  10364. static int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
  10365. vector unsigned char __b) {
  10366. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
  10367. }
  10368. static int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
  10369. vector bool char __b) {
  10370. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
  10371. (vector unsigned char)__b);
  10372. }
  10373. static int __ATTRS_o_ai vec_any_gt(vector bool char __a,
  10374. vector signed char __b) {
  10375. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
  10376. (vector unsigned char)__b);
  10377. }
  10378. static int __ATTRS_o_ai vec_any_gt(vector bool char __a,
  10379. vector unsigned char __b) {
  10380. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
  10381. __b);
  10382. }
  10383. static int __ATTRS_o_ai vec_any_gt(vector bool char __a, vector bool char __b) {
  10384. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
  10385. (vector unsigned char)__b);
  10386. }
  10387. static int __ATTRS_o_ai vec_any_gt(vector short __a, vector short __b) {
  10388. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
  10389. }
  10390. static int __ATTRS_o_ai vec_any_gt(vector short __a, vector bool short __b) {
  10391. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
  10392. }
  10393. static int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
  10394. vector unsigned short __b) {
  10395. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
  10396. }
  10397. static int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
  10398. vector bool short __b) {
  10399. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
  10400. (vector unsigned short)__b);
  10401. }
  10402. static int __ATTRS_o_ai vec_any_gt(vector bool short __a, vector short __b) {
  10403. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
  10404. (vector unsigned short)__b);
  10405. }
  10406. static int __ATTRS_o_ai vec_any_gt(vector bool short __a,
  10407. vector unsigned short __b) {
  10408. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
  10409. __b);
  10410. }
  10411. static int __ATTRS_o_ai vec_any_gt(vector bool short __a,
  10412. vector bool short __b) {
  10413. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
  10414. (vector unsigned short)__b);
  10415. }
  10416. static int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
  10417. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
  10418. }
  10419. static int __ATTRS_o_ai vec_any_gt(vector int __a, vector bool int __b) {
  10420. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
  10421. }
  10422. static int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
  10423. vector unsigned int __b) {
  10424. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
  10425. }
  10426. static int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
  10427. vector bool int __b) {
  10428. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
  10429. (vector unsigned int)__b);
  10430. }
  10431. static int __ATTRS_o_ai vec_any_gt(vector bool int __a, vector int __b) {
  10432. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
  10433. (vector unsigned int)__b);
  10434. }
  10435. static int __ATTRS_o_ai vec_any_gt(vector bool int __a,
  10436. vector unsigned int __b) {
  10437. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
  10438. __b);
  10439. }
  10440. static int __ATTRS_o_ai vec_any_gt(vector bool int __a, vector bool int __b) {
  10441. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
  10442. (vector unsigned int)__b);
  10443. }
  10444. #ifdef __POWER8_VECTOR__
  10445. static int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
  10446. vector signed long long __b) {
  10447. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
  10448. }
  10449. static int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
  10450. vector unsigned long long __b) {
  10451. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
  10452. }
  10453. static int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
  10454. vector bool long long __b) {
  10455. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
  10456. (vector signed long long)__b);
  10457. }
  10458. static int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
  10459. vector bool long long __b) {
  10460. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
  10461. (vector unsigned long long)__b);
  10462. }
  10463. static int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
  10464. vector signed long long __b) {
  10465. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10466. (vector unsigned long long)__a,
  10467. (vector unsigned long long)__b);
  10468. }
  10469. static int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
  10470. vector unsigned long long __b) {
  10471. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10472. (vector unsigned long long)__a, __b);
  10473. }
  10474. static int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
  10475. vector bool long long __b) {
  10476. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10477. (vector unsigned long long)__a,
  10478. (vector unsigned long long)__b);
  10479. }
  10480. #endif
  10481. static int __ATTRS_o_ai vec_any_gt(vector float __a, vector float __b) {
  10482. return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
  10483. }
  10484. /* vec_any_le */
  10485. static int __ATTRS_o_ai vec_any_le(vector signed char __a,
  10486. vector signed char __b) {
  10487. return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
  10488. }
  10489. static int __ATTRS_o_ai vec_any_le(vector signed char __a,
  10490. vector bool char __b) {
  10491. return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
  10492. (vector signed char)__b);
  10493. }
  10494. static int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
  10495. vector unsigned char __b) {
  10496. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
  10497. }
  10498. static int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
  10499. vector bool char __b) {
  10500. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
  10501. (vector unsigned char)__b);
  10502. }
  10503. static int __ATTRS_o_ai vec_any_le(vector bool char __a,
  10504. vector signed char __b) {
  10505. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
  10506. (vector unsigned char)__b);
  10507. }
  10508. static int __ATTRS_o_ai vec_any_le(vector bool char __a,
  10509. vector unsigned char __b) {
  10510. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
  10511. __b);
  10512. }
  10513. static int __ATTRS_o_ai vec_any_le(vector bool char __a, vector bool char __b) {
  10514. return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
  10515. (vector unsigned char)__b);
  10516. }
  10517. static int __ATTRS_o_ai vec_any_le(vector short __a, vector short __b) {
  10518. return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
  10519. }
  10520. static int __ATTRS_o_ai vec_any_le(vector short __a, vector bool short __b) {
  10521. return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
  10522. }
  10523. static int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
  10524. vector unsigned short __b) {
  10525. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
  10526. }
  10527. static int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
  10528. vector bool short __b) {
  10529. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
  10530. (vector unsigned short)__b);
  10531. }
  10532. static int __ATTRS_o_ai vec_any_le(vector bool short __a, vector short __b) {
  10533. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
  10534. (vector unsigned short)__b);
  10535. }
  10536. static int __ATTRS_o_ai vec_any_le(vector bool short __a,
  10537. vector unsigned short __b) {
  10538. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
  10539. __b);
  10540. }
  10541. static int __ATTRS_o_ai vec_any_le(vector bool short __a,
  10542. vector bool short __b) {
  10543. return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
  10544. (vector unsigned short)__b);
  10545. }
  10546. static int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
  10547. return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
  10548. }
  10549. static int __ATTRS_o_ai vec_any_le(vector int __a, vector bool int __b) {
  10550. return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
  10551. }
  10552. static int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
  10553. vector unsigned int __b) {
  10554. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
  10555. }
  10556. static int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
  10557. vector bool int __b) {
  10558. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
  10559. (vector unsigned int)__b);
  10560. }
  10561. static int __ATTRS_o_ai vec_any_le(vector bool int __a, vector int __b) {
  10562. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
  10563. (vector unsigned int)__b);
  10564. }
  10565. static int __ATTRS_o_ai vec_any_le(vector bool int __a,
  10566. vector unsigned int __b) {
  10567. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
  10568. __b);
  10569. }
  10570. static int __ATTRS_o_ai vec_any_le(vector bool int __a, vector bool int __b) {
  10571. return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
  10572. (vector unsigned int)__b);
  10573. }
  10574. #ifdef __POWER8_VECTOR__
  10575. static int __ATTRS_o_ai vec_any_le(vector signed long long __a,
  10576. vector signed long long __b) {
  10577. return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
  10578. }
  10579. static int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
  10580. vector unsigned long long __b) {
  10581. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
  10582. }
  10583. static int __ATTRS_o_ai vec_any_le(vector signed long long __a,
  10584. vector bool long long __b) {
  10585. return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
  10586. (vector signed long long)__b);
  10587. }
  10588. static int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
  10589. vector bool long long __b) {
  10590. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
  10591. (vector unsigned long long)__b);
  10592. }
  10593. static int __ATTRS_o_ai vec_any_le(vector bool long long __a,
  10594. vector signed long long __b) {
  10595. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10596. (vector unsigned long long)__a,
  10597. (vector unsigned long long)__b);
  10598. }
  10599. static int __ATTRS_o_ai vec_any_le(vector bool long long __a,
  10600. vector unsigned long long __b) {
  10601. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10602. (vector unsigned long long)__a, __b);
  10603. }
  10604. static int __ATTRS_o_ai vec_any_le(vector bool long long __a,
  10605. vector bool long long __b) {
  10606. return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
  10607. (vector unsigned long long)__a,
  10608. (vector unsigned long long)__b);
  10609. }
  10610. #endif
  10611. static int __ATTRS_o_ai vec_any_le(vector float __a, vector float __b) {
  10612. return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
  10613. }
  10614. /* vec_any_lt */
  10615. static int __ATTRS_o_ai vec_any_lt(vector signed char __a,
  10616. vector signed char __b) {
  10617. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
  10618. }
  10619. static int __ATTRS_o_ai vec_any_lt(vector signed char __a,
  10620. vector bool char __b) {
  10621. return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
  10622. __a);
  10623. }
  10624. static int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
  10625. vector unsigned char __b) {
  10626. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
  10627. }
  10628. static int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
  10629. vector bool char __b) {
  10630. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
  10631. __a);
  10632. }
  10633. static int __ATTRS_o_ai vec_any_lt(vector bool char __a,
  10634. vector signed char __b) {
  10635. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
  10636. (vector unsigned char)__a);
  10637. }
  10638. static int __ATTRS_o_ai vec_any_lt(vector bool char __a,
  10639. vector unsigned char __b) {
  10640. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
  10641. (vector unsigned char)__a);
  10642. }
  10643. static int __ATTRS_o_ai vec_any_lt(vector bool char __a, vector bool char __b) {
  10644. return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
  10645. (vector unsigned char)__a);
  10646. }
  10647. static int __ATTRS_o_ai vec_any_lt(vector short __a, vector short __b) {
  10648. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
  10649. }
  10650. static int __ATTRS_o_ai vec_any_lt(vector short __a, vector bool short __b) {
  10651. return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
  10652. }
  10653. static int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
  10654. vector unsigned short __b) {
  10655. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
  10656. }
  10657. static int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
  10658. vector bool short __b) {
  10659. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
  10660. __a);
  10661. }
  10662. static int __ATTRS_o_ai vec_any_lt(vector bool short __a, vector short __b) {
  10663. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
  10664. (vector unsigned short)__a);
  10665. }
  10666. static int __ATTRS_o_ai vec_any_lt(vector bool short __a,
  10667. vector unsigned short __b) {
  10668. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
  10669. (vector unsigned short)__a);
  10670. }
  10671. static int __ATTRS_o_ai vec_any_lt(vector bool short __a,
  10672. vector bool short __b) {
  10673. return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
  10674. (vector unsigned short)__a);
  10675. }
  10676. static int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
  10677. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
  10678. }
  10679. static int __ATTRS_o_ai vec_any_lt(vector int __a, vector bool int __b) {
  10680. return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
  10681. }
  10682. static int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
  10683. vector unsigned int __b) {
  10684. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
  10685. }
  10686. static int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
  10687. vector bool int __b) {
  10688. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
  10689. __a);
  10690. }
  10691. static int __ATTRS_o_ai vec_any_lt(vector bool int __a, vector int __b) {
  10692. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
  10693. (vector unsigned int)__a);
  10694. }
  10695. static int __ATTRS_o_ai vec_any_lt(vector bool int __a,
  10696. vector unsigned int __b) {
  10697. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
  10698. (vector unsigned int)__a);
  10699. }
  10700. static int __ATTRS_o_ai vec_any_lt(vector bool int __a, vector bool int __b) {
  10701. return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
  10702. (vector unsigned int)__a);
  10703. }
  10704. #ifdef __POWER8_VECTOR__
  10705. static int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
  10706. vector signed long long __b) {
  10707. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
  10708. }
  10709. static int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
  10710. vector unsigned long long __b) {
  10711. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
  10712. }
  10713. static int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
  10714. vector bool long long __b) {
  10715. return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
  10716. (vector signed long long)__b, __a);
  10717. }
  10718. static int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
  10719. vector bool long long __b) {
  10720. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10721. (vector unsigned long long)__b, __a);
  10722. }
  10723. static int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
  10724. vector signed long long __b) {
  10725. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10726. (vector unsigned long long)__b,
  10727. (vector unsigned long long)__a);
  10728. }
  10729. static int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
  10730. vector unsigned long long __b) {
  10731. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
  10732. (vector unsigned long long)__a);
  10733. }
  10734. static int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
  10735. vector bool long long __b) {
  10736. return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
  10737. (vector unsigned long long)__b,
  10738. (vector unsigned long long)__a);
  10739. }
  10740. #endif
  10741. static int __ATTRS_o_ai vec_any_lt(vector float __a, vector float __b) {
  10742. return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
  10743. }
  10744. /* vec_any_nan */
  10745. static int __attribute__((__always_inline__)) vec_any_nan(vector float __a) {
  10746. return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
  10747. }
  10748. /* vec_any_ne */
  10749. static int __ATTRS_o_ai vec_any_ne(vector signed char __a,
  10750. vector signed char __b) {
  10751. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10752. (vector char)__b);
  10753. }
  10754. static int __ATTRS_o_ai vec_any_ne(vector signed char __a,
  10755. vector bool char __b) {
  10756. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10757. (vector char)__b);
  10758. }
  10759. static int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
  10760. vector unsigned char __b) {
  10761. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10762. (vector char)__b);
  10763. }
  10764. static int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
  10765. vector bool char __b) {
  10766. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10767. (vector char)__b);
  10768. }
  10769. static int __ATTRS_o_ai vec_any_ne(vector bool char __a,
  10770. vector signed char __b) {
  10771. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10772. (vector char)__b);
  10773. }
  10774. static int __ATTRS_o_ai vec_any_ne(vector bool char __a,
  10775. vector unsigned char __b) {
  10776. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10777. (vector char)__b);
  10778. }
  10779. static int __ATTRS_o_ai vec_any_ne(vector bool char __a, vector bool char __b) {
  10780. return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
  10781. (vector char)__b);
  10782. }
  10783. static int __ATTRS_o_ai vec_any_ne(vector short __a, vector short __b) {
  10784. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
  10785. }
  10786. static int __ATTRS_o_ai vec_any_ne(vector short __a, vector bool short __b) {
  10787. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
  10788. }
  10789. static int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
  10790. vector unsigned short __b) {
  10791. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10792. (vector short)__b);
  10793. }
  10794. static int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
  10795. vector bool short __b) {
  10796. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10797. (vector short)__b);
  10798. }
  10799. static int __ATTRS_o_ai vec_any_ne(vector bool short __a, vector short __b) {
  10800. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10801. (vector short)__b);
  10802. }
  10803. static int __ATTRS_o_ai vec_any_ne(vector bool short __a,
  10804. vector unsigned short __b) {
  10805. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10806. (vector short)__b);
  10807. }
  10808. static int __ATTRS_o_ai vec_any_ne(vector bool short __a,
  10809. vector bool short __b) {
  10810. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10811. (vector short)__b);
  10812. }
  10813. static int __ATTRS_o_ai vec_any_ne(vector pixel __a, vector pixel __b) {
  10814. return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
  10815. (vector short)__b);
  10816. }
  10817. static int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
  10818. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
  10819. }
  10820. static int __ATTRS_o_ai vec_any_ne(vector int __a, vector bool int __b) {
  10821. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
  10822. }
  10823. static int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
  10824. vector unsigned int __b) {
  10825. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
  10826. (vector int)__b);
  10827. }
  10828. static int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
  10829. vector bool int __b) {
  10830. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
  10831. (vector int)__b);
  10832. }
  10833. static int __ATTRS_o_ai vec_any_ne(vector bool int __a, vector int __b) {
  10834. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
  10835. (vector int)__b);
  10836. }
  10837. static int __ATTRS_o_ai vec_any_ne(vector bool int __a,
  10838. vector unsigned int __b) {
  10839. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
  10840. (vector int)__b);
  10841. }
  10842. static int __ATTRS_o_ai vec_any_ne(vector bool int __a, vector bool int __b) {
  10843. return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
  10844. (vector int)__b);
  10845. }
  10846. #ifdef __POWER8_VECTOR__
  10847. static int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
  10848. vector signed long long __b) {
  10849. return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
  10850. }
  10851. static int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
  10852. vector unsigned long long __b) {
  10853. return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
  10854. (vector long long)__b);
  10855. }
  10856. static int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
  10857. vector bool long long __b) {
  10858. return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
  10859. (vector signed long long)__b);
  10860. }
  10861. static int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
  10862. vector bool long long __b) {
  10863. return __builtin_altivec_vcmpequd_p(
  10864. __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
  10865. }
  10866. static int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
  10867. vector signed long long __b) {
  10868. return __builtin_altivec_vcmpequd_p(
  10869. __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
  10870. }
  10871. static int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
  10872. vector unsigned long long __b) {
  10873. return __builtin_altivec_vcmpequd_p(
  10874. __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
  10875. }
  10876. static int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
  10877. vector bool long long __b) {
  10878. return __builtin_altivec_vcmpequd_p(
  10879. __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
  10880. }
  10881. #endif
  10882. static int __ATTRS_o_ai vec_any_ne(vector float __a, vector float __b) {
  10883. return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
  10884. }
  10885. /* vec_any_nge */
  10886. static int __attribute__((__always_inline__))
  10887. vec_any_nge(vector float __a, vector float __b) {
  10888. return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
  10889. }
  10890. /* vec_any_ngt */
  10891. static int __attribute__((__always_inline__))
  10892. vec_any_ngt(vector float __a, vector float __b) {
  10893. return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
  10894. }
  10895. /* vec_any_nle */
  10896. static int __attribute__((__always_inline__))
  10897. vec_any_nle(vector float __a, vector float __b) {
  10898. return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
  10899. }
  10900. /* vec_any_nlt */
  10901. static int __attribute__((__always_inline__))
  10902. vec_any_nlt(vector float __a, vector float __b) {
  10903. return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
  10904. }
  10905. /* vec_any_numeric */
  10906. static int __attribute__((__always_inline__))
  10907. vec_any_numeric(vector float __a) {
  10908. return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
  10909. }
  10910. /* vec_any_out */
  10911. static int __attribute__((__always_inline__))
  10912. vec_any_out(vector float __a, vector float __b) {
  10913. return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
  10914. }
  10915. /* Power 8 Crypto functions
  10916. Note: We diverge from the current GCC implementation with regard
  10917. to cryptography and related functions as follows:
  10918. - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
  10919. - The remaining ones are only available on Power8 and up so
  10920. require -mpower8-vector
  10921. The justification for this is that export requirements require that
  10922. Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
  10923. support). As a result, we need to be able to turn off support for those.
  10924. The remaining ones (currently controlled by -mcrypto for GCC) still
  10925. need to be provided on compliant hardware even if Vector.Crypto is not
  10926. provided.
  10927. FIXME: the naming convention for the builtins will be adjusted due
  10928. to the inconsistency (__builtin_crypto_ prefix on builtins that cannot be
  10929. removed with -mno-crypto). This is under development.
  10930. */
  10931. #ifdef __CRYPTO__
  10932. static vector unsigned long long __attribute__((__always_inline__))
  10933. __builtin_crypto_vsbox(vector unsigned long long __a) {
  10934. return __builtin_altivec_crypto_vsbox(__a);
  10935. }
  10936. static vector unsigned long long __attribute__((__always_inline__))
  10937. __builtin_crypto_vcipher(vector unsigned long long __a,
  10938. vector unsigned long long __b) {
  10939. return __builtin_altivec_crypto_vcipher(__a, __b);
  10940. }
  10941. static vector unsigned long long __attribute__((__always_inline__))
  10942. __builtin_crypto_vcipherlast(vector unsigned long long __a,
  10943. vector unsigned long long __b) {
  10944. return __builtin_altivec_crypto_vcipherlast(__a, __b);
  10945. }
  10946. static vector unsigned long long __attribute__((__always_inline__))
  10947. __builtin_crypto_vncipher(vector unsigned long long __a,
  10948. vector unsigned long long __b) {
  10949. return __builtin_altivec_crypto_vncipher(__a, __b);
  10950. }
  10951. static vector unsigned long long __attribute__((__always_inline__))
  10952. __builtin_crypto_vncipherlast(vector unsigned long long __a,
  10953. vector unsigned long long __b) {
  10954. return __builtin_altivec_crypto_vncipherlast(__a, __b);
  10955. }
  10956. #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
  10957. #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
  10958. #endif
  10959. #ifdef __POWER8_VECTOR__
  10960. static vector unsigned char __ATTRS_o_ai
  10961. __builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
  10962. vector unsigned char __c) {
  10963. return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
  10964. }
  10965. static vector unsigned short __ATTRS_o_ai
  10966. __builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
  10967. vector unsigned short __c) {
  10968. return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
  10969. (vector unsigned char)__a, (vector unsigned char)__b,
  10970. (vector unsigned char)__c);
  10971. }
  10972. static vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
  10973. vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
  10974. return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
  10975. (vector unsigned char)__a, (vector unsigned char)__b,
  10976. (vector unsigned char)__c);
  10977. }
  10978. static vector unsigned long long __ATTRS_o_ai __builtin_crypto_vpermxor(
  10979. vector unsigned long long __a, vector unsigned long long __b,
  10980. vector unsigned long long __c) {
  10981. return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
  10982. (vector unsigned char)__a, (vector unsigned char)__b,
  10983. (vector unsigned char)__c);
  10984. }
  10985. static vector unsigned char __ATTRS_o_ai
  10986. __builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
  10987. return __builtin_altivec_crypto_vpmsumb(__a, __b);
  10988. }
  10989. static vector unsigned short __ATTRS_o_ai
  10990. __builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
  10991. return __builtin_altivec_crypto_vpmsumh(__a, __b);
  10992. }
  10993. static vector unsigned int __ATTRS_o_ai
  10994. __builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
  10995. return __builtin_altivec_crypto_vpmsumw(__a, __b);
  10996. }
  10997. static vector unsigned long long __ATTRS_o_ai __builtin_crypto_vpmsumb(
  10998. vector unsigned long long __a, vector unsigned long long __b) {
  10999. return __builtin_altivec_crypto_vpmsumd(__a, __b);
  11000. }
  11001. static vector signed char __ATTRS_o_ai vec_vgbbd (vector signed char __a)
  11002. {
  11003. return __builtin_altivec_vgbbd((vector unsigned char) __a);
  11004. }
  11005. static vector unsigned char __ATTRS_o_ai vec_vgbbd (vector unsigned char __a)
  11006. {
  11007. return __builtin_altivec_vgbbd(__a);
  11008. }
  11009. static vector long long __ATTRS_o_ai
  11010. vec_vbpermq (vector signed char __a, vector signed char __b)
  11011. {
  11012. return __builtin_altivec_vbpermq((vector unsigned char) __a,
  11013. (vector unsigned char) __b);
  11014. }
  11015. static vector long long __ATTRS_o_ai
  11016. vec_vbpermq (vector unsigned char __a, vector unsigned char __b)
  11017. {
  11018. return __builtin_altivec_vbpermq(__a, __b);
  11019. }
  11020. #endif
  11021. #undef __ATTRS_o_ai
  11022. #endif /* __ALTIVEC_H */