From patchwork Wed Apr 22 01:16:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185621 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp163096ilf; Tue, 21 Apr 2020 18:21:48 -0700 (PDT) X-Google-Smtp-Source: APiQypIvtHoX1IJAYuT9ZA7rjizyi/KwVyYPe9w4xZB0yU86Mf/uUAWlcniBj0p9S2BnT20H+P1q X-Received: by 2002:ac8:31ac:: with SMTP id h41mr23986101qte.139.1587518508262; Tue, 21 Apr 2020 18:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587518508; cv=none; d=google.com; s=arc-20160816; b=DR+ZuB0LPfl9p2tvwJxXlNGsHNLqPTsTkNKmkCOspG3qw5yFUR4pLEPU3U2fKamXed RQfeczrhve1ERzgAY20NBXLk1fooi2JX0xI1vmx31XEGt30rCB9Pgg+yeSaGUYjXHRD/ lIvbBpe9MjzoiqaBNF3isqCFPKp33zFuzMM/VMLWSUDEck7om2y0Y3GNY+DDgRXEesGB ZspfYQkQnqrL+eaG//N8a2o0gOZ/TIMKqhAKlSS7Ud0aIbhWArkSXFKnuaFRMJpScjHI B3ojUJ8YTxTasdpkU1z7+SxMdmyjGWX8JKWHdaR+f7mJR8kakyheo3bxHL0Blih/MYT5 uqfQ== 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=0V/ZRxEb6ePbby7wOatIf966jqiZTa7L3IUbLbPYLQI=; b=jmkGmpzIHL0ZCV/qJwjZyOXTdSbAHgWCXgmaSyAnTmNGGdW91HpnRqzx+8GY3s69PR vLTP9Dyym+8H59aVLfg0jqyB0Y7eaG0/ND8XH/POZ+oKh9kreumFqpv5Vm1YciPJ1R+W J7iaoU7Stnqc6I3qQx2m6YT2QouExi/SIy/ivuiAOnUX/dyXkR7rp4/RFvVDlXuL/jjd hLLkmjKXs8ZOx7pH21tD+PnR5JJbM1Iw201sFW87Ad+MhWYoi/N3upq7PyEfV1xgq4SG LvpruMH4jOwQU6IbgNQLbuR9grocPMjo16x7ckmpGigRG65YEdh8Q9/aOAFwlyMy78bW jwOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v8x2OyAj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.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. [209.51.188.17]) by mx.google.com with ESMTPS id p45si2314898qtc.179.2020.04.21.18.21.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Apr 2020 18:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v8x2OyAj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.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]:38660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR45D-0008NL-K5 for patch@linaro.org; Tue, 21 Apr 2020 21:21:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR416-00016s-Sr for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jR416-0001Hv-3T for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:32 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:36419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jR415-0001Dn-MB for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:31 -0400 Received: by mail-pf1-x441.google.com with SMTP id g30so226307pfr.3 for ; Tue, 21 Apr 2020 18:17:31 -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=0V/ZRxEb6ePbby7wOatIf966jqiZTa7L3IUbLbPYLQI=; b=v8x2OyAj2X+c7gtEEZpQUohma0vesyS9VL1HD4gx9DKmB7DRdD5MXUAKgHenD0kZZW M78XhjMUuE8RjRWKD+hVp4mmUBIFSFFLEAKSyJXEnpHHL0WbJBH2FyKSK14/IWuMahlg wPIT6q2RqTbsFU8pU+1eCD+Tk5gUfnenId/libB20Ca283NFHJ3ecMYuMqb4MRt5KSP/ y/bw0SAZHCTHKrlMZA5UaTbZyQnP7tAydxZDWfVR15SXvbB7oX1SECe5WEQSFrW1aSq/ gkkHbuGgdMliVUX2zY21tPr/BKbhKcJvS/j9oohqXUT0N4px8Zc7WVlQhj+yOq5DIbp0 Vo9g== 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=0V/ZRxEb6ePbby7wOatIf966jqiZTa7L3IUbLbPYLQI=; b=BDjBLiITUmoC7Y9WnNRH5/lRfRIYPaesBDGLqBp8qEiT4A+u7oYACJNutqLFYzrHSO bSuz9pA944IpDj+M/xo5l7osH4ZP6bwGdpTu9KGzPl8d7kFKBaHUvaXbFVzr4EQEGY8i ON4c9gZX4Yh+u7FOmPgMZb1YVCJYRkM/przs1KkyakCpV6Jnf6018GCHDP3svxIgRRNL zdKWpBiEVTXUZJz27DXGA/Sh4JuK1bHGVDvOkUOoyd+xtUgADVlkZh7fFLVeIzMqBuPb t+BvZmURJiKwTdCrNwuHKrtAqRUkdq1MnJXx/COcgUGqOj/v/Mk3BK/9HHik1q7QXt90 Oo8w== X-Gm-Message-State: AGi0PuacTcMLIqHRdx9IsAqSnqOhz3rY2JaEOBXMDW1Fcobfim1YxQN1 ywNGcRO2q/V15yIJfV8/rPu77K7Ori8= X-Received: by 2002:aa7:8e0a:: with SMTP id c10mr24588404pfr.114.1587518249892; Tue, 21 Apr 2020 18:17:29 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id m4sm3673561pfm.26.2020.04.21.18.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 18:17:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/36] target/arm: Use tcg_gen_gvec_dup_imm Date: Tue, 21 Apr 2020 18:16:50 -0700 Message-Id: <20200422011722.13287-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200422011722.13287-1-richard.henderson@linaro.org> References: <20200422011722.13287-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::441 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: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In a few cases, we're able to remove some manual replication. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 10 +++++----- target/arm/translate-sve.c | 12 +++++------- target/arm/translate.c | 9 ++++++--- 3 files changed, 16 insertions(+), 15 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 7580e46367..095638e09a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -519,7 +519,7 @@ static void clear_vec_high(DisasContext *s, bool is_q, int rd) tcg_temp_free_i64(tcg_zero); } if (vsz > 16) { - tcg_gen_gvec_dup8i(ofs + 16, vsz - 16, vsz - 16, 0); + tcg_gen_gvec_dup_imm(MO_64, ofs + 16, vsz - 16, vsz - 16, 0); } } @@ -7794,8 +7794,8 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn) if (!((cmode & 0x9) == 0x1 || (cmode & 0xd) == 0x9)) { /* MOVI or MVNI, with MVNI negation handled above. */ - tcg_gen_gvec_dup64i(vec_full_reg_offset(s, rd), is_q ? 16 : 8, - vec_full_reg_size(s), imm); + tcg_gen_gvec_dup_imm(MO_64, vec_full_reg_offset(s, rd), is_q ? 16 : 8, + vec_full_reg_size(s), imm); } else { /* ORR or BIC, with BIC negation to AND handled above. */ if (is_neg) { @@ -10223,8 +10223,8 @@ static void handle_vec_simd_shri(DisasContext *s, bool is_q, bool is_u, if (is_u) { if (shift == 8 << size) { /* Shift count the same size as element size produces zero. */ - tcg_gen_gvec_dup8i(vec_full_reg_offset(s, rd), - is_q ? 16 : 8, vec_full_reg_size(s), 0); + tcg_gen_gvec_dup_imm(size, vec_full_reg_offset(s, rd), + is_q ? 16 : 8, vec_full_reg_size(s), 0); } else { gen_gvec_fn2i(s, is_q, rd, rn, shift, tcg_gen_gvec_shri, size); } diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index b35bad245e..6c8bda4e4c 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -177,7 +177,7 @@ static bool do_mov_z(DisasContext *s, int rd, int rn) static void do_dupi_z(DisasContext *s, int rd, uint64_t word) { unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_dup64i(vec_full_reg_offset(s, rd), vsz, vsz, word); + tcg_gen_gvec_dup_imm(MO_64, vec_full_reg_offset(s, rd), vsz, vsz, word); } /* Invoke a vector expander on two Pregs. */ @@ -1453,7 +1453,7 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag) unsigned oprsz = size_for_gvec(setsz / 8); if (oprsz * 8 == setsz) { - tcg_gen_gvec_dup64i(ofs, oprsz, maxsz, word); + tcg_gen_gvec_dup_imm(MO_64, ofs, oprsz, maxsz, word); goto done; } } @@ -2044,7 +2044,7 @@ static bool trans_DUP_x(DisasContext *s, arg_DUP_x *a) unsigned nofs = vec_reg_offset(s, a->rn, index, esz); tcg_gen_gvec_dup_mem(esz, dofs, nofs, vsz, vsz); } else { - tcg_gen_gvec_dup64i(dofs, vsz, vsz, 0); + tcg_gen_gvec_dup_imm(esz, dofs, vsz, vsz, 0); } } return true; @@ -3260,9 +3260,7 @@ static bool trans_FDUP(DisasContext *s, arg_FDUP *a) /* Decode the VFP immediate. */ imm = vfp_expand_imm(a->esz, a->imm); - imm = dup_const(a->esz, imm); - - tcg_gen_gvec_dup64i(dofs, vsz, vsz, imm); + tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, imm); } return true; } @@ -3276,7 +3274,7 @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) unsigned vsz = vec_full_reg_size(s); int dofs = vec_full_reg_offset(s, a->rd); - tcg_gen_gvec_dup64i(dofs, vsz, vsz, dup_const(a->esz, a->imm)); + tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, a->imm); } return true; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 9f9f4e19e0..af4d3ff4c9 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -5386,7 +5386,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) MIN(shift, (8 << size) - 1), vec_size, vec_size); } else if (shift >= 8 << size) { - tcg_gen_gvec_dup8i(rd_ofs, vec_size, vec_size, 0); + tcg_gen_gvec_dup_imm(MO_8, rd_ofs, vec_size, + vec_size, 0); } else { tcg_gen_gvec_shri(size, rd_ofs, rm_ofs, shift, vec_size, vec_size); @@ -5437,7 +5438,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) * architecturally valid and results in zero. */ if (shift >= 8 << size) { - tcg_gen_gvec_dup8i(rd_ofs, vec_size, vec_size, 0); + tcg_gen_gvec_dup_imm(size, rd_ofs, + vec_size, vec_size, 0); } else { tcg_gen_gvec_shli(size, rd_ofs, rm_ofs, shift, vec_size, vec_size); @@ -5783,7 +5785,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) } tcg_temp_free_i64(t64); } else { - tcg_gen_gvec_dup32i(reg_ofs, vec_size, vec_size, imm); + tcg_gen_gvec_dup_imm(MO_32, reg_ofs, vec_size, + vec_size, imm); } } }