public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: gcc-help@gcc.gnu.org
Subject: Re: Why does GCC drop "+simd" for the assembler if compiling for Armv8-A or Armv8-R?
Date: Thu, 3 Dec 2020 13:53:29 +0100	[thread overview]
Message-ID: <becf5696-a89b-4d2c-1b2e-fce8cb0022f7@embedded-brains.de> (raw)
In-Reply-To: <71fc3de0-dbb1-219e-1baf-ddf59e5466c3@embedded-brains.de>

On 03/12/2020 13:25, Sebastian Huber wrote:

> Hello,
>
> I have a problem that assembler files assembled by GCC issue errors 
> due to incomplete architecture and FPU options which should be 
> provided by the assembler command line and not as directives in the 
> file. For example:
>
> arm-rtems6-gcc -save-temps -c test.c -mthumb -march=armv8-a+crc+simd 
> -mfloat-abi=hard -wrapper echo
> /tmp/sh/rtems/6/lib/gcc/arm-rtems6/10.2.1/cc1 -E -quiet 
> -D__USES_INITFINI__ test.c -mthumb -mfloat-abi=hard 
> -march=armv8-a+crc+simd -fpch-preprocess -o test.i
> /tmp/sh/rtems/6/lib/gcc/arm-rtems6/10.2.1/cc1 -fpreprocessed test.i 
> -quiet -dumpbase test.c -mthumb -mfloat-abi=hard 
> -march=armv8-a+crc+simd -auxbase test -o test.s
> /tmp/sh/rtems/6/lib64/gcc/arm-rtems6/10.2.1/../../../../arm-rtems6/bin/as 
> -march=armv8-a+crc -mfloat-abi=hard -meabi=5 -o test.o test.s
>
> arm-rtems6-gcc -save-temps -c test.c -mthumb -march=armv8-r+crc+simd 
> -mfloat-abi=hard -wrapper echo
> /tmp/sh/rtems/6/lib/gcc/arm-rtems6/10.2.1/cc1 -E -quiet 
> -D__USES_INITFINI__ test.c -mthumb -mfloat-abi=hard 
> -march=armv8-r+crc+simd -fpch-preprocess -o test.i
> /tmp/sh/rtems/6/lib/gcc/arm-rtems6/10.2.1/cc1 -fpreprocessed test.i 
> -quiet -dumpbase test.c -mthumb -mfloat-abi=hard 
> -march=armv8-r+crc+simd -auxbase test -o test.s
> /tmp/sh/rtems/6/lib64/gcc/arm-rtems6/10.2.1/../../../../arm-rtems6/bin/as 
> -march=armv8-r+crc -mfloat-abi=hard -meabi=5 -o test.o test.s
>
> The assembler is called without the "+simd". In Armv7-A and Armv7-R 
> the FPU was selected by -mfpu options.

It is discarded by arm_rewrite_selected_arch() probably because

(gdb) p *entry
$16 = {name = 0x4c1acc "simd", remove = false, alias = false, isa_bits = 
{isa_bit_fp_d32, isa_bit_fp_dbl, isa_bit_fp16conv, isa_bit_fpv5, 
isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, isa_nobit 
<repeats 54 times>}}

and

#define ISA_ALL_FPU_INTERNAL \
   isa_bit_fp16conv, \
   isa_bit_crypto, \
   isa_bit_vfpv2, \
   isa_bit_vfpv3, \
   isa_bit_vfpv4, \
   isa_bit_fpv5, \
   isa_bit_neon, \
   isa_bit_fp_dbl, \
   isa_bit_fp_d32

So

(gdb) p/x fpu_bits
$17 = {m_bitmap = 0x778e60}
(gdb) p/x opt_bits
$18 = {m_bitmap = 0x778e20}

     if (!bitmap_subset_p (opt_bits, fpu_bits))
         optlist.push_back (entry->name);

doesn't push back entry->name.

Is this a bug or a feature?

The assembler doesn't complain about a -march=armv8-r+crc+simd and it 
makes the assembler error go away, for example:

../../../cpukit/score/cpu/arm/cpu_asm.S: Assembler messages:
../../../cpukit/score/cpu/arm/cpu_asm.S:64: Error: selected processor 
does not support `vstm r5,{d8-d15}' in ARM mode
../../../cpukit/score/cpu/arm/cpu_asm.S:110: Error: selected processor 
does not support `vldm r5,{d8-d15}' in ARM mode

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hubere@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


  reply	other threads:[~2020-12-03 12:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 12:25 Sebastian Huber
2020-12-03 12:53 ` Sebastian Huber [this message]
2020-12-03 14:25   ` Sebastian Huber
2020-12-04  8:15     ` Sebastian Huber
2020-12-09 14:53 ` Richard Earnshaw
2020-12-09 15:07   ` Sebastian Huber

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=becf5696-a89b-4d2c-1b2e-fce8cb0022f7@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=gcc-help@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).