mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
softfloat: Move pick_nan_muladd to softfloat-parts.c.inc
At the same time, convert to pointers, rename to pick_nan_muladd$N and define a macro for pick_nan_muladd using QEMU_GENERIC. Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
22c355f417
commit
979582d071
2 changed files with 53 additions and 40 deletions
|
@ -60,3 +60,43 @@ static FloatPartsN *partsN(pick_nan)(FloatPartsN *a, FloatPartsN *b,
|
|||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN *a, FloatPartsN *b,
|
||||
FloatPartsN *c, float_status *s,
|
||||
int ab_mask, int abc_mask)
|
||||
{
|
||||
int which;
|
||||
|
||||
if (unlikely(abc_mask & float_cmask_snan)) {
|
||||
float_raise(float_flag_invalid, s);
|
||||
}
|
||||
|
||||
which = pickNaNMulAdd(a->cls, b->cls, c->cls,
|
||||
ab_mask == float_cmask_infzero, s);
|
||||
|
||||
if (s->default_nan_mode || which == 3) {
|
||||
/*
|
||||
* Note that this check is after pickNaNMulAdd so that function
|
||||
* has an opportunity to set the Invalid flag for infzero.
|
||||
*/
|
||||
parts_default_nan(a, s);
|
||||
return a;
|
||||
}
|
||||
|
||||
switch (which) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
a = b;
|
||||
break;
|
||||
case 2:
|
||||
a = c;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
if (is_snan(a->cls)) {
|
||||
parts_silence_nan(a, s);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue