<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/91415>91415</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [BUG] error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          onthegrid007
      </td>
    </tr>
</table>

<pre>
    Hi I am trying to use clang to compile [https://github.com/luxonis/depthai-core](https://github.com/luxonis/depthai-core) and there is a reoccurring bug in many of the CPP files.

```
[16/28] Building CXX object CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj
FAILED: CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj 
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DHAVE_STRUCT_TIMESPEC -DUSE_TCP_IP -DUSE_USB_VSC -DWIN32_LEAN_AND_MEAN -DXLINK_ENABLE_LIBUSB -D_CRT_SECURE_NO_WARNINGS -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../src/pc/Win/include -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../src/pc/protocols -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../include/XLink -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../include -isystem C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Install/include -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=c++14 -MD -MT CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj -MF CMakeFiles\XLink.dir\src\pc\protocols\usb_host.cpp.obj.d -o CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj -c C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/src/pc/protocols/usb_host.cpp
In file included from C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/src/pc/protocols/usb_host.cpp:19:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\mutex:15:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\__msvc_chrono.hpp:11:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\limits:15:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\intrin.h:20:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\x86intrin.h:15:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\immintrin.h:21:
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:71:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
 ^~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:133:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:163:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:193:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:220:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:243:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:264:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:291:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:314:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:335:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:356:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:377:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:398:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:420:41: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:443:41: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:465:42: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:487:42: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:508:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM
\lib\clang\16\include\mmintrin.h:529:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')

 return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);

 ^~~~~~~~~~~~

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.
```

I can't figure out how this is occurring in a header file but I assume its due to a bug with clang, not the library itself... Any help would be appreciated...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsml9zm7jXx1-NfHMGBgSyzYUvbDBZz2O7mThJc8cIkI0aQKwkkmYv-tqfETh_t9tt07rj_DYeD1gCfY90PpwDeA5Viu9qxiaIzBCJBrTVhZATUeuC7STPHWc0SEV-N_mDwwJoBVre8XoHWkCrGGQl7RuZqBpeMkBkVmjdKORNEY4RjndcF21qZ6JCOC7bz6LmCuE4Z40uKLcyIRkiEcLjHx-GA6B1DrpgkgFXQEEykWWtlGaGabsDXkNF6zsQW3MWhKensOUlUzZ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