From patchwork Sun Sep 13 17:06:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 517206 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 D85D6140129 for ; Mon, 14 Sep 2015 03:12:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=I88NHMUN; 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=mqg4VH/0lN0Et1z3 BAEjSIvIs4khPBUhB8EJBsL8psi3NQOHccfKWCC660XXRs5tVcgiyJQvCjCacsp6 +cq4xlohkGEjq1M2oLt6royFbVBo7DKu6zSJWanB6LrLoGjsU3q5CHykVJMCIqNT D/lWZYpfqVaToCjTDVT0Wjq1OSo= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=iSl5fo4mAXhiJucpi9LjOX xih80=; b=I88NHMUNg0amirC+mHqAZcyD/+VAh1ShUQJhSVCXFgFhGohUpVzDqk O8urR7SEhqGT4/+yd2W35OhCnJvhRraVXcTwGNknJQOWhHzvXwVfApkuzl3m39XV B/1wN2QwWY/wlJWvJc0zvHFhc2qJFd2kVUneSA323MpGHRSlywwA8= Received: (qmail 38122 invoked by alias); 13 Sep 2015 17:11:53 -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 38108 invoked by uid 89); 13 Sep 2015 17:11:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 13 Sep 2015 17:11:51 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6834629D20FE for ; Sun, 13 Sep 2015 19:11:47 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jRRkX3RlkCVH for ; Sun, 13 Sep 2015 19:11:47 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 4376B29D20EC for ; Sun, 13 Sep 2015 19:11:47 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [visium] Add --with-cpu configure option Date: Sun, 13 Sep 2015 19:06:41 +0200 Message-ID: <2251670.atQs9368ZD@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 Self-explanatory, tested on visium-elf, applied on the mainline. 2015-09-13 Olivier Hainque Eric Botcazou * config.gcc (visium-*-*): Enable --with-cpu option, accept gr5 and gr6 as possible values, defaulting to gr5. Set target_cpu_default2. * config/visium/visium.h (OPTION_DEFAULT_SPECS): Define. (TARGET_CPU_gr5): Likewise. (TARGET_CPU_gr6): Likewise. (MULTILIB_DEFAULTS): Likewise. * config/visium/t-visium (MULTILIB_OPTIONS): Request distinct variants for mcpu=gr5 and mcpu=gr6. (MULTILIB_DIRNAMES): Adjust accordingly. Index: config.gcc =================================================================== --- config.gcc (revision 227628) +++ config.gcc (working copy) @@ -3346,6 +3346,9 @@ if test x$with_cpu = x ; then ;; esac ;; + visium-*-*) + with_cpu=gr5 + ;; esac # Avoid overriding --with-cpu-32 and --with-cpu-64 values. @@ -4295,6 +4298,16 @@ case "${target}" in ;; esac ;; + visium-*-*) + supported_defaults="cpu" + case $with_cpu in + "" | gr5 | gr6) + ;; + *) echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2 + exit 1 + ;; + esac + ;; esac # Set some miscellaneous flags for particular targets. @@ -4449,6 +4462,9 @@ case ${target} in ;; esac ;; + visium-*-*) + target_cpu_default2="TARGET_CPU_$with_cpu" + ;; esac t= Index: config/visium/visium.h =================================================================== --- config/visium/visium.h (revision 227628) +++ config/visium/visium.h (working copy) @@ -1735,3 +1735,19 @@ extern int visium_indent_opcode; visium_indent_opcode = 0; \ } \ } while (0) + +/* Configure-time default values for common options. */ +#define OPTION_DEFAULT_SPECS { "cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" } + +/* Values of TARGET_CPU_DEFAULT specified via --with-cpu. */ +#define TARGET_CPU_gr5 0 +#define TARGET_CPU_gr6 1 + +/* Default -mcpu multilib for above values. */ +#if TARGET_CPU_DEFAULT == TARGET_CPU_gr5 +#define MULTILIB_DEFAULTS { "mcpu=gr5" } +#elif TARGET_CPU_DEFAULT == TARGET_CPU_gr6 +#define MULTILIB_DEFAULTS { "mcpu=gr6" } +#else +#error Unrecognized value in TARGET_CPU_DEFAULT +#endif Index: config/visium/t-visium =================================================================== --- config/visium/t-visium (revision 227628) +++ config/visium/t-visium (working copy) @@ -17,5 +17,7 @@ # along with GCC; see the file COPYING3. If not see # . -MULTILIB_OPTIONS = mcpu=gr6 -MULTILIB_DIRNAMES = gr6 +# The compiler defaults to -mcpu=gr5 but this may be overridden via --with-cpu +# at configure time so the -mcpu setting must be symmetrical. +MULTILIB_OPTIONS = mcpu=gr5/mcpu=gr6 +MULTILIB_DIRNAMES = gr5 gr6