From patchwork Mon Feb 13 08:25:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 56085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2231538wrn; Mon, 13 Feb 2023 00:26:09 -0800 (PST) X-Google-Smtp-Source: AK7set+Ey3uHn3Dfr72xW6ZsgB3hDQAjTjNJ7FK8mMGEjmzZjT3xhMrS3v1+Gcir9aY1xjRxhFA6 X-Received: by 2002:a17:906:730f:b0:8ab:b03d:a34f with SMTP id di15-20020a170906730f00b008abb03da34fmr22178599ejc.12.1676276768991; Mon, 13 Feb 2023 00:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676276768; cv=none; d=google.com; s=arc-20160816; b=Z5Yj6s5ocyujXiU4fuo1Jc/aWXtPl5OvJg1sSpi23Mr/JXjskcVI+DURnEajNMpSLD hVbTUrB5CEaXezYGJdFQ3PL6kQU4Etv/4wHwV4S84GBNToQOiwDacBZx5hbLDhfC9kqZ jBG1q4QVGIiRi7GfeY5GpwN3RUlHovDZ/eKZkOGEDv+ICxQS/jvdB4fqhR0T+ZFiSCfn ASUKjtHPqrY2BHmA/TU9SCaPZ0MgKaFok5RkTjqt0hiaNFvsYE8hIgOjKHY+1eKCS40v 8ZK9duRYLfjc873bEJ28LDNL2nhDVxtCt01Za8Ia0SD5v56gDbF7vszLfxqYnXFQFHM1 P0kg== 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=LG410j+lZs/b74tlLnV2kBSv37i2eR6hVi8wvbovyjE=; b=x96p7337+szFe7dCG9aguVhbcZa3zFc+TwYUn4yI8KlLblkz1pYTFVtPgPUGiKaUVq KXRdie9NuUbb0rRfYEm+AQJvSki8wQjG9gKrOKUYr/QXt6w70zsByBq7gFl5+0bdZQRB IaAUtk0+OHcQ8zxqyYgHjyCNhU7DMEiEeUC/a+jTyFDXc//uJzQywhbJF8z7UD7X2eVZ FDlxlpAaTdHdN/+svU3UQa+0Y7uFFHNP29sxQuVg/l0vqyN7FAIq49lxpVKo/qTI/4b8 7rxjdoxt/j5KaQEsEAc+nN6sNwnCRp32FPpa1NffLyaeIdsLB2uotXyoA6PiyDDlnhYi Qf1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gc14-20020a1709072b0e00b008aa8ce0b51bsi11516718ejc.881.2023.02.13.00.26.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 00:26:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D70773858020 for ; Mon, 13 Feb 2023 08:26:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by sourceware.org (Postfix) with ESMTPS id 656693858D33 for ; Mon, 13 Feb 2023 08:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 656693858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp64t1676276724tff4b75k Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 13 Feb 2023 16:25:23 +0800 (CST) X-QQ-SSF: 01400000000000E0L000000A0000000 X-QQ-FEAT: HNEuTRwWosxQhVWGhioghDDYjeZFDCoGetw6DDIW6z0lH5bqIh3lsfVq0Uu51 VDi3UF3v8//1yMUOcIv8UPwIAwrmoeLZd1cucF7qFtplPB79dADBmoXAI+NScXgiZQiHRfx iDzo4JKZuRQfTox3nNPIsWWybjGsbCpgSBXVpuJlMoqxhPkea2G/E7vg37Yu5h4sYck6V52 o+gcCRyUsVIi2bRqRuC+bxSc+MVBiJ4Aku4zZuaOsHg2tJIQe7asi3O/qRyXgSe+ODe8TZ3 4ToqtsRxBuQV/S66X8OlnxE0mz1zrp+Dz0gSlXvJmt/Tdp7FMYN5C1tj06ArW+QnOv9oqVT BHKqGI2VNL5yDZarnNHE3TXNJcJEsnwOabhlAxUeGQYvWc7KvOf1pj2M3zuQA== X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Ju-Zhe Zhong Subject: [PATCH] RISC-V: Add binop constraints tests for integer compare Date: Mon, 13 Feb 2023 16:25:22 +0800 Message-Id: <20230213082522.289082-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757703589394692626?= X-GMAIL-MSGID: =?utf-8?q?1757703589394692626?= From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/binop_vv_constraint-2.c: New test. * gcc.target/riscv/rvv/base/binop_vv_constraint-3.c: New test. * gcc.target/riscv/rvv/base/binop_vv_constraint-4.c: New test. * gcc.target/riscv/rvv/base/binop_vv_constraint-5.c: New test. * gcc.target/riscv/rvv/base/binop_vv_constraint-6.c: New test. * gcc.target/riscv/rvv/base/binop_vv_constraint-7.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-123.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-124.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-125.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-126.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-127.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-128.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-129.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-130.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-131.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-132.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-133.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-134.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-135.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-136.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-137.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-138.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-139.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-140.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-141.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-142.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-143.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-144.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-145.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-146.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-147.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-148.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-149.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-150.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-151.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-152.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-153.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-154.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-155.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-156.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-157.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-158.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-159.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-160.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-161.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-162.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-163.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-164.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-165.c: New test. * gcc.target/riscv/rvv/base/binop_vx_constraint-166.c: New test. --- .../riscv/rvv/base/binop_vv_constraint-2.c | 15 ++ .../riscv/rvv/base/binop_vv_constraint-3.c | 27 ++++ .../riscv/rvv/base/binop_vv_constraint-4.c | 27 ++++ .../riscv/rvv/base/binop_vv_constraint-5.c | 29 ++++ .../riscv/rvv/base/binop_vv_constraint-6.c | 27 ++++ .../riscv/rvv/base/binop_vv_constraint-7.c | 29 ++++ .../riscv/rvv/base/binop_vx_constraint-123.c | 15 ++ .../riscv/rvv/base/binop_vx_constraint-124.c | 27 ++++ .../riscv/rvv/base/binop_vx_constraint-125.c | 27 ++++ .../riscv/rvv/base/binop_vx_constraint-126.c | 29 ++++ .../riscv/rvv/base/binop_vx_constraint-127.c | 27 ++++ .../riscv/rvv/base/binop_vx_constraint-128.c | 29 ++++ .../riscv/rvv/base/binop_vx_constraint-129.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-130.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-131.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-132.c | 59 ++++++++ .../riscv/rvv/base/binop_vx_constraint-133.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-134.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-135.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-136.c | 59 ++++++++ .../riscv/rvv/base/binop_vx_constraint-137.c | 123 ++++++++++++++++ .../riscv/rvv/base/binop_vx_constraint-138.c | 123 ++++++++++++++++ .../riscv/rvv/base/binop_vx_constraint-139.c | 72 ++++++++++ .../riscv/rvv/base/binop_vx_constraint-140.c | 72 ++++++++++ .../riscv/rvv/base/binop_vx_constraint-141.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-142.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-143.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-144.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-145.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-146.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-147.c | 19 +++ .../riscv/rvv/base/binop_vx_constraint-148.c | 20 +++ .../riscv/rvv/base/binop_vx_constraint-149.c | 19 +++ .../riscv/rvv/base/binop_vx_constraint-150.c | 21 +++ .../riscv/rvv/base/binop_vx_constraint-151.c | 20 +++ .../riscv/rvv/base/binop_vx_constraint-152.c | 20 +++ .../riscv/rvv/base/binop_vx_constraint-153.c | 75 ++++++++++ .../riscv/rvv/base/binop_vx_constraint-154.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-155.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-156.c | 65 +++++++++ .../riscv/rvv/base/binop_vx_constraint-157.c | 133 ++++++++++++++++++ .../riscv/rvv/base/binop_vx_constraint-158.c | 69 +++++++++ .../riscv/rvv/base/binop_vx_constraint-159.c | 65 +++++++++ .../riscv/rvv/base/binop_vx_constraint-160.c | 133 ++++++++++++++++++ .../riscv/rvv/base/binop_vx_constraint-161.c | 76 ++++++++++ .../riscv/rvv/base/binop_vx_constraint-162.c | 17 +++ .../riscv/rvv/base/binop_vx_constraint-163.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-164.c | 16 +++ .../riscv/rvv/base/binop_vx_constraint-165.c | 13 ++ .../riscv/rvv/base/binop_vx_constraint-166.c | 15 ++ 50 files changed, 2276 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-2.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-3.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-4.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-5.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-6.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-7.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-123.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-124.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-125.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-126.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-127.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-128.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-129.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-130.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-131.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-132.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-133.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-134.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-135.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-136.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-137.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-138.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-139.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-140.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-141.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-142.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-143.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-144.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-145.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-146.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-147.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-148.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-149.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-150.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-151.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-152.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-153.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-154.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-155.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-156.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-157.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-158.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-159.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-160.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-161.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-162.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-163.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-164.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-165.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-166.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-2.c new file mode 100644 index 00000000000..6a03b00a3a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f (void * in, void *out) +{ + vint32mf2_t v = __riscv_vle32_v_i32mf2 (in, 4); + vbool64_t mask = __riscv_vlm_v_b64 (in + 1, 4); + vint32mf2_t v2 = __riscv_vle32_v_i32mf2 (in+444, 4); + vbool64_t mask2 = __riscv_vmseq_vv_i32mf2_b64_m(mask,v,v2,4); + mask2 = __riscv_vmslt_vv_i32mf2_b64_mu(mask2,mask2,v2,v,4); + __riscv_vsm_v_b64 (out, mask2, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-3.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-3.c new file mode 100644 index 00000000000..c4f81382a5c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-3.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmseq_vv_i32m1_b32_m (m3, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmslt_vv_i32m1_b32_m (m3, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-4.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-4.c new file mode 100644 index 00000000000..e16db932f15 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-4.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmseq_vv_i32m1_b32_mu (m3, m3, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmslt_vv_i32m1_b32_mu (m3, m3, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-5.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-5.c new file mode 100644 index 00000000000..54a240f44fe --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-5.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmseq_vv_i32m1_b32_mu (mask, m3, v, v, 4); + m4 = __riscv_vmseq_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmslt_vv_i32m1_b32_mu (mask, m3, v, v, 4); + m4 = __riscv_vmslt_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmv} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-6.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-6.c new file mode 100644 index 00000000000..ad5441f3404 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-6.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = __riscv_vlm_v_b32 (in, 4); + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vv_i32m1_b32 (v, v2, 4); + vbool32_t m4 = __riscv_vmseq_vv_i32m1_b32_mu (m3, mask, v, v, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = __riscv_vlm_v_b32 (in, 4); + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vv_i32m1_b32 (v, v2, 4); + vbool32_t m4 = __riscv_vmslt_vv_i32m1_b32_mu (m3, mask, v, v, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmv} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-7.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-7.c new file mode 100644 index 00000000000..0ef92a22a34 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv_constraint-7.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmseq_vv_i32m1_b32_m (m3, v2, v2, 4); + m4 = __riscv_vmseq_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vv_i32m1_b32 (v, v, 4); + vbool32_t m4 = __riscv_vmslt_vv_i32m1_b32_m (m3, v2, v2, 4); + m4 = __riscv_vmslt_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-123.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-123.c new file mode 100644 index 00000000000..f11219c5221 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-123.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f (void * in, void *out, int32_t x) +{ + vint32mf2_t v = __riscv_vle32_v_i32mf2 (in, 4); + vbool64_t mask = __riscv_vlm_v_b64 (in + 1, 4); + vint32mf2_t v2 = __riscv_vle32_v_i32mf2 (in+444, 4); + vbool64_t mask2 = __riscv_vmseq_vx_i32mf2_b64_m(mask,v,x,4); + mask2 = __riscv_vmslt_vx_i32mf2_b64_mu(mask2,mask2,v2,x,4); + __riscv_vsm_v_b64 (out, mask2, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-124.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-124.c new file mode 100644 index 00000000000..f6c3015872f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-124.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-125.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-125.c new file mode 100644 index 00000000000..d92e250dcf4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-125.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-126.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-126.c new file mode 100644 index 00000000000..57971915ad8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-126.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (mask, m3, v, x, 4); + m4 = __riscv_vmseq_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (mask, m3, v, x, 4); + m4 = __riscv_vmslt_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmv} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-127.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-127.c new file mode 100644 index 00000000000..3933c35f4ce --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-127.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = __riscv_vlm_v_b32 (in, 4); + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v2, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, mask, v, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = __riscv_vlm_v_b32 (in, 4); + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v2, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, mask, v, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmv} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-128.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-128.c new file mode 100644 index 00000000000..77c3a2b79e4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-128.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, x, 4); + m4 = __riscv_vmseq_vx_i32m1_b32_m (m4, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, x, 4); + m4 = __riscv_vmslt_vx_i32m1_b32_m (m4, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-129.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-129.c new file mode 100644 index 00000000000..db5dfe1fc3e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-129.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (mask, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-130.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-130.c new file mode 100644 index 00000000000..da6b02ddd2d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-130.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, -16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, m3, v2, -16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16 +** vmseq\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*-16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, -16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (mask, m3, v2, -16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, -16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, -16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-131.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-131.c new file mode 100644 index 00000000000..16d35c8053d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-131.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 15, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, m3, v2, 15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15 +** vmseq\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 15, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (mask, m3, v2, 15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 15, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, 15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-132.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-132.c new file mode 100644 index 00000000000..b804c15baa1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-132.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (m3, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_mu (mask, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmseq_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmseq_vx_i32m1_b32_m (m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-133.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-133.c new file mode 100644 index 00000000000..2da8ab7c15e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-133.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (mask, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-134.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-134.c new file mode 100644 index 00000000000..a83fee48494 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-134.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmslt\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*-15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (mask, m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-135.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-135.c new file mode 100644 index 00000000000..767987657b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-135.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmslt\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (mask, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-136.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-136.c new file mode 100644 index 00000000000..d938c20aadc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-136.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (m3, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_mu (mask, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmslt_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmslt_vx_i32m1_b32_m (m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-137.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-137.c new file mode 100644 index 00000000000..1825a6ab982 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-137.c @@ -0,0 +1,123 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, -16, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, -16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 15, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f4: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f4 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f5: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f5 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f6: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-138.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-138.c new file mode 100644 index 00000000000..1b19982f5d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-138.c @@ -0,0 +1,123 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, -15, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, -15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 17, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 17, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f4: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f4 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f5: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f5 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f6: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-139.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-139.c new file mode 100644 index 00000000000..e062234b011 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-139.c @@ -0,0 +1,72 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*-16,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, -16, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, -16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15 +** vmseq\.vi\tv[0-9]+,\s*v[0-9]+,\s*15,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 15, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmseq\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-140.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-140.c new file mode 100644 index 00000000000..a1dbf777c98 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-140.c @@ -0,0 +1,72 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, -15, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, -15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmslt\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 17, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 17, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-141.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-141.c new file mode 100644 index 00000000000..7ff6affd3a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-141.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-142.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-142.c new file mode 100644 index 00000000000..4613447f0d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-142.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-143.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-143.c new file mode 100644 index 00000000000..7f44087a022 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-143.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-144.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-144.c new file mode 100644 index 00000000000..9ccbc15f666 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-144.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-145.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-145.c new file mode 100644 index 00000000000..3d73b2af4fb --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-145.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmseq_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmseq_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-146.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-146.c new file mode 100644 index 00000000000..9aae1dc28f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-146.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmslt_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmslt_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-147.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-147.c new file mode 100644 index 00000000000..bf08954797d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-147.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f (void * in, void *out, int32_t x) +{ + vint32mf2_t v = __riscv_vle32_v_i32mf2 (in, 4); + vbool64_t mask = __riscv_vlm_v_b64 (in + 1, 4); + vint32mf2_t v2 = __riscv_vle32_v_i32mf2 (in+444, 4); + vbool64_t mask2 = __riscv_vmsge_vx_i32mf2_b64_m(mask,v,x,4); + mask2 = __riscv_vmsge_vx_i32mf2_b64_mu(mask2,mask2,v2,x,4); + __riscv_vsm_v_b64 (out, mask2, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t} 1 } } */ +/* { dg-final { scan-assembler-times {vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmandn\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-148.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-148.c new file mode 100644 index 00000000000..c48134bc553 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-148.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t} 1 } } */ +/* { dg-final { scan-assembler-times {vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmnot\.mm\s+v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-149.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-149.c new file mode 100644 index 00000000000..7ba1a14aab6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-149.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 2 } } */ +/* { dg-final { scan-assembler-times {vmandn\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmnot\.mm\s+v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-150.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-150.c new file mode 100644 index 00000000000..6282fb48105 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-150.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v, x, 4); + m4 = __riscv_vmsge_vv_i32m1_b32_m (m4, v2, v2, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t} 1 } } */ +/* { dg-final { scan-assembler-times {vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmnot\.mm\s+v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmv} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-151.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-151.c new file mode 100644 index 00000000000..a2aa633aef7 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-151.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = __riscv_vlm_v_b32 (in, 4); + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v2, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, mask, v, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t} 1 } } */ +/* { dg-final { scan-assembler-times {vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmnot\.mm\s+v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vmv} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-152.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-152.c new file mode 100644 index 00000000000..1bd751564ab --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-152.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ +#include "riscv_vector.h" + +void f1 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + //asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, x, 4); + m4 = __riscv_vmsge_vx_i32m1_b32_m (m4, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+\s+} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vx\s+v[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t} 2 } } */ +/* { dg-final { scan-assembler-times {vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vmnot\.mm\s+v[0-9]+,\s*v[0-9]+} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-153.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-153.c new file mode 100644 index 00000000000..5a3d475e3d8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-153.c @@ -0,0 +1,75 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmandn\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, x, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-154.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-154.c new file mode 100644 index 00000000000..ddbde574565 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-154.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*-15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, -15, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, -15, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-155.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-155.c new file mode 100644 index 00000000000..d22f3e4baa6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-155.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-156.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-156.c new file mode 100644 index 00000000000..e2e75709709 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-156.c @@ -0,0 +1,65 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmandn\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-157.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-157.c new file mode 100644 index 00000000000..2a9cb6eb6b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-157.c @@ -0,0 +1,133 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, -15, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, -15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 17, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 17, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f4: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f4 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f5: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f5 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f6: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-158.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-158.c new file mode 100644 index 00000000000..d22f3e4baa6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-158.c @@ -0,0 +1,69 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** vsm\.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],mu +** vle32.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[1-9][0-9]?,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** vsetvli\t[a-x0-9]+,zero,e8,mf4,ta,ma +** vlm.v\tv[0-9]+,0\([a-x0-9]+\) +** vsetivli\tzero,4,e32,m1,t[au],m[au] +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\) +** vle32\.v\tv[0-9]+,0\([a-x0-9]+\),v0.t +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,\s*v0.t +** vsm.v\tv[0-9]+,0\([a-x0-9]+\) +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 16, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, 16, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-159.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-159.c new file mode 100644 index 00000000000..e2e75709709 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-159.c @@ -0,0 +1,65 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f1: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmandn\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f1 (void * in, void * in2, void *out, int32_t x) +{ + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1 (in2, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (m3, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[1-9][0-9]?,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f2 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,\s*v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f3 (void * in, void *out, int32_t x) +{ + vbool32_t mask = *(vbool32_t*)in; + asm volatile ("":::"memory"); + vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4); + vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4); + vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, 17, 4); + vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_m (m3, v2, 17, 4); + __riscv_vsm_v_b32 (out, m4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-160.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-160.c new file mode 100644 index 00000000000..2a9cb6eb6b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-160.c @@ -0,0 +1,133 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, -15, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, -15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 17, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 17, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f4: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f4 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f5: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f5 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f6: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-161.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-161.c new file mode 100644 index 00000000000..d95c7c6b6d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-161.c @@ -0,0 +1,76 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ +#include "riscv_vector.h" + +/* +** f0: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*-15,v0.t +** ... +** ret +*/ +void f0 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, -15, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, -15, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f1: +** ... +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16 +** vmsge\.vi\tv[0-9]+,\s*v[0-9]+,\s*16,v0.t +** ... +** ret +*/ +void f1 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 16, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 16, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f2: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f2 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 17, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 17, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* +** f3: +** ... +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+ +** vmnot\.mm\s+v[0-9]+,\s*v[0-9]+ +** vmslt\.vx\tv[0-9]+,\s*v[0-9]+,\s*[a-x0-9]+,v0.t +** vmxor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+ +** ... +** ret +*/ +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-162.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-162.c new file mode 100644 index 00000000000..976487a680c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-162.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-163.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-163.c new file mode 100644 index 00000000000..9245f19c1db --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-163.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f3 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, 0xAAAAAAAAAAAAAAAA, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, 0xAAAAAAAAAAAAAAAA, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-164.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-164.c new file mode 100644 index 00000000000..bd6916e9c38 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-164.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f6 (void * in, void *out, int64_t x, int n) +{ + vint64m1_t v = __riscv_vle64_v_i64m1 (in + 1, 4); + vint64m1_t v2 = __riscv_vle64_v_i64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsge_vx_i64m1_b64 (v2, x, 4); + vbool64_t v4 = __riscv_vmsge_vx_i64m1_b64_m (v3, v2, x, 4); + __riscv_vsm_v_b64 (out + 2, v4, 4); +} + +/* { dg-final { scan-assembler-times {vlse64\.v\s+v[0-9]+,\s*0\([a-x0-9]+\),\s*zero} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-not {vmv} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-165.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-165.c new file mode 100644 index 00000000000..313595e29cd --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-165.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f (void * in, void *out, int64_t x, int n) +{ + vuint64m1_t v = __riscv_vle64_v_u64m1 (in + 1, 4); + vuint64m1_t v2 = __riscv_vle64_v_u64m1_tu (v, in + 2, 4); + vbool64_t v3 = __riscv_vmsgeu_vx_u64m1_b64 (v2, 0, 4); + __riscv_vsm_v_b64 (out + 2, v3, 4); +} + +/* { dg-final { scan-assembler-times {vmset\.m\s+v[0-9]+} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-166.c b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-166.c new file mode 100644 index 00000000000..1bd52f4c1e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/binop_vx_constraint-166.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3" } */ +#include "riscv_vector.h" + +void f (void * in, void *out, int64_t x, int n) +{ + vuint64m1_t v = __riscv_vle64_v_u64m1 (in + 1, 4); + vuint64m1_t v2 = __riscv_vle64_v_u64m1_tu (v, in + 2, 4); + vbool64_t mask = __riscv_vlm_v_b64 (in,8); + vbool64_t mask2 = __riscv_vlm_v_b64 (in + 100,8); + vbool64_t v3 = __riscv_vmsgeu_vx_u64m1_b64_mu (mask,mask2,v2, 0, 4); + __riscv_vsm_v_b64 (out + 2, v3, 4); +} + +/* { dg-final { scan-assembler-times {vmor\.mm\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */