<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63320>63320</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ARM]: Incorrect ARMHF vector_size ABI for VFP-only
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
easyaspi314
</td>
</tr>
</table>
<pre>
Related to #62994.
According to the [EABI documentation](https://github.com/ARM-software/abi-aa/blob/844a79fd4c77252a11342709e3b27b2c9f590cf1/aapcs32/aapcs32.rst#vfp-and-simd-vector-register-arguments), the hard float ABI passes 64-bit and 128-bit containerized vectors in VFP registers, regardless of whether vectors are available. This is what GCC does, even if it can't legalize the vector type.
However, on hard float without NEON (e.g. Raspbian), Clang unpacks them into individual arguments.
This results in integer vectors being passed in r0-r3, and float/double registers to not be aligned to doubleword or quadword register pairs.
| args | AAPCS | Clang VFP |
| :-- | :--| :-- |
| i32x2 a | d0 (s0-s1) | **r0-r1** |
| i32x4 a | q0 (s0-s3) | **r0-r3** |
| f32 a, i32x2 b | s0, d1 (s2-s3) | s0, **r0-r1** |
| f32 a, i32x4 b | s0, q1 (s4-s7) | s0, **r0-r3** |
| f32 a, f32x2 b | s0, d1 (s2-s3) | s0, **s1-s2** |
| f32 a, f64x2 b | s0, q1 (s4-s7) | s0, **d1-d2 (s2-s5)** |
https://godbolt.org/z/73Kjc5zaM
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE9z47YP_TT0BSOPBP2zDj4ozuq3O7_Jdift9NqBREjilhYdkrKbfPoO5SSOs212epEwEt7DwyMIck4NE_NW5Dciv13R7Edjt0zukdxBpUm2ao183N6zJs8SvAGBaYFVla1FfCvi-vysu85YqaYhZPiRQeQ3n-qbLyBNN-958uSVmUR-K3Azen9wIq0FNgKbQflxbted2Qts6vu7yJnen8iywIZaFREJbFptWoHNJsuorHqZdWWJO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