summaryrefslogtreecommitdiff
path: root/src/gallium/tests
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2020-10-01 13:48:16 -0700
committerMarge Bot <eric+marge@anholt.net>2020-10-01 21:08:12 +0000
commit1aac47db69d5cf40329ccd26acfea8f615db3415 (patch)
treec5a551d14ec3d3b7acff4d4279b44d1615d9aafb /src/gallium/tests
parent4a0164ed85f309ad4909bb481f16d5d4f8337181 (diff)
Revert F16C series (MR 6774)
This reverts commit 4fb2eddfdf9adafde2e6f94de23202ee44123d59. This reverts commit 7a1deb16f8af4e0ae4ed64511cbfcc606087f0ee. This reverts commit 2b6a17234376817e75d1f81edf5bd1b28eefb374. This reverts commit 5af81393e419eaf086e4de2a1d149af78cd1f54d. This reverts commit 87900afe5bbe90c5f3ad0921b28ae1c889029ada. A couple of problems were discovered after this series was merged that cause breakage in different configurations: (1) It seems that using -mf16c also enables AVX, leading to SIGILL on platforms that do not support AVX. (2) Since clang only warns about unknown flags, and as I understand it Meson's handling in cc.has_argument() is broken, the F16C code is wrongly enabled when clang is used, even for example on ARM, leading to a compilation error. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3583 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6969>
Diffstat (limited to 'src/gallium/tests')
-rw-r--r--src/gallium/tests/unit/translate_test.c4
-rw-r--r--src/gallium/tests/unit/u_half_test.c31
2 files changed, 11 insertions, 24 deletions
diff --git a/src/gallium/tests/unit/translate_test.c b/src/gallium/tests/unit/translate_test.c
index 4d9c4e27ebf..b07db7f4eb8 100644
--- a/src/gallium/tests/unit/translate_test.c
+++ b/src/gallium/tests/unit/translate_test.c
@@ -27,7 +27,7 @@
#include "translate/translate.h"
#include "util/u_memory.h"
#include "util/format/u_format.h"
-#include "util/half_float.h"
+#include "util/u_half.h"
#include "util/u_cpu_detect.h"
#include "rtasm/rtasm_cpu.h"
@@ -164,7 +164,7 @@ int main(int argc, char** argv)
double_buffer[i] = rand_double();
for (i = 0; i < buffer_size / sizeof(double); ++i)
- half_buffer[i] = _mesa_float_to_half((float) rand_double());
+ half_buffer[i] = util_float_to_half((float) rand_double());
for (i = 0; i < count; ++i)
elts[i] = i;
diff --git a/src/gallium/tests/unit/u_half_test.c b/src/gallium/tests/unit/u_half_test.c
index 7f2eba9382b..48a9a2d539c 100644
--- a/src/gallium/tests/unit/u_half_test.c
+++ b/src/gallium/tests/unit/u_half_test.c
@@ -3,11 +3,10 @@
#include <float.h>
#include "util/u_math.h"
-#include "util/half_float.h"
-#include "util/u_cpu_detect.h"
+#include "util/u_half.h"
-static void
-test(void)
+int
+main(int argc, char **argv)
{
unsigned i;
unsigned roundtrip_fails = 0;
@@ -18,8 +17,8 @@ test(void)
union fi f;
uint16_t rh;
- f.f = _mesa_half_to_float(h);
- rh = _mesa_float_to_half(f.f);
+ f.f = util_half_to_float(h);
+ rh = util_float_to_half(f.f);
if (h != rh && !(util_is_half_nan(h) && util_is_half_nan(rh))) {
printf("Roundtrip failed: %x -> %x = %f -> %x\n", h, f.ui, f.f, rh);
@@ -29,21 +28,9 @@ test(void)
if(roundtrip_fails) {
printf("Failure! %u/65536 half floats failed a conversion to float and back.\n", roundtrip_fails);
- exit(1);
+ return 1;
+ } else {
+ printf("Success!\n");
+ return 0;
}
}
-
-int
-main(int argc, char **argv)
-{
- assert(!util_cpu_caps.has_f16c);
- test();
-
- /* Test f16c. */
- util_cpu_detect();
- if (util_cpu_caps.has_f16c)
- test();
-
- printf("Success!\n");
- return 0;
-}