llvm-project/clang/lib/Headers
Simon Pilgrim e3b9ee0645 [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.

Differential Revision: https://reviews.llvm.org/D22105

llvm-svn: 276102
2016-07-20 10:18:01 +00:00
..
CMakeLists.txt [Clang][Feature] Adding CLFLUSHOPT feature and intrinsic to clang 2016-07-05 15:56:03 +00:00
__clang_cuda_cmath.h [CUDA] Tweak math forward declares so we're compatible with libstdc++4.9. 2016-04-07 23:55:53 +00:00
__clang_cuda_intrinsics.h NVPTX: Rename __builtin_ptx_shfl -> __nvvm_shfl 2016-07-06 19:52:32 +00:00
__clang_cuda_math_forward_declares.h [CUDA] Tweak math forward declares so we're compatible with libstdc++4.9. 2016-04-07 23:55:53 +00:00
__clang_cuda_runtime_wrapper.h [CUDA] Implement __shfl* intrinsics in clang headers. 2016-06-09 20:04:57 +00:00
__stddef_max_align_t.h Restore the libc++ definition of max_align_t on Apple platforms 2015-02-24 01:06:22 +00:00
__wmmintrin_aes.h Clean up: remove trailing spaces in x86 intrinsic headers. 2016-05-28 00:18:59 +00:00
__wmmintrin_pclmul.h Clean up: remove trailing spaces in x86 intrinsic headers. 2016-05-28 00:18:59 +00:00
adxintrin.h [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR 2015-06-30 13:36:19 +00:00
altivec.h Make the altivec intrinsics that require immediate constant propagation 2016-05-24 22:25:06 +00:00
ammintrin.h Updated doxygen comments for intrinsics. 2016-04-27 07:14:02 +00:00
arm_acle.h Update functions in clang supplied headers to use the compiler reserved 2016-02-12 02:22:53 +00:00
avx2intrin.h [X86] Use undefined instead of setzero in shufflevector based intrinsics when the second source is unused. Rewrite immediate extractions in shuffle intrinsics to be in ((c >> x) & y) form instead of ((c & z) >> x). This way only x varies between each use instead of having to vary x and z. 2016-07-04 22:18:01 +00:00
avx512bwintrin.h [X86][AVX512] Converted the VBROADCAST intrinsics to generic IR 2016-07-05 12:59:33 +00:00
avx512cdintrin.h [Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAST instruction set . 2016-04-27 11:43:14 +00:00
avx512dqintrin.h [Clang][Intrinsics][AVX512][BuiltIn] adding intrinsics for vrangesd instruction set 2016-06-30 08:05:46 +00:00
avx512erintrin.h Fixing problem with rsqrt28_sd 2016-06-05 15:57:49 +00:00
avx512fintrin.h [X86][AVX512F] minor fix of the parameter names 2016-07-14 08:40:30 +00:00
avx512ifmaintrin.h [AVX512] Remove space in -1 constants. NFC 2016-06-04 05:43:37 +00:00
avx512ifmavlintrin.h [AVX512] Remove space in -1 constants. NFC 2016-06-04 05:43:37 +00:00
avx512pfintrin.h [Clang][avx512][Intrinsics] adding prefetch gather intrinsics 2016-06-14 13:45:17 +00:00
avx512vbmiintrin.h [Clang][AVX512] Making cosmetic changes 2016-07-12 12:42:27 +00:00
avx512vbmivlintrin.h [clang][AVX512][Builtin] adding missing intrinsics for vpmultishiftqb{128|256|512} instruction set . 2016-05-23 15:04:39 +00:00
avx512vlbwintrin.h [X86][AVX512] Converted the VBROADCAST intrinsics to generic IR 2016-07-05 12:59:33 +00:00
avx512vlcdintrin.h [AVX512] Move the 128-bit and 256-bit lzcnt intrinsics to avx512vlcdintrin.h where they belong. 2016-06-21 06:53:58 +00:00
avx512vldqintrin.h [X86] Use unsigned types for vector arithmetic in intrinsics to avoid undefined behavior for signed integer overflow. 2016-06-04 05:43:41 +00:00
avx512vlintrin.h [AVX512] Replace masked AND/OR/XOR intrinsics with native code and remove the builtins. 2016-07-11 06:14:18 +00:00
avxintrin.h [X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR 2016-07-20 10:18:01 +00:00
bmi2intrin.h [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR 2015-06-30 13:36:19 +00:00
bmiintrin.h [Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang. 2016-06-22 12:32:43 +00:00
clflushoptintrin.h [Clang][Feature] Adding CLFLUSHOPT feature and intrinsic to clang 2016-07-05 15:56:03 +00:00
cpuid.h Fix trailing commas in AMD define. 2014-10-01 21:22:17 +00:00
cuda_builtin_vars.h NVPTX: Use the nvvm builtins to read SRegs rather than the legacy ptx ones 2016-07-07 16:41:08 +00:00
emmintrin.h [X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR 2016-07-20 10:18:01 +00:00
f16cintrin.h Doxygen comments for avxintrin.h. 2016-05-16 22:54:45 +00:00
float.h <float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99. 2016-02-12 01:15:33 +00:00
fma4intrin.h [X86] Add typecasts to remove most assumptions about what __m128i/__m256i is defined as. Add similar typecasts for the fp types as well. 2016-05-16 06:38:42 +00:00
fmaintrin.h [X86] Add typecasts to remove most assumptions about what __m128i/__m256i is defined as. Add similar typecasts for the fp types as well. 2016-05-16 06:38:42 +00:00
fxsrintrin.h [X86] Add fxsr feature name for fxsave/fxrestore builtins. 2015-10-16 06:22:36 +00:00
htmintrin.h Update functions in clang supplied headers to use the compiler reserved 2016-02-12 02:22:53 +00:00
htmxlintrin.h Update functions in clang supplied headers to use the compiler reserved 2016-02-12 02:22:53 +00:00
ia32intrin.h Adding front-end support to several intrinsics (bit scanning, conversion and state reading intrinsics) 2016-06-01 12:21:00 +00:00
immintrin.h [Clang][Feature] Adding CLFLUSHOPT feature and intrinsic to clang 2016-07-05 15:56:03 +00:00
intrin.h [intrin.h] Certain _Interlocked intrinsics return the old value 2016-06-28 02:54:43 +00:00
inttypes.h Headers: wordsmith error message 2016-06-17 00:27:02 +00:00
iso646.h
limits.h
lzcntintrin.h [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR 2015-06-30 13:36:19 +00:00
mm3dnow.h [X86] Add void to the argument list of intrinsics that don't take arguments since empty argument list mean something else in C. 2016-06-09 05:14:28 +00:00
mm_malloc.h
mmintrin.h Add doxygen comments to mmintrin.h's intrinsics. 2016-06-10 00:10:40 +00:00
module.modulemap [OpenCL] Include opencl-c.h by default as a clang module 2016-06-20 19:26:00 +00:00
mwaitxintrin.h Clean up: remove trailing spaces in x86 intrinsic headers. 2016-05-28 00:18:59 +00:00
nmmintrin.h Update the intel intrinsic headers to use the target attribute support. 2015-06-17 07:09:32 +00:00
opencl-c.h [OpenCL] An implementation of device side enqueue (DSE) from OpenCL v2.0 s6.13.17. 2016-07-05 11:31:24 +00:00
pkuintrin.h Update functions in clang supplied headers to use the compiler reserved 2016-02-12 02:22:53 +00:00
pmmintrin.h Clean up: remove trailing spaces in x86 intrinsic headers. 2016-05-28 00:18:59 +00:00
popcntintrin.h This patch adds doxygen comments for the intrinsincs in the header file popcntintrin.h. 2016-03-01 20:04:57 +00:00
prfchwintrin.h [X86] Add missing _m_prefetch intrinsic 2015-07-27 19:01:52 +00:00
rdseedintrin.h [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR 2015-06-30 13:36:19 +00:00
rtmintrin.h [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR 2015-06-30 13:36:19 +00:00
s390intrin.h [SystemZ] Add support for vecintrin.h vector built-in functions 2015-07-30 14:10:43 +00:00
shaintrin.h [X86] Add missing typecasts in intrinsic macros. This should make them more robust against inputs that aren't already the right type. 2015-11-11 03:47:10 +00:00
smmintrin.h [X86] Use unsigned types for vector arithmetic in intrinsics to avoid undefined behavior for signed integer overflow. 2016-06-04 05:43:41 +00:00
stdalign.h
stdarg.h
stdatomic.h Don't use BCPL comments here, in case someone wants to use <stdatomic.h> from C89 mode. 2015-01-29 03:34:39 +00:00
stdbool.h
stddef.h Fix interaction of max_align_t and modules. 2014-10-03 00:31:35 +00:00
stdint.h Clean up trailing whitespace in the builtin headers 2015-09-12 02:55:19 +00:00
stdnoreturn.h
tbmintrin.h Update functions in clang supplied headers to use the compiler reserved 2016-02-12 02:22:53 +00:00
tgmath.h Clean up trailing whitespace in the builtin headers 2015-09-12 02:55:19 +00:00
tmmintrin.h This patch adds doxygen comments for all the intrinsincs in the header file tmmintrin.h. 2016-03-03 00:20:11 +00:00
unwind.h Add ARM EHABI-related constants to unwind.h. 2016-02-28 15:01:42 +00:00
vadefs.h Intercept __crt_va_* used by MSVC "14" 2014-11-20 22:44:03 +00:00
varargs.h
vecintrin.h [SystemZ] Add support for vecintrin.h vector built-in functions 2015-07-30 14:10:43 +00:00
wmmintrin.h Update the intel intrinsic headers to use the target attribute support. 2015-06-17 07:09:32 +00:00
x86intrin.h Add new intrinsic support for MONITORX and MWAITX instructions 2016-05-18 11:56:23 +00:00
xmmintrin.h [X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR 2016-07-20 10:18:01 +00:00
xopintrin.h [X86] Add typecasts to remove most assumptions about what __m128i/__m256i is defined as. Add similar typecasts for the fp types as well. 2016-05-16 06:38:42 +00:00
xsavecintrin.h Headers: Switch some headers to LF line endings for consistency. 2015-10-15 10:33:27 +00:00
xsaveintrin.h Headers: Switch some headers to LF line endings for consistency. 2015-10-15 10:33:27 +00:00
xsaveoptintrin.h Headers: Switch some headers to LF line endings for consistency. 2015-10-15 10:33:27 +00:00
xsavesintrin.h Headers: Switch some headers to LF line endings for consistency. 2015-10-15 10:33:27 +00:00
xtestintrin.h Move xtest to its own file to match the gcc header organization. 2015-06-17 18:42:07 +00:00