Граф коммитов

250 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 82bab0dda6 Place the definition of 'va_list' within a preprocessor guard. This matches the behavior of GCC, and avoids potential conflicts with system headers (e.g., stdio.h). Fixes <rdar://problem/7727145>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:13:05 +00:00
Eric Christopher 3afda6037d Add sse4.1 packed min and max intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:00:42 +00:00
Eric Christopher 0356848744 Add load hint instruction intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 06:29:09 +00:00
Eric Christopher c82ac95dbd Add in support for dword multiply and fp dot product intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 06:17:19 +00:00
Eric Christopher 9ce2116005 Fix _MM_FROUND_NEARBYINT and move rounding intrinsics to macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 10:31:44 +00:00
Eric Christopher b71f956471 First start on smmintrin.h, rounding and blending.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 02:56:19 +00:00
Chris Lattner ef5ebf60c8 add two aliases for SSE functions we already have, fixing PR6316.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 18:21:25 +00:00
Chris Lattner 21b91a35fb fix PR6187: various load functions in xmmintrin.h were missing 'const'.
emmintrin looks ok.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 20:14:14 +00:00
Chris Lattner 9afb227116 fix a bug in the _MM_TRANSPOSE4_PS definition, patch by Brian Sumner from
PR6138


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94669 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 07:54:50 +00:00
Chris Lattner 2c48345cf9 _mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
but this one is wrong.  Thanks to Tanya for noticing this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:36:41 +00:00
Nate Begeman c3420ffb28 Revert mmx palignr to use an intrinsic, since mmx shuffle patterns are missing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 05:15:02 +00:00
Nate Begeman ce5818a19a Support x86's PALIGNR instruction without the use of a palignr intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 04:57:03 +00:00
Chris Lattner f2c8e7dee9 minimal fix for PR5743
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:38:15 +00:00
Douglas Gregor a22848f4d9 Pick up MB_LEN_MAX as defined by the system <limits.h>, when it's provided there
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90879 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 21:35:00 +00:00
Ken Dyck fc07d91c89 Define SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 15:47:12 +00:00
Ken Dyck fdb4324286 Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
UINT<n>_C(v) macros. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 16:49:10 +00:00
Ken Dyck a2e92846f1 Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
and UINT<n>_MAX defintions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 16:44:38 +00:00
Ken Dyck aface1b7e0 Avoid unwanted macro expansion in macros that paste together int<n>_t and
uint<n>_t definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 16:37:35 +00:00
Ken Dyck c2bae59b00 Define WCHAR_MIN and WCHAR_MAX in terms of __WCHAR_WIDTH__ for consistency with
other limit macros.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 15:53:08 +00:00
Ken Dyck bfec4b0274 Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
widths. This corrects the values of these definitions for MSP430 and PIC16.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 14:35:19 +00:00
Ken Dyck 4b7d945699 Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
arbitrary widths.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 14:03:24 +00:00
Ken Dyck 8a3e9d9c00 Construct the macro body of PTRDIFF_MAX and PTRDIFF_MIN from __PTRDIFF_WIDTH__.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 12:33:01 +00:00
Ken Dyck c3ca6ef0e0 Construct INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX from the exact-width limit
macros corresponding to __INTPTR_WIDTH__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:36:29 +00:00
Ken Dyck 08321b445a Define intptr_t and uintptr_t in terms of their equivalent exact-width types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:24:13 +00:00
Ken Dyck 832b710f59 Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-width
INTn_C and UINTn_C macros.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 19:42:57 +00:00
Ken Dyck db57ce5771 Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros for
their corresponding exact-width type. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 19:22:15 +00:00
Ken Dyck 36fac077b4 Define intmax_t and uintmax_t as the [u]intN_t type corresponding to
__INTMAX_WIDTH__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 18:57:04 +00:00
Ken Dyck b088756289 Replace (-INT8_C(128)), which uses an illegally out-of-range argument for
INT8_C, with (-INT8_C(127)-1) in the definition of INT8_MIN. Apply similar
changes to the definitions of INT16_MIN and INT24_MIN.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 18:29:12 +00:00
Ken Dyck 81638410cf Use the INTn_C integer constant macros to generate limit constants with correct
suffixes. This corrects the suffixes for the limit constants of the 32-bit
types on MSP430 and PIC16, and the 64-bit types on PPC64, SystemZ, X86_64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 16:26:27 +00:00
Ken Dyck 6ab25f482c Remove unnecessary parens around the bodies of integer constant macros. C99
requires that their arguments be decimal, hex, octal constants---no signs
allowed---making the parens unnecessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 13:54:02 +00:00
Ken Dyck eef22efce8 Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 16:36:33 +00:00
Chris Lattner dcdd2a064a Generalize stdint.h for non-8-bit-multiple types, patch by
Ken Dyck!

"This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types 
for the exact-width definitions in InitPreprocessor.cpp."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 08:08:27 +00:00
Chris Lattner 06dcf6b092 A simple reordering of the definitions in stdint.h and
introduces no new function changes.   Patch by Ken Dyck!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 23:03:18 +00:00
John Thompson 92bd8c70a6 Added __has_include and __has_include_next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 22:28:12 +00:00
Oscar Fuentes 25950e8c13 CMake: Respect LLVM_LIBDIR_SUFFIX for clang-specific headers under
${libdir}/clang

Patch by Ingmar Vanhassel!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 21:15:21 +00:00
Anders Carlsson 4bf4e3034e Make our char vector types not be explicitly signed to match GCC and to fix compilation with C++ and -fno-lax-vector-conversions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:18:19 +00:00
Anders Carlsson 9436ed50b0 Fix PR4923.
Fix error in _mm_set_pd/_mm_setr_pd and add _mm_set_epi64x/_mm_set1_epi64x. Patch by Laurent Morichetti!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 17:03:55 +00:00
Mike Stump f918b8f934 Collapse more clang version numbers down into fewer places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:26:05 +00:00
Mike Stump 1f2c32e61c Back to 1.1 we go.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 23:04:22 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Douglas Gregor 7f7b74888e CMake: Improve installation of Clang
- Install clang-cc into libexec
  - Install headers into lib/clang/<version>/include
  - Don't install other clang-based tools (clang-wpa, clang-index, etc.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 05:28:29 +00:00
Eli Friedman 3a266f28ff Switch some functions from using x86 builtins to using vector
operations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 17:08:01 +00:00
Douglas Gregor 91a425cfd9 Make sure install Clang headers when building clang-cc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-25 05:07:31 +00:00
Douglas Gregor ebfc180d9b Update Clang to include the InitializeAllTargets and
InitializeAllAsmPrinters LLVM headers. Also includes some minor fixes
for the CMake-based build with Xcode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16 20:13:51 +00:00
Eli Friedman c7d95dcb4e Following gcc, hide the hack to include the SSE2 intrinsics from
xmmintrin.h in an ifdef.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 18:50:02 +00:00
Eli Friedman 8fff25719e Remove a few more vector builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 09:32:56 +00:00
Daniel Dunbar 3eef3e16ff xmmintrin needs to include emmintrin, Darwin system headers seem to depend on it
defining m128[id], at least.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 08:33:23 +00:00
Eli Friedman e0ae8bdadc Now that LLVM CodeGen can handle the generic variations a bit better,
get rid of a few more clang vector builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 07:12:56 +00:00
Douglas Gregor 06026000b1 CMake: Install Clang's headers into the right place in the build tree, for regression testing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 07:09:23 +00:00
Eli Friedman 098136a8cd Replace more calls to builtins with generic code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 08:08:06 +00:00
Eli Friedman 2e8d8da13d Fix obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 07:42:17 +00:00
Eli Friedman 17d2e3a7d1 Fix some casts to work without -flax-vector-conversions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 03:45:06 +00:00
Eli Friedman 80c8004658 Misc fixes to MMX/SSE intrinsics: a few small bug fixes, and getting rid
of calls to builtins for constructs which can be expressed directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 02:13:04 +00:00
Eli Friedman db7351af8e Add aliases for a couple of SSE intrinsics. Patch by Ed Schouten.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-02 05:55:48 +00:00
Anders Carlsson 79dcf5f96a Add 'cmp' SSE builtins and get rid of a bunch of other builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 19:16:46 +00:00
Eli Friedman 6fdca0e1f8 Fix for PR3841: follow gcc's example and fall back to the system
stdint.h unless we are freestanding.

