agx: Add minifloat tests

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582>
This commit is contained in:
Alyssa Rosenzweig 2021-04-16 14:55:39 -04:00 committed by Alyssa Rosenzweig
parent c89ab07996
commit 8191adb0d9

View file

@ -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");