From b8e352ad378ce4ef7a517971533b02ec9c3768cb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 16 Oct 2017 13:54:38 +0200 Subject: Add functions for fast bulk conversion of qfloat16 Both ARM and x86 can convert fp16 much faster in bulk than one at a time. This also enables hardware accelerated conversion on x86, when F16C isn't unconditionally available at compile time. This code is implemented in C to ensure that there's no leakage of inline symbols from the .obj file that was compiled by Visual Studio with AVX support. Unfortunately, simd.prf uses $(CXX) instead of $(CC) for all its sources, which means the file gets interpreted as C++ by g++, clang++ and icpc. Those compilers at least don't leak any symbols. Done-with: Thiago Macieira Change-Id: I9d26d99e83392861fb09564e0e8e8d76cd8483b3 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 33b86a7321..203c9a9da4 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -246,6 +246,15 @@ typedef unsigned long long quint64; /* 64 bit unsigned */ typedef qint64 qlonglong; typedef quint64 qulonglong; +#ifndef __cplusplus +// In C++ mode, we define below using QIntegerForSize template +Q_STATIC_ASSERT_X(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions"); +typedef ptrdiff_t qptrdiff; +typedef ptrdiff_t qssize_t; +typedef ptrdiff_t qintptr; +typedef size_t quintptr; +#endif + /* Useful type definitions for Qt */ -- cgit v1.2.3