-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eduard Vintilă <[email protected]>
- Loading branch information
1 parent
e328b86
commit b29cfc4
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From c3737ee23f13b8cf453cf91c28be4c0e4a320970 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Eduard=20Vintil=C4=83?= <[email protected]> | ||
Date: Thu, 21 Jul 2022 00:26:24 +0300 | ||
Subject: [PATCH] Define llroundl for all targets | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
The RISC-V ABI spec states that sizeof(long double) is equal to 16, | ||
hence on such targets a double is not as wide as a long double. | ||
|
||
Newlibc's implementation for llroundl is just a wrapper for llround, and | ||
is not defined at all for targets where the size of the two types differ. | ||
Musl wraps llround using llroundl regardless of the difference between double and long double, | ||
so we remove the compile-time check such that llroundl is defined for all targets in newlibc as well. | ||
|
||
Signed-off-by: Eduard Vintilă <[email protected]> | ||
--- | ||
newlib/libm/common/llroundl.c | 3 --- | ||
1 file changed, 3 deletions(-) | ||
|
||
diff --git a/newlib/libm/common/llroundl.c b/newlib/libm/common/llroundl.c | ||
index d663226..1e1fda4 100644 | ||
--- a/newlib/libm/common/llroundl.c | ||
+++ b/newlib/libm/common/llroundl.c | ||
@@ -31,12 +31,9 @@ POSSIBILITY OF SUCH DAMAGE. | ||
#include <math.h> | ||
#include "local.h" | ||
|
||
-/* On platforms where long double is as wide as double. */ | ||
-#ifdef _LDBL_EQ_DBL | ||
long long int | ||
llroundl (long double x) | ||
{ | ||
return llround(x); | ||
} | ||
-#endif | ||
|
||
-- | ||
2.37.1 | ||
|