<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-legacy-support.
</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/fa92ff2aa5577853edb56ba7898c6f7103beee52">https://github.com/macports/macports-legacy-support/commit/fa92ff2aa5577853edb56ba7898c6f7103beee52</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit fa92ff2aa5577853edb56ba7898c6f7103beee52
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Thu Jun 6 21:09:24 2024 -0700
<span style='display:block; white-space:pre;color:#404040;'> sincos: Implement sincos[f]_stret
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Builds with 10.9+ SDKs expect these functions as part of an improved
</span><span style='display:block; white-space:pre;color:#404040;'> internal interface, but they don't become available until 10.9.
</span><span style='display:block; white-space:pre;color:#404040;'> Builds targeting 10.6 or earlier don't use them, but we don't worry
</span><span style='display:block; white-space:pre;color:#404040;'> about that.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> We don't try to do anything fancy - this just creates a compatible
</span><span style='display:block; white-space:pre;color:#404040;'> interface to the two-call approach.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Re: https://trac.macports.org/ticket/69867
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> TESTED:
</span><span style='display:block; white-space:pre;color:#404040;'> Tested on 10.4-10.5 ppc, 10.5-10.6 ppc (i386 Rosetta), 10.4-10.6 i386,
</span><span style='display:block; white-space:pre;color:#404040;'> 10.5-12.x x86_64, and 11.x-14.x arm64. Tested against all 10.4-14.x
</span><span style='display:block; white-space:pre;color:#404040;'> SDKs, using the headerinfo manual test (from a subsequent commit).
</span><span style='display:block; white-space:pre;color:#404040;'> All target/SDK combinations where the SDK supports the CPU
</span><span style='display:block; white-space:pre;color:#404040;'> architecture work correctly, including all SDKs on Intel
</span><span style='display:block; white-space:pre;color:#404040;'> architectures. Only 10.4-10.6 SDKs support ppc, and only 11.x+ SDKs
</span><span style='display:block; white-space:pre;color:#404040;'> support arm64.
</span>---
src/sincos.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/sincos.c b/src/sincos.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 315ecbf..f0940a4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/sincos.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/sincos.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -35,4 +35,33 @@ void __sincos(double __x, double *__sinp, double *__cosp) {
</span> *__cosp = cos(__x);
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * The following definitions are only used on a 10.7+ build with a 10.9+ SDK.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * The comment and declarations are from the 10.9 math.h.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * The function definitions are new.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Implementation details of __sincos and __sincospi allowing them to return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ two results while allowing the compiler to optimize away unnecessary load-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ store traffic. Although these interfaces are exposed in the math.h header
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ to allow compilers to generate better code, users should call __sincos[f]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and __sincospi[f] instead and allow the compiler to emit these calls. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+struct __float2 { float __sinval; float __cosval; };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+struct __double2 { double __sinval; double __cosval; };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+struct __float2 __sincosf_stret(float __x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const struct __float2 __stret = {.__sinval = sinf(__x),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .__cosval = cosf(__x)};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return __stret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+struct __double2 __sincos_stret(double __x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const struct __double2 __stret = {.__sinval = sin(__x),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .__cosval = cos(__x)};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return __stret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> #endif /* __MP_LEGACY_SUPPORT_COSSIN__ */
</pre><pre style='margin:0'>
</pre>