Skip to content

Commit

Permalink
target-ppc: Use correct precision for FPRF setting
Browse files Browse the repository at this point in the history
Use correct FP precision when setting FPRF in FP conversion helpers
instead of always assuming float64 precision.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
Bharata B Rao authored and dgibson committed Jan 30, 2017
1 parent f566c04 commit 9aeae8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/ppc/fpu_helper.c
Expand Up @@ -109,6 +109,7 @@ void helper_compute_fprf_##tp(CPUPPCState *env, tp arg) \
}

COMPUTE_FPRF(float16)
COMPUTE_FPRF(float32)
COMPUTE_FPRF(float64)

/* Floating-point invalid operations exception */
Expand Down Expand Up @@ -2652,8 +2653,7 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \
xt.tfld = ttp##_snan_to_qnan(xt.tfld); \
} \
if (sfprf) { \
helper_compute_fprf_float64(env, ttp##_to_float64(xt.tfld, \
&env->fp_status)); \
helper_compute_fprf_##ttp(env, xt.tfld); \
} \
} \
\
Expand Down
1 change: 1 addition & 0 deletions target/ppc/internal.h
Expand Up @@ -244,4 +244,5 @@ static inline void putVSR(int n, ppc_vsr_t *vsr, CPUPPCState *env)
}

void helper_compute_fprf_float16(CPUPPCState *env, float16 arg);
void helper_compute_fprf_float32(CPUPPCState *env, float32 arg);
#endif /* PPC_INTERNAL_H */

0 comments on commit 9aeae8e

Please sign in to comment.