Commit Graph

270 Commits

Author SHA1 Message Date
Nick Lewycky c3218637bd Fix typo.
llvm-svn: 135473
2011-07-19 08:48:08 +00:00
Alexis Hunt 8cb46bb51c Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN and
WCHAR_MAX in limits.h, thus solving the problem where the system header
thinks it knows better.

llvm-svn: 135455
2011-07-19 00:50:57 +00:00
NAKAMURA Takumi a185c78d4d lib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.
By default, mingw does not have _mm_alloc() nor _aligned_malloc().

llvm-svn: 135388
2011-07-18 11:13:50 +00:00
Douglas Gregor c9c40ce861 Teach Clang's <float.h> to also include MinGW's <float.h>, which provides additional system definitions, from Ruben Van Boxem
llvm-svn: 134407
2011-07-05 14:17:04 +00:00
Douglas Gregor 21ad5dfc69 Define va_copy when in C++0x mode; C++0x picked it up from C99.
llvm-svn: 133438
2011-06-20 15:03:22 +00:00
Bill Wendling 03e7e430c3 Add 'may_alias' attribute. Noticed by Eli.
llvm-svn: 131278
2011-05-13 01:24:00 +00:00
Bill Wendling 502931fad9 Represent the unaligned loads natively. These are converted into a call to the
correct unaligned load.

llvm-svn: 131268
2011-05-13 00:11:39 +00:00
Bill Wendling e106c34817 LLVM doesn't always optimize away the four loads from this:
(__m128){ p[0], p[1], p[2], p[3] }

which produces really bad code. This could be done in instcombine, but it's
probably better to do it in the front-end instead.
<rdar://problem/9424836>

llvm-svn: 131237
2011-05-12 19:02:15 +00:00
Eli Friedman 8ba29d8e7f PR9866: Fix the implementation of _mm_loadl_pd and _mm_loadh_pd to not make
bad assumptions about the alignment of the double* argument.

llvm-svn: 131052
2011-05-07 18:59:31 +00:00
Eli Friedman cb59baaa20 PR9849: Fix _mm_setr_pi32 and friends to actually work correctly. They broke with the MMX rewrite a while back.
llvm-svn: 130945
2011-05-05 20:21:54 +00:00
Eli Friedman fe0739dffb Some small improvements to the builtin (-ffreestanding) stdint.h; in
particular, make sure to handle WCHAR_MIN correctly.

llvm-svn: 130618
2011-04-30 19:02:59 +00:00
Chris Lattner f03406f103 don't use compound literals in MM macros, since they will be instantiated
into user code which may warn about them with -pedantic.  Patch by Jonathan Sauer!

llvm-svn: 130149
2011-04-25 20:42:40 +00:00
Eli Friedman 4547752402 PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.
llvm-svn: 129907
2011-04-21 05:45:45 +00:00
Michael J. Spencer 1737c9e0b5 Add mm3dnow.h.
llvm-svn: 129572
2011-04-15 15:11:21 +00:00
Chris Lattner 57540c5be0 fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Bill Wendling 2c1c33552d Remove comment that snuck in there.
llvm-svn: 129434
2011-04-13 10:05:14 +00:00
Bill Wendling b9c9e34cb3 Just use a native "load" instead of translating the builtin later. Clang can
take it!

I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned
load...I'll have to look into it further.

llvm-svn: 129427
2011-04-13 05:58:17 +00:00
John McCall 91a528841b Implement the AVX cmp builtins as macros instead of static inlines.
Patch by Syoyo Fujita!  Reviewed by Chris Lattner!  Checked in by me!

llvm-svn: 128984
2011-04-06 03:37:51 +00:00
Ted Kremenek f49e1dd86d Add '#ifndef _PTRDIFF_T' guard around definition of ptrdiff_t. Fixes <rdar://problem/9210154>.
llvm-svn: 128578
2011-03-30 21:43:52 +00:00
NAKAMURA Takumi 1a780ee8a9 lib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as macro by <malloc.h>.
llvm-svn: 127654
2011-03-15 02:32:43 +00:00
Oscar Fuentes 6401523405 CMake: updated list of installable header files. PR9321.
llvm-svn: 126572
2011-02-27 13:33:31 +00:00
Oscar Fuentes 15fe190027 Put targets on folders, if the IDE supports the feature.
Requires CMake 2.8.3 or newer.

llvm-svn: 126094
2011-02-20 22:06:44 +00:00
Oscar Fuentes 6f72540e46 New function for tablegenning: clang_tablegen.
llvm-svn: 126093
2011-02-20 22:06:32 +00:00
Anton Yartsev b9734cd4eb Optimized IR for vec_splat
llvm-svn: 120610
2010-12-01 21:59:31 +00:00
Chandler Carruth 45c2fb1e69 Undo part of my previous commit to mm_malloc.h, going back to the use of
stdlib.h. There were numerous problems with forward declaring 'malloc' and
'free', but the most important is that these are reserved by POSIX and may be
implemented via a function-like macro.

As suggested by Dale Johannesen, I'm instead guarding the only include of this
in our builtin headers with __STDC_HOSTED__, and I've removed the include of
the header from the test suite. I'll discuss with folks whether we want to have
a hosted section of the test suite or not, and add it (and perhaps other tests)
back there if that's the direction.

