Commit Graph

800 Commits

Author SHA1 Message Date
Bob Wilson 87b3a189ef 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.

llvm-svn: 184171
2013-06-18 05:36:04 +00:00
Rafael Espindola 3d4276e3cf Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
llvm-svn: 184113
2013-06-17 20:00:15 +00:00
Ed Schouten 60afa2d923 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.

llvm-svn: 184040
2013-06-15 09:40:14 +00:00
Bob Wilson 1710d59553 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.

llvm-svn: 183172
2013-06-03 23:57:13 +00:00
Jakob Stoklund Olesen 826df14d72 OpenBSD/sparc64 uses long long for int64_t and intmax_t.
Other operating systems, including FreeBSD and NetBSD, use long.

llvm-svn: 182215
2013-05-19 17:53:37 +00:00
David Fang 072d47b67f fix PR 15726: ptrdiff_t should be int on PowerPC Darwin
llvm-svn: 182029
2013-05-16 17:51:48 +00:00
Jakob Stoklund Olesen 248520bdea Use correct types for SPARC v9.
It's an LP64 platform.

llvm-svn: 181867
2013-05-15 03:22:33 +00:00
Rafael Espindola 92dbc3183f 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.

llvm-svn: 181750
2013-05-14 00:44:24 +00:00
Rafael Espindola 101d5b956a Use atomic instructions on ARM linux.
This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.

This fixes pr15429.

llvm-svn: 181728
2013-05-13 20:09:47 +00:00
Ulrich Weigand 47445073f8 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.

llvm-svn: 181211
2013-05-06 16:26:41 +00:00
Tim Northover 8ec8c4bf89 AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

llvm-svn: 181111
2013-05-04 07:15:13 +00:00
Benjamin Kramer 914d7e06b6 Add support for -march=btver2.
llvm-svn: 181006
2013-05-03 10:47:15 +00:00
Jakob Stoklund Olesen f759989bcd Add some more required SPARC v9 predefined macros.
Solaris/AuroraUX only need __arch64__, the BSDs need the other variants.

llvm-svn: 180172
2013-04-24 04:36:38 +00:00
Jakob Stoklund Olesen 4dda152d14 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.

llvm-svn: 179596
2013-04-16 15:17:49 +00:00
Simon Atanasyan 607776140b [Mips] Support -mmicromips / -mno-micromips command line options.
llvm-svn: 179489
2013-04-14 14:07:51 +00:00
Simon Atanasyan 1607191e66 [Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

llvm-svn: 179486
2013-04-14 14:07:30 +00:00
Eli Bendersky 4f6791cafb The PNaCl target no longer permits __attribute__((regparm)).
Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo
and adjust tests accordingly.

llvm-svn: 179059
2013-04-08 21:31:01 +00:00
Tim Northover b85654d3cd 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.

llvm-svn: 178870
2013-04-05 14:08:55 +00:00
Michael J. Spencer a0d5eb3a27 Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} on x86.
This fixes std::thread with libstdc++.

llvm-svn: 178816
2013-04-04 23:53:43 +00:00
Tom Stellard 7856993228 R600: Add missing Southern Islands GPU to setCPU() function
llvm-svn: 178498
2013-04-01 20:56:49 +00:00
Justin Holewinski 91203e8468 Remove old NVPTX cpus and add new NVPTX cpus
llvm-svn: 178419
2013-03-30 14:38:26 +00:00
Hal Finkel 7d4585973a Add support for gcc-compatible -mfprnd -mno-fprnd PPC options
gcc provides -mfprnd and -mno-fprnd for controlling the fprnd target
feature; support these options as well.

llvm-svn: 178414
2013-03-30 13:47:44 +00:00
Michael Liao ffaae3511a Add RDSEED intrinsic support defined in AVX2 extension
llvm-svn: 178331
2013-03-29 05:17:55 +00:00
Hal Finkel 1fe8b3dd4b Add support for gcc-compatible -mpopcntd -mno-popcntd PPC options
gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target
feature; support these options as well.

llvm-svn: 178235
2013-03-28 13:51:36 +00:00
Hal Finkel 279ca4d608 Add support for gcc-compatible -mmfcrf -mno-mfcrf PPC options
gcc provides -mmfcrf and -mno-mfcrf for controlling what we call
the mfocrf target feature. Also, PPC is now making use of the
static function AddTargetFeature used by the Mips Driver code.

llvm-svn: 178227
2013-03-28 08:38:53 +00:00
Michael Liao 74f4eaf4dc Add PRFCHW intrinsic support
- Add head 'prfchwintrin.h' to define '_m_prefetchw' which is mapped to
  LLVM/clang prefetch builtin
- Add option '-mprfchw' to enable PRFCHW feature and pre-define '__PRFCHW__'
  macro

llvm-svn: 178041
2013-03-26 17:52:08 +00:00
Matthew Curtis 7808cf1a39 Remove driver support for Hexagon V2 and V3
Driver will now error when trying to compile for V2 or V3.

Removal of V2 and V3 support will allow us to simplify the hexagon
back-end.

llvm-svn: 176859
2013-03-12 11:52:09 +00:00
Guy Benyei 5ea30273a1 Add 'e' to the SPIR data layout - SPIR is little endian for now.
Add 32/64 bit specific target defines for SPIR.

llvm-svn: 176629
2013-03-07 13:06:10 +00:00
Jack Carter beaccddcba Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store.

Including missing positive test case and fixed typo for r176453.

Thanks to Richard Smith for catching this!

Jack

llvm-svn: 176506
2013-03-05 19:10:54 +00:00
Bob Wilson f643afcd31 Tidy up lists of Cortex-A series processors, adding entries for A7.
Also fix a missing entry for cortex-r5 in one copy of getLLVMArchSuffixForARM.

llvm-svn: 176457
2013-03-04 22:37:46 +00:00
Jack Carter 427b404d0a Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

llvm-svn: 176453
2013-03-04 21:36:11 +00:00
Tom Stellard c74b1e054c R600: Use the GPU type to determine the correct DataLayout v2
v2:
  - Add R600_DOUBLE_OPS for RV670
  - s/CPU/GPU/

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
llvm-svn: 176440
2013-03-04 17:40:53 +00:00
Simon Atanasyan 0da400cf92 [Mips] Add two new aliases for MIPS ABI names 32 (means o32 abi) and 64
(means n64 abi) to improve compatibility with GNU tools.
Patch by Jia Liu <proljc@gmail.com>.

