Commit Graph

681 Commits

Author SHA1 Message Date
Daniel Sanders 838f9337a1 [mips][msa] Enable inlinse assembly for MSA.
Like GCC, this re-uses the 'f' constraint and a new 'w' print-modifier:
  asm ("ldi.w %w0, 1", "=f"(result));

Unlike GCC, the 'w' print-modifer is not _required_ to produce the intended
output. This is a consequence of differences in the internal handling of
the registers in each compiler. To be source-compatible between the
compilers, users must use the 'w' print-modifier.

MSA registers (including control registers) are supported in clobber lists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194476 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 12:56:01 +00:00
Robert Lytton 1816219b01 XCore target Type defines.
Change SizeType, PtrDiffType, IntPtrType, WCharType, WIntType
to follow the XMOS llvm-gcc front end's settings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194461 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 10:09:30 +00:00
Akira Hatanaka dda91e0c4b [mips] Partially revert r193640. Stack alignment should not be determined by
the floating point register mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 22:10:46 +00:00
Tim Northover 9b79630004 Darwin(ish): we don't want __ARM_EABI__ even on v7a embedded targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 19:11:22 +00:00
Joerg Sonnenberger 8daa7fe574 NetBSD 6.99.26 switched to default rounding mode, so adjust
__FLT_EVAL_METHOD__ accordingly. Add test case for this and the SSE2
variances on NetBSD.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 14:00:37 +00:00
Benjamin Kramer a2420960fd Driver: Add support for -march=bdver3 on x86.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-04 10:29:51 +00:00
Amara Emerson 3bb1b5c953 [AArch64] Add some CPU targets for "generic", A-53 and A-57.
Enables the clang driver to begin targeting specific CPUs. Introduced a
"generic" CPU which will ensure that the optional FP feature is enabled
by default when it gets to LLVM, without needing any extra arguments.
Cortex-A53 and A-57 are also introduced with tests, although backend
handling of them does not yet exist.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 09:32:33 +00:00
Akira Hatanaka 2669986562 [mips] Delete unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193674 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-30 02:38:17 +00:00
Akira Hatanaka 550ed2077e [mips] Align the stack to 16-bytes for -mfp64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193640 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 19:00:35 +00:00
Akira Hatanaka 4d1c2364d6 [mips] Move setDescriptionString to base class MipsTargetInfoBase and call it
at the end of handleTargetFeatures.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 18:30:33 +00:00
Tom Stellard 423170442b R600: Add Sea Islands GPUs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 16:38:29 +00:00
Bernard Ogden 909f35a884 ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.

Differential Revision: http://llvm-reviews.chandlerc.com/D2037

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 09:47:51 +00:00
Bernard Ogden f779e65390 Add driver support for FP, SIMD and crypto defaults.
Although we wire up a bit for v8fp for macro setting
purposes, we don't set a macro yet. Need to ask list
about that.

Change-Id: Ic9819593ce00882fbec72757ffccc6f0b18160a0

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:51 +00:00
Bernard Ogden 51f997dfc0 Clean up char/numeric comparisons in ARM getTargetDefines
Change-Id: Ie07228411b68252adcd5cf80b27ccd2eb3b031d9

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193366 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:44 +00:00
Bernard Ogden c427249cb7 Teach clang driver about Cortex-A53 and Cortex-A57.
Adds some Cortex-A53 strings where they were missing before.
Cortex-A57 is entirely new to clang.

Doesn't touch code only used by Darwin, in consequence of which
one of the A53 lines has been removed.

Change-Id: I5edb58f6eae93947334787e26a8772c736de6483

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193364 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:36 +00:00
Tim Northover 66b5dac8b7 ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs
These arch arguments are used for embedded targets (obviously) which need a
different calling convention to iOS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 10:48:50 +00:00
Silviu Baranga c6c9cf4b18 Set the default hardware division features for ARM cpus. Also set it as default for A32 armv8.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 10:59:33 +00:00
Silviu Baranga 1db2e27911 Add the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware divide in the mode that we are compiling in (depending on the target features), not defined if we don't. Should be compatible with the GCC conterpart. Also adding a -hwdiv option to overide the default behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 10:54:53 +00:00
Simon Atanasyan ddb2ad21d2 [Mips] Define __mips_fpr and _MIPS_FPSET macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192969 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 13:13:53 +00:00
Eric Christopher 3d11cedeb5 Rename HandleTargetFeatures->handleTargetFeatures to match
everything else in the class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192851 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 21:26:26 +00:00
Eric Christopher 165432092b Add preprocessor support for powerpc vsx.
The test should be expanded upon for more powerpc checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192849 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 21:19:26 +00:00
Eric Christopher f217400fd5 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 21:19:19 +00:00
Yunzhong Gao 15dbacc7cb Enabling 3DNow! prefetch instruction support for a few AMD processors in the
clang front end. This change will allow the __PRFCHW__ macro to be set on these
processors and hence include prfchwintrin.h in x86intrin.h header. Support for
the intrinsic itself seems to have already been added in r178041.

