Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177370074
D57773.1794216955.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
D57773.1794216955.diff
View Options
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -301,7 +301,7 @@
SUBDIR.${MK_TESTS}+= tests
.include <bsd.compiler.mk>
-.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 120000
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 120000
# Silence '#pragma FENV_ACCESS' is not supported on this target - ignored
CWARNFLAGS+= -Wno-error=ignored-pragmas
.endif
diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -183,6 +183,7 @@
double
fma(double x, double y, double z)
{
+#pragma STDC FENV_ACCESS ON
double xs, ys, zs, adj;
struct dd xy, r;
int oround;
diff --git a/lib/msun/src/s_fmaf.c b/lib/msun/src/s_fmaf.c
--- a/lib/msun/src/s_fmaf.c
+++ b/lib/msun/src/s_fmaf.c
@@ -48,6 +48,7 @@
float
fmaf(float x, float y, float z)
{
+#pragma STDC FENV_ACCESS ON
double xy, result;
uint32_t hr, lr;
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -164,6 +164,7 @@
long double
fmal(long double x, long double y, long double z)
{
+#pragma STDC FENV_ACCESS ON
long double xs, ys, zs, adj;
struct dd xy, r;
int oround;
diff --git a/lib/msun/src/s_lrint.c b/lib/msun/src/s_lrint.c
--- a/lib/msun/src/s_lrint.c
+++ b/lib/msun/src/s_lrint.c
@@ -46,6 +46,7 @@
dtype
fn(type x)
{
+#pragma STDC FENV_ACCESS ON
fenv_t env;
dtype d;
diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c
--- a/lib/msun/src/s_lround.c
+++ b/lib/msun/src/s_lround.c
@@ -57,7 +57,7 @@
dtype
fn(type x)
{
-
+#pragma STDC FENV_ACCESS ON
if (INRANGE(x)) {
x = roundit(x);
return ((dtype)x);
diff --git a/lib/msun/tests/conj_test.c b/lib/msun/tests/conj_test.c
--- a/lib/msun/tests/conj_test.c
+++ b/lib/msun/tests/conj_test.c
@@ -70,6 +70,7 @@
ATF_TC_WITHOUT_HEAD(main);
ATF_TC_BODY(main, tc)
{
+#pragma STDC FENV_ACCESS ON
static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2;
complex float in;
complex long double expected;
diff --git a/lib/msun/tests/nan_test.c b/lib/msun/tests/nan_test.c
--- a/lib/msun/tests/nan_test.c
+++ b/lib/msun/tests/nan_test.c
@@ -105,6 +105,7 @@
ATF_TC_WITHOUT_HEAD(nan);
ATF_TC_BODY(nan, tc)
{
+#pragma STDC FENV_ACCESS ON
/* Die if a signalling NaN is returned */
feenableexcept(FE_INVALID);
diff --git a/lib/msun/tests/nearbyint_test.c b/lib/msun/tests/nearbyint_test.c
--- a/lib/msun/tests/nearbyint_test.c
+++ b/lib/msun/tests/nearbyint_test.c
@@ -85,6 +85,7 @@
static void
test_nearby(int testindex)
{
+#pragma STDC FENV_ACCESS ON
float in, out;
unsigned i;
@@ -111,6 +112,7 @@
static void
test_modf(int testindex)
{
+#pragma STDC FENV_ACCESS ON
float in, out;
float ipartf, ipart_expected;
double ipart;
@@ -152,9 +154,6 @@
ATF_TC_WITHOUT_HEAD(nearbyint);
ATF_TC_BODY(nearbyint, tc)
{
-#if defined(__aarch64__) || defined(__riscv)
- atf_tc_expect_fail("https://bugs.freebsd.org/290099");
-#endif
unsigned i;
for (i = 0; i < nitems(tests); i++) {
diff --git a/lib/msun/tests/next_test.c b/lib/msun/tests/next_test.c
--- a/lib/msun/tests/next_test.c
+++ b/lib/msun/tests/next_test.c
@@ -39,6 +39,8 @@
#include <ieeefp.h>
#endif
+#pragma STDC FENV_ACCESS ON
+
#include "test-utils.h"
#define test(exp, ans, ex) do { \
diff --git a/lib/msun/tests/test-utils.h b/lib/msun/tests/test-utils.h
--- a/lib/msun/tests/test-utils.h
+++ b/lib/msun/tests/test-utils.h
@@ -117,6 +117,7 @@
fpequal_tol(long double x, long double y, long double tol,
unsigned int flags)
{
+#pragma STDC FENV_ACCESS ON
fenv_t env;
int ret;
@@ -190,14 +191,18 @@
#x, creall(_x), cimagl(_x), #y, creall(_y), cimagl(_y)); \
} while (0)
-#define _fp_exceptions(atf_variant, excepts, exceptmask) \
+#define _fp_exceptions(atf_variant, excepts, exceptmask) do { \
+ _Pragma("STDC FENV_ACCESS ON"); \
ATF_##atf_variant##_EQ_MSG((excepts), fetestexcept(exceptmask), \
"unexpected exception flags: got %#x not %#x", \
- fetestexcept(exceptmask), (excepts))
-#define _fp_exceptions_msg(atf_variant, excepts, exceptmask, fmt, ...) \
+ fetestexcept(exceptmask), (excepts)); \
+} while (0)
+#define _fp_exceptions_msg(atf_variant, excepts, exceptmask, fmt, ...) do { \
+ _Pragma("STDC FENV_ACCESS ON"); \
ATF_##atf_variant##_EQ_MSG((excepts), fetestexcept(exceptmask), \
- "unexpected exception flags: got %#x not %#x " fmt, \
- fetestexcept(exceptmask), (excepts), __VA_ARGS__)
+ "unexpected exception flags: got %#x not %#x " fmt, \
+ fetestexcept(exceptmask), (excepts), __VA_ARGS__); \
+} while (0)
#define CHECK_FP_EXCEPTIONS(excepts, exceptmask) _fp_exceptions(CHECK, excepts, exceptmask)
#define CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, fmt, ...) _fp_exceptions_msg(CHECK, excepts, exceptmask, fmt, __VA_ARGS__)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 9, 9:35 AM (6 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41611317
Default Alt Text
D57773.1794216955.diff (4 KB)
Attached To
Mode
D57773: lib/msun: add missing FENV_ACCESS pragmas
Attached
Detach File
Event Timeline