<pre style='margin:0'>
Mohamed Akram (mohd-akram) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/f575f8a3495ba5afbe640a4a3dbb14f3afc44e28">https://github.com/macports/macports-ports/commit/f575f8a3495ba5afbe640a4a3dbb14f3afc44e28</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new f575f8a3495 chez-scheme: Only use intrinsics if available
</span>f575f8a3495 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit f575f8a3495ba5afbe640a4a3dbb14f3afc44e28
</span>Author: Ryan Carsten Schmidt <ryandesign@macports.org>
AuthorDate: Thu Jun 27 01:01:15 2024 -0500
<span style='display:block; white-space:pre;color:#404040;'> chez-scheme: Only use intrinsics if available
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/70278
</span>---
lang/chez-scheme/Portfile | 2 +
lang/chez-scheme/files/intrinsics.patch | 78 +++++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/chez-scheme/Portfile b/lang/chez-scheme/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index cd107fb1c3a..7c485b5ec12 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/chez-scheme/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/chez-scheme/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -31,6 +31,8 @@ depends_lib port:zlib \
</span> port:libiconv \
port:xorg-libX11
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles intrinsics.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> configure.pre_args --installprefix=${prefix}
configure.args --temproot=${destroot} \
--threads \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/chez-scheme/files/intrinsics.patch b/lang/chez-scheme/files/intrinsics.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..5ba8f391628
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/chez-scheme/files/intrinsics.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,78 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Only use intrinsics when the compiler supports them.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/cisco/ChezScheme/issues/845
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/cisco/ChezScheme/commit/f1ad314a3809074c6f2b986a5db6a84ad88700c1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- c/atomic.h.orig 2024-02-05 16:52:07.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ c/atomic.h 2024-06-27 00:56:20.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -114,7 +114,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define CAS_LOAD_ACQUIRE(a, old, new) S_cas_any_fence(1, a, old, new)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define CAS_STORE_RELEASE(a, old, new) S_cas_any_fence(0, a, old, new)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif (__GNUC__ >= 5) || defined(__clang__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (__GNUC__ >= 5) || C_COMPILER_HAS_BUILTIN(__sync_bool_compare_and_swap)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define CAS_ANY_FENCE(a, old, new) __sync_bool_compare_and_swap((ptr *)(a), TO_PTR(old), TO_PTR(new))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__i386__) || defined(__x86_64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # if ptr_bits == 64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- c/pb.h.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ c/pb.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -71,12 +71,25 @@ enum {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define SIGN_FLIP(r, a, b) ((~((a ^ b) | (r ^ ~b))) >> (ptr_bits-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if (__GNUC__ >= 5) || defined(__clang__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if C_COMPILER_HAS_BUILTIN(__builtin_add_overflow) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && C_COMPILER_HAS_BUILTIN(__builtin_sub_overflow) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && C_COMPILER_HAS_BUILTIN(__builtin_mul_overflow)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define USE_OVERFLOW_INTRINSICS 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (__GNUC__ >= 5)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define USE_OVERFLOW_INTRINSICS 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define USE_OVERFLOW_INTRINSICS 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if C_COMPILER_HAS_BUILTIN(__builtin_bswap16) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && C_COMPILER_HAS_BUILTIN(__builtin_bswap32)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define USE_BSWAP_INTRINSICS 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (__GNUC__ >= 5)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define USE_BSWAP_INTRINSICS 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define USE_BSWAP_INTRINSICS 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Use `machine_state * RESTRICT_PTR`, because machine registers won't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ be modified in any way other than through the machine-state pointer */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -714,7 +727,7 @@ enum {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if ptr_bits == 64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define doi_pb_rev_op_pb_int16_pb_register(instr) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ do_pb_rev_op_pb_int16_pb_register(INSTR_dr_dest(instr), INSTR_dr_reg(instr))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# if USE_OVERFLOW_INTRINSICS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# if USE_BSWAP_INTRINSICS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* See note below on unsigned swap. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define do_pb_rev_op_pb_int16_pb_register(dest, reg) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ regs[dest] = ((uptr)(((iptr)((uptr)__builtin_bswap16(regs[reg]) << 48)) >> 48))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -740,7 +753,7 @@ enum {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if ptr_bits == 64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define doi_pb_rev_op_pb_int32_pb_register(instr) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ do_pb_rev_op_pb_int32_pb_register(INSTR_dr_dest(instr), INSTR_dr_reg(instr))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# if USE_OVERFLOW_INTRINSICS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# if USE_BSWAP_INTRINSICS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* x86_64 GCC before 12.2 incorrectly compiles the code below to an unsigned swap.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Defeat that by using the unsigned-swap intrinsic (which is good, anyway), then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ shift up and back. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- c/version.h.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ c/version.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,6 +33,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define FORCEINLINE static inline
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* GCC 10 and later and all versions of Clang provide `__has_builtin` for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ checking for builtins. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __has_builtin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define C_COMPILER_HAS_BUILTIN(x) __has_builtin(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define C_COMPILER_HAS_BUILTIN(x) 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</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;'>+ /* Architectures */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>