From patchwork Thu Aug 31 03:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 718950 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp244937wrn; Wed, 30 Aug 2023 20:10:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExDFlLOmqx/PRNuj2dAXOszucKSiBIZHaaHvFZCQwaP+PsBhH+zB/WyXg9VIQDFZVz9RAr X-Received: by 2002:a05:600c:ac8:b0:401:eb0:a98d with SMTP id c8-20020a05600c0ac800b004010eb0a98dmr3268360wmr.24.1693451402355; Wed, 30 Aug 2023 20:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693451402; cv=none; d=google.com; s=arc-20160816; b=GuRHyFyhodeIBqGGGZwXfjbkIF5pJFrGui83nIBuECjRL05vKTmc8Z1e/vOP9CwNJG fvg0OEKj7/E6INwopCQLIiqO2xXUN8ssOHxZqywl0/6trxgsE07rZyTkollOD+HnBtvb jQp+V3f1mFXP8mOK5torQk+c0XuGQXxpz3TY3NP/dvRCUKQeujduIZ4QwbZrG3evJv0d c4oZdm/3CPHXHKa/ZFbLvEIbnpVfOUL8yzS5DrKq/asSRfscn6hclPsCFhj6snezoSbf /WmVPuvBBNOaBEk0nk+aX9aa/6DQBk2nVtDkwjRtWAGvRUub4vvKFwTxD0IBZLoDNDmT pc7Q== 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:cc:to :from:dkim-signature; bh=WCSUo8NxMzlfmw4OjKURT71L8T30vr4pb5Vh1ZtlO+I=; fh=legojzL0NBjNCMcvXYgHWqhi5VvhbuKc83OjI5AWfTg=; b=O6pSs0mfVM1Q43dcCNfGLXOz9VRExR3TCK8HkHKKQYxy+JNxH72gV9rTVXENSI4+LH 4VgFkQBSQ7ZixVpp5E+MRE6mLNEVam4cc3bSGy2KnClp0Mxa7wKn4Y7m63WpHS9JjdwZ JblDnO/hi73nYpHw0k3gAbGPIEAhJYyzompergC2zzdc+TDe/MSMF36ev4wPerelr5PU r6GxPuJjr7iFpB0pbuwp20uuPT0GIoEPMNsjgJN6gp64zFmTT1Ja+2cbjprHl8ECGRgA afkP3KmwS52dIEV3MEUvlZZle8k/PZA//Q32AGuhiwdGkJpTST5O0AlDitBf+L46UJbh 8vLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KNRDLbOV; 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 n1-20020adffe01000000b0030aecd473d3si197469wrr.211.2023.08.30.20.10.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 20:10:02 -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=KNRDLbOV; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbY3c-0005MO-NH; Wed, 30 Aug 2023 23:09:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbY3T-0005LB-G4 for qemu-devel@nongnu.org; Wed, 30 Aug 2023 23:09:12 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbY3R-0001Fx-4m for qemu-devel@nongnu.org; Wed, 30 Aug 2023 23:09:11 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-563f8e8a53dso302431a12.3 for ; Wed, 30 Aug 2023 20:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693451347; x=1694056147; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WCSUo8NxMzlfmw4OjKURT71L8T30vr4pb5Vh1ZtlO+I=; b=KNRDLbOV7CYBDTs+fL6rzy04S72S4/1wLcEI995T6nGhM2ATFHYiDEjuDTDm99yKV0 EQSPQ5aCVr0GPHsmJ/2KcKKkBTS3XBmMTOIeRTecgoTls9DWnVG2iK1QGGREgZZcFQaC 3/LNmh43+RMiZOKwSQyq2kMfAUVCF/dKzbWwXDmmQ7Xj6shEqv661t77YYmp9yxDGBED t1F1ZEuR429+pHu4Mzomettw+Em7N0bJ0u0Nd7bqa/1jjHXT7lTtxfxWgRgaN5VcXJcs JU46iHLD+W1fBt5IHvUPzRKOWAyx/I3w50/rqqNpGqkNauyJ0TXn3vabeXZMX6qDsLRg kuTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693451347; x=1694056147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WCSUo8NxMzlfmw4OjKURT71L8T30vr4pb5Vh1ZtlO+I=; b=GzOvqYQOPS8a9/VHctLniWbwkkr4eJDX8AjiLj599GS7uyCFo1secyIh/RuAzAs7fT MVj4j/W1PMfycztGYvC3/x6bt+jOZsid3udH6LIsBRzh/83T7SSa0a4kYwUF1+sLkcui EabmbfAgBrI3ajbX3IkmiRIr5Dz8yQF2KN4JzPqkWwmhVrY36Wpug+9RsWXaXLh9xSgL Q6mq5D32GpPZkJDxwhk8LZ9BrQwKyEvMTnbxUG5HNCgBn94ENDNtZ9vTNZkXNPzjRis9 MHnKCTaW/PZa+/ANEvOzn7ha69D/ydmdclM+/cHTsWIGNuKKeqAg0EthKRCROWLgWYr7 Fmvg== X-Gm-Message-State: AOJu0YwfQYghGITkEo1/oSE0qo6OusMwKIg/ouoduhLelOZMRiBzcq1q qo3joAdf4szDJ2yYrJ7nCrjuOFKXPt7rw+iO0PQ= X-Received: by 2002:a05:6a20:415:b0:148:9ba1:9f6f with SMTP id a21-20020a056a20041500b001489ba19f6fmr3821246pza.38.1693451347534; Wed, 30 Aug 2023 20:09:07 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id ix21-20020a170902f81500b001bba7aab826sm225123plb.163.2023.08.30.20.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 20:09:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: gaosong@loongson.cn Subject: [PATCH 2/2] target/arm: Use tcg_gen_gvec_cmpi for compare vs 0 Date: Wed, 30 Aug 2023 20:09:04 -0700 Message-Id: <20230831030904.1194667-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230831030904.1194667-1-richard.henderson@linaro.org> References: <20230831030904.1194667-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com 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.29 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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Song Gao --- target/arm/tcg/translate.c | 56 ++++++-------------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 38ad8dd4bd..89a7392ed3 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -2943,54 +2943,16 @@ void gen_gvec_sqrdmlsh_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, gen_gvec_fn3_qc(rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, fns[vece - 1]); } -#define GEN_CMP0(NAME, COND) \ - static void gen_##NAME##0_i32(TCGv_i32 d, TCGv_i32 a) \ - { \ - tcg_gen_negsetcond_i32(COND, d, a, tcg_constant_i32(0)); \ - } \ - static void gen_##NAME##0_i64(TCGv_i64 d, TCGv_i64 a) \ - { \ - tcg_gen_negsetcond_i64(COND, d, a, tcg_constant_i64(0)); \ - } \ - static void gen_##NAME##0_vec(unsigned vece, TCGv_vec d, TCGv_vec a) \ - { \ - TCGv_vec zero = tcg_constant_vec_matching(d, vece, 0); \ - tcg_gen_cmp_vec(COND, vece, d, a, zero); \ - } \ - void gen_gvec_##NAME##0(unsigned vece, uint32_t d, uint32_t m, \ - uint32_t opr_sz, uint32_t max_sz) \ - { \ - const GVecGen2 op[4] = { \ - { .fno = gen_helper_gvec_##NAME##0_b, \ - .fniv = gen_##NAME##0_vec, \ - .opt_opc = vecop_list_cmp, \ - .vece = MO_8 }, \ - { .fno = gen_helper_gvec_##NAME##0_h, \ - .fniv = gen_##NAME##0_vec, \ - .opt_opc = vecop_list_cmp, \ - .vece = MO_16 }, \ - { .fni4 = gen_##NAME##0_i32, \ - .fniv = gen_##NAME##0_vec, \ - .opt_opc = vecop_list_cmp, \ - .vece = MO_32 }, \ - { .fni8 = gen_##NAME##0_i64, \ - .fniv = gen_##NAME##0_vec, \ - .opt_opc = vecop_list_cmp, \ - .prefer_i64 = TCG_TARGET_REG_BITS == 64, \ - .vece = MO_64 }, \ - }; \ - tcg_gen_gvec_2(d, m, opr_sz, max_sz, &op[vece]); \ - } +#define GEN_CMP0(NAME, COND) \ + void NAME(unsigned vece, uint32_t d, uint32_t m, \ + uint32_t opr_sz, uint32_t max_sz) \ + { tcg_gen_gvec_cmpi(COND, vece, d, m, 0, opr_sz, max_sz); } -static const TCGOpcode vecop_list_cmp[] = { - INDEX_op_cmp_vec, 0 -}; - -GEN_CMP0(ceq, TCG_COND_EQ) -GEN_CMP0(cle, TCG_COND_LE) -GEN_CMP0(cge, TCG_COND_GE) -GEN_CMP0(clt, TCG_COND_LT) -GEN_CMP0(cgt, TCG_COND_GT) +GEN_CMP0(gen_gvec_ceq0, TCG_COND_EQ) +GEN_CMP0(gen_gvec_cle0, TCG_COND_LE) +GEN_CMP0(gen_gvec_cge0, TCG_COND_GE) +GEN_CMP0(gen_gvec_clt0, TCG_COND_LT) +GEN_CMP0(gen_gvec_cgt0, TCG_COND_GT) #undef GEN_CMP0