From patchwork Wed Dec 20 10:28:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 851355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-469643-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NeniMPAt"; 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 3z1rbR3wWZz9s74 for ; Wed, 20 Dec 2017 21:28:50 +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:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=O6FOG4ZP/QNAjFvfORKH2EYTiIXwtxrPvTZFlf8qiKUsgH wKdoLODx7pordOmzRBXJjcRE9770rpi0yjHuDwXNZrYhwzopW/4IMfoUeECuxq98 3vk62Nhxezmx959e06Xg7qSd7E+cEPHbLxLLbl7PQZrHMOK2BRa4BVxUgfn9o= 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:subject:content-type; s= default; bh=ZltOn/g69QPLVo4iVHbWls5ueiA=; b=NeniMPAtJDYmlJ7rG7UG GlxezmqOmPwNCsmjhiYNYOkFbzEAkDIDJVETBncXQR2FVCRNixAmaSqcPBEQ16J9 61AgUEoni9E1XOgF7jdTEjo2S1SIN41rQSiLXXX4+PfYKgZF4BaBpIjHqgCXRkid xNBq/7kqF2/UaX5Ty2hA4BU= Received: (qmail 113894 invoked by alias); 20 Dec 2017 10:28:33 -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 113833 invoked by uid 89); 20 Dec 2017 10:28:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Dec 2017 10:28:31 +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 46E0E15A2; Wed, 20 Dec 2017 02:28:23 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C4AD43F41F; Wed, 20 Dec 2017 02:28:22 -0800 (PST) Message-ID: <5A3A3B45.8000306@foss.arm.com> Date: Wed, 20 Dec 2017 10:28:21 +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@gcc.gnu.org" , libstdc++@gcc.gnu.org Subject: [PATCH][aarch64][libstdc++] Use __ARM_BIG_ENDIAN instead of __AARCH64EB__ in opt_random.h Hi all, As has been spotted at https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01289.html we check the __AARCH64EB__ macro for aarch64 big-endian detection in config/cpu/aarch64/opt/ext/opt_random.h. That works just fine with GCC but the standardised ACLE[1] macro for that purpose is __ARM_BIG_ENDIAN so there is a possibility that non-GCC compilers that include this header are not aware of this predefine. So this patch changes the use of __AARCH64EB__ to the more portable __ARM_BIG_ENDIAN. Tested on aarch64-none-elf and aarch64_be-none-elf. Preapproved by Jeff at https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01326.html Committed to trunk. Thanks, Kyrill [1] https://static.docs.arm.com/ihi0053/c/IHI0053C_acle_2_0.pdf 2017-12-20 Kyrylo Tkachov * config/cpu/aarch64/opt/ext/opt_random.h (__VEXT): Check __ARM_BIG_ENDIAN instead of __AARCH64EB__. commit acf0abfe3d166df053ca81840fbe29f4eac72b38 Author: Kyrylo Tkachov Date: Tue Dec 19 18:45:01 2017 +0000 [aarch64][libstdc++] Use __ARM_BIG_ENDIAN instead of __AARCH64EB__ in opt_random.h diff --git a/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h index 330050f..7c82480 100644 --- a/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h +++ b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h @@ -34,7 +34,7 @@ #ifdef __ARM_NEON -#ifdef __AARCH64EB__ +#ifdef __ARM_BIG_ENDIAN # define __VEXT(_A,_B,_C) __builtin_shuffle (_A, _B, (__Uint8x16_t) \ {16-_C, 17-_C, 18-_C, 19-_C, 20-_C, 21-_C, 22-_C, 23-_C, \ 24-_C, 25-_C, 26-_C, 27-_C, 28-_C, 29-_C, 30-_C, 31-_C})