Any suggestions here are welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:00:48 +00:00
Anders Carlsson 2e828f06e5 Fix tyop in SSSE3 header (6808876).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:31:10 +00:00
Chris Lattner ca93195baf glibc plays some weird games with multiple different definitions of
int8_t and games it with strange *_defined macros.  Emulate its weirdness
for better compatibility with linux etc.  Problem pointed out by anders 
johnson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 19:11:11 +00:00
Chris Lattner 7add5470b5 fix misspelt attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 17:55:23 +00:00
Chris Lattner 2ec926cce3 define __va_copy unconditionally, but va_copy only in c99 or non-ansi mode.
Fixes rdar://6759546, some code that actually used __va_copy because they
thought it was "more portable".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 05:12:42 +00:00
Anders Carlsson ae8ecdd6db Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 21:55:22 +00:00
Chris Lattner 2fc47b54ee add support for the LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX limits.h GNU extensions.
rdar://6740292


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 00:44:37 +00:00
Daniel Dunbar cf117d367e Only intptr_t is protected by __intptr_t_defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 03:16:47 +00:00
Chris Lattner ab775f62ea fix inverted conditional, rdar://6633188
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 18:53:33 +00:00
Daniel Dunbar adcf5b389a Put compiler headers in <prefix>/lib/clang/1.0/include (vs
<prefix>/Headers, gross).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 20:52:41 +00:00
Howard Hinnant ccb8f089d7 testing (reverted)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 00:27:58 +00:00
Howard Hinnant 412705b00e testing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 00:25:33 +00:00
Douglas Gregor 0c36c925fc Remove pointless backslash
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:24:55 +00:00
Douglas Gregor c13c0125a0 Add an unavailable __tg_promote function to attract incorrect uses of type-generic macros, rom Howard Hinnant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:23:05 +00:00
Chris Lattner 39aa1ed8f9 initial reimplement tgmath.h, written by Howard Hinnant!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 22:14:32 +00:00
Daniel Dunbar d99e31b6c0 Spell __always_inline__ correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 07:57:58 +00:00
Anders Carlsson 85b2a47ec0 Add SSSE3 header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 03:05:04 +00:00
Chris Lattner 1cd6711ce3 remove dead macros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:42:31 +00:00
Chris Lattner e1ce4a9d83 explicitly cast integers to double. This a) silences any
possible future "data loss" warnings, and b) makes it intensely
obvious to the user what the impl of these functions do in a
ambiguity error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:41:36 +00:00
Chris Lattner 05a6c166e8 asin support. No we don't care about complex int :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:37:35 +00:00
Chris Lattner e5b7d644c2 hand macro expand this to make "candidate" set printing more useful. However,
Now no candidates are printed because the 'notes' are in a system header. :(

#include <tgmath-sofar.h>
 double foo2(short *x) {
  return acos(x);
}

t.c:10:10: error: no matching function for call to '__tg_acos'; candidates are:
  return acos(x);
         ^~~~
1 diagnostic generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:30:54 +00:00
Chris Lattner f265a00d32 add support for integers to tgmath functions. I apparently need to provide
all the integer types other than char/short to avoid overload ambiguities.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:22:33 +00:00
Chris Lattner 5f3d0aef11 start converting over to attr(overloadable). Unfortunately, this
produces really horrible diagnostics when overload ambiguities
happen:

t.c:10:10: error: call to '__tg_acos' is ambiguous; candidates are:
  return acos(x);
         ^~~~
In file included from t.c:1:
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^

A possible fix is to just not use macros for this, which I'll probably go for,
but it would be nice to emit the type at the call, so we know what we asked for!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64720 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 02:14:31 +00:00
Mike Stump e308c413fa Fix 80col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 18:02:21 +00:00
Anders Carlsson a837a07d46 Fix more xmmintrin.h typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 04:01:38 +00:00
Anders Carlsson 13f5f6e479 Fix an error in _mm_loaddup_pd that Eli noticed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 01:06:58 +00:00
Anders Carlsson a2f12ae0e3 Add the nodebug attribute to intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 01:00:11 +00:00
Chris Lattner 40e60c27d0 anders johnson points out that some software depends on the
definition of __intptr_t_defined when stdint.h defines intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 22:43:13 +00:00
Chris Lattner 6ad474f82f Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.

Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.

On linux/32, set intptr_t to int, instead of long.  This fixes PR3563.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 22:28:55 +00:00
Mike Stump dae4413d77 80col.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 14:24:50 +00:00
Mike Stump 3855b9a8f0 Fix limits.h for linux, as glibc does a #include_next unless
_GCC_LIMITS_H_ is defined, when __GNUC__ is defined.

Also, we need to stay away from possible conflicts with header guards.
We should use CLANG_ to prefix all header guards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 23:06:31 +00:00
Anders Carlsson f29b774a75 Add pmmintrin.h header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 06:39:50 +00:00
Anders Carlsson 4cc4427984 Fix some mistakes I made when I tried to decipher the Intel documentation of the MXCSR register
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 06:29:32 +00:00
Anders Carlsson 6c90919188 Fix an #ifndef that should be an #ifdef instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 06:18:19 +00:00
Chris Lattner 6148428024 C++ really shouldn't check these #defines, thanks to Howard
for pointing this out!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:21:31 +00:00
Chris Lattner dfd556ecdc remove two eroneous suffixes, these promote to int. Thanks to Neil
for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 08:49:37 +00:00
Chris Lattner 33cfe69441 add note, weirdness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 07:13:51 +00:00
Chris Lattner 7ed4f39518 fix some missing parens, thanks for Eli's review!
Obviously I make a miserable header developer :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 06:42:04 +00:00
Chris Lattner 34faffac00 fix a typo that Sebastian noticed!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 06:38:41 +00:00
Chris Lattner c865f7ae8b make sure that UINTMAX_MAX has an unsigned type. This assumes that
uintmax_t is unsigned long long, which is not optimal, but is assumed 
elsewhere already.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 06:38:06 +00:00
Chris Lattner f894bd0354 make various MAX/MIN constants be preprocessor constants, not C constants.
Thanks to Eli for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 06:33:44 +00:00
Chris Lattner b1f3fe55d4 start of tgmath, yuck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 00:47:29 +00:00
Chris Lattner 25d69b57cc Apparently it is important to define intptr_t and uintptr_t to
long instead of int.  This is because system heaers like to redefine
typedefs and that is an error if they don't exactly match.  Use long
for intptr_t on all systems where long is the right size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 00:23:17 +00:00
Sebastian Redl 63b4fe6c11 Fix some errors in the new stdint.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 23:57:52 +00:00
Chris Lattner ed27d441eb only define MB_LEN_MAX if the system <limits.h> doesn't.
don't typecast CHAR_MIN to char, this makes it not a PP constant
and gives it the wrong unpromoted type.  Thanks to Sebastian for
pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 23:29:39 +00:00
Chris Lattner 2a67f7bd99 add a stdint.h header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 22:59:47 +00:00
Chris Lattner a9cece68cc correct description
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 18:45:59 +00:00
Chris Lattner c807423936 first hack at limits.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 18:34:27 +00:00
Mike Stump 3733831cde Avoid creating .dir files in the installation area.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 02:53:03 +00:00
Anders Carlsson bbd1fa24fc Fix more bugs I discovered
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 01:49:39 +00:00
Anders Carlsson 62005c16bc Fix some errors I noticed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 21:51:44 +00:00
Anders Carlsson d4a5c9a3f8 Add mm_malloc.h, patch by Sam Weinig.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 23:30:09 +00:00
Anders Carlsson 12868cc25c Add a MS specific intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 04:26:15 +00:00
Anders Carlsson 6b06b7a882 Eli noticed that I had forgotten some #defines. Add them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 22:49:10 +00:00
Anders Carlsson 629c5b4c2d Add float.h header. Eli, please review :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 17:10:18 +00:00
Anders Carlsson 4bcd44d3b3 Fix implementation of _mm_pause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 02:22:10 +00:00
Anders Carlsson 4fd3e63cb0 OK, all tests pass. Let's start using the SSE2 header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:57:11 +00:00
Anders Carlsson 92d66868a1 Fix formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:50:47 +00:00
Anders Carlsson f1bc66008e Add _mm_pause and _MM_SHUFFLE
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:49:43 +00:00
Anders Carlsson 4547075dbb More SSE2 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:45:50 +00:00
Anders Carlsson 0727df0c41 More SSE2 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 23:48:58 +00:00
Anders Carlsson dfb0911b95 Make _mm_add_si64 inlined
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 07:07:08 +00:00
Anders Carlsson 07603aa9e5 Add integer arithmetic intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 02:41:00 +00:00
Anders Carlsson 445afa04f5 Add store/set/load intrisics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 02:11:54 +00:00
Anders Carlsson 37f2f00d71 Start implementing some SSE2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 01:45:22 +00:00
Anders Carlsson 398082e33c Fix test failures noticed by Fariborz.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 17:42:23 +00:00
Anders Carlsson 2a29dcc6c6 Flip the switch and start using the new xmmintrin.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61332 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 07:36:02 +00:00
Anders Carlsson 8e28d24ce3 Comment out _mm_insert_pi16 for now
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61331 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 07:34:23 +00:00
Anders Carlsson a6431dc8d2 Implement the last intrinsics, _mm_insert_pi16 is the last remaining one now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 07:08:03 +00:00
Anders Carlsson b595509bf5 Add macros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 05:42:03 +00:00
Anders Carlsson 50099cbb48 Add misc intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 05:20:34 +00:00
Anders Carlsson c1f9afd5f0 Add control register intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 05:00:07 +00:00
Anders Carlsson 62af71c07e Add integer intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 04:55:36 +00:00
Anders Carlsson dedad4ed67 Add cacheability intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 03:50:21 +00:00
Anders Carlsson 09b9305acf Add store intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61322 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 03:16:40 +00:00
Anders Carlsson a6ba0012fb Add set intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 02:51:35 +00:00
Anders Carlsson 9770086950 Add load intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 02:43:30 +00:00
Anders Carlsson 1b76b80f75 _mm_cvtsi64_ss is 64-bit only, so wrap it in #ifdef __x86_64__
Add composite conversion intrinsics - will implement them shortly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 01:26:50 +00:00
Anders Carlsson 4fcc313c62 Add a couple of conversion intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 00:48:30 +00:00
Anders Carlsson f62c681839 Add comparison intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 00:28:39 +00:00
Anders Carlsson 566d8da282 Check in an in-progress version of xmmintrin.h that I had lying around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 00:01:20 +00:00
Douglas Gregor 28d6cba4c4 Define NULL to __null in C++, so that it's guaranteed to have the same size as a pointer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 17:20:57 +00:00
Anders Carlsson f8e61b371d #define NULL as 0 when compiling as C++. This fixes the carbon.cpp and cocoa.mm test failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 06:53:14 +00:00
Daniel Dunbar 0b4f69f07c Fix mmintrin.h to use proper definition of functions taking no
arguments.
 - More important than it looks, this inhibits trivial inlining
   otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 03:37:55 +00:00
Daniel Dunbar 83e61e566b Mark mmintrin functions static inline, this ensures they don't end up
being emitted unless needed and doesn't inhibit inlining.
  - Can be fixed once we implement C99 inline semantics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 00:06:25 +00:00
Oscar Fuentes d2f4e5ea6e CMake: Builds and installs clang binary and libs (no docs yet). It
must be under the `tools' subdirectory of the LLVM *source* tree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-26 00:56:18 +00:00
Anders Carlsson f5e8ba0c48 Actually use the mmintrin.h header, it's good enough now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 04:49:00 +00:00
Anders Carlsson da298fdf23 Apparently gcc uses pi64 for the shift intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57145 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 02:07:50 +00:00
Anders Carlsson 551b9642b0 Remove copyright notice, we decided not to have them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57118 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 17:21:08 +00:00
Eli Friedman a1d91fe84d Implementation of stdarg.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 10:40:55 +00:00
Eli Friedman eb1df85a34 Protect iso646.h from C++ (although I can't imagine why someone would
need it...).  Patch by Mike Stump.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 03:11:31 +00:00
Eli Friedman 8ba179d4a3 Add a couple more headers. stddef was discussed on cfe-dev, and
consensus was that it was fine; iso646 is trivial.

We actually don't need that many headers overall... on Ubuntu, at least, 
all we need are stdint.h, stdarg.h, limits.h, and float.h to stop 
depending on having gcc's headers around for normal code.

On a side note, the path searching needs some improvement; I had to 
hardcode the path to my header directory into clang.cpp to get the 
driver to use it consistently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 13:34:26 +00:00
Eli Friedman edbd9289b7 Use double-underscores in front of all non-keywords to protect against
#define pollution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:32:22 +00:00
Eli Friedman 1e6d14fdd2 Make header use the new __builtin_shufflevector builtin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:11:29 +00:00
Chris Lattner bda0b626e7 Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00