llvm-svn: 176187
2013-02-27 14:55:49 +00:00
Logan Chien 5a5a96bfdc Implement __builtin_eh_return_data_regno() for ARM and MIPS.
llvm-svn: 175954
2013-02-23 04:24:36 +00:00
Peter Collingbourne 47f9f2d1e6 Revert r175912, "Add support for coldcc to clang" at John's request.
llvm-svn: 175936
2013-02-23 00:06:18 +00:00
Peter Collingbourne f32b3f2c55 Add support for coldcc to clang
llvm-svn: 175912
2013-02-22 19:24:35 +00:00
Jordan Rose 011bda8031 Revert "intmax_t is long long on Darwin, not long."
'long' and 'long long' are different for the purposes of mangling.
This caused <rdar://problem/13254874>.

This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.

llvm-svn: 175681
2013-02-20 22:28:41 +00:00
Jordan Rose e2b34142c3 intmax_t is long long on Darwin, not long.
<rdar://problem/11540697>

llvm-svn: 175588
2013-02-20 01:56:21 +00:00
Tim Northover 847d2d4549 AArch64: add atomic support parameters to TargetInfo
This allows Clang to detect and deal wih __atomic_* operations properly on
AArch64. Previously we produced an error when encountering them at high
optimisation levels.

llvm-svn: 175438
2013-02-18 12:11:32 +00:00
Bill Schmidt 38378a06dd Add some missing PPC cpus
llvm-svn: 174215
2013-02-01 20:23:10 +00:00
Hal Finkel b58ce85ecc Add -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set
I've renamed the altivec test to ppc-features (because now there is more than one feature to test).

llvm-svn: 174204
2013-02-01 18:44:19 +00:00
Hal Finkel df1e4bfcb2 Add PPC A2Q core and BG/Q preprocessor definitions
The a2q core is the variant of the a2 core used on the BG/Q supercomputers.

llvm-svn: 174151
2013-02-01 05:53:33 +00:00
Bill Schmidt 2fe4c67374 Enable -fno-altivec, -mno-altivec for PowerPC.
Introduces these negation forms explicitly and uses them to control a new
"altivec" target feature for PowerPC.  This allows avoiding generating
Altivec instructions on processors that support Altivec.

The new test case verifies that the Altivec "lvx" instruction is not
used when -fno-altivec is present on the command line.

llvm-svn: 174140
2013-02-01 02:14:03 +00:00
Tim Northover 9bb857a4f1 Add support for AArch64 target.
In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

llvm-svn: 174055
2013-01-31 12:13:10 +00:00
John McCall 359b885e12 First pass at abstracting out a class for the target C++ ABI.
llvm-svn: 173514
2013-01-25 22:30:49 +00:00
Adhemerval Zanella 5d874aeea9 PowerPC: fix __builtin_eh_return_data_regno return
llvm-svn: 173188
2013-01-22 20:02:45 +00:00
Akira Hatanaka b2206e71e1 [mips] Enable inlining of atomic ops on mips32 and mips64.
llvm-svn: 172855
2013-01-18 21:58:11 +00:00
Will Dietz f54319c891 [ubsan] Add support for -fsanitize-blacklist
llvm-svn: 172808
2013-01-18 11:30:38 +00:00
Dmitri Gribenko f857950d39 Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h

llvm-svn: 172323
2013-01-12 19:30:44 +00:00
Guy Benyei 03e61960c8 Enable intel_ocl_bicc for x86_64 target only. Remove fix from 171969 that enabled this extension for multiple targets.
llvm-svn: 172052
2013-01-10 10:41:05 +00:00
Akira Hatanaka 009173f613 [mips] Fix data layout string. Add 64 to the list of native integer widths
and add stack alignment information.

llvm-svn: 171588
2013-01-05 02:04:34 +00:00
Anshuman Dasgupta 89730ce9ee Correct Hexagon DataLayout string. Fixes bug 14744.
Patch by Krzysztof Parzyszek!

llvm-svn: 171415
2013-01-02 21:25:57 +00:00
Chandler Carruth ffd5551bc7 Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

llvm-svn: 171369
2013-01-02 11:45:17 +00:00
Richard Smith 2bf7fdb723 s/CPlusPlus0x/CPlusPlus11/g
llvm-svn: 171367
2013-01-02 11:42:31 +00:00
Guy Benyei f0a014bbb7 Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.
llvm-svn: 171056
2012-12-25 08:53:55 +00:00
Quentin Colombet f5a37a3b71 Add ARM cortex-r5 subtarget as available mcpu
llvm-svn: 170909
2012-12-21 17:57:47 +00:00
NAKAMURA Takumi 02f4395df6 Targets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version of cygwin/w32api.
llvm-svn: 170188
2012-12-14 10:17:26 +00:00
Guy Benyei 41aa1a4b92 Remove little endian specification from SPIR data layout - SPIR doesn't define endiannes in the data layout.
llvm-svn: 170125
2012-12-13 13:22:48 +00:00
Rafael Espindola 0f207edaa5 Initial support for FreeBSD on ARM.
Patch by Andrew Turner.

llvm-svn: 170096
2012-12-13 04:17:14 +00:00
Guy Benyei b798fc9849 Add SPIR32/SPIR64 targets to Clang
llvm-svn: 169917
2012-12-11 21:38:14 +00:00
Aaron Ballman 02df2e0872 Virtual method overrides can no longer have mismatched calling conventions. This fixes PR14339.
llvm-svn: 169705
2012-12-09 17:45:41 +00:00
David Chisnall a87d85994b long double should be 64 bits on FreeBSD/MIPS64. It possibly should be on
Linux too, as I think we inherited it from there.  The ABI spec says 128-bit,
although I think SGI's compiler on IRIX may be the only thing ever to support
this.

llvm-svn: 169674
2012-12-08 09:06:08 +00:00
Eli Bendersky d7c9203938 Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
in the triple.

llvm-svn: 169292
2012-12-04 18:38:10 +00:00
Bill Wendling 0517508c00 Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.
llvm-svn: 169059
2012-11-30 23:46:56 +00:00
Bill Wendling 3c6591d6ea Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

llvm-svn: 169054
2012-11-30 23:18:12 +00:00
Quentin Colombet 2e9952ef60 Add ARM cortex-a5 subtarget
llvm-svn: 168958
2012-11-29 23:15:27 +00:00
Quentin Colombet 9b541ff6af Revert commit revision r168953, to change the commit message, which was empty
llvm-svn: 168956
2012-11-29 23:07:08 +00:00
Quentin Colombet 2b14712eca (no commit message)
llvm-svn: 168953
2012-11-29 22:58:40 +00:00
Eli Friedman 4e91899e7b Fix the definition of the vfork() builtin on Haiku. PR14378.
llvm-svn: 168674
2012-11-27 02:58:24 +00:00
Eli Friedman 102dc4e30d Add missing "break". Thanks to Craig for spotting it.
I'm looking at ways to fix the relevant test so it can catch this sort of mistake.

llvm-svn: 168618
2012-11-26 21:57:28 +00:00
Benjamin Kramer 37196de31e Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.
Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size.

llvm-svn: 168260
2012-11-17 17:30:55 +00:00
Eli Friedman 3e94f57a0f Add missing features for misc x86 CPUs to CPU feature translation. Patch by Jung-uk Kim.
llvm-svn: 168239
2012-11-17 01:43:10 +00:00
Eli Friedman 1beddcffc3 Clean up X86 target feature translation code slightly. No intended functional change. Patch by Jung-uk Kim.
llvm-svn: 168237
2012-11-17 01:16:19 +00:00
Douglas Gregor f8715de599 Since CreateTargetInfo is taking ownership of the target options, pass
it as a pointer. 

llvm-svn: 168136
2012-11-16 04:24:59 +00:00
Eric Christopher fd081ca50a Remove the cellspu port.
Approved by Chris Lattner.

llvm-svn: 167983
2012-11-14 22:08:59 +00:00
Bill Wendling 3c7fed87d2 The register constraint could mean a 16- or 8-bit register.
llvm-svn: 167735
2012-11-12 18:52:32 +00:00
Bill Wendling 887b485dbe Check that the input size is correct for the given constraint.
The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot
place a 64-bit value into the 32-bit register. Error out instead of causing the
compiler to spew general badness.
<rdar://problem/12415959>

llvm-svn: 167717
2012-11-12 06:42:51 +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
Benjamin Kramer d0b9f090fb Set TLSSupported to false on Haiku.
Haiku does not support this (yet). Leaving it set to true leads to
configure scripts detecting __thread being available and Clang emitting
code for it, resulting in binaries the runtime_loader will refuse to
load.

Patch by Jonathan Schleifer!

llvm-svn: 167576
2012-11-08 12:59:15 +00:00
Richard Smith 43f9d9c6d9 Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

llvm-svn: 167405
2012-11-05 21:48:12 +00:00
Bill Schmidt cec4cb151a This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.

llvm-svn: 166927
2012-10-29 14:59:24 +00:00
Bill Wendling 9d1ee1175d Recommit Eric's code to validate ASM string's constraints and modifiers.
This code checks the ASM string to see if the output size is able to fit within
the variable specified as the output. For instance, scalar-to-vector conversions
may not really work. It's on by default, but can be turned off with a flag if
you think you know what you're doing.

This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm').

<rdar://problem/12284092>

llvm-svn: 166737
2012-10-25 23:28:48 +00:00
David Tweed 8f67653d26 Modify the targets to set appropriate calling convention defaults and C variables when using a gnueabihf or aapcs-vfp target.
Tested by me and Wei-Ren Chen.

llvm-svn: 166679
2012-10-25 13:33:01 +00:00
Bill Wendling d75987dde9 Revert r166647 to rethink the patch...
llvm-svn: 166655
2012-10-25 00:32:44 +00:00
Bill Wendling 753c8782df Add some support for diagnosing possibly mismatched constraint, type size and
modifiers. (From an idea by Eric...)
<rdar://problem/12284092>

llvm-svn: 166647
2012-10-25 00:05:55 +00:00
Daniel Dunbar d9debab629 Fix pre-commit refacto failure.
llvm-svn: 166431
2012-10-22 18:56:43 +00:00
Daniel Dunbar f7124da497 driver/Darwin: Follow up to last patch, M-class CPUs are AAPCS but not EABI.
llvm-svn: 166430
2012-10-22 18:51:13 +00:00
Douglas Gregor cb177f15e7 Serialize TargetOptions into an AST file, and make sure that we keep
target options around so they can be accessed at any point (rather
than keeping them transient).

llvm-svn: 166072
2012-10-16 23:40:58 +00:00
Derek Schuff a202096dc0 Add pnaclcall convention to Native Client targets.
Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

llvm-svn: 166065
2012-10-16 22:30:41 +00:00
Douglas Gregor bc10b9fbc5 Teach TargetInfo to hold on to the TargetOptions with which it was
created.

llvm-svn: 165943
2012-10-15 16:45:32 +00:00
Eli Friedman d13b41e32a Add TargetInfo for r600.
Patch by Tom Stellard.

llvm-svn: 165850
2012-10-12 23:32:00 +00:00
Derek Schuff 57b7e8f63f Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

llvm-svn: 165722
2012-10-11 16:55:58 +00:00
Derek Schuff c7dd722f0f Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

llvm-svn: 165715
2012-10-11 15:52:22 +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
Logan Chien 57086ce248 Fix PR 11709: Change the definition of va_list to meet AAPCS requirement
AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
         /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.

llvm-svn: 165609
2012-10-10 06:56:20 +00:00
Aaron Ballman e91c6be01e Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.
Fixes PR13782

llvm-svn: 165015
2012-10-02 14:26:08 +00:00
Bob Wilson 6fc8fb8da5 Add ARM VFPv4 feature and enable it by default for Swift.
llvm-svn: 164906
2012-09-29 23:52:52 +00:00
Bob Wilson d7cf104dae Add armv7s and some other arm variants supported by Mach-O files.
llvm-svn: 164905
2012-09-29 23:52:50 +00:00
Alexander Potapenko b4f819086a Disable source fortification on Darwin with AddressSanitizer.
ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7

