public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "René Rebe" <rene@exactcode.de>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, linkw@linux.ibm.com, sjames@gcc.gnu.org,
	bergner@linux.ibm.com, dje.gcc@gmail.com
Subject: Re: [PATCH v2] fix PowerPC < 7 w/ Altivec not to default to power7
Date: Wed, 12 Jun 2024 00:27:51 +0200	[thread overview]
Message-ID: <35D670D1-ABCC-42DB-A362-BD828877F136@exactcode.de> (raw)
In-Reply-To: <20240611221529.GF19790@gate.crashing.org>

Hi!

> On Jun 12, 2024, at 00:15, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> Hi!
> 
> What does "powerpc < 7" mean?  Something before POWER ISA 2.06?

PowerPC ISA level 7 or whatever you like to call it.

> On Tue, Jun 11, 2024 at 04:22:54PM +0200, Rene Rebe wrote:
>> Glibc uses .machine to determine assembler optimizations to use.
> 
> What does this mean?
> 
> .machine is an *output* for glibc; nothing in glibc reads source code.

The glibc build with gcc since 2019 with -mcpu=g5, cell or anything before
power7 w/ altiven will use assembly optimizations with instructions not
supported by the CPU. I found out the hard way because the resultings
binaries threw SIGILL.

> Nothing the ".machine" directive does has anything to do with
> optimisations.  Instead, it simply changes what architecture level is
> used for the following code. what specific instructions are supported
> mainly.

I could probably go grep the glibc sources again 4 years later for you.

>> --- a/gcc/testsuite/gcc.target/powerpc/pr97367.c.vanilla 2024-05-30 18:26:29.839784279 +0200
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr97367.c 2024-10-06 18:20:34.873818482 +0200
>> @@ -0,0 +1,9 @@
>> +/* { dg-do compile } */
>> +/* { dg-options "-mdejagnu-cpu=G5" } */
>> +
>> +int dummy ()
>> +{
>> +  return 0;
>> +}
>> +
>> +/* { dg-final { scan-assembler "power4" } } */
> 
> Please explain (in the testcase, not here!) what this is meant to test!
> 
> You probably want to say {\mpower4\M} instead, btw.  Unless you want to
> match ".machine spower436" as well?

That sounds indeed reasonable. I guess we can make it match .machine, too.
Updated test-case welcome ;-)

	René

-- 
ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
http://exactcode.com | http://exactscan.com | http://ocrkit.com


  reply	other threads:[~2024-06-11 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 14:22 Rene Rebe
2024-06-11 22:15 ` Segher Boessenkool
2024-06-11 22:27   ` René Rebe [this message]
2024-06-12  8:04     ` René Rebe

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=35D670D1-ABCC-42DB-A362-BD828877F136@exactcode.de \
    --to=rene@exactcode.de \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=sjames@gcc.gnu.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).