Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34971

Vector search fails to compile on x86_32

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 11.7.0
    • 11.7.1
    • Vector search
    • None

    Description

      In file included from /home/buildbot/x86-debian-12/build/sql/vector_mhnsw.cc:25:
      /home/buildbot/x86-debian-12/build/sql/bloom_filters.h: In member function ‘void PatternedSimdBloomFilter<T>::Insert(const T**)’:
      /home/buildbot/x86-debian-12/build/sql/bloom_filters.h:128:23: error: there are no arguments to ‘_mm256_extract_epi64’ that depend on a template parameter, so a declaration of ‘_mm256_extract_epi64’ must be available [-fpermissive]
        128 |     uint64_t block0 = _mm256_extract_epi64(vecBlockIdxA, 0);
      

      Attachments

        Issue Links

          Activity

            As far as I can tell, the Intel intrinsic function wraps an AVX instruction, which definitely is available in some IA-32 implementations.

            One thing that I do not see in the code is a run-time feature check. Not only the CPU implementation needs to support the ISA extensions that are being used, but also the operating system needs to enable saving the registers on a context switch; otherwise SIGILL will be triggered, as we recently learned in MDEV-34565. An easy way to test this would be to boot Linux with the option noxsave.

            marko Marko Mäkelä added a comment - As far as I can tell, the Intel intrinsic function wraps an AVX instruction, which definitely is available in some IA-32 implementations. One thing that I do not see in the code is a run-time feature check. Not only the CPU implementation needs to support the ISA extensions that are being used, but also the operating system needs to enable saving the registers on a context switch; otherwise SIGILL will be triggered, as we recently learned in MDEV-34565 . An easy way to test this would be to boot Linux with the option noxsave .

            some intrisics are defined as

            avxintrin.h

            #ifdef __x86_64__
            extern __inline long long  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
            _mm256_extract_epi64 (__m256i __X, const int __N)
            {
              __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1);
              return _mm_extract_epi64 (__Y, __N % 2);
            }
            #endif
            

            serg Sergei Golubchik added a comment - some intrisics are defined as avxintrin.h #ifdef __x86_64__ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extract_epi64 (__m256i __X, const int __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1); return _mm_extract_epi64 (__Y, __N % 2); } #endif

            People

              serg Sergei Golubchik
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.