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.

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

s/one/a/

1055

Nit, this indentation seems noncanonical.

1064–1065

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

1065

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

llvm/lib/Support/APFloat.cpp
69–73

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

70

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

72

adjacent to

82–90

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

4244

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

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

Removed. I don't like it either.

llvm/lib/Support/APFloat.cpp
69–73

Tweaked a bit.

70

Added ", and if normalized, ..."

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

lgtm!

llvm/lib/Support/APFloat.cpp
70

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

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

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

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