diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-29 15:37:28 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-30 09:52:24 +0200 |
commit | a57419b10d636fcdf4813a18a6f5468b6311b3cc (patch) | |
tree | 0e27b43e587e5161c2e3104897e16fb99f595dfe /src/corelib/global | |
parent | 79408518636a4d32b2c0e9e637ded57c3cca65da (diff) |
Document run-time acceleration of using the conversions functions
Pick-to: 5.15
Change-Id: I985b93135b9d8fdfdd64e9183b23cbf8a7b4e3eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qfloat16.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp index 1f06b10313..c97331748b 100644 --- a/src/corelib/global/qfloat16.cpp +++ b/src/corelib/global/qfloat16.cpp @@ -65,6 +65,10 @@ QT_BEGIN_NAMESPACE stating that it supports all arithmetic operators incident to floating point types. + \note On x86 and x86-64 that to get hardware accelerated conversions you must + compile with F16C or AVX2 enabled, or use qFloatToFloat16() and qFloatFromFloat16() + which will detect F16C at runtime. + \since 5.9 */ @@ -262,6 +266,9 @@ static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) noexcept Converts \a len floats from \a in to qfloat16 and stores them in \a out. Both \a in and \a out must have \a len allocated entries. + + This function is faster than converting values one by one, and will do runtime + F16C detection on x86 and x86-64 hardware. */ Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len) noexcept { @@ -278,6 +285,9 @@ Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len Converts \a len qfloat16 from \a in to floats and stores them in \a out. Both \a in and \a out must have \a len allocated entries. + + This function is faster than converting values one by one, and will do runtime + F16C detection on x86 and x86-64 hardware. */ Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype len) noexcept { |