Differential Revision: http://llvm-reviews.chandlerc.com/D1934



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192829 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 19:07:02 +00:00
Nick Lewycky af94546359 Add support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
it is enabled. Also enable it on the same architectures that GCC does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 20:14:27 +00:00
Weiming Zhao 8712ded79d Fix PR 12730: Add _GCC_HAVE_SYNC_COMPARE_AND_SWAP macros for ARM
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191707 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 22:51:32 +00:00
Ed Schouten 5ada7a5e97 Add character set related __STDC_* definitions.
Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's
exclusively. This means that we can define __STDC_UTF_16__ and
__STDC_UTF_32__ unconditionally.

While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's
wchar_t's don't encode characters as ISO-10646; the encoding depends on
the locale used. Because the character set used might not be a superset
of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191631 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-29 07:54:52 +00:00
Yunzhong Gao a8f7d9dd92 Adding -mtbm and -mno-tbm command line options to the clang front end for the
x86 TBM instruction set. Also adding a __TBM__ macro if the TBM feature is
enabled. Otherwise there should be no functionality change to existing features.

Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1693



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191326 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 19:00:58 +00:00
Simon Atanasyan fc12c4aa20 [Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
this option to the assembler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 09:09:16 +00:00
Petar Jovanovic bbac9aacc4 [Mips] Allocate NaClTargetInfo for MIPSEL NaCl
A patch to AllocateTarget function to recognize llvm::Triple::NaCl for
MIPSEL and return NaClTargetInfo. Additional test has been added to check
if the expected macros get defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 01:27:01 +00:00
Ben Langmuir b83f5a7733 Add C intrinsics for Intel SHA Extensions
Intrinsics added shaintrin.h, which is included from x86intrin.h if __SHA__ is
enabled. SHA implies SSE2, which is needed for the __m128i type.

Also add the -msha/-mno-sha option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190999 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 13:22:04 +00:00
Craig Topper b22352e7c4 Use curly braces all the way through long if/else chain for consistency and readability.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 01:13:07 +00:00
Craig Topper a6cbc27012 Disabling sse2 should disable aes and pclmul support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 00:01:05 +00:00
Joey Gouly 520ec1e553 [ARMv8] Add builtins for CRC instructions.
Patch by Bradley Smith!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 10:07:09 +00:00
Craig Topper 85bfef69f9 Push contents of X86TargetInfo::setFeatureEnabled down to a static function called by the virtual version and all the places in getDefaultFeatures. This way getDefaultFeatures doesn't make so many virtual calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-17 04:51:29 +00:00
Craig Topper 319d81f235 Mark setSSELevel/setMMXLevel/setXOPLevel as static since they don't access anything in the class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190846 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-17 04:12:55 +00:00
Amara Emerson 2440fb1f91 Add error checking to reject neon_vector_type attribute on targets without NEON.
Patch by Artyom Skrobov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190801 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 18:07:35 +00:00
Craig Topper 84f007b173 Make F16C feature imply AVX. Matches GCC behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190776 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 04:54:13 +00:00
Cameron Esfahani 57b1da1588 Clean up some Triple usage in clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190737 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 01:09:11 +00:00
Preston Gurd c57ea68783 Update Atom Silvermont (SLM) support by adding enabled features.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190718 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 19:27:17 +00:00
Renato Golin 5df4045db5 Add more Cortex CPUs and tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 17:02:54 +00:00
Renato Golin 1302f9fec0 Fix Neon detection for Cortex-A class, plus adds some more CPUs to default features
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 17:02:45 +00:00
David Tweed 1eef85246b Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190684 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 12:04:22 +00:00
Craig Topper 56bed97d75 Fix a bug where -msse followed by -mno-sse would leave MMX enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 06:48:53 +00:00
Alexey Samsonov 3f46e6f459 Delete unused static class members
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190394 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 09:26:48 +00:00
Craig Topper 89a5e796be Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.
Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled.
Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190387 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 06:55:47 +00:00
Sylvestre Ledru deb77991a2 Fix the profile of the function (fix commit 190048)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190051 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 13:58:07 +00:00
Sylvestre Ledru 3309a78379 Fix bug #17104 - Target info for GNU/kFreeBSD were missing.
As a result, Clang doesn't define the pre-processor macros that are expected
on this platform.

Thanks to Robert Millan for the patch



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 13:47:07 +00:00
Benjamin Kramer b98ce37c69 Add support for -march=slm, aka Intel Atom Silvermont.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 14:05:34 +00:00
Charles Davis e8519c31a6 Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 04:39:01 +00:00
Reid Kleckner ef07203387 Delete CC_Default and use the target default CC everywhere
Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention.  This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator.  There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1231

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 23:08:25 +00:00