mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
fpu: Use {get,set}_flush_inputs_to_zero everywhere
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -218,7 +218,7 @@ static void partsN(canonicalize)(FloatPartsN *p, float_status *status,
|
||||
if (unlikely(p->exp == 0)) {
|
||||
if (likely(fracN(eqz)(p))) {
|
||||
p->cls = float_class_zero;
|
||||
} else if (status->flush_inputs_to_zero) {
|
||||
} else if (get_flush_inputs_to_zero(status)) {
|
||||
float_raise(float_flag_input_denormal_flushed, status);
|
||||
p->cls = float_class_zero;
|
||||
fracN(clear)(p);
|
||||
|
||||
@@ -141,7 +141,7 @@ GEN_INPUT_FLUSH__NOCHECK(float64_input_flush__nocheck, float64)
|
||||
#define GEN_INPUT_FLUSH1(name, soft_t) \
|
||||
static inline void name(soft_t *a, float_status *s) \
|
||||
{ \
|
||||
if (likely(!s->flush_inputs_to_zero)) { \
|
||||
if (likely(!get_flush_inputs_to_zero(s))) { \
|
||||
return; \
|
||||
} \
|
||||
soft_t ## _input_flush__nocheck(a, s); \
|
||||
@@ -154,7 +154,7 @@ GEN_INPUT_FLUSH1(float64_input_flush1, float64)
|
||||
#define GEN_INPUT_FLUSH2(name, soft_t) \
|
||||
static inline void name(soft_t *a, soft_t *b, float_status *s) \
|
||||
{ \
|
||||
if (likely(!s->flush_inputs_to_zero)) { \
|
||||
if (likely(!get_flush_inputs_to_zero(s))) { \
|
||||
return; \
|
||||
} \
|
||||
soft_t ## _input_flush__nocheck(a, s); \
|
||||
@@ -168,7 +168,7 @@ GEN_INPUT_FLUSH2(float64_input_flush2, float64)
|
||||
#define GEN_INPUT_FLUSH3(name, soft_t) \
|
||||
static inline void name(soft_t *a, soft_t *b, soft_t *c, float_status *s) \
|
||||
{ \
|
||||
if (likely(!s->flush_inputs_to_zero)) { \
|
||||
if (likely(!get_flush_inputs_to_zero(s))) { \
|
||||
return; \
|
||||
} \
|
||||
soft_t ## _input_flush__nocheck(a, s); \
|
||||
@@ -4764,7 +4764,7 @@ static bool parts_squash_denormal(FloatParts64 p, float_status *status)
|
||||
|
||||
float16 float16_squash_input_denormal(float16 a, float_status *status)
|
||||
{
|
||||
if (status->flush_inputs_to_zero) {
|
||||
if (get_flush_inputs_to_zero(status)) {
|
||||
FloatParts64 p = unpack_raw64(&float16_params, a);
|
||||
|
||||
if (parts_squash_denormal(p, status)) {
|
||||
@@ -4776,7 +4776,7 @@ float16 float16_squash_input_denormal(float16 a, float_status *status)
|
||||
|
||||
float32 float32_squash_input_denormal(float32 a, float_status *status)
|
||||
{
|
||||
if (status->flush_inputs_to_zero) {
|
||||
if (get_flush_inputs_to_zero(status)) {
|
||||
FloatParts64 p = unpack_raw64(&float32_params, a);
|
||||
|
||||
if (parts_squash_denormal(p, status)) {
|
||||
@@ -4788,7 +4788,7 @@ float32 float32_squash_input_denormal(float32 a, float_status *status)
|
||||
|
||||
float64 float64_squash_input_denormal(float64 a, float_status *status)
|
||||
{
|
||||
if (status->flush_inputs_to_zero) {
|
||||
if (get_flush_inputs_to_zero(status)) {
|
||||
FloatParts64 p = unpack_raw64(&float64_params, a);
|
||||
|
||||
if (parts_squash_denormal(p, status)) {
|
||||
@@ -4800,7 +4800,7 @@ float64 float64_squash_input_denormal(float64 a, float_status *status)
|
||||
|
||||
bfloat16 bfloat16_squash_input_denormal(bfloat16 a, float_status *status)
|
||||
{
|
||||
if (status->flush_inputs_to_zero) {
|
||||
if (get_flush_inputs_to_zero(status)) {
|
||||
FloatParts64 p = unpack_raw64(&bfloat16_params, a);
|
||||
|
||||
if (parts_squash_denormal(p, status)) {
|
||||
|
||||
@@ -151,7 +151,7 @@ void helper_ieee_input_cmp(CPUAlphaState *env, uint64_t val)
|
||||
void helper_ieee_input_s(CPUAlphaState *env, uint64_t val)
|
||||
{
|
||||
if (unlikely(2 * val - 1 < 0x1fffffffffffffull)
|
||||
&& !env->fp_status.flush_inputs_to_zero) {
|
||||
&& !get_flush_inputs_to_zero(&env->fp_status)) {
|
||||
arith_excp(env, GETPC(), EXC_M_INV | EXC_M_SWC, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "exec/page-protection.h"
|
||||
#include "exec/target_page.h"
|
||||
#include "fpu/softfloat-types.h"
|
||||
#include "fpu/softfloat-helpers.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "qemu/qemu-print.h"
|
||||
#include "system/memory.h"
|
||||
@@ -80,7 +81,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t val)
|
||||
env->fpcr_exc_enable = ~t & FPCR_STATUS_MASK;
|
||||
|
||||
env->fpcr_dyn_round = rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT];
|
||||
env->fp_status.flush_inputs_to_zero = (fpcr & FPCR_DNZ) != 0;
|
||||
set_flush_inputs_to_zero(fpcr & FPCR_DNZ, &env->fp_status);
|
||||
|
||||
t = (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ);
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
|
||||
@@ -672,7 +672,7 @@ static void parse_args(int argc, char *argv[])
|
||||
tester = val;
|
||||
break;
|
||||
case 'z':
|
||||
soft_status.flush_inputs_to_zero = 1;
|
||||
set_flush_inputs_to_zero(true, &soft_status);
|
||||
break;
|
||||
case 'Z':
|
||||
set_flush_to_zero(true, &soft_status);
|
||||
|
||||
Reference in New Issue
Block a user