Commit Graph

398 Commits

Author SHA1 Message Date
Richard Smith 8acb4044d8 libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
being included in C++. Don't define alignof or alignas in this case. Note that
the C++11 standard is broken in various ways here (it refers to the contents
of <stdalign.h> in C99, where that header did not exist, and doesn't mention
the alignas macro at all), but we do our best to do what it intended.

llvm-svn: 175708
2013-02-21 02:17:58 +00:00
Daniel Dunbar 230cc79394 [Headers] Use standard builtin defines instead of typeof trickery.
- The trickery can confuse more basic source processors, in particular the
   Unix conformance tool that wants to scan headers.

llvm-svn: 174475
2013-02-06 00:38:13 +00:00
Richard Smith 4dab709484 C11: Provide the missing half of <stdalign.h>
llvm-svn: 173900
2013-01-30 06:33:54 +00:00
Richard Smith 0015f09877 Parsing support for C11's _Noreturn keyword. No semantics yet.
llvm-svn: 172761
2013-01-17 22:16:11 +00:00
David Blaikie 5bb700360c Readd an open paren that was lost while reformatting code.
llvm-svn: 172669
2013-01-16 23:13:42 +00:00
David Blaikie 3302f2bd46 PR14964: intrinsic headers using non-reserved identifiers
Several of the intrinsic headers were using plain non-reserved identifiers.
C++11 17.6.4.3.2 [global.names] p1 reservers names containing a double
begining with an underscore followed by an uppercase letter for any use.

I think I got them all, but open to being corrected. For the most part I
didn't bother updating function-like macro parameter names because I don't
believe they're subject to any such collission - though some function-like
macros already follow this convention (I didn't update them in part because
the churn was more significant as several function-like macros use the double
underscore prefixed version of the same name as a parameter in their
implementation)

llvm-svn: 172666
2013-01-16 23:08:36 +00:00
Benjamin Kramer 696651429d unwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS is specified.
For GCC compatibility.

llvm-svn: 171991
2013-01-09 19:54:57 +00:00
Logan Chien 4d401b47d1 Code cleanup: Remove trailing whitespace in unwind.h.
llvm-svn: 167915
2012-11-14 06:33:58 +00:00
Michael Liao 625a875f05 Add clang support of RTM from TSX
- New options '-mrtm'/'-mno-rtm' are added to enable/disable RTM feature
- Builtin macro '__RTM__' is defined if RTM feature is enabled
- RTM intrinsic header is added and introduces 3 new intrinsics, namely
  '_xbegin', '_xend', and '_xabort'.
- 3 new builtins are added to keep compatible with gcc, namely
  '__builtin_ia32_xbegin', '__builtin_ia32_xend', and '__builtin_ia32_xabort'.
- Test cases for pre-defined macro and new intrinsic codegen are added.

llvm-svn: 167665
2012-11-10 05:17:46 +00:00
Douglas Gregor dc779abb8b Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.

llvm-svn: 167420
2012-11-05 23:30:26 +00:00
Douglas Gregor 10b4f2a20c Fix module map for SSE4a builtins
llvm-svn: 167399
2012-11-05 20:41:30 +00:00
Douglas Gregor 4c69859b56 Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.
While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).

llvm-svn: 167398
2012-11-05 20:11:10 +00:00
Ulrich Weigand 9936f137eb Add "static" to some functions in altivec.c where it was missing.
llvm-svn: 167148
2012-10-31 18:17:07 +00:00
Manman Ren 5750c1c07e 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

llvm-svn: 166743
2012-10-26 00:25:10 +00:00
NAKAMURA Takumi 16ff8fdb57 clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.
llvm-svn: 165688
2012-10-11 01:10:04 +00:00
Manman Ren a45358c284 X86: add F16C support in Clang
Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875

llvm-svn: 165685
2012-10-11 00:59:55 +00:00
Michael Liao 4a7f8c23e0 Add intrinsic of MULX in BMI2 header
llvm-svn: 165325
2012-10-05 18:50:09 +00:00
Logan Chien 774442162d Add struct keyword before _Unwind_Context.
In the C programming language, we have to add the
"struct" keyword.  Otherwise, the compiler will
emit error message.

llvm-svn: 164665
2012-09-26 06:35:17 +00:00
Benjamin Kramer a43b6999ff Add _rdrand{16,32,64}_step intrinsics to immintrin.h
llvm-svn: 160118
2012-07-12 09:33:03 +00:00
Craig Topper 6490bdcf72 Rename tzcnt intrinsics to match gcc.
llvm-svn: 159515
2012-07-02 06:52:51 +00:00
Douglas Gregor 158dec5d20 std::nullptr_t support in MS headers, from João Matos.
llvm-svn: 159448
2012-06-29 18:28:41 +00:00
Manman Ren f865ba0c0e X86: add more GATHER intrinsics in Clang
Support the following intrinsics:
  _mm_i32gather_pd, _mm256_i32gather_pd,
  _mm_i64gather_pd, _mm256_i64gather_pd,
  _mm_i32gather_ps, _mm256_i32gather_ps,
  _mm_i64gather_ps, _mm256_i64gather_ps,
  _mm_i32gather_epi64, _mm256_i32gather_epi64,
  _mm_i64gather_epi64, _mm256_i64gather_epi64,
  _mm_i32gather_epi32, _mm256_i32gather_epi32,
  _mm_i64gather_epi32, _mm256_i64gather_epi32

llvm-svn: 159410
2012-06-29 05:19:13 +00:00
Manman Ren 86c3250b82 X86: add more GATHER intrinsics in Clang
Corrected type for index of _mm256_mask_i32gather_pd
  from 256-bit to 128-bit
Corrected types for src|dst|mask of _mm256_mask_i64gather_ps
  from 256-bit to 128-bit

Support the following intrinsics:
  _mm_mask_i32gather_epi64, _mm256_mask_i32gather_epi64,
  _mm_mask_i64gather_epi64, _mm256_mask_i64gather_epi64,
  _mm_mask_i32gather_epi32, _mm256_mask_i32gather_epi32,
  _mm_mask_i64gather_epi32, _mm256_mask_i64gather_epi32

llvm-svn: 159403
2012-06-29 00:54:35 +00:00
Manman Ren add5e9e289 X86: add GATHER intrinsics (AVX2) in Clang
Support the following intrinsics:
  _mm_mask_i32gather_pd, _mm256_mask_i32gather_pd, _mm_mask_i64gather_pd
  _mm256_mask_i64gather_pd, _mm_mask_i32gather_ps, _mm256_mask_i32gather_ps
  _mm_mask_i64gather_ps, _mm256_mask_i64gather_ps

llvm-svn: 159222
2012-06-26 19:55:09 +00:00
NAKAMURA Takumi f500be025a Headers/xopintrin.h: Try to fix r158492. Did you mean, mm256?
llvm-svn: 158521
2012-06-15 13:37:44 +00:00
Craig Topper 9e28bf9345 Add XOP frcz instrinsics.
llvm-svn: 158492
2012-06-15 06:33:42 +00:00
Craig Topper db0fbf0a50 Add XOP permute intrinsics.
llvm-svn: 158351
2012-06-12 06:03:35 +00:00
Craig Topper ce8dbaadb6 Add XOP shift and compare intrinsics.
llvm-svn: 158300
2012-06-11 07:01:43 +00:00
Craig Topper a3c5fbf54b Add XOP vprot* instruction intrinsics
llvm-svn: 158292
2012-06-10 07:47:32 +00:00
Craig Topper 02b3d81a97 More XOP intrinsics
llvm-svn: 158287
2012-06-10 02:46:15 +00:00
Craig Topper 33b6d5e20b Begin adding XOP intrinsics
llvm-svn: 158286
2012-06-10 00:39:38 +00:00
Craig Topper 2b1eda344a Add fma3 intrinsic header file.
llvm-svn: 157913
2012-06-04 03:42:47 +00:00
Craig Topper 3f122a7636 Add builtin for pclmulqdq instruction.
llvm-svn: 157733
2012-05-31 05:18:48 +00:00
Craig Topper 9fd12db1c0 Update FIXME. ABM is already covered by LZCNT and POPCNT.
llvm-svn: 157676
2012-05-30 04:49:49 +00:00
Benjamin Kramer 1ab16ba501 Install ammintrin.h in the cmake build.
llvm-svn: 157639
2012-05-29 19:36:17 +00:00
Benjamin Kramer ba6e2528fa Add an ammintrin.h header for SSE4a intrinsics.
This is a clean-room implementation based on public documentation and
I tried to validate it as much as possible against gcc.

llvm-svn: 157638
2012-05-29 19:10:17 +00:00
Chandler Carruth 4496c44e5f Remove the 'intrin.h' builtin header file and its tests for now.
After discussion with several people, including Doug Gregor, we've
decided to change our approach here. If you have questions about this
header file, the commit removing it, etc., please reach out to me
off-list.

llvm-svn: 156322
2012-05-07 20:46:58 +00:00
Chad Rosier 87622b8b84 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

llvm-svn: 155924
2012-05-01 18:11:51 +00:00
Nico Weber cb93142e1f Expand #include_next in float.h from mingw to _msc_ver.
A test for this is checking if this compiles:

    #include <float.h>

    inline bool IsFinite(const double& number) {
     return _finite(number) != 0;
    }

That depends however on either mingw or msvc being installed, and
chapuni tells me there might be issues with float.h on mingw, so
no automated test is added.

llvm-svn: 155507
2012-04-24 23:43:40 +00:00
Nico Weber 1d725ecf93 Let NULL and MSVC headers coexist better.
Fixes the two issues mentioned in PR12146.

llvm-svn: 155490
2012-04-24 21:27:01 +00:00
Aaron Ballman 0ae8c946a4 Adding information about what intrinsics still need to be implemented for MSVC compatibility.
llvm-svn: 155441
2012-04-24 12:30:37 +00:00
Chandler Carruth ff90611253 Fix a typo spotted by Matt.
llvm-svn: 155427
2012-04-24 05:59:48 +00:00
Chandler Carruth 3dfb6d84c6 Introduce an initial sketch of a MSVC compatible 'intrin.h' builtin
header, along with a stub test to make sure it compiles in the
appropriate modes.

Thanks to Aaron Ballman for working with me to figure out the initial
strategy here, and to Nico for reviewing and pestering me to actually
commit it.

llvm-svn: 155425
2012-04-24 05:23:54 +00:00
Craig Topper 26e74e50b6 Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortunately, these instructions have behavior that can't be modeled with shuffle vector.
llvm-svn: 154906
2012-04-17 05:16:56 +00:00
Craig Topper 8e57855ea0 Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code.
llvm-svn: 154777
2012-04-15 22:18:10 +00:00
Chad Rosier 2c5154224b Fix the signatures for the _mm256_storeu2_* intrinsics.
PR12532

llvm-svn: 154591
2012-04-12 16:29:08 +00:00
Craig Topper 74c17c65e4 Correctly check argument types for some vector macros in smmintrin.h. Put parentheses around uses of vector macro arguments.
llvm-svn: 153732
2012-03-30 07:01:17 +00:00
Craig Topper 97f042f2d6 Add _mm_minpos_epu16 to smmintrin.h. Fixes PR12399.
llvm-svn: 153726
2012-03-30 05:41:28 +00:00
Craig Topper 678a53c350 Fix shuffle vector calculation for mm_permute_ps. Fixes PR 12401.
llvm-svn: 153724
2012-03-30 05:09:18 +00:00
Rafael Espindola c31d004ece unwind.h fix for -fvisibility=hidden users. This fixes firefox build in a system
with libunwind installed.
Patch by Jeffrey Yasskin!

llvm-svn: 153633
2012-03-29 03:37:17 +00:00