diff mbox series

[3/3] arm64: rust: Disable neon and fp target features.

Message ID 20230125163739.3798252-4-Jamie.Cunliffe@arm.com (mailing list archive)
State New, archived
Headers show
Series Rust enablement for AArch64 | expand

Commit Message

Jamie Cunliffe Jan. 25, 2023, 4:37 p.m. UTC
Disable the neon and fp target features to avoid fp & simd
registers. The use of fp-armv8 will cause a warning from rustc about
an unknown feature that is specified. The target feature is still
passed through to LLVM, this behaviour is documented as part of the
warning. This will be fixed in a future version of the rustc
toolchain.

Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
---
 arch/arm64/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Comments

Miguel Ojeda Jan. 25, 2023, 5:49 p.m. UTC | #1
On Wed, Jan 25, 2023 at 5:38 PM Jamie Cunliffe <Jamie.Cunliffe@arm.com> wrote:
>
> Disable the neon and fp target features to avoid fp & simd
> registers. The use of fp-armv8 will cause a warning from rustc about
> an unknown feature that is specified.

This would be https://github.com/rust-lang/rust/issues/96472, right?
(if I misunderstood and it is something else, please let me know!)

> The target feature is still
> passed through to LLVM, this behaviour is documented as part of the
> warning. This will be fixed in a future version of the rustc
> toolchain.

The cover letter had the link, which could be nice to have here in a
`Link: ` tag maybe.

Cheers,
Miguel
Vincenzo Palazzo Jan. 25, 2023, 7:55 p.m. UTC | #2
On Wed Jan 25, 2023 at 5:37 PM CET, Jamie Cunliffe wrote:
> Disable the neon and fp target features to avoid fp & simd
> registers. The use of fp-armv8 will cause a warning from rustc about
> an unknown feature that is specified. The target feature is still
> passed through to LLVM, this behaviour is documented as part of the
> warning. This will be fixed in a future version of the rustc
> toolchain.
>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>

Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
> ---
>  arch/arm64/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index b53ab6aa2dfe..33ae20fc3f56 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -41,6 +41,8 @@ KBUILD_CFLAGS	+= -mgeneral-regs-only	\
>  KBUILD_CFLAGS	+= $(call cc-disable-warning, psabi)
>  KBUILD_AFLAGS	+= $(compat_vdso)
>  
> +KBUILD_RUSTFLAGS += -C target-feature="-neon,-fp-armv8"
> +
>  KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
>  KBUILD_AFLAGS	+= $(call cc-option,-mabi=lp64)
>  
> -- 
> 2.30.2
Will Deacon Jan. 26, 2023, 4:37 p.m. UTC | #3
On Wed, Jan 25, 2023 at 04:37:39PM +0000, Jamie Cunliffe wrote:
> Disable the neon and fp target features to avoid fp & simd
> registers. The use of fp-armv8 will cause a warning from rustc about
> an unknown feature that is specified. The target feature is still
> passed through to LLVM, this behaviour is documented as part of the
> warning. This will be fixed in a future version of the rustc
> toolchain.
> 
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> ---
>  arch/arm64/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index b53ab6aa2dfe..33ae20fc3f56 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -41,6 +41,8 @@ KBUILD_CFLAGS	+= -mgeneral-regs-only	\
>  KBUILD_CFLAGS	+= $(call cc-disable-warning, psabi)
>  KBUILD_AFLAGS	+= $(compat_vdso)
>  
> +KBUILD_RUSTFLAGS += -C target-feature="-neon,-fp-armv8"

Why do we advertise these features as present in
scripts/generate_rust_target.rs?

Will
diff mbox series

Patch

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b53ab6aa2dfe..33ae20fc3f56 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -41,6 +41,8 @@  KBUILD_CFLAGS	+= -mgeneral-regs-only	\
 KBUILD_CFLAGS	+= $(call cc-disable-warning, psabi)
 KBUILD_AFLAGS	+= $(compat_vdso)
 
+KBUILD_RUSTFLAGS += -C target-feature="-neon,-fp-armv8"
+
 KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
 KBUILD_AFLAGS	+= $(call cc-option,-mabi=lp64)