- Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 50810 |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
With -msimd128 -O3, the compiler wont't recognize the following snippet as an i32x4.dot_i16x8_s.
It also scalarizes a lot of stuff; the WASM backend seems to have a lot of trouble with non-128-bit vectors. Even if this wasn't recognized as a dot product, I'd hope to see some extmuls (or at least i16x8.extend_low/high and i32x4.mul) and shuffles for this. I can file another bug for that if you want.
Anyways, here is the example (Compiler Explorer: https://godbolt.org/z/an4jKTnf5):
#include <stdint.h>
typedef int16_t i16x8 attribute((vector_size(16)));
typedef int32_t i32x4 attribute((vector_size(16)));
i32x4
dot(i16x8 a, i16x8 b) {
int32_t prod attribute((vector_size(32))) =
__builtin_convertvector(a, typeof(prod)) *
__builtin_convertvector(b, typeof(prod));
return
__builtin_shufflevector(prod, prod, 0, 2, 4, 6) +
__builtin_shufflevector(prod, prod, 1, 3, 5, 7);
}