From patchwork Wed Apr 22 01:16:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185617 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp161543ilf; Tue, 21 Apr 2020 18:19:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJW08j/QY0HgCO5mg7rlvrxNm2A0Bcbx7vxv0rkYHMqrtyb7rEQqt/yiUwcGL8Gt6ogr8dh X-Received: by 2002:a05:620a:796:: with SMTP id 22mr10002135qka.247.1587518381026; Tue, 21 Apr 2020 18:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587518381; cv=none; d=google.com; s=arc-20160816; b=yjwbqTr/xsL9GBRLvya0ZoFJqAdhTLPX6sEueHH0bJQQZz/ycKS5M5gG7rrrnXmdGh ghdtuTaDgCHs4MSzNec5srAM0JDVFrVT5U1Pmnv2q6BDzT8ax9OLk/mFH6SNGhqnRURs 4dI/XsJCNPR5otyH3ZjPt037ZIIIFpWdthZM4zJj0l9gG26byJpU4fQdYD7YVbKiTGQl rUapZ91QRe2krdTonZ0/MDJN8WFxLmDaSwCLTBWSDAiaw928xpa/xuIW0YbD/aHiRYLz DAGT55/XWc4BduISG4ac/s+KS9ruoA6smX4jRh7TboClkVzQBtdKkPxjDJTNYfhcSnfW nScg== 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=dOnBBGhmkNTpQUIqTasvNhE2MTWW7gI0dB3WMtwwkiQ=; b=EuF7G8hRey2lxFsI4Bac0ov1BzY2N+klF0Tv2sSEhLFShhGMY+rYgBAfGpduEf1CwH Vp5jkb+P+JOq5UX+yKngdTKpV/yoAJ+fFGqB9sQM6cWI6lTSL2P/+DlTlKJ/7Gl8ynNY pMri5B3xgh5sRNE/JswAIar2uNXOjrwL09vn87jIPPGytqNZqMbgJpOGkFutfqLTrvsP reGUw0i/MymzbTV6uJWPNS5n5QXvpDrh9t2yGmFT5JHWAEgQ/d/hVx5W9/mVpFqZK3r0 lB19Fr4uUce8VvCqdgfg0w1UCAt4EIFpxe5qbwf+KinYXBnU3Um8ftUSFaKrdDx4CPdC S49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dF+G9V1j; 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 j207si2526364qke.62.2020.04.21.18.19.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Apr 2020 18:19:41 -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=dF+G9V1j; 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]:38598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR43A-0004pC-H4 for patch@linaro.org; Tue, 21 Apr 2020 21:19:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33640) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR414-00013c-3s for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jR413-00018G-Ge for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:29 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:40573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jR413-00012Q-23 for qemu-devel@nongnu.org; Tue, 21 Apr 2020 21:17:29 -0400 Received: by mail-pj1-x1041.google.com with SMTP id a22so152442pjk.5 for ; Tue, 21 Apr 2020 18:17:28 -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=dOnBBGhmkNTpQUIqTasvNhE2MTWW7gI0dB3WMtwwkiQ=; b=dF+G9V1jvI1961CjsImzyiM4/+mpSq1Jo0LdN4EHEONWL9h7ryuY4v5BjOICv1C1ZF fbuDzsj02QPNAQEHhCaXhdJg4FuXrxp/Rf2fH+yHlM43Q5aBkdabtnNr7HE8ZXPr4eKR 6r06QCyFMKSSLNhzD8Omk2CzPJL1nEdT3nWCJNaxYwztpTWelf93qh+OzF4E5lkZ3nsX FclFMN5OWC6U6QuE9LnwxMQ02peErI81z5DgzaBhfjt9nMfOnjK4fL7dKsr/inDdOlGj wwzfMO03hIJE7ObY+cALNXhFFRGK/8/DHAVx4/IqbDpquPiKO//GdqlYmKvpqtL4Bq2X 34LA== 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=dOnBBGhmkNTpQUIqTasvNhE2MTWW7gI0dB3WMtwwkiQ=; b=YTp89ikorjTAObCtPjTIzgvs+Dvft2s8A/pCJeB2uh3gynDD32z1TFiGI7X6vIlYnx i0NbOPD9XouF45PGjvbHtI3SVUASXS8ZcuX5TSFbSL0tc7rRdo3wbtOZjBpbXEBhAFnt MIPZn23Rg+5ZfRtlloUlKubD52jpH8frHlGk8kMGWHAJ4SYYp+a62DrYBS6GMusRGGKv xvrREBYd1LifsrJ84FuvDxAqK/ONS7L50tLenOMJgkNo94Yuyco665JeHAGG7eLzeeQU yS0Ez9S3c8fFUD7yTEpZb5wfu/O4s97mN9w0SAExI52m5fJ3viVpJmwySKtmrjcBHJXf xNfQ== X-Gm-Message-State: AGi0PuZ1GRVsMKK4+bvc40X8viDan/k9/MXz1DXSRq/M0WqDvGoaRvNH pGMYShs9WqAECE35kN34AIx7dwhyoiM= X-Received: by 2002:a17:90a:f995:: with SMTP id cq21mr8699807pjb.56.1587518247266; Tue, 21 Apr 2020 18:17:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 18:17:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/36] target/s390x: Use tcg_gen_gvec_dup_imm Date: Tue, 21 Apr 2020 18:16:48 -0700 Message-Id: <20200422011722.13287-3-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::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.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::1041 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, David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The gen_gvec_dupi switch is unnecessary with the new function. Replace it with a local gen_gvec_dup_imm that takes care of the register to offset conversion and length arguments. Drop zero_vec and use use gen_gvec_dup_imm with 0. Reviewed-by: David Hildenbrand Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/s390x/translate_vx.inc.c | 41 +++++++-------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) -- 2.20.1 diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.inc.c index 24558cce80..12347f8a03 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -231,8 +231,8 @@ static void get_vec_element_ptr_i64(TCGv_ptr ptr, uint8_t reg, TCGv_i64 enr, #define gen_gvec_mov(v1, v2) \ tcg_gen_gvec_mov(0, vec_full_reg_offset(v1), vec_full_reg_offset(v2), 16, \ 16) -#define gen_gvec_dup64i(v1, c) \ - tcg_gen_gvec_dup64i(vec_full_reg_offset(v1), 16, 16, c) +#define gen_gvec_dup_imm(es, v1, c) \ + tcg_gen_gvec_dup_imm(es, vec_full_reg_offset(v1), 16, 16, c); #define gen_gvec_fn_2(fn, es, v1, v2) \ tcg_gen_gvec_##fn(es, vec_full_reg_offset(v1), vec_full_reg_offset(v2), \ 16, 16) @@ -316,31 +316,6 @@ static void gen_gvec128_4_i64(gen_gvec128_4_i64_fn fn, uint8_t d, uint8_t a, tcg_temp_free_i64(cl); } -static void gen_gvec_dupi(uint8_t es, uint8_t reg, uint64_t c) -{ - switch (es) { - case ES_8: - tcg_gen_gvec_dup8i(vec_full_reg_offset(reg), 16, 16, c); - break; - case ES_16: - tcg_gen_gvec_dup16i(vec_full_reg_offset(reg), 16, 16, c); - break; - case ES_32: - tcg_gen_gvec_dup32i(vec_full_reg_offset(reg), 16, 16, c); - break; - case ES_64: - gen_gvec_dup64i(reg, c); - break; - default: - g_assert_not_reached(); - } -} - -static void zero_vec(uint8_t reg) -{ - tcg_gen_gvec_dup8i(vec_full_reg_offset(reg), 16, 16, 0); -} - static void gen_addi2_i64(TCGv_i64 dl, TCGv_i64 dh, TCGv_i64 al, TCGv_i64 ah, uint64_t b) { @@ -396,8 +371,8 @@ static DisasJumpType op_vgbm(DisasContext *s, DisasOps *o) * Masks for both 64 bit elements of the vector are the same. * Trust tcg to produce a good constant loading. */ - gen_gvec_dup64i(get_field(s, v1), - generate_byte_mask(i2 & 0xff)); + gen_gvec_dup_imm(ES_64, get_field(s, v1), + generate_byte_mask(i2 & 0xff)); } else { TCGv_i64 t = tcg_temp_new_i64(); @@ -432,7 +407,7 @@ static DisasJumpType op_vgm(DisasContext *s, DisasOps *o) } } - gen_gvec_dupi(es, get_field(s, v1), mask); + gen_gvec_dup_imm(es, get_field(s, v1), mask); return DISAS_NEXT; } @@ -585,7 +560,7 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o) t = tcg_temp_new_i64(); tcg_gen_qemu_ld_i64(t, o->addr1, get_mem_index(s), MO_TE | es); - zero_vec(get_field(s, v1)); + gen_gvec_dup_imm(es, get_field(s, v1), 0); write_vec_element_i64(t, get_field(s, v1), enr, es); tcg_temp_free_i64(t); return DISAS_NEXT; @@ -892,7 +867,7 @@ static DisasJumpType op_vrepi(DisasContext *s, DisasOps *o) return DISAS_NORETURN; } - gen_gvec_dupi(es, get_field(s, v1), data); + gen_gvec_dup_imm(es, get_field(s, v1), data); return DISAS_NEXT; } @@ -1372,7 +1347,7 @@ static DisasJumpType op_vcksm(DisasContext *s, DisasOps *o) read_vec_element_i32(tmp, get_field(s, v2), i, ES_32); tcg_gen_add2_i32(tmp, sum, sum, sum, tmp, tmp); } - zero_vec(get_field(s, v1)); + gen_gvec_dup_imm(ES_32, get_field(s, v1), 0); write_vec_element_i32(sum, get_field(s, v1), 1, ES_32); tcg_temp_free_i32(tmp);