summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/xopintrin.h
Commit message (Collapse)AuthorAgeFilesLines
* Move the builtin headers to use the new license file header.Chandler Carruth2019-04-081-17/+3
| | | | | | | | | | | | | | | | | | Summary: These all had somewhat custom file headers with different text from the ones I searched for previously, and so I missed them. Thanks to Hal and Kristina and others who prompted me to fix this, and sorry it took so long. Reviewers: hfinkel Subscribers: mcrosier, javed.absar, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60406 llvm-svn: 357941
* [Builtins][Attributes][X86] Tag all X86 builtins with their required vector ↵Craig Topper2018-07-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | width. Add a min_vector_width function attribute and tag all x86 instrinsics with it This is part of an ongoing attempt at making 512 bit vectors illegal in the X86 backend type legalizer due to CPU frequency penalties associated with wide vectors on Skylake Server CPUs. We want the loop vectorizer to be able to emit IR containing wide vectors as intermediate operations in vectorized code and allow these wide vectors to be legalized to 256 bits by the X86 backend even though we are targetting a CPU that supports 512 bit vectors. This is similar to what happens with an AVX2 CPU, the vectorizer can emit wide vectors and the backend will split them. We want this splitting behavior, but still be able to use new Skylake instructions that work on 256-bit vectors and support things like masking and gather/scatter. Of course if the user uses explicit vector code in their source code we need to not split those operations. Especially if they have used any of the 512-bit vector intrinsics from immintrin.h. And we need to make it so that merely using the intrinsics produces the expected code in order to be backwards compatible. To support this goal, this patch adds a new IR function attribute "min-legal-vector-width" that can indicate the need for a minimum vector width to be legal in the backend. We need to ensure this attribute is set to the largest vector width needed by any intrinsics from immintrin.h that the function uses. The inliner will be reponsible for merging this attribute when a function is inlined. We may also need a way to limit inlining in the future as well, but we can discuss that in the future. To make things more complicated, there are two different ways intrinsics are implemented in immintrin.h. Either as an always_inline function containing calls to builtins(can be target specific or target independent) or vector extension code. Or as a macro wrapper around a taget specific builtin. I believe I've removed all cases where the macro was around a target independent builtin. To support the always_inline function case this patch adds attribute((min_vector_width(128))) that can be used to tag these functions with their vector width. All x86 intrinsic functions that operate on vectors have been tagged with this attribute. To support the macro case, all x86 specific builtins have also been tagged with the vector width that they require. Use of any builtin with this property will implicitly increase the min_vector_width of the function that calls it. I've done this as a new property in the attribute string for the builtin rather than basing it on the type string so that we can opt into it on a per builtin basis and avoid any impact to target independent builtins. There will be future work to support vectors passed as function arguments and supporting inline assembly. And whatever else we can find that isn't covered by this patch. Special thanks to Chandler who suggested this direction and reviewed a preview version of this patch. And thanks to Eric Christopher who has had many conversations with me about this issue. Differential Revision: https://reviews.llvm.org/D48617 llvm-svn: 336583
* [X86] Remove __extension__ from macro intrinsics when its not needed.Craig Topper2018-05-311-32/+32
| | | | | | | | | | I think this is a holdover from when we used to declare variables inside the macros. And then its been copy and pasted forward for years every time a new macro intrinsic gets added. Interestingly this caused some tests for IRGen to be slightly more optimized. We now return a zeroinitializer directly instead of going through a store+load. It also removed a bogus error message on another test. llvm-svn: 333613
* [X86][XOP] Fix type conversion warning in vpcmov generic implementations.Simon Pilgrim2017-02-181-2/+2
| | | | llvm-svn: 295584
* [X86] Replace XOP vpcmov builtins with native vector logical operations.Craig Topper2017-02-181-2/+2
| | | | llvm-svn: 295570
* [X86] Add typecasts to remove most assumptions about what __m128i/__m256i is ↵Craig Topper2016-05-161-2/+2
| | | | | | defined as. Add similar typecasts for the fp types as well. llvm-svn: 269632
* [X86] Remove temporary variables from macros in x86 intrinsic headers. ↵Craig Topper2015-11-101-52/+31
| | | | | | Prevents duplicate names appearing from multiple macro expansions. NFC llvm-svn: 252586
* [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTRMichael Kuperstein2015-06-301-114/+114
| | | | llvm-svn: 241065
* Update the intel intrinsic headers to use the target attribute support.Eric Christopher2015-06-171-7/+1
| | | | | | | | | | | | | | | | | | | This involved removing the conditional inclusion and replacing them with target attributes matching the original conditional inclusion and checks. The testcase update removes the macro checks for each file and replaces them with usage of the __target__ attribute, e.g.: int __attribute__((__target__(("sse3")))) foo(int a) { _mm_mwait(0, 0); return 4; } This usage does require the enclosing function have the requisite __target__ attribute for inlining and code generation - also for any macro intrinsic uses in the enclosing function. There's no change for existing uses of the intrinsic headers. llvm-svn: 239883
* Use a define for per-file function attributes for the Intel intrinsic headers.Eric Christopher2015-06-171-112/+117
| | | | | | | This is a precursor to changing them to use the new target attribute code. llvm-svn: 239882
* xopintrin.h: Add wrappers for all flavors of _mm_com.Benjamin Kramer2013-05-091-0/+393
| | | | | | | GCC defines only the wrappers, MSVC defines both, we define both now too. PR15844. llvm-svn: 181514
* Fix header comment.Benjamin Kramer2013-04-251-2/+2
| | | | llvm-svn: 180268
* Headers/xopintrin.h: Try to fix r158492. Did you mean, mm256?NAKAMURA Takumi2012-06-151-4/+4
| | | | llvm-svn: 158521
* Add XOP frcz instrinsics.Craig Topper2012-06-151-0/+36
| | | | llvm-svn: 158492
* Add XOP permute intrinsics.Craig Topper2012-06-121-0/+28
| | | | llvm-svn: 158351
* Add XOP shift and compare intrinsics.Craig Topper2012-06-111-4/+92
| | | | llvm-svn: 158300
* Add XOP vprot* instruction intrinsicsCraig Topper2012-06-101-0/+40
| | | | llvm-svn: 158292
* More XOP intrinsicsCraig Topper2012-06-101-0/+108
| | | | llvm-svn: 158287
* Begin adding XOP intrinsicsCraig Topper2012-06-101-0/+111
llvm-svn: 158286
OpenPOWER on IntegriCloud