diff mbox series

[v2,03/76] tests/tcg: Do not require FE_* exception bits

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

Commit Message

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

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

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

Philippe Mathieu-Daudé Aug. 31, 2020, 5:30 p.m. UTC | #1
Le ven. 28 août 2020 16:22, Richard Henderson <richard.henderson@linaro.org>
a écrit :

> Define anything that is missing as 0, so that flags & FE_FOO

> is false for any missing FOO.

>

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

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

>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


---
>  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

>

>

>
<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 28 août 2020 16:22, Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org">richard.henderson@linaro.org</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Define anything that is missing as 0, so that flags &amp; FE_FOO<br>
is false for any missing FOO.<br>
<br>
Reviewed-by: Edgar E. Iglesias &lt;<a href="mailto:edgar.iglesias@xilinx.com" target="_blank" rel="noreferrer">edgar.iglesias@xilinx.com</a>&gt;<br>

Signed-off-by: Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org" target="_blank" rel="noreferrer">richard.henderson@linaro.org</a>&gt;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px">Reviewed-by: Philippe Mathieu-Daudé &lt;</span><a href="mailto:f4bug@amsat.org" style="text-decoration:none;color:rgb(66,133,244);font-family:sans-serif;font-size:13.696px">f4bug@amsat.org</a><span style="font-family:sans-serif;font-size:13.696px">&gt;</span><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

---<br>
 tests/tcg/multiarch/float_helpers.h | 17 +++++++++++++++++<br>
 1 file changed, 17 insertions(+)<br>
<br>
diff --git a/tests/tcg/multiarch/float_helpers.h b/tests/tcg/multiarch/float_helpers.h<br>
index 6337bc66c1..309f3f4bf1 100644<br>
--- a/tests/tcg/multiarch/float_helpers.h<br>
+++ b/tests/tcg/multiarch/float_helpers.h<br>
@@ -8,6 +8,23 @@<br>
<br>
 #include &lt;inttypes.h&gt;<br>
<br>
+/* Some hosts do not have support for all of these; not required by ISO C. */<br>
+#ifndef FE_OVERFLOW<br>
+#define FE_OVERFLOW 0<br>
+#endif<br>
+#ifndef FE_UNDERFLOW<br>
+#define FE_UNDERFLOW 0<br>
+#endif<br>
+#ifndef FE_DIVBYZERO<br>
+#define FE_DIVBYZERO 0<br>
+#endif<br>
+#ifndef FE_INEXACT<br>
+#define FE_INEXACT 0<br>
+#endif<br>
+#ifndef FE_INVALID<br>
+#define FE_INVALID 0<br>
+#endif<br>
+<br>
 /* Number of constants in each table */<br>
 int get_num_f16(void);<br>
 int get_num_f32(void);<br>
-- <br>
2.25.1<br>
<br>
<br>
</blockquote></div></div></div>
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);