From a2054564d8668c801bb2f4937e4a06509b18f290 Mon Sep 17 00:00:00 2001 From: dslarm <38504854+dslarm@users.noreply.github.com> Date: Mon, 11 Sep 2023 21:04:20 +0100 Subject: ctffind: extend a Power 9 patch to AArch64 (#39137) --- .../repos/builtin/packages/ctffind/no_sincos_asm.patch | 16 ++++++++++++++++ var/spack/repos/builtin/packages/ctffind/package.py | 3 ++- var/spack/repos/builtin/packages/ctffind/power9.patch | 16 ---------------- 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 var/spack/repos/builtin/packages/ctffind/no_sincos_asm.patch delete mode 100644 var/spack/repos/builtin/packages/ctffind/power9.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/ctffind/no_sincos_asm.patch b/var/spack/repos/builtin/packages/ctffind/no_sincos_asm.patch new file mode 100644 index 0000000000..6ff49a7556 --- /dev/null +++ b/var/spack/repos/builtin/packages/ctffind/no_sincos_asm.patch @@ -0,0 +1,16 @@ +diff -ur a/src/core/matrix.cpp b/src/core/matrix.cpp +--- a/src/core/matrix.cpp 2020-05-08 18:28:30.000000000 +0100 ++++ b/src/core/matrix.cpp 2022-04-26 14:45:23.414518732 +0100 +@@ -4,7 +4,11 @@ + // think i got it from a book i had about game programming in c.. it's probably slower than what the compiler would do these days. + + #define AL_PI 3.14159265358979323846 +-#define _AL_SINCOS(x, s, c) __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x)) ++#if defined(__i386__) || defined(__x86_64__) ++#define _AL_SINCOS(x, s, c) __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x)) ++#else ++#define _AL_SINCOS(x, s, c) s = sinf(x); c = cosf(x); ++#endif + #define FLOATSINCOS(x, s, c) _AL_SINCOS((x) * AL_PI / 128.0, s ,c) + + #define MAKE_ROTATION_f(x, y, z) diff --git a/var/spack/repos/builtin/packages/ctffind/package.py b/var/spack/repos/builtin/packages/ctffind/package.py index a57833be16..d1be5c6ea6 100644 --- a/var/spack/repos/builtin/packages/ctffind/package.py +++ b/var/spack/repos/builtin/packages/ctffind/package.py @@ -33,7 +33,8 @@ class Ctffind(AutotoolsPackage): depends_on("jpeg") patch("configure.patch", when="@4.1.8") - patch("power9.patch", when="@4.1.14 target=power9le") + patch("no_sincos_asm.patch", when="@4.1.14 target=power9le") + patch("no_sincos_asm.patch", when="@4.1.14 target=aarch64:") patch("fix_return_types.patch", when="@4.1.13:4.1.14") def configure_args(self): diff --git a/var/spack/repos/builtin/packages/ctffind/power9.patch b/var/spack/repos/builtin/packages/ctffind/power9.patch deleted file mode 100644 index 6ff49a7556..0000000000 --- a/var/spack/repos/builtin/packages/ctffind/power9.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -ur a/src/core/matrix.cpp b/src/core/matrix.cpp ---- a/src/core/matrix.cpp 2020-05-08 18:28:30.000000000 +0100 -+++ b/src/core/matrix.cpp 2022-04-26 14:45:23.414518732 +0100 -@@ -4,7 +4,11 @@ - // think i got it from a book i had about game programming in c.. it's probably slower than what the compiler would do these days. - - #define AL_PI 3.14159265358979323846 --#define _AL_SINCOS(x, s, c) __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x)) -+#if defined(__i386__) || defined(__x86_64__) -+#define _AL_SINCOS(x, s, c) __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x)) -+#else -+#define _AL_SINCOS(x, s, c) s = sinf(x); c = cosf(x); -+#endif - #define FLOATSINCOS(x, s, c) _AL_SINCOS((x) * AL_PI / 128.0, s ,c) - - #define MAKE_ROTATION_f(x, y, z) -- cgit v1.2.3-70-g09d2