llvm-svn: 164299
2012-09-20 10:10:01 +00:00
Hal Finkel f6d6cb0218 Add e500mc and e5500 to the list of valid PPC CPU names.
Patch by Tobias von Koch!

llvm-svn: 164176
2012-09-18 22:25:03 +00:00
Silviu Baranga 157f7c6742 This patch introduces A15 as a target in Clang.
llvm-svn: 163804
2012-09-13 15:06:00 +00:00
Anton Korobeynikov 26b1388293 Do not construct StringRef from NULL argument.
llvm-svn: 163465
2012-09-08 08:22:13 +00:00
Anton Korobeynikov e98c4dbd1e Provide some ACLE C defines. This should fix PR13796
llvm-svn: 163464
2012-09-08 08:08:27 +00:00
Logan Chien c6fd820937 Rename ANDROIDEABI to Android.
Most of the code guarded with ANDROIDEABI are not
ARM-specific, and having no relation with arm-eabi.
Thus, it will be more natural to call this
environment "Android" instead of "ANDROIDEABI".

Note: We are not using ANDROID because several projects
are using "-DANDROID" as the conditional compilation
flag.

llvm-svn: 163088
2012-09-02 09:30:11 +00:00
Simon Atanasyan c6a0be00ab Define __mips64 / __mips64__ macros for MIPS 64-bit targets.
The patch suggested by Brad Smith.

llvm-svn: 162858
2012-08-29 20:50:11 +00:00
Simon Atanasyan 16ee0057ab Use getTargetDefines() virtual function in MipsTargetInfoBase successors
to define all macros for MIPS targets. Remove redundant virtual function
getArchDefines(). Two virtual functions for this task are really too much.

llvm-svn: 162853
2012-08-29 19:59:32 +00:00
Simon Atanasyan 683535bbdd Factor out MIPS macro definitions common for all MIPS targets.
llvm-svn: 162852
2012-08-29 19:14:58 +00:00
Simon Atanasyan 5a0642fdc1 Define _MIPS_ARCH and _MIPS_ARCH_<cpu name> macros for MIPS targets.
The patch suggested by Logan Chien.

llvm-svn: 162840
2012-08-29 15:17:29 +00:00
Eric Christopher c34d391ca2 Remove FIXME, the constraints contain more options than the
current available documentation.

llvm-svn: 162065
2012-08-16 23:50:43 +00:00
Eric Christopher 9e49188a01 Add a missing 'break' to ensure that we reject inline assembly
constraints we don't recognize.

llvm-svn: 162064
2012-08-16 23:50:41 +00:00
Dylan Noblesmith 8d48c8c675 Frontend: define _LP64 in a target-independent way
Instead of adding it to each individual subclass in
Targets.cpp, simply check the appropriate target
values.

Where before it was only on x86_64 and ppc64, it's now
also defined on mips64 and nvptx64.

Also add a bunch of negative tests to ensure it is *not*
defined on any other architectures while we're here.

llvm-svn: 161685
2012-08-10 19:12:37 +00:00
Eli Friedman 9fa2885522 clang support for Bitrig (an OpenBSD fork); patch by David Hill.
llvm-svn: 161546
2012-08-08 23:57:20 +00:00
Hans Wennborg 29fbe3e0d7 Revert part of r161175 which was wrong for OpenBSD's PowerPC target.
Contributed by Brad Smith <brad@comstyle.com>

llvm-svn: 161481
2012-08-08 08:41:02 +00:00
Hans Wennborg 0bb8462bf7 Add OpenBSD arch targets for powerpc, arm, mips64, mips64el and sparc.
Contributed by Brad Smith <brad@comstyle.com>

llvm-svn: 161175
2012-08-02 13:45:48 +00:00
Hans Wennborg 1241731803 TLS is not supported on OpenBSD
This fixes PR13502 and adds a test to keep track of which
targets support TLS and which do not.

llvm-svn: 161124
2012-08-01 18:53:19 +00:00
Chad Rosier cc40ea7f9a Add a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
AVX).  Currently, if no aligned attribute is specified the alignment of a vector is
inferred from its size.  Thus, very large vectors will be over-aligned with no 
benefit.  Target owners should set this target max.

llvm-svn: 160209
2012-07-13 23:57:43 +00:00
Justin Holewinski 5fafdd9d1d Fix handling of curly braces in NVPTX inline asm
Fixes bug 13322

Patch by Dmitry Mikushin

llvm-svn: 160050
2012-07-11 15:34:55 +00:00
Benjamin Kramer 1e250395fa Wire up -mrdrnd for X86.
For some reason GCC decided to call the feature rdrnd instead of rdrand,
which requires translating it for LLVM.

llvm-svn: 159897
2012-07-07 09:39:18 +00:00
Benjamin Kramer b2c42807a4 Remove unreachable default case to pacify clang's -Wcovered-switch-default.
llvm-svn: 159829
2012-07-06 15:27:25 +00:00
Simon Atanasyan 9780e4a2bb MIPS: Define __mips_dsp_rev / __mips_dspr2 / __mips_dsp macros
if -mdsp or -mdspr2 options are provided.

llvm-svn: 159774
2012-07-05 20:16:22 +00:00
Simon Atanasyan 9c6f1f7f23 MIPS: Add -mdsp/-mno-dsp and -mdspr2/-mno-dspr2 command line options support.
llvm-svn: 159769
2012-07-05 19:23:00 +00:00
Simon Atanasyan 72244b6e4f MIPS: Define __mips16 macro if -mips16 option is provided.
llvm-svn: 159753
2012-07-05 16:06:06 +00:00
Simon Atanasyan 9f444d5a1b MIPS: Replace the pair of boolean flags by enumeration to hold selected float ABI.
llvm-svn: 159752
2012-07-05 15:32:46 +00:00
Simon Atanasyan 6f23fa0f18 MIPS: Add -mips16 / -mno-mips16 command line support.
llvm-svn: 159747
2012-07-05 14:19:39 +00:00
Hal Finkel 6b984f084c Add additional architecture defines for PPC targets.
Patch by Andy Gibbs.

llvm-svn: 159665
2012-07-03 16:51:04 +00:00
Simon Atanasyan 07ce7d8fb5 Support MIPS DSP Rev1 intrinsics.
This patch was reviewed in the llvm-commits list by Jim Grosbach.

