[FPEnv][X86][SystemZ] Use different algorithms for i64->double uint_to_fp under stric...
authorCraig Topper <craig.topper@gmail.com>
Wed, 21 Oct 2020 23:45:23 +0000 (16:45 -0700)
committerCraig Topper <craig.topper@gmail.com>
Thu, 22 Oct 2020 01:12:54 +0000 (18:12 -0700)
commit9e884169a2723de5ad5c59af69b35b20953965fa
treeacdb28dbc88b225d2baa3025d14510f7dfb29b8f
parente04ba2bc052f20fe745894b24b0f9b335db5abbc
[FPEnv][X86][SystemZ] Use different algorithms for i64->double uint_to_fp under strictfp to avoid producing -0.0 when rounding toward negative infinity

Some of our conversion algorithms produce -0.0 when converting unsigned i64 to double when the rounding mode is round toward negative. This switches them to other algorithms that don't have this problem. Since it is undefined behavior to change rounding mode with the non-strict nodes, this patch only changes the behavior for strict nodes.

There are still problems with unsigned i32 conversions too which I'll try to fix in another patch.

Fixes part of PR47393

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D87115
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/SystemZ/fp-strict-conv-08.ll
llvm/test/CodeGen/X86/fp-intrinsics.ll
llvm/test/CodeGen/X86/fp-strict-scalar-inttofp.ll
llvm/test/CodeGen/X86/vec-strict-inttofp-128.ll
llvm/test/CodeGen/X86/vec-strict-inttofp-256.ll
llvm/test/CodeGen/X86/vec-strict-inttofp-512.ll
llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll