This fixes the ranges for the vcvth family of FP16 intrinsics in the clang front end. Previously it was accepting incorrect ranges
-Changed builtin range checking in SemaChecking
-added tests SemaCheck changes - included in their own file since no similar one exists
-modified existing tests to reflect new ranges
Details
- Reviewers
SjoerdMeijer javed.absar - Commits
- rGdc54b3741431: [AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
rC334489: [AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
rL334489: [AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
Diff Detail
- Repository
- rL LLVM
Event Timeline
-generates range checks in NEON Emitter rather than hardcoding in SemaChecking.cpp
-uses 'isVCVT_N' to correctly direct the emitter to generate the correct ranges.
lib/Sema/SemaChecking.cpp | ||
---|---|---|
1409 ↗ | (On Diff #149295) | We don't actually need this one, inspecting include/clang/Basic/arm_fp16.inc after building shows an empty set of #ifdefs pragmas - ie nothing is generated and hence nothing happens. |
test/Sema/aarch64-neon-fp16-ranges.c | ||
1 ↗ | (On Diff #149295) | That doesn't seem to work, removing neon introduces hundreds of errors around incompatible types (including things this diff doesn't change) which would suggest maybe neon doesn't cover everything? |
39 ↗ | (On Diff #149295) | Agreed. Fixed. |
I think this looks ok now, just some nits inline.
Can you please upload your diffs with more context next time?
utils/TableGen/NeonEmitter.cpp | ||
---|---|---|
2166 ↗ | (On Diff #149737) | Nit: can you realign this? |
2193 ↗ | (On Diff #149737) | Nit: for a moment I thought this could match more cases than intended, but we have already checked for isVCVT_N, so should be fine? |
2194 ↗ | (On Diff #149737) | Nit: think you're (almost) repeating the comment above, so you can omit this one? |