From patchwork Fri Jun 2 14:19:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 101274 Delivered-To: patch@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp216442obc; Fri, 2 Jun 2017 07:19:39 -0700 (PDT) X-Received: by 10.99.121.4 with SMTP id u4mr7460560pgc.167.1496413179339; Fri, 02 Jun 2017 07:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496413179; cv=none; d=google.com; s=arc-20160816; b=H/uU0OoHijutoTMdMIVXyTT4a5EeSFlNpeEE6HnQWZDVAET1542Yy+aZdeUljGFyRO NM+ubc03rgyhOuukLtFXgpiUdON18eUG4UW7nvG8vWLj8ZHsefKPlyOcQ1OtrXPJKpVa yGNAwUH2qifu6asAChUfZvMXEUCRhupCu+sOpMAPT/byvaKGs4Hm/h2foKpsU71U+wMy 4axQsvAjys5DqavEtWjImBehWEVHZUwYQXV/c0fWGMSorfuCH+tcTEBStG80U8zbN5zu O4E422ZyHceM+hPffmTiv4joTxzP4sfQw9K5RuqsXpAUhieKm7o8Vd2IUCgzWsWHXez/ iYVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=iuAT7THpc6ETepFmTfNvh0HduQ18aRCoqPpMCxxfBu0=; b=lovXDwfc5+2mtxVWf08J5qVtUt4RiH3i8Aps8SQRLHu5hqvbDuhHA1ied1tEz3Nnzc HTHstWsqDjkefMfrLU74XV4DgpJ3P5aShrVuIh53g8zCI5fSXTKldQ2xN1YGdNomXzv1 2eSoG/43NpkVCFpBhiXjAxHE6a9eejRMM6cTMr5zd/Fi7M6mbXzvfcRaorfVEFLjCIWf 6kRovzPjWPmfqEH0M+V351AYeQkGpuk3HGx8DUkJQJdR+OhN4IYmLxXx+oIhAXkLS+XB Xu/NOI6K8SMpsvkenksyVac6n6eTBeoKQj5NTs7UZ317CAbVL9B+yOxO5meTiPHlWBxg 26lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455041-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455041-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g2si10052102pgu.37.2017.06.02.07.19.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 07:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-455041-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455041-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455041-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=azz+rwJmjxKYnnsL/FIZGVHChEMDKvlbLO477FVHm+5gDE 8QKCHD1y7oRQgvUnwsBmYnRDb/j+wHhZxAGJYeyGq0OMpoF0UdQhbenvm5KNEYlt CeFTN7bDBLbvgaMQ0FBNOFGAK9DMBRoOSzto8rC4fdbSXW9tnC9d8LkmM5EIo= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=f+l/KfEpETLeJAWQfjVCOfq17z4=; b=wLL6jx1QTG1ZvM3ubdOy ftYLyerEi8vJqMFDvEnKZfBhMrobkvEfMWmsIboyDWYjIZYPREvyA7N/H6rDyim5 39h+4ZytrsLIzF6QABsY1A8ZtBThjLuxoSUb6BzB2Bt3Gt2AiYhcHTr19akf83yD 7NoCCRsyk5vipaLCBWE9IJ8= Received: (qmail 37187 invoked by alias); 2 Jun 2017 14:19:19 -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 37164 invoked by uid 89); 2 Jun 2017 14:19:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=1.6, sk:people X-HELO: mail-ua0-f170.google.com Received: from mail-ua0-f170.google.com (HELO mail-ua0-f170.google.com) (209.85.217.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Jun 2017 14:19:15 +0000 Received: by mail-ua0-f170.google.com with SMTP id y4so45564770uay.2 for ; Fri, 02 Jun 2017 07:19:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CSUApd/fWawjLubwtvTxS3tdTn5Ti7UVbJBFFKwgrds=; b=SwOj7x2ylAYcT3JYurulkuTTspMSTlX5tTf+LXrGlrrbw9JKpqmZOD8KJoS2IXOZzs nASLQIIH0lgLAH0h/Z9k1Tb5WzSR2sPuoZK9Q1lHIGS5c7FS2YMhp4KMBBeqEvDFYtHV y0h7fUqUm/fwWvwxB7Z+ps2FRFJQCEsGJcpSBdiSLo5cU6pGbD36j0wJDy1p1bBjjdvr CiXnEfP/iJjwNmKr6kKN6KQ/ihGQkTpaLOBelAEwAgIpIS2CVPNdlQCAOI1WVSDsf6rV DLymTz6a+DmL+xQFqdhDJwCb6MObYMsJ9bXI35+S9cdGiAxfH/QikocFUAL4xdoOy9vs ioHg== X-Gm-Message-State: AODbwcBG37vlMu8WTedCNNooMtv5Q+e7t03qTmwisL385AHRK9toBhzD yveyHZDdd1wse9+tdQIY5chSd7LxQwMAnUqttg== X-Received: by 10.159.60.82 with SMTP id w18mr1137479uah.19.1496413157315; Fri, 02 Jun 2017 07:19:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.45.5 with HTTP; Fri, 2 Jun 2017 07:19:16 -0700 (PDT) From: Christophe Lyon Date: Fri, 2 Jun 2017 16:19:16 +0200 Message-ID: Subject: [Patch, ARM, testsuite] Add -mfloat-abi=hard to arm_neon_ok To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes Hi, I have recently updated the dejagnu version I use for cross-testing arm and aarch64 toolchains to 1.6+. One of the side effects was mentioned by Jonathan in https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01267.html. Since I use multilibs to test many configurations, I noticed several changes in the results I get. In particular, on arm-none-linux-gnueabihf with -march=armv5t, all the tests that require arm_neon_ok fail to compile because they now use -march=armv5t -mfpu=neon -mfloat-abi=softfp -march=armv7-a, which leads to a failure to include gnu/stubs-soft.h (not present since the target is 'hf'). Previously, -march=armv5t was appended, making the tests unsupported because -mfpu=neon conflicts with -march=armv5t. Now, arm_neon_ok succeeds because it only checks if some preprocessor defines are present. This patch fixes that by including arm_neon.h in arm_neon_ok, such that it fails for unsupported cases. However, since most of these tests should pass instead of becoming unsupported, I have added flag combinations with -mfloat-abi=hard. However, this is not sufficient to make the gcc.target/arm/lto/pr65837* tests pass: they do not require arm_neon_ok, and when I tried to add it, they still failed because these lto tests do not support dg-add-options. My proposal is to add a new check_effective_target_arm_neon_ok_no_float_abi function which tries to use neon without trying to change the -mfloat-abi setting (that is, the same as arm_neon_ok, with only "" and "-mfpu=neon" in the list of flags) . This makes these two lto tests unsupported for non-hf targets (again because gnu/stubs-soft.h is not present). To make them pass on "hf" targets: - I added -mfpu=neon to dg-lto-options in pr65837-attr_0.c, because the fpu attributes in arm_neon.h only work if -mfpu=neon is enabled - I removed dg-suppress-ld-options {-mfpu=neon} from pr65837_0.c, -mfpu=neon is needed for the test to compile with toolchains where the default fpu is not neon (eg vfpv3-d16-fp16) On arm-none-linux-gnueabihf --with-cpu=cortex-a9 --with-fpu=vfp and multilib test flag=-march=armv5t, this patch brings: - 2 UNRESOLVED -> FAIL (gcc.dg/vect/vect-align-1.c) - 14 UNRESOLVED -> XPASS (in gcc.dg/vect/) - 2765 new PASS - 3639 FAIL -> PASS - 1826 UNRESOLVED -> PASS - 102 UNRESOLVED -> XFAIL as visible in the red cell at http://people.linaro.org/~christophe.lyon/cross-validation/gcc-test-patches/248552-gnu-stubs9.patch/report-build-info.html (the build-failed line can be ignored, it was caused by a server problem) Sorry, the explanation is almost longer than the patch :-) Is it OK for trunk? (Just realizing that I forgot to document the new functions :( ) Thanks, Christophe 2017-06-02 Christophe Lyon * lib/target-supports.exp (check_effective_target_arm_neon_ok_nocache): Add flags with -mfloat-abi=hard. Include arm_neon.h. (check_effective_target_arm_neon_ok_no_float_abi_nocache): New. (check_effective_target_arm_neon_ok_no_float_abi): New. * gcc.target/arm/lto/pr65837_0.c: Require arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options. * gcc.target/arm/lto/pr65837-attr_0.c: Require arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options. diff --git a/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c b/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c index ebc5f44..f00480b 100644 --- a/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c +++ b/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c @@ -1,6 +1,7 @@ /* { dg-lto-do run } */ /* { dg-require-effective-target arm_neon_hw } */ -/* { dg-lto-options {{-flto}} } */ +/* { dg-require-effective-target arm_neon_ok_no_float_abi } */ +/* { dg-lto-options {{-flto -mfpu=neon}} } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c b/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c index 6b2def9..5d7cea7 100644 --- a/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c +++ b/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c @@ -1,7 +1,7 @@ /* { dg-lto-do run } */ /* { dg-require-effective-target arm_neon_hw } */ +/* { dg-require-effective-target arm_neon_ok_no_float_abi } */ /* { dg-lto-options {{-flto -mfpu=neon}} } */ -/* { dg-suppress-ld-options {-mfpu=neon} } */ #include "arm_neon.h" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ded6383..720b10b 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3434,8 +3434,9 @@ proc check_effective_target_arm_neon_ok_nocache { } { global et_arm_neon_flags set et_arm_neon_flags "" if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a"} { + foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a" "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard -march=armv7-a"} { if { [check_no_compiler_messages_nocache arm_neon_ok object { + #include int dummy; #ifndef __ARM_NEON__ #error not NEON @@ -3460,6 +3461,38 @@ proc check_effective_target_arm_neon_ok { } { check_effective_target_arm_neon_ok_nocache] } +# Return 1 if this is an ARM target supporting -mfpu=neon without any +# -mfloat-abi= option. Useful in tests where add_options is not +# supported (such as lto tests). + +proc check_effective_target_arm_neon_ok_no_float_abi_nocache { } { + if { [check_effective_target_arm32] } { + foreach flags {"" "-mfpu=neon"} { + if { [check_no_compiler_messages_nocache arm_neon_ok_no_float_abi object { + #include + int dummy; + #ifndef __ARM_NEON__ + #error not NEON + #endif + /* Avoid the case where a test adds -mfpu=neon, but the toolchain is + configured for -mcpu=arm926ej-s, for example. */ + #if __ARM_ARCH < 7 || __ARM_ARCH_PROFILE == 'M' + #error Architecture does not support NEON. + #endif + } "$flags"] } { + return 1 + } + } + } + + return 0 +} + +proc check_effective_target_arm_neon_ok_no_float_abi { } { + return [check_cached_effective_target arm_neon_ok_no_float_abi \ + check_effective_target_arm_neon_ok_no_float_abi_nocache] +} + proc check_effective_target_arm_crc_ok_nocache { } { global et_arm_crc_flags set et_arm_crc_flags "-march=armv8-a+crc"