qemu-patch-raspberry4/tests/tcg/multiarch/float_helpers.h
Alex Bennée a4f3ed629e 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>
2019-09-26 19:00:53 +01:00

27 lines
573 B
C

/*
* 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);