Re: [Piglit] [PATCH] tests: only run rounding tests if FE_UPWARD is present

2018-11-30 Thread Eric Engestrom
On Friday, 2018-11-30 18:31:16 +, Burton, Ross wrote:
> On Fri, 30 Nov 2018 at 17:44, Eric Engestrom  wrote:
> > On Friday, 2018-11-30 16:33:23 +, Ross Burton wrote:
> > > On ARM, musl does not define FE_* when the architecture does not have VFP 
> > > (which
> > > is the right interpretation).
> > >
> > > As these tests depend on calling fesetround(), skip the test if FE_UPWARD 
> > > isn't
> > > available.
> > >
> > > Signed-off-by: Ross Burton 
> >
> > Maybe add to the commit message when pushing:
> >
> >   From the fesetround(3) man page:
> >   > Each of the macros FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, and
> >   > FE_TOWARDZERO is defined when the implementation supports getting
> >   > and setting the corresponding rounding direction.
> >
> > Reviewed-by: Eric Engestrom 
> 
> I can revise the message and re-submit, but I can't push to piglit.

It's fine, I'll do that when I push it on Monday, unless someone beats
me to it :P

> 
> Ross
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] tests: only run rounding tests if FE_UPWARD is present

2018-11-30 Thread Burton, Ross
On Fri, 30 Nov 2018 at 17:44, Eric Engestrom  wrote:
> On Friday, 2018-11-30 16:33:23 +, Ross Burton wrote:
> > On ARM, musl does not define FE_* when the architecture does not have VFP 
> > (which
> > is the right interpretation).
> >
> > As these tests depend on calling fesetround(), skip the test if FE_UPWARD 
> > isn't
> > available.
> >
> > Signed-off-by: Ross Burton 
>
> Maybe add to the commit message when pushing:
>
>   From the fesetround(3) man page:
>   > Each of the macros FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, and
>   > FE_TOWARDZERO is defined when the implementation supports getting
>   > and setting the corresponding rounding direction.
>
> Reviewed-by: Eric Engestrom 

I can revise the message and re-submit, but I can't push to piglit.

Ross
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] tests: only run rounding tests if FE_UPWARD is present

2018-11-30 Thread Eric Engestrom
On Friday, 2018-11-30 16:33:23 +, Ross Burton wrote:
> On ARM, musl does not define FE_* when the architecture does not have VFP 
> (which
> is the right interpretation).
> 
> As these tests depend on calling fesetround(), skip the test if FE_UPWARD 
> isn't
> available.
> 
> Signed-off-by: Ross Burton 

Maybe add to the commit message when pushing:

  From the fesetround(3) man page:
  > Each of the macros FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, and
  > FE_TOWARDZERO is defined when the implementation supports getting
  > and setting the corresponding rounding direction.

Reviewed-by: Eric Engestrom 

> ---
>  tests/general/roundmode-getintegerv.c | 12 
>  tests/general/roundmode-pixelstore.c  | 12 
>  2 files changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/general/roundmode-getintegerv.c 
> b/tests/general/roundmode-getintegerv.c
> index 28ecfaf55..aa99044a1 100644
> --- a/tests/general/roundmode-getintegerv.c
> +++ b/tests/general/roundmode-getintegerv.c
> @@ -79,13 +79,17 @@ test(float val, int expect)
>  void
>  piglit_init(int argc, char **argv)
>  {
> - int ret;
>   bool pass = true;
> - ret = fesetround(FE_UPWARD);
> - if (ret != 0) {
> - printf("Couldn't set rounding mode\n");
> +
> +#ifdef FE_UPWARD
> + if (fesetround(FE_UPWARD) != 0) {
> + printf("Setting rounding mode failed\n");
>   piglit_report_result(PIGLIT_SKIP);
>   }
> +#else
> + printf("Cannot set rounding mode\n");
> + piglit_report_result(PIGLIT_SKIP);
> +#endif
>  
>   pass = test(2.2, 2) && pass;
>   pass = test(2.8, 3) && pass;
> diff --git a/tests/general/roundmode-pixelstore.c 
> b/tests/general/roundmode-pixelstore.c
> index 8a029b257..57ec11c09 100644
> --- a/tests/general/roundmode-pixelstore.c
> +++ b/tests/general/roundmode-pixelstore.c
> @@ -79,13 +79,17 @@ test(float val, int expect)
>  void
>  piglit_init(int argc, char **argv)
>  {
> - int ret;
>   bool pass = true;
> - ret = fesetround(FE_UPWARD);
> - if (ret != 0) {
> - printf("Couldn't set rounding mode\n");
> +
> +#ifdef FE_UPWARD
> + if (fesetround(FE_UPWARD) != 0) {
> + printf("Setting rounding mode failed\n");
>   piglit_report_result(PIGLIT_SKIP);
>   }
> +#else
> + printf("Cannot set rounding mode\n");
> + piglit_report_result(PIGLIT_SKIP);
> +#endif
>  
>   pass = test(2.2, 2) && pass;
>   pass = test(2.8, 3) && pass;
> -- 
> 2.11.0
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] tests: only run rounding tests if FE_UPWARD is present

2018-11-30 Thread Ross Burton
On ARM, musl does not define FE_* when the architecture does not have VFP (which
is the right interpretation).

As these tests depend on calling fesetround(), skip the test if FE_UPWARD isn't
available.

Signed-off-by: Ross Burton 
---
 tests/general/roundmode-getintegerv.c | 12 
 tests/general/roundmode-pixelstore.c  | 12 
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/tests/general/roundmode-getintegerv.c 
b/tests/general/roundmode-getintegerv.c
index 28ecfaf55..aa99044a1 100644
--- a/tests/general/roundmode-getintegerv.c
+++ b/tests/general/roundmode-getintegerv.c
@@ -79,13 +79,17 @@ test(float val, int expect)
 void
 piglit_init(int argc, char **argv)
 {
-   int ret;
bool pass = true;
-   ret = fesetround(FE_UPWARD);
-   if (ret != 0) {
-   printf("Couldn't set rounding mode\n");
+
+#ifdef FE_UPWARD
+   if (fesetround(FE_UPWARD) != 0) {
+   printf("Setting rounding mode failed\n");
piglit_report_result(PIGLIT_SKIP);
}
+#else
+   printf("Cannot set rounding mode\n");
+   piglit_report_result(PIGLIT_SKIP);
+#endif
 
pass = test(2.2, 2) && pass;
pass = test(2.8, 3) && pass;
diff --git a/tests/general/roundmode-pixelstore.c 
b/tests/general/roundmode-pixelstore.c
index 8a029b257..57ec11c09 100644
--- a/tests/general/roundmode-pixelstore.c
+++ b/tests/general/roundmode-pixelstore.c
@@ -79,13 +79,17 @@ test(float val, int expect)
 void
 piglit_init(int argc, char **argv)
 {
-   int ret;
bool pass = true;
-   ret = fesetround(FE_UPWARD);
-   if (ret != 0) {
-   printf("Couldn't set rounding mode\n");
+
+#ifdef FE_UPWARD
+   if (fesetround(FE_UPWARD) != 0) {
+   printf("Setting rounding mode failed\n");
piglit_report_result(PIGLIT_SKIP);
}
+#else
+   printf("Cannot set rounding mode\n");
+   piglit_report_result(PIGLIT_SKIP);
+#endif
 
pass = test(2.2, 2) && pass;
pass = test(2.8, 3) && pass;
-- 
2.11.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit