Commit Graph

629 Commits

Author SHA1 Message Date
Rafael Espindola 5389b84a78 Move -mfpmath handling to -cc1 and implement it for x86.
The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 21:59:03 +00:00
Rafael Espindola 078a333b7e Remove dead code.
setFeatureEnabled is never called with "32" or "64". The driver never passes it
and mips' getDefaultFeatures sets the Features map directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188913 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 18:13:43 +00:00
Rafael Espindola bc1e54587b Move the logic for selecting the last feature in the command line to the driver.
This is a partial revert of r188817 now that the driver handles -target-feature
in a single place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 17:34:32 +00:00
Rafael Espindola 29f26de508 Don't disable SSE4A when disabling AVX.
Thanks for Craig Topper for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 13:28:02 +00:00
Craig Topper bca2c4fab5 Add avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 05:29:10 +00:00
Craig Topper b7a95d2941 Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 03:59:22 +00:00
Rafael Espindola c84ed54f97 Centralize the logic for handling -m* options and fix pr16943.
This moves the logic for handling -mfoo -mno-foo from the driver to -cc1. It
also changes -cc1 to apply the options in order, fixing pr16943.

The handling of -mno-mmx -msse is now an explicit special case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 18:57:55 +00:00
Rafael Espindola ade7cd45d5 Remove duplicated error checking.
The driver validates its options, so we don't need to redo the work in
"clang -cc1".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 15:30:32 +00:00
Rafael Espindola 020b1e28b2 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188802 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 14:18:24 +00:00
Rafael Espindola f6fe72b707 Refactor the x86 feature handling.
This removes the very long chains of
Feature["avx"] = Feature["sse42"] = ... = true;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 13:44:29 +00:00
Craig Topper 42f98732d6 Change 'avx512' to 'avx-512' to match llvm backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 07:39:54 +00:00
Craig Topper 10c2c68e56 Add AVX-512 feature flag and knl cpu to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 07:09:39 +00:00
Craig Topper ed218d05aa Revert r188756 because some other changes snuck in with it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188757 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 07:07:29 +00:00
Craig Topper dab7845798 Add AVX-512 feature flag and knl cpu to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 07:05:05 +00:00
Bob Wilson d588f5c448 Bump the value of the __APPLE_CC__ predefined macro up to 6000.
The previous value was set to match some ancient version of Apple's GCC.
The value should be higher than anything used by Apple's GCC, but we don't
intend for this value to be updated in the future. We have other macros to
identify compiler versions. <rdar://problem/14749599>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188700 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 20:23:37 +00:00
Robert Lytton 5f15f4daf0 Add XCore target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188258 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 09:43:10 +00:00
Jack Carter c613b67f4f [Mips] MSA frontend option support
This patch adds -mmsa and -mno-msa to the options supported by 
clang to enable and disable support for MSA.

When MSA is enabled, a predefined macro '__mips_msa' is defined to 1.

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 17:20:29 +00:00
Tim Northover b793f0d344 AArch64: initial NEON support
Patch by Ana Pazos

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187568 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 09:23:19 +00:00
Bill Schmidt ea7fb0ce25 [PowerPC] Support powerpc64le as a syntax-checking target.
This patch provides basic support for powerpc64le as an LLVM target.
However, use of this target will not actually generate little-endian
code.  Instead, use of the target will cause the correct little-endian
built-in defines to be generated, so that code that tests for
__LITTLE_ENDIAN__, for example, will be correctly parsed for
syntax-only testing.  Code generation will otherwise be the same as
powerpc64 (big-endian), for now.

The patch leaves open the possibility of creating a little-endian
PowerPC64 back end, but there is no immediate intent to create such a
thing.

