From nobody Wed Apr 16 02:28:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550171813499710.7295968636195; Thu, 14 Feb 2019 11:16:53 -0800 (PST) Received: from localhost ([127.0.0.1]:53659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMV8-0007cA-DV for importer@patchew.org; Thu, 14 Feb 2019 14:16:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMKq-0007i5-MN for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guMKp-0004eE-RI for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:12 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guMKp-0004de-Ki for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:11 -0500 Received: by mail-wr1-x42c.google.com with SMTP id v16so7681111wrn.11 for ; Thu, 14 Feb 2019 11:06:11 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n184sm7798471wmf.5.2019.02.14.11.06.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Hw0Y9LbAAg43SvV1h3Yi9DABc8HNiWGmFOP9dGtwUOo=; b=xfFTarucpvyokQpwiOOqRyMpod4Zh1xnaqJRqvLLCDDX+ZW2Wy6qt0HQkVYMxpQmcF BPrKRXE67/05Yn3zrNADnUGYlhxKyIESWBkX3rzS9HUJpNcBQ5vYmcKeD6X3YQz9aoY6 GscOnVTTwWVJ/fTmlJTT9ex0AkBJbdqOsxONXFKBJYFsC9jEoJRG0Q7wd0ixK2H4RWDB Pn5NL9twCfcVrc53Fh1S3x081/wNJaLwdhB/WjTJU7yipHHTUOeHKiONi4h4IvyBir9j A6fDUwgRrH79+3pyV5fXJRPUCdsLavG2+jrN7ygMhKFcZxRFqFdTjDAKeTTkE2MIaqGj F0JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hw0Y9LbAAg43SvV1h3Yi9DABc8HNiWGmFOP9dGtwUOo=; b=f/8Tve2IRh1cqaTf9F0iHmBHrXk8viGoaBlN26QsM04NigdpvlHuKvTFtM7LEaoLSi 1xCoVNDHmxEqNCRh9SlFZ1u3dd2bhcxM6lQeqt3jMtH2rZuzcNzov8ul36JQq0wI8C0t 8QobfWw312bkbfUOTD1MPknO+VoDfd0+5oqCuGvtFGxGSfhL0g7jg/KuYwz2KTrRLSDi q4K8TFkmtIrPOp1+3xlOHLJPP4YbuBv1lP5vWYndGLwyXiIVt1xSIdtrfXqX8/LP3WQ7 kgOLb4klnc6ZePjgPFSuDyL82CObmu22dM6gfj91iN6vUxThsMCKGYteYA6Bz8k938jq tuvA== X-Gm-Message-State: AHQUAuYAaLSe0nNfgrZDElVi8VNF8OtfP3ug1G6WOLDYWHBLJigVTqTt HUmohcPgmd5HWG/gn46a4strClq/GHf0tw== X-Google-Smtp-Source: AHgI3IZF3WoNF5hioEXudE+YvbanTI7x/MfQziZjymu9EicdvgqDnYyuD7iSNxMhIdxwiDI32NLSIg== X-Received: by 2002:a5d:52c3:: with SMTP id r3mr3974840wrv.163.1550171170243; Thu, 14 Feb 2019 11:06:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 19:05:40 +0000 Message-Id: <20190214190603.25030-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214190603.25030-1-peter.maydell@linaro.org> References: <20190214190603.25030-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL 04/27] target/arm: Force result size into dp after operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson Rather than a complex set of cases testing for writeback, adjust DP after performing the operation. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20190206052857.5077-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 66cf28c8cbe..eb258958768 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -3970,6 +3970,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t i= nsn) tcg_gen_or_i32(tmp, tmp, tmp2); tcg_temp_free_i32(tmp2); gen_vfp_msr(tmp); + dp =3D 0; /* always a single precision result */ break; } case 7: /* vcvtt.f16.f32, vcvtt.f16.f64 */ @@ -3993,20 +3994,25 @@ static int disas_vfp_insn(DisasContext *s, uint32_t= insn) tcg_gen_or_i32(tmp, tmp, tmp2); tcg_temp_free_i32(tmp2); gen_vfp_msr(tmp); + dp =3D 0; /* always a single precision result */ break; } case 8: /* cmp */ gen_vfp_cmp(dp); + dp =3D -1; /* no write back */ break; case 9: /* cmpe */ gen_vfp_cmpe(dp); + dp =3D -1; /* no write back */ break; case 10: /* cmpz */ gen_vfp_cmp(dp); + dp =3D -1; /* no write back */ break; case 11: /* cmpez */ gen_vfp_F1_ld0(dp); gen_vfp_cmpe(dp); + dp =3D -1; /* no write back */ break; case 12: /* vrintr */ { @@ -4047,10 +4053,12 @@ static int disas_vfp_insn(DisasContext *s, uint32_t= insn) break; } case 15: /* single<->double conversion */ - if (dp) + if (dp) { gen_helper_vfp_fcvtsd(cpu_F0s, cpu_F0d, cpu_en= v); - else + } else { gen_helper_vfp_fcvtds(cpu_F0d, cpu_F0s, cpu_en= v); + } + dp =3D !dp; /* result size is opposite */ break; case 16: /* fuito */ gen_vfp_uito(dp, 0); @@ -4084,15 +4092,19 @@ static int disas_vfp_insn(DisasContext *s, uint32_t= insn) break; case 24: /* ftoui */ gen_vfp_toui(dp, 0); + dp =3D 0; /* always an integer result */ break; case 25: /* ftouiz */ gen_vfp_touiz(dp, 0); + dp =3D 0; /* always an integer result */ break; case 26: /* ftosi */ gen_vfp_tosi(dp, 0); + dp =3D 0; /* always an integer result */ break; case 27: /* ftosiz */ gen_vfp_tosiz(dp, 0); + dp =3D 0; /* always an integer result */ break; case 28: /* ftosh */ if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { @@ -4126,20 +4138,8 @@ static int disas_vfp_insn(DisasContext *s, uint32_t = insn) return 1; } =20 - /* Write back the result. */ - if (op =3D=3D 15 && (rn >=3D 8 && rn <=3D 11)) { - /* Comparison, do nothing. */ - } else if (op =3D=3D 15 && dp && ((rn & 0x1c) =3D=3D 0x18 = || - (rn & 0x1e) =3D=3D 0x6)) { - /* VCVT double to int: always integer result. - * VCVT double to half precision is always a single - * precision result. - */ - gen_mov_vreg_F0(0, rd); - } else if (op =3D=3D 15 && rn =3D=3D 15) { - /* conversion */ - gen_mov_vreg_F0(!dp, rd); - } else { + /* Write back the result, if any. */ + if (dp >=3D 0) { gen_mov_vreg_F0(dp, rd); } =20 --=20 2.20.1