https://github.com/flopop01 created https://github.com/llvm/llvm-project/pull/123028
-mfpu=fpv5-d16 or -mfpu=fpv5-sp-d16 disables the scalar half-precision floating-point operations feature. Therefore, because the M-profile Vector Extension (MVE) floating-point feature requires the scalar half-precision floating-point operations, this option also disables the MVE floating-point feature, -mve.fp >From dbb412b925a01fec354fe0bcadf9db3a766730d7 Mon Sep 17 00:00:00 2001 From: Florin Popa <florin.p...@arm.com> Date: Wed, 15 Jan 2025 09:15:23 +0000 Subject: [PATCH] [Clang][Arch]Disable mve.fp when explicit -mfpu option -mfpu=fpv5-d16 or -mfpu=fpv5-sp-d16 disables the scalar half-precision floating-point operations feature. Therefore, because the M-profile Vector Extension (MVE) floating-point feature requires the scalar half-precision floating-point operations, this option also disables the MVE floating-point feature, -mve.fp --- clang/lib/Driver/ToolChains/Arch/ARM.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp b/clang/lib/Driver/ToolChains/Arch/ARM.cpp index b8181ce6dc012a..cec2c4f24d676d 100644 --- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp +++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp @@ -748,6 +748,15 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D, Features.push_back("-crc"); } + // Invalid value of the __ARM_FEATURE_MVE macro when an explicit -mfpu= option + // disables MVE-FP -mfpu=fpv5-d16 or -mfpu=fpv5-sp-d16 disables the scalar + // half-precision floating-point operations feature. Therefore, because the + // M-profile Vector Extension (MVE) floating-point feature requires the scalar + // half-precision floating-point operations, this option also disables the MVE + // floating-point feature: -mve.fp + if (FPUKind == llvm::ARM::FK_FPV5_D16 || FPUKind == llvm::ARM::FK_FPV5_SP_D16) + Features.push_back("-mve.fp"); + // For Arch >= ARMv8.0 && A or R profile: crypto = sha2 + aes // Rather than replace within the feature vector, determine whether each // algorithm is enabled and append this to the end of the vector. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits