]> granicus.if.org Git - llvm/commit
Merging r275981 and r276740:
authorHans Wennborg <hans@hanshq.net>
Thu, 28 Jul 2016 15:38:57 +0000 (15:38 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 28 Jul 2016 15:38:57 +0000 (15:38 +0000)
commit7230d55ab6371ac83f030967c3fe7bc5d4f62dde
tree44250bf421cbf0a97e6c1f29d79a1c962506a6e6
parentcd00acd4fbde246fabf4aed5da3f7e6e24a27ee6
Merging r275981 and r276740:
------------------------------------------------------------------------
r275981 | rksimon | 2016-07-19 08:07:43 -0700 (Tue, 19 Jul 2016) | 13 lines

[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR

D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

A companion clang patch is at D22105

Differential Revision: https://reviews.llvm.org/D22106
------------------------------------------------------------------------

------------------------------------------------------------------------
r276740 | rksimon | 2016-07-26 03:41:28 -0700 (Tue, 26 Jul 2016) | 5 lines

[X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics

Fixed typo in the intrinsic definitions of (v)cvtsd2ss with memory folding.

This was only unearthed when rL276102 started using the intrinsic again.....
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276990 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/IR/IntrinsicsX86.td
lib/Analysis/ConstantFolding.cpp
lib/IR/AutoUpgrade.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/avx-intrinsics-fast-isel.ll
test/CodeGen/X86/avx-intrinsics-x86-upgrade.ll
test/CodeGen/X86/avx-intrinsics-x86.ll
test/CodeGen/X86/sse-intrinsics-fast-isel-x86_64.ll
test/CodeGen/X86/sse-intrinsics-fast-isel.ll
test/CodeGen/X86/sse2-intrinsics-fast-isel-x86_64.ll
test/CodeGen/X86/sse2-intrinsics-fast-isel.ll
test/CodeGen/X86/sse2-intrinsics-x86-upgrade.ll
test/CodeGen/X86/sse2-intrinsics-x86.ll
test/Transforms/ConstProp/calls.ll