[PATCH] D69773: [APFloat] Extend converting from special strings

Ehud Katz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 11:21:36 PST 2020


ekatz marked an inline comment as done.
ekatz added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:2663
+    // 'Q').
+    if (str[0] != 'N' && str[0] != (C + NDiff))
+      return false;
----------------
hfinkel wrote:
> My impression is that this logic involving NDiff is here to make sure that the case matches, correct? This makes the code hard to follow. Frankly, if this is just a feature for us (to make it easier to write FP numbers in textual LLVM IR), why bother checking for the case matching at all?  Just do a case-insensitive match. Otherwise, you can also match and then just check that: `isupper(str[0]) == isupper(str[2])`, no?
> 
I think that the key of your comment is that:
> ...the code hard to follow.

I agree, and I decided to implement a simpler version (maybe not as efficient, but it is negligible anyway).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69773/new/

https://reviews.llvm.org/D69773





More information about the llvm-commits mailing list