2 #include "m256-check.h"
61 unsigned long long a
[8];
65 CHECK_EXP (union512i_b
, char, "%d")
66 CHECK_EXP (union512i_w
, short, "%d")
67 CHECK_EXP (union512i_d
, int, "0x%x")
68 CHECK_EXP (union512i_q
, long long, "0x%llx")
69 CHECK_EXP (union512
, float, "%f")
70 CHECK_EXP (union512d
, double, "%f")
71 CHECK_EXP (union512i_ub
, unsigned char, "%d")
72 CHECK_EXP (union512i_uw
, unsigned short, "%d")
73 CHECK_EXP (union512i_ud
, unsigned int, "0x%x")
74 CHECK_EXP (union512i_uq
, unsigned long long, "0x%llx")
77 CHECK_FP_EXP (union512
, float, ESP_FLOAT
, "%f")
78 CHECK_FP_EXP (union512d
, double, ESP_DOUBLE
, "%f")
80 #define CHECK_ROUGH_EXP(UINON_TYPE, VALUE_TYPE, FMT) \
82 __attribute__((noinline, unused)) \
83 check_rough_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v, \
89 for (i = 0; i < ARRAY_SIZE (u.a); i++) \
91 /* We can have have v[i] == 0 == u.a[i] for some i, \
92 when we test zero-masking. */ \
93 if (v[i] == 0.0 && u.a[i] == 0.0) \
95 if (v[i] == 0.0 && u.a[i] != 0.0) \
98 PRINTF ("%i: " FMT " != " FMT "\n", \
101 VALUE_TYPE rel_err = (u.a[i] - v[i]) / v[i]; \
102 if (((rel_err < 0) ? -rel_err : rel_err) > eps) \
105 PRINTF ("%i: " FMT " != " FMT "\n", \
112 CHECK_ROUGH_EXP (union512
, float, "%f")
113 CHECK_ROUGH_EXP (union512d
, double, "%f")
114 CHECK_ROUGH_EXP (union256
, float, "%f")
115 CHECK_ROUGH_EXP (union256d
, double, "%f")
116 CHECK_ROUGH_EXP (union128
, float, "%f")
117 CHECK_ROUGH_EXP (union128d
, double, "%f")