Chad Rosier
db163c87f9
[avx] Define the _mm256_loadu2_xxx and _mm256_storeu2_xxx intrinsics.
...
From the Intel Optimization Reference Manual, Section 11.6.2. When data cannot
be aligned or alignment is not known, 16-byte memory accesses may provide better
performance.
rdar://11076953
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 16:40:00 +00:00
Howard Hinnant
d184e53e8a
* tgmath_logb.patch implements the missing logb function (see C99 standard 7.22, paragraph 5). * tgmath_fabs_complex.patch corrects the return types for the complex fabs functions. These must be non-complex float/double/long double (see C99 standard 7.22, paragraph 4 and 7.3.8.1). Patch contributed by Kristof Beyls.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151276 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23 20:22:10 +00:00
Jeffrey Yasskin
f18a87b1ce
Allow linux builds to take advantage of libunwind to get unwind.h if
...
that's installed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 16:20:12 +00:00
Chandler Carruth
345032a721
Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ to
...
match the behavior of GCC. Also add a test for these intrinsics, which
apparently have *zero* tests. =[ Not surprisingly, Clang crashed when
compiling these.
Fix the bug in CodeGen where we failed to bitcast the argument type to
x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the
new 3dnow-builtins.c test.
This is one issue impacting the efforts to get Clang to emulate the
Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made
available there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150948 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 07:35:45 +00:00
Craig Topper
cfa8e6530d
Remove vperm2f* and vperm2i builtins. Same effect can be achieved with builtin_shufflevector.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150064 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 07:33:36 +00:00
Craig Topper
10c57a87d9
Remove vpermilp* builtins. Same effect can be achieved with builtin_shufflevector.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 05:16:54 +00:00
Eli Friedman
88ce85fa4f
Add C11 FLT_TRUE_MIN and friends. <rdar://problem/10812837>.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 01:02:19 +00:00
Nick Lewycky
279114c861
Comment mystery code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149742 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:16:48 +00:00
Nick Lewycky
f42f85ce6c
Make _mm_cmpgt_epi8 immute to -funsigned-char.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149725 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 23:57:48 +00:00
Douglas Gregor
2f04f1843c
Back out my heinous hack that tricked the module generation mechanism
...
into using non-absolute system includes (<foo>)...
... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.
As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149611 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02 18:42:48 +00:00
Douglas Gregor
eb7b9eb18b
Split compiler builtin module into "stdlib" builtins and "intrinsic"
...
builds, and bring mm_alloc.h into the fold. Start playing some tricks
with these builtin modules to mirror the include_next tricks that the
headers already perform.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 21:57:50 +00:00
Douglas Gregor
8f7d64b6d4
Remove tgmath.h from the module map for now, because it currently causes a
...
cyclic module dependency due to its inclusion of math.h and
complex.h. I'll take another shot at it later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149283 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 22:22:39 +00:00
Douglas Gregor
ba0e3189ed
Fix typo spotted by Sebastian. Thanks!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149257 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 18:49:05 +00:00
Craig Topper
f8495d67ca
Cleanup 3dnow builtin handling. Most of them were already handled by LLVM connecting intrinsics and builtins in IntrinsicsX86.td.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149233 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 08:18:19 +00:00
Douglas Gregor
e727d21d3f
Introduce TargetInfo::hasFeature() to query various feature names in
...
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.
Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 06:38:25 +00:00
Douglas Gregor
ebb1004d09
Just disable the compiler-builtins module test on MSVC for now
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149214 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 23:53:54 +00:00
Douglas Gregor
8101c7f8a9
Teach tgmath.h to only include <complex.h> if it's available.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149213 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 23:40:50 +00:00
Douglas Gregor
e5c9e096a9
Alternate fix to the modules failures that doesn't require us to tweak tgmath.h
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149210 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 22:47:19 +00:00
Douglas Gregor
5ad2649083
If there's no math.h, then tgmath.h should just be empty
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149209 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 22:35:57 +00:00
Douglas Gregor
3e80d8ac92
Introduce a module map for (some of) the compiler-supplied
...
headers. The remaining headers require more sophisticated
requirements; they'll be handled separately. Part of
<rdar://problem/10710060>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149206 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:52:14 +00:00
Craig Topper
2ee2ac2293
Represent 256-bit unaligned loads natively and remove the builtins. Similar change was made for 128-bit versions a while back.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 04:26:17 +00:00
Douglas Gregor
1ea742bd25
On Darwin, use the system's <unwind.h> whenever it is
...
available. Clang's <unwind.h> isn't ready for prime time. Fixes
<rdar://problem/10733587>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148807 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 15:12:50 +00:00
Bob Wilson
092acb08e0
Fix a typo: _MM_FLUSH_ZERO_OFF has the wrong value. rdar://10716672
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148711 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 18:27:24 +00:00
Evgeniy Stepanov
f5f18bfde0
Extend unwind.h with the ARM unwinder interface.
...
These declarations come from the sample code in the
"Exception Handling ABI for the ARM Architecture" document.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148469 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 11:39:05 +00:00
Joerg Sonnenberger
f84d560fc7
Don't depend on undefined macros being 0, there are options for the
...
preprocessor to warn about it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147466 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 19:22:38 +00:00
NAKAMURA Takumi
5c76db3a4c
clang/lib/Headers/CMakeLists.txt: Unbreak cmake build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 10:38:16 +00:00
Craig Topper
7feb321af4
Add FMA4 intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 09:15:03 +00:00
Craig Topper
f9322a6708
Remove an accidental change from r147370. Would only break if the new fma4 flag was used.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 07:35:49 +00:00
Craig Topper
6a511e1407
Add FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply sse3. Matches gcc behavior.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 07:33:42 +00:00
Richard Smith
0945f20f1c
Unbreak cmake build after r147340.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147355 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 21:42:29 +00:00
Craig Topper
e14e08b255
Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147340 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 16:10:46 +00:00
NAKAMURA Takumi
b5409c5bbf
clang/lib/Headers/CMakeLists.txt: Unbreak cmake build to add bmi2intrin.h since r147275.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 03:20:06 +00:00
Craig Topper
f58f3647b1
Add BMI2 intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147275 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 02:31:10 +00:00
NAKAMURA Takumi
6ab9f02ca0
lib/Headers/CMakeLists.txt: Fix cmake build since r147263, for two missing headers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 12:47:46 +00:00
Craig Topper
0b269c1f36
Add the rest of the BMI intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 07:27:12 +00:00
Craig Topper
5c75208a5b
Add intrinsics for lzcnt and tzcnt instructions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 06:25:37 +00:00
Craig Topper
31ceea0965
Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 05:06:45 +00:00
Craig Topper
5cbd751a2f
Add last of the AVX2 intrinsics except for gather.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 17:20:15 +00:00
Craig Topper
34a1da4354
Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 07:55:14 +00:00
Craig Topper
ee9b41d154
Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 05:19:29 +00:00
Craig Topper
7f16caa3c0
Intrinsics for AVX2 unpack instructions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:58:43 +00:00
Craig Topper
cbe627b54e
More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:28:57 +00:00
Craig Topper
28a324a30b
Add AVX2 multiply intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 08:31:16 +00:00
Craig Topper
231f793326
Add AVX2 intrinsics for max, min, sign extend, and zero extend.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 09:18:58 +00:00
Craig Topper
4a4f25a5a8
Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:35:05 +00:00
Craig Topper
318e460ada
Add AVX2 horizontal add/sub intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:17:40 +00:00
Craig Topper
4c07c5dfeb
Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 09:55:26 +00:00
Craig Topper
735ceaa4cc
Add AVX2 intrinsics for and, andn, or, and xor.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 09:03:48 +00:00
Craig Topper
9c2ffd803a
More AVX2 intrinsic support including saturating add/sub and palignr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146857 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 07:03:25 +00:00
Craig Topper
925be547b1
Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146855 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 05:04:33 +00:00