Skip to content

Commit

Permalink
POWER: Fix compilation issues with clang
Browse files Browse the repository at this point in the history
This patch fixes some compilation errors when using
clang11 on POWER processors.
  • Loading branch information
Rajalakshmi Srinivasaraghavan authored and snnn committed Aug 25, 2021
1 parent 73fe7bf commit 33a97e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions onnxruntime/core/mlas/lib/mlasi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 33a97e9

Please sign in to comment.