jcranmer-intel added inline comments.

================
Comment at: clang/test/Sema/constant-builtins-ilogb.cpp:53-63
+// assert smallest subnormal and largest finite numbers
+static_assert(__builtin_ilogbf(1.40129846E-45f) == -149);
+static_assert(__builtin_ilogbf(3.40282347E+38f) == 127);
+
+static_assert(__builtin_ilogb(4.9406564584124654E-324) == -1074);
+static_assert(__builtin_ilogb(1.7976931348623157E+308) == 1023);
+
----------------
You can simplify at least the float, double, and especially long double tests 
using something like this:

```
static_assert(__builtin_ilogbf(__FLT_MIN__) == __FLT_MIN_EXP__ + 1);
static_assert(__builtin_ilogbf(__FLT_MAX__) == __FLT_MAX_EXP__ - 1);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136568

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to