From: Alyssa Rosenzweig Date: Fri, 16 Apr 2021 18:55:39 +0000 (-0400) Subject: agx: Add minifloat tests X-Git-Tag: upstream/21.2.3~4001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8191adb0d9ff3c7ede0d25ceb79200e3bbf16124;p=platform%2Fupstream%2Fmesa.git agx: Add minifloat tests Signed-off-by: Alyssa Rosenzweig Acked-by: Jason Ekstrand Acked-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/asahi/compiler/cmdline.c b/src/asahi/compiler/cmdline.c index 1f33283..b2f6d10 100644 --- a/src/asahi/compiler/cmdline.c +++ b/src/asahi/compiler/cmdline.c @@ -30,6 +30,7 @@ #include "compiler/nir_types.h" #include "util/u_dynarray.h" #include "agx_compile.h" +#include "agx_minifloat.h" static int st_packed_uniforms_type_size(const struct glsl_type *type, bool bindless) @@ -206,6 +207,17 @@ disassemble(const char *filename, bool verbose) free(code); } +static void +tests() +{ +#ifndef NDEBUG + agx_minifloat_tests(); + printf("Pass.\n"); +#else + fprintf(stderr, "tests not compiled in NDEBUG mode"); +#endif +} + int main(int argc, char **argv) { @@ -220,6 +232,8 @@ main(int argc, char **argv) disassemble(argv[2], false); else if (strcmp(argv[1], "disasm-verbose") == 0) disassemble(argv[2], true); + else if (strcmp(argv[1], "test") == 0) + tests(); else unreachable("Unknown command. Valid: compile/disasm/disasm-verbose");