about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32
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 /sysdeps/sparc/sparc32
parent2ef427168818ce04b03cecb7b739f9db0156e3e4 (diff)
downloadglibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.tar.gz
glibc-69da3c9e87e0a692e79db0615a53782e4198dbf0.tar.xz
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.
Diffstat (limited to 'sysdeps/sparc/sparc32')
-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
4 files changed, 4 insertions, 4 deletions
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);