diff options
Diffstat (limited to 'tests/tcg/multiarch/float_helpers.h')
-rw-r--r-- | tests/tcg/multiarch/float_helpers.h | 26 |
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); |