<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68149>68149</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Can't pass `__m512bh` as inline assembly operand
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:X86
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bjacob
</td>
</tr>
</table>
<pre>
Normally constraint `x` allows passing SIMD vectors as X86 inline assembly operands, as documented here for LLVM inline assembly:
https://llvm.org/docs/LangRef.html#inline-assembler-expressions
This Compiler Explorer link shows that this works for `__m512` but not for `__m512bh`.
https://godbolt.org/z/Wrrnr6E4d
Pasted here:
```c
#include <immintrin.h>
#include <stdint.h>
__m512bh broadcast_load_2xbf16(const void *src) {
__m512bh dst;
asm("vbroadcastss %[dst], dword ptr [%[src]]" :[dst]"=x"(dst) : [src]"r"(src) :);
return dst;
}
__m512 broadcast_load_f32(const void *src) {
__m512 dst;
asm("vbroadcastss %[dst], dword ptr [%[src]]" :[dst]"=x"(dst) : [src]"r"(src) :);
return dst;
}
```
Compile with flags: `-O3 -masm=intel -mavx -mavx2 -mfma -mf16c -mavx512f -mavx512vl -mavx512cd -mavx512bw -mavx512dq -mavx512bf16` .
The function `broadcast_load_f32` compiles but the function `broadcast_load_2xbf16` errors with:
```
<source>:6:7: error: couldn't allocate output register for constraint 'x'
6 | asm("vbroadcastss %[dst], dword ptr [%[src]]" :[dst]"=x"(dst) : [src]"r"(src) :);
| ^
1 error generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVV2P6yYT_jXkZpQIQ0ySC19kk430SnveVm3VnrsVhnHMWQwp4Gy2v77CdrIf3dPetlGEB5gZHh7mQ8Zojg6xIuUdKfcz2afWh6r-JpWvZ7XXL9X_feiktS-gvIspSOMSEEEvRFCQ1vrnCKfsxh3h5_992cMZVfIhgozwdS3AOGscgowRu9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