This is an archive of the discontinued LLVM Phabricator instance.

[APFloat] Fix comments. NFC.
ClosedPublic

Authored by timshen on Jan 24 2017, 5:40 PM.

Details

Summary

Fix comments in response to jlebar's comments in D27872.

Diff Detail

Repository
rL LLVM

Event Timeline

timshen created this revision.Jan 24 2017, 5:40 PM
jlebar added inline comments.Jan 24 2017, 5:48 PM
llvm/include/llvm/ADT/APFloat.h
1054 ↗(On Diff #85672)

s/one/a/

1055 ↗(On Diff #85672)

Nit, this indentation seems noncanonical.

1064 ↗(On Diff #85672)

Perhaps "Add two APFloats, rounding ties to the nearest even.", so we repeat less of what's in the code?

1065 ↗(On Diff #85672)

Nit, I'm not sure we need the asterisks around "No".

llvm/lib/Support/APFloat.cpp
69 ↗(On Diff #85672)

s/It consists/They consist/ to match "number*s*" earlier.

70 ↗(On Diff #85672)

Well, that second criterion is only true for non-denormals, right?

72 ↗(On Diff #85672)

adjacent to

82 ↗(On Diff #85672)

(Here "it's" is fine, because the antecedent is "semantics", used in a singular sense, rather than "numbers".)

4243 ↗(On Diff #85672)

Hm, in order for this to be true for denormals, they must also have the same sign, right?

iteratee accepted this revision.Jan 24 2017, 5:51 PM
iteratee added inline comments.
llvm/lib/Support/APFloat.cpp
73 ↗(On Diff #85672)

You could clarify that there are 2 11-bit exponents.

This revision is now accepted and ready to land.Jan 24 2017, 5:51 PM
timshen updated this revision to Diff 85831.Jan 25 2017, 4:05 PM
timshen marked 9 inline comments as done.

Tweak wording.

llvm/include/llvm/ADT/APFloat.h
1065 ↗(On Diff #85672)

Removed. I don't like it either.

llvm/lib/Support/APFloat.cpp
69 ↗(On Diff #85672)

Tweaked a bit.

70 ↗(On Diff #85672)

Added ", and if normalized, ..."

jlebar edited edge metadata.Jan 25 2017, 4:10 PM

lgtm!

llvm/lib/Support/APFloat.cpp
70 ↗(On Diff #85831)

I think "if normal" or "if not denormal" is what you want. "if normalized" implies that you may be able to take *any* Hi/Lo and "normalize" them so that this criterion is true. But that's not true for some values (namely, denormals).

Unless we use "normalized" elsewhere in apfloat, in which case, whatever. :)

4341 ↗(On Diff #85831)

Again, perhaps "normal" or "non-denormal".

This revision was automatically updated to reflect the committed changes.
timshen marked 2 inline comments as done.

s/normalized/normal/ in the commit. I committed before uploading it to Phab. :P

llvm/lib/Support/APFloat.cpp
70 ↗(On Diff #85831)

Changed to normal as APFloat uses it in other places too.

FWIW, https://en.wikipedia.org/wiki/Denormal_number aliases these two terms.