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

    <tr>
        <th>Summary</th>
        <td>
            x86_64 ABI incompatibility with GCC for [[gnu::vector_size(N)]] arguments and return values
        </td>
    </tr>

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

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

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

<pre>
    Test case [CE Link](https://godbolt.org/z/r4dndPse9):
```c++
template <typename T, int N> struct Test
{
  using V [[gnu::vector_size (N * sizeof (T))]] = T;

  V f(V a)
  { return a + a; }
};

template struct Test<float, 1>;
template struct Test<float, 16>;
template struct Test<double, 1>;
template struct Test<double, 8>;
```

* GCC consistently passes all arguments and return values via the stack.
* ICC passes `<float, 1>` via `xmm`, everything else via the stack.
* Clang passes `<float, 1>` via GPR, for everything else function arguments are passed via the stack but return values are passed via `xmm`/`ymm` registers.

Note that the compilers seem to agree for integral types.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVFGPozgM_jXmxdoKQqH0gYdCh9VKp9HqNJrXVQAXchOSKjHd7fz6U9jOtNfT3I2IBDGfP_tzYkvv1WCISsgqyPaRnHm0rpwk84sjfo1a25_LJ_KMnfSEkFX1A_6hzAtkexDFyHz0kO5ANCCawfat1byybgDRvIJo3Lo3_XdPWxDbAIv3EO8gj3-vDkQV1mJlmo5aMiGkNZ-PZORE-ASiRmUYHyF9QM9u7hhDOhemzcUZcfbKDPiMi5BqMHMIl-5O1LF1P7x6JQRRPCKIHYadPYT9U8hLbIOYbI-Q7vEJ0gvnG_MzHkAUzygD8GKDTYWOeHYGJYKoUEJaIWz2b3nt72je1d1qSOuDtpKDxgTSh3eX_wXnn0D3dm41fZb7ii5u0e9HdasllPBrXWNnjVeeybA-41F6Tx6l1ijdME9k2KM0_VuZTlLP5PGkJPIYosvuZXXl-1bXbxQh2n1l8njxhDz-NU0BIGqkE7kzj-HYSXv6kLrW0gyfIP_6_c9gOlj3L-rDbDpW1txKc_Sbs_9nYGxnvtN8B70R0UAen5dvdDSEWjq_ui31o2VCHiUvATo7HZUm59ETTcgW5eCIlpSVYRqc1Bh6x6-ivkz7bbqVEZVJXhSbJM-SJBrLtGgp6xJRJFK0RR73h4PosnyT9cmmWHd5pEoRizTehCfLkmQl130Si7Rrt5QVtO5gHdMklV5pfZpCr0fK-5nKPN2IItKyJe2XeSKEoZ-4_AQhwnhxZfD50s6Dh3WslWd_ZWHFmspfRf4jX-Ou-obKBMGSVau04jP-VDwuFy_o_bjPQ5tfe_o_LmM0O13eTTDF49yuOjuBaEJml9eXo7N_UccgmkWPB9Esev8OAAD__7R_nVI">