public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Icenowy Zheng <uwu@icenowy.me>
To: gcc-patches@gcc.gnu.org
Cc: Xi Ruoyao <xry111@xry111.site>,
	jit@gcc.gnu.org, Icenowy Zheng <uwu@icenowy.me>
Subject: [PATCH 1/2] LoongArch: respect the with values in config.gcc
Date: Fri,  9 Dec 2022 10:43:48 +0800	[thread overview]
Message-ID: <20221209024349.845948-2-uwu@icenowy.me> (raw)
In-Reply-To: <20221209024349.845948-1-uwu@icenowy.me>

In config.gcc, there's a long code snippet that handles
--with-{arch,tune,abi,fpu} and give them default values; however these
"with" values are not used at all.

Use these "with" values to initialize these variables in specs.

gcc/ChangeLog:

	* config/loongarch/loongarch.h (OPTION_DEFAULT_SPECS):
	New macro that simply injects configure --with values.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
---
 gcc/config/loongarch/loongarch.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index a402d3ba35a..5e2f4158f70 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -50,6 +50,17 @@ along with GCC; see the file COPYING3.  If not see
 /* Driver native functions for SPEC processing in the GCC driver.  */
 #include "loongarch-driver.h"
 
+/* Support for a compile-time default CPU, et cetera.  The rules are:
+   --with-arch is ignored if -march is specified.
+   --with-tune is ignored if -mtune is specified.
+   --with-abi is ignored if -mabi is specified.
+   --with-fpu is ignored if -mfpu is specified. */
+#define OPTION_DEFAULT_SPECS \
+  {"arch", "%{!march=*:-march=%(VALUE)}" }, \
+  {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
+  {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
+  {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}" }, \
+
 /* This definition replaces the formerly used 'm' constraint with a
    different constraint letter in order to avoid changing semantics of
    the 'm' constraint when accepting new address formats in
-- 
2.38.1


       reply	other threads:[~2022-12-09  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221209024349.845948-1-uwu@icenowy.me>
2022-12-09  2:43 ` Icenowy Zheng [this message]
2022-12-09  2:43 ` [PATCH 2/2] LoongArch: drop loongarch-driver Icenowy Zheng
2022-12-09  7:51 ` [PATCH 0/2] LoongArch: respect --with-* and " Xi Ruoyao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221209024349.845948-2-uwu@icenowy.me \
    --to=uwu@icenowy.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).