From nobody Fri Nov 14 19:25:41 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=1589923569; cv=none; d=zohomail.com; s=zohoarc; b=R/xCdeFkVVJjoVk8LhJSKdWpmpPFliBDSrnOc1macTwPmK7wmX975PpOJJbbBXbuofvF3d43kBPu90J6wjLJdR/pVQBlJTWGFdtvbWgCxB48MkkJc7uxo4wDSoE51H2/L+o51c3vhWQYnR8tZKyQ7x5mo6z1MIlJABsdBzAnZQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589923569; 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=vNnf1Z3O76puR4Ng9rbHBmplMSYxwbl0e181XAAkbmE=; b=QizbM3yS6EFHKkWvohFvmEoMpC3OyfJlzb1Okgx8/3ZFhYGrQ0/l4xY8YvW7v9KdkZe8adUezBxgIuv5th9J9EETdJ1bKktyyYn3ho9WPcNtQUZ0ijCD/bolnQoDEFYQOSIvqanAlWJT7a5adRnd9ObeBILVKnJkIuRJJyHShZc= 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 1589923569025290.30058723663035; Tue, 19 May 2020 14:26:09 -0700 (PDT) Received: from localhost ([::1]:46886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb9kV-0007SG-PC for importer@patchew.org; Tue, 19 May 2020 17:26:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb9jP-0006WA-L4 for qemu-devel@nongnu.org; Tue, 19 May 2020 17:24:59 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb9jO-0005xJ-Su for qemu-devel@nongnu.org; Tue, 19 May 2020 17:24:59 -0400 Received: by mail-pl1-x643.google.com with SMTP id x10so412151plr.4 for ; Tue, 19 May 2020 14:24:58 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id v5sm386134pjy.4.2020.05.19.14.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 14:24:56 -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=vNnf1Z3O76puR4Ng9rbHBmplMSYxwbl0e181XAAkbmE=; b=w4zghGbGyjPOLHDyHbDHmfRFZ4udpfJBVcKwZlFeaBE5lW22Y3rmeY293oB3IW0OyC CNnyrxsAEk3T0gHIEdUmNfh/seD4OKegY18n+be1uLo9PzlgYMsElhf/3ftSMxCWb975 MTVJCxH4puoWq3wrS02eEBD7FxgI0dkp/m1Et8ApjwDQdk0U/PzxN1EqRD3U3X8zU/jF 0+w1DLVloJNFSsU7ybWa4KNPX80xY/HdP3owfQIkWrspnTmrqZqchwtnXLBjwxWiJOj7 fcJ6tg7RquYnMkAAgqFv45bJWto9i377ARGd4xVkwjdCAUu0mS0J7SnYXqcUPRMtzE0/ j1hg== 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=vNnf1Z3O76puR4Ng9rbHBmplMSYxwbl0e181XAAkbmE=; b=JrX4kD3qI2Fmip8kBrNWNpGUES3giNlAEyHGylL8DuGSxJeGfAHZBTSMJCuanSZv5K 6iYUzvRmBb8Ked8V8BmOUv9v1dqpgO84pBAU5Wmjt5om0neq6+EetTp8PNrrcQNFk0Z0 Y9CmNEr5yrempteuaFc8lkDoCemSmU/vXbeSbxU4UrGUY94vucvOEgj2daDV15auOKWF 1jJmf2lxz/KAIzgRDfHIdTSLk78KDCSaoYMMJ3iEu2yuI7P4K9819jJKBXZciij9UgRd NMZcJfKO0rYeXMg7iadFQ+SYjoOBhdEvVcfnW2PU5vY7tUWqedrkMHjgUz266tFQhixO S/ow== X-Gm-Message-State: AOAM533kBBheVfh/kaodbWnrP00l1XkNm1GNPec3wOU8DDDvi2D7RRUA a6sCgn2jSVwOrFuTsMStKccMC3TsBd0= X-Google-Smtp-Source: ABdhPJxNlg0MfPtwiKx+o+Lt1GRmW+Be/Xbz087KKrKX34hHjC3cB5/5hA9gd/psHc/6QbItCIf91Q== X-Received: by 2002:a17:90a:5ae6:: with SMTP id n93mr1616598pji.159.1589923496961; Tue, 19 May 2020 14:24:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 1/2] target/arm: Use tcg_gen_gvec_mov for clear_vec_high Date: Tue, 19 May 2020 14:24:52 -0700 Message-Id: <20200519212453.28494-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519212453.28494-1-richard.henderson@linaro.org> References: <20200519212453.28494-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) The 8-byte store for the end a !is_q operation can be merged with the other stores. Use a no-op vector move to trigger the expand_clr portion of tcg_gen_gvec_mov. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 991e451644..4f6edb2892 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -496,14 +496,8 @@ static void clear_vec_high(DisasContext *s, bool is_q,= int rd) unsigned ofs =3D fp_reg_offset(s, rd, MO_64); unsigned vsz =3D vec_full_reg_size(s); =20 - if (!is_q) { - TCGv_i64 tcg_zero =3D tcg_const_i64(0); - tcg_gen_st_i64(tcg_zero, cpu_env, ofs + 8); - tcg_temp_free_i64(tcg_zero); - } - if (vsz > 16) { - tcg_gen_gvec_dup_imm(MO_64, ofs + 16, vsz - 16, vsz - 16, 0); - } + /* Nop move, with side effect of clearing the tail. */ + tcg_gen_gvec_mov(MO_64, ofs, ofs, is_q ? 16 : 8, vsz); } =20 void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v) --=20 2.20.1 From nobody Fri Nov 14 19:25:41 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=1589923675; cv=none; d=zohomail.com; s=zohoarc; b=KlPTt1XP35mpsw8WinMjboUEj6JUPhhgesvfSqHhYdPiFYxPRFKKUoTyBVlE6eItVxEJSpoz3OzA7SiP8Ryqt7nWs8gk02nDEvCraxAVeZC2CX+R4nIl11RFL+OSIbOt65rt/nAyeF6Hg1GzoHavJlAQsnFO6yBFipinrtTgvQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589923675; 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=RhGbNNl/BQMyjtUlDzXdTl/WP4OX7gSer22iwrANAWc=; b=WouxCZC6BMQdYc55RbhRi7AI4Xpa+LGU2ruUs1dny6rCc/QkzNuocbkZe4CcXIMNRRZDgjlRKnF3h8lyYioD9fkv6qOkgqhOshuupRzCfrdTTuepeP8dnJfUaQXJ/XUxEZM6tR849SdcvjJSGpYWvPC1gAoP6oDyKJIljiTRPlM= 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 1589923675807474.820015227746; Tue, 19 May 2020 14:27:55 -0700 (PDT) Received: from localhost ([::1]:52806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb9mE-0001Pg-IX for importer@patchew.org; Tue, 19 May 2020 17:27:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb9jU-0006cB-48 for qemu-devel@nongnu.org; Tue, 19 May 2020 17:25:04 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:32839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb9jQ-0005yX-0c for qemu-devel@nongnu.org; Tue, 19 May 2020 17:25:03 -0400 Received: by mail-pf1-x444.google.com with SMTP id n15so513550pfd.0 for ; Tue, 19 May 2020 14:24:59 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id v5sm386134pjy.4.2020.05.19.14.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 14:24:57 -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=RhGbNNl/BQMyjtUlDzXdTl/WP4OX7gSer22iwrANAWc=; b=Mw+ZNBWaXokO10anNAOdRkqknWh9/88wylVZM4+N5TBLxm1bckd3kEBWNyMsw37Ow7 Khq9mVo/pE/MlIvSXRPZGtpsv7dZCX1UvvRhcCitU0PQ+qOiMnOjGYTbJz43Ei/ueOT1 b6D/lbLW7GBDeq5ns3EgmcdmI7jBVHfuoXCM79vQ+pTqaXDzkoI8Gka+n1Qsn52lkXgQ P9xddrZaxxzsB+H63D/NKaaR/L2DpYCUY2PBp+MLPjZ8/0sbl2HAGzfS20F3XugyGNFf s3mr6nH81IXFRa77u2+UXeeJeN56BEmzwS2jCFcRSh7GBkPDCO5uktF1DAUwHC3w2Sm9 vMEg== 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=RhGbNNl/BQMyjtUlDzXdTl/WP4OX7gSer22iwrANAWc=; b=icnFmxV6nJeFk4vU3N98byyb/sQVq9Ytany5Y0YduDxwjVstXz9m9SFTetKg6+Fu4N 9ElA/yt+XOyAY4KCHp1mgA6QbQGSUVHlMZq7oAkJu8bvyAW0lWHmxUsoV02br39aACHK D5A6G3xuylXmIaJtI1BU4lhLd1NLuJssWDHHIFJwgO745idkjTZQ2WFXf1bAPOWWYzjw 6GKo1qFgKi+qxeqVnW15Zq7P0fzW0GRARxYxXrjfOh90ZNdZFgSrICweDYaL7dpYtnSL E6Vtx+SMi8olZSXHm2B62HDt5PaQu/L6KnLxJuigceJ2bwk8VnFwM3bsJP213nBzv/TR 8poA== X-Gm-Message-State: AOAM532F+1XB2dneoizwox51VkvlX2EdbOkGQee3QY6IJaccxD4UofzF 8NGqDHmKsdpC7vEmJU8IuIi4MKixMxk= X-Google-Smtp-Source: ABdhPJyIer26JHMwL2QanrnZBV8vACrahSkISCBc1TO2VhzMMuFescaWrf87gB3nzSpftBlDJJm54w== X-Received: by 2002:a62:804c:: with SMTP id j73mr1041958pfd.214.1589923498249; Tue, 19 May 2020 14:24:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/2] target/arm: Use clear_vec_high more effectively Date: Tue, 19 May 2020 14:24:53 -0700 Message-Id: <20200519212453.28494-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519212453.28494-1-richard.henderson@linaro.org> References: <20200519212453.28494-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::444; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x444.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 | 53 +++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 4f6edb2892..874f3eb4f9 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -900,11 +900,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; @@ -922,12 +921,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 /* @@ -6934,7 +6934,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 { @@ -6964,9 +6963,11 @@ 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); + if (is_q) { + write_vec_element(s, tcg_resh, rd, 1, MO_64); + } tcg_temp_free_i64(tcg_resh); - clear_vec_high(s, true, rd); + clear_vec_high(s, is_q, rd); } =20 /* TBL/TBX @@ -7003,17 +7004,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(); @@ -7033,9 +7038,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 @@ -7072,7 +7080,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++) { @@ -7123,9 +7131,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