llvm-project/clang/lib/Headers
Craig Topper 8b653d0308 [X86] Add gcc rotate intrinsics to ia32intrin.h
This is another attempt at what Erich Keane tried to do in r355322.

This adds rolb, rolw, rold, rolq and their ror equivalent as always_inline wrappers around __builtin_rotate* which will lower to funnel shift intrinsics in IR.

Additionally, when _MSC_VER is not defined we will define _rotl, _lrotl, _rotr, _lrotr as macros to one of the always_inline intrinsics mentioned above. Making sure that _lrotl/_lrotr use either 32 or 64 bit based on the size of long. These need to be macros because we have builtins with the same name for MS compatibility, but _MSC_VER isn't always defined when those builtins are enabled.

We also define _rotwl and _rotwr as macros aliasing to rolw/rorw just like gcc to complete the set. These don't need to be gated with _MSC_VER because these aren't MS builtins.

I've added tests both for non-MS and -ms-extensions with and without _MSC_VER being defined.

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

llvm-svn: 356423
2019-03-18 22:25:57 +00:00
..
cuda_wrappers [CUDA] Added missing 'inline' for functions defined in a header. 2018-12-07 22:20:53 +00:00
CMakeLists.txt [build] Rename clang-headers to clang-resource-headers 2019-03-04 21:19:53 +00:00
__clang_cuda_builtin_vars.h Fix typos in clang 2018-04-06 15:14:32 +00:00
__clang_cuda_cmath.h [CUDA] Remove implementations of nexttoward. 2017-11-17 01:15:43 +00:00
__clang_cuda_complex_builtins.h [CUDA] Re-land support for <complex> (r283683 and r283680). 2016-10-11 17:36:03 +00:00
__clang_cuda_device_functions.h [CUDA][Windows] Partial fix for bug 38811 (Step 2 of 3) 2019-03-15 19:04:46 +00:00
__clang_cuda_intrinsics.h [CUDA] added missing __ldg(const signed char *) 2018-04-18 18:33:43 +00:00
__clang_cuda_libdevice_declares.h [CUDA][Windows] Partial fix for bug 38811 (Step 2 of 3) 2019-03-15 19:04:46 +00:00
__clang_cuda_math_forward_declares.h [CUDA] Remove implementations of nexttoward. 2017-11-17 01:15:43 +00:00
__clang_cuda_runtime_wrapper.h Basic CUDA-10 support. 2019-02-05 22:38:58 +00:00
__stddef_max_align_t.h
__wmmintrin_aes.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
__wmmintrin_pclmul.h [X86] Fix some places where macro arguments to intrinsics weren't cast to _m512(i|d)/_m256(i|d/_m128(i|d) first. 2018-05-31 01:24:40 +00:00
adxintrin.h [X86] Remove the addcarry builtins. Leaving only the addcarryx builtins since that matches gcc. 2018-12-10 06:07:59 +00:00
altivec.h [PowerPC] Vector load/store builtins overstate alignment of pointers 2018-11-26 14:35:38 +00:00
ammintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
arm64intr.h [clang] Add ARM64 support to armintr.h for MSVC compatibility 2017-07-26 05:29:40 +00:00
arm_acle.h [ARM] ACLE Chapter 9 intrinsics 2017-05-04 08:37:59 +00:00
armintr.h
avx2intrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512bitalgintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512bwintrin.h [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
avx512cdintrin.h [X86] Remove mask and passthru arguments from vpconflict builtins. Use select in IR instead. 2019-01-25 07:08:22 +00:00
avx512dqintrin.h [X86] Add ktest intrinsics to match gcc and icc. 2018-08-31 22:29:56 +00:00
avx512erintrin.h [X86] Remove __extension__ from macro intrinsics when its not needed. 2018-05-31 00:51:20 +00:00
avx512fintrin.h [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
avx512ifmaintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512ifmavlintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512pfintrin.h [X86] Make the pointer arguments to avx512 gather/scatter intrinsics 'void*' to match gcc and Intel's documentation. 2019-01-09 07:36:01 +00:00
avx512vbmi2intrin.h Recommit r350555 "[X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd builtins." 2019-01-07 21:00:41 +00:00
avx512vbmiintrin.h [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR instead. 2019-01-14 08:46:51 +00:00
avx512vbmivlintrin.h [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR instead. 2019-01-14 08:46:51 +00:00
avx512vlbitalgintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512vlbwintrin.h [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
avx512vlcdintrin.h [X86] Remove mask and passthru arguments from vpconflict builtins. Use select in IR instead. 2019-01-25 07:08:22 +00:00
avx512vldqintrin.h [X86] Remove the cvtuqq2ps256/cvtqq2ps256 mask builtins. Replace with uitofp/sitofp and select. 2019-01-20 19:04:56 +00:00
avx512vlintrin.h [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
avx512vlvbmi2intrin.h Recommit r350555 "[X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd builtins." 2019-01-07 21:00:41 +00:00
avx512vlvnniintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512vnniintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512vpopcntdqintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avx512vpopcntdqvlintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
avxintrin.h [X86] Use the new unaligned vector typedefs for the loadu/storeu intrinsics pointer arguments. 2019-02-12 07:44:40 +00:00
bmi2intrin.h
bmiintrin.h [X86] For lzcnt/tzcnt intrinsics use cttz/ctlz intrinsics with zero_undef flag set to false. 2018-09-26 17:01:44 +00:00
cetintrin.h [X86] Fix some inconsistent formatting in the first line of our intrinsics headers. 2018-05-04 21:45:25 +00:00
cldemoteintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
clflushoptintrin.h [X86] Fix some inconsistent formatting in the first line of our intrinsics headers. 2018-05-04 21:45:25 +00:00
clwbintrin.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
clzerointrin.h Remove trailing space 2018-07-30 19:24:48 +00:00
cpuid.h [x86] invpcid intrinsic 2018-05-25 06:34:42 +00:00
emmintrin.h [X86] Use the new unaligned vector typedefs for the loadu/storeu intrinsics pointer arguments. 2019-02-12 07:44:40 +00:00
f16cintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
float.h [clang] Only provide C11 features in <float.h> starting with C++17 2019-02-22 20:48:54 +00:00
fma4intrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
fmaintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
fxsrintrin.h [X86] Remove 'return' from a bunch of intrinsics that return void and use a builtin that returns void. 2018-05-30 17:23:45 +00:00
gfniintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
htmintrin.h
htmxlintrin.h Fix typos in clang 2018-04-06 15:14:32 +00:00
ia32intrin.h [X86] Add gcc rotate intrinsics to ia32intrin.h 2019-03-18 22:25:57 +00:00
immintrin.h Recommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms" 2019-01-16 22:56:25 +00:00
intrin.h [COFF, ARM64] Remove definitions for _byteswap library functions 2019-02-11 20:04:02 +00:00
inttypes.h
invpcidintrin.h [x86] invpcid intrinsic 2018-05-25 06:34:42 +00:00
iso646.h
limits.h
lwpintrin.h Remove trailing space 2018-07-30 19:24:48 +00:00
lzcntintrin.h [Builltins][X86] Provide implementations of __lzcnt16, __lzcnt, __lzcnt64 for MS compatibility. Remove declarations from intrin.h and implementations from lzcntintrin.h 2018-12-14 00:21:02 +00:00
mm3dnow.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
mm_malloc.h
mmintrin.h [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack. 2019-02-08 19:45:08 +00:00
module.modulemap [x86] invpcid intrinsic 2018-05-25 06:34:42 +00:00
movdirintrin.h [X86] Use C style comments in intrinsic headers for overall consistency. 2018-05-30 22:33:21 +00:00
msa.h
mwaitxintrin.h [X86] Consistently use double underscore at the beginning of the include guards in our intrinsic headers. 2018-04-24 17:40:47 +00:00
nmmintrin.h [X86] Consistently use double underscore at the beginning of the include guards in our intrinsic headers. 2018-04-24 17:40:47 +00:00
opencl-c.h OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
pconfigintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
pkuintrin.h [X86] Remove 'return' from a bunch of intrinsics that return void and use a builtin that returns void. 2018-05-30 17:23:45 +00:00
pmmintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
popcntintrin.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
prfchwintrin.h [X86] Remove some preprocessor feature checks from intrinsic headers 2018-05-21 06:07:49 +00:00
ptwriteintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
rdseedintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
rtmintrin.h
s390intrin.h
sgxintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
shaintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
smmintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
stdalign.h
stdarg.h Guard __gnuc_va_list typedef. 2017-01-23 19:09:21 +00:00
stdatomic.h Revert "Emit an error when mixing <stdatomic.h> and <atomic>" 2018-05-02 19:52:07 +00:00
stdbool.h In stdbool.h, define bool, false, true only in gnu++98 2017-12-08 08:28:08 +00:00
stddef.h
stdint.h Fix typos in clang 2018-04-06 15:14:32 +00:00
stdnoreturn.h
tbmintrin.h
tgmath.h [Headers] Reapply: Add #include_next for tgmath.h on Darwin 2017-03-16 23:19:00 +00:00
tmmintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
unwind.h [Headers][mips] Add `__attribute__((__mode__(__unwind_word__)))` to the _Unwind_Word / _Unwind_SWord definitions 2019-02-13 18:27:09 +00:00
vadefs.h
vaesintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
varargs.h
vecintrin.h [SystemZ] Fix wrong codegen caused by typos in vecintrin.h 2018-12-20 13:09:09 +00:00
vpclmulqdqintrin.h [X86] Remove leftover semicolons at end of macros 2018-06-01 09:40:50 +00:00
waitpkgintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
wbnoinvdintrin.h [X86] Move all Intel defined intrinsic includes into immintrin.h 2018-05-23 18:32:58 +00:00
wmmintrin.h [X86] Consistently use double underscore at the beginning of the include guards in our intrinsic headers. 2018-04-24 17:40:47 +00:00
x86intrin.h [X86] Move the include of clzerointrin.h from immintrin.h back to x86intrin.h. 2018-05-23 21:04:26 +00:00
xmmintrin.h [X86] Use __m128_u for _mm_loadu_ps after r353555 2019-02-12 21:04:21 +00:00
xopintrin.h [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
xsavecintrin.h [X86] Fix some inconsistent formatting in the first line of our intrinsics headers. 2018-05-04 21:45:25 +00:00
xsaveintrin.h [X86] Only define _XCR_XFEATURE_ENABLED_MASK in xsaveintrin.h when _MSC_VER is defined. Remove from intrin.h. 2019-01-18 17:51:51 +00:00
xsaveoptintrin.h [X86] Remove 'return' from a bunch of intrinsics that return void and use a builtin that returns void. 2018-05-30 17:23:45 +00:00
xsavesintrin.h [X86] Fix some inconsistent formatting in the first line of our intrinsics headers. 2018-05-04 21:45:25 +00:00
xtestintrin.h [X86] Fix some inconsistent formatting in the first line of our intrinsics headers. 2018-05-04 21:45:25 +00:00