diff mbox series

[03/77] tests/tcg: Do not require FE_* exception bits

Message ID 20200825205950.730499-4-richard.henderson@linaro.org
State Superseded
Headers show
Series target/microblaze improvements | expand

Commit Message

Richard Henderson Aug. 25, 2020, 8:58 p.m. UTC
Define anything that is missing as 0, so that flags & FE_FOO
is false for any missing FOO.

Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tests/tcg/multiarch/float_helpers.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

-- 
2.25.1

Comments

Edgar E. Iglesias Aug. 26, 2020, 4:21 p.m. UTC | #1
On Tue, Aug 25, 2020 at 01:58:36PM -0700, Richard Henderson wrote:
> Define anything that is missing as 0, so that flags & FE_FOO

> is false for any missing FOO.

> 

> Cc: Alex Bennée <alex.bennee@linaro.org>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>



> ---

>  tests/tcg/multiarch/float_helpers.h | 17 +++++++++++++++++

>  1 file changed, 17 insertions(+)

> 

> diff --git a/tests/tcg/multiarch/float_helpers.h b/tests/tcg/multiarch/float_helpers.h

> index 6337bc66c1..309f3f4bf1 100644

> --- a/tests/tcg/multiarch/float_helpers.h

> +++ b/tests/tcg/multiarch/float_helpers.h

> @@ -8,6 +8,23 @@

>  

>  #include <inttypes.h>

>  

> +/* Some hosts do not have support for all of these; not required by ISO C. */

> +#ifndef FE_OVERFLOW

> +#define FE_OVERFLOW 0

> +#endif

> +#ifndef FE_UNDERFLOW

> +#define FE_UNDERFLOW 0

> +#endif

> +#ifndef FE_DIVBYZERO

> +#define FE_DIVBYZERO 0

> +#endif

> +#ifndef FE_INEXACT

> +#define FE_INEXACT 0

> +#endif

> +#ifndef FE_INVALID

> +#define FE_INVALID 0

> +#endif

> +

>  /* Number of constants in each table */

>  int get_num_f16(void);

>  int get_num_f32(void);

> -- 

> 2.25.1

>
diff mbox series

Patch

diff --git a/tests/tcg/multiarch/float_helpers.h b/tests/tcg/multiarch/float_helpers.h
index 6337bc66c1..309f3f4bf1 100644
--- a/tests/tcg/multiarch/float_helpers.h
+++ b/tests/tcg/multiarch/float_helpers.h
@@ -8,6 +8,23 @@ 
 
 #include <inttypes.h>
 
+/* Some hosts do not have support for all of these; not required by ISO C. */
+#ifndef FE_OVERFLOW
+#define FE_OVERFLOW 0
+#endif
+#ifndef FE_UNDERFLOW
+#define FE_UNDERFLOW 0
+#endif
+#ifndef FE_DIVBYZERO
+#define FE_DIVBYZERO 0
+#endif
+#ifndef FE_INEXACT
+#define FE_INEXACT 0
+#endif
+#ifndef FE_INVALID
+#define FE_INVALID 0
+#endif
+
 /* Number of constants in each table */
 int get_num_f16(void);
 int get_num_f32(void);