llvm-svn: 159366
2012-06-28 18:23:16 +00:00
Meador Inge 5d3fb22bac Explicitly build __builtin_va_list.
The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.

llvm-svn: 158592
2012-06-16 03:34:49 +00:00
Hal Finkel 8eb5928514 Add PPC support for translating gcc-style -mcpu options into LLVM -target-cpu options.
This functionality is based on what is done on ARM, and enables selecting PPC CPUs
in a way compatible with gcc's driver. Also, mirroring gcc (and what is done on x86),
-mcpu=native support was added. This uses the host cpu detection from LLVM
(which will also soon be updated by refactoring code currently in backend).

In order for this to work, the target needs a list of valid CPUs -- we now accept all CPUs accepted by LLVM.
A few preprocessor defines for common CPU types have been added.

llvm-svn: 158334
2012-06-11 22:35:19 +00:00
Craig Topper f561a9562d Add XOP feature flag.
llvm-svn: 158284
2012-06-09 22:24:14 +00:00
Simon Atanasyan d3d173ddca Mips: Define __mips_hard_float macro additional to __mips_single_float
when single float ABI is selected.

llvm-svn: 157996
2012-06-05 13:06:56 +00:00
Craig Topper 12c9df3a9d Make disabling SSE levels also disable AVX and FMA.
llvm-svn: 157907
2012-06-03 22:23:42 +00:00
Craig Topper 1e9e01fabf Make AES and PCLMUL features imply SSE2 as that's needed to get the right types defined.
llvm-svn: 157906
2012-06-03 21:56:22 +00:00
Craig Topper bba778bfd5 Add fma feature flag for Intel FMA instructions.
llvm-svn: 157904
2012-06-03 21:46:30 +00:00
Craig Topper 3f122a7636 Add builtin for pclmulqdq instruction.
llvm-svn: 157733
2012-05-31 05:18:48 +00:00
Craig Topper 9ee12508ca SSE4A should not imply LZCNT and POPCNT. FMA4 should imply SSE4A. Add missing break at the end of btver1 feature list.
llvm-svn: 157680
2012-05-30 05:54:54 +00:00
Benjamin Kramer 8ac9c22391 Define __SSE4A__ when targeting new AMD CPUs.
This doesn't really fit the existing SSELevel so it gets an extra flag.

llvm-svn: 157630
2012-05-29 17:48:39 +00:00
Roman Divacky 67030280f9 Sparc is bigendian.
llvm-svn: 157626
2012-05-29 16:10:50 +00:00
Justin Holewinski 83e9668133 Replace PTX back-end with NVPTX back-end in all places where Clang cares
NV_CONTRIB

llvm-svn: 157403
2012-05-24 17:43:12 +00:00
Peter Collingbourne c947aaeeae Teach Clang about the NVPTX backend.
llvm-svn: 157173
2012-05-20 23:28:41 +00:00
Peter Collingbourne f44bdf9c5f CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0.  This relies on address
space 0 being a unified address space.

llvm-svn: 157167
2012-05-20 21:08:35 +00:00
Sirish Pande 11ebc4ed1b Hexagon V5 FP support.
llvm-svn: 156567
2012-05-10 20:19:54 +00:00
Craig Topper eb590aa956 Enable AVX on AMD Bulldozer processors.
llvm-svn: 155900
2012-05-01 07:18:03 +00:00
Evgeniy Stepanov 94dc4c9783 Define __ANDROID__ macro on -androideabi targets.
llvm-svn: 155632
2012-04-26 12:08:09 +00:00
Craig Topper 5f365e94c3 Enable AVX/AVX2 for Sandy Bridge, Ivy Bridge, and Haswell CPUs.
llvm-svn: 155624
2012-04-26 07:31:30 +00:00
Chris Lattner 024e12df52 OpenBSD: Remove incorrect -pthread preprocessor define _POSIX_THREADS and replace
with _REENTRANT. Also remove undef _POSIX_THREADS in phread.h.

Patch by Brad Smith!

llvm-svn: 155535
2012-04-25 06:12:24 +00:00
Chandler Carruth 70ac923ebc Revert r155363, due to the underlying patches in LLVM causing regression
test suite failures.

llvm-svn: 155371
2012-04-23 18:25:40 +00:00
Sirish Pande 7039d0eaee Hexagon V5 (floating point) support in cfe.
llvm-svn: 155363
2012-04-23 17:48:57 +00:00
Chandler Carruth b8ae76037a Revert some Hexagon builtin commits to match reverts done to LLVM in
r155047. See the LLVM log for the primary motivation:
  http://llvm.org/viewvc/llvm-project?rev=155047&view=rev

Primary commit r154828:
  - Several issues were raised in review, and fixed in subsequent
    commits.
  - Follow-up commits also reverted, and which should be folded into the
    original before reposting:
    - r154837: Re-add the 'undef BUILTIN' thing to fix the build.
    - r154928: Fix build warnings, re-add (and correct) header and
      license
    - r154937: Typo fix.

Please resubmit this patch with the relevant LLVM resubmission.

llvm-svn: 155048
2012-04-18 21:32:25 +00:00
Simon Atanasyan 296a7bb49f MIPS: Followup to r154606. Expand list of accepted MIPS target features in the MipsTargetInfoBase::setFeatureEnabled() routine.
llvm-svn: 154998
2012-04-18 12:00:11 +00:00
Sirish Pande f02eebef2a Hexagon V5(Floating Point) support.
llvm-svn: 154828
2012-04-16 17:04:05 +00:00
Simon Atanasyan ce74e9d896 MIPS: Initialize MIPS CPU's name by default value.
Otherwise MipsTargetInfoBase::getDefaultFeatures() might return an invalid
features set with an empty feature name.

llvm-svn: 154606
2012-04-12 19:59:24 +00:00
Simon Atanasyan 26f19678b6 Move some MIPS target macro definitions from class Mips32TargetInfoBase
to the base class MipsTargetInfoBase. These macros are applicable for both
32/64-bits targets.

