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.
Details
- Reviewers
vkalintiris zoran.jovanovic
Diff Detail
Event Timeline
test/CodeGen/builtins-mips-msa.c | ||
---|---|---|
8 | 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. | |
361 | This is a correct use of v8f16. | |
390 | This is an incorrect use of v8f16. There are many more. | |
391 | This should be v2f64 I believe, there are many more of these too. |
@sdardis: can you update the review request before committing this because I don't think that test/CodeGen/builtins-mips-msa.c has ever been properly reviewed before.
As stated I'll do a follow-up patch to fix the test. Committed as r281975.
Thanks,
Simon
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.
@mpf
Would it be problematic to expose this typedef from msa.h?