From patchwork Wed Feb 17 16:06:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 584210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 EDB9314018C for ; Thu, 18 Feb 2016 03:06:22 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=X33qERu8; dkim-atps=neutral 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:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=OSYu9nGePYLaZ77xvbs7Y3o2s15OxtI9+yxlsSyfW1g uhB4WdrjGjepz9H/xk7xAaJbiqy+XZDQZK4XLsD5WIfglxBsXKnicpoBA3xwnYwc hmxQNyUuagZzWoNRs6oDY/C0t8OKgDmc1mvUbxWwz05rHZJwY8zq5BaoGsnczlR4 = 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:date:from:mime-version:to:cc:subject:content-type; s=default; bh=UmKgf2ZRazWDJjbQkU0XxNccAFs=; b=X33qERu85isEsf4WV Jv9hhlBtHq0xv+kiVNmPxNfivglG9PK9sp3GdScl0G83iZIPrXLFlR74woWp4d7L 6S/ehoofv6O9JGgYwVGgbsj0jXpID41S5rerhTbfRA7OSnz0KQiB+E3oFqPfXwMq lV8H9RPQ3hNeeCylZPVN+GzHnQ= Received: (qmail 24813 invoked by alias); 17 Feb 2016 16:06:13 -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 24773 invoked by uid 89); 17 Feb 2016 16:06:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=FUNC, H*u:31.2.0, H*UA:31.2.0 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Feb 2016 16:06:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 00EE23A1; Wed, 17 Feb 2016 08:05:20 -0800 (PST) Received: from [10.2.206.200] (e100706-lin.cambridge.arm.com [10.2.206.200]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E0A93F246; Wed, 17 Feb 2016 08:06:09 -0800 (PST) Message-ID: <56C49A6F.9010604@foss.arm.com> Date: Wed, 17 Feb 2016 16:06:07 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: James Greenhalgh , Christophe Lyon Subject: [PATCH][AArch64][v2] Skip gcc.target/aarch64/assembler_arch_1.c if assembler does not support it Hi all, I've thought about this check a bit more and I think we can compactly auto-generate checks for any aarch64 architecture extension support in the assembler. This is done in a similar way we autogenerate the arm_arch_*_ok checks for arm. So in this revision we autogenerate aarch64_asm__ok checks for every architecture extension using some of the expect machinery. This should make this approach a bit more general to handle checks for any .arch_extension argument without much extra cost. This still assumes that the assembler supports the .arch_extension pseudo-op, the effective target check will fail if it doesn't. This is what we want for this testcase. Is this patch ok instead of https://gcc.gnu.org/ml/gcc-patches/2016-02/msg01052.html ? Thanks, Kyrill 2016-02-17 Kyrylo Tkachov * lib/target-supports.exp: Define aarch64_asm_FUNC_ok checks for fp, simd, crypto, crc, lse. * doc/sourcebuild.texi (AArch64-specific attributes): Document the above. * gcc.target/aarch64/assembler_arch_1.c: Add aarch64_asm_lse_ok effective target check. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 6d548aad7aa24c59b40ec13d9c99733d94ec0aa6..19fd938afff9bb480e2262d07ce5c8ff9ca167c7 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1606,6 +1606,10 @@ ARM target prefers @code{LDRD} and @code{STRD} instructions over @subsubsection AArch64-specific attributes @table @code +@item aarch64_asm__ok +AArch64 assembler supports the architecture extension @code{ext} via the +@code{.arch_extension} pseudo-op. The values of @code{ext} are defined in +the file config/aarch64/aarch64-option-extensions.def. @item aarch64_tiny AArch64 target which generates instruction sequences for tiny memory model. @item aarch64_small diff --git a/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c index 901e50a178d7a4a443a5ad0abe63f624688db268..5deea5cf0ee9306743bc47bace6f762d0e35ce65 100644 --- a/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c +++ b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c @@ -1,4 +1,5 @@ /* { dg-do assemble } */ +/* { dg-require-effective-target aarch64_asm_lse_ok } */ /* { dg-options "-march=armv8-a" } */ /* Make sure that the function header in assembly doesn't override diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 66fb1eaf7bd4aa58d23cfc9203e9f27573c7a303..f399f185d25aa5a947b7a17fd6020dc311b18f58 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6719,6 +6719,23 @@ proc check_effective_target_aarch64_tiny { } { } } +# Create functions to check that the AArch64 assembler supports the +# various architecture extensions via the .arch_extension pseudo-op. + +foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse"} { + eval [string map [list FUNC $aarch64_ext] { + proc check_effective_target_aarch64_asm_FUNC_ok { } { + if { [istarget aarch64*-*-*] } { + return [check_no_compiler_messages aarch64_lse_assembler object { + __asm__ (".arch_extension FUNC"); + } "-march=armv8-a+FUNC"] + } else { + return 0 + } + } + }] +} + proc check_effective_target_aarch64_small { } { if { [istarget aarch64*-*-*] } { return [check_no_compiler_messages aarch64_small object {