llvm-svn: 154116
2012-04-05 19:28:31 +00:00
Chad Rosier 1f0e52e361 [driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP.

-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.

rdar://11108618

llvm-svn: 154046
2012-04-04 20:39:32 +00:00
Eric Christopher b7e28ccb3d Add more constraint registers for mips.
Patch by Jack Carter. Testcase cleanup by me.

llvm-svn: 153921
2012-04-03 01:16:32 +00:00
Jim Grosbach 903e63fef3 ARM backend knows about cortex-m4. The front end should too.
llvm-svn: 153678
2012-03-29 19:53:34 +00:00
Jan Wen Voung 1d4c2d9a48 Define __LITTLE_ENDIAN__ for le32, since "le" stands for little endian.
Add a test for this too.

llvm-svn: 153616
2012-03-29 00:05:59 +00:00
David Chisnall b526e93d03 Fix the type of wchar_t on Solaris.
Patch by Dmitri Shubin!

llvm-svn: 153585
2012-03-28 18:04:14 +00:00
Eric Christopher 8b6d051ea2 Add better support for $fp and $sp for mips inline asm support.
Patch by Jack Carter.

llvm-svn: 153530
2012-03-27 19:56:11 +00:00
Akira Hatanaka 6976ec8551 Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.
Patch by Simon Atanasyan.

llvm-svn: 153348
2012-03-23 23:07:09 +00:00
Aaron Ballman bc9e04342d No longer defining LP64 in 64-bit builds on platforms which are not LP64.
llvm-svn: 152740
2012-03-14 20:50:57 +00:00
Roman Divacky 3ffe746ca8 Fix the long double to be of width/align 64. Rename va_list_test to
powerpc_types and add testing for the (long) double there.

llvm-svn: 152647
2012-03-13 19:20:17 +00:00
Roman Divacky 816dcd1777 Long double is just double on FreeBSD/{PPC,PPC64}.
llvm-svn: 152632
2012-03-13 16:53:54 +00:00
James Molloy a7139221f8 Use ZeroLengthBitfieldAlignment for AAPCS, as well as APCS-GNU.
llvm-svn: 152552
2012-03-12 09:14:10 +00:00
Benjamin Kramer 27402c61c8 TargetInfo: create less temporary strings.
llvm-svn: 152029
2012-03-05 15:10:44 +00:00
Hal Finkel 2690838227 Fix an ABI problem with ptrdiff_t and intptr_t on PPC32
ptrdiff_t on PPC32 on Linux, etc. should be int not long.
This does not matter for C, but it does matter for C++ because of
name mangling.

The preprocessor test has been changed accordingly.

llvm-svn: 151935
2012-03-02 20:54:36 +00:00
David Chisnall e04307e47c Add the Solaris support directory to the header search when using libc++.
Unconditionally define __C99FEATURES__ when using C++ on Solaris.  This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.

llvm-svn: 151889
2012-03-02 10:49:52 +00:00
David Chisnall 0c52c0f0fd Some more Solaris fixes. Now successfully building libc++ on Solaris with clang (and linking clang against it).
llvm-svn: 151632
2012-02-28 17:10:04 +00:00
David Chisnall 0c1941cb05 On Solaris, define some standard macros that the Solaris headers require in
order to not be broken (by Solaris standards).

llvm-svn: 150822
2012-02-17 18:35:11 +00:00
Eli Friedman 4286fba606 Set UserLabelPrefix and MCountName correctly for DragonFly BSD. Patch by Sascha Wildner.
Setting UserLabelPrefix correctly fixes PR11949.

llvm-svn: 150280
2012-02-10 23:02:29 +00:00
Dylan Noblesmith e27789991d Basic: import OwningPtr<> into clang namespace
llvm-svn: 149798
2012-02-05 02:12:40 +00:00
Bob Wilson 8e5acc5cc1 Use the new Triple::getMacOSXVersion function in another place.
I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

llvm-svn: 149455
2012-01-31 23:52:58 +00:00
Nico Weber 3435ede0ca Fix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.
Fixes PR11867. Patch from Jeremy Huddleston!

llvm-svn: 149334
2012-01-31 02:07:33 +00:00
Nico Weber 2dd5756bf1 Revert r149285, it breaks test/Preprocessor/init.c.
llvm-svn: 149301
2012-01-30 23:53:44 +00:00
Nico Weber aa11e6e28c Fix "long double" and __SIZE_TYPE__ on powerpc.
Fixes PR11867. Patch from Jeremy Huddleston!

llvm-svn: 149285
2012-01-30 22:25:29 +00:00
Douglas Gregor 0070c0bfbe Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.

Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.

llvm-svn: 149227
2012-01-30 06:38:25 +00:00
John McCall eed64c77d2 Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it.  We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

llvm-svn: 149186
2012-01-29 01:20:30 +00:00
Bob Wilson 19a2f2bcc0 Use defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.
llvm-svn: 149181
2012-01-28 18:02:29 +00:00
Bob Wilson a7a61e2701 Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455
ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

llvm-svn: 149086
2012-01-26 22:14:27 +00:00
Sebastian Pop 422377cfd3 rename -ccc-host-triple into -target
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
Anton Yartsev 68d773cb3d fix for PR11655
changes i64 alignment from 64 to 32 for powerpc-darwin

llvm-svn: 148345
2012-01-17 22:40:00 +00:00
David Blaikie 8a40f700e6 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
llvm-svn: 148292
2012-01-17 06:56:22 +00:00
Eli Friedman d749c6bf2e Revert r148138; it's causing test failures.
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop 86500280c6 remove assertions in the Hexagon backend specific clang driver
Patch from Jyotsna Verma:

I have made the changes to remove assertions in the Hexagon backend
specific clang driver. Instead of asserting on invalid arch name, it has
been modified to use the default value.

I have changed the implementation of the CPU flag validation for the
Hexagon backend. Earlier, the clang driver performed the check and
asserted on invalid inputs. In the new implementation, the driver passes
the last CPU flag (or sets to "v4" if not specified) to the compiler (and
also to the assembler and linker which perform their own check) instead of
asserting on incorrect values. This patch changes the setCPU function for
the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the
compiler to error out on incorrect CPU flag values.

llvm-svn: 148139
2012-01-13 20:37:10 +00:00
Sebastian Pop 9a8d528ddf rename -ccc-host-triple into -target
llvm-svn: 148138
2012-01-13 20:37:02 +00:00
Evgeniy Stepanov 48af2a9e66 Fix -mfpu parsing on ARM.
- Support gcc-compatible vfpv3 name in addition to vfp3.
- Support vfpv3-d16.
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions
  for those!).

