Don't raise inexact when lowering ceil, floor, round, trunc.
authorStephen Canon <scanon@apple.com>
Tue, 22 Sep 2015 11:43:17 +0000 (11:43 +0000)
committerStephen Canon <scanon@apple.com>
Tue, 22 Sep 2015 11:43:17 +0000 (11:43 +0000)
commiteb1a6c56698dfb1efffae151f4ec7eaf3e2144c7
treeb7ef149a2f42fd54e1f8cd9519cbb434e1626c04
parentccf2ea372c25a1b4074e657477a1483d19b86085
Don't raise inexact when lowering ceil, floor, round, trunc.

The C standard has historically not specified whether or not these functions should raise the inexact flag. Traditionally on Darwin, these functions *did* raise inexact, and the llvm lowerings followed that conventions. n1778 (C bindings for IEEE-754 (2008)) clarifies that these functions should not set inexact. This patch brings the lowerings for arm64 and x86 in line with the newly specified behavior.  This also lets us fold some logic into TD patterns, which is nice.

Differential Revision: http://reviews.llvm.org/D12969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248266 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
lib/Target/AArch64/AArch64InstrInfo.td
lib/Target/X86/X86InstrSSE.td
test/CodeGen/AArch64/arm64-rounding.ll
test/CodeGen/AArch64/round-conv.ll
test/CodeGen/X86/avx-cvt.ll
test/CodeGen/X86/floor-soft-float.ll
test/CodeGen/X86/rounding-ops.ll
test/CodeGen/X86/stack-folding-fp-avx1.ll
test/CodeGen/X86/stack-folding-fp-sse42.ll