Re: [PATCH] clang compatibility: fpu options

Volodymyr Turanskyy <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <DB4PR08MB8152840902E63D325342B26BE0E72@DB4PR08MB8152.eurprd08.prod.outlook.com>
Hi,

Please see attached re-formatted patch file.

Sincerely,

Volodymyr Turanskyy | Principal Software Engineer | CE SW LLVM Team

From: Volodymyr Turanskyy <[email protected]>
Date: Monday, 20 January 2025 at 15:06
To: Joel Sherrill <[email protected]>, [email protected] <[email protected]>
Cc: nd <[email protected]>
Subject: Re: [PATCH] clang compatibility: fpu options
Hi Joel,

Let me fix the commit messages.

Clang does not have vfpxd - vfpv3xd might be the closest, however we believe that it is not needed for clang at all, so it is skipped.

Sincerely,

Volodymyr Turanskyy | Principal Software Engineer | CE SW LLVM Team

From: Joel Sherrill <[email protected]>
Date: Monday, 20 January 2025 at 15:01
To: Volodymyr Turanskyy <[email protected]>
Cc: [email protected] <[email protected]>, nd <[email protected]>
Subject: Re: [PATCH] clang compatibility: fpu options
Same with missing commit.

Does the clang assembler have a directive for vfpxd? If I am reading the patch correctly, it just drops the directive rather than replacing it.

--joel

On Mon, Jan 20, 2025 at 8:49 AM Volodymyr Turanskyy <[email protected]<mailto:[email protected]>> wrote:
Hi,

Following up on the RFC [1], please find attached a patch that adds a check to avoid extra assembler directives that are not compatible with clang and are not needed by clang.

References

https://sourceware.org/pipermail/newlib/2025/021452.html

Sincerely,

Volodymyr Turanskyy | Principal Software Engineer | CE SW LLVM Team
0001-Add-check-for-clang-to-avoid-unnecessary-FPU-directi.patch (application/octet-stream, 1 KB)
From 5184bcdc36ed48cd2074757db5afe2e5de5b28d0 Mon Sep 17 00:00:00 2001
From: Volodymyr Turanskyy <[email protected]>
Date: Mon, 20 Jan 2025 15:18:06 +0000
Subject: [PATCH] Add check for clang to avoid unnecessary FPU directives

This improves compatibility with clang that does not support vfpxd and does not need these extra directives.

Change-Id: Id2027e622aef8457ac9c7e1d6715a9240ce8e3f0
---
 newlib/libc/machine/arm/setjmp.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S
index 0070f17cd..a53f7918e 100644
--- a/newlib/libc/machine/arm/setjmp.S
+++ b/newlib/libc/machine/arm/setjmp.S
@@ -78,10 +78,10 @@
     covers all the cases we need in this file for hardware
     floating-point and should be compatible with all required FPUs
     that we need to support.  */
-# if __ARM_FP
+# if __ARM_FP && !__clang__
 	.fpu vfpxd
 # endif
-# if __ARM_FEATURE_MVE
+# if __ARM_FEATURE_MVE && !__clang__
 	.arch_extension mve
 # endif
 #endif
-- 
2.48.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.