Adds some more text to the documentation for the noimplicitfloat
function attribute. Hopefully, this makes it clearer what
qualifies an implicit vs. explicit float, without becoming overly
long or going into target-specific details.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This matches my understanding of the semantics of noimplicitfloat, but I'd like to get a stamp from one of the other people I added to check my understanding.
This matches my understanding too. At least on X86, I think "floating-point" also includes integer SSE. Should we mention that?
That's a good point, if this attribute disables vectorization of integer math, the docs should say as much.
The examples I know of are using vector ctpop instructions when
Note, I don't know specifically about the vectorizer. I was referring to backend tricks like this https://godbolt.org/z/KaE9T8P1q where we use the vector unit to expand i64 popcnt on 32-bit target.
Also specified that this inhibits the use of SIMD/vector registers
(which is true at least of x86_64 and armv8).
llvm/docs/LangRef.rst | ||
---|---|---|
1641 | Probably, it makes sense to explicitly describe which cases are "explicit/implicit"? something like this: LLVM instructions that perform floating-point operations or require access to floating-point
|
I avoided enumerating the cases to save space and to avoid pinning this down too much. My intention was to clarify that noimplicitfloat does not mean that no floating-point code will be generated under any circumstances, not necessarily to clarify exactly in which situations such code will or will not be generated. I'm happy to add the extra text, but before I do, I would like to get a second vote in favor of doing so vs. using the shorter text that I had written. @rnk, @craig.topper: What are your opinions?
lgtm
I think the current text is correct and clear, and we can elaborate later if others think more precision is needed.
llvm/docs/LangRef.rst | ||
---|---|---|
1641 | I think the existing text is clear enough and more concise. Mainly, the proposed text adds a note about generating FP code to satisfy platform ABI requirements. I think the text "LLVM instructions ... that require access to FP registers" captures that well enough. |
Probably, it makes sense to explicitly describe which cases are "explicit/implicit"? something like this:
LLVM instructions that perform floating-point operations or require access to floating-point
registers may still cause floating-point code to be generated for the explicit floating-point cases: