m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.55k stars 266 forks source link

mingw32 vvc: InterpolationFilter_avx.cpp: x86 compile trying to use x86-64 intrinsics #1449

Closed LigH-de closed 5 years ago

LigH-de commented 5 years ago

Reported to Fraunhofer trac VVC ticket #620. Not blocking MABS as it treats this project as optional.

[6/141] Building CXX object source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx/InterpolationFilter_avx.cpp.o
FAILED: source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx/InterpolationFilter_avx.cpp.o 
E:\MABS\local32\bin\g++.bat  -DENABLE_SPLIT_PARALLELISM=0 -DRExt__DECODER_DEBUG_BIT_STATISTICS=1 -DRExt__DECODER_DEBUG_TOOL_STATISTICS=1 -DUSE_AVX -I../source/Lib/CommonAnalyserLib/../CommonLib/. -I../source/Lib/CommonAnalyserLib/../CommonLib/.. -I../source/Lib/CommonAnalyserLib/../CommonLib/x86 -I../source/Lib/CommonAnalyserLib/../libmd5 -mthreads -mtune=generic -O2 -pipe -fopenmp -O3 -DNDEBUG   -Wall -fdiagnostics-show-option -Werror -Wno-sign-compare -Wno-class-memaccess -msse4.1 -mthreads -std=gnu++11 -mavx -MD -MT source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx/InterpolationFilter_avx.cpp.o -MF source\Lib\CommonAnalyserLib\CMakeFiles\CommonAnalyserLib.dir\__\CommonLib\x86\avx\InterpolationFilter_avx.cpp.o.d -o source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx/InterpolationFilter_avx.cpp.o -c ../source/Lib/CommonLib/x86/avx/InterpolationFilter_avx.cpp
In file included from ../source/Lib/CommonLib/x86/avx/InterpolationFilter_avx.cpp:1:
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h: In function 'void simdInterpolateN2_HIGHBIT_M4(const int16_t*, int, int16_t*, int, int, int, int, int, int, const ClpRng&, const int16_t*)':
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1085:21: error: there are no arguments to '_mm_cvtsi64_si128' that depend on a template parameter, so a declaration of '_mm_cvtsi64_si128' must be available [-fpermissive]
 1085 |   __m128i mmShift = _mm_cvtsi64_si128(shift);
      |                     ^~~~~~~~~~~~~~~~~
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1085:21: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h: In instantiation of 'void simdInterpolateN2_HIGHBIT_M4(const int16_t*, int, int16_t*, int, int, int, int, int, int, const ClpRng&, const int16_t*) [with X86_VEXT vext = AVX; bool isLast = false; int16_t = short int]':
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1284:53:   required from 'void simdFilter(const ClpRng&, const Pel*, int, Pel*, int, int, int, const TFilterCoeff*, bool) [with X86_VEXT vext = AVX; int N = 8; bool isVertical = false; bool isFirst = false; bool isLast = false; Pel = short int; TFilterCoeff = short int]'
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1447:24:   required from 'void InterpolationFilter::_initInterpolationFilterX86() [with X86_VEXT vext = AVX]'
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1485:73:   required from here
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1085:38: error: '_mm_cvtsi64_si128' was not declared in this scope; did you mean '_mm_cvtsi32_si128'?
 1085 |   __m128i mmShift = _mm_cvtsi64_si128(shift);
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~
      |                     _mm_cvtsi32_si128
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h: In instantiation of 'void simdInterpolateN2_HIGHBIT_M4(const int16_t*, int, int16_t*, int, int, int, int, int, int, const ClpRng&, const int16_t*) [with X86_VEXT vext = AVX; bool isLast = true; int16_t = short int]':
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1284:53:   required from 'void simdFilter(const ClpRng&, const Pel*, int, Pel*, int, int, int, const TFilterCoeff*, bool) [with X86_VEXT vext = AVX; int N = 8; bool isVertical = false; bool isFirst = false; bool isLast = true; Pel = short int; TFilterCoeff = short int]'
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1448:24:   required from 'void InterpolationFilter::_initInterpolationFilterX86() [with X86_VEXT vext = AVX]'
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1485:73:   required from here
../source/Lib/CommonLib/x86/avx/../InterpolationFilterX86.h:1085:38: error: '_mm_cvtsi64_si128' was not declared in this scope; did you mean '_mm_cvtsi32_si128'?
 1085 |   __m128i mmShift = _mm_cvtsi64_si128(shift);
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~
      |                     _mm_cvtsi32_si128
LigH-de commented 5 years ago

Still no reaction. May it be appropriate to raise the priority in the VVC tracker after 2 weeks?

wiiaboo commented 5 years ago

Or maybe it should be restricted to 64-bit only. If upstream doesn't give a shit about 32-bit, there's really no point trying to support it.

1480c1 commented 5 years ago

Edit: ^

Perhaps, but at the same time, most likely 32-bit probably is not even close to a high enough priority for them since they are only encoding plus a lot of distros are dropping 32-bit, although not necessarily 32-bit libs.

1480c1 commented 5 years ago

@LigH-de, do you feel that vvc is important enough to keep on with 32-bit compilation? We can disable temporarily until they at least respond.

LigH-de commented 5 years ago

You don't need to restrict it to 64-bit only compilation as the suite treats this project as optional, already. It continues after failing to compile in 32-bit mode. But getting practically restricted by the developers in the future would not surprise me: VVC is slow as hell. Trying to execute it on 32-bit only hardware can't be recommendable. And already x265 required more RAM than 32-bit addresses could provide, to encode HD resolutions.

I hope changing the priority boldly may provoke them to any reaction.

LigH-de commented 5 years ago

It was probably a good choice to disable 32-bit building. I see a drop for support coming, rather than "fixing" it:

Thanks for the report. VTM does not work properly in 32-bit due to big amount of memory used. Although We have an MR on memory reduction, it may not solve all the issues with 32-bit. It is suggested to test with 64-bit compiler. Fix and improvement for 32-bit are appreciated.

I will close this report now. If I ever get a notice about a patch to re-enable 32-bit compilation, I may tell about it here...

LigH-de commented 4 years ago

VVC staff officially stated that x86 (32-bit) is no target for VVC, at least not the reference software. Custom projects may or may not support it.