From patchwork Thu May 7 17:23:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186308 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp3377007ill; Thu, 7 May 2020 10:26:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKLwIj3dZqexzLC2tI/JAOsnCV2eidKG7TA9vpyuT6H3o3RPv6JMRhTal4N2aTkwp64dRAM X-Received: by 2002:ac8:1cf:: with SMTP id b15mr15135312qtg.389.1588872370002; Thu, 07 May 2020 10:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588872369; cv=none; d=google.com; s=arc-20160816; b=uRGvtAaRSfsWRyKAiApaTEyXxw1hi40IedyE9Ud3WRsa60N3sJ37rZfzfe1YtkOkfh /UYBpJ7xbqPJtJvOWYLqsB5MIaGyPY+Fg8kWIDx9jEk/o2HJmtTQRH0D/N9tZDN8rtfY IF8vE30j1OJj619e6G78h01aVG90lLLspgIOUYzxx1IFm2fNKZiGJxRJKS1hFA587CVC 7d79p16uMPbdvSYOA4szXvQ1davFroYpczfqtPgSyeD83MSGJiNXsoD1xIKt9Jm3JfFn H34U6A2d+Nz4TJL6UsLNa0jcuWaMz3SluoazhCzvJgkWSxxFuOGh0RsCgLnNEap5ImIC 1QGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hu8GAtYpK4KqYeGSLVRmQ5y9C6Pv/NuZ3ZqPedv/gBI=; b=JlcMb5toSjV8iJqfC4j69NNj3RYAZ5MTaQ2rWqfqHlDScCUM7AC5HJ87+e3AGK0ClS cEkeG4vj37V9o2tawoB3OCsm70whrHU7udIRrE0PfNtTdKFABvwHB9Dplyg/RCiyxOFY aGoBqjcpB+E44uVVbxicfc4IfQxd4B4CkEBagAMqxirENTe4SK/RJQazVTI8ZHiYs5XE 8KjbMzysn7wnJsE+rUEq4Y/SjMk9vpBDuHiHkJ7ba2LKG3ZJrGxQrUp4ATFs1E6RYkeX 8ZP8GNQgsSEZLm+SNApLObVbb5JPhfXXVDtV37EzgyDfI+e5B4YChPZmPQ3vthuh+EMf hZDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NRikOAcJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:470:142::17]) by mx.google.com with ESMTPS id h7si3342900qkm.177.2020.05.07.10.26.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 May 2020 10:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) client-ip=2001:470:142::17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NRikOAcJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkHh-0004ap-Ai for patch@linaro.org; Thu, 07 May 2020 13:26:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkFd-0002Xx-G4 for qemu-devel@nongnu.org; Thu, 07 May 2020 13:24:01 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:52843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWkFc-0005fy-HQ for qemu-devel@nongnu.org; Thu, 07 May 2020 13:24:01 -0400 Received: by mail-pj1-x1042.google.com with SMTP id a5so2931754pjh.2 for ; Thu, 07 May 2020 10:24:00 -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=hu8GAtYpK4KqYeGSLVRmQ5y9C6Pv/NuZ3ZqPedv/gBI=; b=NRikOAcJqfw36J2pHMrL/68H9bsb/3BhB7kmrZsrw9Y1qOoN+s3gpmdzaqK+XFHWvM 5EDr4H7Kf4afM2rf52gEM2GD2OiX5a6qFiBIVIsTEil4+dYURPdWI7Y4UU5fNp3/+Yxb sGrhs525tvLsUw33BhHjDmvjo+wTQVON2BvNCB1GMBaxUiqN0dPt1TQ4znN9TXajzu7d +x4K1j/Gqaj7/ISBnEdyr1y5T31BepYnvHKsoAnnnkI8E8NzmGUFe1uk5i0JLD7HUgrd ru/sIsZE5WgwWXV5m9ZYOTpAz1rIl8uUW4kBUpdOf5G5+SGYVIdqW7diT7UBNXKomz1X K0tg== 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=hu8GAtYpK4KqYeGSLVRmQ5y9C6Pv/NuZ3ZqPedv/gBI=; b=kg/yEZZF5SLyFE9uIg7DNpKRAoIpLw7myB6So59y75ciEauUxWwfW86e7lXJfhb6hl OexYXznCD84St67nXN7mybpFOcIrlmTDYtm9Oo7c8TEw6eTiDJ6eVLDgHuv8jv9+koAS D0njRsWJEfo0UO69IniOJYKG3qZqjz/kDJ2RuYQ6PUKM6x6tWbSrNj4FZiaJOk4E9QI1 rUC3Fz99Y4q/NW2RffLruWF5gUuEC4XO/ctv3FMBY4GNXKyfomWJEXgj8tCISv7f3GjE mcOocbyBt+7cmAAd2jacKLfHZpsJ11TavcZROV1O9EvqwXXNEb+yZ9aEgPnfy+2aZOe3 5DpA== X-Gm-Message-State: AGi0PubkcPNsRlBQ9xVqiZ567TPHy3x2AsnZ3spxJsyEL7yVLJJto8bc 7cvuVApcg8TGMVsp7kb80xlbatyu0wc= X-Received: by 2002:a17:90a:cd03:: with SMTP id d3mr1157557pju.233.1588872238365; Thu, 07 May 2020 10:23:58 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id 19sm312228pjl.52.2020.05.07.10.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 10:23:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 3/4] target/arm: Use clear_vec_high more effectively Date: Thu, 7 May 2020 10:23:51 -0700 Message-Id: <20200507172352.15418-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200507172352.15418-1-richard.henderson@linaro.org> References: <20200507172352.15418-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1042.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_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not explicitly store zero to the NEON high part when we can pass !is_q to clear_vec_high. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 59 +++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 23 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b6feb2b9dc..0947eaee05 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, TCGv_i64 tcg_addr, int size) { /* This always zero-extends and writes to a full 128 bit wide vector */ TCGv_i64 tmplo = tcg_temp_new_i64(); - TCGv_i64 tmphi; + TCGv_i64 tmphi = NULL; if (size < 4) { MemOp memop = s->be_data + size; - tmphi = tcg_const_i64(0); tcg_gen_qemu_ld_i64(tmplo, tcg_addr, get_mem_index(s), memop); } else { bool be = s->be_data == MO_BE; @@ -961,12 +960,13 @@ static void do_fp_ld(DisasContext *s, int destidx, TCGv_i64 tcg_addr, int size) } 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); - 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 != NULL, destidx); } /* @@ -6960,8 +6960,8 @@ static void disas_simd_ext(DisasContext *s, uint32_t insn) return; } - tcg_resh = tcg_temp_new_i64(); tcg_resl = tcg_temp_new_i64(); + tcg_resh = NULL; /* 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 -= 64; } + tcg_resh = 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) 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); } /* TBL/TBX @@ -7042,17 +7045,21 @@ static void disas_simd_tb(DisasContext *s, uint32_t insn) * the input. */ tcg_resl = tcg_temp_new_i64(); - tcg_resh = tcg_temp_new_i64(); + tcg_resh = NULL; 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 = 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); + } } tcg_idx = tcg_temp_new_i64(); @@ -7072,9 +7079,12 @@ static void disas_simd_tb(DisasContext *s, uint32_t insn) 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); } /* ZIP/UZP/TRN @@ -7111,7 +7121,7 @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) } tcg_resl = tcg_const_i64(0); - tcg_resh = tcg_const_i64(0); + tcg_resh = is_q ? tcg_const_i64(0) : NULL; tcg_res = tcg_temp_new_i64(); for (i = 0; i < elements; i++) { @@ -7162,9 +7172,12 @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) 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); } /*