Commit Graph

17156 Commits

Author SHA1 Message Date
Oscar Fuentes 5ed962656c Move library stuff out of the toplevel CMakeLists.txt file.
llvm-svn: 125968
2011-02-18 22:06:14 +00:00
Chris Lattner 0e125bb4d0 introduce a new TargetLibraryInfo pass, which transformations can use to
query about available library functions.  For now this just has 
memset_pattern16, which exists on darwin, but it can be extended for a 
bunch of other things in the future.

llvm-svn: 125965
2011-02-18 21:50:34 +00:00
Bruno Cardoso Lopes cdd20affec Fix style and a typo
llvm-svn: 125949
2011-02-18 19:49:06 +00:00
Bruno Cardoso Lopes 9cd43977c3 Add assembly parsing support for "msr" and also fix its encoding. Also add
testcases for the disassembler to make sure it still works for "msr".

llvm-svn: 125948
2011-02-18 19:45:59 +00:00
Chris Lattner 0281731cc2 add a poor division by constant case.
llvm-svn: 125832
2011-02-18 05:35:49 +00:00
Joerg Sonnenberger f69c80bac2 Recognize monitor/mwait with explicit register arguments
llvm-svn: 125805
2011-02-18 00:48:11 +00:00
Joerg Sonnenberger 889a508157 Recognize leavel and leaveq aliases for leave.
Validate encoding of leave in 64bit mode.

llvm-svn: 125795
2011-02-17 23:36:39 +00:00
David Greene 3a2b508e8f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.

llvm-svn: 125765
2011-02-17 19:18:59 +00:00
Dan Gohman f0f8e14370 The labyrinthine X86 backend no longer appears to require
these patterns.

llvm-svn: 125759
2011-02-17 18:50:19 +00:00
NAKAMURA Takumi 4c14a5cc2c Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

llvm-svn: 125747
2011-02-17 12:24:17 +00:00
NAKAMURA Takumi 0544fe7287 Fix whitespace.
llvm-svn: 125746
2011-02-17 12:23:50 +00:00
Duncan Sands 491eb276a7 This has been implemented.
llvm-svn: 125738
2011-02-17 08:16:56 +00:00
Chris Lattner 727eebee58 add some notes on compares + binops. Remove redundant entries.
llvm-svn: 125702
2011-02-17 01:43:46 +00:00
Chris Lattner 28bf91f78e Add a few missed xforms from GCC PR14753
llvm-svn: 125681
2011-02-16 19:16:34 +00:00
Stuart Hastings 81c4306005 Swap VT and DebugLoc operands of getExtLoad() for consistency with
other getNode() methods.  Radar 9002173.

llvm-svn: 125665
2011-02-16 16:23:55 +00:00
Eli Friedman c8fb2557b9 Remove outdated README entry.
llvm-svn: 125660
2011-02-16 07:41:19 +00:00
Eli Friedman 0254c4c01b Remove outdated README entry.
llvm-svn: 125659
2011-02-16 07:18:18 +00:00
Eli Friedman 5f75515e5d Update README entry.
llvm-svn: 125658
2011-02-16 07:17:44 +00:00
Rafael Espindola 58ac6e1677 Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
llvm-svn: 125629
2011-02-16 01:08:29 +00:00
Evan Cheng 4a8c43fe6d Some single precision VFP instructions may be executed on NEON pipeline, but not double precision ones.
llvm-svn: 125624
2011-02-16 00:35:02 +00:00
Jakob Stoklund Olesen d9c80ef837 Teach ARMLoadStoreOptimizer to remove kill flags from merged instructions as well.
This is necessary to avoid a crash in certain tangled situations where a kill
flag is first correctly moved to a merged instruction, and then needs to be
moved again:

  STR %R0, a...
  STR %R0<kill>, b...

First becomes:

  STR %R0, b...
  STM a, %R0<kill>, ...

and then:

  STM a, %R0, ...
  STM b, %R0<kill>, ...

We can now remove the kill flag from the merged STM when needed. 8960050.

