Commit Graph

25 Commits

Author SHA1 Message Date
Craig Topper eceb4b4fd7 [X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembly to implement _mm_pause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11 08:13:33 +00:00
Craig Topper 271fd30fa4 [X86] Use __builtin_ia32_paddq and __builtin_ia32_psubq to implement a couple intrinsics that were supposed to operate on MMX registers. Otherwise we end up operating on GPRs. Throw in a test for _mm_mul_su32 while I was there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11 08:00:41 +00:00
Simon Pilgrim cc0e5a2f90 [X86][SSSE3] Added SSSE3 IR + assembly codegen builtin tests
Transferred SSSE3 instructions from sse-builtins.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-06 17:06:22 +00:00
Simon Pilgrim 5488a47f84 [X86]][SSE3] Added SSE41 IR + assembly codegen builtin tests
Transferred SSE41 instructions from sse-builtins.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246947 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-06 16:38:17 +00:00
Simon Pilgrim 85a91ffe20 [X86][SSE] Add _mm_undefined_* intrinsics
Added missing SSE/AVX 'undefined' intrinsics (PR24040):

_mm_undefined_pd, _mm_undefined_ps + _mm_undefined_si128
_mm256_undefined_pd, _mm256_undefined_ps + _mm256_undefined_si256
_mm512_undefined, _mm512_undefined_ps, _mm512_undefined_pd + _mm512_undefined_epi32

Added builtin intrinsicss:

__builtin_ia32_undef128, __builtin_ia32_undef256 + __builtin_ia32_undef512

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246083 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26 21:17:12 +00:00
Simon Pilgrim 5a337c6497 Added missing tests for SSE41 pmovsx/pmovzx extension intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245815 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 16:19:38 +00:00
David Blaikie 1d7abba8db Update Clang tests to handle explicitly typed load changes in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 21:19:58 +00:00
Manuel Klimek b385cf06e6 Make tests independent of llvm variable naming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 09:49:31 +00:00
Craig Topper 10f4cefaf8 [X86] Convert palignr builtin handling to use shuffle form of right shift instead of intrinsics. This should allow the instrinsics to removed from the backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 07:18:01 +00:00
Craig Topper e00a185b23 [X86] Merge the 2 separate builtin handlers for PALIGNR into a single one that handles both.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 06:37:58 +00:00
Craig Topper f8bd6d3988 [X86] Fix test cases that I foolishly copied and modified from another file that had optimizations on. This caused the check patterns to not quite match.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229073 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 06:27:39 +00:00
Craig Topper 5ed011edbd [X86] Add _mm_bslli_si128 and _mm_bsrli_si128 as aliases of _mm_slli_si128 and _mm_srli_si128. This matches Intel documentation and gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229066 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 06:04:45 +00:00
Craig Topper c453d7f648 [x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic files.
This still lower to the same intrinsics as before.

This is preparation for bounds checking the immediate on the avx version of the builtin so we don't pass illegal immediates into the backend. Since SSE uses a smaller size immediate its not possible to bounds check when using a shared builtin. Rather than creating a clang specific builtin for the different immediate, I decided (after consulting with Chandler) that it was better to match gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224879 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-27 06:59:57 +00:00
Evgeniy Stepanov 690ad3120a Fix line numbers for code inlined from __nodebug__ functions.
Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210459 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 09:09:19 +00:00
Filipe Cabecinhas c0680e2b0b Patched clang to emit x86 blends as shufflevectors.
Summary:
Most of the clang header patch by Simon Pilgrim @ SCEE.
Also fixed (or added) clang tests for these intrinsics.

LLVM tests to make sure we get the blend instruction out of these
shufflevectors are at http://reviews.llvm.org/D3600

Reviewers: eli.friedman, craig.topper, rafael

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208664 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-13 02:37:02 +00:00
Manman Ren 8484375b0f Intrinsics: fix extract & insert when index is out of bound.
Now, all extract & insert intrinsics should have the correct and operation
to ignore higher bits.

rdar://15250497


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 20:33:14 +00:00
Manman Ren bb6144beed _mm_extract_epi16: use "& 7" when index is out of bound.
This is in line with implementation of _mm_extract_pi16.
rdar://15250497


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-22 19:24:42 +00:00
Eli Friedman 440a5f4913 Add _mm_stream_si64 intrinsic.
While I'm here, also fix the alignment computation for the whole family of
intrinsics.

PR17298.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191243 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 23:38:39 +00:00
Stephen Lin 93ab6bf534 CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 06:47:53 +00:00
Manman Ren f0e97dba82 X86 SSE Intrinsics: update header for sqrt_ss, rsqrt_ss and rcp_ss.
There intrinsics pass through the upper FP values from the input.
rdar://12558838


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 00:25:10 +00:00
Chad Rosier c5713cfd87 Get rid of storelv4si builtin as it can be expressed directly. This is general
goodness because it provides opportunites to cleanup things.  For example,

uint64_t t1(__m128i vA)
{
  uint64_t Alo;
  _mm_storel_epi64((__m128i*)&Alo, vA);
  return Alo;
}

was generating 

	movq	%xmm0, -8(%rbp)
	movq	-8(%rbp), %rax

and now generates

	movd	%xmm0, %rax

rdar://11282581

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 18:11:51 +00:00
Craig Topper 5aeaca3fa7 Correctly check argument types for some vector macros in smmintrin.h. Put parentheses around uses of vector macro arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153732 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 07:01:17 +00:00
Craig Topper 5228982f07 Add _mm_minpos_epu16 to smmintrin.h. Fixes PR12399.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153726 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 05:41:28 +00:00
NAKAMURA Takumi b5f8f07c68 test/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.
Without -ffreestanding, clang tries to seek /usr/include/stdlib.h in host filesystem, even on Windows hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 03:55:36 +00:00
Eli Friedman 7c06f6b319 Tweak *mmintrin.h so that they don't make any bad assumptions about alignment (which probably has little effect in practice, but better to get it right). Make the load in _mm_loadh_pi and _mm_loadl_pi a single LLVM IR instruction to make optimizing easier for CodeGen.
rdar://10054986



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139874 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 23:15:27 +00:00