public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@redhat.com>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: gcc-patches@gcc.gnu.org, binutils@sources.redhat.com
Subject: Re: RFC & patch: Rework MIPS command-line handling
Date: Tue, 16 Jul 2002 02:40:00 -0000	[thread overview]
Message-ID: <wvnd6to9g2s.fsf@talisman.cambridge.redhat.com> (raw)
In-Reply-To: <20020715175419.GA16056@rembrandt.csv.ica.uni-stuttgart.de>

Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> Richard Sandiford wrote:
> > > GCC and GAS have different requirements: For GCC it's sensible to guess
> > > ISA from ABI and vice versa because it usually handles ABI-conforming
> > > code. For GAS, the ABI selection is not that useful because assembly
> > > normally isn't ABI-conformant (which would be limited to opcodes covered
> > > in the respective ISA).
> > 
> > I agree that might be true for embedded configs.  But like Maciej
> > said, it could be useful to have a default ABI for hosted toolchains
> > like mips64-linux-gnu.  It seems reasonable that anyone using such
> > an assembler would be at least try to write ABI-conformant code.
> 
> I don't know about embedded configs. Just have a look at the linux
> kernel. I claim it has nearly no assembly code which could be written
> in an ABI-conformant way, with few performance improvements in assembly
> as an exception.
>
> Having a default ABI is IMHO a good thing in any case: For userland
> code the ABI conformance is essential, and for kernels/embedded configs
> the ABI can provide the default settings which may get overridden then.

I'm still not sure what you're suggesting should be done in the
kernel case.

> > So the way the GAS config stuff is structured, it will assume NO_ABI
> > by default, since that seems sensible for most embedded configs,
> > and won't lead to spurious "incompatible ABI" link failures.
> 
> Spurious? With some likeliness these are real incompatibilities.

Sure, it could catch real incompatibilities, but it could generate
false positives too.  My point is that, before now, there has been
no default ABI assumption for "mips-elf-as", either invoked directly,
or through the GCC driver.  It hasn't been necessary to think about
ABI flags when assembling (to pick a trivial example):

version:
        .asciz "version (2.10)"

I'm not saying it's necessarily bad to have a default ABI for all
configs, but I just feel that some users might think we're being
a bit too pedantic.

> I heard
> 
> 	mips64-elf-gcc -march=FOO -mlong64
> 
> is used in the embedded world to get 64 bit code and allow FOO's
> opcodes in it. Selecting an ABI definition automatically for e.g.
> FOO == r4000 while keeping "No ABI" for FOO == r5000 would be
> at least surprising.

There isn't a "no ABI" mode in GCC as such.  What we have is ad-hoc
variations on the real ABIs.  So mips64-elf-gcc is o64 by default.
If you specify -mlong64, gcc generates a "long64" version of o64
code (mips_abi == ABI_O64, TARGET_LONG64).  Specifying a 64-bit FOO
would not change the ABI at all wrt just "mips64-elf-gcc -mlong64".

After the patch I sent, specifying a 32-bit FOO would switch to o32,
but you'd get gcc's "long64" version of o32 (just as you would with
"mips-elf-gcc -mlong64").

> > One of the changes was that the default float register size would
> > be worked out from -mgp32, -mgp64, -msingle-float, etc.  That was
> > mostly for multilib convenience.
> 
> For embedded use, I assume. For hosted systems this should be done
> by the ABI.

Well, -mabi isn't the only GCC option that changes the ABI.  At the
moment, you need -mgp32 to select between 32-bit and 64-bit code when
an EABI is selected.  And we have the -msingle-float variations too.
For example:

  -mgp32 -mabi=eabi                     => -mfp32
  -mgp64 -mabi=eabi                     => -mfp64
  -mgp64 -mabi=eabi -msingle-float      => -mfp32

(All supported combinations, I think.)

> > GAS can generate -mgp32 -mfp64 "no ABI" code, so we'd need the
> > -mfp64 option then.  Why anyone would use it, well, who knows?
> 
> I don't see even an half-sane use for it, and it's IMHO a bad idea
> to try to support everything without need.
> 
> > But someone once went to a lot of effort to make it work in GCC too
> > (although it doesn't any more).
> 
> Are you actually talking about the combination -mgp32 -mfp64?

Sadly, yes ;).  E.g., from mips.md:

    (define_insn "movdf_internal1a"
      [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,R,R,To,To,*d,*d,*d,*To,*R,*d")
            (match_operand:DF 1 "general_operand"      " f,To,f,G,f,G,*F,*To,*R,*d,*d,*d"))]
      "TARGET_HARD_FLOAT && (TARGET_FLOAT64 && !TARGET_64BIT)

Like I say, gcc doesn't support it any more, but someone somewhere
must have cared.  The archive even has patches to fix bugs in
-mgp32 -mfp64 code.

