This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] ppc64 s_lrint.c changes
- From: Steve Munroe <sjmunroe at vnet dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: aj at suse dot de, geoffk at geoffk dot org, roland at frob dot com
- Date: Fri, 20 Sep 2002 13:10:49 -0500
- Subject: [PATCH] ppc64 s_lrint.c changes
The good news is that the "Floating Convert To Integer Word" instruction is the
same between powerpc32 and powerpc64.
The bad news is that sizeof(long) and the ABI are different.
2002-09-18 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/fpu/s_lrint.c (__lrint): Change union long array to
int array for 32-/64-bit compatibility.
[HAVE_ASM_GLOBAL_DOT_NAME]: Add powerpc64 "DOT" symbols for lrintf.
diff -rupPN libc23-cvstip-20020918/sysdeps/powerpc/fpu/s_lrint.c libc23/sysdeps/powerpc/fpu/s_lrint.c
--- libc23-cvstip-20020918/sysdeps/powerpc/fpu/s_lrint.c Thu Jul 5 23:56:02 2001
+++ libc23/sysdeps/powerpc/fpu/s_lrint.c Wed Sep 18 19:43:52 2002
@@ -24,7 +24,7 @@ __lrint (double x)
{
union {
double d;
- long int ll[2];
+ int ll[2];
} u;
asm ("fctiw %0,%1" : "=f"(u.d) : "f"(x));
return u.ll[1];
@@ -39,6 +39,15 @@ asm ("\n\
.set __lrintf,__lrint \n\
.set lrintf,__lrint \n\
");
+
+/* powerpc64 needs that "DOT NAME" for branch targets. */
+#ifdef HAVE_ASM_GLOBAL_DOT_NAME
+asm ("\n\
+ .globl .lrintf \n\
+ .weak .lrintf \n\
+ .set .lrintf,.__lrint \n\
+");
+#endif
#ifdef NO_LONG_DOUBLE
strong_alias (__lrint, __lrintl)