summaryrefslogtreecommitdiff
path: root/lib/libm/arch/amd64
diff options
context:
space:
mode:
authormortimer <mortimer@cvs.openbsd.org>2018-07-03 22:43:35 +0000
committermortimer <mortimer@cvs.openbsd.org>2018-07-03 22:43:35 +0000
commit8e58489b257b1aa53deea6bd33d90e6de1e2ab94 (patch)
tree94b4dbbda5a790cea831ab3057988e9a68655302 /lib/libm/arch/amd64
parent7172f60910c3353e8a649d297b80d3bcab9cabfe (diff)
Add retguard macros to libm assembly.
ok deraadt
Diffstat (limited to 'lib/libm/arch/amd64')
-rw-r--r--lib/libm/arch/amd64/e_acos.S4
-rw-r--r--lib/libm/arch/amd64/e_asin.S4
-rw-r--r--lib/libm/arch/amd64/e_atan2.S4
-rw-r--r--lib/libm/arch/amd64/e_atan2f.S4
-rw-r--r--lib/libm/arch/amd64/e_exp.S6
-rw-r--r--lib/libm/arch/amd64/e_fmod.S4
-rw-r--r--lib/libm/arch/amd64/e_log.S4
-rw-r--r--lib/libm/arch/amd64/e_log10.S4
-rw-r--r--lib/libm/arch/amd64/e_remainder.S4
-rw-r--r--lib/libm/arch/amd64/e_remainderf.S4
-rw-r--r--lib/libm/arch/amd64/e_scalb.S4
-rw-r--r--lib/libm/arch/amd64/e_sqrt.S4
-rw-r--r--lib/libm/arch/amd64/e_sqrtf.S4
-rw-r--r--lib/libm/arch/amd64/e_sqrtl.S4
-rw-r--r--lib/libm/arch/amd64/s_atan.S4
-rw-r--r--lib/libm/arch/amd64/s_atanf.S4
-rw-r--r--lib/libm/arch/amd64/s_ceil.S4
-rw-r--r--lib/libm/arch/amd64/s_ceilf.S4
-rw-r--r--lib/libm/arch/amd64/s_copysign.S4
-rw-r--r--lib/libm/arch/amd64/s_copysignf.S4
-rw-r--r--lib/libm/arch/amd64/s_cos.S4
-rw-r--r--lib/libm/arch/amd64/s_cosf.S4
-rw-r--r--lib/libm/arch/amd64/s_floor.S4
-rw-r--r--lib/libm/arch/amd64/s_floorf.S4
-rw-r--r--lib/libm/arch/amd64/s_ilogb.S4
-rw-r--r--lib/libm/arch/amd64/s_ilogbf.S4
-rw-r--r--lib/libm/arch/amd64/s_llrint.S4
-rw-r--r--lib/libm/arch/amd64/s_llrintf.S4
-rw-r--r--lib/libm/arch/amd64/s_log1p.S5
-rw-r--r--lib/libm/arch/amd64/s_log1pf.S5
-rw-r--r--lib/libm/arch/amd64/s_logb.S4
-rw-r--r--lib/libm/arch/amd64/s_logbf.S4
-rw-r--r--lib/libm/arch/amd64/s_lrint.S4
-rw-r--r--lib/libm/arch/amd64/s_lrintf.S4
-rw-r--r--lib/libm/arch/amd64/s_rint.S4
-rw-r--r--lib/libm/arch/amd64/s_rintf.S4
-rw-r--r--lib/libm/arch/amd64/s_scalbnf.S4
-rw-r--r--lib/libm/arch/amd64/s_significand.S4
-rw-r--r--lib/libm/arch/amd64/s_significandf.S4
-rw-r--r--lib/libm/arch/amd64/s_sin.S5
-rw-r--r--lib/libm/arch/amd64/s_sinf.S4
-rw-r--r--lib/libm/arch/amd64/s_tan.S5
-rw-r--r--lib/libm/arch/amd64/s_tanf.S4
43 files changed, 135 insertions, 43 deletions
diff --git a/lib/libm/arch/amd64/e_acos.S b/lib/libm/arch/amd64/e_acos.S
index 01231e67c50..1a6b2cb0f61 100644
--- a/lib/libm/arch/amd64/e_acos.S
+++ b/lib/libm/arch/amd64/e_acos.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_acos.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_acos.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,6 +10,7 @@
/* acos = atan (sqrt(1 - x^2) / x) */
ENTRY(acos)
+ RETGUARD_SETUP(acos, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE /* x */
fld %st(0)
@@ -20,5 +21,6 @@ ENTRY(acos)
fxch %st(1)
fpatan
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(acos, r11)
ret
END(acos)
diff --git a/lib/libm/arch/amd64/e_asin.S b/lib/libm/arch/amd64/e_asin.S
index 44eb4b87256..c132ea34d28 100644
--- a/lib/libm/arch/amd64/e_asin.S
+++ b/lib/libm/arch/amd64/e_asin.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_asin.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_asin.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,6 +10,7 @@
/* asin = atan (x / sqrt(1 - x^2)) */
ENTRY(asin)
+ RETGUARD_SETUP(asin, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE /* x */
fld %st(0)
@@ -19,5 +20,6 @@ ENTRY(asin)
fsqrt /* sqrt (1 - x^2) */
fpatan
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(asin, r11)
ret
END_STD(asin)
diff --git a/lib/libm/arch/amd64/e_atan2.S b/lib/libm/arch/amd64/e_atan2.S
index 6fbcc6bcd4f..ddaec850886 100644
--- a/lib/libm/arch/amd64/e_atan2.S
+++ b/lib/libm/arch/amd64/e_atan2.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_atan2.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_atan2.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(atan2)
+ RETGUARD_SETUP(atan2, r11)
XMM_TWO_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fldl ARG_DOUBLE_TWO
fpatan
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(atan2, r11)
ret
END_STD(atan2)
diff --git a/lib/libm/arch/amd64/e_atan2f.S b/lib/libm/arch/amd64/e_atan2f.S
index af9f9bb26f6..a80234a1c76 100644
--- a/lib/libm/arch/amd64/e_atan2f.S
+++ b/lib/libm/arch/amd64/e_atan2f.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_atan2f.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_atan2f.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(atan2f)
+ RETGUARD_SETUP(atan2f, r11)
XMM_TWO_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
flds ARG_FLOAT_TWO
fpatan
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(atan2f, r11)
ret
END_STD(atan2f)
diff --git a/lib/libm/arch/amd64/e_exp.S b/lib/libm/arch/amd64/e_exp.S
index 61df362b078..f67850cf05f 100644
--- a/lib/libm/arch/amd64/e_exp.S
+++ b/lib/libm/arch/amd64/e_exp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_exp.S,v 1.6 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_exp.S,v 1.7 2018/07/03 22:43:34 mortimer Exp $ */
/* $NetBSD: e_exp.S,v 1.12 2002/02/27 16:32:46 christos Exp $ */
/*
@@ -42,6 +42,7 @@
/* e^x = 2^(x * log2(e)) */
ENTRY(exp)
+ RETGUARD_SETUP(exp, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
/*
* If x is +-Inf, then the subtraction would give Inf-Inf = NaN.
@@ -82,6 +83,7 @@ ENTRY(exp)
fldcw -8(%rsp)
1:
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(exp, r11)
ret
x_Inf_or_NaN:
@@ -94,9 +96,11 @@ x_Inf_or_NaN:
cmpl $0,-8(%rsp)
jne x_not_minus_Inf
xorpd %xmm0,%xmm0
+ RETGUARD_CHECK(exp, r11)
ret
x_not_minus_Inf:
movsd ARG_DOUBLE_ONE,%xmm0
+ RETGUARD_CHECK(exp, r11)
ret
END_STD(exp)
diff --git a/lib/libm/arch/amd64/e_fmod.S b/lib/libm/arch/amd64/e_fmod.S
index 62777f170ac..dc97939d2a1 100644
--- a/lib/libm/arch/amd64/e_fmod.S
+++ b/lib/libm/arch/amd64/e_fmod.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_fmod.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_fmod.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,6 +10,7 @@
ENTRY(fmod)
+ RETGUARD_SETUP(fmod, r11)
XMM_TWO_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_TWO
fldl ARG_DOUBLE_ONE
@@ -19,5 +20,6 @@ ENTRY(fmod)
jc 1b
fstp %st(1)
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(fmod, r11)
ret
END(fmod)
diff --git a/lib/libm/arch/amd64/e_log.S b/lib/libm/arch/amd64/e_log.S
index 16c7a77598e..ad9bedbfcc8 100644
--- a/lib/libm/arch/amd64/e_log.S
+++ b/lib/libm/arch/amd64/e_log.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_log.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_log.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(log)
+ RETGUARD_SETUP(log, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldln2
fldl ARG_DOUBLE_ONE
fyl2x
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(log, r11)
ret
END_STD(log)
diff --git a/lib/libm/arch/amd64/e_log10.S b/lib/libm/arch/amd64/e_log10.S
index 6774d928a65..6d67ac06b99 100644
--- a/lib/libm/arch/amd64/e_log10.S
+++ b/lib/libm/arch/amd64/e_log10.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_log10.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_log10.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(log10)
+ RETGUARD_SETUP(log10, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldlg2
fldl ARG_DOUBLE_ONE
fyl2x
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(log10, r11)
ret
END(log10)
diff --git a/lib/libm/arch/amd64/e_remainder.S b/lib/libm/arch/amd64/e_remainder.S
index 31290dfd9c6..5e3b5fa014a 100644
--- a/lib/libm/arch/amd64/e_remainder.S
+++ b/lib/libm/arch/amd64/e_remainder.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_remainder.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_remainder.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(remainder)
+ RETGUARD_SETUP(remainder, r11)
XMM_TWO_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_TWO
fldl ARG_DOUBLE_ONE
@@ -18,5 +19,6 @@ ENTRY(remainder)
jc 1b
fstp %st(1)
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(remainder, r11)
ret
END_STD(remainder)
diff --git a/lib/libm/arch/amd64/e_remainderf.S b/lib/libm/arch/amd64/e_remainderf.S
index 39bd10f0d33..2c1f42ba0df 100644
--- a/lib/libm/arch/amd64/e_remainderf.S
+++ b/lib/libm/arch/amd64/e_remainderf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_remainderf.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_remainderf.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(remainderf)
+ RETGUARD_SETUP(remainderf, r11)
XMM_TWO_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_TWO
flds ARG_FLOAT_ONE
@@ -18,5 +19,6 @@ ENTRY(remainderf)
jc 1b
fstp %st(1)
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(remainderf, r11)
ret
END_STD(remainderf)
diff --git a/lib/libm/arch/amd64/e_scalb.S b/lib/libm/arch/amd64/e_scalb.S
index 0b509bd8d90..a43318e7e54 100644
--- a/lib/libm/arch/amd64/e_scalb.S
+++ b/lib/libm/arch/amd64/e_scalb.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_scalb.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_scalb.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,11 +9,13 @@
#include "abi.h"
ENTRY(scalb)
+ RETGUARD_SETUP(scalb, r11)
XMM_TWO_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_TWO
fldl ARG_DOUBLE_ONE
fscale
fstp %st(1) /* bug fix for fp stack overflow */
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(scalb, r11)
ret
END_NONSTD(scalb)
diff --git a/lib/libm/arch/amd64/e_sqrt.S b/lib/libm/arch/amd64/e_sqrt.S
index 07d121a531f..dd46e95132e 100644
--- a/lib/libm/arch/amd64/e_sqrt.S
+++ b/lib/libm/arch/amd64/e_sqrt.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_sqrt.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_sqrt.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,6 +8,8 @@
#include "abi.h"
ENTRY(sqrt)
+ RETGUARD_SETUP(sqrt, r11)
sqrtsd %xmm0,%xmm0
+ RETGUARD_CHECK(sqrt, r11)
ret
END_STD(sqrt)
diff --git a/lib/libm/arch/amd64/e_sqrtf.S b/lib/libm/arch/amd64/e_sqrtf.S
index 1a8a5616127..17ef76b1751 100644
--- a/lib/libm/arch/amd64/e_sqrtf.S
+++ b/lib/libm/arch/amd64/e_sqrtf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_sqrtf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_sqrtf.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,6 +8,8 @@
#include "abi.h"
ENTRY(sqrtf)
+ RETGUARD_SETUP(sqrtf, r11)
sqrtss %xmm0,%xmm0
+ RETGUARD_CHECK(sqrtf, r11)
ret
END_STD(sqrtf)
diff --git a/lib/libm/arch/amd64/e_sqrtl.S b/lib/libm/arch/amd64/e_sqrtl.S
index 71ab6bdd5f2..bbe998846d9 100644
--- a/lib/libm/arch/amd64/e_sqrtl.S
+++ b/lib/libm/arch/amd64/e_sqrtl.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_sqrtl.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: e_sqrtl.S,v 1.3 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
@@ -8,7 +8,9 @@
#include "abi.h"
ENTRY(sqrtl)
+ RETGUARD_SETUP(sqrtl, r11)
fldt 8(%rsp)
fsqrt
+ RETGUARD_CHECK(sqrtl, r11)
ret
END_STD(sqrtl)
diff --git a/lib/libm/arch/amd64/s_atan.S b/lib/libm/arch/amd64/s_atan.S
index 9c2ac3bbd2f..026d1ab398e 100644
--- a/lib/libm/arch/amd64/s_atan.S
+++ b/lib/libm/arch/amd64/s_atan.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_atan.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_atan.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(atan)
+ RETGUARD_SETUP(atan, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fld1
fpatan
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(atan, r11)
ret
END(atan)
diff --git a/lib/libm/arch/amd64/s_atanf.S b/lib/libm/arch/amd64/s_atanf.S
index d36843d41dd..b2705fb2010 100644
--- a/lib/libm/arch/amd64/s_atanf.S
+++ b/lib/libm/arch/amd64/s_atanf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_atanf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_atanf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(atanf)
+ RETGUARD_SETUP(atanf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fld1
fpatan
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(atanf, r11)
ret
END_STD(atanf)
diff --git a/lib/libm/arch/amd64/s_ceil.S b/lib/libm/arch/amd64/s_ceil.S
index 3cb26b6cde9..88dd13bc416 100644
--- a/lib/libm/arch/amd64/s_ceil.S
+++ b/lib/libm/arch/amd64/s_ceil.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_ceil.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_ceil.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(ceil)
+ RETGUARD_SETUP(ceil, r11)
fstcw -12(%rsp)
movw -12(%rsp),%dx
orw $0x0800,%dx
@@ -21,5 +22,6 @@ ENTRY(ceil)
fldcw -12(%rsp)
fstpl -8(%rsp)
movsd -8(%rsp),%xmm0
+ RETGUARD_CHECK(ceil, r11)
ret
END_STD(ceil)
diff --git a/lib/libm/arch/amd64/s_ceilf.S b/lib/libm/arch/amd64/s_ceilf.S
index 12f7f2cf37e..110616cc8bf 100644
--- a/lib/libm/arch/amd64/s_ceilf.S
+++ b/lib/libm/arch/amd64/s_ceilf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_ceilf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_ceilf.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -7,6 +7,7 @@
#include <machine/asm.h>
ENTRY(ceilf)
+ RETGUARD_SETUP(ceilf, r11)
fstcw -8(%rsp)
movw -8(%rsp),%dx
orw $0x0800,%dx
@@ -19,5 +20,6 @@ ENTRY(ceilf)
fldcw -8(%rsp)
fstps -4(%rsp)
movss -4(%rsp),%xmm0
+ RETGUARD_CHECK(ceilf, r11)
ret
END(ceilf)
diff --git a/lib/libm/arch/amd64/s_copysign.S b/lib/libm/arch/amd64/s_copysign.S
index 480f498811d..b4e71096be3 100644
--- a/lib/libm/arch/amd64/s_copysign.S
+++ b/lib/libm/arch/amd64/s_copysign.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_copysign.S,v 1.7 2018/02/05 04:01:49 deraadt Exp $ */
+/* $OpenBSD: s_copysign.S,v 1.8 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -15,10 +15,12 @@
.quad 0x7fffffffffffffff
ENTRY(copysign)
+ RETGUARD_SETUP(copysign, r11)
movq .Lpos(%rip),%xmm2
movq .Lneg(%rip),%xmm3
pand %xmm2,%xmm1
pand %xmm3,%xmm0
por %xmm1,%xmm0
+ RETGUARD_CHECK(copysign, r11)
ret
END_STD(copysign)
diff --git a/lib/libm/arch/amd64/s_copysignf.S b/lib/libm/arch/amd64/s_copysignf.S
index da8b2301033..58c63a9b4f8 100644
--- a/lib/libm/arch/amd64/s_copysignf.S
+++ b/lib/libm/arch/amd64/s_copysignf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_copysignf.S,v 1.7 2018/02/05 04:01:49 deraadt Exp $ */
+/* $OpenBSD: s_copysignf.S,v 1.8 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -15,10 +15,12 @@
.long 0x80000000
ENTRY(copysignf)
+ RETGUARD_SETUP(copysignf, r11)
movss .Lpos(%rip),%xmm2
movss .Lneg(%rip),%xmm3
pand %xmm2,%xmm1
pand %xmm3,%xmm0
por %xmm1,%xmm0
+ RETGUARD_CHECK(copysignf, r11)
ret
END_STD(copysignf)
diff --git a/lib/libm/arch/amd64/s_cos.S b/lib/libm/arch/amd64/s_cos.S
index cb382696914..0b85c58bbe9 100644
--- a/lib/libm/arch/amd64/s_cos.S
+++ b/lib/libm/arch/amd64/s_cos.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_cos.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_cos.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(cos)
+ RETGUARD_SETUP(cos, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fcos
@@ -27,5 +28,6 @@ ENTRY(cos)
fstp %st(1)
fcos
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(cos, r11)
ret
END_STD(cos)
diff --git a/lib/libm/arch/amd64/s_cosf.S b/lib/libm/arch/amd64/s_cosf.S
index 15fe9afcf89..3e7539d829c 100644
--- a/lib/libm/arch/amd64/s_cosf.S
+++ b/lib/libm/arch/amd64/s_cosf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_cosf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_cosf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,9 +10,11 @@
/* A float's domain isn't large enough to require argument reduction. */
ENTRY(cosf)
+ RETGUARD_SETUP(cosf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fcos
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(cosf, r11)
ret
END_STD(cosf)
diff --git a/lib/libm/arch/amd64/s_floor.S b/lib/libm/arch/amd64/s_floor.S
index adff8b4e7c8..65824176d21 100644
--- a/lib/libm/arch/amd64/s_floor.S
+++ b/lib/libm/arch/amd64/s_floor.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_floor.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_floor.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,6 +8,7 @@
#include "abi.h"
ENTRY(floor)
+ RETGUARD_SETUP(floor, r11)
movsd %xmm0, -8(%rsp)
fstcw -12(%rsp)
movw -12(%rsp),%dx
@@ -20,5 +21,6 @@ ENTRY(floor)
fldcw -12(%rsp)
fstpl -8(%rsp)
movsd -8(%rsp),%xmm0
+ RETGUARD_CHECK(floor, r11)
ret
END_STD(floor)
diff --git a/lib/libm/arch/amd64/s_floorf.S b/lib/libm/arch/amd64/s_floorf.S
index 4c161831d1b..dd17b6f18ab 100644
--- a/lib/libm/arch/amd64/s_floorf.S
+++ b/lib/libm/arch/amd64/s_floorf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_floorf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_floorf.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,6 +8,7 @@
#include "abi.h"
ENTRY(floorf)
+ RETGUARD_SETUP(floorf, r11)
movss %xmm0, -4(%rsp)
fstcw -8(%rsp)
movw -8(%rsp),%dx
@@ -20,5 +21,6 @@ ENTRY(floorf)
fldcw -8(%rsp)
fstps -4(%rsp)
movss -4(%rsp),%xmm0
+ RETGUARD_CHECK(floorf, r11)
ret
END_STD(floorf)
diff --git a/lib/libm/arch/amd64/s_ilogb.S b/lib/libm/arch/amd64/s_ilogb.S
index e516d1e197d..6ef0d469575 100644
--- a/lib/libm/arch/amd64/s_ilogb.S
+++ b/lib/libm/arch/amd64/s_ilogb.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_ilogb.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_ilogb.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,11 +8,13 @@
#include "abi.h"
ENTRY(ilogb)
+ RETGUARD_SETUP(ilogb, r11)
movsd %xmm0,-8(%rsp)
fldl -8(%rsp)
fxtract
fstp %st
fistpl -8(%rsp)
movl -8(%rsp),%eax
+ RETGUARD_CHECK(ilogb, r11)
ret
END_STD(ilogb)
diff --git a/lib/libm/arch/amd64/s_ilogbf.S b/lib/libm/arch/amd64/s_ilogbf.S
index b943f850ecd..29bf3af13bc 100644
--- a/lib/libm/arch/amd64/s_ilogbf.S
+++ b/lib/libm/arch/amd64/s_ilogbf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_ilogbf.S,v 1.4 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_ilogbf.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -8,11 +8,13 @@
#include "abi.h"
ENTRY(ilogbf)
+ RETGUARD_SETUP(ilogbf, r11)
movss %xmm0,-4(%rsp)
flds -4(%rsp)
fxtract
fstp %st
fistpl -4(%rsp)
movl -4(%rsp),%eax
+ RETGUARD_CHECK(ilogbf, r11)
ret
END_STD(ilogbf)
diff --git a/lib/libm/arch/amd64/s_llrint.S b/lib/libm/arch/amd64/s_llrint.S
index aea32600ffe..4c974b8c79e 100644
--- a/lib/libm/arch/amd64/s_llrint.S
+++ b/lib/libm/arch/amd64/s_llrint.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_llrint.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_llrint.S,v 1.3 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by Martynas Venckus. Public domain
@@ -7,6 +7,8 @@
#include <machine/asm.h>
ENTRY(llrint)
+ RETGUARD_SETUP(llrint, r11)
cvtsd2si %xmm0, %rax
+ RETGUARD_CHECK(llrint, r11)
ret
END(llrint)
diff --git a/lib/libm/arch/amd64/s_llrintf.S b/lib/libm/arch/amd64/s_llrintf.S
index a800178a532..02fec84bc99 100644
--- a/lib/libm/arch/amd64/s_llrintf.S
+++ b/lib/libm/arch/amd64/s_llrintf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_llrintf.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_llrintf.S,v 1.3 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by Martynas Venckus. Public domain
@@ -8,6 +8,8 @@
#include "abi.h"
ENTRY(llrintf)
+ RETGUARD_SETUP(llrintf, r11)
cvtss2si %xmm0, %rax
+ RETGUARD_CHECK(llrintf, r11)
ret
END_STD(llrintf)
diff --git a/lib/libm/arch/amd64/s_log1p.S b/lib/libm/arch/amd64/s_log1p.S
index 4987ac8ff70..f3387463294 100644
--- a/lib/libm/arch/amd64/s_log1p.S
+++ b/lib/libm/arch/amd64/s_log1p.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_log1p.S,v 1.5 2017/08/19 18:27:19 deraadt Exp $ */
+/* $OpenBSD: s_log1p.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -40,6 +40,7 @@
*/
ENTRY(log1p)
+ RETGUARD_SETUP(log1p, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fabs
@@ -62,6 +63,7 @@ use_fyl2x:
faddp
fyl2x
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(log1p, r11)
ret
.align 4,0xcc
@@ -70,5 +72,6 @@ use_fyl2xp1:
fldl ARG_DOUBLE_ONE
fyl2xp1
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(log1p, r11)
ret
END_STD(log1p)
diff --git a/lib/libm/arch/amd64/s_log1pf.S b/lib/libm/arch/amd64/s_log1pf.S
index 3749449e2d2..b8fa85705c2 100644
--- a/lib/libm/arch/amd64/s_log1pf.S
+++ b/lib/libm/arch/amd64/s_log1pf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_log1pf.S,v 1.5 2017/08/19 18:27:19 deraadt Exp $ */
+/* $OpenBSD: s_log1pf.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -40,6 +40,7 @@
*/
ENTRY(log1pf)
+ RETGUARD_SETUP(log1pf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fabs
@@ -62,6 +63,7 @@ use_fyl2x:
faddp
fyl2x
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(log1pf, r11)
ret
.align 4,0xcc
@@ -70,5 +72,6 @@ use_fyl2xp1:
flds ARG_FLOAT_ONE
fyl2xp1
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(log1pf, r11)
ret
END_STD(log1pf)
diff --git a/lib/libm/arch/amd64/s_logb.S b/lib/libm/arch/amd64/s_logb.S
index 0703a1278e2..747642f7a27 100644
--- a/lib/libm/arch/amd64/s_logb.S
+++ b/lib/libm/arch/amd64/s_logb.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_logb.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_logb.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(logb)
+ RETGUARD_SETUP(logb, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fxtract
fstp %st
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(logb, r11)
ret
END_STD(logb)
diff --git a/lib/libm/arch/amd64/s_logbf.S b/lib/libm/arch/amd64/s_logbf.S
index c1cd84b1c20..bb85c11f5ae 100644
--- a/lib/libm/arch/amd64/s_logbf.S
+++ b/lib/libm/arch/amd64/s_logbf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_logbf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_logbf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,12 @@
#include "abi.h"
ENTRY(logbf)
+ RETGUARD_SETUP(logbf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fxtract
fstp %st
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(logbf, r11)
ret
END_STD(logbf)
diff --git a/lib/libm/arch/amd64/s_lrint.S b/lib/libm/arch/amd64/s_lrint.S
index 662b2b5046a..b58b8953cd3 100644
--- a/lib/libm/arch/amd64/s_lrint.S
+++ b/lib/libm/arch/amd64/s_lrint.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_lrint.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_lrint.S,v 1.3 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by Martynas Venckus. Public domain
@@ -7,6 +7,8 @@
#include <machine/asm.h>
ENTRY(lrint)
+ RETGUARD_SETUP(lrint, r11)
cvtsd2si %xmm0, %rax
+ RETGUARD_CHECK(lrint, r11)
ret
END(lrint)
diff --git a/lib/libm/arch/amd64/s_lrintf.S b/lib/libm/arch/amd64/s_lrintf.S
index 3e84734d4a6..17c0b88c9f8 100644
--- a/lib/libm/arch/amd64/s_lrintf.S
+++ b/lib/libm/arch/amd64/s_lrintf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_lrintf.S,v 1.2 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_lrintf.S,v 1.3 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by Martynas Venckus. Public domain
@@ -7,6 +7,8 @@
#include <machine/asm.h>
ENTRY(lrintf)
+ RETGUARD_SETUP(lrintf, r11)
cvtss2si %xmm0, %rax
+ RETGUARD_CHECK(lrintf, r11)
ret
END(lrintf)
diff --git a/lib/libm/arch/amd64/s_rint.S b/lib/libm/arch/amd64/s_rint.S
index e1716eb52ff..9462e7be82c 100644
--- a/lib/libm/arch/amd64/s_rint.S
+++ b/lib/libm/arch/amd64/s_rint.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_rint.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_rint.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,9 +9,11 @@
#include "abi.h"
ENTRY(rint)
+ RETGUARD_SETUP(rint, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
frndint
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(rint, r11)
ret
END_STD(rint)
diff --git a/lib/libm/arch/amd64/s_rintf.S b/lib/libm/arch/amd64/s_rintf.S
index 53a40725bcc..8fd10cd7947 100644
--- a/lib/libm/arch/amd64/s_rintf.S
+++ b/lib/libm/arch/amd64/s_rintf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_rintf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_rintf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,9 +9,11 @@
#include "abi.h"
ENTRY(rintf)
+ RETGUARD_SETUP(rintf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
frndint
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(rintf, r11)
ret
END_STD(rintf)
diff --git a/lib/libm/arch/amd64/s_scalbnf.S b/lib/libm/arch/amd64/s_scalbnf.S
index 1faecbec78a..4c7b131d240 100644
--- a/lib/libm/arch/amd64/s_scalbnf.S
+++ b/lib/libm/arch/amd64/s_scalbnf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_scalbnf.S,v 1.5 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_scalbnf.S,v 1.6 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -12,6 +12,7 @@
ldexpf = scalbnf
ENTRY(scalbnf)
+ RETGUARD_SETUP(scalbnf, r11)
movss %xmm0,-8(%rsp)
movl %edi,-4(%rsp)
fildl -4(%rsp)
@@ -20,5 +21,6 @@ ENTRY(scalbnf)
fstp %st(1) /* bug fix for fp stack overflow */
fstps -8(%rsp)
movss -8(%rsp),%xmm0
+ RETGUARD_CHECK(scalbnf, r11)
ret
END_STD(scalbnf)
diff --git a/lib/libm/arch/amd64/s_significand.S b/lib/libm/arch/amd64/s_significand.S
index d49a21e5496..78f221fda1a 100644
--- a/lib/libm/arch/amd64/s_significand.S
+++ b/lib/libm/arch/amd64/s_significand.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_significand.S,v 1.4 2018/03/12 04:27:48 guenther Exp $ */
+/* $OpenBSD: s_significand.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,11 +9,13 @@
#include "abi.h"
ENTRY(significand)
+ RETGUARD_SETUP(significand, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fxtract
fstp %st(1)
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(significand, r11)
ret
END(significand)
.weak significand
diff --git a/lib/libm/arch/amd64/s_significandf.S b/lib/libm/arch/amd64/s_significandf.S
index c16cb531568..c80dd2e2588 100644
--- a/lib/libm/arch/amd64/s_significandf.S
+++ b/lib/libm/arch/amd64/s_significandf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_significandf.S,v 1.4 2018/03/12 04:27:48 guenther Exp $ */
+/* $OpenBSD: s_significandf.S,v 1.5 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,11 +9,13 @@
#include "abi.h"
ENTRY(significandf)
+ RETGUARD_SETUP(significandf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fxtract
fstp %st(1)
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(significandf, r11)
ret
END(significandf)
.weak significandf
diff --git a/lib/libm/arch/amd64/s_sin.S b/lib/libm/arch/amd64/s_sin.S
index 6f21144001e..ade5a463516 100644
--- a/lib/libm/arch/amd64/s_sin.S
+++ b/lib/libm/arch/amd64/s_sin.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_sin.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_sin.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(sin)
+ RETGUARD_SETUP(sin, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fsin
@@ -16,6 +17,7 @@ ENTRY(sin)
andw $0x400,%ax
jnz 1f
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(sin, r11)
ret
1: fldpi
fadd %st(0)
@@ -27,5 +29,6 @@ ENTRY(sin)
fstp %st(1)
fsin
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(sin, r11)
ret
END_STD(sin)
diff --git a/lib/libm/arch/amd64/s_sinf.S b/lib/libm/arch/amd64/s_sinf.S
index d145f8c39db..91d3b9d27f7 100644
--- a/lib/libm/arch/amd64/s_sinf.S
+++ b/lib/libm/arch/amd64/s_sinf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_sinf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_sinf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,9 +10,11 @@
/* A float's domain isn't large enough to require argument reduction. */
ENTRY(sinf)
+ RETGUARD_SETUP(sinf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fsin
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(sinf, r11)
ret
END_STD(sinf)
diff --git a/lib/libm/arch/amd64/s_tan.S b/lib/libm/arch/amd64/s_tan.S
index 0e891fe2ee9..917681b3ec2 100644
--- a/lib/libm/arch/amd64/s_tan.S
+++ b/lib/libm/arch/amd64/s_tan.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_tan.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_tan.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,6 +9,7 @@
#include "abi.h"
ENTRY(tan)
+ RETGUARD_SETUP(tan, r11)
XMM_ONE_ARG_DOUBLE_PROLOGUE
fldl ARG_DOUBLE_ONE
fptan
@@ -17,6 +18,7 @@ ENTRY(tan)
jnz 1f
fstp %st(0)
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(tan, r11)
ret
1: fldpi
fadd %st(0)
@@ -29,5 +31,6 @@ ENTRY(tan)
fptan
fstp %st(0)
XMM_DOUBLE_EPILOGUE
+ RETGUARD_CHECK(tan, r11)
ret
END(tan)
diff --git a/lib/libm/arch/amd64/s_tanf.S b/lib/libm/arch/amd64/s_tanf.S
index 94b7a6d6028..f1f7c8bbc75 100644
--- a/lib/libm/arch/amd64/s_tanf.S
+++ b/lib/libm/arch/amd64/s_tanf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_tanf.S,v 1.3 2016/09/12 19:47:01 guenther Exp $ */
+/* $OpenBSD: s_tanf.S,v 1.4 2018/07/03 22:43:34 mortimer Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -10,10 +10,12 @@
/* A float's domain isn't large enough to require argument reduction. */
ENTRY(tanf)
+ RETGUARD_SETUP(tanf, r11)
XMM_ONE_ARG_FLOAT_PROLOGUE
flds ARG_FLOAT_ONE
fptan
fstp %st(0)
XMM_FLOAT_EPILOGUE
+ RETGUARD_CHECK(tanf, r11)
ret
END(tanf)