From patchwork Tue Jan 24 23:51:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 719458 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 3v7Q3Q5HQnz9sD6 for ; Wed, 25 Jan 2017 10:52:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qbKw4Uyh"; 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:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=aRrtaG7wJQAMMWSVoDC 8hHg1Tm2xOW3WusooFijRANa7IZ7j1gnmAYJ5ZRw8H55NRPH9pZ0U7oFMoRoykGl X8lpfbIoX1g04QIsskRltTUnin+XkQZ/3+Hx9ISh02Rqn5TzSlhAyMhnYqO3qEnS R2/PvzLJPDkacYEesAuZFigs= 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:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=aAX3SGnHHpuaeY9k7GYnbPnVd Uc=; b=qbKw4UyhKnaQqgy2ZGDcUDgpU5aqyu7jXLVU8Oxpcigjj9xoM7kRny4bV SM8Ei2qoFYuPEQHU4X43Za+wDJ4YJdPpTm+um9hJbSQQuMijCbx1PafR7wwN7qdf gz1AZhkSud5/YAxEWle3CUsNUWDv16bJBXb2R9KjsgDSVcp5rc= Received: (qmail 73582 invoked by alias); 24 Jan 2017 23:52:07 -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 73484 invoked by uid 89); 24 Jan 2017 23:52:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=arch_info, H*x:2.5.1, H*UA:2.5.1, arc700 X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jan 2017 23:51:58 +0000 Received: by mail-wm0-f44.google.com with SMTP id r144so3136888wme.1 for ; Tue, 24 Jan 2017 15:51:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=RxJK+1oBa33lMgJCZvncQjPdV7lI+UB4Iq3V+rw/AAg=; b=Obov9NpiZkziUpwqTS+jFnw6jNDBPLLct3hALL/SdGsWAWQslCCRQ+JN1AcjJGTKbn f9Mk901OBxXZgkQmah80+ziTm0MRfuwFLNPZgow+BsFZ+K1hbyoRr/ViTrHA2/5RdG8B xFDGAFNDn+KENee8bU36lG+gOuDXlVYK5ELMBPpbcWBwUoe5M4YJGwWEPuzifgVVNaHB gn86goMT2P77ak8igjQGlAxyO+DBz9VRpuDX8arMZBcfPf3bikWsrN/g3g1nrcTkVWx6 w2dk0s5z8i72GECCyl9YY92EARWtrb3i3Ii5pqWqMtAzHQMQOmFeek+ai2QJrYHnmg9p 5DEQ== X-Gm-Message-State: AIkVDXLiU+c67+yNM/zID9JsJl9zEMJHsXb9eh/xOIt4mPgddNYZuPRtZBjeYr8KqbmcOw== X-Received: by 10.28.150.202 with SMTP id y193mr21096857wmd.106.1485301916836; Tue, 24 Jan 2017 15:51:56 -0800 (PST) Received: from localhost (host81-151-161-49.range81-151.btcentralplus.com. [81.151.161.49]) by smtp.gmail.com with ESMTPSA id 36sm22081967wrz.8.2017.01.24.15.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 15:51:55 -0800 (PST) From: Andrew Burgess To: gcc-patches@gcc.gnu.org Cc: Claudiu.Zissulescu@synopsys.com, Andrew Burgess Subject: [PATCH 2/2] ARC: Better creation of __NPS400__ define Date: Tue, 24 Jan 2017 23:51:44 +0000 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes The __NPS400__ define is currently created in CPP_SPEC unlike the other target defines, which are created in arc-c.def. Further, the current __NPS400__ define is (currently) only created when -mcpu=nps400 is passed, which is fine, except that if GCC is configured using --with-cpu=nps400 then the -mcpu option is not required and the __NPS400__ define will not be created. This commit moves the __NPS400__ define into arc-c.def inline with all of the other target defines, and removes the code in CPP_SPEC that used to create the define. In order to support the creation of the define in arc-c.def, a new TARGET_NPS400 macro is created in arc.h. gcc/ChangeLog: * config/arc/arc-c.def: Add __NPS400__ definition. * config/arc/arc.h (CPP_SPEC): Don't define __NPS400__ here. (TARGET_NPS400): Define. --- gcc/ChangeLog | 6 ++++++ gcc/config/arc/arc-c.def | 1 + gcc/config/arc/arc.h | 9 +++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/arc-c.def b/gcc/config/arc/arc-c.def index 4903d84..8c5097e 100644 --- a/gcc/config/arc/arc-c.def +++ b/gcc/config/arc/arc-c.def @@ -20,6 +20,7 @@ ARC_C_DEF ("__ARC600__", TARGET_ARC600) ARC_C_DEF ("__ARC601__", TARGET_ARC601) ARC_C_DEF ("__ARC700__", TARGET_ARC700) +ARC_C_DEF ("__NPS400__", TARGET_NPS400) ARC_C_DEF ("__ARCEM__", TARGET_EM) ARC_C_DEF ("__ARCHS__", TARGET_HS) ARC_C_DEF ("__ARC_ATOMIC__", TARGET_ATOMIC) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index d6d9012..e269b4d 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -92,8 +92,7 @@ along with GCC; see the file COPYING3. If not see %{mmac-d16:-D__Xxmac_d16} %{mmac-24:-D__Xxmac_24} \ %{mdsp-packa:-D__Xdsp_packa} %{mcrc:-D__Xcrc} %{mdvbf:-D__Xdvbf} \ %{mtelephony:-D__Xtelephony} %{mxy:-D__Xxy} %{mmul64: -D__Xmult32} \ -%{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc} \ -%{mcpu=nps400:-D__NPS400__}" +%{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc}" #define CC1_SPEC "\ %{EB:%{EL:%emay not use both -EB and -EL}} \ @@ -223,6 +222,12 @@ extern const char *arc_cpu_to_as (int argc, const char **argv); && (!TARGET_BARREL_SHIFTER)) #define TARGET_ARC700 (arc_selected_cpu->arch_info->arch_id \ == BASE_ARCH_700) +/* An NPS400 is a specialisation of ARC700, so it is correct for NPS400 + TARGET_ARC700 is true, and TARGET_NPS400 is true. */ +#define TARGET_NPS400 ((arc_selected_cpu->arch_info->arch_id \ + == BASE_ARCH_700) \ + && (arc_selected_cpu->processor \ + == PROCESSOR_nps400)) #define TARGET_EM (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_em) #define TARGET_HS (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_hs) #define TARGET_V2 (TARGET_EM || TARGET_HS)