llvm-svn: 147943
2012-01-11 11:21:31 +00:00
Benjamin Kramer 569f215771 Add definitions for AMD's bobcat (aka btver1)
llvm-svn: 147849
2012-01-10 11:50:18 +00:00
Benjamin Kramer edbc59a27e Enable POPCNT and LZCNT with sse4a.
llvm-svn: 147848
2012-01-10 11:50:13 +00:00
Benjamin Kramer e3b442d20c Factor the repetitive cpu macro definition into a helper function.
llvm-svn: 147847
2012-01-10 11:50:09 +00:00
Craig Topper 23b9219765 Merge AVX/AVX2 into the SSE level.
llvm-svn: 147771
2012-01-09 09:19:09 +00:00
Joerg Sonnenberger 1623714010 __FLT_EVAL_METHOD__ should be 1 on NetBSD/i386, since it defaults to
"double" rounding.

llvm-svn: 147669
2012-01-06 18:32:26 +00:00
Benjamin Kramer 6dced3b468 Penryn doesn't support sse4.2, don't enable it in the first place.
While the code took care of disabling the sse42 flag it didn't know
about popcnt. This broke -march=native on penryn.

llvm-svn: 147531
2012-01-04 14:36:57 +00:00
Craig Topper ffdb46ceef Add FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply sse3. Matches gcc behavior.
llvm-svn: 147370
2011-12-30 07:33:42 +00:00
Craig Topper 1de8348db7 Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
llvm-svn: 147340
2011-12-29 16:10:46 +00:00
Benjamin Kramer cf5014771d Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse disabled.
x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD
to "2".

llvm-svn: 147311
2011-12-28 15:47:06 +00:00
Craig Topper 22967d4a61 Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
llvm-svn: 147262
2011-12-25 05:06:45 +00:00
Eli Friedman 803acb3ff2 Add support for bitcasts to vector type in Evaluate.
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Nick Lewycky f243e0df95 Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don't
actually know about the other OSes on X86-32 besides Linux...

llvm-svn: 147034
2011-12-21 04:25:47 +00:00
Fariborz Jahanian 103ae5c48f objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832

llvm-svn: 146904
2011-12-19 21:06:15 +00:00
Craig Topper 865fff5d4c Add -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.
llvm-svn: 146835
2011-12-17 19:55:21 +00:00
Nick Lewycky f59e129c3b Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)

llvm-svn: 146762
2011-12-16 22:34:14 +00:00
Nick Lewycky c0a61734df Fix 80-column violation and whitespace. No functionality change.
llvm-svn: 146761
2011-12-16 22:32:39 +00:00
Eli Friedman 3715d1f435 gcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
llvm-svn: 146631
2011-12-15 02:15:56 +00:00
Tony Linthicum 76329bf83f Hexagon backend support
llvm-svn: 146413
2011-12-12 21:14:55 +00:00
Eli Friedman 83de51301a Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.

llvm-svn: 146206
2011-12-08 23:54:21 +00:00
Eric Christopher af6431077c Add support for AVX registers to clang inline asm. Add a small testcase
and update the Sema testcase with a register that we won't hit for a while
I hope.

Fixes rdar://10510405

llvm-svn: 145671
2011-12-02 02:12:16 +00:00
Eli Friedman bfd5addf4c When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing. Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.
llvm-svn: 145652
2011-12-02 00:11:43 +00:00
Benjamin Kramer 6bd51593ca Add support for AMD's bulldozer.
llvm-svn: 145606
2011-12-01 18:23:59 +00:00
Rafael Espindola a6416a7c73 Make our handling of MMX x SSE closer to what gcc does:
* Enabling sse enables mmx.
* Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
* The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.

llvm-svn: 145194
2011-11-27 20:00:43 +00:00
James Molloy c445be4b4b AAPCS compliance - 32-bit wchar_t should be unsigned for both aapcs and aapcs-linux.
Original behaviour of defining wchar_t as signed int has been kept for apcs-gnu as I don't have any spec for this to validate against.

llvm-svn: 145102
2011-11-23 13:35:08 +00:00
Douglas Gregor 7240a95282 Define some built-ins macros on mips32 platform, from Simon Atanasyan!
llvm-svn: 144189
2011-11-09 15:17:16 +00:00
Akira Hatanaka 8cc2e865bc Move definitions of SizeType and PtrDiffType to Mips32TargetInfoBase.
llvm-svn: 143775
2011-11-05 01:48:34 +00:00
Douglas Gregor 07216d174e Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!

llvm-svn: 143569
2011-11-02 20:52:01 +00:00
Anders Carlsson 2f1a6c3f01 In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.
llvm-svn: 143350
2011-10-31 16:27:11 +00:00
Roman Divacky ce253d89a2 Add support for sse4a and enable it for amdfam10 cpu.
llvm-svn: 143312
2011-10-30 13:47:56 +00:00
Roman Divacky 43eb6f8aeb Add support for amdfam10 cpu.
llvm-svn: 143305
2011-10-30 07:48:46 +00:00
Dan Gohman 93127aecb9 Remove the Blackfin backend.
llvm-svn: 142881
2011-10-25 00:06:12 +00:00
Dan Gohman 53bb0ff685 Remove the SystemZ backend.
llvm-svn: 142879
2011-10-24 23:48:52 +00:00
Akira Hatanaka c12a271b55 Make changes necessary for N32/64 ABI conformance.
- Size of long double is 16 bytes for both N32 and N64.
- Size of pointers and long is 8 bytes for N64.

llvm-svn: 142705
2011-10-22 00:07:27 +00:00
Benjamin Kramer 80ca407610 Use llvm::Triple's methods to parse FreeBSD version numbers.
Who could've thought that FreeBSD would ever reach version 10!
Patch from Dimitry Andric.

llvm-svn: 142349
2011-10-18 10:10:08 +00:00
Benjamin Kramer a518b22d6b Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.
This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

