Bug 87302 - -mfpu=auto -march=armv8-a does not work
Summary: -mfpu=auto -march=armv8-a does not work
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-14 11:15 UTC by nsz
Modified: 2018-09-14 12:52 UTC (History)
0 users

See Also:
Host:
Target: arm-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nsz 2018-09-14 11:15:32 UTC
i think the following inconsistency is problematic:

on a hard float toolchain (-mfloat-abi=hard):

$ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv7-a a.c ; echo $?
cc1: error: -mfloat-abi=hard: selected processor lacks an FPU
1
$ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv7-a+fp a.c ; echo $?
0
$ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a a.c ; echo $?
cc1: error: -mfloat-abi=hard: selected processor lacks an FPU
1
$ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a+fp a.c ; echo $?
arm-none-linux-gnueabihf-gcc: error: 'armv8-a' does not support feature 'fp'
arm-none-linux-gnueabihf-gcc: note: valid feature names are: crc simd crypto nocrypto nofp; did you mean 'nofp'?
1
$ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a+simd a.c ; echo $?
0

so it seems neither armv8-a nor armv8-a+fp work with -mfpu=auto, but armv8-a+simd and armv7-a+fp do.
Comment 1 Richard Earnshaw 2018-09-14 12:52:38 UTC
(In reply to nsz from comment #0)
> i think the following inconsistency is problematic:
> 
> on a hard float toolchain (-mfloat-abi=hard):
> 
> $ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv7-a a.c ; echo $?
> cc1: error: -mfloat-abi=hard: selected processor lacks an FPU
> 1

This is the correct response, you haven't specified the expected floating point/simd extensions in the architecture.

> $ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv7-a+fp a.c ; echo $?
> 0

correct response.

> $ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a a.c ; echo $?
> cc1: error: -mfloat-abi=hard: selected processor lacks an FPU
> 1

Correct response, floating point/simd extension not enabled.

> $ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a+fp a.c ; echo $?
> arm-none-linux-gnueabihf-gcc: error: 'armv8-a' does not support feature 'fp'
> arm-none-linux-gnueabihf-gcc: note: valid feature names are: crc simd crypto
> nocrypto nofp; did you mean 'nofp'?
> 1

Correct response.  Fp without SIMD is not an option in Arm v8.

> $ arm-none-linux-gnueabihf-gcc -mfpu=auto -march=armv8-a+simd a.c ; echo $?
> 0
> 
> so it seems neither armv8-a nor armv8-a+fp work with -mfpu=auto, but
> armv8-a+simd and armv7-a+fp do.

this is all as it should be.  The documentation describes which options are available for which architecture.