Commit Graph

1140 Commits

Author SHA1 Message Date
Bradley Smith dd4c4d4e50 [ARM] Add Clang targeting for ARMv8-M Baseline/Mainline
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 13:52:22 +00:00
John McCall a29b4d2ff1 Semantic analysis for the swiftcall calling convention.
I've tried to keep the infrastructure behind parameter ABI
treatments fairly general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 06:39:32 +00:00
Tom Stellard d4ef24ffe8 AMDGPU: Add missing Volcanic Islands targets
Reviewers: arsenm

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 15:08:56 +00:00
Craig Topper b19fae99c1 [X86] Disabling avx512f should also disable avx512vbmi and avx512ifma. Enabling avx512vbmi or avx512ifma should enable avx512f. Add command line switches and header defines for avx512ifma and avx512vbmi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 06:51:38 +00:00
Craig Topper 41d40eca2d [X86] Enabling xsave should not enable AVX. I seem to have done this, but I don't know why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 06:51:34 +00:00
Matt Arsenault 7c9aafc612 AMDGPU: Fix broken/confusing predefined macro
amdgcn should not be defining __R600__

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 09:06:26 +00:00
Matt Arsenault 3edc5c550e AMDGPU: Fix inconsistent register name for flat_scratch
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 09:06:22 +00:00
Saleem Abdulrasool de5983bfd6 Basic: fix __USER_LABEL_PREFIX__ on Cygwin
Adjust the user label prefix for cygwin x86_64.

Resolves PR26744.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 16:34:01 +00:00
Elena Demikhovsky 4ac9f2c9a4 Added SKL and CNL processors and features to Clang
Differential Revision: http://reviews.llvm.org/D16756



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 07:41:23 +00:00
JF Bastien b4663aa977 ARM: fix VFP asm constraints
Summary:
Rich Felker was sad that clang used 'w' and 'P' for VFP constraints when GCC documents them as 't' and 'w':
  https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

This was added way back in 2008:
  http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20080421/005393.html

Subscribers: aemerson, rengolin, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 06:54:45 +00:00
Krzysztof Parzyszek 8148f06ebc [Hexagon] Specify vector alignment in DataLayout string
The DataLayout can calculate alignment of vectors based on the alignment
of the element type and the number of elements. In fact, it is the product
of these two values. The problem is that for vectors of N x i1, this will
return the alignment of N bytes, since the alignment of i1 is 8 bits. The
vector types of vNi1 should be aligned to N bits instead. Provide explicit
alignment for HVX vectors to avoid such complications.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 14:48:34 +00:00
Chad Rosier d0f4542438 [Driver] Add support for Qualcomm's Kryo CPU.
http://reviews.llvm.org/D17124

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 18:09:31 +00:00
Oliver Stannard aba1af8a47 [ARM] Add command-line options for ARMv8.2-A
This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the
triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a).

The FP16 extension can be enabled with the "+fp16" suffix to the -march
or -mcpu option. This is consistent with the AArch64 option, rather than
the usual ARM option of -mfpu. We have agreed with the team which will
be upstreaming this to GCC that we want to use this new option format
for new architecture extensions for both ARM and AArch64.

