From patchwork Tue Feb 25 23:02:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 1244560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-520122-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=KmxAaUSI; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48RvZz2W2tz9sPR for ; Wed, 26 Feb 2020 10:02:18 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; q=dns; s=default; b=VN5V902YM+FvRRXy bjrYK06OD+M/5W2woLEWIRD1xZEizjdSHIGBAynrX/gcQ8lwMyB7VDXm4XG1WPRu hQsIJHmGSxzBITISbtF31/5eAuLbbySSJlYbeAMeLSCXMuZWw3DCVULGxUF4R5h3 pz1U2sxM/157voRL/1luehxkLyA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; s=default; bh=wou0VCytK5zRwLPai1A7sJ 2vX8s=; b=KmxAaUSI/M7n94cXd71S6tDqpf3P0ApdBIxAaMpEplLrOQLXeZKq1m xZeYWkAG+dGApkJPtwHT8KHiKE/X0txILNAAkpn6fOhHlK3VrN5IQfcWfExHDzdt HIcZ2naWppYVVYx73tss2tu4DdqkkZR6TuoGWEfc0DQ4fb5T6JNj8= Received: (qmail 122591 invoked by alias); 25 Feb 2020 23:02:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 122583 invoked by uid 89); 25 Feb 2020 23:02:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 23:02:10 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01PMoSY0044337; Tue, 25 Feb 2020 18:02:09 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ydcqv8arj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2020 18:02:08 -0500 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 01PMqQ3D048634; Tue, 25 Feb 2020 18:02:08 -0500 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ydcqv8aqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2020 18:02:08 -0500 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01PN1Ck8016301; Tue, 25 Feb 2020 23:02:07 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma05wdc.us.ibm.com with ESMTP id 2ydcmkg4kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2020 23:02:07 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01PN26In53936436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Feb 2020 23:02:07 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDC19B2067; Tue, 25 Feb 2020 23:02:06 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E9E2B205F; Tue, 25 Feb 2020 23:02:06 +0000 (GMT) Received: from brimstone.rchland.ibm.com (unknown [9.10.86.107]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 25 Feb 2020 23:02:06 +0000 (GMT) Message-ID: Subject: PowerPC Add has_arch_pwr* checks From: will schmidt To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool , Bill Schmidt , David Edelsohn Date: Tue, 25 Feb 2020 17:02:06 -0600 Mime-Version: 1.0 X-IsSubscribed: yes PowerPC Add has_arch_pwr* checks Hi, This adds some procs to target-supports.exp that will allow our testcases to accurately determine which -mcpu= option is enabled at the time of our testcase compile. For completeness I've added blobs to cover the ARCH_PWR5 through ARCH_PWR9 targets. With this in place, the existing pr92132-fp-1.c testcase is updated with a target check such that it now passes reliably on targets that include power8 support, and skips (unsupported) those that do not. Tested on assorted powerpc targets with the incantation make -k check-gcc-c "RUNTESTFLAGS=powerpc.exp=pr92132-fp-1*.c --target_board=unix/'{-mcpu=power5,-mcpu=power6,-mcpu=power7, -mcpu=power8,-mcpu=power9}''{-m32,-m64}'" OK for master? Thanks -Will testsuite/ 2020-02-25 Will Schmidt * lib/target_supports.exp (check_effective_target_has_arch_pwr5): New. (check_effective_target_has_arch_pwr6): New. (check_effective_target_has_arch_pwr7): New. (check_effective_target_has_arch_pwr8): New. (check_effective_target_has_arch_pwr9): New. * gcc.target/powerpc/pr92132-fp-1.c: Add target check. diff --git a/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c b/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c index 1023e8c..c5cbb62 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c +++ b/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c @@ -292,6 +292,6 @@ main (void) abort (); return 0; } -/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 14 "vect" } } */ +/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 14 "vect" { target has_arch_pwr8 } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ec46231..038a7bb 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5505,10 +5505,58 @@ proc check_effective_target_powerpc_p9modulo_ok { } { } else { return 0 } } +# return 1 if our compiler returns the ARCH_PWR defines with the options +# as provided by the test. +proc check_effective_target_has_arch_pwr5 { } { + return [check_no_compiler_messages arch_pwr5 assembly { + #ifndef _ARCH_PWR5 + #error does not have power5 support. + #else + /* "has power5 support" */ + #endif + }] +} +proc check_effective_target_has_arch_pwr6 { } { + return [check_no_compiler_messages arch_pwr6 assembly { + #ifndef _ARCH_PWR6 + #error does not have power6 support. + #else + /* "has power6 support" */ + #endif + }] +} +proc check_effective_target_has_arch_pwr7 { } { + return [check_no_compiler_messages arch_pwr7 assembly { + #ifndef _ARCH_PWR7 + #error does not have power7 support. + #else + /* "has power7 support" */ + #endif + }] +} +proc check_effective_target_has_arch_pwr8 { } { + return [check_no_compiler_messages arch_pwr8 assembly { + #ifndef _ARCH_PWR8 + #error does not have power8 support. + #else + /* "has power8 support" */ + #endif + }] +} +proc check_effective_target_has_arch_pwr9 { } { + return [check_no_compiler_messages arch_pwr9 assembly { + #ifndef _ARCH_PWR9 + #error does not have power9 support. + #else + /* "has power9 support" */ + #endif + }] +} + # Return 1 if this is a PowerPC target supporting -mfuture. # Limit this to 64-bit linux systems for now until other # targets support FUTURE. proc check_effective_target_powerpc_future_ok { } {