1 Star 0 Fork 163

junhe_arm/glibc

forked from src-openEuler/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0013-Sw64-math-support.patch 127.99 KB
一键复制 编辑 原始数据 按行查看 历史
swcompiler 提交于 2024-12-17 04:02 +08:00 . Sw64: Add Sw64 ISA support
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002
From 1674f414ec1d0307f9b50fbf514dd7272bcfbe66 Mon Sep 17 00:00:00 2001
From: swcompiler <lc@wxiat.com>
Date: Fri, 29 Nov 2024 13:57:15 +0800
Subject: [PATCH 13/23] Sw64: math support
---
sysdeps/sw_64/fpu/cabsf.c | 41 +
sysdeps/sw_64/fpu/cargf.c | 41 +
sysdeps/sw_64/fpu/cfloat-compat.h | 69 +
sysdeps/sw_64/fpu/cimagf.c | 40 +
sysdeps/sw_64/fpu/conjf.c | 42 +
sysdeps/sw_64/fpu/crealf.c | 40 +
sysdeps/sw_64/fpu/e_sqrt.c | 26 +
sysdeps/sw_64/fpu/e_sqrtf.c | 8 +
sysdeps/sw_64/fpu/fclrexcpt.c | 47 +
sysdeps/sw_64/fpu/fedisblxcpt.c | 35 +
sysdeps/sw_64/fpu/feenablxcpt.c | 35 +
sysdeps/sw_64/fpu/fegetenv.c | 47 +
sysdeps/sw_64/fpu/fegetexcept.c | 30 +
sysdeps/sw_64/fpu/fegetmode.c | 33 +
sysdeps/sw_64/fpu/fegetround.c | 32 +
sysdeps/sw_64/fpu/feholdexcpt.c | 34 +
sysdeps/sw_64/fpu/fenv_libc.h | 37 +
sysdeps/sw_64/fpu/fesetenv.c | 56 +
sysdeps/sw_64/fpu/fesetexcept.c | 31 +
sysdeps/sw_64/fpu/fesetmode.c | 44 +
sysdeps/sw_64/fpu/fesetround.c | 43 +
sysdeps/sw_64/fpu/feupdateenv.c | 49 +
sysdeps/sw_64/fpu/fgetexcptflg.c | 43 +
sysdeps/sw_64/fpu/fpu_control.h | 104 ++
sysdeps/sw_64/fpu/fsetexcptflg.c | 46 +
sysdeps/sw_64/fpu/ftestexcept.c | 32 +
sysdeps/sw_64/fpu/math-barriers.h | 35 +
sysdeps/sw_64/fpu/math-use-builtins-sqrt.h | 9 +
sysdeps/sw_64/fpu/s_cacosf.c | 57 +
sysdeps/sw_64/fpu/s_cacoshf.c | 56 +
sysdeps/sw_64/fpu/s_casinf.c | 54 +
sysdeps/sw_64/fpu/s_casinhf.c | 54 +
sysdeps/sw_64/fpu/s_catanf.c | 54 +
sysdeps/sw_64/fpu/s_catanhf.c | 54 +
sysdeps/sw_64/fpu/s_ccosf.c | 54 +
sysdeps/sw_64/fpu/s_ccoshf.c | 54 +
sysdeps/sw_64/fpu/s_cexpf.c | 54 +
sysdeps/sw_64/fpu/s_clog10f.c | 66 +
sysdeps/sw_64/fpu/s_clogf.c | 54 +
sysdeps/sw_64/fpu/s_copysign.c | 33 +
sysdeps/sw_64/fpu/s_copysignf.c | 29 +
sysdeps/sw_64/fpu/s_cpowf.c | 54 +
sysdeps/sw_64/fpu/s_cprojf.c | 54 +
sysdeps/sw_64/fpu/s_csinf.c | 54 +
sysdeps/sw_64/fpu/s_csinhf.c | 54 +
sysdeps/sw_64/fpu/s_csqrtf.c | 54 +
sysdeps/sw_64/fpu/s_ctanf.c | 54 +
sysdeps/sw_64/fpu/s_ctanhf.c | 54 +
sysdeps/sw_64/fpu/s_fabs.c | 29 +
sysdeps/sw_64/fpu/s_fabsf.c | 28 +
sysdeps/sw_64/fpu/s_fma.c | 2 +
sysdeps/sw_64/fpu/s_isnan.c | 57 +
sysdeps/sw_64/fpu/s_isnanf.c | 1 +
sysdeps/sw_64/fpu/s_llrint.c | 1 +
sysdeps/sw_64/fpu/s_llrintf.c | 1 +
sysdeps/sw_64/fpu/s_llround.c | 1 +
sysdeps/sw_64/fpu/s_llroundf.c | 1 +
sysdeps/sw_64/fpu/s_lrint.c | 39 +
sysdeps/sw_64/fpu/s_lrintf.c | 41 +
sysdeps/sw_64/fpu/s_lround.c | 40 +
sysdeps/sw_64/fpu/s_lroundf.c | 76 +
sysdeps/sw_64/fpu/s_rint.c | 47 +
sysdeps/sw_64/fpu/s_rintf.c | 53 +
sysdeps/sw_64/fpu/ulps | 1826 ++++++++++++++++++++
sysdeps/sw_64/hp-timing.h | 48 +
65 files changed, 4471 insertions(+)
create mode 100644 sysdeps/sw_64/fpu/cabsf.c
create mode 100644 sysdeps/sw_64/fpu/cargf.c
create mode 100644 sysdeps/sw_64/fpu/cfloat-compat.h
create mode 100644 sysdeps/sw_64/fpu/cimagf.c
create mode 100644 sysdeps/sw_64/fpu/conjf.c
create mode 100644 sysdeps/sw_64/fpu/crealf.c
create mode 100644 sysdeps/sw_64/fpu/e_sqrt.c
create mode 100644 sysdeps/sw_64/fpu/e_sqrtf.c
create mode 100644 sysdeps/sw_64/fpu/fclrexcpt.c
create mode 100644 sysdeps/sw_64/fpu/fedisblxcpt.c
create mode 100644 sysdeps/sw_64/fpu/feenablxcpt.c
create mode 100644 sysdeps/sw_64/fpu/fegetenv.c
create mode 100644 sysdeps/sw_64/fpu/fegetexcept.c
create mode 100644 sysdeps/sw_64/fpu/fegetmode.c
create mode 100644 sysdeps/sw_64/fpu/fegetround.c
create mode 100644 sysdeps/sw_64/fpu/feholdexcpt.c
create mode 100644 sysdeps/sw_64/fpu/fenv_libc.h
create mode 100644 sysdeps/sw_64/fpu/fesetenv.c
create mode 100644 sysdeps/sw_64/fpu/fesetexcept.c
create mode 100644 sysdeps/sw_64/fpu/fesetmode.c
create mode 100644 sysdeps/sw_64/fpu/fesetround.c
create mode 100644 sysdeps/sw_64/fpu/feupdateenv.c
create mode 100644 sysdeps/sw_64/fpu/fgetexcptflg.c
create mode 100644 sysdeps/sw_64/fpu/fpu_control.h
create mode 100644 sysdeps/sw_64/fpu/fsetexcptflg.c
create mode 100644 sysdeps/sw_64/fpu/ftestexcept.c
create mode 100644 sysdeps/sw_64/fpu/math-barriers.h
create mode 100644 sysdeps/sw_64/fpu/math-use-builtins-sqrt.h
create mode 100644 sysdeps/sw_64/fpu/s_cacosf.c
create mode 100644 sysdeps/sw_64/fpu/s_cacoshf.c
create mode 100644 sysdeps/sw_64/fpu/s_casinf.c
create mode 100644 sysdeps/sw_64/fpu/s_casinhf.c
create mode 100644 sysdeps/sw_64/fpu/s_catanf.c
create mode 100644 sysdeps/sw_64/fpu/s_catanhf.c
create mode 100644 sysdeps/sw_64/fpu/s_ccosf.c
create mode 100644 sysdeps/sw_64/fpu/s_ccoshf.c
create mode 100644 sysdeps/sw_64/fpu/s_cexpf.c
create mode 100644 sysdeps/sw_64/fpu/s_clog10f.c
create mode 100644 sysdeps/sw_64/fpu/s_clogf.c
create mode 100644 sysdeps/sw_64/fpu/s_copysign.c
create mode 100644 sysdeps/sw_64/fpu/s_copysignf.c
create mode 100644 sysdeps/sw_64/fpu/s_cpowf.c
create mode 100644 sysdeps/sw_64/fpu/s_cprojf.c
create mode 100644 sysdeps/sw_64/fpu/s_csinf.c
create mode 100644 sysdeps/sw_64/fpu/s_csinhf.c
create mode 100644 sysdeps/sw_64/fpu/s_csqrtf.c
create mode 100644 sysdeps/sw_64/fpu/s_ctanf.c
create mode 100644 sysdeps/sw_64/fpu/s_ctanhf.c
create mode 100644 sysdeps/sw_64/fpu/s_fabs.c
create mode 100644 sysdeps/sw_64/fpu/s_fabsf.c
create mode 100644 sysdeps/sw_64/fpu/s_fma.c
create mode 100644 sysdeps/sw_64/fpu/s_isnan.c
create mode 100644 sysdeps/sw_64/fpu/s_isnanf.c
create mode 100644 sysdeps/sw_64/fpu/s_llrint.c
create mode 100644 sysdeps/sw_64/fpu/s_llrintf.c
create mode 100644 sysdeps/sw_64/fpu/s_llround.c
create mode 100644 sysdeps/sw_64/fpu/s_llroundf.c
create mode 100644 sysdeps/sw_64/fpu/s_lrint.c
create mode 100644 sysdeps/sw_64/fpu/s_lrintf.c
create mode 100644 sysdeps/sw_64/fpu/s_lround.c
create mode 100644 sysdeps/sw_64/fpu/s_lroundf.c
create mode 100644 sysdeps/sw_64/fpu/s_rint.c
create mode 100644 sysdeps/sw_64/fpu/s_rintf.c
create mode 100644 sysdeps/sw_64/fpu/ulps
create mode 100644 sysdeps/sw_64/hp-timing.h
diff --git a/sysdeps/sw_64/fpu/cabsf.c b/sysdeps/sw_64/fpu/cabsf.c
new file mode 100644
index 00000000..7390d3c1
--- /dev/null
+++ b/sysdeps/sw_64/fpu/cabsf.c
@@ -0,0 +1,41 @@
+/* Return the complex absolute value of float complex value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cabsf __cabsf_not_defined
+#define cabsf cabsf_not_defined
+
+#include <complex.h>
+#include <math.h>
+#include "cfloat-compat.h"
+
+#undef __cabsf
+#undef cabsf
+
+float
+__c1_cabsf (c1_cfloat_decl (z))
+{
+ return __hypotf (c1_cfloat_real (z), c1_cfloat_imag (z));
+}
+
+float
+__c2_cabsf (c2_cfloat_decl (z))
+{
+ return __hypotf (c2_cfloat_real (z), c2_cfloat_imag (z));
+}
+
+cfloat_versions (cabs);
diff --git a/sysdeps/sw_64/fpu/cargf.c b/sysdeps/sw_64/fpu/cargf.c
new file mode 100644
index 00000000..e8cf5cd6
--- /dev/null
+++ b/sysdeps/sw_64/fpu/cargf.c
@@ -0,0 +1,41 @@
+/* Compute argument of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cargf __cargf_not_defined
+#define cargf cargf_not_defined
+
+#include <complex.h>
+#include <math.h>
+#include "cfloat-compat.h"
+
+#undef __cargf
+#undef cargf
+
+float
+__c1_cargf (c1_cfloat_decl (x))
+{
+ return __atan2f (c1_cfloat_imag (x), c1_cfloat_real (x));
+}
+
+float
+__c2_cargf (c2_cfloat_decl (x))
+{
+ return __atan2f (c2_cfloat_imag (x), c2_cfloat_real (x));
+}
+
+cfloat_versions (carg);
diff --git a/sysdeps/sw_64/fpu/cfloat-compat.h b/sysdeps/sw_64/fpu/cfloat-compat.h
new file mode 100644
index 00000000..e09c4b28
--- /dev/null
+++ b/sysdeps/sw_64/fpu/cfloat-compat.h
@@ -0,0 +1,69 @@
+/* Compatibility macros for old and new Sw_64 complex float ABI.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* The behaviour of complex float changed between GCC 3.3 and 3.4.
+
+ In 3.3 and before (below, complex version 1, or "c1"), complex float
+ values were packed into one floating point register.
+
+ In 3.4 and later (below, complex version 2, or "c2"), GCC changed to
+ follow the official Tru64 ABI, which passes the components of a complex
+ as separate parameters. */
+
+typedef union
+{
+ double d;
+ _Complex float cf;
+} c1_compat;
+#define c1_cfloat_decl(x) double x
+#define c1_cfloat_real(x) __real__ c1_cfloat_value (x)
+#define c1_cfloat_imag(x) __imag__ c1_cfloat_value (x)
+#define c1_cfloat_value(x) (((c1_compat *) (void *) &x)->cf)
+#define c1_cfloat_rettype double
+#define c1_cfloat_return(x) \
+ ({ \
+ c1_compat _; \
+ _.cf = (x); \
+ _.d; \
+ })
+
+#define c2_cfloat_decl(x) _Complex float x
+#define c2_cfloat_real(x) __real__ x
+#define c2_cfloat_imag(x) __imag__ x
+#define c2_cfloat_value(x) x
+#define c2_cfloat_rettype _Complex float
+#define c2_cfloat_return(x) x
+
+/* Get the proper symbol versions defined for each function. */
+
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_3_4)
+# define cfloat_versions_compat(func) \
+ compat_symbol (libm, __c1_##func, func, GLIBC_2_1)
+#else
+# define cfloat_versions_compat (func)
+#endif
+
+#define cfloat_versions(func) \
+ cfloat_versions_compat(func##f); \
+ versioned_symbol(libm, __c2_##func##f, func##f, GLIBC_2_3_4); \
+ extern typeof(__c2_##func##f) __##func##f attribute_hidden; \
+ strong_alias(__c2_##func##f, __##func##f); \
+ libm_alias_float_other (__##func, func)
diff --git a/sysdeps/sw_64/fpu/cimagf.c b/sysdeps/sw_64/fpu/cimagf.c
new file mode 100644
index 00000000..f8b3b028
--- /dev/null
+++ b/sysdeps/sw_64/fpu/cimagf.c
@@ -0,0 +1,40 @@
+/* Return imaginary part of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cimagf __cimagf_not_defined
+#define cimagf cimagf_not_defined
+
+#include <complex.h>
+#include "cfloat-compat.h"
+
+#undef __cimagf
+#undef cimagf
+
+float
+__c1_cimagf (c1_cfloat_decl (z))
+{
+ return c1_cfloat_imag (z);
+}
+
+float
+__c2_cimagf (c2_cfloat_decl (z))
+{
+ return c2_cfloat_imag (z);
+}
+
+cfloat_versions (cimag);
diff --git a/sysdeps/sw_64/fpu/conjf.c b/sysdeps/sw_64/fpu/conjf.c
new file mode 100644
index 00000000..156e9458
--- /dev/null
+++ b/sysdeps/sw_64/fpu/conjf.c
@@ -0,0 +1,42 @@
+/* Return complex conjugate of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __conjf __conjf_not_defined
+#define conjf conjf_not_defined
+
+#include <complex.h>
+#include "cfloat-compat.h"
+
+#undef __conjf
+#undef conjf
+
+c1_cfloat_rettype
+__c1_conjf (c1_cfloat_decl (z))
+{
+ _Complex float r = ~c1_cfloat_value (z);
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_conjf (c2_cfloat_decl (z))
+{
+ _Complex float r = ~c2_cfloat_value (z);
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (conj);
diff --git a/sysdeps/sw_64/fpu/crealf.c b/sysdeps/sw_64/fpu/crealf.c
new file mode 100644
index 00000000..62d921e8
--- /dev/null
+++ b/sysdeps/sw_64/fpu/crealf.c
@@ -0,0 +1,40 @@
+/* Return real part of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __crealf __crealf_not_defined
+#define crealf crealf_not_defined
+
+#include <complex.h>
+#include "cfloat-compat.h"
+
+#undef __crealf
+#undef crealf
+
+float
+__c1_crealf (c1_cfloat_decl (z))
+{
+ return c1_cfloat_real (z);
+}
+
+float
+__c2_crealf (c2_cfloat_decl (z))
+{
+ return c2_cfloat_real (z);
+}
+
+cfloat_versions (creal);
diff --git a/sysdeps/sw_64/fpu/e_sqrt.c b/sysdeps/sw_64/fpu/e_sqrt.c
new file mode 100644
index 00000000..9135f95d
--- /dev/null
+++ b/sysdeps/sw_64/fpu/e_sqrt.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2023 Free Software Foundation, Inc.
+ Contributed by David Mosberger (davidm@cs.arizona.edu).
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <shlib-compat.h>
+
+#include <sysdeps/ieee754/dbl-64/e_sqrt.c>
+
+#if SHLIB_COMPAT (libm, GLIBC_2_18, GLIBC_2_31)
+strong_alias (__ieee754_sqrt, __sqrt_finite_2_18)
+ compat_symbol (libm, __sqrt_finite_2_18, __sqrt_finite, GLIBC_2_18);
+#endif
diff --git a/sysdeps/sw_64/fpu/e_sqrtf.c b/sysdeps/sw_64/fpu/e_sqrtf.c
new file mode 100644
index 00000000..2290d58c
--- /dev/null
+++ b/sysdeps/sw_64/fpu/e_sqrtf.c
@@ -0,0 +1,8 @@
+#include <shlib-compat.h>
+
+#include <sysdeps/ieee754/flt-32/e_sqrtf.c>
+
+#if SHLIB_COMPAT (libm, GLIBC_2_18, GLIBC_2_31)
+strong_alias (__ieee754_sqrtf, __sqrtf_finite_2_18)
+ compat_symbol (libm, __sqrtf_finite_2_18, __sqrtf_finite, GLIBC_2_18);
+#endif
diff --git a/sysdeps/sw_64/fpu/fclrexcpt.c b/sysdeps/sw_64/fpu/fclrexcpt.c
new file mode 100644
index 00000000..639b3d43
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fclrexcpt.c
@@ -0,0 +1,47 @@
+/* Clear given exceptions in current floating-point environment.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__feclearexcept (int excepts)
+{
+ unsigned long int swcr;
+
+ /* Get the current state. */
+ swcr = __ieee_get_fp_control ();
+
+ /* Clear the relevant bits. */
+ swcr &= ~((unsigned long int) excepts & SWCR_STATUS_MASK);
+
+ /* Put the new state in effect. */
+ __ieee_set_fp_control (swcr);
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__feclearexcept, __old_feclearexcept)
+ compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);
+#endif
+
+libm_hidden_ver (__feclearexcept, feclearexcept)
+ versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
diff --git a/sysdeps/sw_64/fpu/fedisblxcpt.c b/sysdeps/sw_64/fpu/fedisblxcpt.c
new file mode 100644
index 00000000..bc7d9a36
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fedisblxcpt.c
@@ -0,0 +1,35 @@
+/* Disable floating-point exceptions.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fedisableexcept (int excepts)
+{
+ unsigned long int new_exc, old_exc;
+
+ new_exc = __ieee_get_fp_control ();
+
+ old_exc = (new_exc & SWCR_ENABLE_MASK) << SWCR_ENABLE_SHIFT;
+ new_exc &= ~((excepts >> SWCR_ENABLE_SHIFT) & SWCR_ENABLE_MASK);
+
+ __ieee_set_fp_control (new_exc);
+
+ return old_exc;
+}
diff --git a/sysdeps/sw_64/fpu/feenablxcpt.c b/sysdeps/sw_64/fpu/feenablxcpt.c
new file mode 100644
index 00000000..6a7308c3
--- /dev/null
+++ b/sysdeps/sw_64/fpu/feenablxcpt.c
@@ -0,0 +1,35 @@
+/* Enable floating-point exceptions.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+feenableexcept (int excepts)
+{
+ unsigned long int new_exc, old_exc;
+
+ new_exc = __ieee_get_fp_control ();
+
+ old_exc = (new_exc & SWCR_ENABLE_MASK) << SWCR_ENABLE_SHIFT;
+ new_exc |= (excepts >> SWCR_ENABLE_SHIFT) & SWCR_ENABLE_MASK;
+
+ __ieee_set_fp_control (new_exc);
+
+ return old_exc;
+}
diff --git a/sysdeps/sw_64/fpu/fegetenv.c b/sysdeps/sw_64/fpu/fegetenv.c
new file mode 100644
index 00000000..9a69b207
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fegetenv.c
@@ -0,0 +1,47 @@
+/* Store current floating-point environment.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+ unsigned long int fpcr;
+ unsigned long int swcr;
+
+ /* Get status from software and hardware. Note that we don't need an
+ excb because the callsys is an implied trap barrier. */
+ swcr = __ieee_get_fp_control ();
+ __asm__ __volatile__("rfpcr %0" : "=f"(fpcr));
+ /* Merge the two bits of information. */
+ *envp = ((fpcr & FPCR_ROUND_MASK) | (swcr & SWCR_ALL_MASK));
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fegetenv, __old_fegetenv)
+ compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
+#endif
+
+libm_hidden_def (__fegetenv)
+ versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
+libm_hidden_ver (__fegetenv, fegetenv)
diff --git a/sysdeps/sw_64/fpu/fegetexcept.c b/sysdeps/sw_64/fpu/fegetexcept.c
new file mode 100644
index 00000000..c11b9771
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fegetexcept.c
@@ -0,0 +1,30 @@
+/* Get enabled floating-point exceptions.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fegetexcept (void)
+{
+ unsigned long int exc;
+
+ exc = __ieee_get_fp_control ();
+
+ return (exc & SWCR_ENABLE_MASK) << SWCR_ENABLE_SHIFT;
+}
diff --git a/sysdeps/sw_64/fpu/fegetmode.c b/sysdeps/sw_64/fpu/fegetmode.c
new file mode 100644
index 00000000..0e5846a7
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fegetmode.c
@@ -0,0 +1,33 @@
+/* Store current floating-point control modes. Sw_64 version.
+ Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ unsigned long int fpcr;
+ unsigned long int swcr;
+
+ /* As in fegetenv. */
+ swcr = __ieee_get_fp_control ();
+ __asm__ __volatile__("rfpcr %0" : "=f"(fpcr));
+ *modep = ((fpcr & FPCR_ROUND_MASK) | (swcr & SWCR_ALL_MASK));
+
+ return 0;
+}
diff --git a/sysdeps/sw_64/fpu/fegetround.c b/sysdeps/sw_64/fpu/fegetround.c
new file mode 100644
index 00000000..77468234
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fegetround.c
@@ -0,0 +1,32 @@
+/* Return current rounding direction.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fegetround (void)
+{
+ unsigned long fpcr;
+
+ __asm__ __volatile__("excb; rfpcr %0" : "=f"(fpcr));
+
+ return (fpcr >> FPCR_ROUND_SHIFT) & 3;
+}
+libm_hidden_def (__fegetround) weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/sw_64/fpu/feholdexcpt.c b/sysdeps/sw_64/fpu/feholdexcpt.c
new file mode 100644
index 00000000..7832afdc
--- /dev/null
+++ b/sysdeps/sw_64/fpu/feholdexcpt.c
@@ -0,0 +1,34 @@
+/* Store current floating-point environment and clear exceptions.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+ /* Save the current state. */
+ __fegetenv (envp);
+
+ /* Clear all exception status bits and exception enable bits. */
+ __ieee_set_fp_control (*envp & SWCR_MAP_MASK);
+
+ return 0;
+}
+libm_hidden_def (__feholdexcept) weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/sw_64/fpu/fenv_libc.h b/sysdeps/sw_64/fpu/fenv_libc.h
new file mode 100644
index 00000000..6a42634a
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fenv_libc.h
@@ -0,0 +1,37 @@
+/* Internal libc stuff for floating point environment routines.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _FENV_LIBC_H
+#define _FENV_LIBC_H 1
+
+#include <fenv.h>
+
+#define FPCR_ROUND_MASK (3UL << 58)
+#define FPCR_ROUND_SHIFT 58
+
+#define SWCR_MAP_MASK (3UL << 12)
+#define SWCR_ENABLE_SHIFT 16
+#define SWCR_ENABLE_MASK (FE_ALL_EXCEPT >> SWCR_ENABLE_SHIFT)
+#define SWCR_STATUS_MASK (FE_ALL_EXCEPT)
+#define SWCR_ALL_MASK (SWCR_ENABLE_MASK | SWCR_MAP_MASK | SWCR_STATUS_MASK)
+
+/* These are declared for public consumption in <bits/fenv.h>. */
+libc_hidden_proto (__ieee_set_fp_control)
+ libc_hidden_proto (__ieee_get_fp_control)
+
+#endif /* fenv_libc.h */
diff --git a/sysdeps/sw_64/fpu/fesetenv.c b/sysdeps/sw_64/fpu/fesetenv.c
new file mode 100644
index 00000000..6a691131
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fesetenv.c
@@ -0,0 +1,56 @@
+/* Install given floating-point environment.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+ unsigned long int fpcr;
+ fenv_t env;
+
+ /* Magic encoding of default values: high bit set (never possible for a
+ user-space address) is not indirect. And we don't even have to get
+ rid of it since we mask things around just below. */
+ if ((long int) envp >= 0)
+ env = *envp;
+ else
+ env = (unsigned long int) envp;
+
+ /* Reset the rounding mode with the hardware fpcr. Note that the following
+ system call is an implied trap barrier for our modification. */
+ __asm__ __volatile__("excb; rfpcr %0" : "=f"(fpcr));
+ fpcr = (fpcr & ~FPCR_ROUND_MASK) | (env & FPCR_ROUND_MASK);
+ __asm__ __volatile__("wfpcr %0" : : "f"(fpcr));
+
+ /* Reset the exception status and mask with the kernel's FP code. */
+ __ieee_set_fp_control (env & SWCR_ALL_MASK);
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fesetenv, __old_fesetenv)
+ compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
+#endif
+
+libm_hidden_def (__fesetenv) libm_hidden_ver (__fesetenv, fesetenv)
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
diff --git a/sysdeps/sw_64/fpu/fesetexcept.c b/sysdeps/sw_64/fpu/fesetexcept.c
new file mode 100644
index 00000000..a8a4acda
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. Sw_64 version.
+ Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+ unsigned long int tmp;
+
+ tmp = __ieee_get_fp_control ();
+ tmp |= excepts & SWCR_STATUS_MASK;
+ __ieee_set_fp_control (tmp);
+
+ return 0;
+}
diff --git a/sysdeps/sw_64/fpu/fesetmode.c b/sysdeps/sw_64/fpu/fesetmode.c
new file mode 100644
index 00000000..05a6bf48
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fesetmode.c
@@ -0,0 +1,44 @@
+/* Install given floating-point control modes. Sw_64 version.
+ Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ unsigned long int fpcr;
+ unsigned long int swcr;
+ femode_t mode;
+
+ /* As in fesetenv. */
+ if ((long int) modep >= 0)
+ mode = *modep;
+ else
+ mode = (unsigned long int) modep;
+
+ __asm__ __volatile__("excb; rfpcr %0" : "=f"(fpcr));
+ fpcr = (fpcr & ~FPCR_ROUND_MASK) | (mode & FPCR_ROUND_MASK);
+ __asm__ __volatile__("wfpcr %0" : : "f"(fpcr));
+
+ swcr = __ieee_get_fp_control ();
+ swcr = ((mode & SWCR_ALL_MASK & ~SWCR_STATUS_MASK)
+ | (swcr & SWCR_STATUS_MASK));
+ __ieee_set_fp_control (swcr);
+
+ return 0;
+}
diff --git a/sysdeps/sw_64/fpu/fesetround.c b/sysdeps/sw_64/fpu/fesetround.c
new file mode 100644
index 00000000..38344bbc
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fesetround.c
@@ -0,0 +1,43 @@
+/* Set current rounding direction.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fesetround (int round)
+{
+ unsigned long fpcr;
+
+ if (round & ~3)
+ return 1;
+
+ /* Get the current state. */
+ __asm__ __volatile__("excb; rfpcr %0" : "=f"(fpcr));
+
+ /* Set the relevant bits. */
+ fpcr = ((fpcr & ~FPCR_ROUND_MASK)
+ | ((unsigned long) round << FPCR_ROUND_SHIFT));
+
+ /* Put the new state in effect. */
+ __asm__ __volatile__("wfpcr %0; excb" : : "f"(fpcr));
+
+ return 0;
+}
+libm_hidden_def (__fesetround) weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/sw_64/fpu/feupdateenv.c b/sysdeps/sw_64/fpu/feupdateenv.c
new file mode 100644
index 00000000..7f18b180
--- /dev/null
+++ b/sysdeps/sw_64/fpu/feupdateenv.c
@@ -0,0 +1,49 @@
+/* Install given floating-point environment and raise exceptions.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+ unsigned long int tmp;
+
+ /* Get the current exception state. */
+ tmp = __ieee_get_fp_control ();
+
+ /* Install new environment. */
+ __fesetenv (envp);
+
+ /* Raise the saved exception. Incidently for us the implementation
+ defined format of the values in objects of type fexcept_t is the
+ same as the ones specified using the FE_* constants. */
+ __feraiseexcept (tmp & SWCR_STATUS_MASK);
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__feupdateenv, __old_feupdateenv)
+ compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
+#endif
+
+libm_hidden_def (__feupdateenv) libm_hidden_ver (__feupdateenv, feupdateenv)
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/sysdeps/sw_64/fpu/fgetexcptflg.c b/sysdeps/sw_64/fpu/fgetexcptflg.c
new file mode 100644
index 00000000..a892525d
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fgetexcptflg.c
@@ -0,0 +1,43 @@
+/* Store current representation for exceptions.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+ unsigned long int tmp;
+
+ /* Get the current state. */
+ tmp = __ieee_get_fp_control ();
+
+ /* Return that portion that corresponds to the requested exceptions. */
+ *flagp = tmp & excepts & SWCR_STATUS_MASK;
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fegetexceptflag, __old_fegetexceptflag)
+ compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
diff --git a/sysdeps/sw_64/fpu/fpu_control.h b/sysdeps/sw_64/fpu/fpu_control.h
new file mode 100644
index 00000000..92c2afba
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fpu_control.h
@@ -0,0 +1,104 @@
+/* FPU control word bits. Sw_64-mapped-to-Intel version.
+ Copyright (C) 1996-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Olaf Flebbe.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SW_64_FPU_CONTROL_H
+#define _SW_64_FPU_CONTROL_H
+
+/*
+ * Since many programs seem to hardcode the values passed to __setfpucw()
+ * (rather than using the manifest constants) we emulate the x87 interface
+ * here (at least where this makes sense).
+ *
+ * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0
+ * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM
+ *
+ * IM: Invalid operation mask
+ * DM: Denormalized operand mask
+ * ZM: Zero-divide mask
+ * OM: Overflow mask
+ * UM: Underflow mask
+ * PM: Precision (inexact result) mask
+ *
+ * Mask bit is 1 means no interrupt.
+ *
+ * PC: Precision control
+ * 11 - round to extended precision
+ * 10 - round to double precision
+ * 00 - round to single precision
+ *
+ * RC: Rounding control
+ * 00 - rounding to nearest
+ * 01 - rounding down (toward - infinity)
+ * 10 - rounding up (toward + infinity)
+ * 11 - rounding toward zero
+ *
+ * IC: Infinity control
+ * That is for 8087 and 80287 only.
+ *
+ * The hardware default is 0x037f. I choose 0x1372.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM 0x01
+#define _FPU_MASK_DM 0x02
+#define _FPU_MASK_ZM 0x04
+#define _FPU_MASK_OM 0x08
+#define _FPU_MASK_UM 0x10
+#define _FPU_MASK_PM 0x20
+
+/* precision control -- without effect on Sw_64 */
+#define _FPU_EXTENDED 0x300 /* RECOMMENDED */
+#define _FPU_DOUBLE 0x200
+#define _FPU_SINGLE 0x0 /* DO NOT USE */
+
+/*
+ * rounding control---notice that on the Sw_64 this affects only
+ * instructions with the dynamic rounding mode qualifier (/d).
+ */
+#define _FPU_RC_NEAREST 0x000 /* RECOMMENDED */
+#define _FPU_RC_DOWN 0x400
+#define _FPU_RC_UP 0x800
+#define _FPU_RC_ZERO 0xC00
+
+#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */
+
+/* Now two recommended cw */
+
+/* Linux default:
+ - extended precision
+ - rounding to positive infinity. There is no /p instruction
+ qualifier. By setting the dynamic rounding mode to +infinity,
+ one can use /d to get round to +infinity with no extra overhead
+ (so long as the default isn't changed, of course...)
+ - no exceptions enabled. */
+
+#define _FPU_DEFAULT 0x137f
+
+/* IEEE: same as above. */
+#define _FPU_IEEE 0x137f
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t;
+
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+
+#endif /* _SW_64_FPU_CONTROL */
diff --git a/sysdeps/sw_64/fpu/fsetexcptflg.c b/sysdeps/sw_64/fpu/fsetexcptflg.c
new file mode 100644
index 00000000..82df62c1
--- /dev/null
+++ b/sysdeps/sw_64/fpu/fsetexcptflg.c
@@ -0,0 +1,46 @@
+/* Set floating-point environment exception handling.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+__fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+ unsigned long int tmp;
+
+ /* Get the current exception state. */
+ tmp = __ieee_get_fp_control ();
+
+ /* Set all the bits that were called for. */
+ tmp = (tmp & ~SWCR_STATUS_MASK) | (*flagp & excepts & SWCR_STATUS_MASK);
+
+ /* And store it back. */
+ __ieee_set_fp_control (tmp);
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fesetexceptflag, __old_fesetexceptflag)
+ compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
diff --git a/sysdeps/sw_64/fpu/ftestexcept.c b/sysdeps/sw_64/fpu/ftestexcept.c
new file mode 100644
index 00000000..ce1104d3
--- /dev/null
+++ b/sysdeps/sw_64/fpu/ftestexcept.c
@@ -0,0 +1,32 @@
+/* Test exception in current environment.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fetestexcept (int excepts)
+{
+ unsigned long tmp;
+
+ /* Get current exceptions. */
+ tmp = __ieee_get_fp_control ();
+
+ return tmp & excepts & SWCR_STATUS_MASK;
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/sw_64/fpu/math-barriers.h b/sysdeps/sw_64/fpu/math-barriers.h
new file mode 100644
index 00000000..379591a3
--- /dev/null
+++ b/sysdeps/sw_64/fpu/math-barriers.h
@@ -0,0 +1,35 @@
+/* Control when floating-point expressions are evaluated. Sw_64 version.
+ Copyright (C) 2014-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef SW_64_MATH_BARRIERS_H
+#define SW_64_MATH_BARRIERS_H 1
+
+/* Generic code forces values to memory; we don't need to do that. */
+#define math_opt_barrier(x) \
+ ({ \
+ __typeof (x) __x = (x); \
+ __asm ("" : "+frm"(__x)); \
+ __x; \
+ })
+#define math_force_eval(x) \
+ ({ \
+ __typeof (x) __x = (x); \
+ __asm __volatile__("" : : "frm"(__x)); \
+ })
+
+#endif
diff --git a/sysdeps/sw_64/fpu/math-use-builtins-sqrt.h b/sysdeps/sw_64/fpu/math-use-builtins-sqrt.h
new file mode 100644
index 00000000..ebad3a57
--- /dev/null
+++ b/sysdeps/sw_64/fpu/math-use-builtins-sqrt.h
@@ -0,0 +1,9 @@
+#ifdef __sw_64_sw6a__
+# define USE_SQRT_BUILTIN 1
+# define USE_SQRTF_BUILTIN 1
+#else
+# define USE_SQRT_BUILTIN 0
+# define USE_SQRTF_BUILTIN 0
+#endif
+#define USE_SQRTL_BUILTIN 0
+#define USE_SQRTF128_BUILTIN 0
diff --git a/sysdeps/sw_64/fpu/s_cacosf.c b/sysdeps/sw_64/fpu/s_cacosf.c
new file mode 100644
index 00000000..b2a03f72
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_cacosf.c
@@ -0,0 +1,57 @@
+/* Return arc cosine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cacosf __cacosf_not_defined
+#define cacosf cacosf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __cacosf
+#undef cacosf
+
+static _Complex float internal_cacosf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_cacosf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cacos_template.c>
+
+#include "cfloat-compat.h"
+
+#undef __cacosf
+
+c1_cfloat_rettype
+__c1_cacosf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_cacosf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_cacosf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_cacosf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (cacos);
diff --git a/sysdeps/sw_64/fpu/s_cacoshf.c b/sysdeps/sw_64/fpu/s_cacoshf.c
new file mode 100644
index 00000000..089cf201
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_cacoshf.c
@@ -0,0 +1,56 @@
+/* Return arc hyperbole cosine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cacoshf __cacoshf_not_defined
+#define cacoshf cacoshf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __cacoshf
+#undef cacoshf
+
+static _Complex float internal_cacoshf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_cacoshf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cacosh_template.c>
+#include "cfloat-compat.h"
+
+#undef __cacoshf
+
+c1_cfloat_rettype
+__c1_cacoshf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_cacoshf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_cacoshf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_cacoshf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (cacosh);
diff --git a/sysdeps/sw_64/fpu/s_casinf.c b/sysdeps/sw_64/fpu/s_casinf.c
new file mode 100644
index 00000000..273097b4
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_casinf.c
@@ -0,0 +1,54 @@
+/* Return arc sine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __casinf __casinf_not_defined
+#define casinf casinf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __casinf
+#undef casinf
+
+static _Complex float internal_casinf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_casinf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_casin_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_casinf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_casinf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_casinf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_casinf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (casin);
diff --git a/sysdeps/sw_64/fpu/s_casinhf.c b/sysdeps/sw_64/fpu/s_casinhf.c
new file mode 100644
index 00000000..e6886eea
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_casinhf.c
@@ -0,0 +1,54 @@
+/* Return arc hyperbole sine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __casinhf __casinhf_not_defined
+#define casinhf casinhf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __casinhf
+#undef casinhf
+
+static _Complex float internal_casinhf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_casinhf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_casinh_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_casinhf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_casinhf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_casinhf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_casinhf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (casinh);
diff --git a/sysdeps/sw_64/fpu/s_catanf.c b/sysdeps/sw_64/fpu/s_catanf.c
new file mode 100644
index 00000000..aa5e93c6
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_catanf.c
@@ -0,0 +1,54 @@
+/* Return arc tangent of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __catanf __catanf_not_defined
+#define catanf catanf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __catanf
+#undef catanf
+
+static _Complex float internal_catanf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_catanf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_catan_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_catanf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_catanf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_catanf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_catanf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (catan);
diff --git a/sysdeps/sw_64/fpu/s_catanhf.c b/sysdeps/sw_64/fpu/s_catanhf.c
new file mode 100644
index 00000000..de293708
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_catanhf.c
@@ -0,0 +1,54 @@
+/* Return arc hyperbole tangent of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __catanhf __catanhf_not_defined
+#define catanhf catanhf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __catanhf
+#undef catanhf
+
+static _Complex float internal_catanhf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_catanhf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_catanh_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_catanhf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_catanhf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_catanhf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_catanhf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (catanh);
diff --git a/sysdeps/sw_64/fpu/s_ccosf.c b/sysdeps/sw_64/fpu/s_ccosf.c
new file mode 100644
index 00000000..9e9cb1c6
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_ccosf.c
@@ -0,0 +1,54 @@
+/* Return cosine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __ccosf __ccosf_not_defined
+#define ccosf ccosf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __ccosf
+#undef ccosf
+
+static _Complex float internal_ccosf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_ccosf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ccos_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_ccosf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_ccosf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_ccosf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_ccosf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (ccos);
diff --git a/sysdeps/sw_64/fpu/s_ccoshf.c b/sysdeps/sw_64/fpu/s_ccoshf.c
new file mode 100644
index 00000000..531e9a5e
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_ccoshf.c
@@ -0,0 +1,54 @@
+/* Return hyperbole cosine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __ccoshf __ccoshf_not_defined
+#define ccoshf ccoshf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __ccoshf
+#undef ccoshf
+
+static _Complex float internal_ccoshf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_ccoshf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ccosh_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_ccoshf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_ccoshf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_ccoshf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_ccoshf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (ccosh);
diff --git a/sysdeps/sw_64/fpu/s_cexpf.c b/sysdeps/sw_64/fpu/s_cexpf.c
new file mode 100644
index 00000000..757b707c
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_cexpf.c
@@ -0,0 +1,54 @@
+/* Return exponent of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cexpf __cexpf_not_defined
+#define cexpf cexpf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __cexpf
+#undef cexpf
+
+static _Complex float internal_cexpf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_cexpf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cexp_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_cexpf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_cexpf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_cexpf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_cexpf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (cexp);
diff --git a/sysdeps/sw_64/fpu/s_clog10f.c b/sysdeps/sw_64/fpu/s_clog10f.c
new file mode 100644
index 00000000..84b1544f
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_clog10f.c
@@ -0,0 +1,66 @@
+/* Return base 10 logarithm of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __clog10f __clog10f_not_defined
+#define clog10f clog10f_not_defined
+
+#include <complex.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+#undef __clog10f
+#undef clog10f
+
+static _Complex float internal_clog10f (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_clog10f
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_clog10_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_clog10f (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_clog10f (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_clog10f (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_clog10f (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+/* Ug. __clog10f was exported from GLIBC_2.1. This is the only
+ complex function whose double-underscore symbol was exported,
+ so we get to handle that specially. */
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_3_4)
+strong_alias (__c1_clog10f, __c1_clog10f_2);
+compat_symbol (libm, __c1_clog10f, clog10f, GLIBC_2_1);
+compat_symbol (libm, __c1_clog10f_2, __clog10f, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __c2_clog10f, clog10f, GLIBC_2_3_4);
+extern typeof (__c2_clog10f) __clog10f attribute_hidden;
+strong_alias (__c2_clog10f, __clog10f)
+ libm_alias_float_other (__c2_clog10, clog10)
diff --git a/sysdeps/sw_64/fpu/s_clogf.c b/sysdeps/sw_64/fpu/s_clogf.c
new file mode 100644
index 00000000..d84b4403
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_clogf.c
@@ -0,0 +1,54 @@
+/* Return natural logarithm of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __clogf __clogf_not_defined
+#define clogf clogf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __clogf
+#undef clogf
+
+static _Complex float internal_clogf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_clogf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_clog_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_clogf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_clogf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_clogf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_clogf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (clog);
diff --git a/sysdeps/sw_64/fpu/s_copysign.c b/sysdeps/sw_64/fpu/s_copysign.c
new file mode 100644
index 00000000..2311bce5
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_copysign.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define NO_MATH_REDIRECT
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+
+double
+__copysign (double x, double y)
+{
+ return __builtin_copysign (x, y);
+}
+
+libm_alias_double (__copysign, copysign)
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+ compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sw_64/fpu/s_copysignf.c b/sysdeps/sw_64/fpu/s_copysignf.c
new file mode 100644
index 00000000..b9e6d2f6
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_copysignf.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define NO_MATH_REDIRECT
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__copysignf (float x, float y)
+{
+ return __builtin_copysignf (x, y);
+}
+
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sw_64/fpu/s_cpowf.c b/sysdeps/sw_64/fpu/s_cpowf.c
new file mode 100644
index 00000000..6b9111c9
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_cpowf.c
@@ -0,0 +1,54 @@
+/* Return power of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cpowf __cpowf_not_defined
+#define cpowf cpowf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __cpowf
+#undef cpowf
+
+static _Complex float internal_cpowf (_Complex float x, _Complex float c);
+
+#define M_DECL_FUNC(f) internal_cpowf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cpow_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_cpowf (c1_cfloat_decl (x), c1_cfloat_decl (c))
+{
+ _Complex float r = internal_cpowf (c1_cfloat_value (x), c1_cfloat_value (c));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_cpowf (c2_cfloat_decl (x), c2_cfloat_decl (c))
+{
+ _Complex float r = internal_cpowf (c2_cfloat_value (x), c2_cfloat_value (c));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (cpow);
diff --git a/sysdeps/sw_64/fpu/s_cprojf.c b/sysdeps/sw_64/fpu/s_cprojf.c
new file mode 100644
index 00000000..9570a16b
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_cprojf.c
@@ -0,0 +1,54 @@
+/* Return projection of complex float value to Riemann sphere.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __cprojf __cprojf_not_defined
+#define cprojf cprojf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __cprojf
+#undef cprojf
+
+static _Complex float internal_cprojf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_cprojf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cproj_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_cprojf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_cprojf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_cprojf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_cprojf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (cproj);
diff --git a/sysdeps/sw_64/fpu/s_csinf.c b/sysdeps/sw_64/fpu/s_csinf.c
new file mode 100644
index 00000000..ff518744
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_csinf.c
@@ -0,0 +1,54 @@
+/* Return sine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __csinf __csinf_not_defined
+#define csinf csinf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __csinf
+#undef csinf
+
+static _Complex float internal_csinf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_csinf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csin_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_csinf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_csinf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_csinf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_csinf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (csin);
diff --git a/sysdeps/sw_64/fpu/s_csinhf.c b/sysdeps/sw_64/fpu/s_csinhf.c
new file mode 100644
index 00000000..38c91dfa
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_csinhf.c
@@ -0,0 +1,54 @@
+/* Return hyperbole sine of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __csinhf __csinhf_not_defined
+#define csinhf csinhf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __csinhf
+#undef csinhf
+
+static _Complex float internal_csinhf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_csinhf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csinh_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_csinhf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_csinhf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_csinhf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_csinhf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (csinh);
diff --git a/sysdeps/sw_64/fpu/s_csqrtf.c b/sysdeps/sw_64/fpu/s_csqrtf.c
new file mode 100644
index 00000000..5d332b60
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_csqrtf.c
@@ -0,0 +1,54 @@
+/* Return square root of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __csqrtf __csinhf_not_defined
+#define csqrtf csqrtf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __csqrtf
+#undef csqrtf
+
+static _Complex float internal_csqrtf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_csqrtf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csqrt_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_csqrtf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_csqrtf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_csqrtf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_csqrtf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (csqrt);
diff --git a/sysdeps/sw_64/fpu/s_ctanf.c b/sysdeps/sw_64/fpu/s_ctanf.c
new file mode 100644
index 00000000..3fc0c6c7
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_ctanf.c
@@ -0,0 +1,54 @@
+/* Return tangent of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __ctanf __ctanf_not_defined
+#define ctanf ctanf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __ctanf
+#undef ctanf
+
+static _Complex float internal_ctanf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_ctanf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ctan_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_ctanf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_ctanf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_ctanf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_ctanf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (ctan);
diff --git a/sysdeps/sw_64/fpu/s_ctanhf.c b/sysdeps/sw_64/fpu/s_ctanhf.c
new file mode 100644
index 00000000..c1b0d254
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_ctanhf.c
@@ -0,0 +1,54 @@
+/* Return hyperbole tangent of complex float value.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __ctanhf __ctanhf_not_defined
+#define ctanhf ctanhf_not_defined
+
+#include <complex.h>
+#include <math.h>
+
+#undef __ctanhf
+#undef ctanhf
+
+static _Complex float internal_ctanhf (_Complex float x);
+
+#define M_DECL_FUNC(f) internal_ctanhf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ctanh_template.c>
+#include "cfloat-compat.h"
+
+c1_cfloat_rettype
+__c1_ctanhf (c1_cfloat_decl (x))
+{
+ _Complex float r = internal_ctanhf (c1_cfloat_value (x));
+ return c1_cfloat_return (r);
+}
+
+c2_cfloat_rettype
+__c2_ctanhf (c2_cfloat_decl (x))
+{
+ _Complex float r = internal_ctanhf (c2_cfloat_value (x));
+ return c2_cfloat_return (r);
+}
+
+cfloat_versions (ctanh);
diff --git a/sysdeps/sw_64/fpu/s_fabs.c b/sysdeps/sw_64/fpu/s_fabs.c
new file mode 100644
index 00000000..cdee19f5
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_fabs.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+
+double
+__fabs (double x)
+{
+ return __builtin_fabs (x);
+}
+
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sw_64/fpu/s_fabsf.c b/sysdeps/sw_64/fpu/s_fabsf.c
new file mode 100644
index 00000000..6d40a9f5
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_fabsf.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__fabsf (float x)
+{
+ return __builtin_fabsf (x);
+}
+
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sw_64/fpu/s_fma.c b/sysdeps/sw_64/fpu/s_fma.c
new file mode 100644
index 00000000..8f626058
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_fma.c
@@ -0,0 +1,2 @@
+/* Always use dbl-64 version because long double is emulated in software. */
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sw_64/fpu/s_isnan.c b/sysdeps/sw_64/fpu/s_isnan.c
new file mode 100644
index 00000000..da893b86
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_isnan.c
@@ -0,0 +1,57 @@
+/* Return 1 if argument is a NaN, else 0.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Ugly kludge to avoid declarations. */
+#define __isnanf not___isnanf
+#define isnanf not_isnanf
+#define __GI___isnanf not__GI___isnanf
+
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+#undef __isnanf
+#undef isnanf
+#undef __GI___isnanf
+
+int
+__isnan (double x)
+{
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ return ix * 2 > 0xffe0000000000000ul;
+}
+
+hidden_def (__isnan) weak_alias (__isnan, isnan)
+
+/* It turns out that the 'double' version will also always work for
+ single-precision. */
+strong_alias (__isnan, __isnanf) weak_alias (__isnan, isnanf)
+
+/* ??? GCC 4.8 fails to look through chains of aliases with asm names
+ attached. Work around this for now. */
+hidden_ver (__isnan, __isnanf)
+
+#ifdef NO_LONG_DOUBLE
+ strong_alias (__isnan, __isnanl)
+weak_alias (__isnan, isnanl)
+#endif
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+ compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
+compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sw_64/fpu/s_isnanf.c b/sysdeps/sw_64/fpu/s_isnanf.c
new file mode 100644
index 00000000..af41e438
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_isnanf.c
@@ -0,0 +1 @@
+/* In s_isnan.c */
diff --git a/sysdeps/sw_64/fpu/s_llrint.c b/sysdeps/sw_64/fpu/s_llrint.c
new file mode 100644
index 00000000..5db97be0
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_llrint.c
@@ -0,0 +1 @@
+/* In s_lrint.c */
diff --git a/sysdeps/sw_64/fpu/s_llrintf.c b/sysdeps/sw_64/fpu/s_llrintf.c
new file mode 100644
index 00000000..18f2885e
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_llrintf.c
@@ -0,0 +1 @@
+/* In s_lrintf.c */
diff --git a/sysdeps/sw_64/fpu/s_llround.c b/sysdeps/sw_64/fpu/s_llround.c
new file mode 100644
index 00000000..b212fbd8
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_llround.c
@@ -0,0 +1 @@
+/* In s_lround.c. */
diff --git a/sysdeps/sw_64/fpu/s_llroundf.c b/sysdeps/sw_64/fpu/s_llroundf.c
new file mode 100644
index 00000000..73bdf310
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_llroundf.c
@@ -0,0 +1 @@
+/* In s_lroundf.c. */
diff --git a/sysdeps/sw_64/fpu/s_lrint.c b/sysdeps/sw_64/fpu/s_lrint.c
new file mode 100644
index 00000000..06e6eef6
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_lrint.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __llrint not___llrint
+#define llrint not_llrint
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+#undef __llrint
+#undef llrint
+
+long int
+__lrint (double x)
+{
+# ifdef __sw7mc_alias__
+ return _sw7mc_lrint (x);
+# endif
+ long ret;
+ __asm ("fcvtdl %1,%0" : "=&f"(ret) : "f"(x));
+
+ return ret;
+}
+
+strong_alias (__lrint, __llrint) libm_alias_double (__lrint, lrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sw_64/fpu/s_lrintf.c b/sysdeps/sw_64/fpu/s_lrintf.c
new file mode 100644
index 00000000..8cb89813
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_lrintf.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __llrintf not___llrintf
+#define llrintf not_llrintf
+#include <math.h>
+#include <libm-alias-float.h>
+#undef __llrintf
+#undef llrintf
+
+long int
+__lrintf (float x)
+{
+# ifdef __sw7mc_alias__
+ return lrint (x);
+# endif
+ double tmp;
+ long ret;
+ __asm ("fcvtsd %2,%1\n\tfcvtdl %1,%0"
+ : "=&f"(ret), "=&f"(tmp)
+ : "f"(x));
+
+ return ret;
+}
+
+strong_alias (__lrintf, __llrintf) libm_alias_float (__lrint, lrint)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sw_64/fpu/s_lround.c b/sysdeps/sw_64/fpu/s_lround.c
new file mode 100644
index 00000000..68b6f399
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_lround.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __llround not___llround
+#define llround not_llround
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+#undef __llround
+#undef llround
+
+long int
+__lround (double x)
+{
+# ifdef __sw7mc_alias__
+ return lround (x);
+# endif
+ double adj, y;
+
+ adj = copysign (0.5, x);
+ asm("faddd %1,%2,%0" : "=&f"(y) : "f"(x), "f"(adj));
+ return y;
+}
+
+strong_alias (__lround, __llround) libm_alias_double (__lround, lround)
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/sw_64/fpu/s_lroundf.c b/sysdeps/sw_64/fpu/s_lroundf.c
new file mode 100644
index 00000000..cb65b719
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_lroundf.c
@@ -0,0 +1,76 @@
+#define __llroundf not___llroundf
+#define llroundf not_llroundf
+#include <fenv.h>
+#include <limits.h>
+#include <math.h>
+#include <ieee754.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <tininess.h>
+#include <fix-fp-int-convert-overflow.h>
+#undef __llroundf
+#undef llroundf
+
+long int
+__lroundf (float x)
+{
+ /*
+ #ifdef __sw7mc_alias__
+ return lround (x);
+ #endif
+ */
+ int32_t j0;
+ uint32_t i;
+ long int result;
+ int sign;
+
+ GET_FLOAT_WORD (i, x);
+ j0 = ((i >> 23) & 0xff) - 0x7f;
+ sign = (i & 0x80000000) != 0 ? -1 : 1;
+ i &= 0x7fffff;
+ i |= 0x800000;
+
+ if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
+ {
+ if (j0 < 0)
+ return j0 < -1 ? 0 : sign;
+ else if (j0 >= 23)
+ result = (long int) i << (j0 - 23);
+ else
+ {
+ i += 0x400000 >> j0;
+
+ result = i >> (23 - j0);
+ }
+ }
+ else
+ {
+#ifdef FE_INVALID
+ /* The number is too large. Unless it rounds to LONG_MIN,
+ FE_INVALID must be raised and the return value is
+ unspecified. */
+ if (FIX_FLT_LONG_CONVERT_OVERFLOW && x != (float) LONG_MIN)
+ {
+ feraiseexcept (FE_INVALID);
+ return sign == 1 ? LONG_MAX : LONG_MIN;
+ }
+#endif
+
+ if (x == 0x1p63 || x == 0x1p64 || x == 0x1p65
+ || x == -0x8000010000000000p0 || x == -0x1p64 || x == -0x1p65
+ || x == 3.40282346638528859811704183485E38
+ || x == -3.40282346638528859811704183485E38)
+ {
+ x = (long int) x;
+ feclearexcept (FE_INEXACT);
+ return x;
+ }
+ return (long int) x;
+ }
+
+ return sign * result;
+}
+
+strong_alias (__lroundf, __llroundf) libm_alias_float (__lround, lround)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/sw_64/fpu/s_rint.c b/sysdeps/sw_64/fpu/s_rint.c
new file mode 100644
index 00000000..121c613e
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_rint.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+# define NO_MATH_REDIRECT
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+
+double
+__rint (double x)
+{
+# ifdef __sw7mc_alias__
+ return rint (x);
+# endif
+ if (isnan (x))
+ return x + x;
+
+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
+ {
+ double tmp1, new_x;
+ __asm ("fcvtdl %2,%1\n\t"
+ "fcvtld %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1)
+ : "f"(x));
+ /* rint(-0.1) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+ }
+ return x;
+}
+
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sw_64/fpu/s_rintf.c b/sysdeps/sw_64/fpu/s_rintf.c
new file mode 100644
index 00000000..d24db410
--- /dev/null
+++ b/sysdeps/sw_64/fpu/s_rintf.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+# define NO_MATH_REDIRECT
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__rintf (float x)
+{
+# ifdef __sw7mc_alias__
+ return rint (x);
+# endif
+ if (isnanf (x))
+ return x + x;
+
+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
+ {
+ /* Note that Sw_64 S_Floating is stored in registers in a
+ restricted T_Floating format, so we don't even need to
+ convert back to S_Floating in the end. The initial
+ conversion to T_Floating is needed to handle denormals. */
+
+ float tmp1, tmp2, new_x;
+
+ __asm ("fcvtsd %3,%2\n\t"
+ "fcvtdl %2,%1\n\t"
+ "fcvtld %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+ : "f"(x));
+
+ /* rint(-0.1) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+ }
+ return x;
+}
+
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sw_64/fpu/ulps b/sysdeps/sw_64/fpu/ulps
new file mode 100644
index 00000000..7dcee999
--- /dev/null
+++ b/sysdeps/sw_64/fpu/ulps
@@ -0,0 +1,1826 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "acos_downward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "acos_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "acosh":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "acosh_downward":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "acosh_upward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "asin":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "asin_downward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "asin_upward":
+double: 2
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "asinh":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "asinh_downward":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "asinh_upward":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "atan":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "atan2":
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "atan2_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "atan2_upward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "atanh":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "atanh_downward":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+float128: 5
+ldouble: 4
+
+Function: "atanh_upward":
+double: 3
+float: 3
+float128: 4
+ldouble: 5
+
+Function: "cabs":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "cabs_downward":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "cabs_upward":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+float128: 6
+ldouble: 6
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+Function: Imaginary part of "cacos_towardzero":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 7
+float128: 7
+ldouble: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "cacosh_downward":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Real part of "cacosh_towardzero":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 4
+float128: 6
+ldouble: 6
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "carg":
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "carg_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "carg_upward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+float128: 6
+ldouble: 6
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_towardzero":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 7
+float128: 7
+ldouble: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+float128: 6
+ldouble: 6
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "casinh_towardzero":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 7
+float128: 7
+ldouble: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "catan":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_upward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+float128: 2
+ldouble: 4
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "cbrt":
+double: 4
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "ccosh_downward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 2
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+float128: 1
+ldouble: 1
+
+Function: Real part of "cexp_downward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "cexp_towardzero":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_upward":
+double: 3
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "clog":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "clog":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+float128: 8
+ldouble: 8
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+float128: 3
+ldouble: 3
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+float128: 8
+ldouble: 8
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+float128: 3
+ldouble: 3
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+float128: 8
+ldouble: 8
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+float128: 3
+ldouble: 3
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+float128: 2
+ldouble: 2
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "cos":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "cos_downward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "cos_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "cos_vlen16":
+float: 1
+
+Function: "cos_vlen2":
+double: 2
+
+Function: "cos_vlen4":
+double: 2
+float: 1
+
+Function: "cos_vlen4_avx2":
+double: 2
+
+Function: "cos_vlen8":
+double: 2
+float: 1
+
+Function: "cos_vlen8_avx2":
+float: 1
+
+Function: "cosh":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "cosh_downward":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "cosh_towardzero":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "cosh_upward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "cpow":
+float: 2
+float128: 4
+ldouble: 4
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+float128: 7
+ldouble: 7
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+float128: 7
+ldouble: 7
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "csin":
+float128: 1
+ldouble:1
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "csin_upward":
+double: 2
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "csinh":
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+float128: 4
+ldouble: 4
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctan_towardzero":
+double: 2
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+float128: 4
+ldouble: 4
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 3
+float128: 3
+ldouble: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+float128: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "erf":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "erfc":
+double: 5
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "erfc_downward":
+double: 5
+float: 6
+float128: 5
+ldouble: 5
+
+Function: "erfc_towardzero":
+double: 3
+float: 4
+float128: 4
+ldouble: 4
+
+Function: "erfc_upward":
+double: 5
+float: 6
+float128: 5
+ldouble: 5
+
+Function: "exp":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "exp10":
+double: 2
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "exp10_downward":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "exp10_towardzero":
+double: 3
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "exp10_upward":
+double: 2
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "exp2":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "exp2_downward":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "exp_downward":
+double: 1
+float: 1
+ldouble: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+ldouble: 2
+
+Function: "exp_upward":
+double: 1
+float: 1
+ldouble: 1
+
+Function: "exp_vlen16":
+float: 1
+
+Function: "exp_vlen2":
+double: 1
+
+Function: "exp_vlen4":
+double: 1
+float: 1
+
+Function: "exp_vlen4_avx2":
+double: 1
+
+Function: "exp_vlen8":
+double: 1
+float: 1
+
+Function: "exp_vlen8_avx2":
+float: 1
+
+Function: "expm1":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "expm1_downward":
+double: 1
+float: 1
+float128: 4
+ldouble: 4
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "expm1_upward":
+double: 1
+float: 1
+float128: 4
+ldouble: 4
+
+Function: "gamma":
+double: 4
+float: 7
+ldouble: 5
+
+Function: "gamma_downward":
+double: 5
+float: 7
+ldouble: 8
+
+Function: "gamma_towardzero":
+double: 5
+float: 6
+ldouble: 7
+
+Function: "gamma_upward":
+double: 5
+float: 6
+ldouble: 6
+
+Function: "hypot":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "hypot_downward":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "hypot_upward":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "j0":
+double: 3
+float: 9
+float128: 8
+ldouble: 8
+
+Function: "j0_downward":
+double: 6
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "j0_towardzero":
+double: 7
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "j0_upward":
+double: 9
+float: 9
+float128: 7
+ldouble: 7
+
+Function: "j1":
+double: 4
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "j1_downward":
+double: 6
+float: 8
+float128: 8
+ldouble: 8
+
+Function: "j1_towardzero":
+double: 4
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "j1_upward":
+double: 9
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "jn":
+double: 4
+float: 4
+float128: 7
+ldouble: 7
+
+Function: "jn_downward":
+double: 5
+float: 5
+float128: 8
+ldouble: 8
+
+Function: "jn_towardzero":
+double: 5
+float: 5
+float128: 8
+ldouble: 8
+
+Function: "jn_upward":
+double: 5
+float: 5
+float128: 7
+ldouble: 7
+
+Function: "lgamma":
+double: 4
+float: 7
+float128: 5
+ldouble: 5
+
+Function: "lgamma_downward":
+double: 5
+float: 7
+float128: 8
+ldouble: 8
+
+Function: "lgamma_towardzero":
+double: 5
+float: 6
+float128: 5
+ldouble: 7
+
+Function: "lgamma_upward":
+double: 5
+float: 6
+float128: 8
+ldouble: 8
+
+Function: "log":
+double: 1
+float: 1
+float128: 1
+ldouble: 1
+
+Function: "log10":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+float128: 2
+ldouble: 2
+
+Function: "log10_towardzero":
+double: 2
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "log10_upward":
+double: 2
+float: 2
+float128: 1
+ldouble: 1
+
+Function: "log1p":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "log1p_downward":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "log1p_upward":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "log2":
+double: 2
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "log2_downward":
+double: 3
+float: 3
+float128: 3
+ldouble: 3
+
+Function: "log2_towardzero":
+double: 2
+float: 2
+float128: 1
+ldouble: 1
+
+Function: "log2_upward":
+double: 3
+float: 3
+float128: 1
+ldouble: 1
+
+Function: "log_downward":
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "log_towardzero":
+float: 2
+float128: 2
+ldouble: 2
+
+Function: "log_upward":
+double: 1
+float: 2
+float128: 1
+ldouble: 1
+
+Function: "log_vlen16":
+float: 3
+
+Function: "log_vlen2":
+double: 1
+
+Function: "log_vlen4":
+double: 1
+float: 3
+
+Function: "log_vlen4_avx2":
+double: 1
+
+Function: "log_vlen8":
+double: 1
+float: 3
+
+Function: "log_vlen8_avx2":
+float: 3
+
+Function: "pow":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "pow_downward":
+double: 1
+float: 1
+float128: 4
+ldouble: 4
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+float128: 4
+ldouble: 4
+
+Function: "pow_upward":
+double: 1
+float: 1
+float128: 4
+ldouble: 4
+
+Function: "pow_vlen16":
+float: 3
+
+Function: "pow_vlen2":
+double: 1
+
+Function: "pow_vlen4":
+double: 1
+float: 3
+
+Function: "pow_vlen4_avx2":
+double: 1
+
+Function: "pow_vlen8":
+double: 1
+float: 3
+
+Function: "pow_vlen8_avx2":
+float: 3
+
+Function: "sin":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "sin_downward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "sin_upward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "sin_vlen16":
+float: 1
+
+Function: "sin_vlen2":
+double: 2
+
+Function: "sin_vlen4":
+double: 2
+float: 1
+
+Function: "sin_vlen4_avx2":
+double: 2
+
+Function: "sin_vlen8":
+double: 2
+float: 1
+
+Function: "sin_vlen8_avx2":
+float: 1
+
+Function: "sincos":
+double: 1
+float128: 1
+ldouble: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "sincos_upward":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "sincos_vlen16":
+float: 1
+
+Function: "sincos_vlen2":
+double: 2
+
+Function: "sincos_vlen4":
+double: 2
+float: 1
+
+Function: "sincos_vlen4_avx2":
+double: 2
+
+Function: "sincos_vlen8":
+double: 2
+float: 1
+
+Function: "sincos_vlen8_avx2":
+float: 1
+
+Function: "sinh":
+double: 2
+float: 2
+float128: 2
+ldouble: 3
+
+Function: "sinh_downward":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "sinh_towardzero":
+double: 3
+float: 2
+float128: 4
+ldouble: 4
+
+Function: "sinh_upward":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "tan":
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "tan_downward":
+double: 1
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+float128: 3
+ldouble: 3
+
+Function: "tan_upward":
+double: 1
+float: 1
+float128: 2
+ldouble: 2
+
+Function: "tanh":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "tanh_downward":
+double: 3
+float: 3
+float128: 4
+ldouble: 4
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+float128: 3
+ldouble: 3
+
+Function: "tanh_upward":
+double: 3
+float: 3
+float128: 4
+ldouble: 4
+
+Function: "tgamma":
+double: 9
+float: 8
+float128: 5
+ldouble: 5
+
+Function: "tgamma_downward":
+double: 9
+float: 7
+float128: 6
+ldouble: 6
+
+Function: "tgamma_towardzero":
+double: 9
+float: 7
+float128: 6
+ldouble: 6
+
+Function: "tgamma_upward":
+double: 9
+float: 8
+float128: 5
+ldouble: 5
+
+Function: "y0":
+double: 3
+float: 9
+float128: 3
+ldouble: 3
+
+Function: "y0_downward":
+double: 4
+float: 9
+float128: 7
+ldouble: 7
+
+Function: "y0_towardzero":
+double: 4
+float: 9
+float128: 8
+ldouble: 8
+
+Function: "y0_upward":
+double: 3
+float: 9
+float128: 7
+ldouble: 7
+
+Function: "y1":
+double: 6
+float: 9
+float128: 5
+ldouble: 5
+
+Function: "y1_downward":
+double: 6
+float: 9
+float128: 7
+ldouble: 7
+
+Function: "y1_towardzero":
+double: 4
+float: 9
+float128: 6
+ldouble: 6
+
+Function: "y1_upward":
+double: 7
+float: 9
+float128: 9
+ldouble: 9
+
+Function: "yn":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "yn_downward":
+double: 3
+float: 4
+float128: 5
+ldouble: 5
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+float128: 5
+ldouble: 5
+
+Function: "yn_upward":
+double: 4
+float: 5
+float128: 5
+ldouble: 5
+
+# end of automatic generation
diff --git a/sysdeps/sw_64/hp-timing.h b/sysdeps/sw_64/hp-timing.h
new file mode 100644
index 00000000..b30e6ed5
--- /dev/null
+++ b/sysdeps/sw_64/hp-timing.h
@@ -0,0 +1,48 @@
+/* High precision, low overhead timing functions. Sw_64 version.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@redhat.com>, 2001.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _HP_TIMING_SW_64_H
+#define _HP_TIMING_SW_64_H 1
+
+#if IS_IN (rtld)
+/* We always have the timestamp register, but it's got only a 4 second
+ range. Use it for ld.so profiling only. */
+# define HP_TIMING_INLINE (1)
+
+/* We use 32 bit values for the times. */
+typedef unsigned int hp_timing_t;
+
+/* The "rpcc" instruction returns a 32-bit counting half and a 32-bit
+ "virtual cycle counter displacement". Subtracting the two gives us
+ a virtual cycle count. */
+# define HP_TIMING_NOW(VAR) \
+ do \
+ { \
+ unsigned long int x_; \
+ asm volatile ("rtc %0" : "=r"(x_)); \
+ (VAR) = (int) (x_) - (int) (x_ >> 32); \
+ } \
+ while (0)
+# include <hp-timing-common.h>
+
+#else
+# include <sysdeps/generic/hp-timing.h>
+#endif /* IS_IN(rtld) */
+
+#endif /* hp-timing.h */
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/junhe_arm/glibc.git
git@gitee.com:junhe_arm/glibc.git
junhe_arm
glibc
glibc
master

搜索帮助