Most of the work for this was done by the TargetParser patch in llvm.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260533 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 16:05:52 +00:00
Andrey Turetskiy 222af3db18 Reapply the patch of r260376.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 12:56:10 +00:00
Andrey Turetskiy 8284fd6aca [X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.
This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 11:58:46 +00:00
Ulrich Weigand 0a2b326966 [SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros
Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ.

This fixes a miscompile of GCC C++11 standard library headers
due to use of those macros in an ABI-changing manner.

See e.g. /usr/include/c++/4.8.5/ext/concurrence.h:

  // Compile time constant that indicates prefered locking policy in
  // the current configuration.
  static const _Lock_policy __default_lock_policy =
#ifdef __GTHREADS
#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
     && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
  _S_atomic;
#else
  _S_mutex;
#endif
#else
  _S_single;
#endif

A different choice of __default_lock_policy causes different
sizes of several of the C++11 data structures, which are then
incompatible when inlined in clang-compiled code with what the
(GCC-compiled) external library expects.

This in turn leads to various crashes when using std::thread
in code compiled with clang, as see e.g. via the ThreadPool
unit tests.  See PR 26473 for an example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 21:34:28 +00:00
Sunil Srivastava 4cff2fd9cc Do not honor explicit alignment attribute on fields for PS4.
This change reverts r257462 for PS4 triple.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 20:50:02 +00:00
Andrey Bokhanko 67e7611e1a [x86] Correct setting of WIntType for MCU target
Differential Revision: http://reviews.llvm.org/D16626


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 11:54:45 +00:00
Saleem Abdulrasool cd4d0d0255 Basic: mark TLS as supported on Windows on ARM
LLVM can now lower TLS access as per the MS ABI on ARM.  This enables the
generation of TLS access for Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 05:05:23 +00:00
Marina Yatsina ea88b232d6 -inline-asm][X86] Add ability to use AVX512 in MS inline asm
Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 11:32:08 +00:00
Reid Kleckner ba0b391504 Fix attribute((mode([word|unwind_word]))) for x32
Patch by H.J. Lu

```
typedef unsigned int gcc_word __attribute__((mode(word)));
```
and

```
typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word)));
```
define the largest unsigned integer types which can be stored in a
general purpose register, which may not be the pointer type.  For x32,
they aren't pointer nor unsigned long.  We should

1. Make getUnwindWordWidth and getRegisterWidth virtual,
2. Override them for x32, similar to hasInt128Type.
3. Use getRegisterWidth for __attribute__((mode(word)));

This fixes PR 24706.

Reviewers: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 18:58:24 +00:00
Tim Northover d011f8c7ef ARMv7k: select ABI based on v7k Arch rather than watchos OS.
Various bits we'd like to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 19:32:40 +00:00
James Y Knight 9030f4d6bd Revert "Change of UserLabelPrefix default value from "_" to """
This reverts commit r258504.

This commit breaks (at least) sparc-rtems -- the OS (RTEMS) used to
override UserLabelPrefix to "", despite the arch (SPARC) having set it
to "_". Now, the OS doesn't override anymore, but the arch sets it to
"_", resulting in the wrong value. I expect this probably breaks other
OSes that overrode to "" before, as well. (Clearly we have some missing
test cases, here...)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:04:51 +00:00
Andrey Bokhanko c39cc52103 Change of UserLabelPrefix default value from "_" to ""
Differential Revision: http://reviews.llvm.org/D16295


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 15:24:34 +00:00
Andrey Bokhanko abc1b34740 Correct setting of UserLabelPrefix for MCU target.
Differential Revision: http://reviews.llvm.org/D16138


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 10:59:36 +00:00
Tim Northover 894c8cb4e7 ARM: allow __thread on OS versions that have the required runtime support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07 09:04:46 +00:00
Dan Gohman a9b56346a9 [WebAssembly] Add -m:e to the target triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07 03:20:15 +00:00
MinSeong Kim 9c86c955ba [AArch64] Teaches clang about Samsung Exynos-M1
Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 12:53:24 +00:00
Asaf Badouh d9c8a628c1 [X86][PKU] add clang intrinsic for {RD|WR}PKRU
Differential Revision: http://reviews.llvm.org/D15837

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 14:14:07 +00:00
Benjamin Kramer 9f3e8630d7 Replace llvm::utostr calls in Twine context with Twines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 10:07:37 +00:00
Daniel Sanders 28840c7e97 [mips] Add _GCC_HAVE_SYNC_COMPARE_AND_SWAP macros.
This fixes the 'pure virtual function called' failure with ThreadPool in a
clang-built clang. This fixes the llvm-mips-linux builder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 12:59:30 +00:00
NAKAMURA Takumi 77484273fe [Cygwin] Enable TLS as emutls.
It resolves clang selfhosting with std::once() for Cygwin.

FIXME: It may be EmulatedTLS-generic also for X86-Android.
FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256134 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-21 02:37:23 +00:00
Krzysztof Parzyszek ee5cbc2897 [Hexagon] Update default paths and arguments
- Removed support for hexagonv3 and earlier.
- Added handling of hexagonv55 and hexagonv60.
- Added handling of target features (hvx, hvx-double).
- Updated paths to reflect current directory layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255502 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 15:03:57 +00:00
Dan Gohman 3ebc2ad19f [WebAssembly] Remove an obsolete TODO comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254817 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 01:36:31 +00:00
Christof Douma 08458da4c9 Teaches clang about Cortex-A35.
Adds support for the new Cortex-A35 ARMv8-A core.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254505 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 12:03:42 +00:00
Alexandros Lamprineas 3b1c04bd7b ARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Add/Subtract.

The following instructions are added to AArch32 instruction set:

- VQRDMLAH: Vector Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- VQRDMLSH: Vector Saturating Rounding Doubling Multiply Subtract
            Returning High Half

The following instructions are added to AArch64 instruction set:

- SQRDMLAH: Signed Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- SQRDMLSH: Signed Saturating Rounding Doubling Multiply Subtract
            Returning High Half

This patch adds intrinsic and ACLE macro support for these instructions,
as well as corresponding tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 10:43:59 +00:00
Alexey Bataev 1b0e2ec43d [X86] Support for C calling convention only for MCU target.
For MCU only C calling convention is allowed, all other calling conventions are not supported.
Differential Revision: http://reviews.llvm.org/D14864


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254063 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-25 09:24:26 +00:00
Tom Stellard 6306f491e5 AMDGPU: Add support for 's' and 'v' asm constraints
Summary: 's' is used to specify sgprs and 'v' is used to specify vgprs.

Reviewers: arsenm, echristo

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-19 22:11:58 +00:00
Akira Hatanaka 66bf0e5936 Produce a better diagnostic for global register variables.
Currently, when there is a global register variable in a program that
is bound to an invalid register, clang/llvm prints an error message that
is not very user-friendly.

This commit improves the diagnostic and moves the check that used to be
in the backend to Sema. In addition, it makes changes to error out if
the size of the register doesn't match the declared variable size.

e.g., volatile register int B asm ("rbp");

rdar://problem/23084219

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 00:15:28 +00:00
Bradley Smith 09adec2e3c [ARM] Pass in the architecture to TargetParser to cope with API change
The TargetParser API to get the default FPU and default extensions has
changed so that it can fall back to the architecture in case of a
generic CPU.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 11:16:36 +00:00
Artyom Skrobov d0e78a2e90 Cull non-standard variants of ARM architectures (NFC)
Summary: Clang-side update, corresponding to D14577

Reviewers: rengolin

Subscribers: aemerson, cfe-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 15:52:02 +00:00
Aaron Ballman f3268761aa Silencing a -Wreturn-type warning for control reaching the end of a non-void function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11 13:42:02 +00:00
Dan Gohman 1ae6ec4574 [WebAssembly] Change long double to be quadruple-precision floating point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 21:01:46 +00:00
Joerg Sonnenberger b45677e208 Add the variant of __sparc_v9__ with five underscores, not just four.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 19:28:17 +00:00
Joerg Sonnenberger 6116fc0887 Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8
is not defined for 32bit mode, but __sparcv9 is. Pass down the correct
-target-cpu flags to the backend, so that instruction restrictions are
applied correctly. Pass down the correct -A flag when not using IAS.
The latter is limited to NetBSD targets in this commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252545 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 23:39:45 +00:00
Andrey Bokhanko 7805dc89fa [x86] Additional small fix for MCU psABI support
This patch fixes one more thing in MCU psABI support: LongDoubleWidth should be set to 64.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 12:43:09 +00:00
Andrey Bokhanko d7177d2007 [x86] Front-end part of MCU psABI support
This patch implements two things in front-end for MCU psABI support:

1) "long double type is the same as double."
2) "New predefined C/C++ pre-processor symbols: iamcu and iamcu__.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 09:54:17 +00:00
Tim Northover ca157bedab ARMv7k: implement ABI changes for watchOS from standard iOS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251710 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:45 +00:00
Tim Northover 9605ec4bd7 Watch and TV OS: wire up basic ABI choices
This sets the mostly expected Darwin default ABI options for these two
platforms. Active changes from these defaults for watchOS are in a later patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:36 +00:00
Tim Northover 74a7cafa2f Preprocessor: define correct tvOS and watchOS version macros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:30 +00:00