From nobody Tue Feb 10 19:49:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1663401814119403.5029938988638; Sat, 17 Sep 2022 01:03:34 -0700 (PDT) Received: from localhost ([::1]:39074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZSnT-0000Hj-Bm for importer@patchew.org; Sat, 17 Sep 2022 04:03:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZSk3-0006Xz-Hm for qemu-devel@nongnu.org; Sat, 17 Sep 2022 03:59:59 -0400 Received: from mail.loongson.cn ([114.242.206.163]:57642 helo=loongson.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZSjz-0008Sf-R8 for qemu-devel@nongnu.org; Sat, 17 Sep 2022 03:59:59 -0400 Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxBOJ2fiVjHQccAA--.40868S3; Sat, 17 Sep 2022 15:59:50 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, peter.maydell@linaro.org, alex.bennee@linaro.org, gaosong@loongson.cn, maobibo@loongson.cn, yangxiaojuan@loongson.cn Subject: [PATCH 1/5] target/loongarch: ftint_xxx insns set the result high 32bit 0xffffffff Date: Sat, 17 Sep 2022 15:59:46 +0800 Message-Id: <20220917075950.1412309-2-gaosong@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220917075950.1412309-1-gaosong@loongson.cn> References: <20220917075950.1412309-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8DxBOJ2fiVjHQccAA--.40868S3 X-Coremail-Antispam: 1UD129KBjvJXoWxAF4xCFy8uFWfZw15Wr4kWFg_yoWruFy3p3 4rGrW3KrWvqFZ5Za4xJ398GF15Xw4UGa4xtr4DWa4SvFsFyws8urW7t3y7ZrWDWFWrZr45 Ja4jyFy3G3Z0qFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ 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=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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" X-ZM-MESSAGEID: 1663401815217100001 Content-Type: text/plain; charset="utf-8" we just set high 32bit 0xffffffff as the other float instructions do. Signed-off-by: Song Gao --- target/loongarch/fpu_helper.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/loongarch/fpu_helper.c b/target/loongarch/fpu_helper.c index 4b9637210a..1a24667eaf 100644 --- a/target/loongarch/fpu_helper.c +++ b/target/loongarch/fpu_helper.c @@ -518,7 +518,7 @@ uint64_t helper_frint_s(CPULoongArchState *env, uint64_= t fj) { uint64_t fd; =20 - fd =3D (uint64_t)(float32_round_to_int((uint32_t)fj, &env->fp_status)); + fd =3D nanbox_s(float32_round_to_int((uint32_t)fj, &env->fp_status)); update_fcsr0(env, GETPC()); return fd; } @@ -574,7 +574,7 @@ uint64_t helper_ftintrm_w_d(CPULoongArchState *env, uin= t64_t fj) FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 set_float_rounding_mode(float_round_down, &env->fp_status); - fd =3D (uint64_t)float64_to_int32(fj, &env->fp_status); + fd =3D nanbox_s(float64_to_int32(fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -592,7 +592,7 @@ uint64_t helper_ftintrm_w_s(CPULoongArchState *env, uin= t64_t fj) FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 set_float_rounding_mode(float_round_down, &env->fp_status); - fd =3D (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); + fd =3D nanbox_s(float32_to_int32((uint32_t)fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -646,7 +646,7 @@ uint64_t helper_ftintrp_w_d(CPULoongArchState *env, uin= t64_t fj) FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 set_float_rounding_mode(float_round_up, &env->fp_status); - fd =3D (uint64_t)float64_to_int32(fj, &env->fp_status); + fd =3D nanbox_s(float64_to_int32(fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -664,7 +664,7 @@ uint64_t helper_ftintrp_w_s(CPULoongArchState *env, uin= t64_t fj) FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 set_float_rounding_mode(float_round_up, &env->fp_status); - fd =3D (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); + fd =3D nanbox_s(float32_to_int32((uint32_t)fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -715,7 +715,7 @@ uint64_t helper_ftintrz_w_d(CPULoongArchState *env, uin= t64_t fj) uint64_t fd; FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 - fd =3D (uint64_t)float64_to_int32_round_to_zero(fj, &env->fp_status); + fd =3D nanbox_s(float64_to_int32_round_to_zero(fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -786,7 +786,7 @@ uint64_t helper_ftintrne_w_d(CPULoongArchState *env, ui= nt64_t fj) FloatRoundMode old_mode =3D get_float_rounding_mode(&env->fp_status); =20 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - fd =3D (uint64_t)float64_to_int32(fj, &env->fp_status); + fd =3D nanbox_s(float64_to_int32(fj, &env->fp_status)); set_float_rounding_mode(old_mode, &env->fp_status); =20 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { @@ -848,7 +848,7 @@ uint64_t helper_ftint_w_s(CPULoongArchState *env, uint6= 4_t fj) { uint64_t fd; =20 - fd =3D (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); + fd =3D nanbox_s(float32_to_int32((uint32_t)fj, &env->fp_status)); if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { if (float32_is_any_nan((uint32_t)fj)) { fd =3D 0; @@ -862,7 +862,7 @@ uint64_t helper_ftint_w_d(CPULoongArchState *env, uint6= 4_t fj) { uint64_t fd; =20 - fd =3D (uint64_t)float64_to_int32(fj, &env->fp_status); + fd =3D nanbox_s(float64_to_int32(fj, &env->fp_status)); if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid))= { if (float64_is_any_nan(fj)) { fd =3D 0; --=20 2.31.1