public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
@ 2021-08-28 0:33 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28 0:33 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c3064d5f506a3f9632d191287c38ec93e5b53e80
commit c3064d5f506a3f9632d191287c38ec93e5b53e80
Author: Stan Shebs <stanshebs@google.com>
Date: Thu Feb 6 11:58:01 2020 -0800
Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
Diff:
---
sysdeps/powerpc/power7/fpu/s_logb.c | 9 ---------
sysdeps/powerpc/power7/fpu/s_logbf.c | 7 -------
sysdeps/powerpc/power7/fpu/s_logbl.c | 8 --------
3 files changed, 24 deletions(-)
diff --git a/sysdeps/powerpc/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c
index 40a689725d..160b9334de 100644
--- a/sysdeps/powerpc/power7/fpu/s_logb.c
+++ b/sysdeps/powerpc/power7/fpu/s_logb.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <math_ldbl_opt.h>
-#include <math_private.h>
#include <libm-alias-double.h>
/* This implementation avoids FP to INT conversions by using VSX
@@ -42,19 +41,11 @@ __logb (double x)
return -1.0 / __builtin_fabs (x);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (x), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbf.c b/sysdeps/powerpc/power7/fpu/s_logbf.c
index 0da0f37490..0832ad7022 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbf.c
@@ -43,18 +43,11 @@ __logbf (float x)
return -1.0 / __builtin_fabsf (x);
/* ret = x & 0x7f800000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f"(ret)
: "f" (x), "f" (mask.d));
-#else
- int32_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0, since ret is double. */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two7m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbl.c b/sysdeps/powerpc/power7/fpu/s_logbl.c
index 997dfcf8fb..192145a7a1 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbl.c
@@ -46,19 +46,11 @@ __logbl (long double x)
ldbl_unpack (x, &xh, &xl);
EXTRACT_WORDS64 (hx, xh);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (xh), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/maskray/grte] Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
@ 2021-08-28 0:28 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28 0:28 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f34e101f60749dd8e3aa15dc8304694145982edb
commit f34e101f60749dd8e3aa15dc8304694145982edb
Author: Stan Shebs <stanshebs@google.com>
Date: Thu Feb 6 11:58:01 2020 -0800
Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
Diff:
---
sysdeps/powerpc/power7/fpu/s_logb.c | 9 ---------
sysdeps/powerpc/power7/fpu/s_logbf.c | 7 -------
sysdeps/powerpc/power7/fpu/s_logbl.c | 8 --------
3 files changed, 24 deletions(-)
diff --git a/sysdeps/powerpc/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c
index 40a689725d..160b9334de 100644
--- a/sysdeps/powerpc/power7/fpu/s_logb.c
+++ b/sysdeps/powerpc/power7/fpu/s_logb.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <math_ldbl_opt.h>
-#include <math_private.h>
#include <libm-alias-double.h>
/* This implementation avoids FP to INT conversions by using VSX
@@ -42,19 +41,11 @@ __logb (double x)
return -1.0 / __builtin_fabs (x);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (x), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbf.c b/sysdeps/powerpc/power7/fpu/s_logbf.c
index 0da0f37490..0832ad7022 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbf.c
@@ -43,18 +43,11 @@ __logbf (float x)
return -1.0 / __builtin_fabsf (x);
/* ret = x & 0x7f800000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f"(ret)
: "f" (x), "f" (mask.d));
-#else
- int32_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0, since ret is double. */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two7m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbl.c b/sysdeps/powerpc/power7/fpu/s_logbl.c
index 997dfcf8fb..192145a7a1 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbl.c
@@ -46,19 +46,11 @@ __logbl (long double x)
ldbl_unpack (x, &xh, &xl);
EXTRACT_WORDS64 (hx, xh);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (xh), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/maskray/grte] Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
@ 2021-08-27 23:45 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:45 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66767b8b0c4f5370a00cb65953fc34b9c91039c6
commit 66767b8b0c4f5370a00cb65953fc34b9c91039c6
Author: Stan Shebs <stanshebs@google.com>
Date: Thu Feb 6 11:58:01 2020 -0800
Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly
Diff:
---
sysdeps/powerpc/power7/fpu/s_logb.c | 9 ---------
sysdeps/powerpc/power7/fpu/s_logbf.c | 7 -------
sysdeps/powerpc/power7/fpu/s_logbl.c | 8 --------
3 files changed, 24 deletions(-)
diff --git a/sysdeps/powerpc/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c
index 40a689725d..160b9334de 100644
--- a/sysdeps/powerpc/power7/fpu/s_logb.c
+++ b/sysdeps/powerpc/power7/fpu/s_logb.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <math_ldbl_opt.h>
-#include <math_private.h>
#include <libm-alias-double.h>
/* This implementation avoids FP to INT conversions by using VSX
@@ -42,19 +41,11 @@ __logb (double x)
return -1.0 / __builtin_fabs (x);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (x), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbf.c b/sysdeps/powerpc/power7/fpu/s_logbf.c
index 0da0f37490..0832ad7022 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbf.c
@@ -43,18 +43,11 @@ __logbf (float x)
return -1.0 / __builtin_fabsf (x);
/* ret = x & 0x7f800000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f"(ret)
: "f" (x), "f" (mask.d));
-#else
- int32_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0, since ret is double. */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two7m1, 0))
diff --git a/sysdeps/powerpc/power7/fpu/s_logbl.c b/sysdeps/powerpc/power7/fpu/s_logbl.c
index 997dfcf8fb..192145a7a1 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbl.c
@@ -46,19 +46,11 @@ __logbl (long double x)
ldbl_unpack (x, &xh, &xl);
EXTRACT_WORDS64 (hx, xh);
/* ret = x & 0x7ff0000000000000; */
-#if !defined __clang__
asm (
"xxland %x0,%x1,%x2\n"
"fcfid %0,%0"
: "=f" (ret)
: "f" (xh), "f" (mask.d));
-#else
- /* TODO(rtenneti): This is wrong. Handle double */
- int64_t inum;
- GET_FLOAT_WORD(inum, x);
- inum = (inum & 0x7ff0000000000000);
- SET_FLOAT_WORD(ret, inum);
-#endif
/* ret = (ret >> 52) - 1023.0; */
ret = (ret * two1div52) + two10m1;
if (__builtin_expect (ret > -two10m1, 0))
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-28 0:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 0:33 [glibc/maskray/grte] Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly Fangrui Song
-- strict thread matches above, loose matches on Subject: below --
2021-08-28 0:28 Fangrui Song
2021-08-27 23:45 Fangrui Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).