aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-10-05 17:23:11 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2019-10-08 20:02:46 +0000
commit6b5122ef14cb8c5ba5a9f790d824e92667e88783 (patch)
tree90eb737cd8e90d11646e85a205f3884e797b1279
parent6442c54d10750016083b06a8bc22b9bffc5e26a2 (diff)
qtbase: Fix build when fp16 is used
Conversions between float and half are only available when the taraget has the half-precision extension. Guard these intrinsics accordingly Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-qt/qt5/nativesdk-qtbase_git.bb1
-rw-r--r--recipes-qt/qt5/qtbase-native_git.bb1
-rw-r--r--recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch37
-rw-r--r--recipes-qt/qt5/qtbase_git.bb1
4 files changed, 40 insertions, 0 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb
index 1727fbb9..3de1ef0f 100644
--- a/recipes-qt/qt5/nativesdk-qtbase_git.bb
+++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb
@@ -41,6 +41,7 @@ SRC_URI += "\
file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \
file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \
file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
+ file://0001-qfloat16-check-for-__ARM_FP-2.patch \
"
# common for qtbase-native and nativesdk-qtbase
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb
index 19181b69..f38bcffa 100644
--- a/recipes-qt/qt5/qtbase-native_git.bb
+++ b/recipes-qt/qt5/qtbase-native_git.bb
@@ -36,6 +36,7 @@ SRC_URI += "\
file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \
file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \
file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
+ file://0001-qfloat16-check-for-__ARM_FP-2.patch \
"
# common for qtbase-native and nativesdk-qtbase
diff --git a/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch b/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch
new file mode 100644
index 00000000..fdcb0cfa
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch
@@ -0,0 +1,37 @@
+From 89ec5b0cdd8663ec2602dec3e151388bab2b4594 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Oct 2019 16:21:08 -0700
+Subject: [PATCH] qfloat16: check for __ARM_FP & 2
+
+Clang hides vcvt_f16_f32() and vcvt_f32_f16() behind (__ARM_FP & 2) where 2 refers to -mfpu=fp-armv8.
+However, GCC would only build this code if -march=armv8.2-a+fp16 is passed as well.
+
+global/qfloat16.cpp:149:31: error: use of undeclared identifier 'vcvt_f16_f32'
+ vst1_f16(out_f16 + i, vcvt_f16_f32(vld1q_f32(in + i)));
+ ^
+global/qfloat16.cpp:159:28: error: use of undeclared identifier 'vcvt_f32_f16'
+ vst1q_f32(out + i, vcvt_f32_f16(vld1_f16(in_f16 + i)));
+ ^
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/corelib/global/qfloat16.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
+index fd608efe55..604a8a9cd8 100644
+--- a/src/corelib/global/qfloat16.cpp
++++ b/src/corelib/global/qfloat16.cpp
+@@ -135,7 +135,7 @@ f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype
+ #undef f16cextern
+ }
+
+-#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__)
++#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) && (__ARM_FP & 2)
+ static inline bool hasFastF16()
+ {
+ return true;
+--
+2.23.0
+
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index b4ccca86..90096026 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -32,6 +32,7 @@ SRC_URI += "\
file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \
file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \
file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
+ file://0001-qfloat16-check-for-__ARM_FP-2.patch \
"
# for syncqt