From 33a97e995bdea96acd39dc54903f764113ae1ac9 Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Wed, 18 Aug 2021 20:40:28 -0500 Subject: [PATCH] POWER: Fix compilation issues with clang This patch fixes some compilation errors when using clang11 on POWER processors. --- onnxruntime/core/mlas/lib/mlasi.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/mlas/lib/mlasi.h b/onnxruntime/core/mlas/lib/mlasi.h index 0e78484265..733d29d2a2 100644 --- a/onnxruntime/core/mlas/lib/mlasi.h +++ b/onnxruntime/core/mlas/lib/mlasi.h @@ -1333,7 +1333,7 @@ MlasStoreLowHalfFloat32x4(float* Buffer, MLAS_FLOAT32X4 Vector) #elif defined(MLAS_SSE2_INTRINSICS) _mm_storel_pi((__m64*)Buffer, Vector); #elif defined(MLAS_VSX_INTRINSICS) - *((int64_t*)Buffer) = ((__vector int64_t)Vector)[0]; + *((long long*)Buffer) = ((__vector long long)Vector)[0]; #else MlasStoreLaneFloat32x4<0>(&Buffer[0], Vector); MlasStoreLaneFloat32x4<1>(&Buffer[1], Vector); @@ -1555,6 +1555,8 @@ MlasGreaterThanFloat32x4(MLAS_FLOAT32X4 Vector1, MLAS_FLOAT32X4 Vector2) return _mm_cmpgt_ps(Vector1, Vector2); #elif defined(MLAS_WASM_SIMD_INTRINSICS) return wasm_f32x4_gt(Vector1, Vector2); +#elif defined(MLAS_VSX_INTRINSICS) + return MLAS_FLOAT32X4(vec_cmpgt(Vector1, Vector2)); #else return Vector1 > Vector2; #endif @@ -1681,7 +1683,7 @@ MlasReduceAddFloat32x4(MLAS_FLOAT32X4 Vector) VectorLow = vpadd_f32(VectorLow, VectorHigh); return vget_lane_f32(VectorLow, 0); #elif defined(MLAS_VSX_INTRINSICS) - Vector = MlasAddFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector int64_t)Vector, 1))); + Vector = MlasAddFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector long long)Vector, 1))); Vector = MlasAddFloat32x4(Vector, vec_splat(Vector, 1)); return Vector[0]; #else @@ -1704,7 +1706,7 @@ MlasReduceMaximumFloat32x4(MLAS_FLOAT32X4 Vector) VectorLow = vpmax_f32(VectorLow, VectorHigh); return vget_lane_f32(VectorLow, 0); #elif defined(MLAS_VSX_INTRINSICS) - Vector = MlasMaximumFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector int64_t)Vector, 1))); + Vector = MlasMaximumFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector long long)Vector, 1))); Vector = MlasMaximumFloat32x4(Vector, vec_splat(Vector, 1)); return Vector[0]; #else @@ -1727,7 +1729,7 @@ MlasReduceMinimumFloat32x4(MLAS_FLOAT32X4 Vector) VectorLow = vpmin_f32(VectorLow, VectorHigh); return vget_lane_f32(VectorLow, 0); #elif defined(MLAS_VSX_INTRINSICS) - Vector = MlasMinimumFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector int64_t)Vector, 1))); + Vector = MlasMinimumFloat32x4(Vector, MLAS_FLOAT32X4(vec_splat((__vector long long)Vector, 1))); Vector = MlasMinimumFloat32x4(Vector, vec_splat(Vector, 1)); return Vector[0]; #else