Language: C++

#include <iostream>
#include <x86intrin.h>
using namespace std;
using Int = long long;
__attribute__((aligned(32))) int A[200000], B[200000];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) cin >> A[i];
    for (int i = 0; i < N; i++) cin >> B[i];
    int blocksize = 16;
    __m256i result1 = _mm256_setzero_si256();
    __m256i result2 = _mm256_setzero_si256();
    for (int i = 0; i < N; i += blocksize) for (int j = 0; j < N; j += blocksize) {
        __m256i b1 = _mm256_loadu_si256((__m256i*)&B[j]);
        __m256i b2 = _mm256_loadu_si256((__m256i*)&B[j + 8]);
        for (int x = i; x < i + blocksize; x++) {
            __m256i a = _mm256_set1_epi32(A[x]);
            result1 = _mm256_xor_si256(result1, _mm256_add_epi32(a, b1));
            result2 = _mm256_xor_si256(result2, _mm256_add_epi32(a, b2));
        }
    }
    result1 = _mm256_xor_si256(result1, result2);
    int r[8];
    _mm256_storeu_si256((__m256i*)&r[0], result1);
    int x = 0;
    for (int i = 0; i < 8; i++) x ^= r[i];
    cout << x << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
   15 |     __m256i result1 = _mm256_setzero_si256();
      |                                            ^
In file included from /usr/lib/gcc/x86_64-linux-gnu/14/include/immintrin.h:43,
                 from /usr/lib/gcc/x86_64-linux-gnu/14/include/x86intrin.h:32,
                 from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:1251:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_setzero_si256()': target specific option mismatch
 1251 | _mm256_setzero_si256 (void)
      | ^~~~~~~~~~~~~~~~~~~~
a.cc:16:43: note: called from here
   16 |     __m256i result2 = _mm256_setzero_si256();
      |                       ~~~~~~~~~~~~~~~~~~~~^~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:1251:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_setzero_si256()': target specific option mismatch
 1251 | _mm256_setzero_si256 (void)
      | ^~~~~~~~~~~~~~~~~~~~
a.cc:15:43: note: called from here
   15 |     __m256i result1 = _mm256_setzero_si256();
      |                       ~~~~~~~~~~~~~~~~~~~~^~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:927:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_loadu_si256(const __m256i_u*)': target specific option mismatch
  927 | _mm256_loadu_si256 (__m256i_u const *__P)
      | ^~~~~~~~~~~~~~~~~~
a.cc:19:40: note: called from here
   19 |         __m256i b2 = _mm256_loadu_si256((__m256i*)&B[j + 8]);
      |                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:927:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_loadu_si256(const __m256i_u*)': target specific option mismatch
  927 | _mm256_loadu_si256 (__m256i_u const *__P)
      | ^~~~~~~~~~~~~~~~~~
a.cc:18:40: note: called from here
   18 |         __m256i b1 = _mm256_loadu_si256((__m256i*)&B[j]);
      |                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/14/include/immintrin.h:53:
/usr/lib/gcc/x86_64-linux-gnu/14/include/avx2intrin.h:913:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_xor_si256(__m256i, __m256i)': target specific option mismatch
  913 | _mm256_xor_si256 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~
a.cc:23:39: note: called from here
   23 |             result2 = _mm256_xor_si256(result2, _mm256_add_epi32(a, b2));
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avx2intrin.h:119:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_add_epi32(__m256i, __m256i)': target specific option mismatch
  119 | _mm256_add_epi32 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~
a.cc:23:39: note: called from here
   23 |             result2 = _mm256_xor_si256(result2, _mm256_add_epi32(a, b2));
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avx2intrin.h:913:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_xor_si256(__m256i, __m256i)': target specific option mismatch
  913 | _mm256_xor_si256 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~
a.cc:22:39: note: called from here
   22 |             result1 = _mm256_xor_si256(result1, _mm256_add_epi32(a, b1));
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avx2intrin.h:119:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_add_epi32(__m256i, __m256i)': target specific option mismatch
  119 | _mm256_add_epi32 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~
a.cc:22:39: note: called from here
   22 |             result1 = _mm256_xor_si256(result1, _mm256_add_epi32(a, b1));
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:1335:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_set1_epi32(int)': target specific option mismatch
 1335 | _mm256_set1_epi32 (int __A)
      | ^~~~~~~~~~~~~~~~~
a.cc:21:42: note: called from here
   21 |             __m256i a = _mm256_set1_epi32(A[x]);
      |                         ~~~~~~~~~~~~~~~~~^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avxintrin.h:933:1: error: inlining failed in call to 'always_inline' 'void _mm256_storeu_si256(__m256i_u*, __m256i)': target specific option mismatch
  933 | _mm256_storeu_si256 (__m256i_u *__P, __m256i __A)
      | ^~~~~~~~~~~~~~~~~~~
a.cc:28:24: note: called from here
   28 |     _mm256_storeu_si256((__m256i*)&r[0], result1);
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/avx2intrin.h:913:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_xor_si256(__m256i, __m256i)': target specific option mismatch
  913 | _mm256_xor_si256 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~
a.cc:26:31: note: called from here
   26 |     result1 = _mm256_xor_si256(result1, result2);
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~