llvm-svn: 125591
2011-02-15 19:51:58 +00:00
Duncan Sands 75b5d27b84 Spelling fix: consequtive -> consecutive.
llvm-svn: 125563
2011-02-15 09:23:02 +00:00
Bob Wilson 9cd0b581b8 Remove unused bitvectors that record ARM callee-saved registers.
llvm-svn: 125534
2011-02-14 23:40:38 +00:00
Bruno Cardoso Lopes 57a522f30d A fail to match coprocessor number and register number must fail instead of assert.
llvm-svn: 125521
2011-02-14 21:10:33 +00:00
Bruno Cardoso Lopes 90d1dfe4c6 Fix encoding and add parsing support for the arm/thumb CPS instruction:
- Add custom operand matching for imod and iflags.
- Rename SplitMnemonicAndCC to SplitMnemonic since it splits more than CC
  from mnemonic.
- While adding ".w" as an operand, don't change "Head" to avoid passing the
  wrong mnemonic to ParseOperand.
- Add asm parser tests.
- Add disassembler tests just to make sure it can catch all cps versions.

llvm-svn: 125489
2011-02-14 13:09:44 +00:00
Chris Lattner 46c01a30f4 Enhance ComputeMaskedBits to know that aligned frameindexes
have their low bits set to zero.  This allows us to optimize
out explicit stack alignment code like in stack-align.ll:test4 when
it is redundant.

Doing this causes the code generator to start turning FI+cst into
FI|cst all over the place, which is general goodness (that is the
canonical form) except that various pieces of the code generator
don't handle OR aggressively.  Fix this by introducing a new
SelectionDAG::isBaseWithConstantOffset predicate, and using it
in places that are looking for ADD(X,CST).  The ARM backend in
particular was missing a lot of addressing mode folding opportunities
around OR.

llvm-svn: 125470
2011-02-13 22:25:43 +00:00
Reid Kleckner 2406b7d179 Add encodings and mnemonics for FXSAVE64 and FXRSTOR64.
These are just FXSAVE and FXRSTOR with REX.W prefixes.  These versions use
64-bit pointer values instead of 32-bit pointer values in the memory map they
dump and restore.

llvm-svn: 125446
2011-02-12 23:24:13 +00:00
Venkatraman Govindaraju 0c1f65317b Prevent IMPLICIT_DEF/KILL to become a delay filler instruction in SPARC backend.
llvm-svn: 125444
2011-02-12 19:02:33 +00:00
Benjamin Kramer 69affe6a94 Add a note about SSE4.1 roundss/roundsd.
llvm-svn: 125438
2011-02-12 17:58:16 +00:00
Jim Grosbach 861e49ce3b AsmMatcher custom operand parser failure enhancements.
Teach the AsmMatcher handling to distinguish between an error custom-parsing
an operand and a failure to match. The former should propogate the error
upwards, while the latter should continue attempting to parse with
alternative matchers.

Update the ARM asm parser accordingly.

llvm-svn: 125426
2011-02-12 01:34:40 +00:00
Nate Begeman fa62d50481 Implement sdiv & udiv for <4 x i16> and <8 x i8> NEON vector types.
This avoids moving each element to the integer register file and calling __divsi3 etc. on it.

llvm-svn: 125402
2011-02-11 20:53:29 +00:00
Rafael Espindola 34b59389ea Remove std::string version of getNameWithPrefix.
llvm-svn: 125363
2011-02-11 05:23:09 +00:00
Evan Cheng 2da1c95993 Fix buggy fcopysign lowering.
This
define float @foo(float %x, float %y) nounwind readnone {
entry:
  %0 = tail call float @copysignf(float %x, float %y) nounwind readnone
  ret float %0
}

Was compiled to:
    vmov     s0, r1
    bic      r0, r0, #-2147483648
    vmov     s1, r0
    vcmpe.f32    s0, #0
    vmrs         apsr_nzcv, fpscr
    it           lt
    vneglt.f32   s1, s1
    vmov         r0, s1
    bx           lr

This fails to copy the sign of -0.0f because it's lost during the float to int
conversion. Also, it's sub-optimal when the inputs are in GPR registers.

Now it uses integer and + or operations when it's profitable. And it's correct!
    lsrs    r1, r1, #31
    bfi     r0, r1, #31, #1
    bx      lr
rdar://8984306

llvm-svn: 125357
2011-02-11 02:28:55 +00:00
David Greene 79827a5a26 [AVX] Implement 256-bit vector lowering for SCALAR_TO_VECTOR. This
largely completes support for 128-bit fallback lowering for code that
is not 256-bit ready.

