[PATCH] D84932: [builtins] Add more test cases for __div[sdt]f3 LibCalls

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 23:01:18 PDT 2020


sepavloff added inline comments.


================
Comment at: compiler-rt/test/builtins/Unit/divdf3_test.c:29-34
+    // qNaN / any = qNaN
+    if (test__divdf3(makeQNaN64(), 3., UINT64_C(0x7ff8000000000000)))
+      return 1;
+    // NaN / any = NaN
+    if (test__divdf3(makeNaN64(UINT64_C(0x123)), 3., UINT64_C(0x7ff8000000000000)))
+      return 1;
----------------
Expressions `any/nan' also could be checked.


================
Comment at: compiler-rt/test/builtins/Unit/divdf3_test.c:49-54
+    // Inf / Inf = NaN
+    if (test__divdf3(makeInf64(), makeInf64(), UINT64_C(0x7ff8000000000000)))
+      return 1;
+    // 0.0 / 0.0 = NaN
+    if (test__divdf3(+0x0.0p+0, +0x0.0p+0, UINT64_C(0x7ff8000000000000)))
+      return 1;
----------------
Expression `Inf/0' also could be checked.


================
Comment at: compiler-rt/test/builtins/Unit/divdf3_test.c:80
+    // divisor is 1.0 as UQ1.31
+    if (test__divdf3(0x1.0p+0, 0x1.00000001p+0, UINT64_C(0x3fefffffffe00000)))
       return 1;
----------------
Is 0x1.00000001p+0 equal to 1.0 in UQ1.31?


================
Comment at: compiler-rt/test/builtins/Unit/divsf3_test.c:27
 {
+    // Returned NaNs are assumed to be qNaN by default
+
----------------
Similar notes as for double precision checks.


================
Comment at: compiler-rt/test/builtins/Unit/divtf3_test.c:34
 {
 #if __LDBL_MANT_DIG__ == 113
+    // Returned NaNs are assumed to be qNaN by default
----------------
Similar notes as double precision checks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84932



More information about the cfe-commits mailing list