[Diffusion] rGb53d44fe4741: [EarlyCSE][ConstantFolding] add tests for atan/atan2; NFC

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 08:13:07 PDT 2022


spatel added a comment.

This is the test in question:

  define float @callatan0() {
  ; CHECK-LABEL: @callatan0(
  ; CHECK-NEXT:    [[CALL:%.*]] = call float @atanf(float -0.000000e+00)
  ; CHECK-NEXT:    ret float -0.000000e+00
  ;
    %call = call float @atanf(float -0.0)
    ret float %call
  }

And if I'm seeing the bot log correctly, a result of "0.0" (positive zero) was returned for an input of -0.0.
That doesn't match the IEEE-754 spec:
"For the functions expm1, exp2m1, exp10m1, logp1, log2p1, log10p1, sin, tan, sinPi, atanPi, asin, atan, sinh,
tanh, asinh, and atanh, f (+0) is +0 and f (−0) is −0 with no exception."


BRANCHES
  main

Users:
  mohammed-nurulhoque (Author)
  spatel (Committer)

https://reviews.llvm.org/rGb53d44fe4741



More information about the llvm-commits mailing list