From patchwork Fri Aug 18 19:32:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dapp X-Patchwork-Id: 136054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1628973vqi; Fri, 18 Aug 2023 12:33:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQ1EOdBbUR6MOaqIpLS6ru8yoIxp9F9UIysPPReB22C73623L//3QRvXkVqgVywv1hS4IQ X-Received: by 2002:ac2:4f15:0:b0:4fb:911b:4e19 with SMTP id k21-20020ac24f15000000b004fb911b4e19mr123618lfr.35.1692387211010; Fri, 18 Aug 2023 12:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692387210; cv=none; d=google.com; s=arc-20160816; b=E0mQSZqVZvlj2jIkdi0Ci9x7GiM4AtpJaO675KfKhhAUmou4xfZjRcLoOT6z7fgg5i u6Rkl4jGWwzIzQGmC2vsuqxSN3JN1skF0DyznBBPz75oFSE+YC/O4GCSXw3sQXQUYQ1L KpcxoEAch7EtkajdESfzCcYsFeabp4KfUeT4LzFQN5eErsLGxfgcTPCavg6nad7soWa3 8NKLew7PzEkSKmiWQZUDqXDDURlESV6himr6IDIhdFWXlafwqa4wtp8vzjhwQYWe+FX/ d8QmUv4sOEfpWU+NXDRS7Q+6u8oPz3fWqSNXKoZ9QgxI302Spd/oBsQqKXbJeg8UMa/o Bonw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:to:content-language:cc:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=N6ONcU1lbQLjWI5eKUNBNf+H+/ab5bvQic7obhNgV8s=; fh=ndvsZwFmZ+tyX7/x1KzctP6d5wHm+PTZEsDUSis59ys=; b=ASkbplWGCeXBfRO4wQUhVC3jROQYddERb38Ee5VIG5+34fFcfSLHTQ2LLEIq5EdEeY O7/9DO7n0YjzN1zi8UT4Ntaq7Q/w5dYLRmjw+u7WVCIWzXS9aD1Pl1TgJdezOswq6ITf EkzkMbXI6hofnsd6o2omzIa0pgCrxmsIzkP/yEhxMUJFLfKfVVo27g+vthG/KOzsuqmi 6u8F8//g+HzZ/gNEFE0RIutAut8xVyjvYaWEcN+uw5MxtBF0Yc5H8ycFkeLa1QKh+pdi tvY2vKWifnvzqL3O383hYVR09ShIp3tuKDmkruL+ygSlRz7Bv46QV5w6SqQRK/zo39g4 VXFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VnWuNp1u; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ba10-20020a0564021aca00b00527e708f378si1668926edb.120.2023.08.18.12.33.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 12:33:30 -0700 (PDT) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VnWuNp1u; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 768B53831390 for ; Fri, 18 Aug 2023 19:32:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 768B53831390 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692387174; bh=N6ONcU1lbQLjWI5eKUNBNf+H+/ab5bvQic7obhNgV8s=; h=Date:Cc:To:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=VnWuNp1uZ7/eBHFFOrX40O1+bqcYXgwr2LOnyBpyWMuhFC8+S0u+Z5Ar5le6GwJ3c JbqsJBA9Gtc72jwVdBst9jNdsuuZU0lH4RZFmXbI11ENit1H2GHz/5qTM8wGIY+HlL 4GWqm6SWV7rNwj8mR6WZygQ4p/ta6qKJvAU4iqkE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 1CAD7383138B for ; Fri, 18 Aug 2023 19:32:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CAD7383138B Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99bcc0adab4so157715066b.2 for ; Fri, 18 Aug 2023 12:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692387125; x=1692991925; h=content-transfer-encoding:subject:from:to:content-language:cc :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=N6ONcU1lbQLjWI5eKUNBNf+H+/ab5bvQic7obhNgV8s=; b=O2Oh8na7IXMJoRkDHQEXOGYfD5mOpNeKbdkWOzXb42s3RsTHKBXBBTU/h9pIV3i2Db 3g6Ucrsb6CqtsgROJjGfEWs0I8cv3KOGnT5/UamCSJQTl197wtg9U0nJ6cEnG85lxnTg d9M/LGv8c+wJOVIdTlc3OGAmemPjZdQIk1EIEgPXSYiqWLHlOOV0q8KMXHsi/tMg4Ojj SmA9ME5HjqsEEoIJQvvXJXcrsnPusvrJY1lNOb+FBBw+VAXFPyiKkypz81yOCfAzO79j c4h5X5Gx+6bXdqz832dbIdbyyu5FxGtgzWzoERP2pc+WtEPMYjlF36kNh9SKDaxzve0b EwGw== X-Gm-Message-State: AOJu0Yw06WVqgMHMhfMgqwBhEelQgyUtRGtjxIVR6RId1wSnJ9Zq+sOk bWQyWYFvqk7LSjxlM7s+BjW9L++zkKA= X-Received: by 2002:a17:907:2cf1:b0:99d:ed5e:cc7f with SMTP id hz17-20020a1709072cf100b0099ded5ecc7fmr120707ejc.13.1692387125165; Fri, 18 Aug 2023 12:32:05 -0700 (PDT) Received: from [192.168.1.24] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id sa4-20020a170906eda400b00992665694f7sm1544907ejb.107.2023.08.18.12.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Aug 2023 12:32:04 -0700 (PDT) Message-ID: Date: Fri, 18 Aug 2023 21:32:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: rdapp.gcc@gmail.com Content-Language: en-US To: gcc-patches , palmer , Kito Cheng , jeffreyalaw , "juzhe.zhong@rivai.ai" Subject: [PATCH] RISC-V/testsuite: Add missing conversion tests. X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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: , X-Patchwork-Original-From: Robin Dapp via Gcc-patches From: Robin Dapp Reply-To: Robin Dapp Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774596612098184840 X-GMAIL-MSGID: 1774596612098184840 Hi, this patch adds some missing tests for vf[nw]cvt. Regards Robin gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-run.c: Add tests. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-template.h: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-template.h: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-zvfh-run.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-template.h: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-zvfh-run.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-run.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-template.h: Ditto. * gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-zvfh-run.c: Ditto. --- .../rvv/autovec/conversions/vfncvt-ftoi-run.c | 96 +++++++++++++++++++ .../autovec/conversions/vfncvt-ftoi-rv32gcv.c | 6 +- .../autovec/conversions/vfncvt-ftoi-rv64gcv.c | 6 +- .../conversions/vfncvt-ftoi-template.h | 6 ++ .../autovec/conversions/vfncvt-itof-rv32gcv.c | 1 + .../autovec/conversions/vfncvt-itof-rv64gcv.c | 4 +- .../conversions/vfncvt-itof-template.h | 5 +- .../conversions/vfncvt-itof-zvfh-run.c | 32 +++++++ .../autovec/conversions/vfwcvt-ftoi-rv32gcv.c | 4 +- .../autovec/conversions/vfwcvt-ftoi-rv64gcv.c | 4 +- .../conversions/vfwcvt-ftoi-template.h | 2 + .../conversions/vfwcvt-ftoi-zvfh-run.c | 32 +++++++ .../rvv/autovec/conversions/vfwcvt-itof-run.c | 96 +++++++++++++++++++ .../autovec/conversions/vfwcvt-itof-rv32gcv.c | 4 +- .../autovec/conversions/vfwcvt-itof-rv64gcv.c | 4 +- .../conversions/vfwcvt-itof-template.h | 10 +- .../conversions/vfwcvt-itof-zvfh-run.c | 10 +- 17 files changed, 302 insertions(+), 20 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-run.c index ce3fcfa9af8..73eda067ba3 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-run.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-run.c @@ -62,6 +62,38 @@ main () RUN2 (float, uint16_t, 4096) RUN2 (float, uint16_t, 5975) + RUN (float, int8_t, 3) + RUN (float, int8_t, 4) + RUN (float, int8_t, 7) + RUN (float, int8_t, 99) + RUN (float, int8_t, 119) + RUN (float, int8_t, 128) + RUN (float, int8_t, 256) + RUN (float, int8_t, 279) + RUN (float, int8_t, 555) + RUN (float, int8_t, 1024) + RUN (float, int8_t, 1389) + RUN (float, int8_t, 2048) + RUN (float, int8_t, 3989) + RUN (float, int8_t, 4096) + RUN (float, int8_t, 5975) + + RUN2 (float, uint8_t, 3) + RUN2 (float, uint8_t, 4) + RUN2 (float, uint8_t, 7) + RUN2 (float, uint8_t, 99) + RUN2 (float, uint8_t, 119) + RUN2 (float, uint8_t, 128) + RUN2 (float, uint8_t, 256) + RUN2 (float, uint8_t, 279) + RUN2 (float, uint8_t, 555) + RUN2 (float, uint8_t, 1024) + RUN2 (float, uint8_t, 1389) + RUN2 (float, uint8_t, 2048) + RUN2 (float, uint8_t, 3989) + RUN2 (float, uint8_t, 4096) + RUN2 (float, uint8_t, 5975) + RUN (double, int32_t, 3) RUN (double, int32_t, 4) RUN (double, int32_t, 7) @@ -93,4 +125,68 @@ main () RUN2 (double, uint32_t, 3989) RUN2 (double, uint32_t, 4096) RUN2 (double, uint32_t, 5975) + + RUN (double, int16_t, 3) + RUN (double, int16_t, 4) + RUN (double, int16_t, 7) + RUN (double, int16_t, 99) + RUN (double, int16_t, 119) + RUN (double, int16_t, 128) + RUN (double, int16_t, 256) + RUN (double, int16_t, 279) + RUN (double, int16_t, 555) + RUN (double, int16_t, 1024) + RUN (double, int16_t, 1389) + RUN (double, int16_t, 2048) + RUN (double, int16_t, 3989) + RUN (double, int16_t, 4096) + RUN (double, int16_t, 5975) + + RUN2 (double, uint16_t, 3) + RUN2 (double, uint16_t, 4) + RUN2 (double, uint16_t, 7) + RUN2 (double, uint16_t, 99) + RUN2 (double, uint16_t, 119) + RUN2 (double, uint16_t, 128) + RUN2 (double, uint16_t, 256) + RUN2 (double, uint16_t, 279) + RUN2 (double, uint16_t, 555) + RUN2 (double, uint16_t, 1024) + RUN2 (double, uint16_t, 1389) + RUN2 (double, uint16_t, 2048) + RUN2 (double, uint16_t, 3989) + RUN2 (double, uint16_t, 4096) + RUN2 (double, uint16_t, 5975) + + RUN (double, int8_t, 3) + RUN (double, int8_t, 4) + RUN (double, int8_t, 7) + RUN (double, int8_t, 99) + RUN (double, int8_t, 119) + RUN (double, int8_t, 128) + RUN (double, int8_t, 256) + RUN (double, int8_t, 279) + RUN (double, int8_t, 555) + RUN (double, int8_t, 1024) + RUN (double, int8_t, 1389) + RUN (double, int8_t, 2048) + RUN (double, int8_t, 3989) + RUN (double, int8_t, 4096) + RUN (double, int8_t, 5975) + + RUN2 (double, uint8_t, 3) + RUN2 (double, uint8_t, 4) + RUN2 (double, uint8_t, 7) + RUN2 (double, uint8_t, 99) + RUN2 (double, uint8_t, 119) + RUN2 (double, uint8_t, 128) + RUN2 (double, uint8_t, 256) + RUN2 (double, uint8_t, 279) + RUN2 (double, uint8_t, 555) + RUN2 (double, uint8_t, 1024) + RUN2 (double, uint8_t, 1389) + RUN2 (double, uint8_t, 2048) + RUN2 (double, uint8_t, 3989) + RUN2 (double, uint8_t, 4096) + RUN2 (double, uint8_t, 5975) } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv32gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv32gcv.c index 4bed5eb7fff..43967af1cd5 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv32gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv32gcv.c @@ -1,7 +1,9 @@ /* { dg-do compile } */ -/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable" } */ +/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv32gcv_zvfh -mabi=ilp32d -fno-trapping-math --param=riscv-autovec-preference=scalable" } */ #include "vfncvt-ftoi-template.h" -/* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.x\.f\.w} 3 } } */ +/* The vectorizer only performs int -> float conversions with + intermediate types with -fno-trapping-math. */ +/* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.x\.f\.w} 9 } } */ /* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.xu\.f\.w} 3 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv64gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv64gcv.c index 7efc3f31c26..d49370bb925 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv64gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-rv64gcv.c @@ -1,7 +1,9 @@ /* { dg-do compile } */ -/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv64gcv_zvfh -mabi=lp64d --param=riscv-autovec-preference=scalable" } */ +/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv64gcv_zvfh -mabi=lp64d -fno-trapping-math --param=riscv-autovec-preference=scalable" } */ #include "vfncvt-ftoi-template.h" -/* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.x\.f\.w} 3 } } */ +/* The vectorizer only performs int -> float conversions with + intermediate types with -fno-trapping-math. */ +/* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.x\.f\.w} 9 } } */ /* { dg-final { scan-assembler-times {\tvfncvt\.rtz\.xu\.f\.w} 3 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-template.h index c6efbf15eca..c334e26e60c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-template.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-ftoi-template.h @@ -11,8 +11,14 @@ #define TEST_ALL() \ TEST (double, int32_t) \ TEST (double, uint32_t) \ + TEST (double, int16_t) \ + TEST (double, uint16_t) \ + TEST (double, int8_t) \ + TEST (double, uint8_t) \ TEST (float, int16_t) \ TEST (float, uint16_t) \ + TEST (float, int8_t) \ + TEST (float, uint8_t) \ TEST (_Float16, int8_t) \ TEST (_Float16, uint8_t) \ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv32gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv32gcv.c index dd5b95c903d..73e4644658b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv32gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv32gcv.c @@ -3,5 +3,6 @@ #include "vfncvt-itof-template.h" +/* { dg-final { scan-assembler-times {\tvfcvt\.f\.x\.v} 2 } } */ /* { dg-final { scan-assembler-times {\tvfncvt\.f\.x\.w} 2 } } */ /* { dg-final { scan-assembler-times {\tvfncvt\.f\.xu\.w} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv64gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv64gcv.c index b3bdeced81d..e9d31a70e6a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv64gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-rv64gcv.c @@ -3,5 +3,5 @@ #include "vfncvt-itof-template.h" -/* { dg-final { scan-assembler-times {\tvfncvt\.f\.x\.w} 2 } } */ -/* { dg-final { scan-assembler-times {\tvfncvt\.f\.xu\.w} 2 } } */ +/* { dg-final { scan-assembler-times {\tvfncvt\.f\.x\.w} 5 } } */ +/* { dg-final { scan-assembler-times {\tvfncvt\.f\.xu\.w} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-template.h index b06deeb3d72..c427cd167f6 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-template.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-template.h @@ -6,12 +6,15 @@ TYPE1 *restrict a, int n) \ { \ for (int i = 0; i < n; i++) \ - dst[i] = (TYPE2) a[i]; \ + dst[i] = (TYPE2) (a[i] & 0x7ffffffful); \ } + #define TEST_ALL() \ TEST (int64_t, float) \ TEST (uint64_t, float) \ + TEST (int64_t, _Float16) \ + TEST (uint64_t, _Float16) \ TEST (int32_t, _Float16) \ TEST (uint32_t, _Float16) \ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-zvfh-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-zvfh-run.c index b4e59c65ac7..2fb9b0c7b89 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-zvfh-run.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-zvfh-run.c @@ -61,4 +61,36 @@ main () RUN2 (uint32_t, _Float16, 3989) RUN2 (uint32_t, _Float16, 4096) RUN2 (uint32_t, _Float16, 5975) + + RUN (int64_t, _Float16, 3) + RUN (int64_t, _Float16, 4) + RUN (int64_t, _Float16, 7) + RUN (int64_t, _Float16, 99) + RUN (int64_t, _Float16, 119) + RUN (int64_t, _Float16, 128) + RUN (int64_t, _Float16, 256) + RUN (int64_t, _Float16, 279) + RUN (int64_t, _Float16, 555) + RUN (int64_t, _Float16, 1024) + RUN (int64_t, _Float16, 1389) + RUN (int64_t, _Float16, 2048) + RUN (int64_t, _Float16, 3989) + RUN (int64_t, _Float16, 4096) + RUN (int64_t, _Float16, 5975) + + RUN2 (uint64_t, _Float16, 3) + RUN2 (uint64_t, _Float16, 4) + RUN2 (uint64_t, _Float16, 7) + RUN2 (uint64_t, _Float16, 99) + RUN2 (uint64_t, _Float16, 119) + RUN2 (uint64_t, _Float16, 128) + RUN2 (uint64_t, _Float16, 256) + RUN2 (uint64_t, _Float16, 279) + RUN2 (uint64_t, _Float16, 555) + RUN2 (uint64_t, _Float16, 1024) + RUN2 (uint64_t, _Float16, 1389) + RUN2 (uint64_t, _Float16, 2048) + RUN2 (uint64_t, _Float16, 3989) + RUN2 (uint64_t, _Float16, 4096) + RUN2 (uint64_t, _Float16, 5975) } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv32gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv32gcv.c index ce2bea48067..0ab42af6d70 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv32gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv32gcv.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ -/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable" } */ +/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv32gcv_zvfh -mabi=ilp32d -fno-trapping-math --param=riscv-autovec-preference=scalable" } */ #include "vfwcvt-ftoi-template.h" -/* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.x\.f\.v} 2 } } */ +/* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.x\.f\.v} 4 } } */ /* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.xu\.f\.v} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv64gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv64gcv.c index 99aa3de4281..e1a4b631423 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv64gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-rv64gcv.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ -/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv64gcv_zvfh -mabi=lp64d --param=riscv-autovec-preference=scalable" } */ +/* { dg-additional-options "-std=c99 -fno-vect-cost-model -march=rv64gcv_zvfh -mabi=lp64d -fno-trapping-math --param=riscv-autovec-preference=scalable" } */ #include "vfwcvt-ftoi-template.h" -/* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.x\.f\.v} 2 } } */ +/* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.x\.f\.v} 4 } } */ /* { dg-final { scan-assembler-times {\tvfwcvt\.rtz\.xu\.f\.v} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-template.h index a276351bf69..aef03859d2b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-template.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-template.h @@ -9,6 +9,8 @@ } #define TEST_ALL() \ + TEST (_Float16, int64_t) \ + TEST (_Float16, uint64_t) \ TEST (_Float16, int32_t) \ TEST (_Float16, uint32_t) \ TEST (float, int64_t) \ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-zvfh-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-zvfh-run.c index 15bcd05b592..5bf4bc99037 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-zvfh-run.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-ftoi-zvfh-run.c @@ -61,4 +61,36 @@ main () RUN2 (_Float16, uint32_t, 3989) RUN2 (_Float16, uint32_t, 4096) RUN2 (_Float16, uint32_t, 5975) + + RUN (_Float16, int64_t, 3) + RUN (_Float16, int64_t, 4) + RUN (_Float16, int64_t, 7) + RUN (_Float16, int64_t, 99) + RUN (_Float16, int64_t, 119) + RUN (_Float16, int64_t, 128) + RUN (_Float16, int64_t, 256) + RUN (_Float16, int64_t, 279) + RUN (_Float16, int64_t, 555) + RUN (_Float16, int64_t, 1024) + RUN (_Float16, int64_t, 1389) + RUN (_Float16, int64_t, 2048) + RUN (_Float16, int64_t, 3989) + RUN (_Float16, int64_t, 4096) + RUN (_Float16, int64_t, 5975) + + RUN2 (_Float16, uint64_t, 3) + RUN2 (_Float16, uint64_t, 4) + RUN2 (_Float16, uint64_t, 7) + RUN2 (_Float16, uint64_t, 99) + RUN2 (_Float16, uint64_t, 119) + RUN2 (_Float16, uint64_t, 128) + RUN2 (_Float16, uint64_t, 256) + RUN2 (_Float16, uint64_t, 279) + RUN2 (_Float16, uint64_t, 555) + RUN2 (_Float16, uint64_t, 1024) + RUN2 (_Float16, uint64_t, 1389) + RUN2 (_Float16, uint64_t, 2048) + RUN2 (_Float16, uint64_t, 3989) + RUN2 (_Float16, uint64_t, 4096) + RUN2 (_Float16, uint64_t, 5975) } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-run.c index b9287f69558..a90faef462f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-run.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-run.c @@ -30,6 +30,70 @@ int main () { + RUN (int8_t, float, 3) + RUN (int8_t, float, 4) + RUN (int8_t, float, 7) + RUN (int8_t, float, 99) + RUN (int8_t, float, 119) + RUN (int8_t, float, 128) + RUN (int8_t, float, 256) + RUN (int8_t, float, 279) + RUN (int8_t, float, 555) + RUN (int8_t, float, 1024) + RUN (int8_t, float, 1389) + RUN (int8_t, float, 2048) + RUN (int8_t, float, 3989) + RUN (int8_t, float, 4096) + RUN (int8_t, float, 5975) + + RUN2 (uint8_t, float, 3) + RUN2 (uint8_t, float, 4) + RUN2 (uint8_t, float, 7) + RUN2 (uint8_t, float, 99) + RUN2 (uint8_t, float, 119) + RUN2 (uint8_t, float, 128) + RUN2 (uint8_t, float, 256) + RUN2 (uint8_t, float, 279) + RUN2 (uint8_t, float, 555) + RUN2 (uint8_t, float, 1024) + RUN2 (uint8_t, float, 1389) + RUN2 (uint8_t, float, 2048) + RUN2 (uint8_t, float, 3989) + RUN2 (uint8_t, float, 4096) + RUN2 (uint8_t, float, 5975) + + RUN (int8_t, double, 3) + RUN (int8_t, double, 4) + RUN (int8_t, double, 7) + RUN (int8_t, double, 99) + RUN (int8_t, double, 119) + RUN (int8_t, double, 128) + RUN (int8_t, double, 256) + RUN (int8_t, double, 279) + RUN (int8_t, double, 555) + RUN (int8_t, double, 1024) + RUN (int8_t, double, 1389) + RUN (int8_t, double, 2048) + RUN (int8_t, double, 3989) + RUN (int8_t, double, 4096) + RUN (int8_t, double, 5975) + + RUN2 (uint8_t, double, 3) + RUN2 (uint8_t, double, 4) + RUN2 (uint8_t, double, 7) + RUN2 (uint8_t, double, 99) + RUN2 (uint8_t, double, 119) + RUN2 (uint8_t, double, 128) + RUN2 (uint8_t, double, 256) + RUN2 (uint8_t, double, 279) + RUN2 (uint8_t, double, 555) + RUN2 (uint8_t, double, 1024) + RUN2 (uint8_t, double, 1389) + RUN2 (uint8_t, double, 2048) + RUN2 (uint8_t, double, 3989) + RUN2 (uint8_t, double, 4096) + RUN2 (uint8_t, double, 5975) + RUN (int16_t, float, 3) RUN (int16_t, float, 4) RUN (int16_t, float, 7) @@ -62,6 +126,38 @@ main () RUN2 (uint16_t, float, 4096) RUN2 (uint16_t, float, 5975) + RUN (int16_t, double, 3) + RUN (int16_t, double, 4) + RUN (int16_t, double, 7) + RUN (int16_t, double, 99) + RUN (int16_t, double, 119) + RUN (int16_t, double, 128) + RUN (int16_t, double, 256) + RUN (int16_t, double, 279) + RUN (int16_t, double, 555) + RUN (int16_t, double, 1024) + RUN (int16_t, double, 1389) + RUN (int16_t, double, 2048) + RUN (int16_t, double, 3989) + RUN (int16_t, double, 4096) + RUN (int16_t, double, 5975) + + RUN2 (uint16_t, double, 3) + RUN2 (uint16_t, double, 4) + RUN2 (uint16_t, double, 7) + RUN2 (uint16_t, double, 99) + RUN2 (uint16_t, double, 119) + RUN2 (uint16_t, double, 128) + RUN2 (uint16_t, double, 256) + RUN2 (uint16_t, double, 279) + RUN2 (uint16_t, double, 555) + RUN2 (uint16_t, double, 1024) + RUN2 (uint16_t, double, 1389) + RUN2 (uint16_t, double, 2048) + RUN2 (uint16_t, double, 3989) + RUN2 (uint16_t, double, 4096) + RUN2 (uint16_t, double, 5975) + RUN (int32_t, double, 3) RUN (int32_t, double, 4) RUN (int32_t, double, 7) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv32gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv32gcv.c index 898b9c17231..cf180992c5d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv32gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv32gcv.c @@ -3,5 +3,7 @@ #include "vfwcvt-itof-template.h" -/* { dg-final { scan-assembler-times {\tvfwcvt\.f\.x\.v} 3 } } */ +/* Conversions that the vectorizer does via multiple intermediate + types end up as signed conversions. */ +/* { dg-final { scan-assembler-times {\tvfwcvt\.f\.x\.v} 9 } } */ /* { dg-final { scan-assembler-times {\tvfwcvt\.f\.xu\.v} 3 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv64gcv.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv64gcv.c index e177b63738c..b1153887bd8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv64gcv.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-rv64gcv.c @@ -3,5 +3,7 @@ #include "vfwcvt-itof-template.h" -/* { dg-final { scan-assembler-times {\tvfwcvt\.f\.x\.v} 3 } } */ +/* Conversions that the vectorizer does via multiple intermediate + types end up as signed conversions. */ +/* { dg-final { scan-assembler-times {\tvfwcvt\.f\.x\.v} 9 } } */ /* { dg-final { scan-assembler-times {\tvfwcvt\.f\.xu\.v} 3 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-template.h index bd6d2387063..e78647f63a0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-template.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-template.h @@ -10,11 +10,17 @@ } #define TEST_ALL() \ + TEST (int8_t, _Float16) \ + TEST (uint8_t, _Float16) \ + TEST (int8_t, float) \ + TEST (uint8_t, float) \ + TEST (int8_t, double) \ + TEST (uint8_t, double) \ TEST (int16_t, float) \ TEST (uint16_t, float) \ + TEST (int16_t, double) \ + TEST (uint16_t, double) \ TEST (int32_t, double) \ TEST (uint32_t, double) \ - TEST (int8_t, _Float16) \ - TEST (uint8_t, _Float16) \ TEST_ALL () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-zvfh-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-zvfh-run.c index f89dc46d65f..15e33200f10 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-zvfh-run.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfwcvt-itof-zvfh-run.c @@ -37,9 +37,9 @@ main () RUN (int8_t, _Float16, 20) RUN (int8_t, _Float16, 27) - RUN (int8_t, _Float16, 4) - RUN (int8_t, _Float16, 8) - RUN (int8_t, _Float16, 11) - RUN (int8_t, _Float16, 29) - RUN (int8_t, _Float16, 49) + RUN (uint8_t, _Float16, 4) + RUN (uint8_t, _Float16, 8) + RUN (uint8_t, _Float16, 11) + RUN (uint8_t, _Float16, 29) + RUN (uint8_t, _Float16, 49) }