Page MenuHomePhabricator

[LangRef] clarify the meaning of noimplicitfloat
AcceptedPublic

Authored by inglorion on Thu, Jun 10, 2:21 PM.

Details

Summary

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.

Diff Detail

Event Timeline

inglorion created this revision.Thu, Jun 10, 2:21 PM
inglorion requested review of this revision.Thu, Jun 10, 2:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Jun 10, 2:21 PM
rnk accepted this revision.Thu, Jun 10, 2:50 PM
rnk added reviewers: pengfei, avl, RKSimon, craig.topper.

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 revision is now accepted and ready to land.Thu, Jun 10, 2:51 PM

This matches my understanding too. At least on X86, I think "floating-point" also includes integer SSE. Should we mention that?

rnk added a comment.Thu, Jun 10, 4:01 PM

That's a good point, if this attribute disables vectorization of integer math, the docs should say as much.

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

That's a good point, if this attribute disables vectorization of integer math, the docs should say as much.

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.

inglorion updated this revision to Diff 351593.Fri, Jun 11, 5:01 PM

Also specified that this inhibits the use of SIMD/vector registers
(which is true at least of x86_64 and armv8).

avl added inline comments.Sat, Jun 12, 12:19 AM
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
registers may still cause floating-point code to be generated for the explicit floating-point cases:

  1. LLVM instructions that are generated for the expressions from the source code where value has floating-point or vector type.
  2. LLVM instructions that are generated to satisfy the platform`s ABI requirements.