From 30696a3a294bf520a303108d6ada81c741cd2590 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Wed, 23 Jul 2014 21:24:11 -0700
Subject: [PATCH] Add fdlibm trig for sparc.

Sparc's libm almost gets everything right but it fails two tests;

 | Failed Form: (COS (* 13/4 PI))
 | Expected -0.7071067811865471d0 but saw -0.7071067811865472d0
 |
 | Failed Form: (SIN (SCALE-FLOAT 1.0d0 120))
 | Expected 0.377820109360752d0 but saw 0.37782010936075205d0

In both of these cases, the expected value is the correct one, as
confirmed by computing these values with maxima to 64 digits of
precision.  (Care must be used to look at the actual bits instead of
rounding the printed decimal form.)
---
 src/lisp/Config.sparc_sunc | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/lisp/Config.sparc_sunc b/src/lisp/Config.sparc_sunc
index 2e0b4e069..ffe4598be 100644
--- a/src/lisp/Config.sparc_sunc
+++ b/src/lisp/Config.sparc_sunc
@@ -28,3 +28,22 @@ CFLAGS += -xlibmieee -O
 DEPEND_FLAGS = -xM
 ASFLAGS = $(AS_V8PLUS)
 OS_LINK_FLAGS = -M /usr/lib/ld/map.noexstk
+
+OS_SRC += k_sin.c k_cos.c k_tan.c s_sin.c s_cos.c s_tan.c sincos.c
+
+k_sin.o : k_sin.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+k_cos.o : k_cos.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+k_tan.o : k_tan.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+
+s_sin.o : s_sin.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+s_cos.o : s_cos.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+s_tan.o : s_tan.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
+
+sincos.o : sincos.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(CC_REM_PIO2) $<
-- 
GitLab