From: Michael Meissner <meissner@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Michael Meissner <meissner@linux.ibm.com>,
gcc-patches@gcc.gnu.org, dje.gcc@gmail.com
Subject: Re: [PATCH, V3, #5 of 10], Make -mpcrel default on little endian Linux systems
Date: Tue, 03 Sep 2019 21:07:00 -0000 [thread overview]
Message-ID: <20190903210652.GB6369@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <20190830183257.GR31406@gate.crashing.org>
On Fri, Aug 30, 2019 at 01:32:57PM -0500, Segher Boessenkool wrote:
> On Mon, Aug 26, 2019 at 05:07:25PM -0400, Michael Meissner wrote:
> > +/* By default enable support for pc-relative and numeric prefixed addressing on
> > + the 'future' system, unless it is overriden at build time. */
> > +#ifndef TARGET_PREFIXED_ADDR_DEFAULT
> > +#define TARGET_PREFIXED_ADDR_DEFAULT 1
> > +#endif
> > +
> > +#if !defined (TARGET_PCREL_DEFAULT) && TARGET_PREFIXED_ADDR_DEFAULT
> > +#define TARGET_PCREL_DEFAULT 1
> > +#endif
>
> Spelling ("overridden").
>
> How can it be overridden at build time?
>
> How can it be defined already, when linux64.h is included? Don't put in
> guards against things that cannot happen.
You can define TARGET_PREFIXED_ADDR_DEFAULT or TARGET_PCREL_DEFAULT in your
CFLAGS or via the make command line (which is how I tested it).
>
> > + if (TARGET_FUTURE)
> > + {
> > + bool explicit_prefixed = ((rs6000_isa_flags_explicit
> > + & OPTION_MASK_PREFIXED_ADDR) != 0);
> > + bool explicit_pcrel = ((rs6000_isa_flags_explicit
> > + & OPTION_MASK_PCREL) != 0);
> > +
> > + /* Prefixed addressing requires 64-bit registers. */
>
> Does it? Don't disable things just because you do not want to think
> about if and how to support them. Be much more exact in the comment here
> if you do have a reason to disable it here.
>
> > + if (!TARGET_POWERPC64)
> > + {
> > + if (TARGET_PCREL && explicit_pcrel)
> > + error ("%qs requires %qs", "-mpcrel", "-m64");
>
> TARGET_POWERPC64 is -mpowerpc64. -m64 is TARGET_64BIT.
>
> > + /* Enable defaults if desired. */
> > + else
> > + {
> > + if (!explicit_prefixed
> > + && (TARGET_PREFIXED_ADDR_DEFAULT
> > + || TARGET_PCREL
> > + || TARGET_PCREL_DEFAULT))
> > + rs6000_isa_flags |= OPTION_MASK_PREFIXED_ADDR;
> > +
> > + if (!explicit_pcrel && TARGET_PCREL_DEFAULT
> > + && TARGET_CMODEL == CMODEL_MEDIUM)
> > + rs6000_isa_flags |= OPTION_MASK_PCREL;
> > + }
>
> Should these be the other way around?
I'm not sure I follow the question. You want to enable pc-relative support if
prefixed addressing support is enabled, and the OS says that it supports
pc-relative addressing.
If you previously disabled prefixed addressing, you can't enable pc-relative by default.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797
next prev parent reply other threads:[~2019-09-03 21:07 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 19:21 PowerPC future machine, version 3 Michael Meissner
2019-08-26 20:41 ` [PATCH V3, #1 of 10], Add basic pc-relative support Michael Meissner
2019-08-28 18:46 ` Segher Boessenkool
2019-08-28 21:48 ` Michael Meissner
2019-08-30 0:08 ` Segher Boessenkool
2019-09-06 0:18 ` Michael Meissner
2019-09-06 12:50 ` Segher Boessenkool
2019-09-09 20:28 ` Michael Meissner
2019-08-26 21:07 ` [PATCH, V3, #3 of 10], Add prefixed RTL insn attribute Michael Meissner
2019-08-30 1:58 ` Segher Boessenkool
2019-08-26 21:12 ` [PATCH, V3, #2 of 10], Improve rs6000_setup_addr_mask Michael Meissner
2019-08-29 2:59 ` Segher Boessenkool
2019-08-26 21:23 ` [PATCH, V3, #4 of 10], Add general prefixed/pcrel support Michael Meissner
2019-08-30 19:22 ` Segher Boessenkool
2019-08-31 3:08 ` Alan Modra
2019-08-31 14:13 ` Segher Boessenkool
2019-08-26 21:43 ` [PATCH, V3, #5 of 10], Make -mpcrel default on little endian Linux systems Michael Meissner
2019-08-30 19:46 ` Segher Boessenkool
2019-09-03 21:07 ` Michael Meissner [this message]
2019-09-03 22:25 ` Segher Boessenkool
2019-08-26 21:52 ` [PATCH, V3, #6 of 10], Fix vec_extract breakage Michael Meissner
2019-09-03 19:49 ` Segher Boessenkool
2019-09-05 20:48 ` Michael Meissner
2019-09-05 22:38 ` Segher Boessenkool
2019-09-06 10:26 ` Segher Boessenkool
2019-08-26 22:06 ` [PATCH, V3, #7 of 10], Implement PCREL_OPT relocation optimization Michael Meissner
2019-08-28 21:48 ` Michael Meissner
2019-09-03 22:56 ` Segher Boessenkool
2019-09-03 23:20 ` Michael Meissner
2019-09-03 23:33 ` Segher Boessenkool
2019-09-04 17:26 ` Michael Meissner
2019-09-06 12:09 ` Segher Boessenkool
2019-09-09 20:32 ` Michael Meissner
2019-09-09 20:56 ` Segher Boessenkool
2019-09-09 22:39 ` Michael Meissner
2019-08-27 7:01 ` [PATCH, V3, #8 of 10], Miscellaneous prefixed addressing tests Michael Meissner
2019-09-03 23:17 ` Segher Boessenkool
2019-09-05 21:01 ` Michael Meissner
2019-09-05 22:57 ` Segher Boessenkool
2019-08-27 7:14 ` [PATCH, V3, #10 of #10], Pc-relative tests Michael Meissner
2019-08-27 7:55 ` [PATCH, V3, #9 of 10], Prefixed addressing tests with large offsets Michael Meissner
2019-09-03 23:22 ` Segher Boessenkool
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=20190903210652.GB6369@ibm-toto.the-meissners.org \
--to=meissner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
/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).