From patchwork Wed Sep 9 00:16:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249415 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp5017742ilg; Tue, 8 Sep 2020 17:27:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyutx0NP4hI/MXN39PoXMkSug09dOgFyxPfkUqdR8l5pSd5C/ztIBZo9H880HoIYYZ1CANu X-Received: by 2002:a25:25cd:: with SMTP id l196mr2315858ybl.160.1599611249957; Tue, 08 Sep 2020 17:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599611249; cv=none; d=google.com; s=arc-20160816; b=RahNpKAbdUvk1caKq5FGHm6oU4OB88nmctwR5h0h/oq8N/+DAvFaT3dRIpHGoczimT EYFJdS6gD4kf9dk1JPSptKcRsnROWTSr/hM6MSEgSQsmOi5dDTPuurhQeu8acJFhlla6 4eQu7Xcs1t+FGY70QmU5zjSdKk4u4eTMo/xSTcdZ1/Xr3eRQQlVNZlzMNIVH3M+Hp5fy 3Y8PBjadzdzrWNGT4KNX5ebHV3OFHBM26nR9CVbV8PlESfyvmlF72bfVkPaU/vVAIloD dEqzPvIsO3I4kbJ8LHvE/kMDuHVW9v6GLh//RQ24Q5bgMEeVGu4ya1r/MTDHjxSxdNGb R3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=DrWwc7nhYkhyIWgVLuU+D0JRjvYc9QKHe5GHoGABUmU=; b=h0eO5skf+SqF6nLsc6VZCqrvCrG2zw37Kd9bIIp2clA8oOfMQrmhMVouZMgUW4udaS id+erXJW+MeohsGVqXOhq/GbFv78gQcz2w/1/zKhPXuNs5v5pAmMAGBZW/8uLmc5tF7p L9mmtTiSWDPsXfZ4qyZUhNVcpCv6GUr81D+4ATv9/lCH4+HlqGdWXl4OXA8iCo+sQ/tO HZ6tSYoNQZI5/irgnk+wAiZy3ldwMjTZCdM7sLEoXUE68unMfeVcDchx0ODUgri9govt oVUEy/y/dUjcoCO+0QPab3wsU14+qTWEQSka8qjzC+ox5pRn/xC/o3oo90hPabythe/m MwqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PYXUrzx7; 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 i18si911344ybm.302.2020.09.08.17.27.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Sep 2020 17:27:29 -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=PYXUrzx7; 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]:54150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFnxR-00060b-Eh for patch@linaro.org; Tue, 08 Sep 2020 20:27:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFnnc-0008UC-Gj for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:20 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:38014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFnna-0002G9-LX for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:20 -0400 Received: by mail-pj1-x1043.google.com with SMTP id u3so430570pjr.3 for ; Tue, 08 Sep 2020 17:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=DrWwc7nhYkhyIWgVLuU+D0JRjvYc9QKHe5GHoGABUmU=; b=PYXUrzx7PWFJ3hbQvbzUrer9Hz6z3mbOmr0i2q5JUnkupaNxPPkQ1W6Zl2JlPbGbSq pg1XdrhmCc4vNMJ1a3kGbnaa4o3E7CSrtQST5mxWBuvgiZtGELVlmoHV7bqvB26/uFcp eQASzB6jpGRfMzui7KiO6UZmjs/jXUDZaM0WhEVjD2o+/roN19z3FyHFg2G+xb+uFg8R dbvu7yjLkD+nc85hfj9eonOEcYhp8RDjbu14EkPu9mKluh3a05xuOJQEft/utxms+JTM M+k02ppsoqnQwcoaY0ch21PcxxfzbNOKLCQ+XEuVUb4bmrLnH3BtBghnTZ24VCLQPKN0 JXYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DrWwc7nhYkhyIWgVLuU+D0JRjvYc9QKHe5GHoGABUmU=; b=bAe72CIXY+QYyokA2qUsG9ZY5cGNGDexrpPh2haslX1fubJeQXUOiZel2WeZvNgILt 7yiwu1KDqNr+dGxmr9niZAChh4VhRsU4dG9AM6DdkJPg7Sa2qv4qNzlSwWNy5uvdiqrL vWBYfeLQ6OZYA7Z03j+YWvfPHlLNoTXk8/JxSGlAMgSPENwdewfACNu3FLYdDjBQzlfZ 3KrpPNW1v3SUMgeFv4cGff9Kl9RQccbvBvemqD9sXJoI6sE039HcscjI4fAgES6AzkYk 8IcbHqL/jkvk6/s1Ugz10D35kP2Z+bn2QWzd1fCtaqRzw1m9mmR0ajhKhU9w3gcvZMte ArsA== X-Gm-Message-State: AOAM530dBX41ITrYTY6ttMwAqGlvIj8BzQbuauxy5BvscEva9ZThItI9 +Zrzq1CkU9vgM9pN+IJBv+r0uD/AzT3H5g== X-Received: by 2002:a17:90a:a60e:: with SMTP id c14mr1234506pjq.31.1599610637072; Tue, 08 Sep 2020 17:17:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id 137sm505437pfu.149.2020.09.08.17.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 17:17:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 22/43] tcg: Convert tcg_gen_dupi_vec to TCG_CONST Date: Tue, 8 Sep 2020 17:16:26 -0700 Message-Id: <20200909001647.532249-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909001647.532249-1-richard.henderson@linaro.org> References: <20200909001647.532249-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1043.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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Because we now store uint64_t in TCGTemp, we can now always store the full 64-bit duplicate immediate. So remove the difference between 32- and 64-bit hosts. Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++++----- tcg/tcg-op-vec.c | 39 ++++++++++----------------------------- tcg/tcg.c | 7 +------ 3 files changed, 15 insertions(+), 40 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 1eda7dc419..af07c6f628 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1116,11 +1116,10 @@ void tcg_optimize(TCGContext *s) case INDEX_op_dup2_vec: assert(TCG_TARGET_REG_BITS == 32); if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { - tmp = arg_info(op->args[1])->val; - if (tmp == arg_info(op->args[2])->val) { - tcg_opt_gen_movi(s, &temps_used, op, op->args[0], tmp); - break; - } + tcg_opt_gen_movi(s, &temps_used, op, op->args[0], + deposit64(arg_info(op->args[1])->val, 32, 32, + arg_info(op->args[2])->val)); + break; } else if (args_are_copies(op->args[1], op->args[2])) { op->opc = INDEX_op_dup_vec; TCGOP_VECE(op) = MO_32; diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index cdbf11c573..9fbed1366c 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -216,25 +216,17 @@ void tcg_gen_mov_vec(TCGv_vec r, TCGv_vec a) } } -#define MO_REG (TCG_TARGET_REG_BITS == 64 ? MO_64 : MO_32) - -static void do_dupi_vec(TCGv_vec r, unsigned vece, TCGArg a) -{ - TCGTemp *rt = tcgv_vec_temp(r); - vec_gen_2(INDEX_op_dupi_vec, rt->base_type, vece, temp_arg(rt), a); -} - TCGv_vec tcg_const_zeros_vec(TCGType type) { TCGv_vec ret = tcg_temp_new_vec(type); - do_dupi_vec(ret, MO_REG, 0); + tcg_gen_dupi_vec(MO_64, ret, 0); return ret; } TCGv_vec tcg_const_ones_vec(TCGType type) { TCGv_vec ret = tcg_temp_new_vec(type); - do_dupi_vec(ret, MO_REG, -1); + tcg_gen_dupi_vec(MO_64, ret, -1); return ret; } @@ -252,39 +244,28 @@ TCGv_vec tcg_const_ones_vec_matching(TCGv_vec m) void tcg_gen_dup64i_vec(TCGv_vec r, uint64_t a) { - if (TCG_TARGET_REG_BITS == 64) { - do_dupi_vec(r, MO_64, a); - } else if (a == dup_const(MO_32, a)) { - do_dupi_vec(r, MO_32, a); - } else { - TCGv_i64 c = tcg_const_i64(a); - tcg_gen_dup_i64_vec(MO_64, r, c); - tcg_temp_free_i64(c); - } + tcg_gen_dupi_vec(MO_64, r, a); } void tcg_gen_dup32i_vec(TCGv_vec r, uint32_t a) { - do_dupi_vec(r, MO_REG, dup_const(MO_32, a)); + tcg_gen_dupi_vec(MO_32, r, a); } void tcg_gen_dup16i_vec(TCGv_vec r, uint32_t a) { - do_dupi_vec(r, MO_REG, dup_const(MO_16, a)); + tcg_gen_dupi_vec(MO_16, r, a); } void tcg_gen_dup8i_vec(TCGv_vec r, uint32_t a) { - do_dupi_vec(r, MO_REG, dup_const(MO_8, a)); + tcg_gen_dupi_vec(MO_8, r, a); } void tcg_gen_dupi_vec(unsigned vece, TCGv_vec r, uint64_t a) { - if (vece == MO_64) { - tcg_gen_dup64i_vec(r, a); - } else { - do_dupi_vec(r, MO_REG, dup_const(vece, a)); - } + TCGTemp *rt = tcgv_vec_temp(r); + tcg_gen_mov_vec(r, tcg_constant_vec(rt->base_type, vece, a)); } void tcg_gen_dup_i64_vec(unsigned vece, TCGv_vec r, TCGv_i64 a) @@ -489,8 +470,8 @@ void tcg_gen_abs_vec(unsigned vece, TCGv_vec r, TCGv_vec a) if (tcg_can_emit_vec_op(INDEX_op_sari_vec, type, vece) > 0) { tcg_gen_sari_vec(vece, t, a, (8 << vece) - 1); } else { - do_dupi_vec(t, MO_REG, 0); - tcg_gen_cmp_vec(TCG_COND_LT, vece, t, a, t); + tcg_gen_cmp_vec(TCG_COND_LT, vece, t, a, + tcg_constant_vec(type, vece, 0)); } tcg_gen_xor_vec(vece, r, a, t); tcg_gen_sub_vec(vece, r, r, t); diff --git a/tcg/tcg.c b/tcg/tcg.c index e413bf70d4..0ce45fd123 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3440,16 +3440,11 @@ static void temp_load(TCGContext *s, TCGTemp *ts, TCGRegSet desired_regs, * The targets will, in general, have to do this search anyway, * do this generically. */ - if (TCG_TARGET_REG_BITS == 32) { - val = dup_const(MO_32, val); - vece = MO_32; - } if (val == dup_const(MO_8, val)) { vece = MO_8; } else if (val == dup_const(MO_16, val)) { vece = MO_16; - } else if (TCG_TARGET_REG_BITS == 64 && - val == dup_const(MO_32, val)) { + } else if (val == dup_const(MO_32, val)) { vece = MO_32; }