From nobody Mon Feb 9 13:44:50 2026 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=1588620323; cv=none; d=zohomail.com; s=zohoarc; b=iTk3bJBlX7oajeUCep/4dQj80fjs2FoPTl7iMhBKdo5n4dr36IY/5H4w47eeoMvnuZwhHc779xthZKQzaNhKKhhaqiJYbu71cH/dnP2HmFoZ9zs6weak9Crxq9UBZmemzNSsHK0WKdtaRaaSziQrBk1KFNSdZ/KL9tyb6qGIXxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588620323; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c3OBmdqjWHi93YqiLmZoZH4s0E/AFDrL/k2Mh8jPufY=; b=PQECfDaFtSOllKlBKdqCgR9MusnU3VG0E1Nvh5KTtOWAl0msQ754YeRHXKBPSyw4eOvPAfpSADeZ0q/J86bivlsgZIvK+CxhGMU+A5YLJD+4HtJQIHR4FodUVpPwROavxt6ex7kvzyTUYlc8M++937hhqOpig8V229CGlvuDElI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588620323969801.5531222537769; Mon, 4 May 2020 12:25:23 -0700 (PDT) Received: from localhost ([::1]:42570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVgiQ-00037F-N0 for importer@patchew.org; Mon, 04 May 2020 15:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVggz-0001VN-Mk for qemu-devel@nongnu.org; Mon, 04 May 2020 15:23:54 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVggy-0005yX-GN for qemu-devel@nongnu.org; Mon, 04 May 2020 15:23:53 -0400 Received: by mail-pl1-x643.google.com with SMTP id x10so158681plr.4 for ; Mon, 04 May 2020 12:23:51 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id b9sm9407364pfp.12.2020.05.04.12.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 12:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c3OBmdqjWHi93YqiLmZoZH4s0E/AFDrL/k2Mh8jPufY=; b=q7W5FY2C0QYokknteHr8slty/pobMtz7m5eY2mf/XP/RzNOirkHn9tNLjRIAn4lNt7 jYP8AS8+7OmOB1yQJLeC6lTL0RQDdNRu/gIBg+e1n4ONt7nL3pDXXmVqhBhQLDGn7UH6 8uKlfIZEPh2VW4jLevXD6SMheiJabk8XgTWM+lWGuKz/YGr13LgbmKlm0KoYPjUe9K+1 ZT1HO9BUNQezmuWc+8+VwzFwOAN73OI6YqByL9zoQzZfT3ABLK49ON0XWk0U/dFPIK5a vlAAOFhjuq5D4kFd29TtTjL+ubBvO73BYZjWWU8ZApTOmkfE8j1sGnQ4S9X3py+RzJQG PSrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c3OBmdqjWHi93YqiLmZoZH4s0E/AFDrL/k2Mh8jPufY=; b=SnUs+4snttP6VZbdqflXJYtI1gw9lrwOQPWLyweBZG71TVJIGyGmIgXGXiBn598gh/ dxppnavKBX6xeEhjIrwa9e9iY24mkEJX3GLOLSDSeihY6z+vQEgil92a1LLBH5ryCRBi Et2LkWVZIixI0kTkCvW7BZTCBdBA7Ep5A3S7MG2ZrJHYD9SVuwlEnZ2utbxrnkW7bSw2 i6fHcqDe7+IWZ+Qc+dkemDzWu3FbRvQMsnLu8W4F8Fh53X+r7PtVe3B+DtBJ0DfKz+hp ajzz7aBMvy8RjBvYt2uOJH+VtMnXIsas+weJnNM9Oz9H0y/uA0mRUs/8WWozYFl2ka8e ZHwg== X-Gm-Message-State: AGi0PubO6NKM0zQ2lIerhNNeaDSaEZM59kR/tMSXSbUFsz95a637dnxW Ul3JNfXcUd5FnLtjKaOnci3ggnnnq7I= X-Google-Smtp-Source: APiQypI0URcFGyTqybBj/pg/0B3CnTtdsk+GZLZpn0QO89FjQkCH1yYsaZ92T5YIm/rrspr1lUv9zQ== X-Received: by 2002:a17:90a:fd94:: with SMTP id cx20mr552247pjb.157.1588620229754; Mon, 04 May 2020 12:23:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 3/3] target/arm: Use clear_vec_high more effectively Date: Mon, 4 May 2020 12:23:44 -0700 Message-Id: <20200504192344.13404-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504192344.13404-1-richard.henderson@linaro.org> References: <20200504192344.13404-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Do not explicitly store zero to the NEON high part when we can pass !is_q to clear_vec_high. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 59 +++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 729e746e25..d1c9150c4f 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -939,11 +939,10 @@ static void do_fp_ld(DisasContext *s, int destidx, TC= Gv_i64 tcg_addr, int size) { /* This always zero-extends and writes to a full 128 bit wide vector */ TCGv_i64 tmplo =3D tcg_temp_new_i64(); - TCGv_i64 tmphi; + TCGv_i64 tmphi =3D NULL; =20 if (size < 4) { MemOp memop =3D s->be_data + size; - tmphi =3D tcg_const_i64(0); tcg_gen_qemu_ld_i64(tmplo, tcg_addr, get_mem_index(s), memop); } else { bool be =3D s->be_data =3D=3D MO_BE; @@ -961,12 +960,13 @@ static void do_fp_ld(DisasContext *s, int destidx, TC= Gv_i64 tcg_addr, int size) } =20 tcg_gen_st_i64(tmplo, cpu_env, fp_reg_offset(s, destidx, MO_64)); - tcg_gen_st_i64(tmphi, cpu_env, fp_reg_hi_offset(s, destidx)); - tcg_temp_free_i64(tmplo); - tcg_temp_free_i64(tmphi); =20 - clear_vec_high(s, true, destidx); + if (tmphi) { + tcg_gen_st_i64(tmphi, cpu_env, fp_reg_hi_offset(s, destidx)); + tcg_temp_free_i64(tmphi); + } + clear_vec_high(s, tmphi !=3D NULL, destidx); } =20 /* @@ -6960,8 +6960,8 @@ static void disas_simd_ext(DisasContext *s, uint32_t = insn) return; } =20 - tcg_resh =3D tcg_temp_new_i64(); tcg_resl =3D tcg_temp_new_i64(); + tcg_resh =3D NULL; =20 /* Vd gets bits starting at pos bits into Vm:Vn. This is * either extracting 128 bits from a 128:128 concatenation, or @@ -6973,7 +6973,6 @@ static void disas_simd_ext(DisasContext *s, uint32_t = insn) read_vec_element(s, tcg_resh, rm, 0, MO_64); do_ext64(s, tcg_resh, tcg_resl, pos); } - tcg_gen_movi_i64(tcg_resh, 0); } else { TCGv_i64 tcg_hh; typedef struct { @@ -6988,6 +6987,7 @@ static void disas_simd_ext(DisasContext *s, uint32_t = insn) pos -=3D 64; } =20 + tcg_resh =3D tcg_temp_new_i64(); read_vec_element(s, tcg_resl, elt->reg, elt->elt, MO_64); elt++; read_vec_element(s, tcg_resh, elt->reg, elt->elt, MO_64); @@ -7003,9 +7003,12 @@ static void disas_simd_ext(DisasContext *s, uint32_t= insn) =20 write_vec_element(s, tcg_resl, rd, 0, MO_64); tcg_temp_free_i64(tcg_resl); - write_vec_element(s, tcg_resh, rd, 1, MO_64); - tcg_temp_free_i64(tcg_resh); - clear_vec_high(s, true, rd); + + if (is_q) { + write_vec_element(s, tcg_resh, rd, 1, MO_64); + tcg_temp_free_i64(tcg_resh); + } + clear_vec_high(s, is_q, rd); } =20 /* TBL/TBX @@ -7042,17 +7045,21 @@ static void disas_simd_tb(DisasContext *s, uint32_t= insn) * the input. */ tcg_resl =3D tcg_temp_new_i64(); - tcg_resh =3D tcg_temp_new_i64(); + tcg_resh =3D NULL; =20 if (is_tblx) { read_vec_element(s, tcg_resl, rd, 0, MO_64); } else { tcg_gen_movi_i64(tcg_resl, 0); } - if (is_tblx && is_q) { - read_vec_element(s, tcg_resh, rd, 1, MO_64); - } else { - tcg_gen_movi_i64(tcg_resh, 0); + + if (is_q) { + tcg_resh =3D tcg_temp_new_i64(); + if (is_tblx) { + read_vec_element(s, tcg_resh, rd, 1, MO_64); + } else { + tcg_gen_movi_i64(tcg_resh, 0); + } } =20 tcg_idx =3D tcg_temp_new_i64(); @@ -7072,9 +7079,12 @@ static void disas_simd_tb(DisasContext *s, uint32_t = insn) =20 write_vec_element(s, tcg_resl, rd, 0, MO_64); tcg_temp_free_i64(tcg_resl); - write_vec_element(s, tcg_resh, rd, 1, MO_64); - tcg_temp_free_i64(tcg_resh); - clear_vec_high(s, true, rd); + + if (is_q) { + write_vec_element(s, tcg_resh, rd, 1, MO_64); + tcg_temp_free_i64(tcg_resh); + } + clear_vec_high(s, is_q, rd); } =20 /* ZIP/UZP/TRN @@ -7111,7 +7121,7 @@ static void disas_simd_zip_trn(DisasContext *s, uint3= 2_t insn) } =20 tcg_resl =3D tcg_const_i64(0); - tcg_resh =3D tcg_const_i64(0); + tcg_resh =3D is_q ? tcg_const_i64(0) : NULL; tcg_res =3D tcg_temp_new_i64(); =20 for (i =3D 0; i < elements; i++) { @@ -7162,9 +7172,12 @@ static void disas_simd_zip_trn(DisasContext *s, uint= 32_t insn) =20 write_vec_element(s, tcg_resl, rd, 0, MO_64); tcg_temp_free_i64(tcg_resl); - write_vec_element(s, tcg_resh, rd, 1, MO_64); - tcg_temp_free_i64(tcg_resh); - clear_vec_high(s, true, rd); + + if (is_q) { + write_vec_element(s, tcg_resh, rd, 1, MO_64); + tcg_temp_free_i64(tcg_resh); + } + clear_vec_high(s, is_q, rd); } =20 /* --=20 2.20.1