This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch tuliom/float128 created. glibc-2.25-44-ga0509fc


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, tuliom/float128 has been created
        at  a0509fc35d64e4ca95eb5753fd175c7af900c756 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a0509fc35d64e4ca95eb5753fd175c7af900c756

commit a0509fc35d64e4ca95eb5753fd175c7af900c756
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Tue Aug 9 16:48:54 2016 -0500

    powerpc64le: Enable float128
    
    Add ulps for the float128 type, bits/floatn.h, and float128-abi.h.
    
    Likewise, sqrt is not implemented in libgcc.  The sfp-machine.h
    header is taken from libgcc, and used to build a P7/P8 soft-fp
    sqrtf128.
    
    TODO: ldouble seems to have gotten worse. Did I break something?
    
    	* sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
    	* sysdeps/powerpc/fpu/math_private.h:
    	(__ieee754_sqrtf128): New inline override.
    	* sysdeps/powerpc/powerpc64le/Implies-before: New file.
    	* sysdeps/powerpc/powerpc64le/Makefile: New file.
    	* sysdeps/powerpc/powerpc64le/bits/floatn.h: New file.
    	* sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c: New file.
    	* sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h: New file.
    	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c: New file.
    
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
    	Regenerated.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
    	Likewise.
    
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h
    	New file.

diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
index 332741f..a7f81ac 100644
--- a/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/sysdeps/powerpc/fpu/libm-test-ulps
@@ -6,6 +6,8 @@ float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "acos_downward":
 double: 1
@@ -14,6 +16,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "acos_towardzero":
 double: 1
@@ -22,6 +26,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "acos_upward":
 double: 1
@@ -30,6 +36,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "acosh":
 double: 2
@@ -38,6 +46,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "acosh_downward":
 double: 2
@@ -46,6 +56,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: "acosh_towardzero":
 double: 2
@@ -54,6 +66,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: "acosh_upward":
 double: 2
@@ -62,12 +76,16 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: "asin":
 float: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "asin_downward":
 double: 1
@@ -76,6 +94,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "asin_towardzero":
 double: 1
@@ -84,6 +104,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "asin_upward":
 double: 1
@@ -92,6 +114,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "asinh":
 double: 1
@@ -100,6 +124,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: "asinh_downward":
 double: 3
@@ -108,6 +134,8 @@ idouble: 3
 ifloat: 3
 ildouble: 5
 ldouble: 5
+ifloat128: 4
+float128: 4
 
 Function: "asinh_towardzero":
 double: 2
@@ -116,6 +144,8 @@ idouble: 2
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: "asinh_upward":
 double: 3
@@ -124,6 +154,8 @@ idouble: 3
 ifloat: 3
 ildouble: 7
 ldouble: 7
+ifloat128: 4
+float128: 4
 
 Function: "atan":
 double: 1
@@ -132,12 +164,16 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "atan2":
 float: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "atan2_downward":
 double: 1
@@ -146,6 +182,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: "atan2_towardzero":
 double: 1
@@ -154,6 +192,8 @@ idouble: 1
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "atan2_upward":
 double: 1
@@ -162,6 +202,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "atan_downward":
 double: 1
@@ -170,6 +212,8 @@ idouble: 1
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "atan_towardzero":
 double: 1
@@ -178,6 +222,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "atan_upward":
 double: 1
@@ -186,6 +232,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "atanh":
 double: 2
@@ -194,6 +242,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: "atanh_downward":
 double: 3
@@ -202,6 +252,8 @@ idouble: 3
 ifloat: 3
 ildouble: 3
 ldouble: 3
+ifloat128: 4
+float128: 4
 
 Function: "atanh_towardzero":
 double: 2
@@ -210,6 +262,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "atanh_upward":
 double: 3
@@ -218,38 +272,50 @@ idouble: 3
 ifloat: 3
 ildouble: 4
 ldouble: 4
+ifloat128: 4
+float128: 4
 
 Function: "cabs":
 double: 1
 idouble: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "cabs_downward":
 double: 1
 idouble: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "cabs_towardzero":
 double: 1
 idouble: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "cabs_upward":
 double: 1
 idouble: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "cacos":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cacos":
 double: 1
@@ -258,6 +324,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cacos_downward":
 double: 2
@@ -266,6 +334,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cacos_downward":
 double: 5
@@ -274,6 +344,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Real part of "cacos_towardzero":
 double: 2
@@ -282,6 +354,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cacos_towardzero":
 double: 5
@@ -290,6 +364,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Real part of "cacos_upward":
 double: 2
@@ -298,6 +374,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "cacos_upward":
 double: 4
@@ -306,6 +384,8 @@ idouble: 4
 ifloat: 4
 ildouble: 8
 ldouble: 8
+ifloat128: 6
+float128: 6
 
 Function: Real part of "cacosh":
 double: 1
@@ -314,14 +394,18 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cacosh":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cacosh_downward":
 double: 5
@@ -330,6 +414,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "cacosh_downward":
 double: 2
@@ -338,6 +424,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cacosh_towardzero":
 double: 5
@@ -346,6 +434,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "cacosh_towardzero":
 double: 2
@@ -354,6 +444,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cacosh_upward":
 double: 4
@@ -362,6 +454,8 @@ idouble: 4
 ifloat: 4
 ildouble: 8
 ldouble: 8
+ifloat128: 6
+float128: 6
 
 Function: Imaginary part of "cacosh_upward":
 double: 2
@@ -370,6 +464,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "carg":
 double: 1
@@ -378,6 +474,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "carg_downward":
 double: 1
@@ -386,6 +484,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: "carg_towardzero":
 double: 1
@@ -394,6 +494,8 @@ idouble: 1
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "carg_upward":
 double: 1
@@ -402,14 +504,18 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: Real part of "casin":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "casin":
 double: 1
@@ -418,6 +524,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Real part of "casin_downward":
 double: 3
@@ -426,6 +534,8 @@ idouble: 3
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "casin_downward":
 double: 5
@@ -434,6 +544,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Real part of "casin_towardzero":
 double: 3
@@ -442,6 +554,8 @@ idouble: 3
 ifloat: 1
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "casin_towardzero":
 double: 5
@@ -450,6 +564,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Real part of "casin_upward":
 double: 2
@@ -458,6 +574,8 @@ idouble: 2
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "casin_upward":
 double: 4
@@ -466,6 +584,8 @@ idouble: 4
 ifloat: 4
 ildouble: 8
 ldouble: 8
+ifloat128: 6
+float128: 6
 
 Function: Real part of "casinh":
 double: 1
@@ -474,14 +594,18 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "casinh":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Real part of "casinh_downward":
 double: 5
@@ -490,6 +614,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "casinh_downward":
 double: 3
@@ -498,6 +624,8 @@ idouble: 3
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Real part of "casinh_towardzero":
 double: 5
@@ -506,6 +634,8 @@ idouble: 5
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "casinh_towardzero":
 double: 3
@@ -514,6 +644,8 @@ idouble: 3
 ifloat: 1
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Real part of "casinh_upward":
 double: 4
@@ -522,6 +654,8 @@ idouble: 4
 ifloat: 4
 ildouble: 8
 ldouble: 8
+ifloat128: 6
+float128: 6
 
 Function: Imaginary part of "casinh_upward":
 double: 2
@@ -530,12 +664,16 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: Real part of "catan":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "catan":
 double: 1
@@ -544,6 +682,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Real part of "catan_downward":
 double: 1
@@ -552,6 +692,8 @@ idouble: 1
 ifloat: 1
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "catan_downward":
 double: 2
@@ -560,6 +702,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: Real part of "catan_towardzero":
 double: 1
@@ -568,6 +712,8 @@ idouble: 1
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "catan_towardzero":
 double: 2
@@ -576,12 +722,16 @@ idouble: 2
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: Real part of "catan_upward":
 float: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "catan_upward":
 double: 3
@@ -590,6 +740,8 @@ idouble: 3
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 3
+float128: 3
 
 Function: Real part of "catanh":
 double: 1
@@ -598,12 +750,16 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "catanh":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Real part of "catanh_downward":
 double: 2
@@ -612,6 +768,8 @@ idouble: 2
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "catanh_downward":
 double: 1
@@ -620,6 +778,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: Real part of "catanh_towardzero":
 double: 2
@@ -628,6 +788,8 @@ idouble: 2
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "catanh_towardzero":
 double: 1
@@ -636,6 +798,8 @@ idouble: 1
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "catanh_upward":
 double: 4
@@ -644,12 +808,16 @@ idouble: 4
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "catanh_upward":
 float: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "cbrt":
 double: 3
@@ -658,6 +826,8 @@ idouble: 3
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "cbrt_downward":
 double: 4
@@ -666,6 +836,8 @@ idouble: 4
 ifloat: 1
 ildouble: 5
 ldouble: 5
+ifloat128: 1
+float128: 1
 
 Function: "cbrt_towardzero":
 double: 3
@@ -674,6 +846,8 @@ idouble: 3
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "cbrt_upward":
 double: 5
@@ -682,6 +856,8 @@ idouble: 5
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "ccos":
 double: 1
@@ -690,6 +866,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "ccos":
 double: 1
@@ -698,6 +876,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "ccos_downward":
 double: 1
@@ -706,6 +886,8 @@ idouble: 1
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "ccos_downward":
 double: 2
@@ -714,6 +896,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "ccos_towardzero":
 double: 1
@@ -722,6 +906,8 @@ idouble: 1
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "ccos_towardzero":
 double: 2
@@ -730,6 +916,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "ccos_upward":
 double: 1
@@ -738,6 +926,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "ccos_upward":
 double: 2
@@ -746,6 +936,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: Real part of "ccosh":
 double: 1
@@ -754,6 +946,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "ccosh":
 double: 1
@@ -762,6 +956,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "ccosh_downward":
 double: 1
@@ -770,6 +966,8 @@ idouble: 1
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "ccosh_downward":
 double: 2
@@ -778,14 +976,18 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "ccosh_towardzero":
 double: 1
 float: 3
 idouble: 1
 ifloat: 3
-ildouble: 6
-ldouble: 6
+ildouble: 10
+ldouble: 10
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "ccosh_towardzero":
 double: 2
@@ -794,6 +996,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "ccosh_upward":
 double: 1
@@ -802,6 +1006,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "ccosh_upward":
 double: 2
@@ -810,6 +1016,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cexp":
 double: 2
@@ -818,6 +1026,8 @@ idouble: 2
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "cexp":
 double: 1
@@ -826,6 +1036,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "cexp_downward":
 double: 1
@@ -834,6 +1046,8 @@ idouble: 1
 ifloat: 2
 ildouble: 11
 ldouble: 11
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cexp_downward":
 double: 1
@@ -842,6 +1056,8 @@ idouble: 1
 ifloat: 3
 ildouble: 11
 ldouble: 11
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cexp_towardzero":
 double: 1
@@ -850,6 +1066,8 @@ idouble: 1
 ifloat: 2
 ildouble: 11
 ldouble: 11
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "cexp_towardzero":
 double: 1
@@ -858,6 +1076,8 @@ idouble: 1
 ifloat: 3
 ildouble: 11
 ldouble: 11
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cexp_upward":
 double: 1
@@ -866,6 +1086,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "cexp_upward":
 double: 1
@@ -874,6 +1096,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Real part of "clog":
 double: 3
@@ -882,6 +1106,8 @@ idouble: 3
 ifloat: 3
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "clog":
 double: 1
@@ -890,6 +1116,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "clog10":
 double: 3
@@ -898,6 +1126,8 @@ idouble: 3
 ifloat: 4
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "clog10":
 double: 2
@@ -906,6 +1136,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: Real part of "clog10_downward":
 double: 6
@@ -914,6 +1146,8 @@ idouble: 6
 ifloat: 6
 ildouble: 10
 ldouble: 10
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "clog10_downward":
 double: 2
@@ -922,6 +1156,8 @@ idouble: 2
 ifloat: 4
 ildouble: 7
 ldouble: 7
+ifloat128: 3
+float128: 3
 
 Function: Real part of "clog10_towardzero":
 double: 5
@@ -930,6 +1166,8 @@ idouble: 5
 ifloat: 5
 ildouble: 9
 ldouble: 9
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "clog10_towardzero":
 double: 2
@@ -938,6 +1176,8 @@ idouble: 2
 ifloat: 4
 ildouble: 8
 ldouble: 8
+ifloat128: 3
+float128: 3
 
 Function: Real part of "clog10_upward":
 double: 8
@@ -946,6 +1186,8 @@ idouble: 8
 ifloat: 5
 ildouble: 10
 ldouble: 10
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "clog10_upward":
 double: 2
@@ -954,6 +1196,8 @@ idouble: 2
 ifloat: 4
 ildouble: 7
 ldouble: 7
+ifloat128: 3
+float128: 3
 
 Function: Real part of "clog_downward":
 double: 7
@@ -962,6 +1206,8 @@ idouble: 7
 ifloat: 5
 ildouble: 11
 ldouble: 11
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "clog_downward":
 double: 1
@@ -970,6 +1216,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: Real part of "clog_towardzero":
 double: 7
@@ -978,6 +1226,8 @@ idouble: 7
 ifloat: 5
 ildouble: 10
 ldouble: 10
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "clog_towardzero":
 double: 1
@@ -986,6 +1236,8 @@ idouble: 1
 ifloat: 3
 ildouble: 7
 ldouble: 7
+ifloat128: 2
+float128: 2
 
 Function: Real part of "clog_upward":
 double: 8
@@ -994,6 +1246,8 @@ idouble: 8
 ifloat: 5
 ildouble: 10
 ldouble: 10
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "clog_upward":
 double: 1
@@ -1002,12 +1256,16 @@ idouble: 1
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: "cos":
 float: 1
 ifloat: 1
 ildouble: 4
 ldouble: 4
+ifloat128: 1
+float128: 1
 
 Function: "cos_downward":
 double: 1
@@ -1016,6 +1274,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: "cos_towardzero":
 double: 1
@@ -1024,6 +1284,8 @@ idouble: 1
 ifloat: 1
 ildouble: 4
 ldouble: 4
+ifloat128: 1
+float128: 1
 
 Function: "cos_upward":
 double: 1
@@ -1032,6 +1294,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 2
+float128: 2
 
 Function: "cosh":
 double: 1
@@ -1040,6 +1304,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "cosh_downward":
 double: 1
@@ -1048,6 +1314,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 2
 
 Function: "cosh_towardzero":
 double: 1
@@ -1056,6 +1324,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 2
 
 Function: "cosh_upward":
 double: 1
@@ -1064,6 +1334,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 3
 
 Function: Real part of "cpow":
 double: 2
@@ -1072,12 +1344,16 @@ idouble: 2
 ifloat: 5
 ildouble: 4
 ldouble: 4
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "cpow":
 float: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 9
+float128: 9
 
 Function: Real part of "cpow_downward":
 double: 4
@@ -1086,6 +1362,8 @@ idouble: 4
 ifloat: 8
 ildouble: 7
 ldouble: 7
+ifloat128: 6
+float128: 6
 
 Function: Imaginary part of "cpow_downward":
 double: 1
@@ -1094,6 +1372,8 @@ idouble: 1
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cpow_towardzero":
 double: 4
@@ -1102,6 +1382,8 @@ idouble: 4
 ifloat: 8
 ildouble: 8
 ldouble: 8
+ifloat128: 6
+float128: 6
 
 Function: Imaginary part of "cpow_towardzero":
 double: 1
@@ -1110,6 +1392,8 @@ idouble: 1
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: Real part of "cpow_upward":
 double: 4
@@ -1118,6 +1402,8 @@ idouble: 4
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "cpow_upward":
 double: 1
@@ -1126,6 +1412,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csin":
 double: 1
@@ -1134,10 +1422,14 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "csin":
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Real part of "csin_downward":
 double: 2
@@ -1146,6 +1438,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csin_downward":
 double: 1
@@ -1154,6 +1448,8 @@ idouble: 1
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csin_towardzero":
 double: 2
@@ -1162,6 +1458,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csin_towardzero":
 double: 1
@@ -1170,6 +1468,8 @@ idouble: 1
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csin_upward":
 double: 2
@@ -1178,6 +1478,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csin_upward":
 double: 1
@@ -1186,12 +1488,16 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Real part of "csinh":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: Imaginary part of "csinh":
 double: 1
@@ -1200,6 +1506,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: Real part of "csinh_downward":
 double: 2
@@ -1208,6 +1516,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csinh_downward":
 double: 2
@@ -1216,6 +1526,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csinh_towardzero":
 double: 2
@@ -1224,6 +1536,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csinh_towardzero":
 double: 2
@@ -1232,6 +1546,8 @@ idouble: 2
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csinh_upward":
 double: 1
@@ -1240,6 +1556,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "csinh_upward":
 double: 2
@@ -1248,6 +1566,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csqrt":
 double: 2
@@ -1256,6 +1576,8 @@ idouble: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: Imaginary part of "csqrt":
 double: 2
@@ -1264,6 +1586,8 @@ idouble: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: Real part of "csqrt_downward":
 double: 5
@@ -1272,6 +1596,8 @@ idouble: 5
 ifloat: 4
 ildouble: 4
 ldouble: 4
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "csqrt_downward":
 double: 4
@@ -1280,6 +1606,8 @@ idouble: 4
 ifloat: 3
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Real part of "csqrt_towardzero":
 double: 4
@@ -1288,6 +1616,8 @@ idouble: 4
 ifloat: 3
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "csqrt_towardzero":
 double: 4
@@ -1296,6 +1626,8 @@ idouble: 4
 ifloat: 3
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: Real part of "csqrt_upward":
 double: 5
@@ -1304,6 +1636,8 @@ idouble: 5
 ifloat: 4
 ildouble: 12
 ldouble: 12
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "csqrt_upward":
 double: 3
@@ -1312,6 +1646,8 @@ idouble: 3
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 3
+float128: 3
 
 Function: Real part of "ctan":
 double: 1
@@ -1320,6 +1656,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "ctan":
 double: 2
@@ -1328,6 +1666,8 @@ idouble: 2
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: Real part of "ctan_downward":
 double: 6
@@ -1336,6 +1676,8 @@ idouble: 6
 ifloat: 5
 ildouble: 6
 ldouble: 6
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "ctan_downward":
 double: 2
@@ -1344,6 +1686,8 @@ idouble: 2
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 5
+float128: 5
 
 Function: Real part of "ctan_towardzero":
 double: 5
@@ -1352,6 +1696,8 @@ idouble: 5
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 4
+float128: 4
 
 Function: Imaginary part of "ctan_towardzero":
 double: 2
@@ -1360,6 +1706,8 @@ idouble: 2
 ifloat: 2
 ildouble: 13
 ldouble: 13
+ifloat128: 5
+float128: 5
 
 Function: Real part of "ctan_upward":
 double: 2
@@ -1368,6 +1716,8 @@ idouble: 2
 ifloat: 3
 ildouble: 7
 ldouble: 7
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "ctan_upward":
 double: 2
@@ -1376,6 +1726,8 @@ idouble: 2
 ifloat: 3
 ildouble: 10
 ldouble: 10
+ifloat128: 5
+float128: 5
 
 Function: Real part of "ctanh":
 double: 2
@@ -1384,6 +1736,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Imaginary part of "ctanh":
 double: 2
@@ -1392,6 +1746,8 @@ idouble: 2
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: Real part of "ctanh_downward":
 double: 4
@@ -1400,6 +1756,8 @@ idouble: 4
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "ctanh_downward":
 double: 6
@@ -1408,6 +1766,8 @@ idouble: 6
 ifloat: 5
 ildouble: 6
 ldouble: 6
+ifloat128: 4
+float128: 4
 
 Function: Real part of "ctanh_towardzero":
 double: 2
@@ -1416,6 +1776,8 @@ idouble: 2
 ifloat: 2
 ildouble: 13
 ldouble: 13
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "ctanh_towardzero":
 double: 5
@@ -1424,6 +1786,8 @@ idouble: 5
 ifloat: 2
 ildouble: 10
 ldouble: 10
+ifloat128: 3
+float128: 3
 
 Function: Real part of "ctanh_upward":
 double: 2
@@ -1432,6 +1796,8 @@ idouble: 2
 ifloat: 3
 ildouble: 10
 ldouble: 10
+ifloat128: 5
+float128: 5
 
 Function: Imaginary part of "ctanh_upward":
 double: 2
@@ -1440,6 +1806,8 @@ idouble: 2
 ifloat: 3
 ildouble: 10
 ldouble: 10
+ifloat128: 5
+float128: 5
 
 Function: "erf":
 double: 1
@@ -1448,6 +1816,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "erf_downward":
 double: 1
@@ -1456,6 +1826,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "erf_towardzero":
 double: 1
@@ -1464,6 +1836,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "erf_upward":
 double: 1
@@ -1472,6 +1846,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "erfc":
 double: 2
@@ -1480,6 +1856,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "erfc_downward":
 double: 3
@@ -1488,6 +1866,8 @@ idouble: 3
 ifloat: 4
 ildouble: 10
 ldouble: 10
+ifloat128: 5
+float128: 5
 
 Function: "erfc_towardzero":
 double: 3
@@ -1496,6 +1876,8 @@ idouble: 3
 ifloat: 3
 ildouble: 9
 ldouble: 9
+ifloat128: 4
+float128: 4
 
 Function: "erfc_upward":
 double: 3
@@ -1504,6 +1886,8 @@ idouble: 3
 ifloat: 4
 ildouble: 7
 ldouble: 7
+ifloat128: 5
+float128: 5
 
 Function: "exp":
 double: 1
@@ -1512,12 +1896,16 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "exp10":
 double: 2
 idouble: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "exp10_downward":
 double: 2
@@ -1526,6 +1914,8 @@ idouble: 2
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 3
+float128: 3
 
 Function: "exp10_towardzero":
 double: 2
@@ -1534,6 +1924,8 @@ idouble: 2
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 3
+float128: 3
 
 Function: "exp10_upward":
 double: 2
@@ -1542,6 +1934,8 @@ idouble: 2
 ifloat: 1
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "exp2":
 double: 1
@@ -1550,6 +1944,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "exp2_downward":
 double: 1
@@ -1558,6 +1954,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "exp2_towardzero":
 double: 1
@@ -1566,6 +1964,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "exp2_upward":
 double: 1
@@ -1574,6 +1974,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "exp_downward":
 double: 1
@@ -1602,6 +2004,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "expm1_downward":
 double: 1
@@ -1610,6 +2014,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "expm1_towardzero":
 double: 1
@@ -1618,6 +2024,8 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 4
+float128: 4
 
 Function: "expm1_upward":
 double: 1
@@ -1626,6 +2034,8 @@ idouble: 1
 ifloat: 1
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "fma":
 ildouble: 1
@@ -1666,6 +2076,8 @@ idouble: 3
 ifloat: 4
 ildouble: 3
 ldouble: 3
+ifloat128: 9
+float128: 9
 
 Function: "gamma_downward":
 double: 4
@@ -1674,6 +2086,8 @@ idouble: 4
 ifloat: 4
 ildouble: 15
 ldouble: 15
+ifloat128: 9
+float128: 9
 
 Function: "gamma_towardzero":
 double: 4
@@ -1682,6 +2096,8 @@ idouble: 4
 ifloat: 3
 ildouble: 16
 ldouble: 16
+ifloat128: 9
+float128: 9
 
 Function: "gamma_upward":
 double: 4
@@ -1690,30 +2106,40 @@ idouble: 4
 ifloat: 5
 ildouble: 11
 ldouble: 11
+ifloat128: 9
+float128: 9
 
 Function: "hypot":
 double: 1
 idouble: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "hypot_downward":
 double: 1
 idouble: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "hypot_towardzero":
 double: 1
 idouble: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "hypot_upward":
 double: 1
 idouble: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "j0":
 double: 2
@@ -1722,6 +2148,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "j0_downward":
 double: 2
@@ -1730,6 +2158,8 @@ idouble: 2
 ifloat: 3
 ildouble: 11
 ldouble: 11
+ifloat128: 4
+float128: 4
 
 Function: "j0_towardzero":
 double: 2
@@ -1738,6 +2168,8 @@ idouble: 2
 ifloat: 1
 ildouble: 8
 ldouble: 8
+ifloat128: 2
+float128: 2
 
 Function: "j0_upward":
 double: 3
@@ -1746,6 +2178,8 @@ idouble: 3
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 5
+float128: 5
 
 Function: "j1":
 double: 1
@@ -1754,6 +2188,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 4
+float128: 4
 
 Function: "j1_downward":
 double: 3
@@ -1762,6 +2198,8 @@ idouble: 3
 ifloat: 2
 ildouble: 7
 ldouble: 7
+ifloat128: 4
+float128: 4
 
 Function: "j1_towardzero":
 double: 3
@@ -1770,6 +2208,8 @@ idouble: 3
 ifloat: 2
 ildouble: 7
 ldouble: 7
+ifloat128: 4
+float128: 4
 
 Function: "j1_upward":
 double: 3
@@ -1778,6 +2218,8 @@ idouble: 3
 ifloat: 4
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "jn":
 double: 4
@@ -1786,6 +2228,8 @@ idouble: 4
 ifloat: 4
 ildouble: 4
 ldouble: 4
+ifloat128: 7
+float128: 7
 
 Function: "jn_downward":
 double: 4
@@ -1794,6 +2238,8 @@ idouble: 4
 ifloat: 5
 ildouble: 7
 ldouble: 7
+ifloat128: 8
+float128: 8
 
 Function: "jn_towardzero":
 double: 4
@@ -1802,6 +2248,8 @@ idouble: 4
 ifloat: 5
 ildouble: 7
 ldouble: 7
+ifloat128: 8
+float128: 8
 
 Function: "jn_upward":
 double: 5
@@ -1810,6 +2258,8 @@ idouble: 5
 ifloat: 4
 ildouble: 5
 ldouble: 5
+ifloat128: 7
+float128: 7
 
 Function: "lgamma":
 double: 3
@@ -1818,6 +2268,8 @@ idouble: 3
 ifloat: 4
 ildouble: 3
 ldouble: 3
+ifloat128: 9
+float128: 9
 
 Function: "lgamma_downward":
 double: 4
@@ -1826,6 +2278,8 @@ idouble: 4
 ifloat: 4
 ildouble: 15
 ldouble: 15
+ifloat128: 9
+float128: 9
 
 Function: "lgamma_towardzero":
 double: 4
@@ -1834,6 +2288,8 @@ idouble: 4
 ifloat: 3
 ildouble: 16
 ldouble: 16
+ifloat128: 9
+float128: 9
 
 Function: "lgamma_upward":
 double: 4
@@ -1842,12 +2298,16 @@ idouble: 4
 ifloat: 5
 ildouble: 11
 ldouble: 11
+ifloat128: 9
+float128: 9
 
 Function: "log":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "log10":
 double: 2
@@ -1856,6 +2316,8 @@ idouble: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "log10_downward":
 double: 2
@@ -1864,6 +2326,8 @@ idouble: 2
 ifloat: 3
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "log10_towardzero":
 double: 2
@@ -1872,6 +2336,8 @@ idouble: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "log10_upward":
 double: 2
@@ -1880,6 +2346,8 @@ idouble: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "log1p":
 double: 1
@@ -1888,6 +2356,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "log1p_downward":
 double: 1
@@ -1896,6 +2366,8 @@ idouble: 1
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: "log1p_towardzero":
 double: 2
@@ -1904,6 +2376,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 3
+float128: 3
 
 Function: "log1p_upward":
 double: 2
@@ -1912,6 +2386,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "log2":
 double: 1
@@ -1920,6 +2396,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "log2_downward":
 double: 3
@@ -1928,6 +2406,8 @@ idouble: 3
 ifloat: 3
 ildouble: 2
 ldouble: 2
+ifloat128: 3
+float128: 3
 
 Function: "log2_towardzero":
 double: 2
@@ -1936,6 +2416,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 1
+float128: 1
 
 Function: "log2_upward":
 double: 3
@@ -1944,18 +2426,24 @@ idouble: 3
 ifloat: 3
 ildouble: 4
 ldouble: 4
+ifloat128: 1
+float128: 1
 
 Function: "log_downward":
 float: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "log_towardzero":
 float: 2
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "log_upward":
 double: 1
@@ -1964,6 +2452,8 @@ idouble: 1
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "nextafter_downward":
 ildouble: 1
@@ -1978,12 +2468,16 @@ float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "pow10":
 double: 2
 idouble: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "pow10_downward":
 double: 2
@@ -1992,6 +2486,8 @@ idouble: 2
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 3
+float128: 3
 
 Function: "pow10_towardzero":
 double: 2
@@ -2000,6 +2496,8 @@ idouble: 2
 ifloat: 1
 ildouble: 9
 ldouble: 9
+ifloat128: 3
+float128: 3
 
 Function: "pow10_upward":
 double: 2
@@ -2008,6 +2506,8 @@ idouble: 2
 ifloat: 1
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "pow_downward":
 double: 1
@@ -2016,6 +2516,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "pow_towardzero":
 double: 1
@@ -2024,6 +2526,8 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "pow_upward":
 double: 1
@@ -2032,12 +2536,16 @@ idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "sin":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "sin_downward":
 double: 1
@@ -2046,6 +2554,8 @@ idouble: 1
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "sin_towardzero":
 double: 1
@@ -2054,6 +2564,8 @@ idouble: 1
 ifloat: 1
 ildouble: 4
 ldouble: 4
+ifloat128: 2
+float128: 2
 
 Function: "sin_upward":
 double: 1
@@ -2062,12 +2574,16 @@ idouble: 1
 ifloat: 2
 ildouble: 5
 ldouble: 5
+ifloat128: 3
+float128: 3
 
 Function: "sincos":
 float: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 1
+float128: 1
 
 Function: "sincos_downward":
 double: 1
@@ -2076,6 +2592,8 @@ idouble: 1
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "sincos_towardzero":
 double: 1
@@ -2084,6 +2602,8 @@ idouble: 1
 ifloat: 1
 ildouble: 7
 ldouble: 7
+ifloat128: 2
+float128: 2
 
 Function: "sincos_upward":
 double: 1
@@ -2092,6 +2612,8 @@ idouble: 1
 ifloat: 2
 ildouble: 7
 ldouble: 7
+ifloat128: 3
+float128: 3
 
 Function: "sinh":
 double: 2
@@ -2100,6 +2622,8 @@ idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 2
+float128: 2
 
 Function: "sinh_downward":
 double: 3
@@ -2108,6 +2632,8 @@ idouble: 3
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "sinh_towardzero":
 double: 2
@@ -2116,6 +2642,8 @@ idouble: 2
 ifloat: 2
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "sinh_upward":
 double: 3
@@ -2124,6 +2652,8 @@ idouble: 3
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 4
+float128: 4
 
 Function: "sqrt":
 ildouble: 1
@@ -2146,6 +2676,8 @@ float: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "tan_downward":
 double: 1
@@ -2154,6 +2686,8 @@ idouble: 1
 ifloat: 2
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "tan_towardzero":
 double: 1
@@ -2162,6 +2696,8 @@ idouble: 1
 ifloat: 1
 ildouble: 2
 ldouble: 2
+ifloat128: 1
+float128: 1
 
 Function: "tan_upward":
 double: 1
@@ -2170,6 +2706,8 @@ idouble: 1
 ifloat: 1
 ildouble: 3
 ldouble: 3
+ifloat128: 1
+float128: 1
 
 Function: "tanh":
 double: 2
@@ -2178,6 +2716,8 @@ idouble: 2
 ifloat: 2
 ildouble: 1
 ldouble: 1
+ifloat128: 2
+float128: 2
 
 Function: "tanh_downward":
 double: 3
@@ -2186,6 +2726,8 @@ idouble: 3
 ifloat: 3
 ildouble: 4
 ldouble: 4
+ifloat128: 4
+float128: 4
 
 Function: "tanh_towardzero":
 double: 2
@@ -2194,6 +2736,8 @@ idouble: 2
 ifloat: 2
 ildouble: 4
 ldouble: 4
+ifloat128: 3
+float128: 3
 
 Function: "tanh_upward":
 double: 3
@@ -2202,6 +2746,8 @@ idouble: 3
 ifloat: 3
 ildouble: 6
 ldouble: 6
+ifloat128: 3
+float128: 3
 
 Function: "tgamma":
 double: 5
@@ -2210,6 +2756,8 @@ idouble: 5
 ifloat: 4
 ildouble: 5
 ldouble: 5
+ifloat128: 4
+float128: 4
 
 Function: "tgamma_downward":
 double: 5
@@ -2218,6 +2766,8 @@ idouble: 5
 ifloat: 5
 ildouble: 6
 ldouble: 6
+ifloat128: 5
+float128: 5
 
 Function: "tgamma_towardzero":
 double: 5
@@ -2226,6 +2776,8 @@ idouble: 5
 ifloat: 4
 ildouble: 5
 ldouble: 5
+ifloat128: 5
+float128: 5
 
 Function: "tgamma_upward":
 double: 4
@@ -2234,6 +2786,8 @@ idouble: 4
 ifloat: 4
 ildouble: 5
 ldouble: 5
+ifloat128: 4
+float128: 4
 
 Function: "y0":
 double: 2
@@ -2242,6 +2796,8 @@ idouble: 2
 ifloat: 1
 ildouble: 1
 ldouble: 1
+ifloat128: 3
+float128: 3
 
 Function: "y0_downward":
 double: 3
@@ -2250,6 +2806,8 @@ idouble: 3
 ifloat: 2
 ildouble: 10
 ldouble: 10
+ifloat128: 4
+float128: 4
 
 Function: "y0_towardzero":
 double: 3
@@ -2258,6 +2816,8 @@ idouble: 3
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 3
+float128: 3
 
 Function: "y0_upward":
 double: 2
@@ -2266,6 +2826,8 @@ idouble: 2
 ifloat: 3
 ildouble: 9
 ldouble: 9
+ifloat128: 3
+float128: 3
 
 Function: "y1":
 double: 3
@@ -2274,6 +2836,8 @@ idouble: 3
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 2
+float128: 2
 
 Function: "y1_downward":
 double: 3
@@ -2282,6 +2846,8 @@ idouble: 3
 ifloat: 2
 ildouble: 7
 ldouble: 7
+ifloat128: 4
+float128: 4
 
 Function: "y1_towardzero":
 double: 3
@@ -2290,6 +2856,8 @@ idouble: 3
 ifloat: 2
 ildouble: 9
 ldouble: 9
+ifloat128: 2
+float128: 2
 
 Function: "y1_upward":
 double: 5
