summaryrefslogtreecommitdiffstats
path: root/tests/tcg/multiarch/float_helpers.h
diff options
context:
space:
mode:
authorAlex Bennée2019-09-13 13:12:17 +0200
committerAlex Bennée2019-09-26 20:00:53 +0200
commita4f3ed629e985f1b5d3b7e0b681ff02e391d699a (patch)
tree9358b4cdd0f2f82a41405450b8291b9988391efd /tests/tcg/multiarch/float_helpers.h
parenttests/tcg: re-enable linux-test for ppc64abi32 (diff)
downloadqemu-a4f3ed629e985f1b5d3b7e0b681ff02e391d699a.tar.gz
qemu-a4f3ed629e985f1b5d3b7e0b681ff02e391d699a.tar.xz
qemu-a4f3ed629e985f1b5d3b7e0b681ff02e391d699a.zip
tests/tcg: add float_madds test to multiarch
This is a generic floating point multiply and accumulate test for single precision floating point values. I've split of the common float functions into a helper library so additional tests can use the same common code. As I don't have references for all architectures I've allowed some flexibility for tests to pass without reference files. They can be added as we get collect them. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'tests/tcg/multiarch/float_helpers.h')
-rw-r--r--tests/tcg/multiarch/float_helpers.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/tcg/multiarch/float_helpers.h b/tests/tcg/multiarch/float_helpers.h
new file mode 100644
index 0000000000..6337bc66c1
--- /dev/null
+++ b/tests/tcg/multiarch/float_helpers.h
@@ -0,0 +1,26 @@
+/*
+ * Common Float Helpers
+ *
+ * Copyright (c) 2019 Linaro
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include <inttypes.h>
+
+/* Number of constants in each table */
+int get_num_f16(void);
+int get_num_f32(void);
+int get_num_f64(void);
+
+/* Accessor helpers, overflows will automatically wrap */
+uint16_t get_f16(int i); /* use _Float16 when we can */
+float get_f32(int i);
+double get_f64(int i);
+
+/* Return format strings, free after use */
+char * fmt_f16(uint16_t);
+char * fmt_f32(float);
+char * fmt_f64(double);
+/* exception flags */
+char * fmt_flags(void);