From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2063) id 23DDF3858CDB; Fri, 30 Sep 2022 12:18:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23DDF3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664540306; bh=x6eenidIKDXSv9Sejdp8XJonmFt57Lu+Lpta2gwH6HA=; h=From:To:Subject:Date:From; b=uwnYXsybadZKYCrBrJ4SSVwWEv3PeXTKhxN1HJX/jC3nW1eGrZU9oTeBoKr6mVmD6 TgnE8j8qnRcg2YpWPYeGwul+DPuKOriIWKT6A1uE/1coFxH9T2LMQmYuHgjPkGIO6D aCqR96WdbJQ5JOdyr6ApykZEbR2iM8B1kl5pEm5o= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kewen Lin To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2983] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516] X-Act-Checkin: gcc X-Git-Author: Kewen Lin X-Git-Refname: refs/heads/master X-Git-Oldrev: c09663eabfb84ac56ddd8d44abcab3f4902c83bd X-Git-Newrev: c28957176dc0adff6e4b8fcbe6b91f5b82900563 Message-Id: <20220930121826.23DDF3858CDB@sourceware.org> Date: Fri, 30 Sep 2022 12:18:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c28957176dc0adff6e4b8fcbe6b91f5b82900563 commit r13-2983-gc28957176dc0adff6e4b8fcbe6b91f5b82900563 Author: Kewen Lin Date: Fri Sep 30 07:16:36 2022 -0500 rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516] As PR106516 shows, we can get unexpected gimple outputs for function thud on some target which supports modulus operation for vector int. This patch introduces one effective target vect_int_mod for it, then adjusts the test case with it. PR testsuite/106516 gcc/testsuite/ChangeLog: * gcc.dg/pr104992.c: Adjust with vect_int_mod. * lib/target-supports.exp (check_effective_target_vect_int_mod): New effective target. Diff: --- gcc/testsuite/gcc.dg/pr104992.c | 3 ++- gcc/testsuite/lib/target-supports.exp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c index 217c89a458c..82f8c75559c 100644 --- a/gcc/testsuite/gcc.dg/pr104992.c +++ b/gcc/testsuite/gcc.dg/pr104992.c @@ -54,4 +54,5 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) { return x / y * z == x; } -/* { dg-final {scan-tree-dump-times " % " 9 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */ +/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2a2dd05db1e..0a959c63c4a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8263,6 +8263,14 @@ proc check_effective_target_vect_long_mult { } { return $answer } +# Return 1 if the target supports vector int modulus, 0 otherwise. + +proc check_effective_target_vect_int_mod { } { + return [check_cached_effective_target_indexed vect_int_mod { + expr { [istarget powerpc*-*-*] + && [check_effective_target_has_arch_pwr10] }}] +} + # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. proc check_effective_target_vect_extract_even_odd { } {