[PATCH] D67999: Fix `compiler_rt_logbf_test.c` test failure for Builtins-i386-darwin test suite.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 11:00:41 PDT 2019


delcypher added a comment.

> I'd like to let others weigh in too. What do you think?

Well I'm not very happy with this patch but it was a quick fix that got the test passing again so I thought I'd suggest this first. I do have an alternative in mind. If we don't care about bit identical representations of NaN then what we could do is change the test (`compiler_rt_logbf_test.c`) by replacing

  if (toRep(crt_value) !=  toRep(libm_value)) {

with

  if (canonicalizeReprNan(toRep(crt_value)) !=  canonicalizeReprNan(toRep(libm_value))) {

Here `canonicalizeReprNan()` would be a function that returns the input it is given unless it is the bit pattern for a NaN. If the bit pattern is a NaN then it returns a canonical representation of NaN (probably a quiet NaN with the sign bit set to zero).

This means that we don't need to change the implementation of `__compiler_rt_logbX()` and in testing we will tolerate libm implementations that decide to return different NaN representations than compiler-rt does.

What do you think?

> (I don't think I can see the rdar link, lemme know if there's some public way to view it)

The radar number here is just so Apple can track upstream changes landing into internal repos. The contents of this particular radar doesn't add anything to this discussion because it's just a report that this test is failing.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D67999





More information about the llvm-commits mailing list