This patch adds the msa.h header file containing the shorter names for the
MSA instrinsics, e.g. msa_sll_b for builtin_msa_sll_b.
Yes it would unfortunately.
We don't have an __fp16 type in the MIPS ABIs so it doesn't really exist. The MSA builtins are in fact not defined in terms of half-float they are just represented as integers via v8i16. This is because there is very little you can do with the half-float type in general apart from the conversions.
I also notice in the test case that v8f16 is used in numerous places where it should be v4f32 and v4f32 where it should be v2f64 (I think). I'll highlight an example below.
This is a correct use of v8f16.
This is an incorrect use of v8f16. There are many more.
This should be v2f64 I believe, there are many more of these too.
Checking the generated IR for the incorrect uses of v8f16 shows that clang is silently generating bitcasts from <8 x i16> to <4 x float>. There are some other cases where the type of the operands is incorrect w.r.t. the builtin used.
I'm not familiar with the type checking machinery, so I'm unsure if the silent conversion is a bug or feature.