From nobody Sat Apr 5 02:10:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739456853; cv=none; d=zohomail.com; s=zohoarc; b=O3/MEOonr0JJuJDI7b6gsvx6jRVaA4U+BSDoeGE12CpPQk/LaPVcd+M/NdDf/imHmnyO39LC4du0ScejPftRnnHd50tjfib9eMlYuLFbfnJAVy5tvPeQG4ewsGsA4hgcHAw92i+XAyfygfcqavz00KfgTaWhqh/+a16NMZ9vSEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739456853; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SdbBccgNA9iD9ywHMcl4sf5pFjIJuIWSjvGN9CQVHH8=; b=hLz4ew9HJyc+/V2iAlcYuwQj8D1zTjUJKVVCQ/1LNfTo/KoD4PWf1Axb6s5X7EJPMBEVqT5t/HSESovMIu9/nyxt5PHUMMY+i1NUjvREarNY+ANPxH2TWGsR85Jnn4o1Syla7qXmpRyigDTVduK0pLYJMGhG1d/pxd45dxGRIgk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739456853906196.68680399785762; Thu, 13 Feb 2025 06:27:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiaAb-0004UA-G5; Thu, 13 Feb 2025 09:26:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tiaAZ-0004TV-Os for qemu-devel@nongnu.org; Thu, 13 Feb 2025 09:26:24 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiaAX-0006nJ-AE for qemu-devel@nongnu.org; Thu, 13 Feb 2025 09:26:23 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-38dc0cd94a6so520339f8f.0 for ; Thu, 13 Feb 2025 06:26:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258b4335sm2093604f8f.15.2025.02.13.06.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 06:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739456780; x=1740061580; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SdbBccgNA9iD9ywHMcl4sf5pFjIJuIWSjvGN9CQVHH8=; b=hyDBOET7k6XIAVP4BjPI4cOX0wTucJVI4Km2Ynk8fUlGsrlHbAmhU0IczZIMsyo+aV +2erte1Iau7r3sZE+WWlgNiRWYy7p/FHbK6+FcIAz/AhLkSlidAaMdSO7GJVl8KomUC9 hhonK9XIIZPLwKTrpOAqX2ZKIgRoWzytewYOBttA7qWBX1a2ncMVv+cIu1OTP2MrCX6P BdrkXY9WbTkAgMqeWnTYqd7rmAAEPBrB0nO6YWBQUjZoB6yyPnB2aTrK8eDzUOVHhS66 9qlooSTvxeLcp5YXF1q+mdscSGN2QpXRYLE6KKxnFo8kLYLm1SDvhxdZxzqanSG2lldr zOLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739456780; x=1740061580; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SdbBccgNA9iD9ywHMcl4sf5pFjIJuIWSjvGN9CQVHH8=; b=rCKm+wbpc40CAESZ1GwkSu9hROpZbpUxVR62liRCg0I5CFr317j7xO9HO0uH1JTuKe q72BzX+hJCU+RNoYVVjZQiz9aXHumhuZ9DQTCikMO+SVpn0DY42FQ98KuIRn3mPyaMxt KxXVvCNXSJ+o/86fZw8r95GnHRwpfHwLdGq1Wuihk07TupgPjmuqOpStxcqlmu1+/6yJ TzxkH3YdLmvb7H3URd3wyseV7Fa+rIRR8LkHnvGE/TMJ8gy7Q39+9g1wKQcYLcg1t1Q9 ONdJfbVPpILprV7HU2XhC7ieyuCIo1c/0rVQzjQ1WHoG7t635bUmUF0PO/iPz5tmgp9E //2Q== X-Gm-Message-State: AOJu0YxmLAWZHJszZo9wNKvYL/r8O4aD0OhOn/VtEYlrz3r1B32dlLIz /jdxrYqxdYYrV1ezBxGRaXthnSX6UwlqCFgdmB+nb6ugYysVoGbaSjYEz/KGiNe2Gu/FSPFAUEF P X-Gm-Gg: ASbGncuVTgeCXS+Jm1yeoOwzP5Yj5TiWsyYwji+AheaVJBBchIlZDQb79ePDBZZozlT S73d4Xszj6zNcEBgWpuFwgl6EtPWav6NyaYNxw7tT7q3dr+T0r3eGRfXBWZ7cOG0VexIFhcXq5h lyBtCAF5SysmKqlfAVG2E4qMREWOt/AbLx1KIpsbSwma8DdMBYcQuEFpLRlKaoYaj8i0TkSThlw rUUcqVXkifDB3PkNx39y0dQFmVeU0+GI5YiV8MxZQfOv7iBE+4YUQr4tpZ7mm6NYl0bGWSjHVkp cnNGWde6jm0mfSLq4huQdA== X-Google-Smtp-Source: AGHT+IFCv/LpWJZ35XO+nPYxqsXyt6Ma4fU65mEUjPkkvqpihUgDvDmg9/nF26plWMteWjrFWc4gtg== X-Received: by 2002:a05:6000:154c:b0:38d:df70:23e7 with SMTP id ffacd0b85a97d-38f245035f5mr3358807f8f.31.1739456779690; Thu, 13 Feb 2025 06:26:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Zhao Liu , Eduardo Habkost Subject: [PATCH 2/4] target/i386: Use correct type for get_float_exception_flags() values Date: Thu, 13 Feb 2025 14:26:11 +0000 Message-ID: <20250213142613.151308-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250213142613.151308-1-peter.maydell@linaro.org> References: <20250213142613.151308-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739456854621019000 Content-Type: text/plain; charset="utf-8" The softfloat get_float_exception_flags() function returns 'int', but in various places in target/i386 we incorrectly store the returned value into a uint8_t. This currently has no ill effects because i386 doesn't care about any of the float_flag enum values above 0x40. However, we want to start using float_flag_input_denormal_used, which is 0x4000. Switch to using 'int' so that we can handle all the possible valid float_flag_* values. This includes changing the return type of save_exception_flags() and the argument to merge_exception_flags(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/ops_sse.h | 16 +++---- target/i386/tcg/fpu_helper.c | 82 ++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index f0aa1894aa2..a2e4d480399 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -842,7 +842,7 @@ int64_t helper_cvttsd2sq(CPUX86State *env, ZMMReg *s) =20 void glue(helper_rsqrtps, SUFFIX)(CPUX86State *env, ZMMReg *d, ZMMReg *s) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); int i; for (i =3D 0; i < 2 << SHIFT; i++) { d->ZMM_S(i) =3D float32_div(float32_one, @@ -855,7 +855,7 @@ void glue(helper_rsqrtps, SUFFIX)(CPUX86State *env, ZMM= Reg *d, ZMMReg *s) #if SHIFT =3D=3D 1 void helper_rsqrtss(CPUX86State *env, ZMMReg *d, ZMMReg *v, ZMMReg *s) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); int i; d->ZMM_S(0) =3D float32_div(float32_one, float32_sqrt(s->ZMM_S(0), &env->sse_status), @@ -869,7 +869,7 @@ void helper_rsqrtss(CPUX86State *env, ZMMReg *d, ZMMReg= *v, ZMMReg *s) =20 void glue(helper_rcpps, SUFFIX)(CPUX86State *env, ZMMReg *d, ZMMReg *s) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); int i; for (i =3D 0; i < 2 << SHIFT; i++) { d->ZMM_S(i) =3D float32_div(float32_one, s->ZMM_S(i), &env->sse_st= atus); @@ -880,7 +880,7 @@ void glue(helper_rcpps, SUFFIX)(CPUX86State *env, ZMMRe= g *d, ZMMReg *s) #if SHIFT =3D=3D 1 void helper_rcpss(CPUX86State *env, ZMMReg *d, ZMMReg *v, ZMMReg *s) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); int i; d->ZMM_S(0) =3D float32_div(float32_one, s->ZMM_S(0), &env->sse_status= ); for (i =3D 1; i < 2 << SHIFT; i++) { @@ -1714,7 +1714,7 @@ void glue(helper_phminposuw, SUFFIX)(CPUX86State *env= , Reg *d, Reg *s) void glue(helper_roundps, SUFFIX)(CPUX86State *env, Reg *d, Reg *s, uint32_t mode) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); signed char prev_rounding_mode; int i; =20 @@ -1738,7 +1738,7 @@ void glue(helper_roundps, SUFFIX)(CPUX86State *env, R= eg *d, Reg *s, void glue(helper_roundpd, SUFFIX)(CPUX86State *env, Reg *d, Reg *s, uint32_t mode) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); signed char prev_rounding_mode; int i; =20 @@ -1763,7 +1763,7 @@ void glue(helper_roundpd, SUFFIX)(CPUX86State *env, R= eg *d, Reg *s, void glue(helper_roundss, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s, uint32_t mode) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); signed char prev_rounding_mode; int i; =20 @@ -1788,7 +1788,7 @@ void glue(helper_roundss, SUFFIX)(CPUX86State *env, R= eg *d, Reg *v, Reg *s, void glue(helper_roundsd, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s, uint32_t mode) { - uint8_t old_flags =3D get_float_exception_flags(&env->sse_status); + int old_flags =3D get_float_exception_flags(&env->sse_status); signed char prev_rounding_mode; int i; =20 diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 87fbc149d84..cd965a1f582 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -198,16 +198,16 @@ void cpu_init_fp_statuses(CPUX86State *env) set_float_ftz_detection(float_ftz_after_rounding, &env->sse_status); } =20 -static inline uint8_t save_exception_flags(CPUX86State *env) +static inline int save_exception_flags(CPUX86State *env) { - uint8_t old_flags =3D get_float_exception_flags(&env->fp_status); + int old_flags =3D get_float_exception_flags(&env->fp_status); set_float_exception_flags(0, &env->fp_status); return old_flags; } =20 -static void merge_exception_flags(CPUX86State *env, uint8_t old_flags) +static void merge_exception_flags(CPUX86State *env, int old_flags) { - uint8_t new_flags =3D get_float_exception_flags(&env->fp_status); + int new_flags =3D get_float_exception_flags(&env->fp_status); float_raise(old_flags, &env->fp_status); fpu_set_exception(env, ((new_flags & float_flag_invalid ? FPUS_IE : 0) | @@ -220,7 +220,7 @@ static void merge_exception_flags(CPUX86State *env, uin= t8_t old_flags) =20 static inline floatx80 helper_fdiv(CPUX86State *env, floatx80 a, floatx80 = b) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); floatx80 ret =3D floatx80_div(a, b, &env->fp_status); merge_exception_flags(env, old_flags); return ret; @@ -240,7 +240,7 @@ static void fpu_raise_exception(CPUX86State *env, uintp= tr_t retaddr) =20 void helper_flds_FT0(CPUX86State *env, uint32_t val) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); union { float32 f; uint32_t i; @@ -253,7 +253,7 @@ void helper_flds_FT0(CPUX86State *env, uint32_t val) =20 void helper_fldl_FT0(CPUX86State *env, uint64_t val) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); union { float64 f; uint64_t i; @@ -271,7 +271,7 @@ void helper_fildl_FT0(CPUX86State *env, int32_t val) =20 void helper_flds_ST0(CPUX86State *env, uint32_t val) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int new_fpstt; union { float32 f; @@ -288,7 +288,7 @@ void helper_flds_ST0(CPUX86State *env, uint32_t val) =20 void helper_fldl_ST0(CPUX86State *env, uint64_t val) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int new_fpstt; union { float64 f; @@ -338,7 +338,7 @@ void helper_fildll_ST0(CPUX86State *env, int64_t val) =20 uint32_t helper_fsts_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); union { float32 f; uint32_t i; @@ -351,7 +351,7 @@ uint32_t helper_fsts_ST0(CPUX86State *env) =20 uint64_t helper_fstl_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); union { float64 f; uint64_t i; @@ -364,7 +364,7 @@ uint64_t helper_fstl_ST0(CPUX86State *env) =20 int32_t helper_fist_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int32_t val; =20 val =3D floatx80_to_int32(ST0, &env->fp_status); @@ -378,7 +378,7 @@ int32_t helper_fist_ST0(CPUX86State *env) =20 int32_t helper_fistl_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int32_t val; =20 val =3D floatx80_to_int32(ST0, &env->fp_status); @@ -391,7 +391,7 @@ int32_t helper_fistl_ST0(CPUX86State *env) =20 int64_t helper_fistll_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int64_t val; =20 val =3D floatx80_to_int64(ST0, &env->fp_status); @@ -404,7 +404,7 @@ int64_t helper_fistll_ST0(CPUX86State *env) =20 int32_t helper_fistt_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int32_t val; =20 val =3D floatx80_to_int32_round_to_zero(ST0, &env->fp_status); @@ -418,7 +418,7 @@ int32_t helper_fistt_ST0(CPUX86State *env) =20 int32_t helper_fisttl_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int32_t val; =20 val =3D floatx80_to_int32_round_to_zero(ST0, &env->fp_status); @@ -431,7 +431,7 @@ int32_t helper_fisttl_ST0(CPUX86State *env) =20 int64_t helper_fisttll_ST0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int64_t val; =20 val =3D floatx80_to_int64_round_to_zero(ST0, &env->fp_status); @@ -527,7 +527,7 @@ static const int fcom_ccval[4] =3D {0x0100, 0x4000, 0x0= 000, 0x4500}; =20 void helper_fcom_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); FloatRelation ret; =20 ret =3D floatx80_compare(ST0, FT0, &env->fp_status); @@ -537,7 +537,7 @@ void helper_fcom_ST0_FT0(CPUX86State *env) =20 void helper_fucom_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); FloatRelation ret; =20 ret =3D floatx80_compare_quiet(ST0, FT0, &env->fp_status); @@ -549,7 +549,7 @@ static const int fcomi_ccval[4] =3D {CC_C, CC_Z, 0, CC_= Z | CC_P | CC_C}; =20 void helper_fcomi_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int eflags; FloatRelation ret; =20 @@ -562,7 +562,7 @@ void helper_fcomi_ST0_FT0(CPUX86State *env) =20 void helper_fucomi_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int eflags; FloatRelation ret; =20 @@ -575,28 +575,28 @@ void helper_fucomi_ST0_FT0(CPUX86State *env) =20 void helper_fadd_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST0 =3D floatx80_add(ST0, FT0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fmul_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST0 =3D floatx80_mul(ST0, FT0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fsub_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST0 =3D floatx80_sub(ST0, FT0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fsubr_ST0_FT0(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST0 =3D floatx80_sub(FT0, ST0, &env->fp_status); merge_exception_flags(env, old_flags); } @@ -615,28 +615,28 @@ void helper_fdivr_ST0_FT0(CPUX86State *env) =20 void helper_fadd_STN_ST0(CPUX86State *env, int st_index) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST(st_index) =3D floatx80_add(ST(st_index), ST0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fmul_STN_ST0(CPUX86State *env, int st_index) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST(st_index) =3D floatx80_mul(ST(st_index), ST0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fsub_STN_ST0(CPUX86State *env, int st_index) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST(st_index) =3D floatx80_sub(ST(st_index), ST0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fsubr_STN_ST0(CPUX86State *env, int st_index) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST(st_index) =3D floatx80_sub(ST0, ST(st_index), &env->fp_status); merge_exception_flags(env, old_flags); } @@ -861,7 +861,7 @@ void helper_fbld_ST0(CPUX86State *env, target_ulong ptr) =20 void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); int v; target_ulong mem_ref, mem_end; int64_t val; @@ -1136,7 +1136,7 @@ static const struct f2xm1_data f2xm1_table[65] =3D { =20 void helper_f2xm1(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); uint64_t sig =3D extractFloatx80Frac(ST0); int32_t exp =3D extractFloatx80Exp(ST0); bool sign =3D extractFloatx80Sign(ST0); @@ -1369,7 +1369,7 @@ static const struct fpatan_data fpatan_table[9] =3D { =20 void helper_fpatan(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); uint64_t arg0_sig =3D extractFloatx80Frac(ST0); int32_t arg0_exp =3D extractFloatx80Exp(ST0); bool arg0_sign =3D extractFloatx80Sign(ST0); @@ -1806,7 +1806,7 @@ void helper_fpatan(CPUX86State *env) =20 void helper_fxtract(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); CPU_LDoubleU temp; =20 temp.d =3D ST0; @@ -1855,7 +1855,7 @@ void helper_fxtract(CPUX86State *env) =20 static void helper_fprem_common(CPUX86State *env, bool mod) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); uint64_t quotient; CPU_LDoubleU temp0, temp1; int exp0, exp1, expdiff; @@ -2050,7 +2050,7 @@ static void helper_fyl2x_common(CPUX86State *env, flo= atx80 arg, int32_t *exp, =20 void helper_fyl2xp1(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); uint64_t arg0_sig =3D extractFloatx80Frac(ST0); int32_t arg0_exp =3D extractFloatx80Exp(ST0); bool arg0_sign =3D extractFloatx80Sign(ST0); @@ -2148,7 +2148,7 @@ void helper_fyl2xp1(CPUX86State *env) =20 void helper_fyl2x(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); uint64_t arg0_sig =3D extractFloatx80Frac(ST0); int32_t arg0_exp =3D extractFloatx80Exp(ST0); bool arg0_sign =3D extractFloatx80Sign(ST0); @@ -2295,7 +2295,7 @@ void helper_fyl2x(CPUX86State *env) =20 void helper_fsqrt(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); if (floatx80_is_neg(ST0)) { env->fpus &=3D ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ env->fpus |=3D 0x400; @@ -2321,14 +2321,14 @@ void helper_fsincos(CPUX86State *env) =20 void helper_frndint(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); ST0 =3D floatx80_round_to_int(ST0, &env->fp_status); merge_exception_flags(env, old_flags); } =20 void helper_fscale(CPUX86State *env) { - uint8_t old_flags =3D save_exception_flags(env); + int old_flags =3D save_exception_flags(env); if (floatx80_invalid_encoding(ST1) || floatx80_invalid_encoding(ST0)) { float_raise(float_flag_invalid, &env->fp_status); ST0 =3D floatx80_default_nan(&env->fp_status); @@ -2366,7 +2366,7 @@ void helper_fscale(CPUX86State *env) } else { int n; FloatX80RoundPrec save =3D env->fp_status.floatx80_rounding_precis= ion; - uint8_t save_flags =3D get_float_exception_flags(&env->fp_status); + int save_flags =3D get_float_exception_flags(&env->fp_status); set_float_exception_flags(0, &env->fp_status); n =3D floatx80_to_int32_round_to_zero(ST1, &env->fp_status); set_float_exception_flags(save_flags, &env->fp_status); @@ -3266,7 +3266,7 @@ void update_mxcsr_status(CPUX86State *env) =20 void update_mxcsr_from_sse_status(CPUX86State *env) { - uint8_t flags =3D get_float_exception_flags(&env->sse_status); + int flags =3D get_float_exception_flags(&env->sse_status); /* * The MXCSR denormal flag has opposite semantics to * float_flag_input_denormal_flushed (the softfloat code sets that flag --=20 2.43.0