git: 2a8218e9dbbe - main - lang/spidermonkey91: Fix build on i386

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Sat, 16 Apr 2022 01:53:34 UTC
The branch main has been updated by nc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2a8218e9dbbeb207291b8604fcf34825ea9492b4

commit 2a8218e9dbbeb207291b8604fcf34825ea9492b4
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2022-04-16 01:53:31 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2022-04-16 01:53:31 +0000

    lang/spidermonkey91: Fix build on i386
---
 .../files/patch-modules_fdlibm_src_math__private.h | 37 ++++++++++++++++++----
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/lang/spidermonkey91/files/patch-modules_fdlibm_src_math__private.h b/lang/spidermonkey91/files/patch-modules_fdlibm_src_math__private.h
index db521fc65645..9294fa86f804 100644
--- a/lang/spidermonkey91/files/patch-modules_fdlibm_src_math__private.h
+++ b/lang/spidermonkey91/files/patch-modules_fdlibm_src_math__private.h
@@ -1,15 +1,38 @@
 Index: modules/fdlibm/src/math_private.h
---- modules/fdlibm/src/math_private.h.orig	2022-03-30 19:25:49 UTC
+--- modules/fdlibm/src/math_private.h.orig	2022-04-16 01:44:07 UTC
 +++ modules/fdlibm/src/math_private.h
-@@ -30,7 +30,11 @@
-  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
-  */
+@@ -634,6 +634,34 @@ rnint(__double_t x)
+ 	return ((double)(x + 0x1.8p52) - 0x1.8p52);
+ }
  
 +#ifdef __i386__
 +typedef long double      __double_t;
 +#else
- typedef double      __double_t;
++typedef double      __double_t;
 +#endif
- typedef __double_t  double_t;
- 
++typedef __double_t  double_t;
++
++/* This is needed on FreeBSD i386. */
++#if defined(__i386__) && defined(__GNUCLIKE_ASM)
++static __inline int
++irintf(float x)
++{
++	int n;
++
++	__asm("fistl %0" : "=m" (n) : "t" (x));
++	return (n);
++}
++
++static __inline int
++irintd(double x)
++{
++	int n;
++
++	__asm("fistl %0" : "=m" (n) : "t" (x));
++	return (n);
++}
++#endif
++
  /*
+  * irint() and i64rint() give the same result as casting to their integer
+  * return type provided their arg is a floating point integer.  They can