llvm-svn: 142076
2011-10-15 17:53:33 +00:00
Eli Friedman 4b72fddd99 Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Anton Korobeynikov 804dd056b3 Add target info for Linux on PPC & Sparc.
Patch by Hal Finkel!

llvm-svn: 141772
2011-10-12 09:30:58 +00:00
David Meyer bfdbb25af2 Allow regparm attribute for PNaCl target
llvm-svn: 141638
2011-10-11 03:12:01 +00:00
Lang Hames 4f4aa1a03a Fixed natural stack alignment for Linux x86-32. Thanks Eli.
llvm-svn: 141617
2011-10-11 00:52:51 +00:00
Lang Hames 60b2b2ee0d Update target data strings for ARM and X86 to include the natural stack
alignment parameter "S<size>" that was introduced in r141599.

llvm-svn: 141601
2011-10-10 23:44:43 +00:00
Eli Friedman 1f19100451 Add address spaces for TCE target. Patch by Pekka Jääskeläinen.
llvm-svn: 141390
2011-10-07 19:51:42 +00:00
Justin Holewinski 794c205e52 PTX: Add some basic support for OpenCL address spaces
llvm-svn: 141008
2011-10-03 17:28:37 +00:00
Chandler Carruth 3270e2619e Fix a typo spotted by Jonathan Sauer.
llvm-svn: 140708
2011-09-28 18:17:30 +00:00
Chandler Carruth 7d8241cf4f Attempt to silence the GCC -Wreturn-type warning...
llvm-svn: 140693
2011-09-28 10:49:06 +00:00
Chandler Carruth cd99bad4ac Generate tests for all of the x86 SIMD instruction feature set
predefines based on the output of GCC as well as the CPU predefines.

Invert tests for __AVX__, Clang's AVX feature is hard coded off still.

Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).

Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).

llvm-svn: 140692
2011-09-28 10:36:46 +00:00
Chandler Carruth 5d0feef373 Fix a think-o on my part that got enshrined in a FIXME by setting up the
__tune_...__ define as well.

llvm-svn: 140690
2011-09-28 09:54:11 +00:00
Chandler Carruth 3f7ed950fd Move some of the defines down to more natural locations, consolidating
the target identifying macros at the top, including subtarget macros.

llvm-svn: 140689
2011-09-28 09:54:07 +00:00
Chandler Carruth 6e20c2bd35 Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.

llvm-svn: 140688
2011-09-28 09:45:08 +00:00
Chandler Carruth df5f48ac99 Simplify the control flow for predefined macro selection by using
fallthrough now that we're working with a switch. Also remove a dubious
"feature" regarding k6 processors and 3dnow and leave a fixme... Not
that anyone is likely to care about correct tuning for k6 processors
with and w/o 3dnow...

llvm-svn: 140687
2011-09-28 09:45:05 +00:00
Chandler Carruth 212334f7ab Switch the X86TargetInfo object from a string representation of the
selected CPU model to the enumeration. This parses the string
representation once using a StringSwitch on SetCPU. It returns an error
for strings which are not recognized (yay!). Finally it replaces
ridiculous if-chains with switches that cover all enumerators.

The last change required adding several missing entries to the features
function. These were obvious on inspection. Yay for a pattern that gives
warnings when we miss one.

No new test cases yet, as I want to get the 64-bit errors working first.
I'll then start fleshing out the testing more. Currently I'm primarily
testing on Linux, but I'm hoping check whether there are interesting
differences on darwin before long...

llvm-svn: 140685
2011-09-28 08:55:37 +00:00
Chandler Carruth 3ac7aeaacb Introduce an enumeration for the x86 CPUs recognized by Clang. I've
tried to give these nice doxyments, but if I've gotten any of my history
wrong, please chime in.

llvm-svn: 140684
2011-09-28 08:55:34 +00:00
Chandler Carruth 8bdcf9ea12 Clean up a bit of the uses of CPU in the TargetInfo classes. This makes
it an error if a CPU is provided for a target that doesn't implement
logic handling CPU settings, to match the ABI settings. It also removes
the CPU parameter from the getDefaultFeatures method. This parameter was
always filled in with the same value as setCPU was called with, and at
this point every single target implementation that referenced the CPU
within this function has needed to store the CPU via setCPU anyways in
order to implement other interface points.

llvm-svn: 140683
2011-09-28 05:56:05 +00:00
Chandler Carruth 5ac1e8e6b1 Begin fixing Clang's predefined macros for various architectures. This
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.

This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.

Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.

llvm-svn: 140673
2011-09-28 02:59:25 +00:00
David Blaikie 9c902b5502 Rename Diagnostic to DiagnosticsEngine as per issue 5397
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie 76bd3c80d4 Fix missing includes for llvm_unreachable
llvm-svn: 140368
2011-09-23 05:35:21 +00:00
David Blaikie 83d382b1ca Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Justin Holewinski 0542df5198 PTX: Clean up target options code
llvm-svn: 140320
2011-09-22 17:57:40 +00:00
Akira Hatanaka bef1745c9c Define Mips64 TargetInfo classes.
llvm-svn: 140174
2011-09-20 19:21:49 +00:00
Akira Hatanaka f6da331e15 Clean up TargetInfo class hierarchy. Define a base class from which TargetInfos
of Mips32 big and little endian derive.

llvm-svn: 140170
2011-09-20 19:00:23 +00:00
Ivan Krasin 96a806199d Clarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
change __builtin_va_list to from a structure to int[4] (same alignment
and size, but with a simpler representation). Patch by David Meyer!

llvm-svn: 140144
2011-09-20 14:56:54 +00:00
Francois Pichet 0706d203cf Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.
Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.

llvm-svn: 139987
2011-09-17 17:15:52 +00:00
Justin Holewinski aa78b235a5 PTX: Define target options
llvm-svn: 139789
2011-09-15 12:13:38 +00:00
Akira Hatanaka f0bbc1c8fd Add comment.
llvm-svn: 139700
2011-09-14 17:24:05 +00:00
Akira Hatanaka 66f6b096f8 O64 will not be supported.
llvm-svn: 139655
2011-09-13 22:47:52 +00:00
Akira Hatanaka 58ad90fa68 mips*-*-psp is no longer supported as a target.
llvm-svn: 139654
2011-09-13 22:46:13 +00:00