summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_arit.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c
index 8b23baaa279..1b576a29809 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c
@@ -80,6 +80,11 @@ struct unary_test_t
*/
const float *values;
unsigned num_values;
+
+ /*
+ * Required precision in bits.
+ */
+ double precision;
};
@@ -167,15 +172,16 @@ const float sincos_values[] = {
* Unary test cases.
*/
-static const struct unary_test_t unary_tests[] = {
- {"neg", &lp_build_negate, &negf, exp2_values, Elements(exp2_values)},
- {"exp2", &lp_build_exp2, &exp2f, exp2_values, Elements(exp2_values)},
- {"log2", &lp_build_log2, &log2f, log2_values, Elements(log2_values)},
- {"exp", &lp_build_exp, &expf, exp2_values, Elements(exp2_values)},
- {"log", &lp_build_log, &logf, log2_values, Elements(log2_values)},
- {"rsqrt", &lp_build_rsqrt, &rsqrtf, rsqrt_values, Elements(rsqrt_values)},
- {"sin", &lp_build_sin, &sinf, sincos_values, Elements(sincos_values)},
- {"cos", &lp_build_cos, &cosf, sincos_values, Elements(sincos_values)},
+static const struct unary_test_t
+unary_tests[] = {
+ {"neg", &lp_build_negate, &negf, exp2_values, Elements(exp2_values), 20.0 },
+ {"exp2", &lp_build_exp2, &exp2f, exp2_values, Elements(exp2_values), 20.0 },
+ {"log2", &lp_build_log2, &log2f, log2_values, Elements(log2_values), 10.0 }, // FIXME
+ {"exp", &lp_build_exp, &expf, exp2_values, Elements(exp2_values), 18.0 },
+ {"log", &lp_build_log, &logf, log2_values, Elements(log2_values), 10.0 }, // FIXME
+ {"rsqrt", &lp_build_rsqrt, &rsqrtf, rsqrt_values, Elements(rsqrt_values), 20.0 },
+ {"sin", &lp_build_sin, &sinf, sincos_values, Elements(sincos_values), 20.0 },
+ {"cos", &lp_build_cos, &cosf, sincos_values, Elements(sincos_values), 20.0 },
};
@@ -254,7 +260,7 @@ test_unary(struct gallivm_state *gallivm, unsigned verbose, FILE *fp, const stru
double error = fabs(src - ref);
double precision = error ? -log2(error/fabs(ref)) : FLT_MANT_DIG;
- bool pass = precision >= 20.0;
+ bool pass = precision >= test->precision;
if (isnan(ref)) {
continue;