This is the mail archive of the libc-alpha@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]

soft-fp: add missing FP_INIT_EXCEPTIONS and FP_INIT_ROUNDMODE calls


This patch makes soft-fp files that can raise exceptions use
FP_INIT_EXCEPTIONS or FP_INIT_ROUNDMODE as appropriate so that any
required state is properly initialized.  It depends on my previous
patch <https://sourceware.org/ml/libc-alpha/2013-10/msg00349.html>
that defines FP_INIT_EXCEPTIONS.

I didn't check if any SPARC or Alpha files are missing such
initialization.

Tested for powerpc-nofpu.

2013-10-09  Joseph Myers  <joseph@codesourcery.com>

	* soft-fp/eqdf2.c (__eqdf2): Use FP_INIT_EXCEPTIONS.
	* soft-fp/eqsf2.c (__eqsf2): Likewise.
	* soft-fp/eqtf2.c (__eqtf2): Likewise.
	* soft-fp/fixdfdi.c (__fixdfdi): Likewise.
	* soft-fp/fixdfsi.c (__fixdfsi): Likewise.
	* soft-fp/fixsfdi.c (__fixsfdi): Likewise.
	* soft-fp/fixsfsi.c (__fixsfsi): Likewise.
	* soft-fp/fixtfdi.c (__fixtfdi): Likewise.
	* soft-fp/fixtfsi.c (__fixtfsi): Likewise.
	* soft-fp/fixunsdfdi.c (__fixunsdfdi): Likewise.
	* soft-fp/fixunsdfsi.c (__fixunsdfsi): Likewise.
	* soft-fp/fixunssfdi.c (__fixunssfdi): Likewise.
	* soft-fp/fixunssfsi.c (__fixunssfsi): Likewise.
	* soft-fp/fixunstfdi.c (__fixunstfdi): Likewise.
	* soft-fp/fixunstfsi.c (__fixunstfsi): Likewise.
	* soft-fp/floatdidf.c (__floatdidf): Use FP_INIT_ROUNDMODE.
	* soft-fp/floatdisf.c (__floatdisf): Likewise.
	* soft-fp/floatsisf.c (__floatsisf): Likewise.
	* soft-fp/floatundidf.c (__floatundidf): Likewise.
	* soft-fp/floatundisf.c (__floatundisf): Likewise.
	* soft-fp/floatunsisf.c (__floatunsisf): Likewise.
	* soft-fp/gedf2.c (__gedf2): Use FP_INIT_EXCEPTIONS.
	* soft-fp/gesf2.c (__gesf2): Likewise.
	* soft-fp/getf2.c (__getf2): Likewise.
	* soft-fp/ledf2.c (__ledf2): Likewise.
	* soft-fp/lesf2.c (__lesf2): Likewise.
	* soft-fp/letf2.c (__letf2): Likewise.

