From 9c4bcc617b25fdcbac0bd8372cdc545dfa1f0bd7 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Wed, 18 Dec 2013 08:20:56 -0800
Subject: [PATCH] Move ieee754_rem_pio2 to os-common.c.  Remove the version in
 from x86-arch.c and ppc-arch.c

---
 src/lisp/os-common.c | 16 ++++++++++++++++
 src/lisp/ppc-arch.c  | 14 --------------
 src/lisp/x86-arch.c  | 16 ----------------
 3 files changed, 16 insertions(+), 30 deletions(-)

diff --git a/src/lisp/os-common.c b/src/lisp/os-common.c
index 2ba4bfd81..90458c950 100755
--- a/src/lisp/os-common.c
+++ b/src/lisp/os-common.c
@@ -542,3 +542,19 @@ os_guard_control_stack(int zone, int guard)
 }
 
 #endif /* not RED_ZONE_HIT */
+
+
+/* Simple interface to __ieee754_rem_pio2 */
+int ieee754_rem_pio2(double x, double *y0, double *y1)
+{
+  extern int __ieee754_rem_pio2(double x, double *y);
+
+  double y[2];
+  int n;
+
+  n = __ieee754_rem_pio2(x, y);
+  *y0 = y[0];
+  *y1 = y[1];
+
+  return n;
+}
diff --git a/src/lisp/ppc-arch.c b/src/lisp/ppc-arch.c
index 6c2ef6b66..c46b99c80 100644
--- a/src/lisp/ppc-arch.c
+++ b/src/lisp/ppc-arch.c
@@ -723,17 +723,3 @@ arch_linkage_entry(unsigned long retaddr)
 	/ LinkageEntrySize;
 }
 #endif
-
-int ieee754_rem_pio2(double x, double *y0, double *y1)
-{
-  extern int __ieee754_rem_pio2(double x, double *y);
-
-  double y[2];
-  int n;
-
-  n = __ieee754_rem_pio2(x, y);
-  *y0 = y[0];
-  *y1 = y[1];
-
-  return n;
-}
diff --git a/src/lisp/x86-arch.c b/src/lisp/x86-arch.c
index 56703348f..c694ceae9 100644
--- a/src/lisp/x86-arch.c
+++ b/src/lisp/x86-arch.c
@@ -521,19 +521,3 @@ arch_linkage_entry(unsigned long retaddr)
     return ((retaddr - 5) - FOREIGN_LINKAGE_SPACE_START) / LinkageEntrySize;
 }
 #endif /* LINKAGE_TABLE */
-
-int ieee754_rem_pio2(double x, double *y0, double *y1)
-{
-  extern int __ieee754_rem_pio2(double x, double *y);
-
-  double y[2];
-  int n;
-
-  n = __ieee754_rem_pio2(x, y);
-  *y0 = y[0];
-  *y1 = y[1];
-
-  return n;
-}
-
-  
-- 
GitLab