Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64529

qfloat16.h missing AVX2 definition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.3
    • 5.9.2
    • Core: Other
    • None

    Description

      While doing cross-compile for i7 haswell (gcc flags -mtune=haswell -mfpmath=sse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx2) I encountered the following error:

       

      /final/test/buildroot-2017.11-rc1/output/host/bin/x86_64-buildroot-linux-gnu-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os --sysroot=/final/test/buildroot-2017.11-rc1/output/host/x86_64-buildroot-linux-gnu/sysroot -O3 -O3 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I. -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../../include -I../../include/QtCore -I../../include/QtCore/5.9.2 -I../../include/QtCore/5.9.2/QtCore -I.moc -I/final/test/buildroot-2017.11-rc1/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0 -I/final/test/buildroot-2017.11-rc1/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/glib-2.0/include -I/final/test/buildroot-2017.11-rc1/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/include -I../../mkspecs/devices/linux-buildroot-g++ -o .obj/qfloat16.o global/qfloat16.cpp
       In file included from ../../include/QtCore/qfloat16.h:1:0,
       from global/qfloat16_p.h:54,
       from global/qfloat16.cpp:40:
       ../../include/QtCore/../../src/corelib/global/qfloat16.h: In constructor 'qfloat16::qfloat16(float)':
       *../../include/QtCore/../../src/corelib/global/qfloat16.h:120:5: error: '__m128' was not declared in this scope*
       *__m128 packsingle = _mm_set_ss(f);*
       *^~~~~~*
       *../../include/QtCore/../../src/corelib/global/qfloat16.h:121:5: error: '__m128i' was not declared in this scope*
       *__m128i packhalf = _mm_cvtps_ph(packsingle, 0);*
      

       

      The following change to qfloat16.h let me compile successfully:

      diff -Naur qt5base-5.9.2.org/src/corelib/global/qfloat16.h qt5base-5.9.2/src/corelib/global/qfloat16.h
       — qt5base-5.9.2.org/src/corelib/global/qfloat16.h 2017-10-02 08:43:38.000000000 +0000
       +++ qt5base-5.9.2/src/corelib/global/qfloat16.h 2017-11-15 05:45:07.629910395 +0000
       @@ -44,7 +44,7 @@
       #include <QtCore/qmetatype.h>
       #include <string.h>
      
      -#if defined __F16C__
       +#if defined(__F16C__) || defined(____AVX2___)
       #include <immintrin.h>
       #endif
      

      Attachments

        Activity

          People

            thiago Thiago Macieira
            crazythinker Stefan Fröberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: