Hi!

> On Jun 12, 2024, at 00:15, Segher Boessenkool <seg...@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 via email to