@@ -2298,6 +2866,8 @@ idouble: 5
 ifloat: 2
 ildouble: 9
 ldouble: 9
+ifloat128: 5
+float128: 5
 
 Function: "yn":
 double: 3
@@ -2306,6 +2876,8 @@ idouble: 3
 ifloat: 2
 ildouble: 2
 ldouble: 2
+ifloat128: 5
+float128: 5
 
 Function: "yn_downward":
 double: 3
@@ -2314,6 +2886,8 @@ idouble: 3
 ifloat: 2
 ildouble: 10
 ldouble: 10
+ifloat128: 5
+float128: 5
 
 Function: "yn_towardzero":
 double: 3
@@ -2322,6 +2896,8 @@ idouble: 3
 ifloat: 3
 ildouble: 8
 ldouble: 8
+ifloat128: 5
+float128: 5
 
 Function: "yn_upward":
 double: 4
@@ -2330,5 +2906,7 @@ idouble: 4
 ifloat: 3
 ildouble: 9
 ldouble: 9
+ifloat128: 5
+float128: 5
 
 # end of automatic generation
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 3c71275..0bb55e5 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -23,8 +23,19 @@
 #include <ldsodefs.h>
 #include <dl-procinfo.h>
 #include <fenv_private.h>
+
 #include_next <math_private.h>
 
+#ifdef _ARCH_PWR9
+extern __always_inline __float128
+__ieee754_sqrtf128 (__float128 __x)
+{
+  __float128 __z;
+  asm ("xssqrtqp %0,%1" : "=wq" (__z) : "wq" (__x));
+  return __z;
+}
+#endif
+
 extern double __slow_ieee754_sqrt (double);
 extern __always_inline double
 __ieee754_sqrt (double __x)
diff --git a/sysdeps/powerpc/powerpc64le/Implies-before b/sysdeps/powerpc/powerpc64le/Implies-before
new file mode 100644
index 0000000..4806514
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/Implies-before
@@ -0,0 +1 @@
+ieee754/float128
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
new file mode 100644
index 0000000..2f3441b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -0,0 +1,37 @@
+# When building float128 we need to ensure -mfloat128 is
+# passed to all such object files.
+
+ifeq ($(subdir),math)
+# sqrtf128 requires emulation on POWER8 and below.
+CPPFLAGS += -I../soft-fp
+
+# float128 requires adding a handful of extra flags.
+%f128.o %f128.os %f128_r.o %f128_r.os: CFLAGS += -mfloat128
+CFLAGS-test-float128.c += -mfloat128
+CFLAGS-test-ifloat128.c += -mfloat128
+CFLAGS-test-float128-finite.c += -mfloat128
+endif
+
+# Append flags to string <-> _Float128 routines.
+ifneq ($(filter $(subdir),wcsmbs stdlib),)
+%f128.o %f128.os %f128_l.o %f128_l.os %f128_nan.o %f128_nan.os %float1282mpn.o %float1282mpn.os %mpn2float128.o %mpn2float128.os: CFLAGS += -mfloat128
+CFLAGS-bug-strtod.c += -mfloat128
+CFLAGS-bug-strtod2.c += -mfloat128
+CFLAGS-tst-strtod-round.c += -mfloat128
+CFLAGS-tst-wcstod-round.c += -mfloat128
+CFLAGS-tst-strtod6.c += -mfloat128
+CFLAGS-tst-strfrom.c += -mfloat128
+CFLAGS-tst-strfrom-locale.c += -mfloat128
+CFLAGS-strfrom-skeleton.c += -mfloat128
+
+# The strfrom class of functions call __printf_fp in order to convert the
+# floating-point value to characters.  This requires the value of IO_MTSAFE_IO.
+CFLAGS-strfromf128.c += $(libio-mtsafe)
+endif
+
+# Append flags to printf routines.
+ifeq ($(subdir),stdio-common)
+CFLAGS-printf_fp.c = -mfloat128
+CFLAGS-printf_fphex.c = -mfloat128
+CFLAGS-printf_size.c = -mfloat128
+endif
diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn.h b/sysdeps/powerpc/powerpc64le/bits/floatn.h
new file mode 100644
index 0000000..e132a53
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/bits/floatn.h
@@ -0,0 +1,41 @@
+/* Macros to control TS 18661-3 glibc features on PPC64.
+   Copyright (C) 2016 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 __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
+
+/* The runtime supports the type.  */
+#define __HAVE_FLOAT128 1
+
+/* Only set the enable flag if float128 is actually supported on the
+   building toolchain. (i.e -mfloat128 on a newer toolchain.)  */
+#ifdef __FLOAT128__
+# define __USE_FLOAT128 \
+  (__GLIBC_USE (IEC_60559_TYPES_EXT) && __GNUC_PREREQ (6,2))
+#else
+# define __USE_FLOAT128 0
+#endif
+
+/* Add a typedef for older GCC compilers which don't natively support
+   _Float128 and _Complex _Float128.  */
+#if __USE_FLOAT128 && __GNUC_PREREQ (6,2) && !__GNUC_PREREQ(7,0) \
+    && !defined __CFLOAT128
+typedef __float128 _Float128;
+typedef _Complex float __cfloat128 __attribute__ ((mode (KC)));
+# define __CFLOAT128 __cfloat128
+#endif
diff --git a/sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c
new file mode 100644
index 0000000..5ae74ae
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c
@@ -0,0 +1,59 @@
+/* soft-fp sqrt for _Float128
+   Return sqrt(a)
+   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
+
+   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/>.  */
+
+/* Unavoidable hacks since TFmode is assumed to be binary128. */
+#define TFtype KFtype
+#define TF KF
+
+#include <soft-fp.h>
+#include <quad.h>
+
+__float128
+__ieee754_sqrtf128 (__float128 a)
+{
+#ifndef _ARCH_PWR9
+  FP_DECL_EX;
+  FP_DECL_Q (A);
+  FP_DECL_Q (R);
+  __float128 r;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q (A, a);
+  FP_SQRT_Q (R, A);
+  FP_PACK_Q (r, R);
+  FP_HANDLE_EXCEPTIONS;
+  return r;
+#else
+  __float128 z;
+  asm ("xssqrtqp %0,%1" : "=wq" (z) : "wq" (a));
+  return z;
+#endif
+}
+strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
diff --git a/sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h b/sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h
new file mode 100644
index 0000000..b5448d8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h
@@ -0,0 +1,158 @@
+/* Decide whether to use 64 or 32-bit types to do the emulation.  If we are
+   doing IEEE-128 with VSX, use 64-bit emulation even if we are compiling for a
+   32-bit target.  */
+
+#if defined(_ARCH_PPC64) || defined(__VSX__) || defined(__FLOAT128__)
+#define _FP_W_TYPE_SIZE		64
+#define _FP_W_TYPE		unsigned long long
+#define _FP_WS_TYPE		signed long long
+#define _FP_I_TYPE		long long
+
+#ifdef _ARCH_PPC64
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+
+#define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype))
+#endif
+
+#else	/* 32-bits  */
+#define _FP_W_TYPE_SIZE		32
+#define _FP_W_TYPE		unsigned int
+#define _FP_WS_TYPE		signed int
+#define _FP_I_TYPE		int
+#endif	/* 32-bits  */
+
+/* The type of the result of a floating point comparison.  This must
+   match `__libgcc_cmp_return__' in GCC for the target.  */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
+
+#define _FP_MUL_MEAT_S(R,X,Y)				\
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+
+#if (_FP_W_TYPE_SIZE==64)
+#define _FP_MUL_MEAT_D(R,X,Y)				\
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)				\
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+#else
+#define _FP_MUL_MEAT_D(R,X,Y)				\
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)				\
+  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+#endif
+
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_loop(S,R,X,Y)
+
+#if (_FP_W_TYPE_SIZE==64)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)   _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+#else
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+#endif
+
+#define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
+
+#if (_FP_W_TYPE_SIZE==64)
+#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1)
+#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1
+#else
+#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#endif
+
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* Someone please check this.  */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+  do {								\
+    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
+	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
+      {								\
+	R##_s = Y##_s;						\
+	_FP_FRAC_COPY_##wc(R,Y);				\
+      }								\
+    else							\
+      {								\
+	R##_s = X##_s;						\
+	_FP_FRAC_COPY_##wc(R,X);				\
+      }								\
+    R##_c = FP_CLS_NAN;						\
+  } while (0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
+
+#define	__LITTLE_ENDIAN	1234
+#define	__BIG_ENDIAN	4321
+
+#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
+# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
+#  error "Both BIG_ENDIAN and LITTLE_ENDIAN defined!"
+# endif
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
+#  define __BYTE_ORDER __LITTLE_ENDIAN
+# else
+#  error "Cannot determine current byte order"
+# endif
+#endif
+
+/* Only provide exception support if we have hardware floating point using
+   floating point registers and we can execute the mtfsf instruction.  This
+   would only be true if we are using the emulation routines for IEEE 128-bit
+   floating point on pre-ISA 3.0 machines without the IEEE 128-bit floating
+   point support.  */
+
+#ifdef __FLOAT128__
+#define ISA_BIT(x) (1LL << (63 - x))
+
+/* Use the same bits of the FPSCR.  */
+# define FP_EX_INVALID		ISA_BIT(34)
+# define FP_EX_OVERFLOW		ISA_BIT(35)
+# define FP_EX_UNDERFLOW	ISA_BIT(36)
+# define FP_EX_DIVZERO		ISA_BIT(37)
+# define FP_EX_INEXACT		ISA_BIT(38)
+# define FP_EX_ALL		(FP_EX_INVALID | FP_EX_OVERFLOW		\
+				 | FP_EX_UNDERFLOW | FP_EX_DIVZERO	\
+				 | FP_EX_INEXACT)
+
+void __sfp_handle_exceptions (int);
+
+# define FP_HANDLE_EXCEPTIONS			\
+  do {						\
+    if (__builtin_expect (_fex, 0))		\
+      __sfp_handle_exceptions (_fex);		\
+  } while (0);
+
+/* The FP_EX_* bits track whether the exception has occurred.  This macro
+   must set the FP_EX_* bits of those exceptions which are configured to
+   trap.  The FPSCR bit which indicates this is 22 ISA bits above the
+   respective FP_EX_* bit.  Note, the ISA labels bits from msb to lsb,
+   so 22 ISA bits above is 22 bits below when counted from the lsb.  */
+# define FP_TRAPPING_EXCEPTIONS ((_fpscr.i << 22) & FP_EX_ALL)
+
+# define FP_RND_NEAREST	0x0
+# define FP_RND_ZERO	0x1
+# define FP_RND_PINF	0x2
+# define FP_RND_MINF	0x3
+# define FP_RND_MASK	0x3
+
+# define _FP_DECL_EX \
+  union { unsigned long long i; double d; } _fpscr __attribute__ ((unused)) = \
+	{ .i = FP_RND_NEAREST }
+
+#define FP_INIT_ROUNDMODE			\
+  do {						\
+    __asm__ __volatile__ ("mffs %0"		\
+			  : "=f" (_fpscr.d));	\
+  } while (0)
+
+# define FP_ROUNDMODE	(_fpscr.i & FP_RND_MASK)
+#endif	/* !__FLOAT128__ */
diff --git a/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
new file mode 100644
index 0000000..e1285d9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
@@ -0,0 +1,38 @@
+/* POWER9 sqrt for _Float128
+   Return sqrt(a)
+   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
+
+   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/>.  */
+
+__float128
+__ieee754_sqrtf128 (__float128 a)
+{
+  __float128 z;
+  asm ("xssqrtqp %0,%1" : "=wq" (z) : "wq" (a));
+  return z;
+}
+strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
index c761221..c36bed2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
@@ -2179,9 +2179,16 @@ GLIBC_2.24 GLIBC_2.24 A
 GLIBC_2.24 quick_exit F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 __strtof128_internal F
+GLIBC_2.25 __wcstof128_internal F
 GLIBC_2.25 explicit_bzero F
 GLIBC_2.25 getentropy F
 GLIBC_2.25 getrandom F
 GLIBC_2.25 strfromd F
 GLIBC_2.25 strfromf F
+GLIBC_2.25 strfromf128 F
 GLIBC_2.25 strfroml F
+GLIBC_2.25 strtof128 F
+GLIBC_2.25 strtof128_l F
+GLIBC_2.25 wcstof128 F
+GLIBC_2.25 wcstof128_l F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
index 9658ded..68fab09 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
@@ -416,54 +416,191 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __acosf128_finite F
+GLIBC_2.25 __acoshf128_finite F
+GLIBC_2.25 __asinf128_finite F
+GLIBC_2.25 __atan2f128_finite F
+GLIBC_2.25 __atanhf128_finite F
+GLIBC_2.25 __coshf128_finite F
+GLIBC_2.25 __exp10f128_finite F
+GLIBC_2.25 __exp2f128_finite F
+GLIBC_2.25 __expf128_finite F
 GLIBC_2.25 __fe_dfl_mode D 0x8
+GLIBC_2.25 __finitef128 F
+GLIBC_2.25 __fmodf128_finite F
+GLIBC_2.25 __fpclassifyf128 F
+GLIBC_2.25 __gammaf128_r_finite F
+GLIBC_2.25 __hypotf128_finite F
 GLIBC_2.25 __iscanonicall F
 GLIBC_2.25 __iseqsig F
 GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigf128 F
 GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 __isinff128 F
+GLIBC_2.25 __isnanf128 F
+GLIBC_2.25 __issignalingf128 F
+GLIBC_2.25 __j0f128_finite F
+GLIBC_2.25 __j1f128_finite F
+GLIBC_2.25 __jnf128_finite F
+GLIBC_2.25 __lgammaf128_r_finite F
+GLIBC_2.25 __log10f128_finite F
+GLIBC_2.25 __log2f128_finite F
+GLIBC_2.25 __logf128_finite F
+GLIBC_2.25 __powf128_finite F
+GLIBC_2.25 __remainderf128_finite F
+GLIBC_2.25 __signbitf128 F
+GLIBC_2.25 __sinhf128_finite F
+GLIBC_2.25 __sqrtf128_finite F
+GLIBC_2.25 __y0f128_finite F
+GLIBC_2.25 __y1f128_finite F
+GLIBC_2.25 __ynf128_finite F
+GLIBC_2.25 acosf128 F
+GLIBC_2.25 acoshf128 F
+GLIBC_2.25 asinf128 F
+GLIBC_2.25 asinhf128 F
+GLIBC_2.25 atan2f128 F
+GLIBC_2.25 atanf128 F
+GLIBC_2.25 atanhf128 F
+GLIBC_2.25 cabsf128 F
+GLIBC_2.25 cacosf128 F
+GLIBC_2.25 cacoshf128 F
 GLIBC_2.25 canonicalize F
 GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizef128 F
 GLIBC_2.25 canonicalizel F
+GLIBC_2.25 cargf128 F
+GLIBC_2.25 casinf128 F
+GLIBC_2.25 casinhf128 F
+GLIBC_2.25 catanf128 F
+GLIBC_2.25 catanhf128 F
+GLIBC_2.25 cbrtf128 F
+GLIBC_2.25 ccosf128 F
+GLIBC_2.25 ccoshf128 F
+GLIBC_2.25 ceilf128 F
+GLIBC_2.25 cexpf128 F
+GLIBC_2.25 cimagf128 F
+GLIBC_2.25 clog10f128 F
+GLIBC_2.25 clogf128 F
+GLIBC_2.25 conjf128 F
+GLIBC_2.25 copysignf128 F
+GLIBC_2.25 cosf128 F
+GLIBC_2.25 coshf128 F
+GLIBC_2.25 cpowf128 F
+GLIBC_2.25 cprojf128 F
+GLIBC_2.25 crealf128 F
+GLIBC_2.25 csinf128 F
+GLIBC_2.25 csinhf128 F
+GLIBC_2.25 csqrtf128 F
+GLIBC_2.25 ctanf128 F
+GLIBC_2.25 ctanhf128 F
+GLIBC_2.25 erfcf128 F
+GLIBC_2.25 erff128 F
+GLIBC_2.25 exp10f128 F
+GLIBC_2.25 exp2f128 F
+GLIBC_2.25 expf128 F
+GLIBC_2.25 expm1f128 F
+GLIBC_2.25 fabsf128 F
+GLIBC_2.25 fdimf128 F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 floorf128 F
+GLIBC_2.25 fmaf128 F
+GLIBC_2.25 fmaxf128 F
 GLIBC_2.25 fmaxmag F
 GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagf128 F
 GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminf128 F
 GLIBC_2.25 fminmag F
 GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagf128 F
 GLIBC_2.25 fminmagl F
+GLIBC_2.25 fmodf128 F
+GLIBC_2.25 frexpf128 F
 GLIBC_2.25 fromfp F
 GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpf128 F
 GLIBC_2.25 fromfpl F
 GLIBC_2.25 fromfpx F
 GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxf128 F
 GLIBC_2.25 fromfpxl F
 GLIBC_2.25 getpayload F
 GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadf128 F
 GLIBC_2.25 getpayloadl F
+GLIBC_2.25 hypotf128 F
+GLIBC_2.25 ilogbf128 F
+GLIBC_2.25 j0f128 F
+GLIBC_2.25 j1f128 F
+GLIBC_2.25 jnf128 F
+GLIBC_2.25 ldexpf128 F
+GLIBC_2.25 lgammaf128 F
+GLIBC_2.25 lgammaf128_r F
 GLIBC_2.25 llogb F
 GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbf128 F
 GLIBC_2.25 llogbl F
+GLIBC_2.25 llrintf128 F
+GLIBC_2.25 llroundf128 F
+GLIBC_2.25 log10f128 F
+GLIBC_2.25 log1pf128 F
+GLIBC_2.25 log2f128 F
+GLIBC_2.25 logbf128 F
+GLIBC_2.25 logf128 F
+GLIBC_2.25 lrintf128 F
+GLIBC_2.25 lroundf128 F
+GLIBC_2.25 modff128 F
+GLIBC_2.25 nanf128 F
+GLIBC_2.25 nearbyintf128 F
+GLIBC_2.25 nextafterf128 F
+GLIBC_2.25 nextdownf128 F
+GLIBC_2.25 nextupf128 F
+GLIBC_2.25 powf128 F
+GLIBC_2.25 remainderf128 F
+GLIBC_2.25 remquof128 F
+GLIBC_2.25 rintf128 F
 GLIBC_2.25 roundeven F
 GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenf128 F
 GLIBC_2.25 roundevenl F
+GLIBC_2.25 roundf128 F
+GLIBC_2.25 scalblnf128 F
+GLIBC_2.25 scalbnf128 F
 GLIBC_2.25 setpayload F
 GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadf128 F
 GLIBC_2.25 setpayloadl F
 GLIBC_2.25 setpayloadsig F
 GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigf128 F
 GLIBC_2.25 setpayloadsigl F
+GLIBC_2.25 sincosf128 F
+GLIBC_2.25 sinf128 F
+GLIBC_2.25 sinhf128 F
+GLIBC_2.25 sqrtf128 F
+GLIBC_2.25 tanf128 F
+GLIBC_2.25 tanhf128 F
+GLIBC_2.25 tgammaf128 F
 GLIBC_2.25 totalorder F
 GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderf128 F
 GLIBC_2.25 totalorderl F
 GLIBC_2.25 totalordermag F
 GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagf128 F
 GLIBC_2.25 totalordermagl F
+GLIBC_2.25 truncf128 F
 GLIBC_2.25 ufromfp F
 GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpf128 F
 GLIBC_2.25 ufromfpl F
 GLIBC_2.25 ufromfpx F
 GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxf128 F
 GLIBC_2.25 ufromfpxl F
+GLIBC_2.25 y0f128 F
+GLIBC_2.25 y1f128 F
+GLIBC_2.25 ynf128 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h
new file mode 100644
index 0000000..c47621c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction.  */
+#define FLOAT128_VERSION GLIBC_2.25

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=89c88df97f053db2ae7fc22eef7a1b7c66811823

commit 89c88df97f053db2ae7fc22eef7a1b7c66811823
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Tue Oct 11 13:50:19 2016 -0300

    powerpc64le: Require gcc >= 6.2 for powerpc64le
    
    On powerpc64le, support for __float128 will start to be built by default,
    which requires gcc versions greater than or equal to 6.2.
    
    Tested for ppc64 (still works with older compilers) and ppc64le.
    
    2016-10-11  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* sysdeps/powerpc/powerpc64le/configure.ac: New file with test for
    	the required minimum gcc version.
    	* sysdeps/powerpc/powerpc64le/configure: New, auto-generated file.

diff --git a/sysdeps/powerpc/powerpc64le/configure b/sysdeps/powerpc/powerpc64le/configure
new file mode 100644
index 0000000..0e1f011
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/configure
@@ -0,0 +1,38 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc for powerpc64le" >&5
+$as_echo_n "checking if $CC is sufficient to build libc for powerpc64le... " >&6; }
+if ${libc_cv_compiler_powerpc64le_compiler_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#error insufficient compiler
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libc_cv_compiler_powerpc64le_compiler_ok=yes
+else
+  libc_cv_compiler_powerpc64le_compiler_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_compiler_ok" >&5
+$as_echo "$libc_cv_compiler_powerpc64le_compiler_ok" >&6; }
+if test $libc_cv_powerpc64le_compiler_ok != yes; then :
+  critic_missing="$critic_missing GCC >= 6.2 is required on powerpc64le."
+fi
+
+test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/powerpc/powerpc64le/configure.ac b/sysdeps/powerpc/powerpc64le/configure.ac
new file mode 100644
index 0000000..b455b9c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/configure.ac
@@ -0,0 +1,16 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+dnl Require __float128 support on powerpc64le (available in GCC 6.2).
+AC_CACHE_CHECK([if $CC is sufficient to build libc for powerpc64le],
+	       libc_cv_compiler_powerpc64le_compiler_ok, [
+AC_TRY_COMPILE([], [
+#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#error insufficient compiler
+#endif],
+	       [libc_cv_compiler_powerpc64le_compiler_ok=yes],
+	       [libc_cv_compiler_powerpc64le_compiler_ok=no])])
+AS_IF([test "$libc_cv_powerpc64le_compiler_ok" != "yes"],
+      critic_missing="$critic_missing GCC >= 6.2 is required on powerpc64le.")
+
+test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=643b690f5a7cb9a1cb338e9d7e3fec3f480616d7

commit 643b690f5a7cb9a1cb338e9d7e3fec3f480616d7
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Jul 15 18:04:40 2016 -0500

    powerpc64le: Create divergent sysdep directory for ppc64le.
    
    float128 requires the seemingly trivial addition of the
    ieee754/float128 sysdep.  This requires creating a bunch
    of submachine and cpu directories and Implies files which
    just point  towards their powerpc64 equivalent.
    
    Tested on P7, P8, and generic ppc64le targets with and
    without multiarch.
    
    	* sysdeps/powerpc/powerpc64le/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/fpu/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/fpu/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power7/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power7/fpu/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power7/fpu/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power7/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power8/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power8/fpu/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power8/fpu/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power8/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power9/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power9/fpu/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power9/fpu/multiarch/Implies: New file.
    	* sysdeps/powerpc/powerpc64le/power9/multiarch/Implies: New file.
    	* sysdeps/powerpc/preconfigure: New file.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64le/Implies: New file.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu/Implies: New file.

diff --git a/sysdeps/powerpc/powerpc64le/Implies b/sysdeps/powerpc/powerpc64le/Implies
new file mode 100644
index 0000000..a105a32
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64
diff --git a/sysdeps/powerpc/powerpc64le/fpu/Implies b/sysdeps/powerpc/powerpc64le/fpu/Implies
new file mode 100644
index 0000000..c1f617b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu
diff --git a/sysdeps/powerpc/powerpc64le/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64le/fpu/multiarch/Implies
new file mode 100644
index 0000000..8d6531a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/multiarch/Implies b/sysdeps/powerpc/powerpc64le/multiarch/Implies
new file mode 100644
index 0000000..30edcf7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power7/Implies b/sysdeps/powerpc/powerpc64le/power7/Implies
new file mode 100644
index 0000000..eedef82
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power7/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power7
diff --git a/sysdeps/powerpc/powerpc64le/power7/fpu/Implies b/sysdeps/powerpc/powerpc64le/power7/fpu/Implies
new file mode 100644
index 0000000..8447198
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power7/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power7/fpu
diff --git a/sysdeps/powerpc/powerpc64le/power7/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power7/fpu/multiarch/Implies
new file mode 100644
index 0000000..7fd86fd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power7/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power7/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power7/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power7/multiarch/Implies
new file mode 100644
index 0000000..1fc7b7c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power7/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power7/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power8/Implies b/sysdeps/powerpc/powerpc64le/power8/Implies
new file mode 100644
index 0000000..3c37351
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power8/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power8
diff --git a/sysdeps/powerpc/powerpc64le/power8/fpu/Implies b/sysdeps/powerpc/powerpc64le/power8/fpu/Implies
new file mode 100644
index 0000000..ae0dbaf
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power8/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power8/fpu
diff --git a/sysdeps/powerpc/powerpc64le/power8/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power8/fpu/multiarch/Implies
new file mode 100644
index 0000000..f11e1bd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power8/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power8/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power8/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power8/multiarch/Implies
new file mode 100644
index 0000000..dd6bca4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power8/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power8/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power9/Implies b/sysdeps/powerpc/powerpc64le/power9/Implies
new file mode 100644
index 0000000..efe5d41
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power9/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power9
diff --git a/sysdeps/powerpc/powerpc64le/power9/fpu/Implies b/sysdeps/powerpc/powerpc64le/power9/fpu/Implies
new file mode 100644
index 0000000..3633114
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power9/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power9/fpu/
diff --git a/sysdeps/powerpc/powerpc64le/power9/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power9/fpu/multiarch/Implies
new file mode 100644
index 0000000..1059480
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power9/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power9/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64le/power9/multiarch/Implies b/sysdeps/powerpc/powerpc64le/power9/multiarch/Implies
new file mode 100644
index 0000000..02be30c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/power9/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power9/multiarch
diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
index 0c6fdde..7de2eaf 100644
--- a/sysdeps/powerpc/preconfigure
+++ b/sysdeps/powerpc/preconfigure
@@ -1,6 +1,9 @@
 # preconfigure fragment for powerpc.
 
 case "$machine" in
+powerpc64le)
+  base_machine=powerpc machine=powerpc/powerpc64le
+  ;;
 powerpc64*)
   base_machine=powerpc machine=powerpc/powerpc64
   ;;
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64le/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/Implies
new file mode 100644
index 0000000..4eacd3a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/Implies
@@ -0,0 +1 @@
+unix/sysv/linux/powerpc/powerpc64
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu/Implies
new file mode 100644
index 0000000..5da96db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu/Implies
@@ -0,0 +1 @@
+unix/sysv/linux/powerpc/powerpc64/fpu

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=68c046d0cbded178e7e912a9b46c82ea31cba712

commit 68c046d0cbded178e7e912a9b46c82ea31cba712
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Tue Jan 17 15:10:08 2017 -0200

    float128: Add fromfpf128 functions
    
    2017-01-26  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
    
    	* sysdeps/ieee754/float128/Versions: Add fromfpf128,
    	fromfpxf128, ufromfpf128, and ufromfpxf128.
    	* sysdeps/ieee754/float128/float128_private.h: Define fromfpf128,
    	fromfpxf128, ufromfpf128, and ufromfpxf128.
    	* sysdeps/ieee754/float128/s_fromfpf128.c: New file.
    	* sysdeps/ieee754/float128/s_ufromfpf128.c: Likewise.
    	* sysdeps/ieee754/float128/s_fromfpxf128.c: Likewise.
    	* sysdeps/ieee754/float128/s_ufromfpxf128.c: Likewise.

diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index c7a35c1..8567da3 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -71,6 +71,8 @@ libm {
     fminmagf128;
     fmodf128;
     frexpf128;
+    fromfpf128;
+    fromfpxf128;
     getpayloadf128;
     hypotf128;
     ilogbf128;
@@ -116,6 +118,8 @@ libm {
     totalorderf128;
     totalordermagf128;
     truncf128;
+    ufromfpf128;
+    ufromfpxf128;
     y0f128;
     y1f128;
     ynf128;
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
index f84dc25..eb513d7 100644
--- a/sysdeps/ieee754/float128/float128_private.h
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -269,6 +269,8 @@ typedef __float128 _Float128;
 #define fmal fmaf128
 #define fmaxl fmaxf128
 #define fminl fminf128
+#define fromfpl fromfpf128
+#define fromfpxl fromfpxf128
 #define fpclassifyl fpclassifyf128
 #define frexpl frexpf128
 #define gammal_r_finite gammaf128_r_finite
@@ -304,6 +306,8 @@ typedef __float128 _Float128;
 #define totalorderl totalorderf128
 #define totalordermagl totalordermagf128
 #define truncl truncf128
+#define ufromfpl ufromfpf128
+#define ufromfpxl ufromfpxf128
 
 
 /* misc internal renames.  */
diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
new file mode 100644
index 0000000..891de3d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC fromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
new file mode 100644
index 0000000..0159ae2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC fromfpxl
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpf128.c b/sysdeps/ieee754/float128/s_ufromfpf128.c
new file mode 100644
index 0000000..0cd2281
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC ufromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpxf128.c b/sysdeps/ieee754/float128/s_ufromfpxf128.c
new file mode 100644
index 0000000..c0cd7e3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC ufromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=66b917ba81e89cfc39f6b9b7edf143166567c5ea

commit 66b917ba81e89cfc39f6b9b7edf143166567c5ea
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Mon Dec 26 10:54:55 2016 -0200

    float128: Add fmaxmagf128, fminmagf128 and roundevenf128
    
    2017-01-26  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
    
    	* sysdeps/ieee754/float128/float128_private.h: Add roundevenl as
    	roundevenf128.
    	* sysdeps/ieee754/float128/s_roundevenf128.c: New file.
    	* sysdeps/ieee754/float128/Versions: Add fmaxmagf128,
    	fminmagf128 and roundevenf128.

diff --git a/math/s_fmaxmag_template.c b/math/s_fmaxmag_template.c
index 6beef03..f7c8248 100644
--- a/math/s_fmaxmag_template.c
+++ b/math/s_fmaxmag_template.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 
 FLOAT
 M_DECL_FUNC (__fmaxmag) (FLOAT x, FLOAT y)
diff --git a/math/s_fminmag_template.c b/math/s_fminmag_template.c
index a1e4c2b..1054c38 100644
--- a/math/s_fminmag_template.c
+++ b/math/s_fminmag_template.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 
 FLOAT
 M_DECL_FUNC (__fminmag) (FLOAT x, FLOAT y)
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 179d4e6..c7a35c1 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -66,7 +66,9 @@ libm {
     floorf128;
     fmaf128;
     fmaxf128;
+    fmaxmagf128;
     fminf128;
+    fminmagf128;
     fmodf128;
     frexpf128;
     getpayloadf128;
@@ -98,6 +100,7 @@ libm {
     remainderf128;
     remquof128;
     rintf128;
+    roundevenf128;
     roundf128;
     scalblnf128;
     scalbnf128;
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
index e40cfe5..f84dc25 100644
--- a/sysdeps/ieee754/float128/float128_private.h
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -292,6 +292,7 @@ typedef __float128 _Float128;
 #define nextupl nextupf128
 #define remquol remquof128
 #define rintl rintf128
+#define roundevenl roundevenf128
 #define roundl roundf128
 #define scalbnl scalbnf128
 #define signbitl signbitf128
diff --git a/sysdeps/ieee754/float128/s_roundevenf128.c b/sysdeps/ieee754/float128/s_roundevenf128.c
new file mode 100644
index 0000000..5a9b3f3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundevenf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundevenl.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=399e6ed59df93547b41d6db2f53cca2d62c3bd29

commit 399e6ed59df93547b41d6db2f53cca2d62c3bd29
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Dec 2 11:59:35 2016 -0200

    float128: Add llogbf128

diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 1db4644..179d4e6 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -78,6 +78,7 @@ libm {
     ldexpf128;
     lgammaf128;
     lgammaf128_r;
+    llogbf128;
     llrintf128;
     llroundf128;
     log10f128;
diff --git a/sysdeps/ieee754/float128/w_llogbf128.c b/sysdeps/ieee754/float128/w_llogbf128.c
new file mode 100644
index 0000000..f83657d
--- /dev/null
+++ b/sysdeps/ieee754/float128/w_llogbf128.c
@@ -0,0 +1,3 @@
+#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#include <math-type-macros-float128.h>
+#include <w_llogb_template.c>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b6a51a87790fa2a2aa38809c25373b6c75e5c356

commit b6a51a87790fa2a2aa38809c25373b6c75e5c356
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Dec 2 11:21:57 2016 -0200

    float128: Add setpayloadsigf128

diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 2b841b7..1db4644 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -101,6 +101,7 @@ libm {
     scalblnf128;
     scalbnf128;
     setpayloadf128;
+    setpayloadsigf128;
     sincosf128;
     sinf128;
     sinhf128;
diff --git a/sysdeps/ieee754/float128/s_setpayloadsigf128.c b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
new file mode 100644
index 0000000..85b2c4a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 1
+#define FUNC setpayloadsigf128
+#include "../ldbl-128/s_setpayloadl_main.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=931f699c7f28142c0831c1219db209bd49442a66

commit 931f699c7f28142c0831c1219db209bd49442a66
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Dec 2 11:17:22 2016 -0200

    float128: Add setpayloadf128

diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 12b7374..2b841b7 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -100,6 +100,7 @@ libm {
     roundf128;
     scalblnf128;
     scalbnf128;
+    setpayloadf128;
     sincosf128;
     sinf128;
     sinhf128;
diff --git a/sysdeps/ieee754/float128/s_setpayloadf128.c b/sysdeps/ieee754/float128/s_setpayloadf128.c
new file mode 100644
index 0000000..63e046a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 0
+#define FUNC setpayloadf128
+#include "../ldbl-128/s_setpayloadl_main.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b9ae839e6269817af4f22794465057e491e93152

commit b9ae839e6269817af4f22794465057e491e93152
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Tue Nov 29 09:41:49 2016 -0200

    float128: Add iscanonicalf128

diff --git a/math/math.h b/math/math.h
index db3584c..53a6702 100644
--- a/math/math.h
+++ b/math/math.h
@@ -474,7 +474,11 @@ enum
 #endif /* Use ISO C99.  */
 
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
-# include <bits/iscanonical.h>
+# if __USE_FLOAT128
+#  include <bits/iscanonicalf128.h>
+# else
+#  include <bits/iscanonical.h>
+# endif
 
 /* Return nonzero value if X is a signaling NaN.  */
 # define issignaling(x) __MATH_TG ((x), __issignaling, (x))
diff --git a/sysdeps/ieee754/float128/bits/iscanonicalf128.h b/sysdeps/ieee754/float128/bits/iscanonicalf128.h
new file mode 100644
index 0000000..5c7f10c
--- /dev/null
+++ b/sysdeps/ieee754/float128/bits/iscanonicalf128.h
@@ -0,0 +1,19 @@
+/* Define iscanonicalf128 macro.
+   Copyright (C) 2016 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 iscanonical(x) ((void) (__typeof (x)) (x), 1)
diff --git a/sysdeps/ieee754/float128/s_canonicalizef128.c b/sysdeps/ieee754/float128/s_canonicalizef128.c
index 7c7a0bd..076d924 100644
--- a/sysdeps/ieee754/float128/s_canonicalizef128.c
+++ b/sysdeps/ieee754/float128/s_canonicalizef128.c
@@ -1,2 +1,3 @@
+#include <bits/iscanonicalf128.h>
 #include <math-type-macros-float128.h>
 #include <math/s_canonicalize_template.c>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=246d0da7330a54758c500ac7f73718fe9204219a

commit 246d0da7330a54758c500ac7f73718fe9204219a
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 24 10:31:02 2016 -0200

    float128: Add canonicalizef128

diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 91f4361..12b7374 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -29,6 +29,7 @@ libm {
     cabsf128;
     cacosf128;
     cacoshf128;
+    canonicalizef128;
     cargf128;
     casinf128;
     casinhf128;
diff --git a/sysdeps/ieee754/float128/s_canonicalizef128.c b/sysdeps/ieee754/float128/s_canonicalizef128.c
new file mode 100644
index 0000000..7c7a0bd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_canonicalizef128.c
@@ -0,0 +1,2 @@
+#include <math-type-macros-float128.h>
+#include <math/s_canonicalize_template.c>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cd8a01bd76340108c2d4c0fd7dc7ac47c3d3e8ba

commit cd8a01bd76340108c2d4c0fd7dc7ac47c3d3e8ba
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 24 10:29:26 2016 -0200

    float128: Add getpayloadf128

diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
index 7d012e8..e40cfe5 100644
--- a/sysdeps/ieee754/float128/float128_private.h
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -272,6 +272,7 @@ typedef __float128 _Float128;
 #define fpclassifyl fpclassifyf128
 #define frexpl frexpf128
 #define gammal_r_finite gammaf128_r_finite
+#define getpayloadl getpayloadf128
 #define isinfl isinff128
 #define isnanl isnanf128
 #define issignalingl issignalingf128
diff --git a/sysdeps/ieee754/float128/s_getpayloadf128.c b/sysdeps/ieee754/float128/s_getpayloadf128.c
new file mode 100644
index 0000000..2e2607a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_getpayloadf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_getpayloadl.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=741843c7033ce045dadd7d879d5ffd62377f37d0

commit 741843c7033ce045dadd7d879d5ffd62377f37d0
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 24 10:27:55 2016 -0200

    float128: Add totalorderf128 and totalordermagf128

diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
index 82f2f52..7d012e8 100644
--- a/sysdeps/ieee754/float128/float128_private.h
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -299,6 +299,8 @@ typedef __float128 _Float128;
 #define sqrtl sqrtf128
 #define tanhl tanhf128
 #define tanl tanf128
+#define totalorderl totalorderf128
+#define totalordermagl totalordermagf128
 #define truncl truncf128
 
 
diff --git a/sysdeps/ieee754/float128/s_totalorderf128.c b/sysdeps/ieee754/float128/s_totalorderf128.c
new file mode 100644
index 0000000..1b115d8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalorderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalorderl.c"
diff --git a/sysdeps/ieee754/float128/s_totalordermagf128.c b/sysdeps/ieee754/float128/s_totalordermagf128.c
new file mode 100644
index 0000000..e44c657
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalordermagf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalordermagl.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9a68b30e11e5527b7b8959a4a1acebf597b3fec2

commit 9a68b30e11e5527b7b8959a4a1acebf597b3fec2
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 24 10:26:26 2016 -0200

    float128: Add SNANF128 macro

diff --git a/math/math.h b/math/math.h
index bcf4488..db3584c 100644
--- a/math/math.h
+++ b/math/math.h
@@ -63,6 +63,9 @@ __BEGIN_DECLS
 #  define SNAN (__builtin_nans (""))
 #  define SNANL (__builtin_nansl (""))
 # endif
+# if __GNUC_PREREQ (6, 0) && __USE_FLOAT128
+#  define SNANF128 ((__float128) __builtin_nansq (""))
+# endif
 #endif
 
 /* Get __GLIBC_FLT_EVAL_METHOD.  */
diff --git a/math/test-float128.h b/math/test-float128.h
index 00e783e..ba87e9f 100644
--- a/math/test-float128.h
+++ b/math/test-float128.h
@@ -26,6 +26,7 @@
 #define TYPE_STR "float128"
 #define LITM(x) x ## f128
 #define FTOSTR strfromf128
+#define snan_value_MACRO SNANF128
 
 /* Fixup builtins and constants for older compilers.  */
 #include <features.h>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5b3b5b460efaa8270fd0f8c2ae46cf9c4267714e

commit 5b3b5b460efaa8270fd0f8c2ae46cf9c4267714e
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Wed Sep 7 10:55:28 2016 -0500

    float128: Add exp2f128.
    
    There is a common version used for long double.  This
    is a copy renamed for _Float128.
    
    	* sysdeps/ieee754/float128/e_exp2f128.c: New file.

diff --git a/sysdeps/ieee754/float128/e_exp2f128.c b/sysdeps/ieee754/float128/e_exp2f128.c
index adeda15..c33b953 100644
--- a/sysdeps/ieee754/float128/e_exp2f128.c
+++ b/sysdeps/ieee754/float128/e_exp2f128.c
@@ -1,2 +1,53 @@
+/* Compute 2^x.
+   Copyright (C) 2012-2016 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 <float128_private.h>
-#include <math/e_exp2l.c>
+
+_Float128
+__ieee754_exp2l (_Float128 x)
+{
+  if (__glibc_likely (isless (x, (_Float128) FLT128_MAX_EXP)))
+    {
+      if (__builtin_expect (isgreaterequal (x, (_Float128) (FLT128_MIN_EXP
+							    - FLT128_MANT_DIG
+							    - 1)), 1))
+	{
+	  int intx = (int) x;
+	  _Float128 fractx = x - intx;
+	  _Float128 result;
+	  if (fabsl (fractx) < FLT128_EPSILON / 4)
+	    result = __scalbnl (1 + fractx, intx);
+	  else
+	    result = __scalbnl (__ieee754_expl (M_LN2l * fractx), intx);
+	  math_check_force_underflow_nonneg (result);
+	  return result;
+	}
+      else
+	{
+	  /* Underflow or exact zero.  */
+	  if (isinf (x))
+	    return 0;
+	  else
+	    return FLT128_MIN * FLT128_MIN;
+	}
+    }
+  else
+    /* Infinity, NaN or overflow.  */
+    return FLT128_MAX * x;
+}
+strong_alias (__ieee754_exp2f128, __exp2f128_finite)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a350d0283a8cfcdf473748621895bb733a085020

commit a350d0283a8cfcdf473748621895bb733a085020
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Jul 15 14:29:51 2016 -0500

    float128: Add test-{float128,ifloat128,float128-finite}
    
    This adds test support for float128, and lays some
    groundwork for future _FloatN types.
    
    	* math/Makefile
    	(CFLAGS-test-float128.c): Add appropriate test flags.
    	(CFLAGS-test-float128-finite.c): Likewise
    	(CPPFLAGS-test-ifloat128.c): Likewise
    
    	* math/libm-test.inc (TEST_FLOATN): New macro to
    	control tests for _FloatN _FloatNx types.
    	(CFLOAT): New macro to compensate for older compilers
    	not supporting _Complex __float128.
    	(check_ulp): Use integer constants and let the compiler
    	handle the type conversions.
    	(significand_test): Disable for TEST_FLOATN.
    	(scalb_test): Likewise
    	(drem_test): Likewise
    	(nexttoward_test): Likewise
    	(gamma_test): Likewise
    	(pow10_test): Likewise
    	(check_complex): Use CFLOAT instead of __complex__ FLOAT.
    	(ulp): Use integers for trivial constants.
    
    	* math/test-float128-finite.c: New file.
    	* math/test-float128.c: New file.
    	* math/test-float128.h: New file.
    	* math/test-ifloat128.c: New file.
    	* math/test-math-floatn.h: New file.
    
    	* math/gen-libm-test.pl (all_floats): Add float128 variants.
    	(all_floats_pfx): Add float128 mapping.
    
    	* math/gen-libm-have-vector-test.sh: Add support for float128.

diff --git a/math/Makefile b/math/Makefile
index 91dd3fe..052ed98 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -275,6 +275,8 @@ CFLAGS-test-double.c = $(libm-test-no-inline-cflags)
 CFLAGS-test-double-finite.c = $(libm-test-finite-cflags)
 CFLAGS-test-ldouble.c = $(libm-test-no-inline-cflags)
 CFLAGS-test-ldouble-finite.c = $(libm-test-finite-cflags)
+CFLAGS-test-float128.c = $(libm-test-no-inline-cflags)
+CFLAGS-test-float128-finite.c = $(libm-test-finite-cflags)
 CFLAGS-test-tgmath.c = -fno-builtin
 # The following testcase uses very long lines (>3 million), so it may take a
 # while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and
@@ -290,6 +292,8 @@ CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES \
 			  $(libm-test-fast-math-cflags)
 CPPFLAGS-test-ildouble.c = -U__LIBC_INTERNAL_MATH_INLINES \
 			  $(libm-test-fast-math-cflags)
+CPPFLAGS-test-ifloat128.c = -U__LIBC_INTERNAL_MATH_INLINES \
+			  $(libm-test-fast-math-cflags)
 
 CFLAGS-test-signgam-finite.c = -ffinite-math-only
 CFLAGS-test-signgam-finite-c99.c = -ffinite-math-only -std=c99
diff --git a/math/gen-libm-have-vector-test.sh b/math/gen-libm-have-vector-test.sh
index fe2b381..d241e3a 100644
--- a/math/gen-libm-have-vector-test.sh
+++ b/math/gen-libm-have-vector-test.sh
@@ -37,16 +37,19 @@ for func in $(cat libm-test.inc | grep ALL_RM_TEST | grep -v define | grep -v RU
   print_defs ${func}
   print_defs ${func}f
   print_defs ${func}l
+  print_defs ${func}f128
 done
 
 for func in $(cat libm-test.inc | grep ALL_RM_TEST | grep RUN_TEST_LOOP_ff_f | sed -r "s/.*\(//; s/,.*//" ); do
   print_defs ${func} "_ff"
   print_defs ${func}f "_ff"
   print_defs ${func}l "_ff"
+  print_defs ${func}f128 "_ff"
 done
 
 for func in $(cat libm-test.inc | grep ALL_RM_TEST | grep RUN_TEST_LOOP_fFF_11 | sed -r "s/.*\(//; s/,.*//" ); do
   print_defs ${func} "_fFF"
   print_defs ${func}f "_fFF"
   print_defs ${func}l "_fFF"
+  print_defs ${func}f128 "_fFF"
 done
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index a58194d..7cc626a 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -45,13 +45,15 @@ use vars qw (%auto_tests);
 
 # all_floats is sorted and contains all recognised float types
 @all_floats = ('double', 'float', 'idouble',
-	       'ifloat', 'ildouble', 'ldouble');
+	       'ifloat', 'ildouble', 'ldouble',
+	       'ifloat128', 'float128');
 
 # all_floats_pfx maps C types to their C like prefix for macros.
 %all_floats_pfx =
   ( "double" => "DBL",
     "ldouble" => "LDBL",
     "float" => "FLT",
+    "float128" => "FLT128",
   );
 
 %beautify =
diff --git a/math/libm-test.inc b/math/libm-test.inc
index bde705c..403e09c 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -208,6 +208,14 @@
 # define QTYPE_STR TYPE_STR
 #endif
 
+#ifndef TEST_FLOATN
+# define TEST_FLOATN 0
+#endif
+
+#ifndef CFLOAT
+# define CFLOAT __complex__ FLOAT
+#endif
+
 /* Format specific test macros.  */
 #define TEST_COND_binary32 (MANT_DIG == 24	\
 			    && MIN_EXP == -125	\
@@ -804,11 +812,11 @@ ulp (FLOAT value)
 	/* Fall through...  */
       case FP_SUBNORMAL:
         /* The next closest subnormal value is a constant distance away.  */
-	ulp = FUNC(ldexp) (1.0, MIN_EXP - MANT_DIG);
+	ulp = FUNC(ldexp) (1, MIN_EXP - MANT_DIG);
 	break;
 
       case FP_NORMAL:
-	ulp = FUNC(ldexp) (1.0, FUNC(ilogb) (value) - MANT_DIG + 1);
+	ulp = FUNC(ldexp) (1, FUNC(ilogb) (value) - MANT_DIG + 1);
 	break;
 
       default:
@@ -944,8 +952,8 @@ check_float (const char *test_name, FLOAT computed, FLOAT expected,
 
 
 static void
-check_complex (const char *test_name, __complex__ FLOAT computed,
-	       __complex__ FLOAT expected,
+check_complex (const char *test_name, CFLOAT computed,
+	       CFLOAT expected,
 	       int exception)
 {
   FLOAT part_comp, part_exp;
@@ -7505,8 +7513,10 @@ exp10_test (void)
 static void
 pow10_test (void)
 {
+#if !TEST_FLOATN
   /* pow10 uses the same test data as exp10.  */
   ALL_RM_TEST (pow10, 0, exp10_test_data, RUN_TEST_LOOP_f_f, END);
+#endif
 }
 
 
@@ -33510,8 +33520,10 @@ lgamma_test (void)
 static void
 gamma_test (void)
 {
+#if !TEST_FLOATN
   /* gamma uses the same test data as lgamma.  */
   ALL_RM_TEST (gamma, 0, lgamma_test_data, RUN_TEST_LOOP_f_f1, END, signgam);
+#endif
 }
 
 
@@ -35286,6 +35298,7 @@ nextdown_test (void)
 }
 
 
+#if !TEST_FLOATN
 /* Note, the second argument is always typed as long double.  The j type
    argument to TEST_ indicates the literal should not be post-processed by
    gen-libm-test.pl.  */
@@ -35420,11 +35433,14 @@ static const struct test_fj_f_data nexttoward_test_data[] =
 # endif
 #endif
   };
+#endif
 
 static void
 nexttoward_test (void)
 {
+#if !TEST_FLOATN
   ALL_RM_TEST (nexttoward, 1, nexttoward_test_data, RUN_TEST_LOOP_fj_f, END);
+#endif
 }
 
 
@@ -35948,8 +35964,10 @@ remainder_test (void)
 static void
 drem_test (void)
 {
+#if !TEST_FLOATN
   /* drem uses the same test data as remainder.  */
   ALL_RM_TEST (drem, 1, remainder_test_data, RUN_TEST_LOOP_ff_f, END);
+#endif
 }
 
 
@@ -37038,6 +37056,7 @@ roundeven_test (void)
 }
 
 
+#if !TEST_FLOATN
 static const struct test_ff_f_data scalb_test_data[] =
   {
     /* Results in this case are unspecified by POSIX, so, for an
@@ -37165,11 +37184,14 @@ static const struct test_ff_f_data scalb_test_data[] =
     TEST_ff_f (scalb, 0.8L, 4, 12.8L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
     TEST_ff_f (scalb, -0.854375L, 5, -27.34L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
   };
+#endif
 
 static void
 scalb_test (void)
 {
+#if !TEST_FLOATN
   ALL_RM_TEST (scalb, 1, scalb_test_data, RUN_TEST_LOOP_ff_f, END);
+#endif
 }
 
 
@@ -52165,6 +52187,7 @@ yn_test (void)
 }
 
 
+#if !TEST_FLOATN
 static const struct test_f_f_data significand_test_data[] =
   {
     /* significand returns the mantissa of the exponential
@@ -52193,11 +52216,14 @@ static const struct test_f_f_data significand_test_data[] =
     TEST_f_f (significand, 8.0, 1.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
     TEST_f_f (significand, -8.0, -1.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
   };
+#endif
 
 static void
 significand_test (void)
 {
+#if !TEST_FLOATN
   ALL_RM_TEST (significand, 1, significand_test_data, RUN_TEST_LOOP_f_f, END);
+#endif
 }
 
 
@@ -52291,17 +52317,17 @@ check_ulp (void)
    FLOAT ulps, ulpx, value;
    int i;
    /* Check ulp of zero is a subnormal value...  */
-   ulps = ulp (0x0.0p0);
+   ulps = ulp (0);
    if (fpclassify (ulps) != FP_SUBNORMAL)
      {
        fprintf (stderr, "ulp (0x0.0p0) is not FP_SUBNORMAL!\n");
        exit (EXIT_FAILURE);
      }
    /* Check that the ulp of one is a normal value... */
-   ulps = ulp (1.0L);
+   ulps = ulp (1);
    if (fpclassify (ulps) != FP_NORMAL)
      {
-       fprintf (stderr, "ulp (1.0L) is not FP_NORMAL\n");
+       fprintf (stderr, "ulp (1.0) is not FP_NORMAL\n");
        exit (EXIT_FAILURE);
      }
 
@@ -52309,8 +52335,8 @@ check_ulp (void)
       We allow +/- 1 ulp around the represented value.  */
    value = FUNC(nextafter) (0, 1);
    ulps = ULPDIFF (value, 0);
-   ulpx = ulp (1.0L);
-   if (ulps < (1.0L - ulpx) || ulps > (1.0L + ulpx))
+   ulpx = ulp (1);
+   if (ulps < (1 - ulpx) || ulps > (1 + ulpx))
      {
        fprintf (stderr, "Value outside of 1 +/- 1ulp.\n");
        exit (EXIT_FAILURE);
@@ -52320,8 +52346,8 @@ check_ulp (void)
       We allow +/- 1 ulp around the represented value.  */
    value = FUNC(nextafter) (10, 20);
    ulps = ULPDIFF (value, 10);
-   ulpx = ulp (1.0L);
-   if (ulps < (1.0L - ulpx) || ulps > (1.0L + ulpx))
+   ulpx = ulp (1);
+   if (ulps < (1 - ulpx) || ulps > (1 + ulpx))
      {
        fprintf (stderr, "Value outside of 1 +/- 1ulp.\n");
        exit (EXIT_FAILURE);
@@ -52329,8 +52355,8 @@ check_ulp (void)
    /* This gives one more ulp.  */
    value = FUNC(nextafter) (value, 20);
    ulps = ULPDIFF (value, 10);
-   ulpx = ulp (2.0L);
-   if (ulps < (2.0L - ulpx) || ulps > (2.0L + ulpx))
+   ulpx = ulp (2);
+   if (ulps < (2 - ulpx) || ulps > (2 + ulpx))
      {
        fprintf (stderr, "Value outside of 2 +/- 1ulp.\n");
        exit (EXIT_FAILURE);
@@ -52339,8 +52365,8 @@ check_ulp (void)
    for (i = 2; i < 100; i++)
      value = FUNC(nextafter) (value, 20);
    ulps = ULPDIFF (value, 10);
-   ulpx = ulp (100.0L);
-   if (ulps < (100.0L - ulpx) || ulps > (100.0L + ulpx))
+   ulpx = ulp (100);
+   if (ulps < (100 - ulpx) || ulps > (100 + ulpx))
      {
        fprintf (stderr, "Value outside of 100 +/- 1ulp.\n");
        exit (EXIT_FAILURE);
diff --git a/math/test-float128-finite.c b/math/test-float128-finite.c
new file mode 100644
index 0000000..74fd991
--- /dev/null
+++ b/math/test-float128-finite.c
@@ -0,0 +1,27 @@
+/* _Float128 finite-math tests.
+
+   Copyright (C) 2016 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 "test-float128.h"
+#include "test-math-finite.h"
+#include "test-math-no-inline.h"
+#include "test-math-scalar.h"
+
+#define TEST_MSG "testing _Float128 (finite-math-only)\n"
+
+#include "libm-test.c"
diff --git a/math/test-float128.c b/math/test-float128.c
new file mode 100644
index 0000000..8e35028
--- /dev/null
+++ b/math/test-float128.c
@@ -0,0 +1,28 @@
+/* _Float128 no-inline tests.
+
+   Copyright (C) 2016 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 "test-float128.h"
+#include "test-math-no-finite.h"
+#include "test-math-no-inline.h"
+#include "test-math-errno.h"
+#include "test-math-scalar.h"
+
+#define TEST_MSG "testing _Float128 (without inline functions)\n"
+
+#include "libm-test.c"
diff --git a/math/test-float128.h b/math/test-float128.h
new file mode 100644
index 0000000..00e783e
--- /dev/null
+++ b/math/test-float128.h
@@ -0,0 +1,53 @@
+/* Common definitions for libm tests for _Float128.
+
+   Copyright (C) 2016 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 FUNC(function) function ## f128
+#define PRINTF_EXPR "e"
+#define PRINTF_XEXPR "a"
+#define PRINTF_NEXPR "f"
+#define BUILD_COMPLEX(real, imag) (CMPLXF128 ((real), (imag)))
+#define PREFIX FLT128
+#define TYPE_STR "float128"
+#define LITM(x) x ## f128
+#define FTOSTR strfromf128
+
+/* Fixup builtins and constants for older compilers.  */
+#include <features.h>
+#if !__GNUC_PREREQ (7, 0)
+# define __builtin_nanf128 __builtin_nanq
+# define __builtin_nansf128 __builtin_nansq
+# define __builtin_inff128 __builtin_infq
+# define LIT(x) (x ## Q)
+# define FLOAT __float128
+# define CFLOAT __CFLOAT128
+#else
+# define LIT(x) (x ## f128)
+# define FLOAT _Float128
+#endif
+
+#include "test-math-floatn.h"
+
+/* Similarly, finitef128 is not API */
+extern int __finitef128 (__float128);
+
+static inline int
+finitef128(__float128 f)
+{
+  return __finitef128 (f);
+}
diff --git a/math/test-ifloat128.c b/math/test-ifloat128.c
new file mode 100644
index 0000000..8194e6a
--- /dev/null
+++ b/math/test-ifloat128.c
@@ -0,0 +1,26 @@
+/* _Float128 inline math tests.
+
+   Copyright (C) 2016 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 "test-float128.h"
+#include "test-math-inline.h"
+#include "test-math-scalar.h"
+
+#define TEST_MSG "testing _Float128 (inline functions)\n"
+
+#include "libm-test.c"
diff --git a/math/test-math-floatn.h b/math/test-math-floatn.h
new file mode 100644
index 0000000..0ff460f
--- /dev/null
+++ b/math/test-math-floatn.h
@@ -0,0 +1,20 @@
+/* Common definitions for libm tests for TS 18661-3 derived types.
+   Copyright (C) 2016 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 TEST_FLOATN 1
+#define __STDC_WANT_IEC_60559_BFP_EXT__

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a3ff008abeedb812bef369ea2f3f64405ccba899

commit a3ff008abeedb812bef369ea2f3f64405ccba899
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Nov 14 14:36:18 2016 -0200

    float128: Add strfromf128, strtof128, and wcstof128 to the manual
    
    2016-11-14  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* manual/arith.texi: Add descriptions for strfromf128, strtof128,
    	and wcstof128.

diff --git a/manual/arith.texi b/manual/arith.texi
index dec12a0..09430fe 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -2990,15 +2990,28 @@ double} is a separate type).
 These functions have been GNU extensions and are new to @w{ISO C99}.
 @end deftypefun
 
+@comment stdlib.h
+@comment ISO/IEC TS-18661-3
+@deftypefun _Float128 strtof128 (const char *@var{string}, char **@var{tailptr})
+@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}}
+The @code{strtof128} function (``string-to-float128'') is like
+@code{strtod}, except that it returns a @code{_Float128} value.
+
+The @code{strtof128} function was introduced in @w{ISO/IEC TS 18661-3}.
+@end deftypefun
+
 @comment wchar.h
 @comment ISO
 @deftypefun double wcstod (const wchar_t *restrict @var{string}, wchar_t **restrict @var{tailptr})
-@comment stdlib.h
+@comment wchar.h
 @comment ISO
 @deftypefunx float wcstof (const wchar_t *@var{string}, wchar_t **@var{tailptr})
-@comment stdlib.h
+@comment wchar.h
 @comment ISO
 @deftypefunx {long double} wcstold (const wchar_t *@var{string}, wchar_t **@var{tailptr})
+@comment wchar.h
+@comment ISO/IEC TS-18661-3
+@deftypefun _Float128 strtof128 (const char *@var{string}, char **@var{tailptr})
 @safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}}
 The @code{wcstod}, @code{wcstof}, and @code{wcstol} functions are
 equivalent in nearly all aspect to the @code{strtod}, @code{strtof}, and
@@ -3006,7 +3019,8 @@ equivalent in nearly all aspect to the @code{strtod}, @code{strtof}, and
 
 The @code{wcstod} function was introduced in @w{Amendment 1} of @w{ISO
 C90}.  The @code{wcstof} and @code{wcstold} functions were introduced in
-@w{ISO C99}.
+@w{ISO C99}.  The @code{wcstof128} function was introduced in @w{ISO/IEC TS
+18661-3}.
 @end deftypefun
 
 @comment stdlib.h
@@ -3064,6 +3078,18 @@ has been completely written if and only if the returned value is less than
 These functions were introduced by ISO/IEC TS 18661-1.
 @end deftypefun
 
+@comment stdlib.h
+@comment ISO/IEC TS 18661-3
+@deftypefun int strfromf128 (char *restrict @var{string}, size_t @var{size}, const char *restrict @var{format}, _Float128 @var{value})
+@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
+@comment this function depends on __printf_fp and __printf_fphex, which are
+@comment AS-unsafe (ascuheap) and AC-unsafe (acsmem).
+The @code{strfromf128} function (``string-from-float128'') is like
+@code{strfromd}, except that @var{value} has floating type _Float128.
+
+The @code{strfromf128} function was introduced by ISO/IEC TS 18661-3.
+@end deftypefun
+
 @node System V Number Conversion
 @section Old-fashioned System V number-to-string functions
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1bd6178d41c6f54eb35883222fea6947fd29baf5

commit 1bd6178d41c6f54eb35883222fea6947fd29baf5
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Mon Jul 25 13:10:00 2016 -0500

    float128: Add strtof128, wcstof128, and related functions.
    
    This is relatively straighfoward with the exception of
    needing to update the power of ten tables used by the
    common implementation when long double is not the most
    expressive real type.
    
    The implementations are contained with sysdeps/ieee754/float128 as
    they are only built when _Float128 is enabled within libc/m.
    	* include/gmp.h (__mpn_construct_float128): New declaration.
    	* include/stdlib.h (__strtof128_l): Likewise.
    	(__strtof128_nan): Likewise.
    	(__wcstof128_nan): Likewise.
    	(__strtof128_internal): Likewise.
    	(____strtof128_l_internal): Likewise.
    	* include/wchar.h (__wcstof128_l): Likewise.
    	(__wcstof128_internal): Likewise.
    
    	* stdlib/Makefile (bug-strtod2): Link libm too.
    
    	* stdlib/fpioconst.c (HAVE_EXTENDED_RANGE): New macro
    	for testing how big the power of ten table should be.
    	[TENS_P11_IDX]: Include if above is true.
    	[TENS_P12_IDX]: Include if above is true.
    	[TENS_P13_IDX]: Include if above is true.
    	[TENS_P14_IDX]: Include if above is true.
    	* stdlib/fpioconst.h (FPIOCONST_POW10_ARRAY_SIZE):
    	Use larger table if _Float128 is supported.
    
    	* stdlib/stdlib.h (strtof128): New declaration.
    	(strtof128_l): Likewise.
    
    	* stdlib/tst-strtod-nan-locale-main.c: Updated
    	to use tst-strtod.h macros to ensure float128
    	gets tested too.
    
    	* stdlib/tst-strtod-round-skeleton.c (CHOOSE_f128):
    	New macro.
    
    	* stdlib/tst-strtod.h (_GEN_F128): New macro.
    	(_GEN): Likewise.
    	(_GENx): Likewise.
    	(_DO): Likewise.
    	(_DOx): Likewise.
    	(GEN_TEST_STRTOD): Update to optionally include
    	_Float128 in the tests.
    	(STRTOD_TEST_FOREACH): Likewise.
    
    	* sysdeps/ieee754/float128/Makefile: Insert
    	new strtof128 and wcstof128 functions into
    	libc.
    
    	* sysdeps/ieee754/float128/Versions: Add
    	exports for the above new functions.
    
    	* sysdeps/ieee754/float128/mpn2float128.c: New file.
    	* sysdeps/ieee754/float128/strtod_nan_float128.h:
    	New file.
    	* sysdeps/ieee754/float128/strtof128.c: New file.
    	* sysdeps/ieee754/float128/strtof128_l.c: New file.
    	* sysdeps/ieee754/float128/strtof128_nan.c: New file.
    	* sysdeps/ieee754/float128/wcstof128.c: New file.
    	* sysdeps/ieee754/float128/wcstof128_l.c: New file.
    	* sysdeps/ieee754/float128/wcstof128_nan.c: New fike.
    	* wcsmbs/Makefile: (CFLAGS-wcstof128.c): Append
    	strtof-CFLAGS.
    	(CFLAGS-wcstof128_l): Likewise.
    
    	* wcsmbs/wchar.h (wcstof128): New declaration.
    	(wcstof128_l): Likewise.

diff --git a/NEWS b/NEWS
index 20b9275..c195cc1 100644
--- a/NEWS
+++ b/NEWS
@@ -108,6 +108,10 @@ Version 2.25
 * The function strfromf128, from ISO/IEC TS 18661-3:2014, is added to libc.  It
   converts a _Float128 value into string.
 
+* The functions strtof128, from ISO/IEC TS 18661-3:2014, is added to libc.  It
+  converts a string into a floating-point number of _Float128 type.  Its wide
+  character counterpart, wsctof128, is added as a GNU extension.
+
 * Most of glibc can now be built with the stack smashing protector enabled.
   It is recommended to build glibc with --enable-stack-protector=strong.
   Implemented by Nick Alcock (Oracle).
diff --git a/include/gmp.h b/include/gmp.h
index 0f0060c..3082e5d 100644
--- a/include/gmp.h
+++ b/include/gmp.h
@@ -6,6 +6,8 @@
 
 #include <stdlib/gmp.h>
 
+#include <bits/floatn.h>
+
 /* Now define the internal interfaces.  */
 extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,
 				       int *expt, int *is_neg,
@@ -29,5 +31,9 @@ extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,
 extern long double __mpn_construct_long_double (mp_srcptr frac_ptr, int expt,
 						int sign);
 
+#if __USE_FLOAT128
+extern _Float128 __mpn_construct_float128 (mp_srcptr frac_ptr, int expt,
+					   int sign);
+#endif
 
 #endif
diff --git a/include/stdlib.h b/include/stdlib.h
index 352339e..f76e51b 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -221,6 +221,35 @@ libc_hidden_proto (__wcstof_nan)
 libc_hidden_proto (__wcstod_nan)
 libc_hidden_proto (__wcstold_nan)
 
+/* Enable _FloatN bits as needed.  */
+#include <bits/floatn.h>
+
+#if __USE_FLOAT128
+extern __typeof (strtof128_l) __strtof128_l;
+
+libc_hidden_proto (__strtof128_l)
+libc_hidden_proto (strtof128)
+
+extern _Float128 __strtof128_nan (const char *, char **, char)
+     internal_function;
+extern _Float128 __wcstof128_nan (const wchar_t *, wchar_t **, wchar_t)
+     internal_function;
+
+libc_hidden_proto (__strtof128_nan)
+libc_hidden_proto (__wcstof128_nan)
+
+extern _Float128 __strtof128_internal (const char *__restrict __nptr,
+				       char **__restrict __endptr,
+				       int __group);
+libc_hidden_proto (__strtof128_internal)
+
+extern _Float128 ____strtof128_l_internal (const char *__restrict __nptr,
+					   char **__restrict __endptr,
+					   int __group, __locale_t __loc);
+
+libc_hidden_proto (____strtof128_l_internal)
+#endif
+
 extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt,
 		     int *__restrict __sign);
 extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
diff --git a/include/wchar.h b/include/wchar.h
index 6272130..177f2e2 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -4,6 +4,8 @@
 # ifndef _ISOMAC
 # ifdef _WCHAR_H
 
+#include <bits/floatn.h>
+
 extern __typeof (wcscasecmp_l) __wcscasecmp_l;
 extern __typeof (wcsncasecmp_l) __wcsncasecmp_l;
 extern __typeof (wcscoll_l) __wcscoll_l;
@@ -70,6 +72,17 @@ libc_hidden_proto (wcstoll)
 libc_hidden_proto (wcstoul)
 libc_hidden_proto (wcstoull)
 
+#if __USE_FLOAT128
+extern __typeof (wcstof128_l) __wcstof128_l;
+libc_hidden_proto (__wcstof128_l)
+extern _Float128 __wcstof128_internal (const wchar_t *__restrict __nptr,
+				       wchar_t **__restrict __endptr,
+				       int __group) __THROW;
+
+libc_hidden_proto (__wcstof128_internal)
+libc_hidden_proto (wcstof128)
+#endif
+
 libc_hidden_proto (__wcscasecmp_l)
 libc_hidden_proto (__wcsncasecmp_l)
 
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5751b5d..d5d0c35 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -194,6 +194,7 @@ $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 libof-tst-putenvmod = extramodules
 
 $(objpfx)bug-getcontext: $(libm)
+$(objpfx)bug-strtod2: $(libm)
 $(objpfx)tst-strtod-round: $(libm)
 $(objpfx)tst-tininess: $(libm)
 $(objpfx)tst-strtod-underflow: $(libm)
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 70a4830..1685003 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -54,6 +54,9 @@ __BEGIN_DECLS
 # endif
 #endif	/* X/Open or XPG7 and <sys/wait.h> not included.  */
 
+/* _FloatN API tests for enablement.  */
+#include <bits/floatn.h>
+
 __BEGIN_NAMESPACE_STD
 /* Returned by `div'.  */
 typedef struct
@@ -140,6 +143,15 @@ extern long double strtold (const char *__restrict __nptr,
 __END_NAMESPACE_C99
 #endif
 
+#if __USE_FLOAT128
+__BEGIN_NAMESPACE_STD
+/* Likewise for the '_Float128' format  */
+extern _Float128 strtof128 (const char *__restrict __nptr,
+		      char **__restrict __endptr)
+     __THROW __nonnull ((1));
+__END_NAMESPACE_STD
+#endif
+
 __BEGIN_NAMESPACE_STD
 /* Convert a string to a long integer.  */
 extern long int strtol (const char *__restrict __nptr,
@@ -251,6 +263,14 @@ extern long double strtold_l (const char *__restrict __nptr,
 			      char **__restrict __endptr,
 			      __locale_t __loc)
      __THROW __nonnull ((1, 3));
+
+#if __USE_FLOAT128
+extern _Float128 strtof128_l (const char *__restrict __nptr,
+			      char **__restrict __endptr,
+			      __locale_t __loc)
+     __THROW __nonnull ((1, 3));
+#endif
+
 #endif /* GNU */
 
 
diff --git a/stdlib/tst-strtod-nan-locale-main.c b/stdlib/tst-strtod-nan-locale-main.c
index 8044dad..8222174 100644
--- a/stdlib/tst-strtod-nan-locale-main.c
+++ b/stdlib/tst-strtod-nan-locale-main.c
@@ -23,6 +23,8 @@
 #include <stdlib.h>
 #include <wchar.h>
 
+#include <stdlib/tst-strtod.h>
+
 #define STR_(X) #X
 #define STR(X) STR_(X)
 #define FNPFXS STR (FNPFX)
@@ -30,20 +32,22 @@
 #define CONCAT(X, Y) CONCAT_ (X, Y)
 #define FNX(FN) CONCAT (FNPFX, FN)
 
-#define TEST(LOC, STR, FN, TYPE)					\
-  do									\
+#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, LSUF, CSUF)			\
+static int								\
+test_strto ## FSUF (const char * loc, CHAR * s)				\
+{									\
+  CHAR *ep;								\
+  FTYPE val = FNX (FSUF) (s, &ep);					\
+  if (isnan (val) && *ep == 0)						\
+    printf ("PASS: %s: " FNPFXS #FSUF " (" SFMT ")\n", loc, s);		\
+  else									\
     {									\
-      CHAR *ep;								\
-      TYPE val = FNX (FN) (STR, &ep);					\
-      if (isnan (val) && *ep == 0)					\
-	printf ("PASS: %s: " FNPFXS #FN " (" SFMT ")\n", LOC, STR);	\
-      else								\
-	{								\
-	  printf ("FAIL: %s: " FNPFXS #FN " (" SFMT ")\n", LOC, STR);	\
-	  result = 1;							\
-	}								\
+      printf ("FAIL: %s: " FNPFXS #FSUF " (" SFMT ")\n", loc, s);	\
+      return 1;							        \
     }									\
-  while (0)
+  return 0;								\
+}
+GEN_TEST_STRTOD_FOREACH (TEST_STRTOD)
 
 static int
 test_one_locale (const char *loc)
@@ -64,13 +68,9 @@ test_one_locale (const char *loc)
       s[4] = L_('A') + i - 10;
       s[5] = L_(')');
       s[6] = 0;
-      TEST (loc, s, f, float);
-      TEST (loc, s, d, double);
-      TEST (loc, s, ld, long double);
+      result |= STRTOD_TEST_FOREACH (test_strto, loc, s);
       s[4] = L_('a') + i - 10;
-      TEST (loc, s, f, float);
-      TEST (loc, s, d, double);
-      TEST (loc, s, ld, long double);
+      result |= STRTOD_TEST_FOREACH (test_strto, loc, s);
     }
   return result;
 }
diff --git a/stdlib/tst-strtod-round-skeleton.c b/stdlib/tst-strtod-round-skeleton.c
index 73603e6..1a9f663 100644
--- a/stdlib/tst-strtod-round-skeleton.c
+++ b/stdlib/tst-strtod-round-skeleton.c
@@ -93,6 +93,7 @@
 /* Add type specific choosing macros below.  */
 #define CHOOSE_f(f,...) f
 #define CHOOSE_d(f,d,...) d
+#define CHOOSE_f128(f,d,ld64i,ld64m,ld106,ld113,...) ld113
 /* long double is special, and handled above.  */
 
 /* Selector for expected result field of a given type.  */
diff --git a/stdlib/tst-strtod.h b/stdlib/tst-strtod.h
index bf5f901..12b33f4 100644
--- a/stdlib/tst-strtod.h
+++ b/stdlib/tst-strtod.h
@@ -21,11 +21,34 @@
 
 #define FSTRLENMAX 128
 
+#include <bits/floatn.h>
+
+#if !__GNUC_PREREQ(7,0)
+# define F128 Q
+#endif
+
+#if __USE_FLOAT128
+# define _GEN_f128(mfunc, ...) mfunc (__VA_ARGS__)
+# define _DO_f128(mfunc,...) (mfunc ## f128) (__VA_ARGS__)
+# ifndef CHAR
+#  define CHAR char
+# endif
+#else
+# define _GEN_f128(...)
+# define _DO_f128(...) 0
+#endif
+
+#define _GEN(mfunc, type, ...) _GENx(_GEN_ ## type, mfunc, type, __VA_ARGS__)
+#define _GENx(mmfunc, mfunc, type, ...) mmfunc (mfunc, type, __VA_ARGS__)
+#define _DO(mfunc, type, ...) _DOx(_DO_ ## type, mfunc, ##__VA_ARGS__)
+#define _DOx(mmfunc, mfunc, ...) mmfunc (mfunc, ##__VA_ARGS__)
+
 /* Splat n variants of the same test for the various strtod functions.  */
 #define GEN_TEST_STRTOD_FOREACH(mfunc, ...)			 \
     mfunc (  f,       float, strfromf, f, f, ##__VA_ARGS__)	 \
     mfunc (  d,      double, strfromd,  ,  , ##__VA_ARGS__)	 \
-    mfunc ( ld, long double, strfroml, L, l, ##__VA_ARGS__)
+    mfunc ( ld, long double, strfroml, L, l, ##__VA_ARGS__)	 \
+    _GEN ( mfunc,  f128, _Float128,   strfromf128, F128, f128, ##__VA_ARGS__)
 /* The arguments to the generated macros are:
    FSUF - Function suffix
    FTYPE - float type
@@ -36,13 +59,14 @@
 
 
 
-#define STRTOD_TEST_FOREACH(mfunc, ...)	  \
-({					  \
-   int result = 0;			  \
-   result |= mfunc ## f  (__VA_ARGS__);   \
-   result |= mfunc ## d  (__VA_ARGS__);   \
-   result |= mfunc ## ld (__VA_ARGS__);   \
-   result;				  \
+#define STRTOD_TEST_FOREACH(mfunc, ...)		\
+({						\
+   int result = 0;				\
+   result |= mfunc ## f  (__VA_ARGS__);		\
+   result |= mfunc ## d  (__VA_ARGS__);		\
+   result |= mfunc ## ld (__VA_ARGS__);		\
+   result |= _DO (mfunc, f128, ##__VA_ARGS__);	\
+   result;					\
 })
 
 
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
index c07586c..166e630 100644
--- a/sysdeps/ieee754/float128/Makefile
+++ b/sysdeps/ieee754/float128/Makefile
@@ -1,3 +1,8 @@
 ifeq ($(subdir),stdlib)
 routines += float1282mpn strfromf128
+routines += strtof128 strtof128_l strtof128_nan mpn2float128
+endif
+
+ifeq ($(subdir),wcsmbs)
+routines += wcstof128_l wcstof128 wcstof128_nan
 endif
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index f32eb8d..91f4361 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -5,6 +5,16 @@
 libc {
   FLOAT128_VERSION {
     strfromf128;
+    strtof128;
+    strtof128_l;
+    __strtof128_internal;
+    wcstof128;
+    wcstof128_l;
+    __wcstof128_internal;
+  }
+  GLIBC_PRIVATE {
+    # For __nanf128.
+    __strtof128_nan;
   }
 }
 libm {
diff --git a/sysdeps/ieee754/float128/mpn2float128.c b/sysdeps/ieee754/float128/mpn2float128.c
new file mode 100644
index 0000000..0a682dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/mpn2float128.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2016 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 "gmp.h"
+#include "gmp-impl.h"
+#include <float.h>
+#include <math.h>
+
+#include "ieee754_float128.h"
+
+/* Convert a multi-precision integer of the needed number of bits (113 for
+   binary128) and an integral power of two to a `__float128' in IEEE854
+   quad-precision format.  */
+
+_Float128
+__mpn_construct_float128 (mp_srcptr frac_ptr, int expt, int sign)
+{
+  union ieee854_float128 u;
+
+  u.ieee.negative = sign;
+  u.ieee.exponent = expt + IEEE854_FLOAT128_BIAS;
+#if BITS_PER_MP_LIMB == 32
+  u.ieee.mantissa3 = frac_ptr[0];
+  u.ieee.mantissa2 = frac_ptr[1];
+  u.ieee.mantissa1 = frac_ptr[2];
+  u.ieee.mantissa0 = frac_ptr[3] & (((mp_limb_t) 1
+				     << (FLT128_MANT_DIG - 96)) - 1);
+#elif BITS_PER_MP_LIMB == 64
+  u.ieee.mantissa3 = frac_ptr[0] & (((mp_limb_t) 1 << 32) - 1);
+  u.ieee.mantissa2 = frac_ptr[0] >> 32;
+  u.ieee.mantissa1 = frac_ptr[1] & (((mp_limb_t) 1 << 32) - 1);
+  u.ieee.mantissa0 = (frac_ptr[1] >> 32) & (((mp_limb_t) 1
+					     << (FLT128_MANT_DIG - 96)) - 1);
+#else
+  #error "mp_limb size " BITS_PER_MP_LIMB "not accounted for"
+#endif
+
+  return u.d;
+}
diff --git a/sysdeps/ieee754/float128/strtod_nan_float128.h b/sysdeps/ieee754/float128/strtod_nan_float128.h
new file mode 100644
index 0000000..6bcbe9a
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtod_nan_float128.h
@@ -0,0 +1,33 @@
+/* Convert string for NaN payload to corresponding NaN.  For _Float128.
+   Copyright (C) 2016 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 FLOAT		_Float128
+#define SET_MANTISSA(flt, mant)				\
+  do							\
+    {							\
+      union ieee854_float128 u;				\
+      u.d = (flt);					\
+      u.ieee_nan.mantissa0 = 0;				\
+      u.ieee_nan.mantissa1 = 0;				\
+      u.ieee_nan.mantissa2 = (mant) >> 32;		\
+      u.ieee_nan.mantissa3 = (mant);			\
+      if ((u.ieee.mantissa0 | u.ieee.mantissa1		\
+	   | u.ieee.mantissa2 | u.ieee.mantissa3) != 0)	\
+	(flt) = u.d;					\
+    }							\
+  while (0)
diff --git a/sysdeps/ieee754/float128/strtof128.c b/sysdeps/ieee754/float128/strtof128.c
new file mode 100644
index 0000000..97c29ee
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128.c
@@ -0,0 +1,34 @@
+/* strtof128 wrapper of strtof128_l.
+   Copyright (C) 2016 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 actual implementation for all floating point sizes is in strtod.c.
+   These macros tell it to produce the `_Float128' version, `strtof128'.  */
+
+#define FLOAT		_Float128
+#define FLT		FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF		wcstof128
+# define STRTOF_L	__wcstof128_l
+#else
+# define STRTOF		strtof128
+# define STRTOF_L	__strtof128_l
+#endif
+
+#include <float128_private.h>
+
+#include <stdlib/strtod.c>
diff --git a/sysdeps/ieee754/float128/strtof128_l.c b/sysdeps/ieee754/float128/strtof128_l.c
new file mode 100644
index 0000000..d3fe864
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_l.c
@@ -0,0 +1,43 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+   Copyright (C) 2016 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 <xlocale.h>
+
+/* Bring in potential typedef for _Float128 early for declaration below.  */
+#include <bits/floatn.h>
+
+extern _Float128 ____strtof128_l_internal (const char *, char **,
+					   int, __locale_t);
+
+#define	FLOAT		_Float128
+#define	FLT		FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF		wcstof128_l
+# define __STRTOF	__wcstof128_l
+# define STRTOF_NAN	__wcstof128_nan
+#else
+# define STRTOF		strtof128_l
+# define __STRTOF	__strtof128_l
+# define STRTOF_NAN	__strtof128_nan
+#endif
+#define	MPN2FLOAT	__mpn_construct_float128
+#define	FLOAT_HUGE_VAL	HUGE_VAL_F128
+
+#include <float128_private.h>
+
+#include <stdlib/strtod_l.c>
diff --git a/sysdeps/ieee754/float128/strtof128_nan.c b/sysdeps/ieee754/float128/strtof128_nan.c
new file mode 100644
index 0000000..db8864c
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_nan.c
@@ -0,0 +1,28 @@
+/* Convert string for NaN payload to corresponding NaN.  Narrow
+   strings, __float128.
+   Copyright (C) 2016 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 <math.h>
+
+#include <float128_private.h>
+
+#include <strtod_nan_narrow.h>
+#include <strtod_nan_float128.h>
+
+#define STRTOD_NAN __strtof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/sysdeps/ieee754/float128/wcstof128.c b/sysdeps/ieee754/float128/wcstof128.c
new file mode 100644
index 0000000..1cda6d3
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2016 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 <stddef.h>
+#include <xlocale.h>
+
+#define	USE_WIDE_CHAR	1
+
+/* Bring in _Float128 typedef if needed.  */
+#include <bits/floatn.h>
+
+extern _Float128 ____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
+					   __locale_t);
+
+#include "strtof128.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_l.c b/sysdeps/ieee754/float128/wcstof128_l.c
new file mode 100644
index 0000000..a7defce
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_l.c
@@ -0,0 +1,30 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 2016 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 <stddef.h>
+#include <xlocale.h>
+
+
+#define	USE_WIDE_CHAR	1
+
+#include <bits/floatn.h>
+
+extern _Float128 ____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
+					   __locale_t);
+
+#include "strtof128_l.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_nan.c b/sysdeps/ieee754/float128/wcstof128_nan.c
new file mode 100644
index 0000000..eb138e1
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_nan.c
@@ -0,0 +1,23 @@
+/* Convert string for NaN payload to corresponding NaN.  Wide strings, _Float128.
+   Copyright (C) 2016 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 <stdlib/strtod_nan_wide.h>
+#include <float128_private.h>
+#include <strtod_nan_float128.h>
+#define STRTOD_NAN __wcstof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index d6b214b..84cf986 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -81,6 +81,7 @@ CFLAGS-wcstoll.c = $(strtox-CFLAGS)
 CFLAGS-wcstoull.c = $(strtox-CFLAGS)
 CFLAGS-wcstod.c = $(strtox-CFLAGS)
 CFLAGS-wcstold.c = $(strtox-CFLAGS)
+CFLAGS-wcstof128.c = $(strtox-CFLAGS)
 CFLAGS-wcstof.c = $(strtox-CFLAGS)
 CFLAGS-wcstol_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstoul_l.c = $(strtox-CFLAGS)
@@ -88,6 +89,7 @@ CFLAGS-wcstoll_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstoull_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstod_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstof128_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
 CPPFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
 
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index de7ef8b..46232a0 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -511,6 +511,15 @@ __extension__
 extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr,
 				       wchar_t **__restrict __endptr,
 				       int __base) __THROW;
+
+/* Include _Float128 variants of strtof128 if available.  */
+#include <bits/floatn.h>
+
+#if __USE_FLOAT128
+extern _Float128 wcstof128 (const wchar_t *__restrict __nptr,
+			    wchar_t **__restrict __endptr) __THROW;
+#endif
+
 #endif /* Use GNU.  */
 
 #ifdef __USE_GNU
@@ -561,6 +570,13 @@ extern float wcstof_l (const wchar_t *__restrict __nptr,
 extern long double wcstold_l (const wchar_t *__restrict __nptr,
 			      wchar_t **__restrict __endptr,
 			      __locale_t __loc) __THROW;
+
+#if __USE_FLOAT128
+extern _Float128 wcstof128_l (const wchar_t *__restrict __nptr,
+			      wchar_t **__restrict __endptr,
+			      __locale_t __loc) __THROW;
+#endif
+
 #endif	/* use GNU */
 
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=56dcd410fa88c8df8ed8bcf5679846890902692e

commit 56dcd410fa88c8df8ed8bcf5679846890902692e
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 3 12:37:08 2016 -0200

    float128: Add strfromf128
    
    Add strfromf128 to stdlib when __float128 support is enabled.
    
    2016-11-07  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* stdio-common/printf-parsemb.c (__parse_one_specmb): Initialize
    	spec->info.is___float128 to zero.
    	* stdio-common/printf.h (printf_info): Add new member is__float128
    	to indicate that the number being converted to string, if any, is
    	in the __float128 format.
    	* stdio-common/printf_fp.c (__printf_fp_l): Add code to deal with
    	__float128 numbers.
    	* stdio-common/printf_fphex.c (__printf_fphex): Likewise.
    	* stdio-common/printf_size.c (__printf_size): Likewise.
    	* stdio-common/vfprintf.c (process_arg): Initialize member
    	info.is___float128 to zero.
    	* stdlib/fpioconst.h (FLT128_MAX_10_EXP_LOG): New definition.
    	* stdlib/stdlib.h (strfromf128): New declaration.
    	* stdlib/strfrom-skeleton.c (STRFROM): Set member info.is__float128
    	to one.
    	* sysdeps/ieee754/float128/Makefile: Add strfromf128.
    	* sysdeps/ieee754/float128/Versions: Likewise.
    	* sysdeps/ieee754/float128/strfromf128.c: New file.

diff --git a/NEWS b/NEWS
index b5a401c..20b9275 100644
--- a/NEWS
+++ b/NEWS
@@ -105,6 +105,9 @@ Version 2.25
 * The functions strfromd, strfromf, and strfroml, from ISO/IEC TS 18661-1:2014,
   are added to libc.  They convert a floating-point number into string.
 
+* The function strfromf128, from ISO/IEC TS 18661-3:2014, is added to libc.  It
+  converts a _Float128 value into string.
+
 * Most of glibc can now be built with the stack smashing protector enabled.
   It is recommended to build glibc with --enable-stack-protector=strong.
   Implemented by Nick Alcock (Oracle).
diff --git a/stdio-common/printf-parsemb.c b/stdio-common/printf-parsemb.c
index edb066e..faa1a9d 100644
--- a/stdio-common/printf-parsemb.c
+++ b/stdio-common/printf-parsemb.c
@@ -79,6 +79,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
   spec->info.extra = 0;
   spec->info.pad = ' ';
   spec->info.wide = sizeof (UCHAR_T) > 1;
+  spec->info.is___float128 = 0;
 
   /* Test for positional argument.  */
   if (ISDIGIT (*format))
diff --git a/stdio-common/printf.h b/stdio-common/printf.h
index bf5ccd4..1b80bdf 100644
--- a/stdio-common/printf.h
+++ b/stdio-common/printf.h
@@ -47,7 +47,8 @@ struct printf_info
   unsigned int is_char:1;	/* hh flag.  */
   unsigned int wide:1;		/* Nonzero for wide character streams.  */
   unsigned int i18n:1;		/* I flag.  */
-  unsigned int __pad:4;		/* Unused so far.  */
+  unsigned int is___float128:1;	/* Floating-point argument is __float128.  */
+  unsigned int __pad:3;		/* Unused so far.  */
   unsigned short int user;	/* Bits for user-installed modifiers.  */
   wchar_t pad;			/* Padding character.  */
 };
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index 7845d96..505a0b2 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -218,6 +218,9 @@ __printf_fp_l (FILE *fp, locale_t loc,
     {
       double dbl;
       __long_double_t ldbl;
+#if __USE_FLOAT128
+      __float128 f128;
+#endif
     }
   fpnum;
 
@@ -328,6 +331,55 @@ __printf_fp_l (FILE *fp, locale_t loc,
     grouping = NULL;
 
   /* Fetch the argument value.	*/
+#if __USE_FLOAT128
+# if ! __HAVE_FLOAT128
+#  error "Runtime support for __float128 not available"
+# endif
+  if (info->is___float128)
+    {
+      fpnum.f128 = *(const __float128 *) args[0];
+
+      /* Check for special values: not a number or infinity.  */
+      if (isnan (fpnum.f128))
+	{
+	  is_neg = __signbitf128 (fpnum.f128);
+	  if (isupper (info->spec))
+	    {
+	      special = "NAN";
+	      wspecial = L"NAN";
+	    }
+	    else
+	      {
+		special = "nan";
+		wspecial = L"nan";
+	      }
+	}
+      else if (isinf (fpnum.f128))
+	{
+	  is_neg = __signbitf128 (fpnum.f128);
+	  if (isupper (info->spec))
+	    {
+	      special = "INF";
+	      wspecial = L"INF";
+	    }
+	  else
+	    {
+	      special = "inf";
+	      wspecial = L"inf";
+	    }
+	}
+      else
+	{
+	  p.fracsize = __mpn_extract_float128 (fp_input,
+					       (sizeof (fp_input) /
+						sizeof (fp_input[0])),
+					       &p.exponent, &is_neg,
+					       fpnum.f128);
+	  to_shift = 1 + p.fracsize * BITS_PER_MP_LIMB - FLT128_MANT_DIG;
+	}
+    }
+  else
+#endif /* USE_FLOAT128 */
 #ifndef __NO_LONG_DOUBLE_MATH
   if (info->is_long_double && sizeof (long double) > sizeof (double))
     {
@@ -499,6 +551,27 @@ __printf_fp_l (FILE *fp, locale_t loc,
 	    {
 	      if (p.scalesize == 0)
 		{
+#if __HAVE_FLOAT128
+		  if ((FLT128_MANT_DIG
+			    > _FPIO_CONST_OFFSET * BITS_PER_MP_LIMB)
+			   && info->is___float128)
+		    {
+#define _FLT128_FPIO_CONST_SHIFT \
+  (((FLT128_MANT_DIG + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB) \
+   - _FPIO_CONST_OFFSET)
+		      /* 64bit const offset is not enough for
+			 IEEE 854 quad long double (__float128).  */
+		      p.tmpsize = powers->arraysize + _FLT128_FPIO_CONST_SHIFT;
+		      memcpy (p.tmp + _FLT128_FPIO_CONST_SHIFT,
+			      &__tens[powers->arrayoff],
+			      p.tmpsize * sizeof (mp_limb_t));
+		      MPN_ZERO (p.tmp, _FLT128_FPIO_CONST_SHIFT);
+		      /* Adjust p.exponent, as scaleexpo will be this much
+			 bigger too.  */
+		      p.exponent += _FLT128_FPIO_CONST_SHIFT * BITS_PER_MP_LIMB;
+		    }
+		  else
+#endif /* HAVE_FLOAT128 */
 #ifndef __NO_LONG_DOUBLE_MATH
 		  if (LDBL_MANT_DIG > _FPIO_CONST_OFFSET * BITS_PER_MP_LIMB
 		      && info->is_long_double)
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index b207e00..cdc3264 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -31,6 +31,10 @@
 #include <stdbool.h>
 #include <rounding-mode.h>
 
+#if __HAVE_FLOAT128
+# include "ieee754_float128.h"
+#endif
+
 /* #define NDEBUG 1*/		/* Undefine this for debugging assertions.  */
 #include <assert.h>
 
@@ -94,6 +98,9 @@ __printf_fphex (FILE *fp,
     {
       union ieee754_double dbl;
       long double ldbl;
+#if __USE_FLOAT128
+      __float128 flt128;
+#endif
     }
   fpnum;
 
@@ -159,6 +166,48 @@ __printf_fphex (FILE *fp,
 
 
   /* Fetch the argument value.	*/
+#if __USE_FLOAT128
+# if ! __HAVE_FLOAT128
+#  error "Runtime support for _Float128 is required but missing"
+# endif
+  if (info->is___float128)
+    {
+      fpnum.flt128 = *(const __float128 *) args[0];
+
+      /* Check for special values: not a number or infinity.  */
+      if (isnan (fpnum.flt128))
+	{
+	  if (isupper (info->spec))
+	    {
+	      special = "NAN";
+	      wspecial = L"NAN";
+	    }
+	  else
+	    {
+	      special = "nan";
+	      wspecial = L"nan";
+	    }
+	}
+      else
+	{
+	  if (isinf (fpnum.flt128))
+	    {
+	      if (isupper (info->spec))
+		{
+		  special = "INF";
+		  wspecial = L"INF";
+		}
+	      else
+		{
+		  special = "inf";
+		  wspecial = L"inf";
+		}
+	    }
+	}
+      negative = signbit (fpnum.flt128);
+    }
+  else
+#endif  /* HAVE_FLOAT128 */
 #ifndef __NO_LONG_DOUBLE_MATH
   if (info->is_long_double && sizeof (long double) > sizeof (double))
     {
@@ -260,6 +309,93 @@ __printf_fphex (FILE *fp,
       return done;
     }
 
+#if __HAVE_FLOAT128
+  if (info->is___float128)
+    {
+      /* We have 112 bits of mantissa plus one implicit digit.  Since
+	 112 bits are representable without rest using hexadecimal
+	 digits we use only the implicit digits for the number before
+	 the decimal point.  */
+      unsigned long long int num0, num1;
+      union ieee854_float128 u;
+      u.d = fpnum.flt128;
+
+      num0 = (((unsigned long long int) u.ieee.mantissa0) << 32
+	     | u.ieee.mantissa1);
+      num1 = (((unsigned long long int) u.ieee.mantissa2) << 32
+	     | u.ieee.mantissa3);
+
+      zero_mantissa = (num0|num1) == 0;
+
+      if (sizeof (unsigned long int) > 6)
+	{
+	  numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16,
+			       info->spec == 'A');
+	  wnumstr = _itowa_word (num1,
+				 wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),
+				 16, info->spec == 'A');
+	}
+      else
+	{
+	  numstr = _itoa (num1, numbuf + sizeof numbuf, 16,
+			  info->spec == 'A');
+	  wnumstr = _itowa (num1,
+			    wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),
+			    16, info->spec == 'A');
+	}
+
+      while (numstr > numbuf + (sizeof numbuf - 64 / 4))
+	{
+	  *--numstr = '0';
+	  *--wnumstr = L'0';
+	}
+
+      if (sizeof (unsigned long int) > 6)
+	{
+	  numstr = _itoa_word (num0, numstr, 16, info->spec == 'A');
+	  wnumstr = _itowa_word (num0, wnumstr, 16, info->spec == 'A');
+	}
+      else
+	{
+	  numstr = _itoa (num0, numstr, 16, info->spec == 'A');
+	  wnumstr = _itowa (num0, wnumstr, 16, info->spec == 'A');
+	}
+
+      /* Fill with zeroes.  */
+      while (numstr > numbuf + (sizeof numbuf - 112 / 4))
+	{
+	  *--numstr = '0';
+	  *--wnumstr = L'0';
+	}
+
+      leading = u.ieee.exponent == 0 ? '0' : '1';
+
+      exponent = u.ieee.exponent;
+
+      if (exponent == 0)
+	{
+	  if (zero_mantissa)
+	    expnegative = 0;
+	  else
+	    {
+	      /* This is a denormalized number.  */
+	      expnegative = 1;
+	      exponent = IEEE854_FLOAT128_BIAS - 1;
+	    }
+	}
+      else if (exponent >= IEEE854_FLOAT128_BIAS)
+	{
+	  expnegative = 0;
+	  exponent -= IEEE854_FLOAT128_BIAS;
+	}
+      else
+	{
+	  expnegative = 1;
+	  exponent = -(exponent - IEEE854_FLOAT128_BIAS);
+	}
+    }
+  else
+#endif /* USE_FLOAT128.  */
   if (info->is_long_double == 0 || sizeof (double) == sizeof (long double))
     {
       /* We have 52 bits of mantissa plus one implicit digit.  Since
diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c
index 9403aea..291dd0b 100644
--- a/stdio-common/printf_size.c
+++ b/stdio-common/printf_size.c
@@ -104,6 +104,9 @@ __printf_size (FILE *fp, const struct printf_info *info,
     {
       union ieee754_double dbl;
       long double ldbl;
+#if __USE_FLOAT128
+      __float128 f128;
+#endif
     }
   fpnum;
   const void *ptr = &fpnum;
@@ -119,6 +122,35 @@ __printf_size (FILE *fp, const struct printf_info *info,
   int wide = info->wide;
 
   /* Fetch the argument value.	*/
+#if __USE_FLOAT128
+# if ! __HAVE_FLOAT128
+#  error "Runtime support for _Float128 is required but missing"
+# endif
+  if (info->is___float128)
+    {
+      fpnum.f128 = *(const __float128 *) args[0];
+
+      /* Check for special values: not a number or infinity.  */
+      if (isnan (fpnum.f128))
+	{
+	  special = "nan";
+	  wspecial = L"nan";
+	}
+      else if (isinf (fpnum.f128))
+	{
+	  is_neg = signbit (fpnum.ldbl);
+	  special = "inf";
+	  wspecial = L"inf";
+	}
+      else
+	while (fpnum.f128 >= divisor && tag[1] != '\0')
+	  {
+	    fpnum.f128 /= divisor;
+	    ++tag;
+	  }
+    }
+  else
+#endif /* USE_FLOAT128 */
 #ifndef __NO_LONG_DOUBLE_MATH
   if (info->is_long_double && sizeof (long double) > sizeof (double))
     {
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 54b1ba2..d3fb202 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -766,7 +766,8 @@ static const uint8_t jump_table[] =
 					.pad = pad,			      \
 					.extra = 0,			      \
 					.i18n = use_outdigits,		      \
-					.wide = sizeof (CHAR_T) != 1 };	      \
+					.wide = sizeof (CHAR_T) != 1,	      \
+					.is___float128 = 0};		      \
 									      \
 	    if (is_long_double)						      \
 	      the_arg.pa_long_double = va_arg (ap, long double);	      \
@@ -784,6 +785,9 @@ static const uint8_t jump_table[] =
 		fspec->data_arg_type = PA_DOUBLE;			      \
 		fspec->info.is_long_double = 0;				      \
 	      }								      \
+	    /* XXX: Is this really required or should the calling function    \
+		    had already set it to zero?  */			      \
+	    fspec->info.is___float128 = 0;				      \
 									      \
 	    function_done = __printf_fp (s, &fspec->info, &ptr);	      \
 	  }								      \
@@ -823,7 +827,8 @@ static const uint8_t jump_table[] =
 					.group = group,			      \
 					.pad = pad,			      \
 					.extra = 0,			      \
-					.wide = sizeof (CHAR_T) != 1 };	      \
+					.wide = sizeof (CHAR_T) != 1,	      \
+					.is___float128 = 0};		      \
 									      \
 	    if (is_long_double)						      \
 	      the_arg.pa_long_double = va_arg (ap, long double);	      \
@@ -838,6 +843,9 @@ static const uint8_t jump_table[] =
 	    ptr = (const void *) &args_value[fspec->data_arg];		      \
 	    if (__ldbl_is_dbl)						      \
 	      fspec->info.is_long_double = 0;				      \
+	    /* XXX: Is this really required or should the calling function    \
+		    had already set it to zero?  */			      \
+	    fspec->info.is___float128 = 0;				      \
 									      \
 	    function_done = __printf_fphex (s, &fspec->info, &ptr);	      \
 	  }								      \
diff --git a/stdlib/fpioconst.h b/stdlib/fpioconst.h
index 518634e..ac61c28 100644
--- a/stdlib/fpioconst.h
+++ b/stdlib/fpioconst.h
@@ -40,6 +40,10 @@
 #define DBL_MAX_10_EXP_LOG	8 /* = floor(log_2(DBL_MAX_10_EXP)) */
 #define FLT_MAX_10_EXP_LOG	5 /* = floor(log_2(FLT_MAX_10_EXP)) */
 
+#if __HAVE_FLOAT128
+# define FLT128_MAX_10_EXP_LOG	12 /* = floor(log_2(FLT128_MAX_10_EXP)) */
+#endif
+
 /* On some machines, _Float128 may be a distinct, and more expressive
    type than long double (i.e the ibm128 format).  */
 #include <bits/floatn.h>
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 292c6a2..70a4830 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -192,6 +192,11 @@ extern int strfromf (char *__dest, size_t __size, const char *__format,
 extern int strfroml (char *__dest, size_t __size, const char *__format,
 		     long double __f)
      __THROW __nonnull ((3));
+# if __USE_FLOAT128
+extern int strfromf128 (char *__dest, size_t __size, const char * __format,
+			__float128 __f)
+     __THROW __nonnull ((3));
+# endif
 #endif
 
 
diff --git a/stdlib/strfrom-skeleton.c b/stdlib/strfrom-skeleton.c
index 811a29c..45ad007 100644
--- a/stdlib/strfrom-skeleton.c
+++ b/stdlib/strfrom-skeleton.c
@@ -132,6 +132,12 @@ STRFROM (char *dest, size_t size, const char *format, FLOAT f)
      which type of floating-point number is being passed.  */
   info.is_long_double = __builtin_types_compatible_p (FLOAT, long double);
 
+  /* Similarly, the function strfromf128 passes a floating-point number in
+     __float128 format to printf_fp.  */
+#if __USE_FLOAT128
+  info.is___float128 = __builtin_types_compatible_p (FLOAT, __float128);
+#endif
+
   /* Set info according to the format string.  */
   info.prec = precision;
   info.spec = specifier;
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
index 6a7b0e0..c07586c 100644
--- a/sysdeps/ieee754/float128/Makefile
+++ b/sysdeps/ieee754/float128/Makefile
@@ -1,3 +1,3 @@
 ifeq ($(subdir),stdlib)
-routines += float1282mpn
+routines += float1282mpn strfromf128
 endif
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 6274c73..f32eb8d 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -2,6 +2,11 @@
 %ifndef FLOAT128_VERSION
 % error "float128-abi.h must define FLOAT128_VERSION"
 %endif
+libc {
+  FLOAT128_VERSION {
+    strfromf128;
+  }
+}
 libm {
   FLOAT128_VERSION {
     acosf128;
diff --git a/sysdeps/ieee754/float128/strfromf128.c b/sysdeps/ieee754/float128/strfromf128.c
new file mode 100644
index 0000000..3d0db4f
--- /dev/null
+++ b/sysdeps/ieee754/float128/strfromf128.c
@@ -0,0 +1,25 @@
+/* Definitions for strfromf128.  Implementation in stdlib/strfrom-skeleton.c.
+
+   Copyright (C) 1995-2016 Free Software Foundation, Inc.
+
+   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	FLOAT		__float128
+#define STRFROM		strfromf128
+
+#include <bits/floatn.h>
+#include <float128_private.h>
+
+#include <stdlib/strfrom-skeleton.c>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=96a95fd6fd13cc0a3df4fd9baaea07a42cdf52e9

commit 96a95fd6fd13cc0a3df4fd9baaea07a42cdf52e9
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 3 12:36:50 2016 -0200

    float128: Add conversion from float128 to mpn
    
    Define __FLOAT128_OVERRIDE to 1 and include ldbl2mpn to reuse the
    implementation of ldbl-128 for float128.
    
    2016-11-03  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* include/gmp.h (__mpn_extract_float128): New declaration.
    	* sysdeps/ieee754/float128/float1282mpn.c: New file.
    	* sysdeps/ieee754/float128/Makefile: Add rule to build float1282mpn.c.

diff --git a/include/gmp.h b/include/gmp.h
index b741670..0f0060c 100644
--- a/include/gmp.h
+++ b/include/gmp.h
@@ -15,6 +15,12 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
 					    int *expt, int *is_neg,
 					    long double value);
 
+#if __USE_FLOAT128
+extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
+					 int *expt, int *is_neg,
+					 __float128 value);
+#endif
+
 extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);
 
 extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
new file mode 100644
index 0000000..6a7b0e0
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),stdlib)
+routines += float1282mpn
+endif
diff --git a/sysdeps/ieee754/float128/float1282mpn.c b/sysdeps/ieee754/float128/float1282mpn.c
new file mode 100644
index 0000000..caa514f
--- /dev/null
+++ b/sysdeps/ieee754/float128/float1282mpn.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2016 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 __FLOAT128_OVERRIDE 1
+
+#include "../ldbl-128/ldbl2mpn.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=00869cc53d1d571824adaf3f43f3386f04aea9e1

commit 00869cc53d1d571824adaf3f43f3386f04aea9e1
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 3 12:26:52 2016 -0200

    ldbl-128: Refactor ldbl2mpn to allow use with float128
    
    Read __FLOAT128_OVERRIDE and generate __mpn_extract_float128 reusing
    existing code for __mpn_extract_long_double.
    
    2016-11-04  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* sysdeps/ieee754/ldbl-128/ldbl2mpn.c (__mpn_extract_float128): New
    	function, which is built when __FLOAT128_OVERRIDE is set to 1.

diff --git a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
index 71a6f04..3185470 100644
--- a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
@@ -18,10 +18,24 @@
 #include "gmp.h"
 #include "gmp-impl.h"
 #include "longlong.h"
-#include <ieee754.h>
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
+
+#if __FLOAT128_OVERRIDE == 1
+# include <float.h>
+# include <math.h>
+# include <ieee754_float128.h>
+# undef ieee854_long_double
+# define ieee854_long_double ieee854_float128
+# undef IEEE854_LONG_DOUBLE_BIAS
+# define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+# undef LDBL_MANT_DIG
+# undef LDBL_MIN_EXP
+# define LDBL_MANT_DIG FLT128_MANT_DIG
+# define LDBL_MIN_EXP FLT128_MIN_EXP
+#else
+# include <ieee754.h>
+# include <float.h>
+# include <math.h>
+#endif
 
 /* Convert a `long double' in IEEE854 quad-precision format to a
    multi-precision integer representing the significand scaled up by its
@@ -29,9 +43,15 @@
    (MPN frexpl). */
 
 mp_size_t
+#if __FLOAT128_OVERRIDE == 1
+__mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
+			int *expt, int *is_neg,
+			__float128 value)
+#else
 __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
 			   int *expt, int *is_neg,
 			   long double value)
+#endif
 {
   union ieee854_long_double u;
   u.d = value;

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d24c6624305c80ce49f8b6b600bf38a58c4994ef

commit d24c6624305c80ce49f8b6b600bf38a58c4994ef
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Nov 4 09:57:27 2016 -0200

    float128: Extend the power of ten tables
    
    Update the power of ten tables used by the common implementation when long
    double is not the most expressive real type.
    
    2016-11-04  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
    
    	* stdlib/fpioconst.c (HAVE_EXTENDED_RANGE): New macro
    	for testing how big the power of ten table should be.
    	[TENS_P11_IDX]: Include if above is true.
    	[TENS_P12_IDX]: Include if above is true.
    	[TENS_P13_IDX]: Include if above is true.
    	[TENS_P14_IDX]: Include if above is true.
    	* stdlib/fpioconst.h (FPIOCONST_POW10_ARRAY_SIZE):
    	Use larger table if _Float128 is supported.

diff --git a/stdlib/fpioconst.c b/stdlib/fpioconst.c
index 7db7fa4..dc9346e 100644
--- a/stdlib/fpioconst.c
+++ b/stdlib/fpioconst.c
@@ -27,6 +27,9 @@
    with gen-fpioconst.c.
  */
 
+#define HAVE_EXTENDED_RANGE ((!defined __NO_LONG_DOUBLE_MATH \
+  && __LDBL_MAX_EXP__ > 1024) || __HAVE_FLOAT128)
+
 #if BITS_PER_MP_LIMB == 32
 
 /* Table with constants of 10^(2^i), i=0..12 for 32-bit limbs.	*/
@@ -112,7 +115,7 @@ const mp_limb_t __tens[] =
   0xd2db49ef, 0x926c3f5b, 0xae6209d4, 0x2d433949, 0x34f4a3c6, 0xd4305d94,
   0xd9d61a05, 0x00000325,
 
-#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
+#if HAVE_EXTENDED_RANGE
 # define TENS_P11_IDX	(TENS_P10_IDX + TENS_P10_SIZE)
 # define TENS_P11_SIZE	215
   [TENS_P11_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -748,7 +751,7 @@ const mp_limb_t __tens[] =
   0xd2db49ef47187094ull, 0xae6209d4926c3f5bull, 0x34f4a3c62d433949ull,
   0xd9d61a05d4305d94ull, 0x0000000000000325ull,
 
-#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
+#if HAVE_EXTENDED_RANGE
 # define TENS_P11_IDX	(TENS_P10_IDX + TENS_P10_SIZE)
 # define TENS_P11_SIZE	108
   [TENS_P11_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
@@ -1320,7 +1323,7 @@ const struct mp_power _fpioconst_pow10[FPIOCONST_POW10_ARRAY_SIZE] =
   { TENS_P8_IDX, TENS_P8_SIZE,  	851,	 848 },
   { TENS_P9_IDX, TENS_P9_SIZE,	 	1701,	1698 },
   { TENS_P10_IDX, TENS_P10_SIZE,	3402,	3399 },
-#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
+#if HAVE_EXTENDED_RANGE
   { TENS_P11_IDX, TENS_P11_SIZE,	6804,	6800 },
   { TENS_P12_IDX, TENS_P12_SIZE,	13607,	13604 },
   { TENS_P13_IDX, TENS_P13_SIZE,	27214,	27210 },
diff --git a/stdlib/fpioconst.h b/stdlib/fpioconst.h
index 6fc476b..518634e 100644
--- a/stdlib/fpioconst.h
+++ b/stdlib/fpioconst.h
@@ -40,9 +40,14 @@
 #define DBL_MAX_10_EXP_LOG	8 /* = floor(log_2(DBL_MAX_10_EXP)) */
 #define FLT_MAX_10_EXP_LOG	5 /* = floor(log_2(FLT_MAX_10_EXP)) */
 
+/* On some machines, _Float128 may be a distinct, and more expressive
+   type than long double (i.e the ibm128 format).  */
+#include <bits/floatn.h>
+
 /* For strtold, we need powers of 10 up to floor (log_2 (LDBL_MANT_DIG
    - LDBL_MIN_EXP + 2)).  */
-#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
+#if (!defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024) \
+    || __HAVE_FLOAT128
 # define FPIOCONST_POW10_ARRAY_SIZE	15
 #else
 # define FPIOCONST_POW10_ARRAY_SIZE	11

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=07ff01bfcec152d5529683e75582be7a0a331b7a

commit 07ff01bfcec152d5529683e75582be7a0a331b7a
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Mon Aug 8 15:49:31 2016 -0500

    float128: Add wrappers to override ldbl-128 as float128.
    
    This change defines float128_private.h which contains
    macros used to override long double naming conventions
    when building a ldbl file.
    
    	* sysdeps/ieee754/float128/e_acosf128.c: New file.
    	* sysdeps/ieee754/float128/e_acoshf128.c: New file.
    	* sysdeps/ieee754/float128/e_asinf128.c: New file.
    	* sysdeps/ieee754/float128/e_atan2f128.c: New file.
    	* sysdeps/ieee754/float128/e_atanhf128.c: New file.
    	* sysdeps/ieee754/float128/e_coshf128.c: New file.
    	* sysdeps/ieee754/float128/e_exp10f128.c: New file.
    	* sysdeps/ieee754/float128/e_exp2f128.c: New file.
    	* sysdeps/ieee754/float128/e_expf128.c: New file.
    	* sysdeps/ieee754/float128/e_fmodf128.c: New file.
    	* sysdeps/ieee754/float128/e_gammaf128_r.c: New file.
    	* sysdeps/ieee754/float128/e_hypotf128.c: New file.
    	* sysdeps/ieee754/float128/e_ilogbf128.c: New file.
    	* sysdeps/ieee754/float128/e_j0f128.c: New file.
    	* sysdeps/ieee754/float128/e_j1f128.c: New file.
    	* sysdeps/ieee754/float128/e_jnf128.c: New file.
    	* sysdeps/ieee754/float128/e_lgammaf128.c: New file.
    	* sysdeps/ieee754/float128/e_lgammaf128_r.c: New file.
    	* sysdeps/ieee754/float128/e_log10f128.c: New file.
    	* sysdeps/ieee754/float128/e_log2f128.c: New file.
    	* sysdeps/ieee754/float128/e_logf128.c: New file.
    	* sysdeps/ieee754/float128/e_powf128.c: New file.
    	* sysdeps/ieee754/float128/e_rem_pio2f128.c: New file.
    	* sysdeps/ieee754/float128/e_remainderf128.c: New file.
    	* sysdeps/ieee754/float128/e_scalbf128.c: New file.
    	* sysdeps/ieee754/float128/e_sinhf128.c: New file.
    	* sysdeps/ieee754/float128/e_sqrtf128.c: New file.
    	* sysdeps/ieee754/float128/float128_private.h: New file.
    	* sysdeps/ieee754/float128/gamma_productf128.c: New file.
    	* sysdeps/ieee754/float128/ieee754_float128.h: New file.
    	* sysdeps/ieee754/float128/k_cosf128.c: New file.
    	* sysdeps/ieee754/float128/k_rem_pio2f128.c: New file.
    	* sysdeps/ieee754/float128/k_sincosf128.c: New file.
    	* sysdeps/ieee754/float128/k_sinf128.c: New file.
    	* sysdeps/ieee754/float128/k_tanf128.c: New file.
    	* sysdeps/ieee754/float128/lgamma_negf128.c: New file.
    	* sysdeps/ieee754/float128/lgamma_productf128.c: New file.
    	* sysdeps/ieee754/float128/s_asinhf128.c: New file.
    	* sysdeps/ieee754/float128/s_atanf128.c: New file.
    	* sysdeps/ieee754/float128/s_cbrtf128.c: New file.
    	* sysdeps/ieee754/float128/s_ceilf128.c: New file.
    	* sysdeps/ieee754/float128/s_copysignf128.c: New file.
    	* sysdeps/ieee754/float128/s_cosf128.c: New file.
    	* sysdeps/ieee754/float128/s_erff128.c: New file.
    	* sysdeps/ieee754/float128/s_expm1f128.c: New file.
    	* sysdeps/ieee754/float128/s_fabsf128.c: New file.
    	* sysdeps/ieee754/float128/s_finitef128.c: New file.
    	* sysdeps/ieee754/float128/s_floorf128.c: New file.
    	* sysdeps/ieee754/float128/s_fmaf128.c: New file.
    	* sysdeps/ieee754/float128/s_fpclassifyf128.c: New file.
    	* sysdeps/ieee754/float128/s_frexpf128.c: New file.
    	* sysdeps/ieee754/float128/s_isinff128.c: New file.
    	* sysdeps/ieee754/float128/s_isnanf128.c: New file.
    	* sysdeps/ieee754/float128/s_issignalingf128.c: New file.
    	* sysdeps/ieee754/float128/s_llrintf128.c: New file.
    	* sysdeps/ieee754/float128/s_llroundf128.c: New file.
    	* sysdeps/ieee754/float128/s_log1pf128.c: New file.
    	* sysdeps/ieee754/float128/s_logbf128.c: New file.
    	* sysdeps/ieee754/float128/s_lrintf128.c: New file.
    	* sysdeps/ieee754/float128/s_lroundf128.c: New file.
    	* sysdeps/ieee754/float128/s_modff128.c: New file.
    	* sysdeps/ieee754/float128/s_nearbyintf128.c: New file.
    	* sysdeps/ieee754/float128/s_nextafterf128.c: New file.
    	* sysdeps/ieee754/float128/s_nexttowardf128.c: New file.
    	* sysdeps/ieee754/float128/s_nextupf128.c: New file.
    	* sysdeps/ieee754/float128/s_remquof128.c: New file.
    	* sysdeps/ieee754/float128/s_rintf128.c: New file.
    	* sysdeps/ieee754/float128/s_roundf128.c: New file.
    	* sysdeps/ieee754/float128/s_scalblnf128.c: New file.
    	* sysdeps/ieee754/float128/s_scalbnf128.c: New file.
    	* sysdeps/ieee754/float128/s_signbitf128.c: New file.
    	* sysdeps/ieee754/float128/s_significandf128.c: New file.
    	* sysdeps/ieee754/float128/s_sincosf128.c: New file.
    	* sysdeps/ieee754/float128/s_sinf128.c: New file.
    	* sysdeps/ieee754/float128/s_tanf128.c: New file.
    	* sysdeps/ieee754/float128/s_tanhf128.c: New file.
    	* sysdeps/ieee754/float128/s_truncf128.c: New file.
    	* sysdeps/ieee754/float128/t_sincosf128.c: New file.
    	* sysdeps/ieee754/float128/x2y2m1f128.c: New file.

diff --git a/sysdeps/ieee754/float128/e_acosf128.c b/sysdeps/ieee754/float128/e_acosf128.c
new file mode 100644
index 0000000..7ddf7dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acosl.c"
diff --git a/sysdeps/ieee754/float128/e_acoshf128.c b/sysdeps/ieee754/float128/e_acoshf128.c
new file mode 100644
index 0000000..f6dd40c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acoshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acoshl.c"
diff --git a/sysdeps/ieee754/float128/e_asinf128.c b/sysdeps/ieee754/float128/e_asinf128.c
new file mode 100644
index 0000000..133ab8d
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_asinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_asinl.c"
diff --git a/sysdeps/ieee754/float128/e_atan2f128.c b/sysdeps/ieee754/float128/e_atan2f128.c
new file mode 100644
index 0000000..9aa740f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atan2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atan2l.c"
diff --git a/sysdeps/ieee754/float128/e_atanhf128.c b/sysdeps/ieee754/float128/e_atanhf128.c
new file mode 100644
index 0000000..f26c8d5
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atanhl.c"
diff --git a/sysdeps/ieee754/float128/e_coshf128.c b/sysdeps/ieee754/float128/e_coshf128.c
new file mode 100644
index 0000000..2abf067
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_coshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_coshl.c"
diff --git a/sysdeps/ieee754/float128/e_exp10f128.c b/sysdeps/ieee754/float128/e_exp10f128.c
new file mode 100644
index 0000000..b3468d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_exp10l.c"
diff --git a/sysdeps/ieee754/float128/e_exp2f128.c b/sysdeps/ieee754/float128/e_exp2f128.c
new file mode 100644
index 0000000..adeda15
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/e_exp2l.c>
diff --git a/sysdeps/ieee754/float128/e_expf128.c b/sysdeps/ieee754/float128/e_expf128.c
new file mode 100644
index 0000000..b727b17
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_expf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_expl.c"
diff --git a/sysdeps/ieee754/float128/e_fmodf128.c b/sysdeps/ieee754/float128/e_fmodf128.c
new file mode 100644
index 0000000..ed8a749
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_fmodf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_fmodl.c"
diff --git a/sysdeps/ieee754/float128/e_gammaf128_r.c b/sysdeps/ieee754/float128/e_gammaf128_r.c
new file mode 100644
index 0000000..895ac63
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_gammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_gammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_hypotf128.c b/sysdeps/ieee754/float128/e_hypotf128.c
new file mode 100644
index 0000000..1f06555
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_hypotf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_hypotl.c"
diff --git a/sysdeps/ieee754/float128/e_ilogbf128.c b/sysdeps/ieee754/float128/e_ilogbf128.c
new file mode 100644
index 0000000..2861801
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_ilogbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_ilogbl.c"
diff --git a/sysdeps/ieee754/float128/e_j0f128.c b/sysdeps/ieee754/float128/e_j0f128.c
new file mode 100644
index 0000000..b624b5c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j0f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j0l.c"
diff --git a/sysdeps/ieee754/float128/e_j1f128.c b/sysdeps/ieee754/float128/e_j1f128.c
new file mode 100644
index 0000000..445428e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j1l.c"
diff --git a/sysdeps/ieee754/float128/e_jnf128.c b/sysdeps/ieee754/float128/e_jnf128.c
new file mode 100644
index 0000000..7854e11
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_jnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_jnl.c"
diff --git a/sysdeps/ieee754/float128/e_lgammaf128.c b/sysdeps/ieee754/float128/e_lgammaf128.c
new file mode 100644
index 0000000..72f02ac
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128.c
@@ -0,0 +1 @@
+/* _FloatN uses tgamma instead.  */
diff --git a/sysdeps/ieee754/float128/e_lgammaf128_r.c b/sysdeps/ieee754/float128/e_lgammaf128_r.c
new file mode 100644
index 0000000..3517ac3
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_lgammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_log10f128.c b/sysdeps/ieee754/float128/e_log10f128.c
new file mode 100644
index 0000000..1c3341e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log10l.c"
diff --git a/sysdeps/ieee754/float128/e_log2f128.c b/sysdeps/ieee754/float128/e_log2f128.c
new file mode 100644
index 0000000..36becaa
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log2l.c"
diff --git a/sysdeps/ieee754/float128/e_logf128.c b/sysdeps/ieee754/float128/e_logf128.c
new file mode 100644
index 0000000..b0c9975
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_logf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_logl.c"
diff --git a/sysdeps/ieee754/float128/e_powf128.c b/sysdeps/ieee754/float128/e_powf128.c
new file mode 100644
index 0000000..3afaf7f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_powf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_powl.c"
diff --git a/sysdeps/ieee754/float128/e_rem_pio2f128.c b/sysdeps/ieee754/float128/e_rem_pio2f128.c
new file mode 100644
index 0000000..86c2ca1
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_rem_pio2l.c"
diff --git a/sysdeps/ieee754/float128/e_remainderf128.c b/sysdeps/ieee754/float128/e_remainderf128.c
new file mode 100644
index 0000000..90c18f8
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_remainderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_remainderl.c"
diff --git a/sysdeps/ieee754/float128/e_scalbf128.c b/sysdeps/ieee754/float128/e_scalbf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_scalbf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/e_sinhf128.c b/sysdeps/ieee754/float128/e_sinhf128.c
new file mode 100644
index 0000000..42a54e0
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_sinhl.c"
diff --git a/sysdeps/ieee754/float128/e_sqrtf128.c b/sysdeps/ieee754/float128/e_sqrtf128.c
new file mode 100644
index 0000000..1ac216f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sqrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/e_sqrtl.c>
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
new file mode 100644
index 0000000..82f2f52
--- /dev/null
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -0,0 +1,343 @@
+/* _Float128 overrides for building ldbl-128 as _Float128.
+   Copyright (C) 2016 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/>.  */
+
+/* This must be included before the function renames below.  */
+#include <math.h>
+#include <math/mul_splitl.h>
+
+/* Override parts of long double code as float128.  */
+#define __LDBL_OVERRIDE 1
+
+#if !__GNUC_PREREQ (7,0)
+# define L(x) x##Q
+typedef __float128 _Float128;
+#else
+# define L(x) x##F128
+#endif
+
+/* Renames derived from math_private.h.  */
+#include <math_private.h>
+#include <ieee754_float128.h>
+#define ieee854_long_double_shape_type ieee854_float128_shape_type
+#define ieee854_long_double ieee854_float128
+
+#undef GET_LDOUBLE_LSW64
+#undef GET_LDOUBLE_MSW64
+#undef GET_LDOUBLE_WORDS64
+#undef SET_LDOUBLE_LSW64
+#undef SET_LDOUBLE_MSW64
+#undef SET_LDOUBLE_WORDS64
+#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
+#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
+#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
+#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
+#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
+#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
+
+#undef IEEE854_LONG_DOUBLE_BIAS
+#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+
+#ifdef SET_RESTORE_ROUNDF128
+# undef SET_RESTORE_ROUNDL
+# define SET_RESTORE_ROUNDL() SET_RESTORE_ROUNDF128()
+#endif
+
+
+/* misc macros from the header below.  */
+#include <fix-fp-int-convert-overflow.h>
+#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
+#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
+
+
+/* float.h constants.  */
+#include <float.h>
+#undef HUGE_VALL
+#undef LDBL_DIG
+#undef LDBL_EPSILON
+#undef LDBL_MANT_DIG
+#undef LDBL_MAX
+#undef LDBL_MAX_10_EXP
+#undef LDBL_MAX_EXP
+#undef LDBL_MIN
+#undef LDBL_MIN_10_EXP
+#undef LDBL_MIN_EXP
+#undef LDBL_TRUE_MIN
+#define HUGE_VALL HUGE_VAL_F128
+#define LDBL_DIG FLT128_DIG
+#define LDBL_EPSILON FLT128_EPSILON
+#define LDBL_MANT_DIG FLT128_MANT_DIG
+#define LDBL_MAX FLT128_MAX
+#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
+#define LDBL_MAX_EXP FLT128_MAX_EXP
+#define LDBL_MIN FLT128_MIN
+#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
+#define LDBL_MIN_EXP FLT128_MIN_EXP
+#define LDBL_TRUE_MIN FLT128_TRUE_MIN
+
+
+/* math.h GNU constants.  */
+#undef M_El
+#undef M_LOG2El
+#undef M_LOG10El
+#undef M_LN2l
+#undef M_LN10l
+#undef M_PIl
+#undef M_PI_2l
+#undef M_PI_4l
+#undef M_1_PIl
+#undef M_2_PIl
+#undef M_2_SQRTPIl
+#undef M_SQRT2l
+#undef M_SQRT1_2l
+#define M_El M_Ef128
+#define M_LOG2El M_LOG2Ef128
+#define M_LOG10El M_LOG10Ef128
+#define M_LN2l M_LN2f128
+#define M_LN10l M_LN10f128
+#define M_PIl M_PIf128
+#define M_PI_2l M_PI_2f128
+#define M_PI_4l M_PI_4f128
+#define M_1_PIl M_1_PIf128
+#define M_2_PIl M_2_PIf128
+#define M_2_SQRTPIl M_2_SQRTPIf128
+#define M_SQRT2l M_SQRT2f128
+#define M_SQRT1_2l M_SQRT1_2f128
+
+
+/* IEEE function renames.  */
+#define __ieee754_acoshl __ieee754_acoshf128
+#define __ieee754_acosl __ieee754_acosf128
+#define __ieee754_asinhl __ieee754_asinhf128
+#define __ieee754_asinl __ieee754_asinf128
+#define __ieee754_atan2l __ieee754_atan2f128
+#define __ieee754_atanhl __ieee754_atanhf128
+#define __ieee754_coshl __ieee754_coshf128
+#define __ieee754_cosl __ieee754_cosf128
+#define __ieee754_exp10l __ieee754_exp10f128
+#define __ieee754_exp2l __ieee754_exp2f128
+#define __ieee754_expl __ieee754_expf128
+#define __ieee754_fmodl __ieee754_fmodf128
+#define __ieee754_gammal_r __ieee754_gammaf128_r
+#define __ieee754_hypotl __ieee754_hypotf128
+#define __ieee754_ilogbl __ieee754_ilogbf128
+#define __ieee754_j0l __ieee754_j0f128
+#define __ieee754_j1l __ieee754_j1f128
+#define __ieee754_jnl __ieee754_jnf128
+#define __ieee754_lgammal_r __ieee754_lgammaf128_r
+#define __ieee754_log10l __ieee754_log10f128
+#define __ieee754_log2l __ieee754_log2f128
+#define __ieee754_logl __ieee754_logf128
+#define __ieee754_powl __ieee754_powf128
+#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
+#define __ieee754_remainderl __ieee754_remainderf128
+#define __ieee754_sinhl __ieee754_sinhf128
+#define __ieee754_sqrtl __ieee754_sqrtf128
+#define __ieee754_y0l __ieee754_y0f128
+#define __ieee754_y1l __ieee754_y1f128
+#define __ieee754_ynl __ieee754_ynf128
+
+
+/* finite math entry points.  */
+#define __acoshl_finite __acoshf128_finite
+#define __acosl_finite __acosf128_finite
+#define __asinl_finite __asinf128_finite
+#define __atan2l_finite __atan2f128_finite
+#define __atanhl_finite __atanhf128_finite
+#define __coshl_finite __coshf128_finite
+#define __cosl_finite __cosf128_finite
+#define __exp10l_finite __exp10f128_finite
+#define __exp2l_finite __exp2f128_finite
+#define __expl_finite __expf128_finite
+#define __fmodl_finite __fmodf128_finite
+#define __hypotl_finite __hypotf128_finite
+#define __ilogbl_finite __ilogbf128_finite
+#define __j0l_finite __j0f128_finite
+#define __j1l_finite __j1f128_finite
+#define __jnl_finite __jnf128_finite
+#define __lgammal_r_finite __lgammaf128_r_finite
+#define __log10l_finite __log10f128_finite
+#define __log2l_finite __log2f128_finite
+#define __logl_finite __logf128_finite
+#define __powl_finite __powf128_finite
+#define __remainderl_finite __remainderf128_finite
+#define __sinhl_finite __sinhf128_finite
+#define __y0l_finite __y0f128_finite
+#define __y1l_finite __y1f128_finite
+#define __ynl_finite __ynf128_finite
+
+
+/* internal function names.  */
+#define __asinhl __asinhf128
+#define __atanl __atanf128
+#define __atanl __atanf128
+#define __cbrtl __cbrtf128
+#define __ceill __ceilf128
+#define __ceill __ceilf128
+#define __copysignl __copysignf128
+#define __copysignl __copysignf128
+#define __cosl __cosf128
+#define __cosl __cosf128
+#define __erfcl __erfcf128
+#define __erfl __erff128
+#define __expl __expf128
+#define __expm1l __expm1f128
+#define __fabsl __fabsf128
+#define __fdiml __fdimf128
+#define __finitel __finitef128
+#define __floorl __floorf128
+#define __fmal __fmaf128
+#define __fmaxl __fmaxf128
+#define __fminl __fminf128
+#define __fpclassifyl __fpclassifyf128
+#define __frexpl __frexpf128
+#define __gammal_r_finite __gammaf128_r_finite
+#define __isinfl __isinff128
+#define __isnanl __isnanf128
+#define __issignalingl __issignalingf128
+#define __ldexpl __ldexpf128
+#define __llrintl __llrintf128
+#define __llroundl __llroundf128
+#define __log1pl __log1pf128
+#define __logbl __logbf128
+#define __logl __logf128
+#define __lrintl __lrintf128
+#define __lroundl __lroundf128
+#define __modfl __modff128
+#define __nearbyintl __nearbyintf128
+#define __nextafterl __nextafterf128
+#define __nextdownl __nextdownf128
+#define __nextupl __nextupf128
+#define __remquol __remquof128
+#define __rintl __rintf128
+#define __roundl __roundf128
+#define __scalblnl __scalblnf128
+#define __scalbnl __scalbnf128
+#define __signbitl __signbitf128
+#define __sincosl __sincosf128
+#define __sinl __sinf128
+#define __sqrtl __sqrtf128
+#define __tanhl __tanhf128
+#define __tanl __tanf128
+#define __truncl __truncf128
+#define __x2y2m1l __x2y2m1f128
+
+/* __nexttowardf128 is not _Float128 API. */
+#define __nexttowardl __nexttowardf128_do_not_use
+#define nexttowardl nexttowardf128_do_not_use
+
+/* __nanl is actually a macro.  */
+#undef __nanl
+#define __nanl(str) __nanf128(str)
+
+
+/* public entry points.  */
+#define asinhl asinhf128
+#define atanl atanf128
+#define atanl atanf128
+#define cbrtl cbrtf128
+#define ceill ceilf128
+#define ceill ceilf128
+#define copysignl copysignf128
+#define copysignl copysignf128
+#define cosl cosf128
+#define cosl cosf128
+#define erfcl erfcf128
+#define erfl erff128
+#define expl expf128
+#define expm1l expm1f128
+#define fabsl fabsf128
+#define fdiml fdimf128
+#define finitel finitef128
+#define floorl floorf128
+#define fmal fmaf128
+#define fmaxl fmaxf128
+#define fminl fminf128
+#define fpclassifyl fpclassifyf128
+#define frexpl frexpf128
+#define gammal_r_finite gammaf128_r_finite
+#define isinfl isinff128
+#define isnanl isnanf128
+#define issignalingl issignalingf128
+#define ldexpl ldexpf128
+#define llrintl llrintf128
+#define llroundl llroundf128
+#define log1pl log1pf128
+#define logbl logbf128
+#define logl logf128
+#define lrintl lrintf128
+#define lroundl lroundf128
+#define modfl modff128
+#define nanl nanf128
+#define nearbyintl nearbyintf128
+#define nextafterl nextafterf128
+#define nextdownl nextdownf128
+#define nextupl nextupf128
+#define remquol remquof128
+#define rintl rintf128
+#define roundl roundf128
+#define scalbnl scalbnf128
+#define signbitl signbitf128
+#define sincosl sincosf128
+#define sinl sinf128
+#define sqrtl sqrtf128
+#define tanhl tanhf128
+#define tanl tanf128
+#define truncl truncf128
+
+
+/* misc internal renames.  */
+#define __builtin_fmal __builtin_fmaf128
+#define __expl_table __expf128_table
+#define __gamma_productl __gamma_productf128
+#define __kernel_cosl __kernel_cosf128
+#define __kernel_rem_pio2l __kernel_rem_pio2f128
+#define __kernel_sincosl __kernel_sincosf128
+#define __kernel_sinl __kernel_sinf128
+#define __kernel_tanl __kernel_tanf128
+#define __lgamma_negl __lgamma_negf128
+#define __lgamma_productl __lgamma_productf128
+#define __sincosl_table __sincosf128_table
+#define mul_splitl mul_splitf128
+
+/* assume GCC >= 6.2 and use the type-generic builtin.  */
+#define __builtin_copysignl __builtin_copysign
+#define __builtin_signbitl __builtin_signbit
+
+static inline void
+mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
+{
+#ifdef __FP_FAST_FMAF128
+  /* Fast built-in fused multiply-add.  */
+  *hi = x * y;
+  *lo = __builtin_fmal (x, y, -*hi);
+#else
+  /* Apply Dekker's algorithm.  */
+  *hi = x * y;
+# define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
+  _Float128 x1 = x * C;
+  _Float128 y1 = y * C;
+# undef C
+  x1 = (x - x1) + x1;
+  y1 = (y - y1) + y1;
+  _Float128 x2 = x - x1;
+  _Float128 y2 = y - y1;
+  *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
diff --git a/sysdeps/ieee754/float128/gamma_productf128.c b/sysdeps/ieee754/float128/gamma_productf128.c
new file mode 100644
index 0000000..be2271f
--- /dev/null
+++ b/sysdeps/ieee754/float128/gamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/gamma_productl.c"
diff --git a/sysdeps/ieee754/float128/ieee754_float128.h b/sysdeps/ieee754/float128/ieee754_float128.h
new file mode 100644
index 0000000..5bd3a98
--- /dev/null
+++ b/sysdeps/ieee754/float128/ieee754_float128.h
@@ -0,0 +1,140 @@
+/* _Float128 IEEE like macros.
+   Copyright (C) 2016 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 _IEEE754_FLOAT128_H
+#define _IEEE754_FLOAT128_H
+
+#include <endian.h>
+#include <stdint.h>
+
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#  define __FLT_EORDER2(t, a, b) t a; t b;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t a; t b; t c; t d;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t a; t b; t c; t d; t e; t f;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t a; t b; t c; t d; t e; t f; t g;
+# else
+#  define __FLT_EORDER2(t, a, b) \
+			t b; t a;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t d; t c; t b; t a;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t f; t e; t d; t c; t b; t a;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t g; t f; t e; t d; t c; t b; t a;
+# endif
+
+/* A union which permits us to convert between _Float128 and
+   four 32 bit ints or two 64 bit ints.  */
+
+typedef union
+{
+  _Float128 value;
+  struct
+  {
+    __FLT_EORDER2 (uint64_t, msw, lsw);
+  } parts64;
+  struct
+  {
+    __FLT_EORDER4 (uint32_t, w0, w1, w2, w3);
+  } parts32;
+} ieee854_float128_shape_type;
+
+/* Get two 64 bit ints from a _Float128.  */
+
+# define GET_FLOAT128_WORDS64(ix0,ix1,d)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.value = (d);						\
+  (ix0) = qw_u.parts64.msw;					\
+  (ix1) = qw_u.parts64.lsw;					\
+} while (0)
+
+/* Set a _Float128 from two 64 bit ints.  */
+
+# define SET_FLOAT128_WORDS64(d,ix0,ix1)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.parts64.msw = (ix0);					\
+  qw_u.parts64.lsw = (ix1);					\
+  (d) = qw_u.value;						\
+} while (0)
+
+/* Get the more significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_MSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.msw;					\
+} while (0)
+
+/* Set the more significant 64 bits of a _Float128 mantissa from an int.  */
+
+# define SET_FLOAT128_MSW64(d,v)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  sh_u.parts64.msw = (v);					\
+  (d) = sh_u.value;						\
+} while (0)
+
+/* Get the least significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_LSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.lsw;					\
+} while (0)
+
+/* Likewise, some helper macros which are exposed via ieee754.h for
+   C99 real types, but not _Float128.  */
+
+union ieee854_float128
+  {
+    _Float128 d;
+
+    /* This is the IEEE 854 quad-precision format.  */
+    struct
+      {
+	__FLT_EORDER6 (unsigned int, negative:1,
+				     exponent:15,
+				     mantissa0:16,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee;
+
+    /* This format makes it easier to see if a NaN is a signalling NaN.  */
+    struct
+      {
+	__FLT_EORDER7 (unsigned int, negative:1,
+				     exponent:15,
+				     quiet_nan:1,
+				     mantissa0:15,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee_nan;
+  };
+
+#define IEEE854_FLOAT128_BIAS 0x3fff /* Added to exponent.  */
+
+#endif
diff --git a/sysdeps/ieee754/float128/k_cosf128.c b/sysdeps/ieee754/float128/k_cosf128.c
new file mode 100644
index 0000000..9db0906
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_cosl.c"
diff --git a/sysdeps/ieee754/float128/k_rem_pio2f128.c b/sysdeps/ieee754/float128/k_rem_pio2f128.c
new file mode 100644
index 0000000..5140266
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/k_rem_pio2l.c>
diff --git a/sysdeps/ieee754/float128/k_sincosf128.c b/sysdeps/ieee754/float128/k_sincosf128.c
new file mode 100644
index 0000000..14c0f1e
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sincosl.c"
diff --git a/sysdeps/ieee754/float128/k_sinf128.c b/sysdeps/ieee754/float128/k_sinf128.c
new file mode 100644
index 0000000..f3acf1c
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sinl.c"
diff --git a/sysdeps/ieee754/float128/k_tanf128.c b/sysdeps/ieee754/float128/k_tanf128.c
new file mode 100644
index 0000000..ca6be53
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_tanl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_negf128.c b/sysdeps/ieee754/float128/lgamma_negf128.c
new file mode 100644
index 0000000..9c16f93
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_negf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_negl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_productf128.c b/sysdeps/ieee754/float128/lgamma_productf128.c
new file mode 100644
index 0000000..5efe5dd
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_productl.c"
diff --git a/sysdeps/ieee754/float128/s_asinhf128.c b/sysdeps/ieee754/float128/s_asinhf128.c
new file mode 100644
index 0000000..7b93d8c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_asinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_asinhl.c"
diff --git a/sysdeps/ieee754/float128/s_atanf128.c b/sysdeps/ieee754/float128/s_atanf128.c
new file mode 100644
index 0000000..9b4d7ec
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_atanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_atanl.c"
diff --git a/sysdeps/ieee754/float128/s_cbrtf128.c b/sysdeps/ieee754/float128/s_cbrtf128.c
new file mode 100644
index 0000000..3bd5797
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cbrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cbrtl.c"
diff --git a/sysdeps/ieee754/float128/s_ceilf128.c b/sysdeps/ieee754/float128/s_ceilf128.c
new file mode 100644
index 0000000..0af15f5
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ceilf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_ceill.c"
diff --git a/sysdeps/ieee754/float128/s_copysignf128.c b/sysdeps/ieee754/float128/s_copysignf128.c
new file mode 100644
index 0000000..808f7ab
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_copysignf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_copysignl.c"
diff --git a/sysdeps/ieee754/float128/s_cosf128.c b/sysdeps/ieee754/float128/s_cosf128.c
new file mode 100644
index 0000000..8ba5526
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cosl.c"
diff --git a/sysdeps/ieee754/float128/s_erff128.c b/sysdeps/ieee754/float128/s_erff128.c
new file mode 100644
index 0000000..ac16ad6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_erff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_erfl.c"
diff --git a/sysdeps/ieee754/float128/s_expm1f128.c b/sysdeps/ieee754/float128/s_expm1f128.c
new file mode 100644
index 0000000..ea28d89
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_expm1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_expm1l.c"
diff --git a/sysdeps/ieee754/float128/s_fabsf128.c b/sysdeps/ieee754/float128/s_fabsf128.c
new file mode 100644
index 0000000..79ba47c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fabsf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fabsl.c"
diff --git a/sysdeps/ieee754/float128/s_finitef128.c b/sysdeps/ieee754/float128/s_finitef128.c
new file mode 100644
index 0000000..801de88
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_finitef128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_finitel.c"
diff --git a/sysdeps/ieee754/float128/s_floorf128.c b/sysdeps/ieee754/float128/s_floorf128.c
new file mode 100644
index 0000000..1829843
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_floorf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_floorl.c"
diff --git a/sysdeps/ieee754/float128/s_fmaf128.c b/sysdeps/ieee754/float128/s_fmaf128.c
new file mode 100644
index 0000000..6497895
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fmaf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fmal.c"
diff --git a/sysdeps/ieee754/float128/s_fpclassifyf128.c b/sysdeps/ieee754/float128/s_fpclassifyf128.c
new file mode 100644
index 0000000..15131dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fpclassifyf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fpclassifyl.c"
diff --git a/sysdeps/ieee754/float128/s_frexpf128.c b/sysdeps/ieee754/float128/s_frexpf128.c
new file mode 100644
index 0000000..7b040b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_frexpf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_frexpl.c"
diff --git a/sysdeps/ieee754/float128/s_isinff128.c b/sysdeps/ieee754/float128/s_isinff128.c
new file mode 100644
index 0000000..62cc424
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isinff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isinfl.c"
diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c
new file mode 100644
index 0000000..efba240
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isnanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isnanl.c"
diff --git a/sysdeps/ieee754/float128/s_issignalingf128.c b/sysdeps/ieee754/float128/s_issignalingf128.c
new file mode 100644
index 0000000..1d45995
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_issignalingf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_issignalingl.c"
diff --git a/sysdeps/ieee754/float128/s_llrintf128.c b/sysdeps/ieee754/float128/s_llrintf128.c
new file mode 100644
index 0000000..bb9ca58
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llrintl.c"
diff --git a/sysdeps/ieee754/float128/s_llroundf128.c b/sysdeps/ieee754/float128/s_llroundf128.c
new file mode 100644
index 0000000..be54a90
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llroundl.c"
diff --git a/sysdeps/ieee754/float128/s_log1pf128.c b/sysdeps/ieee754/float128/s_log1pf128.c
new file mode 100644
index 0000000..48bb84f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_log1pf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_log1pl.c"
diff --git a/sysdeps/ieee754/float128/s_logbf128.c b/sysdeps/ieee754/float128/s_logbf128.c
new file mode 100644
index 0000000..167384a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_logbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_logbl.c"
diff --git a/sysdeps/ieee754/float128/s_lrintf128.c b/sysdeps/ieee754/float128/s_lrintf128.c
new file mode 100644
index 0000000..1cfa9d7
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lrintl.c"
diff --git a/sysdeps/ieee754/float128/s_lroundf128.c b/sysdeps/ieee754/float128/s_lroundf128.c
new file mode 100644
index 0000000..13ba9f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lroundl.c"
diff --git a/sysdeps/ieee754/float128/s_modff128.c b/sysdeps/ieee754/float128/s_modff128.c
new file mode 100644
index 0000000..4618c6c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_modff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_modfl.c"
diff --git a/sysdeps/ieee754/float128/s_nearbyintf128.c b/sysdeps/ieee754/float128/s_nearbyintf128.c
new file mode 100644
index 0000000..e61a3b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nearbyintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nearbyintl.c"
diff --git a/sysdeps/ieee754/float128/s_nextafterf128.c b/sysdeps/ieee754/float128/s_nextafterf128.c
new file mode 100644
index 0000000..2c43a00
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextafterf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextafterl.c"
diff --git a/sysdeps/ieee754/float128/s_nexttowardf128.c b/sysdeps/ieee754/float128/s_nexttowardf128.c
new file mode 100644
index 0000000..006e4c9
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nexttowardf128.c
@@ -0,0 +1 @@
+/* This function does not exist for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_nextupf128.c b/sysdeps/ieee754/float128/s_nextupf128.c
new file mode 100644
index 0000000..7d5d0b8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextupf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextupl.c"
diff --git a/sysdeps/ieee754/float128/s_remquof128.c b/sysdeps/ieee754/float128/s_remquof128.c
new file mode 100644
index 0000000..1cef61a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_remquof128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_remquol.c"
diff --git a/sysdeps/ieee754/float128/s_rintf128.c b/sysdeps/ieee754/float128/s_rintf128.c
new file mode 100644
index 0000000..2adb95f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_rintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_rintl.c"
diff --git a/sysdeps/ieee754/float128/s_roundf128.c b/sysdeps/ieee754/float128/s_roundf128.c
new file mode 100644
index 0000000..1eb36f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundl.c"
diff --git a/sysdeps/ieee754/float128/s_scalblnf128.c b/sysdeps/ieee754/float128/s_scalblnf128.c
new file mode 100644
index 0000000..999223c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalblnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalblnl.c"
diff --git a/sysdeps/ieee754/float128/s_scalbnf128.c b/sysdeps/ieee754/float128/s_scalbnf128.c
new file mode 100644
index 0000000..0e7ab26
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalbnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalbnl.c"
diff --git a/sysdeps/ieee754/float128/s_signbitf128.c b/sysdeps/ieee754/float128/s_signbitf128.c
new file mode 100644
index 0000000..71c1ca3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_signbitf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_signbitl.c"
diff --git a/sysdeps/ieee754/float128/s_significandf128.c b/sysdeps/ieee754/float128/s_significandf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_significandf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_sincosf128.c b/sysdeps/ieee754/float128/s_sincosf128.c
new file mode 100644
index 0000000..472adde
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sincosl.c"
diff --git a/sysdeps/ieee754/float128/s_sinf128.c b/sysdeps/ieee754/float128/s_sinf128.c
new file mode 100644
index 0000000..d79a116
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sinl.c"
diff --git a/sysdeps/ieee754/float128/s_tanf128.c b/sysdeps/ieee754/float128/s_tanf128.c
new file mode 100644
index 0000000..382961a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanl.c"
diff --git a/sysdeps/ieee754/float128/s_tanhf128.c b/sysdeps/ieee754/float128/s_tanhf128.c
new file mode 100644
index 0000000..e02c9a6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanhl.c"
diff --git a/sysdeps/ieee754/float128/s_truncf128.c b/sysdeps/ieee754/float128/s_truncf128.c
new file mode 100644
index 0000000..474d9dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_truncf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_truncl.c"
diff --git a/sysdeps/ieee754/float128/t_sincosf128.c b/sysdeps/ieee754/float128/t_sincosf128.c
new file mode 100644
index 0000000..7e699d3
--- /dev/null
+++ b/sysdeps/ieee754/float128/t_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/t_sincosl.c"
diff --git a/sysdeps/ieee754/float128/x2y2m1f128.c b/sysdeps/ieee754/float128/x2y2m1f128.c
new file mode 100644
index 0000000..6888079
--- /dev/null
+++ b/sysdeps/ieee754/float128/x2y2m1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/x2y2m1l.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b8f658969d3c8385682d5ea08e8227f339e70701

commit b8f658969d3c8385682d5ea08e8227f339e70701
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Wed Feb 1 17:54:25 2017 -0200

    float128: Enable use of IEEE wrapper templates
    
    The templates for the IEEE functions wrappers implement wrappers that
    do not rely on _LIB_VERSION / matherr / __kernel_standard
    functionality to set errno and fix the return value of the functions.
    The wrappers are ready to be used by all floating-point types, however
    they will first be used by float128, since the old wrappers for float,
    double, and long double need to be first deprecated and versioned.
    
    This commits defines __USE_WRAPPER_TEMPLATE to 1 for float128 files,
    so that the new wrapper templates are used for this type.
    
    2017-02-01  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* sysdeps/generic/math-type-macros-float128.h
    	(__USE_WRAPPER_TEMPLATE): Define to 1 to enable use of the
    	wrapper templates.

diff --git a/sysdeps/generic/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
index 20582e4..06dcce5 100644
--- a/sysdeps/generic/math-type-macros-float128.h
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -46,4 +46,7 @@
 # define __builtin_nanf128 __builtin_nanq
 #endif
 
+/* Use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 1
+
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cf57e48b78ee2a9b6d2bbc2b8d29bc662c485c75

commit cf57e48b78ee2a9b6d2bbc2b8d29bc662c485c75
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Nov 24 17:51:43 2016 -0200

    float128: Define __builtin_fabsf128 for GCC < 7.0

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index c5d7fae..0911c88 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -538,6 +538,10 @@ extern long double __lgamma_productl (long double t, long double x,
 # define __EXPR_FLT128(x, yes, no) no
 #endif
 
+/* Before GCC 7.0, __builtin_fabsf128 does not exist.  */
+#if ! __GNUC_PREREQ (7, 0)
+# define __builtin_fabsf128 __builtin_fabsq
+#endif
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=88b5191bfe330109a219ca18e1dc00ef28c1b427

commit 88b5191bfe330109a219ca18e1dc00ef28c1b427
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Jul 15 18:02:03 2016 -0500

    float128: Add private _Float128 declarations for libm.
    
    Add the necessary bits to the private headers to support
    building the _Float128 libm functions.
    
    A local override for float.h is provided to include the
    missing *FLT128 macros implied by TS 18661-3 for this
    type when compiling prior to GCC 7.
    
    	* bits/libm-simd-decl-stubs.h (__DECL_SIMD_cosf128): New macro.
    	(__DECL_SIMD_sinf128): Likewise.
    	(__DECL_SIMD_sincosf128): Likewise.
    	(__DECL_SIMD_logf128): Likewise.
    	(__DECL_SIMD_expf128): Likewise.
    	(__DECL_SIMD_powf128): Likewise.
    
    	* include/complex.h (__kernel_casinhf128): New declaration.
    	* include/float.h: New file.
    	* include/math.h (__finitef128): Add a hidden def.
    	(__isinff128): Likewise.
    	(__isnanf128): Likewise.
    	(__fpclassify): Likewise.
    	(__issignalling): Likewise.
    	(__expf128): Likewise.
    	(__expm1f128): Likewise.
    
    	* sysdeps/generic/fix-fp-int-convert-overflow.h:
    	(FIX_FLT128_LONG_CONVERT_OVERFLOW): New macro.
    	(FIX_FLT128_LLONG_CONVERT_OVERFLOW): Likewise.
    
    	* sysdeps/generic/math-type-macros-float128.h: New file.
    
    	* sysdeps/generic/math_private.h (__EXPR_FLT128): New macro.
    	(fabs_tg): Optionally include _Float128 types too.
    	(min_of_type): Likewise.
    
    	* sysdeps/ieee754/ldbl-opt/s_sin.c:
    	* (__DECL_SIMD_sincos_disablef128): New macro.

diff --git a/bits/libm-simd-decl-stubs.h b/bits/libm-simd-decl-stubs.h
index 7328eb2..6794b9f 100644
--- a/bits/libm-simd-decl-stubs.h
+++ b/bits/libm-simd-decl-stubs.h
@@ -36,24 +36,30 @@
 #define __DECL_SIMD_cos
 #define __DECL_SIMD_cosf
 #define __DECL_SIMD_cosl
+#define __DECL_SIMD_cosf128
 
 #define __DECL_SIMD_sin
 #define __DECL_SIMD_sinf
 #define __DECL_SIMD_sinl
+#define __DECL_SIMD_sinf128
 
 #define __DECL_SIMD_sincos
 #define __DECL_SIMD_sincosf
 #define __DECL_SIMD_sincosl
+#define __DECL_SIMD_sincosf128
 
 #define __DECL_SIMD_log
 #define __DECL_SIMD_logf
 #define __DECL_SIMD_logl
+#define __DECL_SIMD_logf128
 
 #define __DECL_SIMD_exp
 #define __DECL_SIMD_expf
 #define __DECL_SIMD_expl
+#define __DECL_SIMD_expf128
 
 #define __DECL_SIMD_pow
 #define __DECL_SIMD_powf
 #define __DECL_SIMD_powl
+#define __DECL_SIMD_powf128
 #endif
diff --git a/include/complex.h b/include/complex.h
index 082e71f..8eec3a0 100644
--- a/include/complex.h
+++ b/include/complex.h
@@ -8,6 +8,13 @@
 extern complex float __kernel_casinhf (complex float z, int adj);
 extern complex double __kernel_casinh (complex double z, int adj);
 extern complex long double __kernel_casinhl (complex long double z, int adj);
+#  if __USE_FLOAT128
+#   ifdef __CFLOAT128
+extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
+#   else
+extern _Complex _Float128 __kernel_casinhf128 (_Complex _Float128 z, int adj);
+#   endif
+#  endif
 # endif
 
 #endif
diff --git a/include/float.h b/include/float.h
new file mode 100644
index 0000000..f792158
--- /dev/null
+++ b/include/float.h
@@ -0,0 +1,31 @@
+#ifndef _LIBC_FLOAT_H
+#define _LIBC_FLOAT_H
+
+#ifndef _ISOMAC
+# define __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+
+#include_next <float.h>
+
+/* Supplement float.h macros for _Float128 for older compilers
+   which do not yet support the type.  These are described in
+   TS 18661-3.  */
+#ifndef _ISOMAC
+# include <features.h>
+# include <bits/floatn.h>
+# if !__GNUC_PREREQ (7,0) && __USE_FLOAT128
+#  define FLT128_MANT_DIG	113
+#  define FLT128_DECIMAL_DIG	36
+#  define FLT128_DIG		33
+#  define FLT128_MIN_EXP	(-16381)
+#  define FLT128_MIN_10_EXP	(-4931)
+#  define FLT128_MAX_EXP	16384
+#  define FLT128_MAX_10_EXP	4932
+#  define FLT128_MAX		1.18973149535723176508575932662800702e+4932Q
+#  define FLT128_EPSILON	1.92592994438723585305597794258492732e-34Q
+#  define FLT128_MIN		3.36210314311209350626267781732175260e-4932Q
+#  define FLT128_TRUE_MIN	6.47517511943802511092443895822764655e-4966Q
+# endif
+#endif
+
+#endif /* _LIBC_FLOAT_H */
diff --git a/include/math.h b/include/math.h
index a4f5562..a61d6f7 100644
--- a/include/math.h
+++ b/include/math.h
@@ -21,6 +21,12 @@ hidden_proto (__finitel)
 hidden_proto (__isinfl)
 hidden_proto (__isnanl)
 #  endif
+
+#  if __USE_FLOAT128
+hidden_proto (__finitef128)
+hidden_proto (__isinff128)
+hidden_proto (__isnanf128)
+#  endif
 # endif
 
 libm_hidden_proto (__fpclassify)
@@ -38,5 +44,12 @@ libm_hidden_proto (__expl)
 libm_hidden_proto (__expm1l)
 # endif
 
+# if __USE_FLOAT128
+libm_hidden_proto (__fpclassifyf128)
+libm_hidden_proto (__issignalingf128)
+libm_hidden_proto (__expf128)
+libm_hidden_proto (__expm1f128)
+# endif
+
 #endif
 #endif
diff --git a/sysdeps/generic/fix-fp-int-convert-overflow.h b/sysdeps/generic/fix-fp-int-convert-overflow.h
index f53eaf0..4b0cd91 100644
--- a/sysdeps/generic/fix-fp-int-convert-overflow.h
+++ b/sysdeps/generic/fix-fp-int-convert-overflow.h
@@ -29,5 +29,7 @@
 #define FIX_DBL_LLONG_CONVERT_OVERFLOW 0
 #define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
 #define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LLONG_CONVERT_OVERFLOW 0
 
 #endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/generic/fix-fp-int-convert-overflow.h b/sysdeps/generic/math-type-macros-float128.h
similarity index 50%
copy from sysdeps/generic/fix-fp-int-convert-overflow.h
copy to sysdeps/generic/math-type-macros-float128.h
index f53eaf0..20582e4 100644
--- a/sysdeps/generic/fix-fp-int-convert-overflow.h
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -1,5 +1,5 @@
-/* Fix for conversion of floating point to integer overflow.  Generic version.
-   Copyright (C) 2015-2017 Free Software Foundation, Inc.
+/* Helper macros for _Float128 variants of type generic functions of libm.
+   Copyright (C) 2016 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
@@ -16,18 +16,34 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
-#define FIX_FP_INT_CONVERT_OVERFLOW_H	1
-
-/* Define these macros to 1 to workaround conversions of out-of-range
-   floating-point numbers to integer types failing to raise the
-   "invalid" exception, or raising spurious "inexact" or other
-   exceptions.  */
-#define FIX_FLT_LONG_CONVERT_OVERFLOW 0
-#define FIX_FLT_LLONG_CONVERT_OVERFLOW 0
-#define FIX_DBL_LONG_CONVERT_OVERFLOW 0
-#define FIX_DBL_LLONG_CONVERT_OVERFLOW 0
-#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
-#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
-
-#endif /* fix-fp-int-convert-overflow.h */
+#ifndef _MATH_TYPE_MACROS_FLOAT128
+#define _MATH_TYPE_MACROS_FLOAT128
+
+#include <math.h>
+#include <complex.h>
+
+#define M_LIT(c) __f128 (c)
+#define M_PFX FLT128
+#define M_SUF(c) c ## f128
+#define FLOAT _Float128
+#define M_STRTO_NAN __strtof128_nan
+
+#ifdef __CFLOAT128
+# define CFLOAT __CFLOAT128
+#else
+# define CFLOAT _Complex _Float128
+#endif
+
+#define M_MLIT(c) c ## f128
+
+
+/* Supply the generic macros.  */
+#include <math-type-macros.h>
+
+/* A hack, but an honest one. */
+#if __GNUC_PREREQ(6,2)
+# define __builtin_huge_valf128 __builtin_huge_valq
+# define __builtin_nanf128 __builtin_nanq
+#endif
+
+#endif
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index f965708..c5d7fae 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -23,6 +23,9 @@
 #include <float.h>
 #include <get-rounding-mode.h>
 
+/* Gather machine dependent _Floatn support.  */
+#include <bits/floatn.h>
+
 /* The original fdlibm code used statements like:
 	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
 	ix0 = *(n0+(int*)&x);			* high word of x *
@@ -181,6 +184,102 @@ do {								\
 } while (0)
 #endif
 
+/* Float128 variants. */
+#if __USE_FLOAT128
+extern _Float128 __ieee754_sqrtf128 (_Float128);
+extern _Float128 __ieee754_acosf128 (_Float128);
+extern _Float128 __ieee754_acoshf128 (_Float128);
+extern _Float128 __ieee754_logf128 (_Float128);
+extern _Float128 __ieee754_atanhf128 (_Float128);
+extern _Float128 __ieee754_asinf128 (_Float128);
+extern _Float128 __ieee754_atan2f128 (_Float128,_Float128);
+extern _Float128 __ieee754_expf128 (_Float128);
+extern _Float128 __ieee754_exp2f128 (_Float128);
+extern _Float128 __ieee754_exp10f128 (_Float128);
+extern _Float128 __ieee754_coshf128 (_Float128);
+extern _Float128 __ieee754_fmodf128 (_Float128,_Float128);
+extern _Float128 __ieee754_powf128 (_Float128,_Float128);
+extern _Float128 __ieee754_lgammaf128_r (_Float128,int *);
+extern _Float128 __ieee754_gammaf128_r (_Float128,int *);
+extern _Float128 __ieee754_lgammaf128 (_Float128);
+extern _Float128 __ieee754_gammaf128 (_Float128);
+extern _Float128 __ieee754_log10f128 (_Float128);
+extern _Float128 __ieee754_log2f128 (_Float128);
+extern _Float128 __ieee754_sinhf128 (_Float128);
+extern _Float128 __ieee754_hypotf128 (_Float128,_Float128);
+extern _Float128 __ieee754_j0f128 (_Float128);
+extern _Float128 __ieee754_j1f128 (_Float128);
+extern _Float128 __ieee754_y0f128 (_Float128);
+extern _Float128 __ieee754_y1f128 (_Float128);
+extern _Float128 __ieee754_jnf128 (int,_Float128);
+extern _Float128 __ieee754_ynf128 (int,_Float128);
+extern _Float128 __ieee754_remainderf128 (_Float128,_Float128);
+extern int   __ieee754_rem_pio2f128 (_Float128,_Float128*);
+extern _Float128 __ieee754_scalbf128 (_Float128,_Float128);
+extern int   __ieee754_ilogbf128 (_Float128);
+extern _Float128 __kernel_sinf128 (_Float128,_Float128,int);
+extern _Float128 __kernel_cosf128 (_Float128,_Float128);
+extern _Float128 __kernel_tanf128 (_Float128,_Float128,int);
+extern void __kernel_sincosf128 (_Float128,_Float128,
+			      _Float128 *,_Float128 *, int);
+extern int   __kernel_rem_pio2f128 (_Float128*,_Float128*,int,int,
+				 int,const int*);
+extern int __finitef128 (_Float128);
+extern int __ilogbf128 (_Float128);
+extern int __isinff128 (_Float128);
+extern int __isnanf128 (_Float128);
+extern _Float128 __atanf128 (_Float128);
+extern _Float128 __copysignf128 (_Float128, _Float128);
+extern _Float128 __expm1f128 (_Float128);
+extern _Float128 __floorf128 (_Float128);
+extern _Float128 __frexpf128 (_Float128, int *);
+extern _Float128 __ldexpf128 (_Float128, int);
+extern _Float128 __log1pf128 (_Float128);
+extern _Float128 __nanf128 (const char *);
+extern _Float128 __rintf128 (_Float128);
+extern _Float128 __scalbnf128 (_Float128, int);
+extern _Float128 __sqrtf128 (_Float128 x);
+extern _Float128 fabsf128 (_Float128 x);
+extern void __sincosf128 (_Float128, _Float128 *, _Float128 *);
+extern _Float128 __logbf128 (_Float128 x);
+extern _Float128 __significandf128 (_Float128 x);
+extern _Float128 __x2y2m1f128 (_Float128 x, _Float128 y);
+extern _Float128 __gamma_productf128 (_Float128 x, _Float128 x_eps,
+				     int n, _Float128 *eps);
+extern _Float128 __lgamma_negf128 (_Float128 x, int *signgamp);
+extern _Float128 __lgamma_productf128 (_Float128 t, _Float128 x,
+				      _Float128 x_eps, int n);
+
+/* Fixup some builtins on compilers which support __float128 and not
+   _Float128.  */
+# if __GNUC_PREREQ (7, 0)
+#  define BUILTIN_FABSF128 __builtin_fabsf128
+#  define BUILTIN_COPYSIGNF128 __builtin_copysignf128
+# else
+#  define BUILTIN_FABSF128 __builtin_fabsq
+#  define BUILTIN_COPYSIGNF128 __builtin_copysignq
+
+
+/* __builtin_isinf_sign is broken in GCC < 7 for float128.  */
+#  include <ieee754_float128.h>
+extern inline int __isinff128(_Float128 x)
+{
+	int64_t hx,lx;
+	GET_FLOAT128_WORDS64 (hx,lx,x);
+	lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL;
+	lx |= -lx;
+	return ~(lx >> 63) & (hx >> 62);
+}
+# endif
+
+extern inline _Float128 __copysignf128 (_Float128 x, _Float128 y)
+{ return BUILTIN_COPYSIGNF128 (x, y); }
+extern inline _Float128 fabsf128 (_Float128 x)
+{ return BUILTIN_FABSF128 (x); }
+extern inline _Float128 signbitf128 (_Float128 x)
+{ return __builtin_signbit (x); }
+#endif
+
 /* We need to guarantee an expansion of name when building
    ldbl-128 files as another type (e.g _Float128).  */
 #define mathx_hidden_def(name) hidden_def(name)
@@ -431,13 +530,24 @@ extern long double __lgamma_productl (long double t, long double x,
    })
 #endif
 
+#if __USE_FLOAT128
+# define __EXPR_FLT128(x, yes, no)				\
+  __builtin_choose_expr (__builtin_types_compatible_p		\
+			 (__typeof (x), long double), no, yes)
+#else
+# define __EXPR_FLT128(x, yes, no) no
+#endif
+
+
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
+
 #define min_of_type(type) __builtin_choose_expr		\
   (__builtin_types_compatible_p (type, float),		\
    FLT_MIN,						\
    __builtin_choose_expr				\
    (__builtin_types_compatible_p (type, double),	\
-    DBL_MIN, LDBL_MIN))
+    DBL_MIN,						\
+    __EXPR_FLT128 (x, FLT128_MIN, LDBL_MIN)))
 
 /* If X (which is not a NaN) is subnormal, force an underflow
    exception.  */
diff --git a/sysdeps/ieee754/ldbl-opt/s_sin.c b/sysdeps/ieee754/ldbl-opt/s_sin.c
index 04e60e2..6932ccc 100644
--- a/sysdeps/ieee754/ldbl-opt/s_sin.c
+++ b/sysdeps/ieee754/ldbl-opt/s_sin.c
@@ -4,6 +4,7 @@
 #define __DECL_SIMD_sincos_disable
 #define __DECL_SIMD_sincos_disablef
 #define __DECL_SIMD_sincos_disablel
+#define __DECL_SIMD_sincos_disablef128
 #include <math_ldbl_opt.h>
 #undef NAN
 #undef sincos

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=069a471750fe3331c3a2c4f7cc28026ac27ab1e7

commit 069a471750fe3331c3a2c4f7cc28026ac27ab1e7
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Tue Jul 19 15:06:52 2016 -0500

    float128: Expose _Float128 finite math functions.
    
    Similar to the other types, entry points to
    dodge wrapper call for non-finite arguments.
    
    	* math/bits/math-finite.h:
    	(__acosf128_finite): New function declaration.
    	(__acoshf128_finite): Likewise.
    	(__asinf128_finite): Likewise.
    	(__atan2f128_finite): Likewise.
    	(__atanhf128_finite): Likewise.
    	(__coshf128_finite): Likewise.
    	(__expf128_finite): Likewise.
    	(__exp10f128_finite): Likewise.
    	(__exp2f128_finite): Likewise.
    	(__fmodf128_finite): Likewise.
    	(__hypotf128_finite): Likewise.
    	(__j0f128_finite): Likewise.
    	(__y0f128_finite): Likewise.
    	(__j1f128_finite): Likewise.
    	(__y1f128_finite): Likewise.
    	(__jnf128_finite): Likewise.
    	(__ynf128_finite): Likewise.
    	(__logf128_finite): Likewise.
    	(__log10f128_finite): Likewise.
    	(__log2f128_finite): Likewise.
    	(__powf128_finite): Likewise.
    	(__remainderf128_finite): Likewise.
    	(__sinhf128_finite): Likewise.
    	(__sqrtf128_finite): Likewise.
    	(__gammaf128_r_finite): Likewise.
    	(__lgammaf128_r_finite): Likewise.
    	(lgammaf128): Inline override of the
    	same name.
    	(tgammaf128): Likewise.

diff --git a/math/bits/math-finite.h b/math/bits/math-finite.h
index 02da374..b4a6779 100644
--- a/math/bits/math-finite.h
+++ b/math/bits/math-finite.h
@@ -32,6 +32,9 @@ extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (acosf128, (_Float128), __acosf128_finite);
+#endif
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* acosh.  */
@@ -47,6 +50,9 @@ extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (acoshf128, (_Float128), __acoshf128_finite);
+#endif
 
 /* asin.  */
 extern double __REDIRECT_NTH (asin, (double), __asin_finite);
@@ -60,6 +66,9 @@ extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (asinf128, (_Float128), __asinf128_finite);
+#endif
 
 /* atan2.  */
 extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite);
@@ -75,6 +84,10 @@ extern long double __REDIRECT_NTH (atan2l, (long double, long double),
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (atan2f128, (_Float128, _Float128),
+				 __atan2f128_finite);
+#endif
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* atanh.  */
@@ -90,6 +103,9 @@ extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (atanhf128, (_Float128), __atanhf128_finite);
+#endif
 
 /* cosh.  */
 extern double __REDIRECT_NTH (cosh, (double), __cosh_finite);
@@ -103,6 +119,9 @@ extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (coshf128, (_Float128), __coshf128_finite);
+#endif
 
 /* exp.  */
 extern double __REDIRECT_NTH (exp, (double), __exp_finite);
@@ -116,6 +135,9 @@ extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (expf128, (_Float128), __expf128_finite);
+#endif
 
 #ifdef __USE_GNU
 /* exp10.  */
@@ -128,6 +150,9 @@ extern long double __REDIRECT_NTH (exp10l, (long double), __exp10_finite);
 extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (exp10f128, (_Float128), __exp10f128_finite);
+# endif
 
 /* pow10.  */
 extern double __REDIRECT_NTH (pow10, (double), __exp10_finite);
@@ -153,6 +178,9 @@ extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
 #  endif
 # endif
 #endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (exp2f128, (_Float128), __exp2f128_finite);
+# endif
 
 /* fmod.  */
 extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite);
@@ -168,6 +196,10 @@ extern long double __REDIRECT_NTH (fmodl, (long double, long double),
 #  endif
 # endif
 #endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (fmodf128, (_Float128, _Float128),
+				 __fmodf128_finite);
+# endif
 
 #if defined __USE_XOPEN || defined __USE_ISOC99
 /* hypot.  */
@@ -185,6 +217,10 @@ extern long double __REDIRECT_NTH (hypotl, (long double, long double),
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (hypotf128, (_Float128, _Float128),
+				   __hypotf128_finite);
+#endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
 /* j0.  */
@@ -199,6 +235,9 @@ extern long double __REDIRECT_NTH (j0l, (long double), __j0_finite);
 extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (j0f128, (_Float128), __j0f128_finite);
+# endif
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -214,6 +253,9 @@ extern long double __REDIRECT_NTH (y0l, (long double), __y0_finite);
 extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (y0f128, (_Float128), __y0f128_finite);
+# endif
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -229,6 +271,9 @@ extern long double __REDIRECT_NTH (j1l, (long double), __j1_finite);
 extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (j1f128, (_Float128), __j1f128_finite);
+# endif
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -244,6 +289,9 @@ extern long double __REDIRECT_NTH (y1l, (long double), __y1_finite);
 extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (y1f128, (_Float128), __y1f128_finite);
+# endif
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -259,6 +307,9 @@ extern long double __REDIRECT_NTH (jnl, (int, long double), __jn_finite);
 extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (jnf128, (int, _Float128), __jnf128_finite);
+# endif
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -274,6 +325,9 @@ extern long double __REDIRECT_NTH (ynl, (int, long double), __yn_finite);
 extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (ynf128, (int, _Float128), __ynf128_finite);
+# endif
 #endif
 
 #ifdef __USE_MISC
@@ -291,6 +345,10 @@ extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
 #   endif
 #  endif
 # endif
+# if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (lgammaf128_r, (_Float128, int *),
+				   __lgammaf128_r_finite);
+# endif
 #endif
 
 extern double __lgamma_r_finite (double, int *);
@@ -301,6 +359,9 @@ extern long double __REDIRECT_NTH (__lgammal_r_finite, (long double, int *),
 #else
 extern long double __lgammal_r_finite (long double, int *);
 #endif
+#if __USE_FLOAT128
+extern _Float128 __lgammaf128_r_finite (_Float128, int *);
+#endif
 
 #if ((defined __USE_XOPEN || defined __USE_ISOC99) \
      && defined __extern_always_inline)
@@ -336,6 +397,17 @@ __extern_always_inline long double __NTH (lgammal (long double __d))
 # endif
 }
 # endif
+# if __USE_FLOAT128
+__extern_always_inline _Float128 __NTH (lgammaf128 (_Float128 __d))
+{
+# if defined __USE_MISC || defined __USE_XOPEN
+  return __lgammaf128_r_finite (__d, &signgam);
+# else
+  int __local_signgam = 0;
+  return __lgammaf128_r_finite (__d, &__local_signgam);
+# endif
+}
+# endif
 #endif
 
 #if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \
@@ -371,6 +443,9 @@ extern long double __REDIRECT_NTH (logl, (long double), __logl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (logf128, (_Float128), __logf128_finite);
+#endif
 
 /* log10.  */
 extern double __REDIRECT_NTH (log10, (double), __log10_finite);
@@ -384,6 +459,9 @@ extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (log10f128, (_Float128), __log10f128_finite);
+#endif
 
 #ifdef __USE_ISOC99
 /* log2.  */
@@ -397,6 +475,9 @@ extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (log2f128, (_Float128), __log2f128_finite);
+#endif
 
 /* pow.  */
 extern double __REDIRECT_NTH (pow, (double, double), __pow_finite);
@@ -412,6 +493,10 @@ extern long double __REDIRECT_NTH (powl, (long double, long double),
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (powf128, (_Float128, _Float128),
+				   __powf128_finite);
+#endif
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* remainder.  */
@@ -429,6 +514,10 @@ extern long double __REDIRECT_NTH (remainderl, (long double, long double),
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (remainderf128, (_Float128, _Float128),
+				   __remainderf128_finite);
+#endif
 
 #if (defined __USE_MISC							\
      || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))
@@ -460,6 +549,9 @@ extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (sinhf128, (_Float128), __sinhf128_finite);
+#endif
 
 /* sqrt.  */
 extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite);
@@ -473,6 +565,9 @@ extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite);
 #  endif
 # endif
 #endif
+#if __USE_FLOAT128
+extern _Float128 __REDIRECT_NTH (sqrtf128, (_Float128), __sqrtf128_finite);
+#endif
 
 #if defined __USE_ISOC99 && defined __extern_always_inline
 /* tgamma.  */
@@ -503,4 +598,13 @@ __extern_always_inline long double __NTH (tgammal (long double __d))
   return __local_signgam < 0 ? -__res : __res;
 }
 # endif
+# if __USE_FLOAT128
+extern _Float128 __gammaf128_r_finite (_Float128, int *);
+__extern_always_inline _Float128 __NTH (tgammaf128 (_Float128 __d))
+{
+  int __local_signgam = 0;
+  _Float128 __res = __gammaf128_r_finite (__d, &__local_signgam);
+  return __local_signgam < 0 ? -__res : __res;
+}
+# endif
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1ad880cc20fd840a867c25356b544421300a2688

commit 1ad880cc20fd840a867c25356b544421300a2688
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Dec 9 11:41:55 2016 -0200

    float128: Extend __MATH_TG for float128 support

diff --git a/math/math.h b/math/math.h
index 9cce061..bcf4488 100644
--- a/math/math.h
+++ b/math/math.h
@@ -345,6 +345,30 @@ extern int signgam;
 #ifdef __NO_LONG_DOUBLE_MATH
 # define __MATH_TG(TG_ARG, FUNC, ARGS)					\
   (sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS)
+#elif __USE_FLOAT128
+# if __USE_ISOC11 /* if defined __STDC_VERSION__ && __GNUC_PREREQ (4, 9) */
+#  define __MATH_TG(TG_ARG, FUNC, ARGS)	\
+     _Generic ((TG_ARG),		\
+       _Float128: FUNC ## f128 ARGS,	\
+       long double: FUNC ## l ARGS,	\
+       float: FUNC ## f ARGS,		\
+       default: FUNC ARGS)
+# else
+#  if ! __GNUC__
+#   error "Building __float128 support requires GCC or C11 support."
+#  endif
+#  define __MATH_TG(TG_ARG, FUNC, ARGS)					\
+     __builtin_choose_expr						\
+     (__builtin_types_compatible_p (__typeof (TG_ARG), __float128),	\
+      FUNC ## f128 ARGS,						\
+      __builtin_choose_expr						\
+      (__builtin_types_compatible_p (__typeof (TG_ARG), float),		\
+       FUNC ## f ARGS,							\
+       __builtin_choose_expr						\
+       (__builtin_types_compatible_p (__typeof (TG_ARG), long double),	\
+	FUNC ## l ARGS,							\
+	FUNC ARGS)))
+# endif
 #else
 # define __MATH_TG(TG_ARG, FUNC, ARGS)		\
   (sizeof (TG_ARG) == sizeof (float)		\

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d5f83b521a8cdd234465daff5f8047ccb9c189a5

commit d5f83b521a8cdd234465daff5f8047ccb9c189a5
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Tue Nov 29 09:42:26 2016 -0200

    float128: Protect signbit macro definition with __USE_FLOAT128
    
    2016-11-07  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* math/math.h (signbit): Only use __builtin_signbit* if not
    	building with support for __float128.

diff --git a/math/math.h b/math/math.h
index 582c210..9cce061 100644
--- a/math/math.h
+++ b/math/math.h
@@ -391,7 +391,9 @@ enum
 # endif
 
 /* Return nonzero value if sign of X is negative.  */
-# if __GNUC_PREREQ (4,0)
+# if __USE_FLOAT128
+#  define signbit(x) __builtin_signbit (x)
+# elif __GNUC_PREREQ (4,0)
 #  define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
 # else
 #  define signbit(x) __MATH_TG ((x), __signbit, (x))

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b13a81486e5152241d98b67e9b50c50c9625a4dd

commit b13a81486e5152241d98b67e9b50c50c9625a4dd
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Wed Jul 20 11:53:36 2016 -0500

    float128: Add public _Float128 declarations to libm.
    
    This introduces the machine-dependent bits/floatn.h to control
    the inclusion of _Float128 ABI.
    
    This leverages the _Generic feature of C11 as __USE_FLOAT128
    must imply a test for __STDC_WANT_IEC_60559_TYPES_EXT__
    which requires C11 to prevent increasingly complex math
    macros for the sake of old (and unsupported?) GCC toolchains.
    
    	* bits/floatn.h: New file.
    	* bits/huge_val_flt128.h: New file.
    	* math/Makefile (headers): Install bits/floatn.h
    
    	* math/math.h: Define and undefine __FLOATN_TYPE as
    	needed for _FloatN types. Add prototypes for _Float128
    	if __USE_FLOAT128.
    
    	[__GNUC_PREREQ(6,2)] (signbit): Define as type-generic macro.
    	[__USE_FLOAT128] (fpclassify): Use _Generic macro selection when
    	a non-GCC compiler is used.
    	[__USE_FLOAT128] (signbit): Likewise.
    	[__USE_FLOAT128] (isfinite): Likewise.
    	[__USE_FLOAT128] (isnan): Likewise.
    	[__USE_FLOAT128] (issignaling): Likewise.
    
    	[__USE_FLOAT128] (isinf): This builtin is broken on GCC.
    	Explicitly call __isinff128 for _Float128 types, otherwise
    	use the builtin.
    
    	[__USE_FLOAT128] (__f128): New macro to apply proper _Float128
    	literal suffix depending on compiler version for __USE_GNU
    	enabled constants.
    	[__USE_FLOAT128] (M_Ef128): New _GNU_SOURCE enabled macro.
    	[__USE_FLOAT128] (M_LOG2Ef128): Likewise.
    	[__USE_FLOAT128] (M_LOG10Ef128): Likewise.
    	[__USE_FLOAT128] (M_LN2f128): Likewise.
    	[__USE_FLOAT128] (M_LN10f128): Likewise.
    	[__USE_FLOAT128] (M_PIf128): Likewise.
    	[__USE_FLOAT128] (M_PI_2f128): Likewise.
    	[__USE_FLOAT128] (M_PI_4f128): Likewise.
    	[__USE_FLOAT128] (M_1_PIf128): Likewise.
    	[__USE_FLOAT128] (M_2_PIf128): Likewise.
    	[__USE_FLOAT128] (M_SQRT2f128): Likewise.
    	[__USE_FLOAT128] (M_SQRT1_2f128): Likewise.
    
    	* math/mathcalls.h (drem): Only define if __FLOATN_TYPE
    	not defined.
    	(gamma): Likewise.
    	(nexttoward): Likewise.
    	(significand): Likewise.
    	(pow10): Likewise.
    	(scalb): Likewise.
    	(finite): Likewise.
    	(isinf): Likewise.
    	(isnan): Likewise.

diff --git a/bits/floatn.h b/bits/floatn.h
new file mode 100644
index 0000000..57db3a6
--- /dev/null
+++ b/bits/floatn.h
@@ -0,0 +1,27 @@
+/* Macros to control TS 18661-3 glibc features.
+   Copyright (C) 2016 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/>.  */
+
+/* Defined if the compiler supports the _Float128 (and __float128) type.  */
+#define __USE_FLOAT128 0
+
+/* Defined if the runtime supports _Float128.  */
+#define __HAVE_FLOAT128 0
+
+/* Defined for GCC versions which support the __float128 type, but not
+   _Complex __float128.  This resolves to a complex binary128 type.  */
+#undef __CFLOAT128
diff --git a/bits/huge_val_flt128.h b/bits/huge_val_flt128.h
new file mode 100644
index 0000000..c32b401
--- /dev/null
+++ b/bits/huge_val_flt128.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VAL_F128' constant.
+   Copyright (C) 2016 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 _MATH_H
+# error "Never use <bits/huge_val_flt128.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ (7, 0)
+# define HUGE_VAL_F128	(__builtin_huge_valf128 ())
+#elif __GNUC_PREREQ (6, 2)
+# define HUGE_VAL_F128	(__builtin_huge_valq ())
+#else
+# define HUGE_VAL_F128	((_Float128) HUGE_VAL)
+#endif
diff --git a/math/Makefile b/math/Makefile
index 9360598..91dd3fe 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -29,7 +29,7 @@ headers		:= math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
 		   bits/math-finite.h bits/math-vector.h \
 		   bits/libm-simd-decl-stubs.h bits/iscanonical.h \
 		   bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
-		   bits/long-double.h
+		   bits/long-double.h bits/huge_val_flt128.h bits/floatn.h
 
 # FPU support code.
 aux		:= setfpucw fpu_control
diff --git a/math/bits/cmathcalls.h b/math/bits/cmathcalls.h
index 6e13930..7f042db 100644
--- a/math/bits/cmathcalls.h
+++ b/math/bits/cmathcalls.h
@@ -44,7 +44,9 @@
 #error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
 #endif
 
-#define _Mdouble_complex_ _Mdouble_ _Complex
+#ifndef _Mdouble_complex_
+# define _Mdouble_complex_ _Mdouble_ _Complex
+#endif
 
 
 /* Trigonometric functions.  */
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 3d3b414..187172c 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -121,7 +121,9 @@ __MATHCALL (exp10,, (_Mdouble_ __x));
 #endif
 #ifdef __USE_GNU
 /* Another name occasionally used.  */
+# ifndef __FLOATN_TYPE
 __MATHCALL (pow10,, (_Mdouble_ __x));
+# endif
 #endif
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
@@ -198,14 +200,16 @@ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 _Mdouble_END_NAMESPACE
 
 #ifdef __USE_MISC
-# if (!defined __cplusplus \
-      || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
-      || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't.  */
+# if ((!defined __cplusplus \
+       || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
+       || __MATH_DECLARING_DOUBLE == 0)) /* isinff or isinfl don't.  */ \
+      && !defined __FLOATN_TYPE
 /* Return 0 if VALUE is finite or NaN, +1 if it
    is +Infinity, -1 if it is -Infinity.  */
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
 # endif
 
+# ifndef __FLOATN_TYPE
 /* Return nonzero if VALUE is finite and not NaN.  */
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 
@@ -215,6 +219,8 @@ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 
 /* Return the fractional part of X after dividing out `ilogb (X)'.  */
 __MATHCALL (significand,, (_Mdouble_ __x));
+# endif
+
 #endif /* Use misc.  */
 
 #ifdef __USE_ISOC99
@@ -236,9 +242,10 @@ __END_NAMESPACE_C99
 __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
 
 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
-# if (!defined __cplusplus \
-      || __cplusplus < 201103L /* isnan conflicts with C++11.  */ \
-      || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't.  */
+# if ((!defined __cplusplus \
+       || __cplusplus < 201103L /* isnan conflicts with C++11.  */ \
+       || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't.  */ \
+      && !defined __FLOATN_TYPE
 /* Return nonzero if VALUE is not a number.  */
 __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
 # endif
@@ -272,8 +279,10 @@ __END_NAMESPACE_C99
 #endif
 
 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# ifndef __FLOATN_TYPE
 /* Obsolete alias for `lgamma'.  */
 __MATHCALL (gamma,, (_Mdouble_));
+# endif
 #endif
 
 #ifdef __USE_MISC
@@ -292,7 +301,7 @@ __MATHCALL (rint,, (_Mdouble_ __x));
 
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT && !defined __FLOATN_TYPE
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
@@ -444,9 +453,10 @@ __MATHDECL_1 (int, setpayload,, (_Mdouble_ *__x, _Mdouble_ __payload));
 __MATHDECL_1 (int, setpayloadsig,, (_Mdouble_ *__x, _Mdouble_ __payload));
 #endif
 
-#if defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
-			   && __MATH_DECLARING_DOUBLE	\
-			   && !defined __USE_XOPEN2K8)
+#if (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
+			    && __MATH_DECLARING_DOUBLE	  \
+			    && !defined __USE_XOPEN2K8))  \
+     && !defined __FLOATN_TYPE
 /* Return X times (2 to the Nth power).  */
 __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
 #endif
diff --git a/math/complex.h b/math/complex.h
index 59ce30e..653c85f 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -22,11 +22,15 @@
 #ifndef _COMPLEX_H
 #define _COMPLEX_H	1
 
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
 
 /* Get general and ISO C99 specific information.  */
 #include <bits/mathdef.h>
 
+/* Gather machine-dependent _FloatN type support.  */
+#include <bits/floatn.h>
+
 __BEGIN_DECLS
 
 /* We might need to add support for more compilers here.  But since ISO
@@ -55,6 +59,10 @@ __BEGIN_DECLS
 # define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
 #endif
 
+#if __USE_FLOAT128
+# define CMPLXF128(x, y) __builtin_complex ((__float128) (x), (__float128) (y))
+#endif
+
 /* The file <bits/cmathcalls.h> contains the prototypes for all the
    actual math functions.  These macros are used for those prototypes,
    so we can easily declare each function as both `name' and `__name',
@@ -84,6 +92,23 @@ __BEGIN_DECLS
 #undef	_Mdouble_
 #undef	__MATH_PRECNAME
 
+#if __USE_FLOAT128
+# ifndef _Mfloat128_
+#  define _Mfloat128_		_Float128
+# endif
+/* GCC < 7 requires extra convincing to expose a complex float128 type.  */
+# ifdef __CFLOAT128
+#  undef _Mdouble_complex_
+#  define _Mdouble_complex_	__CFLOAT128
+# endif
+# define _Mdouble_ 		_Mfloat128_
+# define __MATH_PRECNAME(name)	name##f128
+# include <bits/cmathcalls.h>
+# undef	_Mdouble_
+# undef	__MATH_PRECNAME
+# undef	_Mdouble_complex_
+#endif
+
 /* And the long double versions.  It is non-critical to define them
    here unconditionally since `long double' is required in ISO C99.  */
 #if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC)	\
diff --git a/math/math.h b/math/math.h
index 09f0ce8..582c210 100644
--- a/math/math.h
+++ b/math/math.h
@@ -34,9 +34,17 @@ __BEGIN_DECLS
 /* Get machine-dependent vector math functions declarations.  */
 #include <bits/math-vector.h>
 
+/* Gather machine dependent type support.  */
+#include <bits/floatn.h>
+
 /* Get machine-dependent HUGE_VAL value (returned on overflow).
    On all IEEE754 machines, this is +Infinity.  */
 #include <bits/huge_val.h>
+
+#if __USE_FLOAT128
+# include <bits/huge_val_flt128.h>
+#endif
+
 #ifdef __USE_ISOC99
 # include <bits/huge_valf.h>
 # include <bits/huge_vall.h>
@@ -206,6 +214,7 @@ enum
   extern type __MATH_PRECNAME(function,suffix) args __THROW
 
 #define _Mdouble_		double
+#undef __FLOATN_TYPE
 #define __MATH_PRECNAME(name,r)	__CONCAT(name,r)
 #define __MATH_DECLARING_DOUBLE  1
 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
@@ -226,6 +235,7 @@ enum
 # ifndef _Mfloat_
 #  define _Mfloat_		float
 # endif
+# undef __FLOATN_TYPE
 # define _Mdouble_		_Mfloat_
 # define __MATH_PRECNAME(name,r) name##f##r
 # define __MATH_DECLARING_DOUBLE  0
@@ -272,6 +282,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
 #  ifndef _Mlong_double_
 #   define _Mlong_double_	long double
 #  endif
+#  undef __FLOATN_TYPE
 #  define _Mdouble_		_Mlong_double_
 #  define __MATH_PRECNAME(name,r) name##l##r
 #  define __MATH_DECLARING_DOUBLE  0
@@ -288,6 +299,29 @@ extern long double __REDIRECT_NTH (nexttowardl,
 # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */
 
 #endif	/* Use ISO C99.  */
+
+/* Include the file of declarations again, this time using `_Float128'
+   instead of `double' and appending f128 to each function name.  */
+
+#if __USE_FLOAT128
+#ifndef _Mfloat128_
+# define _Mfloat128_		_Float128
+#endif
+#define __FLOATN_TYPE		1
+#define _Mdouble_		_Mfloat128_
+#define __MATH_PRECNAME(name,r) name##f128##r
+#define __MATH_DECLARING_DOUBLE  0
+#define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+#define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
+#include <bits/mathcalls.h>
+#undef __FLOATN_TYPE
+#undef	_Mdouble_
+#undef _Mdouble_BEGIN_NAMESPACE
+#undef _Mdouble_END_NAMESPACE
+#undef	__MATH_PRECNAME
+#undef __MATH_DECLARING_DOUBLE
+#endif /* Use _Float128.  */
+
 #undef	__MATHDECL_1
 #undef	__MATHDECL
 #undef	__MATHCALL
@@ -386,7 +420,12 @@ enum
 # endif
 
 /* Return nonzero value if X is positive or negative infinity.  */
-# if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
+# if __USE_FLOAT128 && !defined __SUPPORT_SNAN__ && defined __GNUC__
+/* __builtin_isinf_sign is broken for float128.  */
+#  define isinf(x) \
+     (__builtin_types_compatible_p (typeof (x), _Float128) \
+      ? __isinff128 (x) : __builtin_isinf_sign (x))
+# elif __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
 #  define isinf(x) __builtin_isinf_sign (x)
 # else
 #  define isinf(x) __MATH_TG ((x), __isinf, (x))
@@ -538,6 +577,26 @@ extern int matherr (struct exception *__exc);
 # define M_SQRT1_2l	0.707106781186547524400844362104849039L /* 1/sqrt(2) */
 #endif
 
+#if __USE_FLOAT128
+# if defined __GNUC__ && !__GNUC_PREREQ (7,0)
+#  define __f128(x) x ## q
+# else
+#  define __f128(x) x ## f128
+# endif
+# define M_Ef128	__f128 (2.718281828459045235360287471352662498) /* e */
+# define M_LOG2Ef128	__f128 (1.442695040888963407359924681001892137) /* log_2 e */
+# define M_LOG10Ef128	__f128 (0.434294481903251827651128918916605082) /* log_10 e */
+# define M_LN2f128	__f128 (0.693147180559945309417232121458176568) /* log_e 2 */
+# define M_LN10f128	__f128 (2.302585092994045684017991454684364208) /* log_e 10 */
+# define M_PIf128	__f128 (3.141592653589793238462643383279502884) /* pi */
+# define M_PI_2f128	__f128 (1.570796326794896619231321691639751442) /* pi/2 */
+# define M_PI_4f128	__f128 (0.785398163397448309615660845819875721) /* pi/4 */
+# define M_1_PIf128	__f128 (0.318309886183790671537767526745028724) /* 1/pi */
+# define M_2_PIf128	__f128 (0.636619772367581343075535053490057448) /* 2/pi */
+# define M_2_SQRTPIf128	__f128 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
+# define M_SQRT2f128	__f128 (1.414213562373095048801688724209698079) /* sqrt(2) */
+# define M_SQRT1_2f128	__f128 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
+#endif
 
 /* When compiling in strict ISO C compatible mode we must not use the
    inline functions since they, among other things, do not set the

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2fe0b836daecea4b53e49a4161b4710b5cec02b4

commit 2fe0b836daecea4b53e49a4161b4710b5cec02b4
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Wed Jul 20 12:14:21 2016 -0500

    Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
    
    This is defined by TS 18661-3 for supporting the _FloatN
    and _FloatNx types.
    
    This will also implicitly enforce a minimum GCC 4.9.  Given
    the standard is a C11 derivative, it would seem reasonable
    to assume a C11 compiler with _Generic support.  This allows
    for much simpler type classification macros which in theory
    should be supported on any C11 compiler.
    
    	* bits/libc-header-start.h:
    	(__GLIBC_USR_IEC_60559_TYPES_EXT): New macro.

diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h
index 860225d..59638d8 100644
--- a/bits/libc-header-start.h
+++ b/bits/libc-header-start.h
@@ -59,3 +59,12 @@
 #else
 # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
 #endif
+
+/* ISO/IEC TS 18661-3:2014 defines the
+   __STDC_WANT_IEC_60559_TYPES_EXT__ macro.  */
+#undef __GLIBC_USE_IEC_60559_TYPES_EXT
+#if (defined __STDC_WANT_IEC_60559_TYPES_EXT__ || defined __USE_GNU)
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
+#else
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 0
+#endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ee658ae0c41bdb08e98e037ed03d34f3db5f8281

commit ee658ae0c41bdb08e98e037ed03d34f3db5f8281
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Jul 15 14:05:51 2016 -0500

    float128: Add _Float128 make bits to libm.
    
    This adds the appropriate common bits for a platform to
    enable float128 and expose ABI.
    
    2016-10-21  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
    
    	* math/Makefile:
    	(type-float128-suffix): New variable
    	(type-float128-routines): Likewise
    	(type-float128-yes): Likewise
    	(types): Append float128 if supported
    
    	* sysdeps/ieee754/float128/Makeconfig: New file.
    	* sysdeps/ieee754/float128/Versions: New file.

diff --git a/math/Makefile b/math/Makefile
index 983e500..9360598 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -104,7 +104,7 @@ libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \
 # Finally, note that types is an intentionally recursive variable.
 # We only know the full set of supported types for the target machine
 # after the Rules makefile has been parsed.
-types = $(type-ldouble-$(long-double-fcts)) double float
+types-basic = $(type-ldouble-$(long-double-fcts)) double float
 
 # long double support
 type-ldouble-suffix := l
@@ -121,12 +121,23 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2	\
 type-float-suffix := f
 type-float-routines := k_rem_pio2f
 
+# _Float128 support
+type-float128-suffix := f128
+type-float128-routines := t_sincosf128 k_sincosf128
+type-float128-yes := float128
+types = $(types-basic) $(type-float128-$(float128-fcts))
+
+# For each of the basic types (float, double, long double), replace the
+# occurrences of 'F' in arg 1 with the appropriate suffix for the type.
+type-basic-foreach = $(foreach t, $(types-basic), \
+		       $(subst F,$(type-$(t)-suffix),$(1)))
 
 # Apply suffix to each type in arg 1
 type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1)))
 
 libm-routines = $(strip $(libm-support) $(libm-compat-calls)		\
-			$(call type-foreach, $(libm-compat-calls-auto))	\
+			$(call type-basic-foreach,			\
+			       $(libm-compat-calls-auto))		\
 			$(call type-foreach, $(libm-calls))		\
 			$(foreach t, $(types), $(type-$(t)-routines))) 	\
 
@@ -407,6 +418,7 @@ endif
 CFLAGS-s_modf.c += -fsignaling-nans
 CFLAGS-s_modff.c += -fsignaling-nans
 CFLAGS-s_modfl.c += -fsignaling-nans
+CFLAGS-s_modff128.c += -fsignaling-nans
 
 # The -lieee library is actually an object file.
 # The module just defines the _LIB_VERSION_ variable.
diff --git a/sysdeps/ieee754/float128/Makeconfig b/sysdeps/ieee754/float128/Makeconfig
new file mode 100644
index 0000000..6c385d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makeconfig
@@ -0,0 +1,3 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-fcts = yes
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
new file mode 100644
index 0000000..6274c73
--- /dev/null
+++ b/sysdeps/ieee754/float128/Versions
@@ -0,0 +1,134 @@
+%include <float128-abi.h>
+%ifndef FLOAT128_VERSION
+% error "float128-abi.h must define FLOAT128_VERSION"
+%endif
+libm {
+  FLOAT128_VERSION {
+    acosf128;
+    acoshf128;
+    asinf128;
+    asinhf128;
+    atan2f128;
+    atanf128;
+    atanhf128;
+    cabsf128;
+    cacosf128;
+    cacoshf128;
+    cargf128;
+    casinf128;
+    casinhf128;
+    catanf128;
+    catanhf128;
+    cbrtf128;
+    ccosf128;
+    ccoshf128;
+    ceilf128;
+    cexpf128;
+    cimagf128;
+    clog10f128;
+    clogf128;
+    copysignf128;
+    conjf128;
+    cosf128;
+    coshf128;
+    cpowf128;
+    cprojf128;
+    crealf128;
+    csinf128;
+    csinhf128;
+    csqrtf128;
+    ctanf128;
+    ctanhf128;
+    erff128;
+    erfcf128;
+    exp10f128;
+    exp2f128;
+    expf128;
+    expm1f128;
+    fabsf128;
+    fdimf128;
+    floorf128;
+    fmaf128;
+    fmaxf128;
+    fminf128;
+    fmodf128;
+    frexpf128;
+    getpayloadf128;
+    hypotf128;
+    ilogbf128;
+    j0f128;
+    j1f128;
+    jnf128;
+    ldexpf128;
+    lgammaf128;
+    lgammaf128_r;
+    llrintf128;
+    llroundf128;
+    log10f128;
+    log1pf128;
+    log2f128;
+    logf128;
+    logbf128;
+    lrintf128;
+    lroundf128;
+    modff128;
+    nanf128;
+    nearbyintf128;
+    nextafterf128;
+    nextdownf128;
+    nextupf128;
+    powf128;
+    remainderf128;
+    remquof128;
+    rintf128;
+    roundf128;
+    scalblnf128;
+    scalbnf128;
+    sincosf128;
+    sinf128;
+    sinhf128;
+    sqrtf128;
+    tanf128;
+    tanhf128;
+    tgammaf128;
+    totalorderf128;
+    totalordermagf128;
+    truncf128;
+    y0f128;
+    y1f128;
+    ynf128;
+    __acosf128_finite;
+    __acoshf128_finite;
+    __asinf128_finite;
+    __atan2f128_finite;
+    __atanhf128_finite;
+    __coshf128_finite;
+    __exp10f128_finite;
+    __exp2f128_finite;
+    __expf128_finite;
+    __finitef128;
+    __fmodf128_finite;
+    __fpclassifyf128;
+    __gammaf128_r_finite;
+    __hypotf128_finite;
+    __iseqsigf128;
+    __isinff128;
+    __isnanf128;
+    __issignalingf128;
+    __lgammaf128_r_finite;
+    __log10f128_finite;
+    __log2f128_finite;
+    __logf128_finite;
+    __powf128_finite;
+    __remainderf128_finite;
+    __signbitf128;
+    __sinhf128_finite;
+    __sqrtf128_finite;
+    __j0f128_finite;
+    __j1f128_finite;
+    __jnf128_finite;
+    __y0f128_finite;
+    __y1f128_finite;
+    __ynf128_finite;
+  }
+}

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=512e9d4c8951d99e3b27079f68ee17220b3d63b2

commit 512e9d4c8951d99e3b27079f68ee17220b3d63b2
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Mon Aug 8 16:02:23 2016 -0500

    ldbl-128: Use mathx_hidden_def inplace of hidden_def
    
    This provides a extra macro expansion before invoking
    the hidden_def macro.  This is necessary to build the
    ldbl-128 files as float128 correctly.
    
    	* sysdeps/generic/math_private.h:
    	(mathx_hidden_def): New macro.
    	* sysdeps/ieee754/ldbl-128/s_finitel.c: Replace hidden_def with
    	the above.
    	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
    	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index c0d4e3d..f965708 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -181,6 +181,10 @@ do {								\
 } while (0)
 #endif
 
+/* We need to guarantee an expansion of name when building
+   ldbl-128 files as another type (e.g _Float128).  */
+#define mathx_hidden_def(name) hidden_def(name)
+
 /* Get long double macros from a separate header.  */
 #include <math_ldbl.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index feb4590..7c69968 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -32,5 +32,5 @@ int __finitel(_Float128 x)
 	return (int)((u_int64_t)((hx&0x7fff000000000000LL)
 				 -0x7fff000000000000LL)>>63);
 }
-hidden_def (__finitel)
+mathx_hidden_def (__finitel)
 weak_alias (__finitel, finitel)
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index dce8fc0..a41e8cf 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -25,5 +25,5 @@ __isinfl (_Float128 x)
 	lx |= -lx;
 	return ~(lx >> 63) & (hx >> 62);
 }
-hidden_def (__isinfl)
+mathx_hidden_def (__isinfl)
 weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 1dee642..80f97fe 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -34,5 +34,5 @@ int __isnanl(_Float128 x)
 	hx = 0x7fff000000000000LL - hx;
 	return (int)((u_int64_t)hx>>63);
 }
-hidden_def (__isnanl)
+mathx_hidden_def (__isnanl)
 weak_alias (__isnanl, isnanl)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=11effaca4092af6ad0431b50f11913a835640d4e

commit 11effaca4092af6ad0431b50f11913a835640d4e
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Fri Feb 3 11:08:03 2017 -0200

    ldbl-128: Fix lgammal, log10l and log2l results
    
    lgammal(-x) should return +Inf and raise divide-by-zero.
    log10l(+-0) and log2l(+-0) should return -Inf and raise divide-by-zero.
    
    2017-02-03  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
    
    	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c:
    	(__ieee754_lgammal_r): Return +Inf and raise divide-by-zero when
    	x is negative.
    	* sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Return
    	-Inf and raise divide-by-zero when x = +-0.
    	* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise.

diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 6f55b4d..f9c7c57 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -782,7 +782,10 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
       q = -x;
       p = __floorl (q);
       if (p == q)
-	return (one / (p - p));
+	{
+	  __feraiseexcept (FE_DIVBYZERO);
+	  return HUGE_VALL;
+	}
       _Float128 halfp = p * L(0.5);
       if (halfp == __floorl (halfp))
 	*signgamp = -1;
diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c
index f73cd34..faf66f5 100644
--- a/sysdeps/ieee754/ldbl-128/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log10l.c
@@ -187,7 +187,10 @@ __ieee754_log10l (_Float128 x)
 /* Test for domain */
   GET_LDOUBLE_WORDS64 (hx, lx, x);
   if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
-    return (-1 / (x - x));
+    {
+      __feraiseexcept (FE_DIVBYZERO);
+      return -HUGE_VALL;
+    }
   if (hx < 0)
     return (x - x) / (x - x);
   if (hx >= 0x7fff000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c
index 26a8d7e..a10776d 100644
--- a/sysdeps/ieee754/ldbl-128/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log2l.c
@@ -181,7 +181,10 @@ __ieee754_log2l (_Float128 x)
 /* Test for domain */
   GET_LDOUBLE_WORDS64 (hx, lx, x);
   if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
-    return (-1 / (x - x));
+    {
+      __feraiseexcept (FE_DIVBYZERO);
+      return -HUGE_VALL;
+    }
   if (hx < 0)
     return (x - x) / (x - x);
   if (hx >= 0x7fff000000000000LL)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37c3243d4cfa72cf42df99982f3c9134d20b969a

commit 37c3243d4cfa72cf42df99982f3c9134d20b969a
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Jan 6 13:05:30 2017 -0200

    ldbl-128: Fix y0, y1, and yn for input -Inf
    
    The Bessel functions of the second type (Yn) are not defined for
    negative x and should return NAN.  This error is not exposed for
    float, double, and long double, because the wrappers for these
    functions, which use __kernel_standard functionality, return the
    correct value.
    
    This moves another step towards the deprecation of the old wrappers.
    
    2017-01-06  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Return NAN
    	when x is -Inf.
    	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.

diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index d711007..3bf3569 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -833,7 +833,15 @@ _Float128
       if (x != x)
 	return x + x;
       else
-	return 0;
+	{
+	  /* x = +/-Inf */
+	  if (!signbit (x))
+	    /* y0 (Inf) = 0.  */
+	    return 0;
+	  else
+	    /* y0 (-Inf) = NaN.  */
+	    return NAN;
+	}
     }
   if (x <= 0)
     {
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index 9e78230..99b6534 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -851,7 +851,15 @@ __ieee754_y1l (_Float128 x)
       if (x != x)
 	return x + x;
       else
-	return 0;
+	{
+	  /* x = +/-Inf */
+	  if (!signbit (x))
+	    /* y0 (Inf) = 0.  */
+	    return 0;
+	  else
+	    /* y0 (-Inf) = NaN.  */
+	    return NAN;
+	}
     }
   if (x <= 0)
     {

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=aeab497ebe9c9ee312d3d35b3e9eb1d9b5d68381

commit aeab497ebe9c9ee312d3d35b3e9eb1d9b5d68381
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Wed Feb 1 12:58:51 2017 -0200

    Add template wrapper for IEEE exp function
    
    2017-01-31  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* math/Makefile (gen-libm-calls): Add w_exp.
    	* math/w_exp_template.c: New file.

diff --git a/math/Makefile b/math/Makefile
index 58e4bfa..983e500 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -58,7 +58,7 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF		  \
 		 w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F	  \
 		 w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF	  \
 		 w_log10F w_log2F w_powF w_remainderF w_sinhF w_sqrtF	  \
-		 w_tgammaF w_lgammaF w_lgammaF_r
+		 w_tgammaF w_lgammaF w_lgammaF_r w_expF
 
 libm-calls =								  \
 	e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
diff --git a/math/w_exp_template.c b/math/w_exp_template.c
new file mode 100644
index 0000000..c3f3803
--- /dev/null
+++ b/math/w_exp_template.c
@@ -0,0 +1,48 @@
+/* Wrapper to set errno for exp.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+/* Provide an additional macro expansion for hidden_def.  */
+#define hidden_def_x(name) hidden_def (name)
+
+FLOAT
+M_DECL_FUNC (__exp) (FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_exp) (x);
+  if (__glibc_unlikely (!isfinite (z) || z == 0) && isfinite (x))
+    {
+      __set_errno (ERANGE);
+      if (signbit (x))
+	__feraiseexcept (FE_UNDERFLOW);
+      else
+	__feraiseexcept (FE_OVERFLOW);
+    }
+  return z;
+}
+hidden_def_x (M_SUF (__exp))
+declare_mgen_alias (__exp, exp)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=126081a84171886ae28ecc26d3b785b310ec06f3

commit 126081a84171886ae28ecc26d3b785b310ec06f3
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Thu Dec 15 16:41:58 2016 -0200

    Add new templates for IEEE wrappers
    
    Several wrappers for IEEE functions use _LIB_VERSION / matherr /
    __kernel_standard functionality, which we want to obsolete.  New
    wrappers, such as for float128, must not use this functionality.
    
    This patch adds new wrappers that use __feraiseexcept and __set_errno
    and can be used by the new float128 wrappers.
    
    2016-12-27  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
    
    	* math/Makefile: Add wrappers to gen-libm-calls.
    	* math/w_acos_template.c: New file.
    	* math/w_acosh_template.c: Likewise.
    	* math/w_asin_template.c: Likewise.
    	* math/w_atan2_template.c: Likewise.
    	* math/w_atanh_template.c: Likewise.
    	* math/w_cosh_template.c: Likewise.
    	* math/w_exp10_template.c: Likewise.
    	* math/w_exp2_template.c: Likewise.
    	* math/w_fmod_template.c: Likewise.
    	* math/w_hypot_template.c: Likewise.
    	* math/w_j0_template.c: Likewise.
    	* math/w_j1_template.c: Likewise.
    	* math/w_jn_template.c: Likewise.
    	* math/w_lgamma_r_template.c: Likewise.
    	* math/w_lgamma_template.c: Likewise.
    	* math/w_log10_template.c: Likewise.
    	* math/w_log2_template.c: Likewise.
    	* math/w_log_template.c: Likewise.
    	* math/w_pow_template.c: Likewise.
    	* math/w_remainder_template.c: Likewise.
    	* math/w_sinh_template.c: Likewise.
    	* math/w_sqrt_template.c: Likewise.
    	* math/w_tgamma_template.c: Likewise.
    	* sysdeps/generic/math-type-macros-double.h
    	(__USE_WRAPPER_TEMPLATE): New macro to control inclusion of the
    	new wrappers.
    	* sysdeps/generic/math-type-macros-float.h: Likewise.
    	* sysdeps/generic/math-type-macros-float128.h: Likewise.
    	* sysdeps/generic/math-type-macros-ldouble.h: Likewise.

diff --git a/math/Makefile b/math/Makefile
index e3c192a..58e4bfa 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -54,7 +54,11 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF		  \
 		 s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF	  \
 		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF	  \
 		 s_nanF s_iseqsigF s_canonicalizeF w_ilogbF w_llogbF	  \
-		 w_log1pF w_scalblnF s_fmaxmagF s_fminmagF
+		 w_log1pF w_scalblnF s_fmaxmagF s_fminmagF w_acosF	  \
+		 w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F	  \
+		 w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF	  \
+		 w_log10F w_log2F w_powF w_remainderF w_sinhF w_sqrtF	  \
+		 w_tgammaF w_lgammaF w_lgammaF_r
 
 libm-calls =								  \
 	e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_acos_template.c
similarity index 50%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_acos_template.c
index 03079ce..1a89e0f 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_acos_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,26 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__acos) (FLOAT x)
+{
+  if (__builtin_expect (isgreater (M_SUF (fabs) (x), M_LIT (1.0)), 0))
+    {
+      /* acos(|x|>1) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_acos) (x);
+}
+declare_mgen_alias (__acos, acos)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_acosh_template.c
similarity index 50%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_acosh_template.c
index 03079ce..5a570b6 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_acosh_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for acosh.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,26 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__acosh) (FLOAT x)
+{
+  if (__builtin_expect (isless (x,  M_LIT (1.0)), 0))
+    {
+      /* acosh(x<1) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_acosh) (x);
+}
+declare_mgen_alias (__acosh, acosh)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_asin_template.c
similarity index 50%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_asin_template.c
index 03079ce..ed7176e 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_asin_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for asin.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,26 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__asin) (FLOAT x)
+{
+  if (__builtin_expect (isgreater (M_SUF (fabs) (x),  M_LIT (1.0)), 0))
+    {
+      /* asin(|x|>1) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_asin) (x);
+}
+declare_mgen_alias (__asin, asin)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_atan2_template.c
similarity index 51%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_atan2_template.c
index 03079ce..35d2737 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_atan2_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for atan2.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,23 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <errno.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__atan2) (FLOAT y, FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_atan2) (y, x);
+  if (__glibc_unlikely (z == 0 && y != 0 && isfinite (x)))
+    __set_errno (ERANGE);
+  return z;
+}
+declare_mgen_alias (__atan2, atan2)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_atanh_template.c b/math/w_atanh_template.c
new file mode 100644
index 0000000..c2c5962
--- /dev/null
+++ b/math/w_atanh_template.c
@@ -0,0 +1,48 @@
+/* Wrapper to set errno for atanh.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__atanh) (FLOAT x)
+{
+  if (__builtin_expect (isgreater (M_SUF (fabs) (x), M_LIT (1.0)), 0))
+    {
+      /* atanh(|x|>1) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  else if (__builtin_expect
+	     (isgreaterequal (M_SUF (fabs) (x), M_LIT (1.0)), 0))
+    {
+      /* atanh(|x|==1) */
+      __feraiseexcept (FE_DIVBYZERO);
+      __set_errno (ERANGE);
+    }
+  return M_SUF (__ieee754_atanh) (x);
+}
+declare_mgen_alias (__atanh, atanh)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_cosh_template.c
similarity index 50%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_cosh_template.c
index 03079ce..9025135 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_cosh_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for acosh.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,26 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__cosh) (FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_cosh) (x);
+  if (__builtin_expect (!isfinite (z), 0) && isfinite (x))
+    {
+      __feraiseexcept (FE_OVERFLOW);
+      __set_errno (ERANGE);
+    }
+  return z;
+}
+declare_mgen_alias (__cosh, cosh)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_exp10_template.c b/math/w_exp10_template.c
new file mode 100644
index 0000000..7abe2bf
--- /dev/null
+++ b/math/w_exp10_template.c
@@ -0,0 +1,49 @@
+/* Wrapper to set errno for exp10.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__exp10) (FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_exp10) (x);
+  if (__builtin_expect (!isfinite (z) || z == 0, 0) && isfinite (x))
+    {
+      if (signbit (x))
+	{
+	  __feraiseexcept (FE_UNDERFLOW);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_OVERFLOW);
+	  __set_errno (ERANGE);
+	}
+    }
+  return z;
+}
+declare_mgen_alias (__exp10, exp10)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_exp2_template.c b/math/w_exp2_template.c
new file mode 100644
index 0000000..6590d21
--- /dev/null
+++ b/math/w_exp2_template.c
@@ -0,0 +1,49 @@
+/* Wrapper to set errno for exp2.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__exp2) (FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_exp2) (x);
+  if (__builtin_expect (!isfinite (z) || z == 0, 0) && isfinite (x))
+    {
+      if (signbit (x))
+	{
+	  __feraiseexcept (FE_UNDERFLOW);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_OVERFLOW);
+	  __set_errno (ERANGE);
+	}
+    }
+  return z;
+}
+declare_mgen_alias (__exp2, exp2)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_fmod_template.c b/math/w_fmod_template.c
new file mode 100644
index 0000000..c822dfa
--- /dev/null
+++ b/math/w_fmod_template.c
@@ -0,0 +1,41 @@
+/* Wrapper to set errno for fmod.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__fmod) (FLOAT x, FLOAT y)
+{
+  if (__builtin_expect (isinf (x) || y == 0, 0) && !isnan (y) && !isnan (x))
+    {
+      /* fmod(+-Inf,y) or fmod(x,0) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_fmod) (x, y);
+}
+declare_mgen_alias (__fmod, fmod)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_hypot_template.c b/math/w_hypot_template.c
new file mode 100644
index 0000000..ed64492
--- /dev/null
+++ b/math/w_hypot_template.c
@@ -0,0 +1,41 @@
+/* Wrapper to set errno for hypot.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__hypot) (FLOAT x, FLOAT y)
+{
+  FLOAT z = M_SUF (__ieee754_hypot) (x, y);
+  if (__builtin_expect (!isfinite (z), 0) && isfinite (x) && isfinite (y))
+    {
+      __feraiseexcept (FE_OVERFLOW);
+      __set_errno (ERANGE);
+    }
+  return z;
+}
+declare_mgen_alias (__hypot, hypot)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_j0_template.c b/math/w_j0_template.c
new file mode 100644
index 0000000..f8818ac
--- /dev/null
+++ b/math/w_j0_template.c
@@ -0,0 +1,57 @@
+/* Wrapper to set errno for j0 and y0.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__j0) (FLOAT x)
+{
+  return M_SUF (__ieee754_j0) (x);
+}
+declare_mgen_alias (__j0, j0)
+
+FLOAT
+M_DECL_FUNC (__y0) (FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x < 0)
+	{
+	  /* d = zero/(x-x) */
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+      else if (x == 0)
+	{
+	  /* d = -one/(x-x) */
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+    }
+  return M_SUF (__ieee754_y0) (x);
+}
+declare_mgen_alias (__y0, y0)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_j1_template.c b/math/w_j1_template.c
new file mode 100644
index 0000000..e6c7c2a
--- /dev/null
+++ b/math/w_j1_template.c
@@ -0,0 +1,57 @@
+/* Wrapper to set errno for j1 and y1.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__j1) (FLOAT x)
+{
+  return M_SUF (__ieee754_j1) (x);
+}
+declare_mgen_alias (__j1, j1)
+
+FLOAT
+M_DECL_FUNC (__y1) (FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x < 0)
+	{
+	  /* d = zero/(x-x) */
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+      else if (x == 0)
+	{
+	  /* d = -one/(x-x) */
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+    }
+  return M_SUF (__ieee754_y1) (x);
+}
+declare_mgen_alias (__y1, y1)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_jn_template.c b/math/w_jn_template.c
new file mode 100644
index 0000000..900fc51
--- /dev/null
+++ b/math/w_jn_template.c
@@ -0,0 +1,57 @@
+/* Wrapper to set errno for jn and yn.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__jn) (int n, FLOAT x)
+{
+  return M_SUF (__ieee754_jn) (n, x);
+}
+declare_mgen_alias (__jn, jn)
+
+FLOAT
+M_DECL_FUNC (__yn) (int n, FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x < 0)
+	{
+	  /* d = zero/(x-x) */
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+      else if (x == 0)
+	{
+	  /* d = -one/(x-x) */
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+    }
+  return M_SUF (__ieee754_yn) (n, x);
+}
+declare_mgen_alias (__yn, yn)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_lgamma_r_template.c b/math/w_lgamma_r_template.c
new file mode 100644
index 0000000..b4024be
--- /dev/null
+++ b/math/w_lgamma_r_template.c
@@ -0,0 +1,54 @@
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+#define M_DECL_FUNC_R_X(x) x ## _r
+#define M_DECL_FUNC_R_S(x) M_DECL_FUNC_R_X (x)
+#define M_DECL_FUNC_R(x) M_DECL_FUNC_R_S (M_SUF (x))
+
+#define M_CALL_FUNC_R_X(x) x ## _r
+#define M_CALL_FUNC_R_S(x) M_CALL_FUNC_R_X (x)
+#define M_CALL_FUNC_R(x) M_CALL_FUNC_R_S (M_SUF (x))
+
+#define declare_mgen_alias_r_x(from, to) weak_alias (from ## _r, to ## _r)
+#define declare_mgen_alias_r_s(from, to) \
+	declare_mgen_alias_r_x (from, to)
+#define declare_mgen_alias_r(from, to) \
+	declare_mgen_alias_r_s (M_SUF (from), M_SUF (to))
+
+FLOAT
+M_DECL_FUNC_R (__lgamma) (FLOAT x, int *signgamp)
+{
+  FLOAT y = M_CALL_FUNC_R (__ieee754_lgamma) (x, signgamp);
+  if (__builtin_expect(!isfinite(y), 0) && isfinite(x))
+    {
+      __set_errno (ERANGE);
+    }
+  return y;
+}
+declare_mgen_alias_r (__lgamma, lgamma)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_lgamma_template.c b/math/w_lgamma_template.c
new file mode 100644
index 0000000..9ec123c
--- /dev/null
+++ b/math/w_lgamma_template.c
@@ -0,0 +1,43 @@
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+#define M_CALL_FUNC_X(x) x ## _r
+#define M_CALL_FUNC(x) M_CALL_FUNC_X (x)
+
+FLOAT
+M_DECL_FUNC (__lgamma) (FLOAT x)
+{
+  FLOAT y = M_CALL_FUNC (M_SUF (__ieee754_lgamma)) (x, &__signgam);
+  if (__builtin_expect (!isfinite (y), 0) && isfinite (x))
+    {
+      __set_errno (ERANGE);
+    }
+  return y;
+}
+declare_mgen_alias (__lgamma, lgamma)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_log10_template.c b/math/w_log10_template.c
new file mode 100644
index 0000000..d95a020
--- /dev/null
+++ b/math/w_log10_template.c
@@ -0,0 +1,48 @@
+/* Wrapper to set errno for log10.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__log10) (FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x == 0)
+	{
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+    }
+  return  M_SUF (__ieee754_log10) (x);
+}
+declare_mgen_alias (__log10, log10)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_log2_template.c b/math/w_log2_template.c
new file mode 100644
index 0000000..f2d01b0
--- /dev/null
+++ b/math/w_log2_template.c
@@ -0,0 +1,48 @@
+/* Wrapper to set errno for log2.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__log2) (FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x == 0)
+	{
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+    }
+  return M_SUF (__ieee754_log2) (x);
+}
+declare_mgen_alias (__log2, log2)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_log_template.c b/math/w_log_template.c
new file mode 100644
index 0000000..d8a3da2
--- /dev/null
+++ b/math/w_log_template.c
@@ -0,0 +1,48 @@
+/* Wrapper to set errno for log.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__log) (FLOAT x)
+{
+  if (__builtin_expect (islessequal (x, M_LIT (0.0)), 0))
+    {
+      if (x == 0)
+	{
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+    }
+  return M_SUF (__ieee754_log) (x);
+}
+declare_mgen_alias (__log, log)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_pow_template.c b/math/w_pow_template.c
new file mode 100644
index 0000000..5b46eaf
--- /dev/null
+++ b/math/w_pow_template.c
@@ -0,0 +1,67 @@
+/* Wrapper to set errno for pow.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__pow) (FLOAT x, FLOAT y)
+{
+  FLOAT z = M_SUF (__ieee754_pow) (x, y);
+  if (__glibc_unlikely (!isfinite (z)))
+    {
+      if (isfinite (x) && isfinite (y))
+	{
+	  if (isnan (z))
+	    {
+	      /* (negative)**(non-integer) */
+	      __feraiseexcept (FE_INVALID);
+	      __set_errno (EDOM);
+	    }
+	  else if (x == 0 && y < 0)
+	    {
+	      /* pow(-0.0,negative) or pow(+0.0,negative) */
+	      /* XXX: Should this signal FE_DIVBYZERO for odd negative y?  */
+	      __set_errno (ERANGE);
+	    }
+	  else
+	    {
+	      /* pow overflow */
+	      __feraiseexcept (FE_OVERFLOW);
+	      __set_errno (ERANGE);
+	    }
+	}
+    }
+  else if (__builtin_expect (z == 0, 0)
+	   && isfinite (x) && x != 0 && isfinite (y))
+    {
+      /* pow underflow */
+      __feraiseexcept (FE_UNDERFLOW);
+      __set_errno (ERANGE);
+    }
+  return z;
+}
+declare_mgen_alias (__pow, pow)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_remainder_template.c b/math/w_remainder_template.c
new file mode 100644
index 0000000..6e7f4d1
--- /dev/null
+++ b/math/w_remainder_template.c
@@ -0,0 +1,41 @@
+/* Wrapper to set errno for remainder.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__remainder) (FLOAT x, FLOAT y)
+{
+  if (__builtin_expect (isinf (x) || y == 0, 0) && !isnan (y) && !isnan (x))
+    {
+      /* remainder(+-Inf,y) or remainder(x,0) */
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_remainder) (x, y);
+}
+declare_mgen_alias (__remainder, remainder)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_sinh_template.c
similarity index 50%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_sinh_template.c
index 03079ce..28e0813 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_sinh_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,26 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__sinh) (FLOAT x)
+{
+  FLOAT z = M_SUF (__ieee754_sinh) (x);
+  if (__builtin_expect (!isfinite (z), 0) && isfinite (x))
+    {
+      __feraiseexcept (FE_OVERFLOW);
+      __set_errno (ERANGE);
+    }
+  return z;
+}
+declare_mgen_alias (__sinh, sinh)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-float.h b/math/w_sqrt_template.c
similarity index 51%
copy from sysdeps/generic/math-type-macros-float.h
copy to math/w_sqrt_template.c
index 03079ce..f8f689d 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/math/w_sqrt_template.c
@@ -1,5 +1,5 @@
-/* Helper macros for float variants of type generic functions of libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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
@@ -16,21 +16,25 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _MATH_TYPE_MACROS_FLOAT
-#define _MATH_TYPE_MACROS_FLOAT
-
-#define M_LIT(c) c ## f
-#define M_PFX FLT
-#define M_SUF(c) c ## f
-#define FLOAT float
-#define CFLOAT _Complex float
-#define M_STRTO_NAN __strtof_nan
-
-/* Standard/GNU macro literals do not exist for the float type.  Use
-   the double macro constants.  */
-#define M_MLIT(c) c
-
-/* Supply the generic macros.  */
-#include <math-type-macros.h>
-
-#endif
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__sqrt) (FLOAT x)
+{
+  if (__builtin_expect (isless (x, M_LIT (0.0)), 0))
+    {
+      __feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return M_SUF (__ieee754_sqrt) (x);
+}
+declare_mgen_alias (__sqrt, sqrt)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_tgamma_template.c b/math/w_tgamma_template.c
new file mode 100644
index 0000000..773864d
--- /dev/null
+++ b/math/w_tgamma_template.c
@@ -0,0 +1,65 @@
+/* Wrapper to set errno for acos.
+   Copyright (C) 2011-2016 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/>.  */
+
+/* Do not build wrappers from the templates for the types that define the macro
+   below.  This macro is set in math-type-macros-<type>.h in sysdeps/generic
+   for each floating-point type.  */
+#if defined __USE_WRAPPER_TEMPLATE && __USE_WRAPPER_TEMPLATE
+
+# include <fenv.h>
+# include <math.h>
+# include <math_private.h>
+
+#define M_CALL_FUNC_X(x) x ## _r
+#define M_CALL_FUNC(x) M_CALL_FUNC_X (x)
+
+FLOAT
+M_DECL_FUNC (__tgamma) (FLOAT x)
+{
+  int local_signgam;
+  FLOAT y = M_CALL_FUNC (M_SUF (__ieee754_gamma)) (x, &local_signgam);
+
+  if (__glibc_unlikely (!isfinite (y) || y == 0)
+      && (isfinite (x) || (isinf (x) && x < 0)))
+    {
+      if (x == 0)
+	{
+	  __feraiseexcept (FE_DIVBYZERO);
+	  __set_errno (ERANGE);
+	}
+      else if (M_SUF (__floor) (x) == x && x < 0)
+	{
+	  __feraiseexcept (FE_INVALID);
+	  __set_errno (EDOM);
+	}
+      else if (y == 0)
+	{
+	  __feraiseexcept (FE_UNDERFLOW);
+	  __set_errno (ERANGE);
+	}
+      else
+	{
+	  __feraiseexcept (FE_OVERFLOW);
+	  __set_errno (ERANGE);
+	}
+    }
+  return local_signgam < 0 ? -y : y;
+}
+declare_mgen_alias (__tgamma, tgamma)
+
+#endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
index 8048d38..6116f7f 100644
--- a/sysdeps/generic/math-type-macros-double.h
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -47,4 +47,7 @@
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
 
+/* Do not use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 0
+
 #endif
diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h
index 03079ce..712e517 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/sysdeps/generic/math-type-macros-float.h
@@ -33,4 +33,7 @@
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
 
+/* Do not use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 0
+
 #endif
diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h
index 31591a3..4e02e53 100644
--- a/sysdeps/generic/math-type-macros-ldouble.h
+++ b/sysdeps/generic/math-type-macros-ldouble.h
@@ -30,4 +30,7 @@
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
 
+/* Do not use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 0
+
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=959752a7088bbe86c555f6b564f88a4a75eba1ef

commit 959752a7088bbe86c555f6b564f88a4a75eba1ef
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Jan 30 17:01:05 2017 -0200

    Move w_exp to libm-compat-call-auto
    
    This patch adds the "_compat" suffix to the wrappers of the function
    exp, which use _LIB_VERSION / matherr / __kernel_standard
    functionality.
    
    2017-01-30  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* math/Makefile (libm-calls): Move w_exp...
    	(libm-compat-calls-auto): Here.
    
    	* math/w_expl.c: Add suffix "_compat" to filename.
    	* sysdeps/ia64/fpu/w_expl.c: Likewise.
    	* sysdeps/ia64/fpu/w_expf.c: Likewise.
    	* sysdeps/ia64/fpu/w_exp.c: Likewise.
    	* sysdeps/ieee754/dbl-64/w_exp.c: Likewise.
    	* sysdeps/ieee754/flt-32/w_expf.c: Likewise.
    	* sysdeps/ieee754/ldbl-128/w_expl.c: Likewise.
    	* sysdeps/ieee754/ldbl-128ibm/w_expl.c: Likewise.
    	* sysdeps/ieee754/ldbl-64-128/w_expl.c: Likewise.
    	* sysdeps/ieee754/ldbl-96/w_expl.c: Likewise.
    	* sysdeps/ieee754/ldbl-opt/w_exp.c: Likewise.
    
    	* math/w_expl_compat.c: New file, copied from above.
    	* sysdeps/ia64/fpu/w_exp_compat.c: Likewise.
    	* sysdeps/ia64/fpu/w_expf_compat.c: Likewise.
    	* sysdeps/ia64/fpu/w_expl_compat.c: Likewise.
    	* sysdeps/ieee754/dbl-64/w_expc_compat.c: Likewise.
    	* sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise.
    	* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise.
    	* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise.
    	* sysdeps/ieee754/ldbl-64-128/w_expl_compat.c: Likewise.
    	* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise.
    	* sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Likewise.

diff --git a/math/Makefile b/math/Makefile
index ff400c3..e3c192a 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -66,7 +66,6 @@ libm-calls =								  \
 	s_floorF s_log1pF s_logbF				  \
 	s_nextafterF s_nexttowardF s_rintF s_scalblnF			  \
 	s_significandF s_sinF s_tanF s_tanhF				  \
-	w_expF								  \
 	s_fpclassifyF s_truncF						  \
 	s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF	  \
 	s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F		  \
@@ -83,7 +82,7 @@ libm-compat-calls-auto =						\
 	w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat	\
 	w_powF_compat w_remainderF_compat w_scalbF_compat		\
 	w_sinhF_compat w_sqrtF_compat w_tgammaF_compat			\
-	w_lgammaF_r_compat w_lgammaF_compat2
+	w_lgammaF_r_compat w_lgammaF_compat2 w_expF_compat
 
 libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl
 libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \
diff --git a/math/w_expl.c b/math/w_expl_compat.c
similarity index 100%
rename from math/w_expl.c
rename to math/w_expl_compat.c
diff --git a/sysdeps/ia64/fpu/w_exp.c b/sysdeps/ia64/fpu/w_exp_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_exp.c
rename to sysdeps/ia64/fpu/w_exp_compat.c
diff --git a/sysdeps/ia64/fpu/w_expf.c b/sysdeps/ia64/fpu/w_expf_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_expf.c
rename to sysdeps/ia64/fpu/w_expf_compat.c
diff --git a/sysdeps/ia64/fpu/w_expl.c b/sysdeps/ia64/fpu/w_expl_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_expl.c
rename to sysdeps/ia64/fpu/w_expl_compat.c
diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp_compat.c
similarity index 100%
rename from sysdeps/ieee754/dbl-64/w_exp.c
rename to sysdeps/ieee754/dbl-64/w_exp_compat.c
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf_compat.c
similarity index 100%
rename from sysdeps/ieee754/flt-32/w_expf.c
rename to sysdeps/ieee754/flt-32/w_expf_compat.c
diff --git a/sysdeps/ieee754/ldbl-128/w_expl.c b/sysdeps/ieee754/ldbl-128/w_expl_compat.c
similarity index 100%
rename from sysdeps/ieee754/ldbl-128/w_expl.c
rename to sysdeps/ieee754/ldbl-128/w_expl_compat.c
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl.c b/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
similarity index 100%
rename from sysdeps/ieee754/ldbl-128ibm/w_expl.c
rename to sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
diff --git a/sysdeps/ieee754/ldbl-64-128/w_expl.c b/sysdeps/ieee754/ldbl-64-128/w_expl_compat.c
similarity index 67%
rename from sysdeps/ieee754/ldbl-64-128/w_expl.c
rename to sysdeps/ieee754/ldbl-64-128/w_expl_compat.c
index 2a402b0..37c153e 100644
--- a/sysdeps/ieee754/ldbl-64-128/w_expl.c
+++ b/sysdeps/ieee754/ldbl-64-128/w_expl_compat.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
 #undef weak_alias
 #define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/w_expl.c>
+#include <sysdeps/ieee754/ldbl-128/w_expl_compat.c>
 long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl_compat.c
similarity index 100%
rename from sysdeps/ieee754/ldbl-96/w_expl.c
rename to sysdeps/ieee754/ldbl-96/w_expl_compat.c
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp.c b/sysdeps/ieee754/ldbl-opt/w_exp_compat.c
similarity index 71%
rename from sysdeps/ieee754/ldbl-opt/w_exp.c
rename to sysdeps/ieee754/ldbl-opt/w_exp_compat.c
index 61fcfcc..686c9c2 100644
--- a/sysdeps/ieee754/ldbl-opt/w_exp.c
+++ b/sysdeps/ieee754/ldbl-opt/w_exp_compat.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/w_exp.c>
+#include <sysdeps/ieee754/dbl-64/w_exp_compat.c>
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __exp, expl, GLIBC_2_0);
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7e9f8cbf32a3f8da992e785f22ce1d62fb0d54bd

commit 7e9f8cbf32a3f8da992e785f22ce1d62fb0d54bd
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Wed Dec 21 09:33:32 2016 -0200

    Move w_lgamma to libm-compat-calls-auto
    
    This patch add the suffix "_compat2" to the remaining wrappers that
    use _LIB_VERSION / matherr / __kernel_standard functionality.  The
    suffix "_compat2" is used because the suffix "_compat" is already
    used.
    
    2016-12-16  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* Makefile (libm-calls): Move w_lgammaF...
    	(libm-compat-calls-auto): Here.
    
    	* w_lgamma.c: Add suffix "_compat2" to filename.
    	* w_lgammaf.c: Likewise.
    	* w_lgammal.c: Likewise.
    
    	* w_lgamma_compat2.c: New file, copied from above.
    	* w_lgammaf_compat2.c: Likewise.
    	* w_lgammal_compat2.c: Likewise.

diff --git a/math/Makefile b/math/Makefile
index f12bbf4..ff400c3 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -67,7 +67,6 @@ libm-calls =								  \
 	s_nextafterF s_nexttowardF s_rintF s_scalblnF			  \
 	s_significandF s_sinF s_tanF s_tanhF				  \
 	w_expF								  \
-	w_lgammaF							  \
 	s_fpclassifyF s_truncF						  \
 	s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF	  \
 	s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F		  \
@@ -84,7 +83,7 @@ libm-compat-calls-auto =						\
 	w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat	\
 	w_powF_compat w_remainderF_compat w_scalbF_compat		\
 	w_sinhF_compat w_sqrtF_compat w_tgammaF_compat			\
-	w_lgammaF_r_compat
+	w_lgammaF_r_compat w_lgammaF_compat2
 
 libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl
 libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \
diff --git a/math/w_lgamma.c b/math/w_lgamma_compat2.c
similarity index 100%
rename from math/w_lgamma.c
rename to math/w_lgamma_compat2.c
diff --git a/math/w_lgammaf.c b/math/w_lgammaf_compat2.c
similarity index 100%
rename from math/w_lgammaf.c
rename to math/w_lgammaf_compat2.c
diff --git a/math/w_lgammal.c b/math/w_lgammal_compat2.c
similarity index 100%
rename from math/w_lgammal.c
rename to math/w_lgammal_compat2.c

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b46895d3e9b07197a231effa0db5367ee11e5f99

commit b46895d3e9b07197a231effa0db5367ee11e5f99
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Wed Dec 21 10:20:08 2016 -0200

    Move w_lgamma_r to libm-compat-calls-auto
    
    This patch adds the suffix "_compat" to lgamma_r wrappers and make
    some adjustments to #includes and Makefiles.  This is a step towards
    deprecation of wrappers that use _LIB_VERSION / matherr /
    __kernel_standard functionality.
    
    2016-12-16  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
    
    	* math/Makefile (libm-calls): Move w_lgammaF_r...
    	(libm-compat-calls-auto): Here.
    
    	* math/w_lgamma_r.c: Add suffix "_compat" to filename.
    	* math/w_lgammaf_r.c: Likewise.
    	* math/w_lgammal_r.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgammal_r.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgammaf_r.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgamma_r.c: Likewise.
    
    	* math/w_lgamma_r_compat.c: New file, copied from above.
    	* math/w_lgammaf_r_compat.c: Likewise.
    	* math/w_lgammal_r_compat.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgamma_r_compat.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgammaf_r_compat.c: Likewise.
    	* sysdeps/ia64/fpu/w_lgammal_r_compat.c: Likewise.
    
    	* sysdeps/ieee754/ldbl-opt/w_lgamma_r.c: Add suffix "_compat"
    	to filename.
    	* sysdeps/ieee754/ldbl-opt/w_lgammal_r.c: Likewise.
    
    	* sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c: New file
    	copied from above and adjusted for the new filenames.
    	* sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c: Likewise.

diff --git a/math/Makefile b/math/Makefile
index 0ee4648..f12bbf4 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -67,7 +67,7 @@ libm-calls =								  \
 	s_nextafterF s_nexttowardF s_rintF s_scalblnF			  \
 	s_significandF s_sinF s_tanF s_tanhF				  \
 	w_expF								  \
-	w_lgammaF w_lgammaF_r						  \
+	w_lgammaF							  \
 	s_fpclassifyF s_truncF						  \
 	s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF	  \
 	s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F		  \
@@ -83,7 +83,8 @@ libm-compat-calls-auto =						\
 	w_fmodF_compat w_hypotF_compat w_j0F_compat w_j1F_compat	\
 	w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat	\
 	w_powF_compat w_remainderF_compat w_scalbF_compat		\
-	w_sinhF_compat w_sqrtF_compat w_tgammaF_compat
+	w_sinhF_compat w_sqrtF_compat w_tgammaF_compat			\
+	w_lgammaF_r_compat
 
 libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl
 libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \
diff --git a/math/w_lgamma_r.c b/math/w_lgamma_r_compat.c
similarity index 100%
rename from math/w_lgamma_r.c
rename to math/w_lgamma_r_compat.c
diff --git a/math/w_lgammaf_r.c b/math/w_lgammaf_r_compat.c
similarity index 100%
rename from math/w_lgammaf_r.c
rename to math/w_lgammaf_r_compat.c
diff --git a/math/w_lgammal_r.c b/math/w_lgammal_r_compat.c
similarity index 100%
rename from math/w_lgammal_r.c
rename to math/w_lgammal_r_compat.c
diff --git a/sysdeps/ia64/fpu/w_lgamma_r.c b/sysdeps/ia64/fpu/w_lgamma_r_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_lgamma_r.c
rename to sysdeps/ia64/fpu/w_lgamma_r_compat.c
diff --git a/sysdeps/ia64/fpu/w_lgammaf_r.c b/sysdeps/ia64/fpu/w_lgammaf_r_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_lgammaf_r.c
rename to sysdeps/ia64/fpu/w_lgammaf_r_compat.c
diff --git a/sysdeps/ia64/fpu/w_lgammal_r.c b/sysdeps/ia64/fpu/w_lgammal_r_compat.c
similarity index 100%
rename from sysdeps/ia64/fpu/w_lgammal_r.c
rename to sysdeps/ia64/fpu/w_lgammal_r_compat.c
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c
similarity index 78%
rename from sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
rename to sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c
index eeab6a6..673954c 100644
--- a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
+++ b/sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#include <math/w_lgamma_r.c>
+#include <math/w_lgamma_r_compat.c>
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0);
 #endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c
similarity index 76%
rename from sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
rename to sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c
index 2545975..6fdf2bb 100644
--- a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
 #undef weak_alias
 #define weak_alias(n,a)
-#include <math/w_lgammal_r.c>
+#include <math/w_lgammal_r_compat.c>
 long_double_symbol (libm, __lgammal_r, lgammal_r);

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]