softfloat: Move muladd_floats to softfloat-parts.c.inc

Rename to parts$N_muladd.
Implement float128_muladd with FloatParts128.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2020-10-24 06:04:19 -07:00
parent aca845275a
commit dedd123c56
6 changed files with 342 additions and 214 deletions

View file

@ -386,7 +386,7 @@ static void bench(enum precision prec, enum op op, int n_ops, bool no_neg)
for (i = 0; i < OPS_PER_ITER; i++) {
float128 a = ops[0].f128;
float128 b = ops[1].f128;
/* float128 c = ops[2].f128; */
float128 c = ops[2].f128;
switch (op) {
case OP_ADD:
@ -401,9 +401,9 @@ static void bench(enum precision prec, enum op op, int n_ops, bool no_neg)
case OP_DIV:
res.f128 = float128_div(a, b, &soft_status);
break;
/* case OP_FMA: */
/* res.f128 = float128_muladd(a, b, c, 0, &soft_status); */
/* break; */
case OP_FMA:
res.f128 = float128_muladd(a, b, c, 0, &soft_status);
break;
case OP_SQRT:
res.f128 = float128_sqrt(a, &soft_status);
break;

View file

@ -717,7 +717,7 @@ static void do_testfloat(int op, int rmode, bool exact)
test_abz_f128(true_abz_f128M, subj_abz_f128M);
break;
case F128_MULADD:
not_implemented();
test_abcz_f128(slow_f128M_mulAdd, qemu_f128M_mulAdd);
break;
case F128_SQRT:
test_az_f128(slow_f128M_sqrt, qemu_f128M_sqrt);

View file

@ -574,6 +574,18 @@ WRAP_MULADD(qemu_f32_mulAdd, float32_muladd, float32)
WRAP_MULADD(qemu_f64_mulAdd, float64_muladd, float64)
#undef WRAP_MULADD
static void qemu_f128M_mulAdd(const float128_t *ap, const float128_t *bp,
const float128_t *cp, float128_t *res)
{
float128 a, b, c, ret;
a = soft_to_qemu128(*ap);
b = soft_to_qemu128(*bp);
c = soft_to_qemu128(*cp);
ret = float128_muladd(a, b, c, 0, &qsf);
*res = qemu_to_soft128(ret);
}
#define WRAP_CMP16(name, func, retcond) \
static bool name(float16_t a, float16_t b) \
{ \