llvm-svn: 119958
2010-11-22 08:06:31 +00:00
Anton Yartsev f2a1345a34 turned pointers into pointers to const in function parameters in all functions/builtins accepting pointers to a const-qualified type according to PIM and "Language Extensions for CBEA"
llvm-svn: 119376
2010-11-16 20:09:36 +00:00
Chandler Carruth 5eef9ba483 Futher reduce the includes of our builtin headers, and teach limits.h to avoid
include_next when not hosted or unavailable. This follows the pattern in
stdint.h and allows these headers to work even in a freestanding configuration
without a standard library.

llvm-svn: 119343
2010-11-16 10:07:43 +00:00
Douglas Gregor c4a821860c Fix CMake installation of arm_neon.h
llvm-svn: 116835
2010-10-19 18:06:10 +00:00
NAKAMURA Takumi a8792e514a lib/Headers/stddef.h: wint_t should be defined whenever <stddef.h> is included with __need_wint_t.
llvm-svn: 116794
2010-10-19 03:42:41 +00:00
Eric Christopher 8a8673ea39 From scratch rewrite of mm_malloc.h.
Patch by Matthew Beaumont-Gay!

llvm-svn: 116771
2010-10-18 23:38:51 +00:00
Anton Yartsev 73d4023114 support for AltiVec extensions from the Cell architecture
llvm-svn: 116478
2010-10-14 14:37:46 +00:00
Douglas Gregor bd82998e35 Eliminate CIndexer::getClangPath(), since libclang no longer depends
on the presence of a 'clang' executable. Simplify
CIndexer::getClangResourcesPath() a bit.

Patch up the CMake makefiles to install headers into two locations in
the build tree, for those silly cases where 'clang' will end up
looking into the wrong build directory for headers.

llvm-svn: 116260
2010-10-11 23:17:59 +00:00
Chris Lattner 07704f1d7e the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

llvm-svn: 115423
2010-10-02 21:32:59 +00:00
Chris Lattner 1750cb037d __builtin_ia32_psrldqi128 too
llvm-svn: 115301
2010-10-01 06:58:49 +00:00
Chris Lattner 81f347fe6d the second argument to __builtin_ia32_pslldqi128 must be an immediate,
so it needs to be called from a macro, not a function.  This is a necessary
but insufficient step towards fixing PR8221

llvm-svn: 115299
2010-10-01 06:52:23 +00:00
Dale Johannesen 39d6f4b95c Clang part of MMX rewrite (goes with 115243).
llvm-svn: 115244
2010-09-30 23:57:50 +00:00
Douglas Gregor 1f7d02fb6d Define _Bool, bool, true, and false macros in <stdbool.h> when we're
in a GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>.

llvm-svn: 115028
2010-09-29 04:57:11 +00:00
Bill Wendling 11191f11b8 Accidentally committed some temporary changes on my branch when reverting patches.
llvm-svn: 114936
2010-09-28 01:28:56 +00:00
Bill Wendling 6d8c442e08 Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U    include/clang/Sema/Sema.h
U    include/clang/AST/DeclCXX.h
U    lib/Sema/SemaDeclCXX.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaDecl.cpp
U    lib/Sema/SemaTemplateInstantiate.cpp
U    lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp
U    lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp

llvm-svn: 114933
2010-09-28 01:09:49 +00:00
Anton Yartsev 79d6af3839 formatted everything to fit within 80 columns
llvm-svn: 114249
2010-09-18 00:39:16 +00:00
Chris Lattner ee8df8f167 fix PR7192 by defining wchar_t in a more conventional way. The
type of L"x" can change based on command line arguments.

llvm-svn: 113127
2010-09-05 23:29:49 +00:00
Chris Lattner 212a492063 fix incorrect MM_HINT_ definitions, PR8011
llvm-svn: 112283
2010-08-27 20:10:06 +00:00
Eric Christopher 2a9898f0a2 Move some type defines from smmintrin.h to emmintrin.h to match where
gcc defines them.

llvm-svn: 112146
2010-08-26 02:09:25 +00:00
Nick Lewycky 0b84914da0 Add x86intrin.h which is generic x86 intrinsics for more than just Intel. Thus
far, this just #include's immintrin.h for compatibility.

llvm-svn: 111785
2010-08-22 20:38:05 +00:00
Benjamin Kramer 6f35f3cd80 Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead. This matches GCC's behavior.
llvm-svn: 111692
2010-08-20 23:00:03 +00:00
Benjamin Kramer 65b9f7b255 Add immintrin meta header.
- This is the official way to get AVX intrinsics, we might want to disallow
  direct inclusion of avxintrin.h, just like GCC does.

llvm-svn: 111660
2010-08-20 18:04:07 +00:00
Chris Lattner 1b55b75e24 alphabeticalize
llvm-svn: 111654
2010-08-20 17:24:02 +00:00
Chris Lattner 21a597a31d hopefully unbreak the msvc buildbot.
llvm-svn: 111653
2010-08-20 17:23:33 +00:00
Benjamin Kramer ae8ea1f715 Fix header comments.
llvm-svn: 111645
2010-08-20 16:47:17 +00:00
Chris Lattner 9052c35479 fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC.  GCC is changing this in 
a series of their own PRs (e.g. 41323).

llvm-svn: 111637
2010-08-20 16:08:33 +00:00