Blame SOURCES/0003-Fix-SIMD-support-on-IBM-z13.patch

698a2e
From 999efd5370b33e8b02d9370eda3d454e08fc9d15 Mon Sep 17 00:00:00 2001
698a2e
From: Andreas Arnez <arnez@linux.ibm.com>
698a2e
Date: Wed, 5 Dec 2018 18:59:15 +0100
698a2e
Subject: [PATCH 3/8] Fix SIMD support on IBM z13
698a2e
698a2e
The header file atlas_simd.h contained a syntax error and a few functional
698a2e
errors that affected IBM z13.  It prevented any SIMD kernels from being
698a2e
compiled successfully for that platform.  This is fixed.  The macro
698a2e
vec_madd is avoided, because some GCC versions don't implement it
698a2e
correctly; the equivalent GCC builtin __builtin_s390_vec_madd is used
698a2e
instead.
698a2e
---
698a2e
 include/atlas_simd.h | 10 +++++-----
698a2e
 1 file changed, 5 insertions(+), 5 deletions(-)
698a2e
698a2e
diff --git a/include/atlas_simd.h b/include/atlas_simd.h
698a2e
index baee6b1..68daf79 100644
698a2e
--- a/include/atlas_simd.h
698a2e
+++ b/include/atlas_simd.h
698a2e
@@ -69,7 +69,7 @@
698a2e
          #define ATL_FRCGNUVEC
698a2e
       #endif
698a2e
    #elif defined(ATL_VXZ)
698a2e
-      #if ATL_VLEN != 2;
698a2e
+      #if ATL_VLEN != 2
698a2e
          #define ATL_FRCGNUVEC
698a2e
       #endif
698a2e
    #elif defined(ATL_NEON)
698a2e
@@ -390,19 +390,19 @@
698a2e
       #define ATL_vld(v_, p_) v_ = vec_ld2f(p_);
698a2e
       #define ATL_vst(p_, v_) vec_st2f(v_, p_);
698a2e
    #endif
698a2e
-   #define ATL_vzero(v_) v_ = vec_splats((TYPE)0.0)
698a2e
+   #define ATL_vzero(v_) v_ = vec_splats((double)0.0)
698a2e
    #define ATL_vcopy(d_, s_) d_ = s_
698a2e
-   #define ATL_vbcast(v_, p_) v_ =  vec_splats(*((TYPE*)(p_)))
698a2e
+   #define ATL_vbcast(v_, p_) v_ = vec_splats((double)*((TYPE*)(p_)))
698a2e
    #define ATL_vuld(v_, p_) ATL_vld(v_, p_)
698a2e
    #define ATL_vust(p_, v_) ATL_vst(p_, v_)
698a2e
    #define ATL_vadd(d_, s1_, s2_) d_ =  s1_ + s2_
698a2e
    #define ATL_vsub(d_, s1_, s2_) d_ =  s1_ - s2_
698a2e
    #define ATL_vmul(d_, s1_, s2_) d_ =  s1_ * s2_
698a2e
-   #define ATL_vmac(d_, s1_, s2_) d_ = vec_madd(s1_, s2_, d_)
698a2e
+   #define ATL_vmac(d_, s1_, s2_) d_ = __builtin_s390_vec_madd(s1_, s2_, d_)
698a2e
    #define ATL_vvrsum1(s0_) \
698a2e
    {  ATL_VTYPE t_;\
698a2e
       t_ = vec_splat(s0_, 1); \
698a2e
-      s0 += t_; \
698a2e
+      s0_ += t_; \
698a2e
    }
698a2e
    #define ATL_vsplat0(d_, s_) d_ = vec_splat(s_, 0)
698a2e
    #define ATL_vsplat1(d_, s_) d_ = vec_splat(s_, 1)
698a2e
-- 
698a2e
2.23.0
698a2e