diff --git a/soft-fp/eqdf2.c b/soft-fp/eqdf2.c
index c93c118..8e9408a 100644
--- a/soft-fp/eqdf2.c
+++ b/soft-fp/eqdf2.c
@@ -37,6 +37,7 @@ CMPtype __eqdf2(DFtype a, DFtype b)
   FP_DECL_D(A); FP_DECL_D(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_UNPACK_RAW_D(B, b);
   FP_CMP_EQ_D(r, A, B);
diff --git a/soft-fp/eqsf2.c b/soft-fp/eqsf2.c
index e5b2a5f..3884b00 100644
--- a/soft-fp/eqsf2.c
+++ b/soft-fp/eqsf2.c
@@ -37,6 +37,7 @@ CMPtype __eqsf2(SFtype a, SFtype b)
   FP_DECL_S(A); FP_DECL_S(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_UNPACK_RAW_S(B, b);
   FP_CMP_EQ_S(r, A, B);
diff --git a/soft-fp/eqtf2.c b/soft-fp/eqtf2.c
index 47b5d5c..4a80375 100644
--- a/soft-fp/eqtf2.c
+++ b/soft-fp/eqtf2.c
@@ -37,6 +37,7 @@ CMPtype __eqtf2(TFtype a, TFtype b)
   FP_DECL_Q(A); FP_DECL_Q(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_UNPACK_RAW_Q(B, b);
   FP_CMP_EQ_Q(r, A, B);
diff --git a/soft-fp/fixdfdi.c b/soft-fp/fixdfdi.c
index 71ce1d4..c426018 100644
--- a/soft-fp/fixdfdi.c
+++ b/soft-fp/fixdfdi.c
@@ -37,6 +37,7 @@ DItype __fixdfdi(DFtype a)
   FP_DECL_D(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_TO_INT_D(r, A, DI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixdfsi.c b/soft-fp/fixdfsi.c
index f0c9960..97f9afe 100644
--- a/soft-fp/fixdfsi.c
+++ b/soft-fp/fixdfsi.c
@@ -37,6 +37,7 @@ SItype __fixdfsi(DFtype a)
   FP_DECL_D(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_TO_INT_D(r, A, SI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixsfdi.c b/soft-fp/fixsfdi.c
index 5f69d6a..564b96c 100644
--- a/soft-fp/fixsfdi.c
+++ b/soft-fp/fixsfdi.c
@@ -37,6 +37,7 @@ DItype __fixsfdi(SFtype a)
   FP_DECL_S(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_TO_INT_S(r, A, DI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixsfsi.c b/soft-fp/fixsfsi.c
index 6fffdd7..a82bdf3 100644
--- a/soft-fp/fixsfsi.c
+++ b/soft-fp/fixsfsi.c
@@ -37,6 +37,7 @@ SItype __fixsfsi(SFtype a)
   FP_DECL_S(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_TO_INT_S(r, A, SI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixtfdi.c b/soft-fp/fixtfdi.c
index ac67bfb..0b3711a 100644
--- a/soft-fp/fixtfdi.c
+++ b/soft-fp/fixtfdi.c
@@ -37,6 +37,7 @@ DItype __fixtfdi(TFtype a)
   FP_DECL_Q(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_TO_INT_Q(r, A, DI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixtfsi.c b/soft-fp/fixtfsi.c
index 8f27ff6..320c066 100644
--- a/soft-fp/fixtfsi.c
+++ b/soft-fp/fixtfsi.c
@@ -37,6 +37,7 @@ SItype __fixtfsi(TFtype a)
   FP_DECL_Q(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_TO_INT_Q(r, A, SI_BITS, 1);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunsdfdi.c b/soft-fp/fixunsdfdi.c
index 82fe1c7..22f9739 100644
--- a/soft-fp/fixunsdfdi.c
+++ b/soft-fp/fixunsdfdi.c
@@ -37,6 +37,7 @@ UDItype __fixunsdfdi(DFtype a)
   FP_DECL_D(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_TO_INT_D(r, A, DI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunsdfsi.c b/soft-fp/fixunsdfsi.c
index 43287b0..fad5e35 100644
--- a/soft-fp/fixunsdfsi.c
+++ b/soft-fp/fixunsdfsi.c
@@ -37,6 +37,7 @@ USItype __fixunsdfsi(DFtype a)
   FP_DECL_D(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_TO_INT_D(r, A, SI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunssfdi.c b/soft-fp/fixunssfdi.c
index c0691c6..4d6b91c 100644
--- a/soft-fp/fixunssfdi.c
+++ b/soft-fp/fixunssfdi.c
@@ -37,6 +37,7 @@ UDItype __fixunssfdi(SFtype a)
   FP_DECL_S(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_TO_INT_S(r, A, DI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunssfsi.c b/soft-fp/fixunssfsi.c
index 3d00ce8..8d4ed89 100644
--- a/soft-fp/fixunssfsi.c
+++ b/soft-fp/fixunssfsi.c
@@ -37,6 +37,7 @@ USItype __fixunssfsi(SFtype a)
   FP_DECL_S(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_TO_INT_S(r, A, SI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunstfdi.c b/soft-fp/fixunstfdi.c
index d6038fa..4f6c2f8 100644
--- a/soft-fp/fixunstfdi.c
+++ b/soft-fp/fixunstfdi.c
@@ -37,6 +37,7 @@ UDItype __fixunstfdi(TFtype a)
   FP_DECL_Q(A);
   UDItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_TO_INT_Q(r, A, DI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/fixunstfsi.c b/soft-fp/fixunstfsi.c
index c8481f1..801009c 100644
--- a/soft-fp/fixunstfsi.c
+++ b/soft-fp/fixunstfsi.c
@@ -37,6 +37,7 @@ USItype __fixunstfsi(TFtype a)
   FP_DECL_Q(A);
   USItype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_TO_INT_Q(r, A, SI_BITS, 0);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatdidf.c b/soft-fp/floatdidf.c
index f6f594a..70082e1 100644
--- a/soft-fp/floatdidf.c
+++ b/soft-fp/floatdidf.c
@@ -37,6 +37,7 @@ DFtype __floatdidf(DItype i)
   FP_DECL_D(A);
   DFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_D(A, i, DI_BITS, UDItype);
   FP_PACK_RAW_D(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatdisf.c b/soft-fp/floatdisf.c
index 72252e4..4a93793 100644
--- a/soft-fp/floatdisf.c
+++ b/soft-fp/floatdisf.c
@@ -37,6 +37,7 @@ SFtype __floatdisf(DItype i)
   FP_DECL_S(A);
   SFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_S(A, i, DI_BITS, UDItype);
   FP_PACK_RAW_S(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatsisf.c b/soft-fp/floatsisf.c
index c9ff205..b4afb9f 100644
--- a/soft-fp/floatsisf.c
+++ b/soft-fp/floatsisf.c
@@ -37,6 +37,7 @@ SFtype __floatsisf(SItype i)
   FP_DECL_S(A);
   SFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_S(A, i, SI_BITS, USItype);
   FP_PACK_RAW_S(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatundidf.c b/soft-fp/floatundidf.c
index 1babcec..53877c2 100644
--- a/soft-fp/floatundidf.c
+++ b/soft-fp/floatundidf.c
@@ -37,6 +37,7 @@ DFtype __floatundidf(UDItype i)
   FP_DECL_D(A);
   DFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_D(A, i, DI_BITS, UDItype);
   FP_PACK_RAW_D(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatundisf.c b/soft-fp/floatundisf.c
index 1c645c0..cec4b0d 100644
--- a/soft-fp/floatundisf.c
+++ b/soft-fp/floatundisf.c
@@ -37,6 +37,7 @@ SFtype __floatundisf(UDItype i)
   FP_DECL_S(A);
   SFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_S(A, i, DI_BITS, UDItype);
   FP_PACK_RAW_S(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/floatunsisf.c b/soft-fp/floatunsisf.c
index 2c0cc89..0a694f6 100644
--- a/soft-fp/floatunsisf.c
+++ b/soft-fp/floatunsisf.c
@@ -37,6 +37,7 @@ SFtype __floatunsisf(USItype i)
   FP_DECL_S(A);
   SFtype a;
 
+  FP_INIT_ROUNDMODE;
   FP_FROM_INT_S(A, i, SI_BITS, USItype);
   FP_PACK_RAW_S(a, A);
   FP_HANDLE_EXCEPTIONS;
diff --git a/soft-fp/gedf2.c b/soft-fp/gedf2.c
index 0ef9f5d..a36f572 100644
--- a/soft-fp/gedf2.c
+++ b/soft-fp/gedf2.c
@@ -37,6 +37,7 @@ CMPtype __gedf2(DFtype a, DFtype b)
   FP_DECL_D(A); FP_DECL_D(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_UNPACK_RAW_D(B, b);
   FP_CMP_D(r, A, B, -2);
diff --git a/soft-fp/gesf2.c b/soft-fp/gesf2.c
index f0a8377..899fcc5 100644
--- a/soft-fp/gesf2.c
+++ b/soft-fp/gesf2.c
@@ -37,6 +37,7 @@ CMPtype __gesf2(SFtype a, SFtype b)
   FP_DECL_S(A); FP_DECL_S(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_UNPACK_RAW_S(B, b);
   FP_CMP_S(r, A, B, -2);
diff --git a/soft-fp/getf2.c b/soft-fp/getf2.c
index 705d48b..d9cb26d 100644
--- a/soft-fp/getf2.c
+++ b/soft-fp/getf2.c
@@ -37,6 +37,7 @@ CMPtype __getf2(TFtype a, TFtype b)
   FP_DECL_Q(A); FP_DECL_Q(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_UNPACK_RAW_Q(B, b);
   FP_CMP_Q(r, A, B, -2);
diff --git a/soft-fp/ledf2.c b/soft-fp/ledf2.c
index 7b8f403..6922d2f 100644
--- a/soft-fp/ledf2.c
+++ b/soft-fp/ledf2.c
@@ -37,6 +37,7 @@ CMPtype __ledf2(DFtype a, DFtype b)
   FP_DECL_D(A); FP_DECL_D(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_D(A, a);
   FP_UNPACK_RAW_D(B, b);
   FP_CMP_D(r, A, B, 2);
diff --git a/soft-fp/lesf2.c b/soft-fp/lesf2.c
index 41f823b..cee5614 100644
--- a/soft-fp/lesf2.c
+++ b/soft-fp/lesf2.c
@@ -37,6 +37,7 @@ CMPtype __lesf2(SFtype a, SFtype b)
   FP_DECL_S(A); FP_DECL_S(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_S(A, a);
   FP_UNPACK_RAW_S(B, b);
   FP_CMP_S(r, A, B, 2);
diff --git a/soft-fp/letf2.c b/soft-fp/letf2.c
index 59342ca..7644b26 100644
--- a/soft-fp/letf2.c
+++ b/soft-fp/letf2.c
@@ -37,6 +37,7 @@ CMPtype __letf2(TFtype a, TFtype b)
   FP_DECL_Q(A); FP_DECL_Q(B);
   CMPtype r;
 
+  FP_INIT_EXCEPTIONS;
   FP_UNPACK_RAW_Q(A, a);
   FP_UNPACK_RAW_Q(B, b);
   FP_CMP_Q(r, A, B, 2);

-- 
Joseph S. Myers
joseph@codesourcery.com


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