mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
lang/spidermonkey91: More i386 build fixes
This commit is contained in:
parent
2a8218e9db
commit
e24e8beab8
1 changed files with 24 additions and 16 deletions
|
@ -1,24 +1,25 @@
|
||||||
Index: modules/fdlibm/src/math_private.h
|
--- modules/fdlibm/src/math_private.h.orig 2022-04-16 03:20:29 UTC
|
||||||
--- modules/fdlibm/src/math_private.h.orig 2022-04-16 01:44:07 UTC
|
|
||||||
+++ modules/fdlibm/src/math_private.h
|
+++ modules/fdlibm/src/math_private.h
|
||||||
@@ -634,6 +634,34 @@ rnint(__double_t x)
|
@@ -30,7 +30,9 @@
|
||||||
return ((double)(x + 0x1.8p52) - 0x1.8p52);
|
* Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
|
||||||
}
|
*/
|
||||||
|
|
||||||
+#ifdef __i386__
|
+#ifndef __FreeBSD__
|
||||||
+typedef long double __double_t;
|
typedef double __double_t;
|
||||||
+#else
|
|
||||||
+typedef double __double_t;
|
|
||||||
+#endif
|
+#endif
|
||||||
+typedef __double_t double_t;
|
typedef __double_t double_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -636,6 +638,33 @@ rnint(__double_t x)
|
||||||
|
* sometimes be more efficient because no rounding is required.
|
||||||
|
*/
|
||||||
|
#if (defined(amd64) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
|
||||||
+
|
+
|
||||||
+/* This is needed on FreeBSD i386. */
|
+#if defined(__i386__)
|
||||||
+#if defined(__i386__) && defined(__GNUCLIKE_ASM)
|
|
||||||
+static __inline int
|
+static __inline int
|
||||||
+irintf(float x)
|
+irintf(float x)
|
||||||
+{
|
+{
|
||||||
+ int n;
|
+ int n;
|
||||||
+
|
|
||||||
+ __asm("fistl %0" : "=m" (n) : "t" (x));
|
+ __asm("fistl %0" : "=m" (n) : "t" (x));
|
||||||
+ return (n);
|
+ return (n);
|
||||||
+}
|
+}
|
||||||
|
@ -27,12 +28,19 @@ Index: modules/fdlibm/src/math_private.h
|
||||||
+irintd(double x)
|
+irintd(double x)
|
||||||
+{
|
+{
|
||||||
+ int n;
|
+ int n;
|
||||||
|
+ __asm("fistl %0" : "=m" (n) : "t" (x));
|
||||||
|
+ return (n);
|
||||||
|
+}
|
||||||
+
|
+
|
||||||
|
+static __inline int
|
||||||
|
+irintl(long x)
|
||||||
|
+{
|
||||||
|
+ int n;
|
||||||
+ __asm("fistl %0" : "=m" (n) : "t" (x));
|
+ __asm("fistl %0" : "=m" (n) : "t" (x));
|
||||||
+ return (n);
|
+ return (n);
|
||||||
+}
|
+}
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
/*
|
#define irint(x) \
|
||||||
* irint() and i64rint() give the same result as casting to their integer
|
(sizeof(x) == sizeof(float) && \
|
||||||
* return type provided their arg is a floating point integer. They can
|
sizeof(__float_t) == sizeof(long double) ? irintf(x) : \
|
||||||
|
|
Loading…
Add table
Reference in a new issue