aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2019-01-07 09:04:29 -0800
committerH.J. Lu <hjl.tools@gmail.com>2019-01-07 09:04:39 -0800
commit69da3c9e87e0a692e79db0615a53782e4198dbf0 (patch)
tree19a3b5f1b84b36f78421a364ce4d29bbdfa0cb94
parent2ef427168818ce04b03cecb7b739f9db0156e3e4 (diff)
downloadglibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.tar
glibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.tar.gz
glibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.tar.bz2
glibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.zip
soft-fp: Properly check _FP_W_TYPE_SIZE [BZ #24066]
quad.h have #if _FP_W_TYPE_SIZE < 64 union _FP_UNION_Q { Use 4 _FP_W_TYPEs } #else union _FP_UNION_Q { Use 2 _FP_W_TYPEs } #endif Replace #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q with #if _FP_W_TYPE_SIZE < 64 to check whether 4 or 2 _FP_W_TYPEs are used for IEEE quad precision. Tested with build-many-glibcs.py. [BZ #24066] * soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if 4_FP_W_TYPEs are used for IEEE quad precision. * soft-fp/extendhftf2.c: Likewise. * soft-fp/extendsftf2.c: Likewise. * soft-fp/extendxftf2.c: Likewise. * soft-fp/trunctfdf2.c: Likewise. * soft-fp/trunctfhf2.c: Likewise. * soft-fp/trunctfsf2.c: Likewise. * soft-fp/trunctfxf2.c: Likewise. * sysdeps/alpha/ots_cvttx.c: Likewise. * sysdeps/alpha/ots_cvtxt.c: Likewise. * sysdeps/ieee754/soft-fp/s_daddl.c: Likewise. * sysdeps/ieee754/soft-fp/s_ddivl.c: Likewise. * sysdeps/ieee754/soft-fp/s_dmull.c: Likewise. * sysdeps/ieee754/soft-fp/s_dsubl.c: Likewise. * sysdeps/ieee754/soft-fp/s_faddl.c: Likewise. * sysdeps/ieee754/soft-fp/s_fdivl.c: Likewise. * sysdeps/ieee754/soft-fp/s_fmull.c: Likewise. * sysdeps/ieee754/soft-fp/s_fsubl.c: Likewise. * sysdeps/sparc/sparc32/q_dtoq.c: Likewise. * sysdeps/sparc/sparc32/q_qtod.c: Likewise. * sysdeps/sparc/sparc32/q_qtos.c: Likewise. * sysdeps/sparc/sparc32/q_stoq.c: Likewise. * sysdeps/sparc/sparc64/qp_dtoq.c: Likewise. * sysdeps/sparc/sparc64/qp_qtod.c: Likewise. * sysdeps/sparc/sparc64/qp_qtos.c: Likewise. * sysdeps/sparc/sparc64/qp_stoq.c: Likewise.
-rw-r--r--ChangeLog31
-rw-r--r--soft-fp/extenddftf2.c2
-rw-r--r--soft-fp/extendhftf2.c2
-rw-r--r--soft-fp/extendsftf2.c2
-rw-r--r--soft-fp/extendxftf2.c2
-rw-r--r--soft-fp/trunctfdf2.c2
-rw-r--r--soft-fp/trunctfhf2.c2
-rw-r--r--soft-fp/trunctfsf2.c2
-rw-r--r--soft-fp/trunctfxf2.c2
-rw-r--r--sysdeps/alpha/ots_cvttx.c2
-rw-r--r--sysdeps/alpha/ots_cvtxt.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_daddl.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_ddivl.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_dmull.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_dsubl.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_faddl.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_fdivl.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmull.c2
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsubl.c2
-rw-r--r--sysdeps/sparc/sparc32/q_dtoq.c2
-rw-r--r--sysdeps/sparc/sparc32/q_qtod.c2
-rw-r--r--sysdeps/sparc/sparc32/q_qtos.c2
-rw-r--r--sysdeps/sparc/sparc32/q_stoq.c2
-rw-r--r--sysdeps/sparc/sparc64/qp_dtoq.c2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtod.c2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtos.c2
-rw-r--r--sysdeps/sparc/sparc64/qp_stoq.c2
27 files changed, 57 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 314a511221..909e56a49c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2019-01-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #24066]
+ * soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if
+ 4_FP_W_TYPEs are used for IEEE quad precision.
+ * soft-fp/extendhftf2.c: Likewise.
+ * soft-fp/extendsftf2.c: Likewise.
+ * soft-fp/extendxftf2.c: Likewise.
+ * soft-fp/trunctfdf2.c: Likewise.
+ * soft-fp/trunctfhf2.c: Likewise.
+ * soft-fp/trunctfsf2.c: Likewise.
+ * soft-fp/trunctfxf2.c: Likewise.
+ * sysdeps/alpha/ots_cvttx.c: Likewise.
+ * sysdeps/alpha/ots_cvtxt.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_daddl.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_ddivl.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_dmull.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_dsubl.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_faddl.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_fdivl.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_fmull.c: Likewise.
+ * sysdeps/ieee754/soft-fp/s_fsubl.c: Likewise.
+ * sysdeps/sparc/sparc32/q_dtoq.c: Likewise.
+ * sysdeps/sparc/sparc32/q_qtod.c: Likewise.
+ * sysdeps/sparc/sparc32/q_qtos.c: Likewise.
+ * sysdeps/sparc/sparc32/q_stoq.c: Likewise.
+ * sysdeps/sparc/sparc64/qp_dtoq.c: Likewise.
+ * sysdeps/sparc/sparc64/qp_qtod.c: Likewise.
+ * sysdeps/sparc/sparc64/qp_qtos.c: Likewise.
+ * sysdeps/sparc/sparc64/qp_stoq.c: Likewise.
+
2019-01-07 Aurelien Jarno <aurelien@aurel32.net>
[BZ #24024]
diff --git a/soft-fp/extenddftf2.c b/soft-fp/extenddftf2.c
index 85a17ceb9e..0568ddf177 100644
--- a/soft-fp/extenddftf2.c
+++ b/soft-fp/extenddftf2.c
@@ -43,7 +43,7 @@ __extenddftf2 (DFtype a)
FP_INIT_EXCEPTIONS;
FP_UNPACK_RAW_D (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND (Q, D, 4, 2, R, A);
#else
FP_EXTEND (Q, D, 2, 1, R, A);
diff --git a/soft-fp/extendhftf2.c b/soft-fp/extendhftf2.c
index ed19f0db27..c71ab53a45 100644
--- a/soft-fp/extendhftf2.c
+++ b/soft-fp/extendhftf2.c
@@ -41,7 +41,7 @@ __extendhftf2 (HFtype a)
FP_INIT_EXCEPTIONS;
FP_UNPACK_RAW_H (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND (Q, H, 4, 1, R, A);
#else
FP_EXTEND (Q, H, 2, 1, R, A);
diff --git a/soft-fp/extendsftf2.c b/soft-fp/extendsftf2.c
index 4707c40745..82b5d627dd 100644
--- a/soft-fp/extendsftf2.c
+++ b/soft-fp/extendsftf2.c
@@ -43,7 +43,7 @@ __extendsftf2 (SFtype a)
FP_INIT_EXCEPTIONS;
FP_UNPACK_RAW_S (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND (Q, S, 4, 1, R, A);
#else
FP_EXTEND (Q, S, 2, 1, R, A);
diff --git a/soft-fp/extendxftf2.c b/soft-fp/extendxftf2.c
index 858e122a16..d9885e5c8f 100644
--- a/soft-fp/extendxftf2.c
+++ b/soft-fp/extendxftf2.c
@@ -41,7 +41,7 @@ __extendxftf2 (XFtype a)
FP_INIT_TRAPPING_EXCEPTIONS;
FP_UNPACK_RAW_E (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND (Q, E, 4, 4, R, A);
#else
FP_EXTEND (Q, E, 2, 2, R, A);
diff --git a/soft-fp/trunctfdf2.c b/soft-fp/trunctfdf2.c
index 440ccfacc7..f62d5419de 100644
--- a/soft-fp/trunctfdf2.c
+++ b/soft-fp/trunctfdf2.c
@@ -42,7 +42,7 @@ __trunctfdf2 (TFtype a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (D, Q, 2, 4, R, A);
#else
FP_TRUNC (D, Q, 1, 2, R, A);
diff --git a/soft-fp/trunctfhf2.c b/soft-fp/trunctfhf2.c
index 6ee80c519c..61d08f896e 100644
--- a/soft-fp/trunctfhf2.c
+++ b/soft-fp/trunctfhf2.c
@@ -40,7 +40,7 @@ __trunctfhf2 (TFtype a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (H, Q, 1, 4, R, A);
#else
FP_TRUNC (H, Q, 1, 2, R, A);
diff --git a/soft-fp/trunctfsf2.c b/soft-fp/trunctfsf2.c
index 8b2f23df25..965e1c488f 100644
--- a/soft-fp/trunctfsf2.c
+++ b/soft-fp/trunctfsf2.c
@@ -42,7 +42,7 @@ __trunctfsf2 (TFtype a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (S, Q, 1, 4, R, A);
#else
FP_TRUNC (S, Q, 1, 2, R, A);
diff --git a/soft-fp/trunctfxf2.c b/soft-fp/trunctfxf2.c
index bcb8e888c6..0d828fac95 100644
--- a/soft-fp/trunctfxf2.c
+++ b/soft-fp/trunctfxf2.c
@@ -41,7 +41,7 @@ __trunctfxf2 (TFtype a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q (A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (E, Q, 4, 4, R, A);
#else
FP_TRUNC (E, Q, 2, 2, R, A);
diff --git a/sysdeps/alpha/ots_cvttx.c b/sysdeps/alpha/ots_cvttx.c
index a2a570c97d..716e45aa54 100644
--- a/sysdeps/alpha/ots_cvttx.c
+++ b/sysdeps/alpha/ots_cvttx.c
@@ -35,7 +35,7 @@ _OtsConvertFloatTX(double a)
AXP_DECL_RETURN_Q(c);
FP_UNPACK_RAW_D(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND(Q,D,4,2,C,A);
#else
FP_EXTEND(Q,D,2,1,C,A);
diff --git a/sysdeps/alpha/ots_cvtxt.c b/sysdeps/alpha/ots_cvtxt.c
index 737142857a..856b213c19 100644
--- a/sysdeps/alpha/ots_cvtxt.c
+++ b/sysdeps/alpha/ots_cvtxt.c
@@ -31,7 +31,7 @@ _OtsConvertFloatXT (long al, long ah, long _round)
FP_INIT_ROUNDMODE;
AXP_UNPACK_SEMIRAW_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC(D,Q,2,4,R,A);
#else
FP_TRUNC(D,Q,1,2,R,A);
diff --git a/sysdeps/ieee754/soft-fp/s_daddl.c b/sysdeps/ieee754/soft-fp/s_daddl.c
index 7f217a88c5..dc909a1c8b 100644
--- a/sysdeps/ieee754/soft-fp/s_daddl.c
+++ b/sysdeps/ieee754/soft-fp/s_daddl.c
@@ -46,7 +46,7 @@ __daddl (_Float128 x, _Float128 y)
FP_UNPACK_SEMIRAW_Q (X, x);
FP_UNPACK_SEMIRAW_Q (Y, y);
FP_ADD_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (D, Q, 2, 4, RN, R);
#else
FP_TRUNC (D, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_ddivl.c b/sysdeps/ieee754/soft-fp/s_ddivl.c
index d792b70de8..8e469c5780 100644
--- a/sysdeps/ieee754/soft-fp/s_ddivl.c
+++ b/sysdeps/ieee754/soft-fp/s_ddivl.c
@@ -46,7 +46,7 @@ __ddivl (_Float128 x, _Float128 y)
FP_UNPACK_Q (X, x);
FP_UNPACK_Q (Y, y);
FP_DIV_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
#else
FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_dmull.c b/sysdeps/ieee754/soft-fp/s_dmull.c
index 9841f817e7..437c55bd80 100644
--- a/sysdeps/ieee754/soft-fp/s_dmull.c
+++ b/sysdeps/ieee754/soft-fp/s_dmull.c
@@ -46,7 +46,7 @@ __dmull (_Float128 x, _Float128 y)
FP_UNPACK_Q (X, x);
FP_UNPACK_Q (Y, y);
FP_MUL_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
#else
FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_dsubl.c b/sysdeps/ieee754/soft-fp/s_dsubl.c
index 14cc769481..699ff44056 100644
--- a/sysdeps/ieee754/soft-fp/s_dsubl.c
+++ b/sysdeps/ieee754/soft-fp/s_dsubl.c
@@ -46,7 +46,7 @@ __dsubl (_Float128 x, _Float128 y)
FP_UNPACK_SEMIRAW_Q (X, x);
FP_UNPACK_SEMIRAW_Q (Y, y);
FP_SUB_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (D, Q, 2, 4, RN, R);
#else
FP_TRUNC (D, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_faddl.c b/sysdeps/ieee754/soft-fp/s_faddl.c
index 4b16984c76..23dfcc046a 100644
--- a/sysdeps/ieee754/soft-fp/s_faddl.c
+++ b/sysdeps/ieee754/soft-fp/s_faddl.c
@@ -42,7 +42,7 @@ __faddl (_Float128 x, _Float128 y)
FP_UNPACK_SEMIRAW_Q (X, x);
FP_UNPACK_SEMIRAW_Q (Y, y);
FP_ADD_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (S, Q, 1, 4, RN, R);
#else
FP_TRUNC (S, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_fdivl.c b/sysdeps/ieee754/soft-fp/s_fdivl.c
index df7a01767c..4792b231b1 100644
--- a/sysdeps/ieee754/soft-fp/s_fdivl.c
+++ b/sysdeps/ieee754/soft-fp/s_fdivl.c
@@ -42,7 +42,7 @@ __fdivl (_Float128 x, _Float128 y)
FP_UNPACK_Q (X, x);
FP_UNPACK_Q (Y, y);
FP_DIV_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
#else
FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_fmull.c b/sysdeps/ieee754/soft-fp/s_fmull.c
index 1ae0e1a187..8d98bf9309 100644
--- a/sysdeps/ieee754/soft-fp/s_fmull.c
+++ b/sysdeps/ieee754/soft-fp/s_fmull.c
@@ -42,7 +42,7 @@ __fmull (_Float128 x, _Float128 y)
FP_UNPACK_Q (X, x);
FP_UNPACK_Q (Y, y);
FP_MUL_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
#else
FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
diff --git a/sysdeps/ieee754/soft-fp/s_fsubl.c b/sysdeps/ieee754/soft-fp/s_fsubl.c
index bafc820a00..bca0060443 100644
--- a/sysdeps/ieee754/soft-fp/s_fsubl.c
+++ b/sysdeps/ieee754/soft-fp/s_fsubl.c
@@ -42,7 +42,7 @@ __fsubl (_Float128 x, _Float128 y)
FP_UNPACK_SEMIRAW_Q (X, x);
FP_UNPACK_SEMIRAW_Q (Y, y);
FP_SUB_Q (R, X, Y);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC (S, Q, 1, 4, RN, R);
#else
FP_TRUNC (S, Q, 1, 2, RN, R);
diff --git a/sysdeps/sparc/sparc32/q_dtoq.c b/sysdeps/sparc/sparc32/q_dtoq.c
index 4fa5eb707a..53f833dbb8 100644
--- a/sysdeps/sparc/sparc32/q_dtoq.c
+++ b/sysdeps/sparc/sparc32/q_dtoq.c
@@ -32,7 +32,7 @@ long double _Q_dtoq(const double a)
FP_INIT_ROUNDMODE;
FP_UNPACK_RAW_D(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND(Q,D,4,2,C,A);
#else
FP_EXTEND(Q,D,2,1,C,A);
diff --git a/sysdeps/sparc/sparc32/q_qtod.c b/sysdeps/sparc/sparc32/q_qtod.c
index e0987fc77d..fe644672ad 100644
--- a/sysdeps/sparc/sparc32/q_qtod.c
+++ b/sysdeps/sparc/sparc32/q_qtod.c
@@ -32,7 +32,7 @@ double _Q_qtod(const long double a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC(D,Q,2,4,R,A);
#else
FP_TRUNC(D,Q,1,2,R,A);
diff --git a/sysdeps/sparc/sparc32/q_qtos.c b/sysdeps/sparc/sparc32/q_qtos.c
index d150c7f36b..36dc247631 100644
--- a/sysdeps/sparc/sparc32/q_qtos.c
+++ b/sysdeps/sparc/sparc32/q_qtos.c
@@ -32,7 +32,7 @@ float _Q_qtos(const long double a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC(S,Q,1,4,R,A);
#else
FP_TRUNC(S,Q,1,2,R,A);
diff --git a/sysdeps/sparc/sparc32/q_stoq.c b/sysdeps/sparc/sparc32/q_stoq.c
index 93fb054cef..6cd8704ce5 100644
--- a/sysdeps/sparc/sparc32/q_stoq.c
+++ b/sysdeps/sparc/sparc32/q_stoq.c
@@ -31,7 +31,7 @@ long double _Q_stoq(const float a)
long double c;
FP_UNPACK_RAW_S(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND(Q,S,4,1,C,A);
#else
FP_EXTEND(Q,S,2,1,C,A);
diff --git a/sysdeps/sparc/sparc64/qp_dtoq.c b/sysdeps/sparc/sparc64/qp_dtoq.c
index 7942c95397..022cb091f8 100644
--- a/sysdeps/sparc/sparc64/qp_dtoq.c
+++ b/sysdeps/sparc/sparc64/qp_dtoq.c
@@ -31,7 +31,7 @@ void _Qp_dtoq(long double *c, const double a)
FP_INIT_ROUNDMODE;
FP_UNPACK_RAW_D(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND(Q,D,4,2,C,A);
#else
FP_EXTEND(Q,D,2,1,C,A);
diff --git a/sysdeps/sparc/sparc64/qp_qtod.c b/sysdeps/sparc/sparc64/qp_qtod.c
index 78e1a209ef..953e2d8d6e 100644
--- a/sysdeps/sparc/sparc64/qp_qtod.c
+++ b/sysdeps/sparc/sparc64/qp_qtod.c
@@ -32,7 +32,7 @@ double _Qp_qtod(const long double *a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_QP(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC(D,Q,2,4,R,A);
#else
FP_TRUNC(D,Q,1,2,R,A);
diff --git a/sysdeps/sparc/sparc64/qp_qtos.c b/sysdeps/sparc/sparc64/qp_qtos.c
index 87901f1b4d..1b932ca189 100644
--- a/sysdeps/sparc/sparc64/qp_qtos.c
+++ b/sysdeps/sparc/sparc64/qp_qtos.c
@@ -32,7 +32,7 @@ float _Qp_qtos(const long double *a)
FP_INIT_ROUNDMODE;
FP_UNPACK_SEMIRAW_QP(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_TRUNC(S,Q,1,4,R,A);
#else
FP_TRUNC(S,Q,1,2,R,A);
diff --git a/sysdeps/sparc/sparc64/qp_stoq.c b/sysdeps/sparc/sparc64/qp_stoq.c
index 005afce11c..4d1c854ebc 100644
--- a/sysdeps/sparc/sparc64/qp_stoq.c
+++ b/sysdeps/sparc/sparc64/qp_stoq.c
@@ -31,7 +31,7 @@ void _Qp_stoq(long double *c, const float a)
FP_INIT_ROUNDMODE;
FP_UNPACK_RAW_S(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+#if _FP_W_TYPE_SIZE < 64
FP_EXTEND(Q,S,4,1,C,A);
#else
FP_EXTEND(Q,S,2,1,C,A);