atrosinenko added a comment.

@sepavloff

Thank you for the test cases. Looks like it is worth completely rewriting the 
three tests as table-driven tests, so for example adding four cases for 
`[+-]Inf / [+-]0.0` would be almost as easy as testing only one of them 
(something similar is already implemented for `udivmod?i4_test.c`). The 
differences between adjacent test cases would be more visually obvious, as well.



================
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;
----------------
sepavloff wrote:
> Is 0x1.00000001p+0 equal to 1.0 in UQ1.31?
Divisor is `1.(31 zeroes)1` after restoring the implicit bit, so it is 
**truncated** to 1.0 as UQ1.31. Instead of counting bits carefully, it would 
probably be better to add several tests with the `1` bit shifted 1-2 places 
left/right as well as if the divisor is round up instead of truncating - //just 
in case//. :) So, with table-driven test it would probably be simpler to not 
make extra assumptions on the implementation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84932

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

Reply via email to