llvm-svn: 125315
2011-02-10 23:11:29 +00:00
Bruno Cardoso Lopes 61a61e9da3 Fix a lot of o32 CC issues and add a bunch of tests. Patch by Akira Hatanaka with some small modifications by me.
llvm-svn: 125292
2011-02-10 18:05:10 +00:00
David Greene ce318e4958 [AVX] Implement 256-bit vector lowering for EXTRACT_VECTOR_ELT.
llvm-svn: 125284
2011-02-10 16:57:36 +00:00
Che-Liang Chiou 84fde9ef2b ptx: add passing parameter to kernel functions
llvm-svn: 125279
2011-02-10 12:01:24 +00:00
David Greene b36195ab26 [AVX] Implement 256-bit vector lowering for INSERT_VECTOR_ELT.
llvm-svn: 125187
2011-02-09 15:32:06 +00:00
Richard Osborne d9dde78c27 Add intrinsic for setc instruction on the XCore.
llvm-svn: 125186
2011-02-09 13:22:12 +00:00
Owen Anderson 4ebf471c9b Revert both r121082 (which broke a bunch of constant pool stuff) and r125074 (which worked around it). This should get us back to the old, correct behavior, though it will make the integrated assembler unhappy for the time being.
llvm-svn: 125127
2011-02-08 22:39:40 +00:00
David Greene 10b0db1d5f [AVX] Implement BUILD_VECTOR lowering for 256-bit vectors. For
anything but the simplest of cases, lower a 256-bit BUILD_VECTOR by
splitting it into 128-bit parts and recombining.

llvm-svn: 125105
2011-02-08 19:04:41 +00:00
Evan Cheng 558ccef74f Temporary workaround for a bad bug introduced by r121082 which replaced
t2LDRpci with t2LDRi12.
There are a couple of problems with this.
1. The encoding for the literal and immediate constant are different.
   Note bit 7 of the literal case is 'U' so it can be negative.
2. t2LDRi12 is now narrowed to tLDRpci before constant island pass is run.
   So we end up never using the Thumb2 instruction, which ends up creating a
   lot more constant islands.

llvm-svn: 125074
2011-02-08 03:07:03 +00:00
Bruno Cardoso Lopes 36dd43fda6 Add support for parsing dmb/dsb instructions
llvm-svn: 125055
2011-02-07 22:09:15 +00:00
Bruno Cardoso Lopes c9253b4deb Remove the MCR asm parser hack and start using the custom target specific asm
parsing of operands introduced in r125030. As a small note, besides using a more
generic approach we can also have more descriptive output when debugging
llvm-mc, example:

mcr  p7, #1, r5, c1, c1, #4

note: parsed instruction:
  ['mcr', <ARMCC::al>,
          <coprocessor number: 7>,
          1,
          <register 73>,
          <coprocessor register: 1>,
          <coprocessor register: 1>,
          4]
llvm-svn: 125052
2011-02-07 21:41:25 +00:00
David Greene 79651c527b [AVX] Insert/extract subvector lowering support. This includes a
couple of utility functions that will be used in other places for more
AVX lowering.

llvm-svn: 125029
2011-02-07 19:36:54 +00:00
Jason W Kim e5ce4c9bcd ARM/MC/ELF Lowercase .cpu attributes in .s, but make them uppercase in .o
llvm-svn: 125025
2011-02-07 19:07:11 +00:00
Evan Cheng e1a4ac9b5b Fix an obvious typo which caused an isel assertion. rdar://8964854.
llvm-svn: 125023
2011-02-07 18:50:47 +00:00
Bob Wilson 06fce87c4a Add codegen support for using post-increment NEON load/store instructions.
The vld1-lane, vld1-dup and vst1-lane instructions do not yet support using
post-increment versions, but all the rest of the NEON load/store instructions
should be handled now.

llvm-svn: 125014
2011-02-07 17:43:21 +00:00
Bob Wilson a609b8954e Change VLD3/4 and VST3/4 for quad registers to not update the address register.
These operations are expanded to pairs of loads or stores, and the first one
uses the address register update to produce the address for the second one.
So far, the second load/store has also updated the address register, just
for convenience, since that output has never been used.  In anticipation of
actually supporting post-increment updates for these operations, this changes
the non-updating operations to use a non-updating load/store for the second
instruction.

llvm-svn: 125013
2011-02-07 17:43:15 +00:00
Bob Wilson 42e67b5f73 Fix some NEON instruction itineraries.
llvm-svn: 125012
2011-02-07 17:43:12 +00:00