The new test case variant ensures that correct built-in defines for
little-endian code are generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 01:36:11 +00:00
Rafael Espindola 7185d6272b Remove the mblaze backend from clang.
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:42:13 +00:00
Richard Sandiford 5c92b9ab4e [SystemZ] Add -march= command-line option
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-19 16:51:51 +00:00
Bill Schmidt b1baad643c [PowerPC] FreeBSD does not require f128 in its data layout string.
Long double is 64 bits on FreeBSD PPC, so the f128 entry is superfluous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185582 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 21:03:06 +00:00
Roman Divacky b2f6f4764e Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.
It's not the case on ie. FreeBSD.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185572 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 19:45:54 +00:00
Anton Korobeynikov 18a295d96d Fix MSP430 builtin types.
Patch by Job Noorman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 19:42:40 +00:00
Benjamin Kramer 9df0823a4b Driver: Push triple objects around instead of going to std::string all the time.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-29 16:37:14 +00:00
Joey Gouly cbed3bfe79 Add support for passing v8fp options via -mfpu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 13:19:54 +00:00
Joey Gouly 4ec8d5b63d Add support for passing '-target armv8' through the Driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184970 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 17:19:48 +00:00
Chandler Carruth c6fa1153f8 Fix a couple of PPC predefined macros that I spotted while driving by
this code. These aren't technically standard predefines for the platform
but apparantly lots of folks use them as they show up within LLVM's own
codebase. ;] This may even fix some self host issues w/ the JIT!!!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184830 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 11:13:47 +00:00
Justin Holewinski 0ac428eb8a [NVPTX] Add NVPTX register constraints
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184578 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 18:51:24 +00:00
Bob Wilson e4bce7a425 size_t on Darwin AAPCS targets is "unsigned long". <rdar://problem/14136459>
Some embedded targets use ARM's AAPCS with iOS header files that define size_t
as unsigned long, which conflicts with the usual AAPCS definition of size_t
as unsigned int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184171 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 05:36:04 +00:00
Rafael Espindola e1e0342446 Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 20:00:15 +00:00
Ed Schouten 04491635b1 Emit native implementations of atomic operations on FreeBSD/armv6.
Just like on Linux, FreeBSD/armv6 assumes the system supports
ldrex/strex unconditionally. It is also used by the kernel. We can
therefore enable support for it, like we do on Linux.

While there, change one of the unit tests to explicitly test against
armv5 instead of armv7, as it actually tests whether libcalls are
emitted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-15 09:40:14 +00:00
Bob Wilson 221a8908e4 Do not report -Wasm-operand-widths for ARM output operands. <rdar://14050337>
We're getting reports of this warning getting triggered in cases where it
is not adding any value. There is no asm operand modifier that you can use
to silence it, and there's really nothing wrong with having an LDRB, for
example, with a "char" output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183172 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-03 23:57:13 +00:00
Jakob Stoklund Olesen 5ac8c4f449 OpenBSD/sparc64 uses long long for int64_t and intmax_t.
Other operating systems, including FreeBSD and NetBSD, use long.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 17:53:37 +00:00
David Fang b5afadd210 fix PR 15726: ptrdiff_t should be int on PowerPC Darwin
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-16 17:51:48 +00:00
Jakob Stoklund Olesen fcec0c991e Use correct types for SPARC v9.
It's an LP64 platform.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-15 03:22:33 +00:00
Rafael Espindola 69db555a7a Use atomic instructions on linux thumb v7.
This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181750 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-14 00:44:24 +00:00
Rafael Espindola 620c0afe5e Use atomic instructions on ARM linux.
This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.

This fixes pr15429.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181728 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-13 20:09:47 +00:00
Ulrich Weigand b840921552 Add SystemZ support
This patch then adds all the usual platform-specific pieces for SystemZ:
driver support, basic target info, register names and constraints,
ABI info and vararg support.  It also adds new tests to verify pre-defined
macros and inline asm, and updates a test for the minimum alignment change.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06 16:26:41 +00:00
Tim Northover ff920eec4d AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04 07:15:13 +00:00
Benjamin Kramer 63063f5dd7 Add support for -march=btver2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03 10:47:15 +00:00
Jakob Stoklund Olesen 44f72d34a9 Add some more required SPARC v9 predefined macros.
Solaris/AuroraUX only need __arch64__, the BSDs need the other variants.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180172 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-24 04:36:38 +00:00
Jakob Stoklund Olesen 56e1f1f7ab Add support for sparcv9 targets.
The SPARC v8 and SPARC v8 architectures are very similar, so use a base
class to share most information between them.

Include operating systems with known SPARC v9 ports.

Also fix two issues with the SPARC v8 data layout string: SPARC v8 is a
big endian target with a 64-bit aligned stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179596 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16 15:17:49 +00:00
Simon Atanasyan 321ae79aae [Mips] Support -mmicromips / -mno-micromips command line options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:51 +00:00
Simon Atanasyan d96e315fb8 [Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:30 +00:00
Eli Bendersky c0783dc18a The PNaCl target no longer permits __attribute__((regparm)).
Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo
and adjust tests accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179059 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08 21:31:01 +00:00
Tim Northover dabcbf9548 AArch64: bring predefines in line with most recent ACLE document
The prefixes and names used are now identical to 32-bit ARM, which is also
expected to remain unchanged.

If we made this change after a release, we'd probably have to support both
variants for a while, but I think since AArch64 exists only on trunk now, it's
acceptable to simply swap them now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178870 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 14:08:55 +00:00
Michael J. Spencer d1b33945f3 Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} on x86.
This fixes std::thread with libstdc++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178816 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04 23:53:43 +00:00
Tom Stellard 3b848ec836 R600: Add missing Southern Islands GPU to setCPU() function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01 20:56:49 +00:00
Justin Holewinski affa3af144 Remove old NVPTX cpus and add new NVPTX cpus
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-30 14:38:26 +00:00