public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com
Subject: Re: [PATCH] rs6000: Fix cpu selection w/ isel (PR100108)
Date: Mon, 17 Jan 2022 14:21:15 -0600	[thread overview]
Message-ID: <20220117202115.GA614@gate.crashing.org> (raw)
In-Reply-To: <1d1848d7-d97a-27df-3a97-19c1a676cead@embedded-brains.de>

Hi!

On Mon, Jan 17, 2022 at 09:06:25PM +0100, Sebastian Huber wrote:
> On 11/01/2022 09:10, Sebastian Huber wrote:
> >On 20/04/2021 17:00, Segher Boessenkool wrote:
> >>There are various non-IBM CPUs with isel as well, so it is easiest if we
> >>just don't consider that flag here (it is not needed).
> >>
> >>2021-04-20  Segher Boessenkool<segher@kernel.crashing.org>
> >>
> >>    PR target/100108
> >>    * config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not 
> >>consider
> >>    OPTION_MASK_ISEL.
> >>---
> >>Committed to trunk and 11.  Will do 10 in a week or so.
> >
> >sorry for the late response, however, I noticed a GCC build issue with 
> >this patch:

[ big snip ]

> >/tmp/ccZJ18fW.s: Assembler messages:
> >/tmp/ccZJ18fW.s:24: Error: unrecognized opcode: `isel'
> >make: *** [Makefile:501: _negvdi2.o] Error 1
> >
> >The assembler is called like this:
> >
> >/tmp/sh/b-gcc-powerpc-rtems6/./gcc/as -I 
> >/home/EB/sebastian_h/src/gcc/libgcc/../newlib/libc/sys/rtems/include -I 
> >. -I . -I ../../../.././gcc -I /home/EB/sebastian_h/src/gcc/libgcc -I 
> >/home/EB/sebastian_h/src/gcc/libgcc/. -I 
> >/home/EB/sebastian_h/src/gcc/libgcc/../gcc -I 
> >/home/EB/sebastian_h/src/gcc/libgcc/../include -a32 -me500 -mbig -o 
> >_negvdi2.o _negvdi2.s
> >
> >Using -me500 seems to be all right, however, the file contains a machine 
> >directive:
> >
> >     .file    "libgcc2.c"
> >     .machine ppc
> >     .section    ".text"
> >
> >If I remove the ".machine ppc" by hand, the file can be assembled with 
> >the above command line.
> >
> >The affect of the patch is:
> >
> >diff -u _negvdi2.s.before _negvdi2.s.after
> >--- _negvdi2.s.before   2022-01-11 09:07:43.313828636 +0100
> >+++ _negvdi2.s.after    2022-01-11 08:54:08.424946502 +0100
> >@@ -1,5 +1,5 @@
> >         .file   "libgcc2.c"
> >-       .machine power9
> >+       .machine ppc

Which is "correct".  rs6000_machine_from_flags should be updated to know
about these CPUs: if you have a -mcpu= that outputs instructions that
are not .machine ppc (or ppc64), the compiler should emit
some appropriate .machine instead.

> I can try to fix this, however, for me it is not really clear in which 
> direction this should be fixed. I can build the GCC 10.3.0 release (it 
> uses .machine power9). The GCC 10 branch is broken (it uses .machine 
> ppc). Using the .machine directive and a command line option (-me500) 
> seems to be a bit inconsistent. It should be one or the other.

Exactly.

> Would a patch which changes .machine ppc to .machine e500 for -mcpu=8540 
> be the right way to fix this issue?

Yes :-)

Do you have the info needed to make a patch like this for all FSL CPUs?


Segher

      reply	other threads:[~2022-01-17 20:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 15:00 Segher Boessenkool
2021-05-10 22:04 ` Segher Boessenkool
2022-01-11  8:10 ` Sebastian Huber
2022-01-17 20:06   ` Sebastian Huber
2022-01-17 20:21     ` Segher Boessenkool [this message]

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=20220117202115.GA614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sebastian.huber@embedded-brains.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).