Richard

  parent reply	other threads:[~2002-07-16  9:29 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 10:16 Richard Sandiford
2002-07-12 11:39 ` Maciej W. Rozycki
2002-07-12 12:28   ` Paul Koning
2002-07-15  4:50   ` Richard Sandiford
2002-07-15 13:18     ` Thiemo Seufer
2002-07-15 13:31       ` Eric Christopher
2002-07-15 13:59         ` Thiemo Seufer
2002-07-15 14:25           ` Eric Christopher
2002-07-15 14:30             ` Thiemo Seufer
2002-07-15 14:59               ` Eric Christopher
2002-07-15 15:04                 ` Thiemo Seufer
2002-07-15 17:26                   ` Eric Christopher
2002-07-16  3:54     ` Maciej W. Rozycki
2002-07-16  4:47       ` Mark D. Baushke
2002-07-16 11:33         ` Eric Christopher
     [not found]           ` <mailpost.1026843855.9110@news-sj1-1>
2002-07-16 18:18             ` cgd
2002-07-17  2:19               ` Maciej W. Rozycki
2002-07-17 15:18               ` Eric Christopher
2002-07-12 11:46 ` Eric Christopher
2002-07-12 12:46   ` Maciej W. Rozycki
2002-07-12 18:16     ` Eric Christopher
     [not found]       ` <mailpost.1026512166.22848@news-sj1-1>
2002-07-13 19:56         ` cgd
2002-07-15  5:39           ` Richard Sandiford
2002-07-14 11:38       ` Thiemo Seufer
2002-07-15  1:03       ` Maciej W. Rozycki
2002-07-15  3:13         ` Mark D. Baushke
2002-07-15  6:40           ` Richard Sandiford
     [not found]     ` <mailpost.1026503036.18648@news-sj1-1>
2002-07-13  0:52       ` cgd
2002-07-14 11:22     ` Thiemo Seufer
     [not found]   ` <mailpost.1026499181.16972@news-sj1-1>
2002-07-13  0:42     ` cgd
2002-07-14 10:53   ` Thiemo Seufer
2002-07-14 23:13     ` Maciej W. Rozycki
     [not found] ` <mailpost.1026493441.14222@news-sj1-1>
2002-07-13  0:40   ` cgd
2002-07-15  5:07     ` Richard Sandiford
     [not found]       ` <mailpost.1026733871.20742@news-sj1-1>
2002-07-15 11:04         ` cgd
2002-07-15 14:28           ` Eric Christopher
2002-07-16  3:23             ` Richard Sandiford
2002-07-16 12:16               ` Eric Christopher
     [not found]               ` <mailpost.1026812813.25035@news-sj1-1>
2002-07-16 17:48                 ` cgd
2002-07-14 10:43 ` Thiemo Seufer
2002-07-15  3:40   ` Richard Sandiford
2002-07-15  3:57     ` Mark D. Baushke
     [not found]       ` <mailpost.1026729642.18965@news-sj1-1>
2002-07-15 10:54         ` cgd
2002-07-15 11:02           ` Mark D. Baushke
2002-07-15 11:11             ` cgd
     [not found]     ` <mailpost.1026728027.18467@news-sj1-1>
2002-07-15 10:47       ` cgd
2002-07-15 11:22         ` Thiemo Seufer
     [not found]           ` <mailpost.1026757359.1135@news-sj1-1>
2002-07-16 17:24             ` cgd
2002-07-18 12:48               ` Thiemo Seufer
2002-07-18 13:09                 ` Eric Christopher
2002-07-16  4:04         ` Maciej W. Rozycki
2002-07-15 11:01     ` Thiemo Seufer
     [not found]       ` <mailpost.1026755685.506@news-sj1-1>
2002-07-15 11:24         ` cgd
2002-07-15 12:51           ` Thiemo Seufer
2002-07-16  3:57             ` Maciej W. Rozycki
2002-07-18 13:43               ` Thiemo Seufer
     [not found]             ` <mailpost.1026759415.2116@news-sj1-1>
2002-07-16 17:34               ` cgd
2002-07-16 18:56                 ` H. J. Lu
2002-07-16 18:57                   ` cgd
2002-07-18 13:57                 ` Thiemo Seufer
2002-07-16  4:45           ` Maciej W. Rozycki
2002-07-16  5:31           ` Richard Sandiford
2002-07-16 11:39             ` Eric Christopher
2002-07-18 14:44             ` Thiemo Seufer
2002-07-16  2:40       ` Richard Sandiford [this message]
2002-07-18 13:36         ` Thiemo Seufer
2002-07-16  4:17       ` Maciej W. Rozycki
2002-07-16  2:46     ` Maciej W. Rozycki
2002-07-16  8:01       ` Paul Koning
2002-07-16 11:01         ` Maciej W. Rozycki
2002-07-18 12:44 ` [Revised patch] " Richard Sandiford
2002-07-18 13:44   ` cgd
2002-07-18 18:12     ` Eric Christopher
2002-07-19  2:53     ` Richard Sandiford
2002-07-19  3:10       ` Mark D. Baushke
2002-07-19 10:11         ` cgd
2002-07-19  9:56       ` cgd
2002-07-22  3:47         ` Richard Sandiford
2002-07-22  4:19           ` Gerald Pfeifer
2002-07-22 11:13           ` Maciej W. Rozycki
2002-07-22 11:21             ` Richard Sandiford
2002-07-22 11:53             ` Eric Christopher
2002-07-22 12:12             ` Paul Koning
2002-07-22 13:13           ` Eric Christopher
     [not found]           ` <mailpost.1027334536.9318@news-sj1-1>
2002-07-22 15:13             ` cgd
2002-07-23  2:03               ` Richard Sandiford
     [not found]                 ` <mailpost.1027412600.13407@news-sj1-1>
2002-07-23  9:42                   ` cgd
2002-07-23  9:42                     ` Richard Sandiford
2002-07-23 10:04                       ` cgd
2002-07-23 10:16                         ` Richard Sandiford
2002-07-23 10:24                           ` cgd
2002-07-23 10:44                             ` Richard Sandiford
2002-07-23 10:52                               ` cgd
2002-07-23 11:38                                 ` Richard Sandiford
2002-07-23 13:18                                   ` Eric Christopher
2002-07-25  3:03           ` Richard Sandiford
2002-07-18 16:32   ` Thiemo Seufer

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=wvnd6to9g2s.fsf@talisman.cambridge.redhat.com \
    --to=rsandifo@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    /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).