Fix build error when __ARM_FP is 2 41/274141/2 accepted/tizen/unified/20220424.221514 submit/tizen/20220422.065922
authorjiyong.min <jiyong.min@samsung.com>
Fri, 22 Apr 2022 04:43:19 +0000 (13:43 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Fri, 22 Apr 2022 04:45:45 +0000 (13:45 +0900)
 - don't use (__ARM_FP & 2) for tizen

Change-Id: If23708d27705099e0cf725bd6af629f878e4ce3d

third_party/highway/hwy/base.h
third_party/highway/hwy/ops/arm_neon-inl.h

index c9e0d0c..cfcf3f9 100644 (file)
@@ -220,7 +220,8 @@ static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 16;
 // Match [u]int##_t naming scheme so rvv-inl.h macros can obtain the type name
 // by concatenating base type and bits.
 
-#if HWY_ARCH_ARM && (__ARM_FP & 2)
+// Avoid __ARM_FP build error
+#if HWY_ARCH_ARM && (__ARM_FP & 2) && !(__TIZEN__)
 #define HWY_NATIVE_FLOAT16 1
 #else
 #define HWY_NATIVE_FLOAT16 0
@@ -231,17 +232,10 @@ static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 16;
 #if defined(HWY_EMULATE_SVE)
 using float16_t = FarmFloat16;
 #elif HWY_NATIVE_FLOAT16
-// Avoid "'__fp16' and '_Float16' not declared" build error
-#if defined(__TIZEN__)
-struct float16_t {
-  uint16_t bits;
-};
-#else
 using float16_t = __fp16;
 // Clang does not allow __fp16 arguments, but scalar.h requires LaneType
 // arguments, so use a wrapper.
 // TODO(janwas): replace with _Float16 when that is supported?
-#endif
 #else
 struct float16_t {
   uint16_t bits;
index 774ca5d..b7a43c2 100644 (file)
@@ -2491,7 +2491,8 @@ HWY_API Vec128<int64_t, N> PromoteTo(Simd<int64_t, N> /* tag */,
   return Vec128<int64_t, N>(vget_low_s64(vmovl_s32(v.raw)));
 }
 
-#if __ARM_FP & 2
+// Avoid __ARM_FP build error
+#if (__ARM_FP & 2) && !(__TIZEN__)
 
 HWY_API Vec128<float> PromoteTo(Full128<float> /* tag */,
                                 const Vec128<float16_t, 4> v) {
@@ -2621,7 +2622,8 @@ HWY_API Vec128<int8_t, N> DemoteTo(Simd<int8_t, N> /* tag */,
   return Vec128<int8_t, N>(vqmovn_s16(vcombine_s16(v.raw, v.raw)));
 }
 
-#if __ARM_FP & 2
+// Avoid __ARM_FP build error
+#if (__ARM_FP & 2) && !(__TIZEN__)
 
 HWY_API Vec128<float16_t, 4> DemoteTo(Simd<float16_t, 4> /* tag */,
                                       const Vec128<float> v) {