Skip to content

Commit

Permalink
target-ppc: use the softfloat min/max functions
Browse files Browse the repository at this point in the history
Use the new softfloat float32_min() and float32_max() to implement the
vminfp and vmaxfp instructions. As a bonus we can get rid of the call to
the HANDLE_NAN2 macro, as the NaN handling is directly done at the
softfloat level.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
  • Loading branch information
aurel32 authored and agraf committed Oct 4, 2012
1 parent ef9bd15 commit db1babb
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions target-ppc/int_helper.c
Expand Up @@ -414,6 +414,8 @@ VARITH(uwm, u32)
}
VARITHFP(addfp, float32_add)
VARITHFP(subfp, float32_sub)
VARITHFP(minfp, float32_min)
VARITHFP(maxfp, float32_max)
#undef VARITHFP

#define VARITHSAT_CASE(type, op, cvt, element) \
Expand Down Expand Up @@ -728,27 +730,6 @@ VMINMAX(uw, u32)
#undef VMINMAX_DO
#undef VMINMAX

#define VMINMAXFP(suffix, rT, rF) \
void helper_v##suffix(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, \
ppc_avr_t *b) \
{ \
int i; \
\
for (i = 0; i < ARRAY_SIZE(r->f); i++) { \
HANDLE_NAN2(r->f[i], a->f[i], b->f[i]) { \
if (float32_lt_quiet(a->f[i], b->f[i], \
&env->vec_status)) { \
r->f[i] = rT->f[i]; \
} else { \
r->f[i] = rF->f[i]; \
} \
} \
} \
}
VMINMAXFP(minfp, a, b)
VMINMAXFP(maxfp, b, a)
#undef VMINMAXFP

void helper_vmladduhm(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
{
int i;
Expand Down

0 comments on commit db1babb

Please sign in to comment.