1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

13900 Commits

Author SHA1 Message Date
Kevin Enderby
8d8cb5c491 Fixed the SS42AI template for the SSE 4.2 instructions with TA prefix so it does
not get an "Unknown immediate size" assert failure when used.  All instructions 
of this form have an 8-bit immediate.  Also added a test case of an example
instruction that is of this form.

llvm-svn: 99435
2010-03-24 22:28:42 +00:00
Nate Begeman
c45fc4a137 Per chris's request, add some comments.
llvm-svn: 99434
2010-03-24 22:19:06 +00:00
Johnny Chen
f53b3e5b12 Trivial formating change.
llvm-svn: 99428
2010-03-24 21:25:07 +00:00
Nate Begeman
820b07ed10 BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts.
llvm-svn: 99423
2010-03-24 20:49:50 +00:00
Johnny Chen
3e5750fc46 Reverted r99326 which added NVdVmVCVTFrm, and later renamed to NVCVTFrm.
NVCVTFrm will later be used to describe "vcvt with fractional bits".

llvm-svn: 99415
2010-03-24 19:47:14 +00:00
Johnny Chen
31c01c1811 Reverted r99376. The disassembler will deal with the 2-reg format of these two
N3VX instructions using special case code.

llvm-svn: 99409
2010-03-24 18:46:34 +00:00
Jim Grosbach
7dc50db8fa tweak the arm if conversion heuristic
llvm-svn: 99402
2010-03-24 16:15:14 +00:00
Johnny Chen
d31726dba1 Mark VMOVDneon and VMOVQ as having the N2RegFrm form to help the disassembler.
llvm-svn: 99376
2010-03-24 01:29:25 +00:00
Chris Lattner
a44c023751 Switch INC8r to defining its pattern in terms of X86inc_flag
and defining the add pattern with Pat<>, eliminating a use of
parallel.

llvm-svn: 99375
2010-03-24 01:02:12 +00:00
Johnny Chen
dabf739480 Renamed NVdVmImmFrm and NVdVmVCVTFrm to the more proper N2RegFrm and NVCVTFrm,
respectively, and add some more comment.

llvm-svn: 99373
2010-03-24 00:57:50 +00:00
Chris Lattner
36f990dc18 switch SDTBinaryArithWithFlags to be a multiple-result node as well.
llvm-svn: 99370
2010-03-24 00:49:29 +00:00
Chris Lattner
0d53d0a634 Switch SDTUnaryArithWithFlags to being modeled as a two-result
ISD node.  The only change in the generated isel code are comments
like:

<                 // Src: (X86dec_flag:i16 GR16:i16:$src)
---
>                 // Src: (X86dec_flag:i16:i32 GR16:i16:$src)

because now it knows that X86dec_flag returns both an i16 (for the result)
and an i32 (for EFLAGS) in this case.  Wewt.

llvm-svn: 99369
2010-03-24 00:47:47 +00:00
Chris Lattner
e42b80792e remove 64-bit or_is_add parallels.
llvm-svn: 99360
2010-03-24 00:16:52 +00:00
Chris Lattner
6a8da47891 remove useless or_is_add parallel's.
llvm-svn: 99359
2010-03-24 00:15:23 +00:00
Chris Lattner
f468453934 reduce nesting.
llvm-svn: 99358
2010-03-24 00:12:57 +00:00
Jim Grosbach
b19d22fcae try being more permissive for if-conversion on ARM V7. see what the nightly
test run permformance numbers say as to whether it helps.

llvm-svn: 99355
2010-03-24 00:03:13 +00:00
Jakob Stoklund Olesen
1dba4a4389 Revert "Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings."
This reverts commit 99345. It was breaking buildbots.

llvm-svn: 99352
2010-03-23 23:48:51 +00:00
Chris Lattner
4eac41e12e [llvm_void_ty] is no longer needed for result types,
just use an empty result list.

llvm-svn: 99346
2010-03-23 23:46:07 +00:00
Jakob Stoklund Olesen
9df76f18b4 Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
This is work in progress. So far, SSE execution domain tables are added to
X86InstrInfo, and a skeleton pass is enabled with -sse-domain-fix.

llvm-svn: 99345
2010-03-23 23:14:44 +00:00
Johnny Chen
b7f2a26117 Renamed NVdImmFrm to N1RegModImmFrm.
llvm-svn: 99344
2010-03-23 23:09:14 +00:00
Johnny Chen
d97eb200cf Fix typo in the comment for N3VX class.
llvm-svn: 99328
2010-03-23 21:35:03 +00:00
Johnny Chen
8249bce25e Add comment.
llvm-svn: 99327
2010-03-23 21:30:12 +00:00
Johnny Chen
415ce90919 Add New NEON Format NVdVmVCVTFrm.
Converted some of the NEON vcvt instructions to this format.

llvm-svn: 99326
2010-03-23 21:25:38 +00:00
Johnny Chen
81fb570fda Add New NEON Format NVdVmImmFrm.
llvm-svn: 99322
2010-03-23 20:40:44 +00:00
Evan Cheng
e6099e3382 Teach isSafeToClobberEFLAGS to ignore dbg_value's. We need a MachineBasicBlock::iterator that does this automatically?
llvm-svn: 99320
2010-03-23 20:35:45 +00:00
Bob Wilson
195c570fd3 Fix VLDMQ and VSTMQ instructions to use the correct encoding and address modes.
These instructions are only needed for codegen, so I've removed all the
explicit encoding bits for now; they should be set in the same way as the for
VLDMD and VSTMD whenever we add encodings for VFP.  The use of addrmode5
requires that the instructions be custom-selected so that the number of
registers can be set in the AM5Opc value.

llvm-svn: 99309
2010-03-23 18:54:46 +00:00
Bob Wilson
672147e9a2 Fix bad indentation, 80-column violations, and trailing whitespace.
llvm-svn: 99295
2010-03-23 17:23:59 +00:00
Johnny Chen
00ac54b896 Add New NEON Format NVdImmFrm.
Ref: A7.4.6 One register and a modified immediate value.

llvm-svn: 99288
2010-03-23 16:43:47 +00:00
Bob Wilson
8ba51dc0bd Rename some instructions to match the corresponding NEON opcode.
llvm-svn: 99266
2010-03-23 06:26:18 +00:00
Bob Wilson
58c4740582 Change VST1 instructions for loading Q register values to operate on pairs
of D registers.  Add a separate VST1q instruction with a Q register
source operand for use by storeRegToStackSlot.

llvm-svn: 99265
2010-03-23 06:20:33 +00:00
Bob Wilson
2764399dd8 Change VLD1 instructions for loading Q register values to operate on pairs
of D registers.  Add a separate VLD1q instruction with a Q register
destination operand for use by loadRegFromStackSlot.

llvm-svn: 99261
2010-03-23 05:25:43 +00:00
Daniel Dunbar
47743ae59a MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar
b33d212057 MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
llvm-svn: 99248
2010-03-23 02:36:58 +00:00
Daniel Dunbar
1595ebfb4b MC: Add TargetAsmBackend::RelaxInstruction callback, and custom X86 implementation.
llvm-svn: 99245
2010-03-23 01:39:09 +00:00
Bob Wilson
0741acde00 Rename one more NEON instruction that I missed earlier.
llvm-svn: 99201
2010-03-22 20:31:39 +00:00
Bob Wilson
80b4f21ab7 Regroup some instructions. No functional change.
llvm-svn: 99192
2010-03-22 18:22:06 +00:00
Bob Wilson
f23a45e151 Rename some VLD1/VST1 instructions to match the implementation, i.e., the
corresponding NEON instructions, instead of operation they are currently
used for.

llvm-svn: 99189
2010-03-22 18:13:18 +00:00
Bob Wilson
8ff1029669 Remove some redundant instruction classes.
llvm-svn: 99187
2010-03-22 18:02:38 +00:00
Bob Wilson
0e5d42fb54 Refactor instruction encoding arguments for VLDnLN/VSTnLN classes to
specify encoding bits in arguments instead of "let" expressions.

llvm-svn: 99185
2010-03-22 16:43:10 +00:00
Jakob Stoklund Olesen
2b348bdbcd Completely remove Blackfin patterns that thought JustCC was i1.
Thanks, Chris!

llvm-svn: 99183
2010-03-22 16:30:04 +00:00
Jeffrey Yasskin
cf13a6f8bb Don't leak a MachineInstruction from Thumb1InstrInfo::restoreCalleeSavedRegisters.
llvm-svn: 99182
2010-03-22 16:13:21 +00:00
Daniel Dunbar
754ec15462 MC/X86: Fix an MCOperand link, when we parsing shrld $1,%eax and friends; I believe this fixes the last memory leaks under test/MC.
llvm-svn: 99102
2010-03-20 22:36:38 +00:00
Daniel Dunbar
2c99d47702 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
llvm-svn: 99097
2010-03-20 22:36:22 +00:00
Bob Wilson
e5614d6b2d pr6652: Use LDM to restore PC to the return address on ARMv4.
Patch by John Tytgat!

llvm-svn: 99096
2010-03-20 22:20:40 +00:00
Bob Wilson
73d7323c91 Re-commit r98683 ("remove redundant writeback flag from ARM address mode 6")
with changes to add a separate optional register update argument.  Change all
the NEON instructions with address register writeback to use it.

llvm-svn: 99095
2010-03-20 22:13:40 +00:00
Bob Wilson
c0f7724ecd Add instruction variants for VST2, VST3, and VST4 "store-lane" operations with
address register writeback.

llvm-svn: 99094
2010-03-20 21:57:36 +00:00
Bob Wilson
076aa52a4f Add variants of VST2, VST3 and VST4 with address register writeback, and
rewrite the existing VST3 and VST4 instructions to use the same classes as
the others.

llvm-svn: 99093
2010-03-20 21:45:18 +00:00
Bob Wilson
7578eb20da Add instructions for double-spaced VST3 and VST4 without address register
writeback, and refactor the existing double-spaced VST2 instructions.
These are only for the disassembler since codegen doesn't use them, at
least for now.

llvm-svn: 99090
2010-03-20 21:15:48 +00:00
Bob Wilson
1106af1257 Add VST1 instructions with address register writeback.
llvm-svn: 99083
2010-03-20 20:54:36 +00:00
Bob Wilson
88757e6720 Add instruction variants for VLD2, VLD3, and VLD4 "load-lane" operations with
address register writeback.

llvm-svn: 99082
2010-03-20 20:47:18 +00:00
Bob Wilson
e70bdcb2a7 Tidy some more comments and whitespace.
llvm-svn: 99081
2010-03-20 20:39:53 +00:00
Bob Wilson
7dacf6bb70 Add variants of VLD2, VLD3 and VLD4 with address register writeback, and
rewrite the existing VLD3 and VLD4 instructions to use the same classes as
the others.

llvm-svn: 99080
2010-03-20 20:10:51 +00:00
Bob Wilson
40ae450fb5 Tidy some comments and whitespace for consistency.
llvm-svn: 99078
2010-03-20 19:57:03 +00:00
Bob Wilson
a98f30a3a2 Rename some instructions for consistency and sanity: use "_UPD" suffix for
load/stores with address register writeback, and use "odd" suffix to distinguish
instructions to access odd numbered registers (instead of "a" and "b").
No functional changes.

llvm-svn: 99066
2010-03-20 18:35:24 +00:00
Bob Wilson
d275bb2338 Add instructions for double-spaced VLD3 and VLD4 without address register
writeback, and refactor the existing double-spaced VLD2 instructions.
These are only for the disassembler since codegen doesn't use them, at
least for now.

llvm-svn: 99065
2010-03-20 18:14:26 +00:00
Bob Wilson
045d2c548a Add VLD1 instructions with address register writeback.
llvm-svn: 99062
2010-03-20 17:59:03 +00:00
Benjamin Kramer
d621aa79d2 PIC16: Simplify code by using a std::set<std::string> instead of a sorted & uniqued std::list of leaked char*.
llvm-svn: 99061
2010-03-20 17:41:18 +00:00
Bob Wilson
3d0c2e0424 Revert the rest of 98679.
--- Reverse-merging r98679 into 'lib/Target/ARM/ARMInstrVFP.td':
U    lib/Target/ARM/ARMInstrVFP.td

llvm-svn: 99049
2010-03-20 06:34:02 +00:00
Bob Wilson
79c77c16be Fix a very bad typo. Since the register number was off by one, the ARM
load/store optimizer would incorrectly think that registers D26 and D28
were consecutive and would generate a VLDM instruction to load them.
The assembler was not convinced.

llvm-svn: 99043
2010-03-20 06:05:13 +00:00
Evan Cheng
011705c6b8 If call result is in ST0 and it is not being passed to the caller's
caller, then it is not safe to optimize the call into a sibcall since
the call result has to be popped off the x87 stack.

llvm-svn: 99032
2010-03-20 02:58:15 +00:00
Johnny Chen
233a7cdda6 Add NLdStFrm Format.
llvm-svn: 99014
2010-03-20 00:17:00 +00:00
Johnny Chen
8f2103ae78 Revert r98679. The disassembler will be updated to depend on the existence of
IndexModeUpd and then populates the Inst{21}=1 while populating the instructions
for disassembly.

llvm-svn: 99013
2010-03-19 23:50:27 +00:00
Bob Wilson
9501c478f7 Revert this change, since it was causing ARM performance regressions.
--- Reverse-merging r98889 into '.':
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/ARMISelLowering.h
U    lib/Target/ARM/ARMInstrInfo.td
U    lib/Target/ARM/ARMInstrVFP.td
U    lib/Target/ARM/ARMISelLowering.cpp
U    lib/Target/ARM/ARMInstrFormats.td

llvm-svn: 99010
2010-03-19 22:51:32 +00:00
Chris Lattner
3634b075ee remove the patterns that I commented out in r98930, Dan verified
that they are dead.

llvm-svn: 99000
2010-03-19 21:43:36 +00:00
Kevin Enderby
766909ae3b Fixed the encoding problems of the crc32 instructions. All had the Operand size
override prefix and only the r/m16 forms should have had that.  Also for variant
one, the AT&T syntax, added suffixes to all forms.  Also added the missing
64-bit form for 'CRC32 r64, r/m8'.  Plus added test cases for all forms and
tweaked one test case to add the needed suffixes.

llvm-svn: 98980
2010-03-19 20:04:42 +00:00
Daniel Dunbar
f803121396 MC/X86: Rename alternate spellings of {ADD64,CMP64} and mark as "code gen only" so they don't get selected by the asm matcher.
llvm-svn: 98972
2010-03-19 18:07:48 +00:00
Johnny Chen
fe68cb6758 Renumber LdStExFrm from 28 to 11 and shift the existing format values to make
room for it.  This is in preparation for another patch which is adding NEON
subformats to facilitate disassembly.

llvm-svn: 98967
2010-03-19 17:39:00 +00:00
Daniel Dunbar
c687bf7cb4 MC: Add TargetAsmBackend::createObjectWriter.
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF.

llvm-svn: 98955
2010-03-19 10:43:26 +00:00
Daniel Dunbar
7252b48af1 MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
llvm-svn: 98954
2010-03-19 10:43:23 +00:00
Daniel Dunbar
287ff291e3 MC: Add TargetAsmBackend::isVirtualSection hook.
llvm-svn: 98950
2010-03-19 09:29:03 +00:00
Daniel Dunbar
3444d755d2 MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target specific not object writer specific task.
llvm-svn: 98947
2010-03-19 09:28:12 +00:00
Jeffrey Yasskin
7856d27d9a Remove a memory leak from the CBackend.
llvm-svn: 98941
2010-03-19 07:06:46 +00:00
Chris Lattner
896b393fab set SDNPVariadic on nodes throughout the rest of the targets that
need them.

llvm-svn: 98937
2010-03-19 05:33:51 +00:00
Jeffrey Yasskin
df8ee9a65b Remove a memory leak from ThumbTargetMachine.
llvm-svn: 98936
2010-03-19 05:25:28 +00:00
Chris Lattner
6b395fca87 add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.

llvm-svn: 98934
2010-03-19 05:07:09 +00:00
Chris Lattner
fe2e2b9e57 remove some damaged sign extend patterns that can never match.
llvm-svn: 98932
2010-03-19 04:53:47 +00:00
Chris Lattner
72e94856ab disable some illegal blackfin patterns. sext from i32 to i32 can never
match.  Jakob, please take a look when you get a chance.

llvm-svn: 98931
2010-03-19 04:53:21 +00:00
Chris Lattner
9ae31faad2 comment out a bunch of parallel store patterns that apparently
can't match or just have no testcases.  Will remove after 
confirmation from dan that they really are dead.

llvm-svn: 98930
2010-03-19 04:14:21 +00:00
Daniel Dunbar
12aef7c1a8 Fix -Asserts warnings.
llvm-svn: 98928
2010-03-19 03:18:23 +00:00
Daniel Dunbar
3ef39d497f X86: Fix encoding for TEST64rr.
llvm-svn: 98919
2010-03-19 01:15:03 +00:00
Chris Lattner
938747fc7f Now that tblgen can handle matching implicit defs of instructions
to input patterns, we can fix X86ISD::CMP and X86ISD::BT as taking
two inputs (which have to be the same type) and *returning an i32*.
This is how the SDNodes get made in the graph, but we weren't able
to model it this way due to deficiencies in the pattern language.

Now we can change things like this:

 def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
-                  [(X86cmp RFP80:$lhs, RFP80:$rhs),
-                   (implicit EFLAGS)]>; // CC = ST(0) cmp ST(i)
+                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>;

and fix terrible crimes like this:

-def : Pat<(parallel (X86cmp GR8:$src1, 0), (implicit EFLAGS)),
+def : Pat<(X86cmp GR8:$src1, 0),
           (TEST8rr GR8:$src1, GR8:$src1)>;

This relies on matching the result of TEST8rr (which is EFLAGS, which is
an implicit def) to the result of X86cmp, an i32.

llvm-svn: 98903
2010-03-19 00:01:11 +00:00
Bob Wilson
5c35e064e5 Update comment to refer to the right filename.
llvm-svn: 98902
2010-03-18 23:57:57 +00:00
Chris Lattner
09704dc656 tidy up
llvm-svn: 98901
2010-03-18 23:57:57 +00:00
Anton Korobeynikov
eeae840ed7 Get rid of target-specific fp <-> int nodes when still I'm here.
llvm-svn: 98889
2010-03-18 22:35:45 +00:00
Anton Korobeynikov
23c07f492e Get rid of target-specific nodes for fp16 <-> fp32 conversion.
llvm-svn: 98888
2010-03-18 22:35:37 +00:00
Anton Korobeynikov
f07111ada7 Refactor Reg-Reg copy emission routine for ARM. This makes cross-regclass copies weirdness more straightforward. Also, add GPR <-> SPR copy support.
llvm-svn: 98887
2010-03-18 22:35:02 +00:00
Eric Christopher
eb546c4d7d Couple of changes that Dan mentioned for llvm.stackprotector fast-isel.
llvm-svn: 98881
2010-03-18 21:58:33 +00:00
Daniel Dunbar
1a50b05aff X86MCCodeEmitter: Fix two minor issues with reloc_riprel_4byte_movq_load, we
were missing it on some movq instructions and were not including the appropriate
PCrel bias.

llvm-svn: 98880
2010-03-18 21:53:54 +00:00
Chris Lattner
87af55dfd6 fix some buggy ops concatentation
llvm-svn: 98869
2010-03-18 21:06:54 +00:00
Chris Lattner
09143aa2b0 use ins/outs.
llvm-svn: 98866
2010-03-18 20:55:18 +00:00
Chris Lattner
2560ce9976 outs come before ins.
llvm-svn: 98864
2010-03-18 20:50:06 +00:00
Eric Christopher
37a2274c91 Make fast-isel understand llvm.stackprotector.
llvm-svn: 98862
2010-03-18 20:27:26 +00:00
Bob Wilson
504b4c8243 Refactor NEON ld/st instructions to hardcode class arguments that are constants.
No functional changes.

llvm-svn: 98860
2010-03-18 20:18:39 +00:00
Daniel Dunbar
ab14df376a MC/X86/AsmMatcher: Use the new instruction cleanup routine to implement a
temporary workaround for matching inc/dec on x86_64 to the correct instruction.
 - This hack will eventually be replaced with a robust mechanism for handling
   matching instructions based on the available target features.

llvm-svn: 98858
2010-03-18 20:06:02 +00:00
Chris Lattner
bf3e096258 fix an x86-64 encoding bug Daniel found.
llvm-svn: 98855
2010-03-18 20:04:36 +00:00
Chris Lattner
45ab55ccec add a special relocation type for movq loads for object
files that produce special relocation types where the 
linker changes movq's into lea's.

llvm-svn: 98839
2010-03-18 18:10:56 +00:00
Chris Lattner
0be133bc3d callq is pcrelative
llvm-svn: 98835
2010-03-18 17:52:22 +00:00
Bob Wilson
cc9d5b7093 Check if function names start with "llvm." before trying to lookup them up as
intrinsics.  The intrinsic lookup code assumes that this check has been done
and assumes the names are at least 6 characters long.  Valgrind complained
about this.  pr6638.

llvm-svn: 98831
2010-03-18 16:52:15 +00:00
Benjamin Kramer
bad76b004a Try to fix a valgrind error on 32 bit platforms: use %zu instead of %llu to format a size_t.
llvm-svn: 98819
2010-03-18 12:18:36 +00:00
Evan Cheng
5ace6fffac Turning off post-ra scheduling for x86. It isn't a consistent win.
llvm-svn: 98810
2010-03-18 06:55:42 +00:00
Daniel Dunbar
26cbc4b1a3 MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols.
Also, avoid some virtual call overhead.

llvm-svn: 98789
2010-03-18 00:58:53 +00:00
Evan Cheng
41730fc7c8 X86 address mode matching code MatchAddressRecursively does some aggressive hack which require doing a RAUW. It may end up deleting some SDNode up stream. It should avoid referencing deleted nodes.
llvm-svn: 98780
2010-03-17 23:58:35 +00:00
Johnny Chen
b1d61d9be1 Revert 98745 with respect to the addition of NEONFrm subformats for disassembly.
There is a better way coming up.

llvm-svn: 98777
2010-03-17 23:26:50 +00:00
Johnny Chen
08d7095c33 Fixed a bug in the IT mask printing where T means the cond bit in the mask
matches that of Firstcond[0] and E means otherwise.  The Firstcond[0] is also
tagged in the Mask to facilitate Asm printing.  The disassembler also depends
on this arrangement.  This is similar to what's described in A2.5.2 ITSTATE.

Ran:

utils/lit/lit.py test/CodeGen/ARM test/CodeGen/Thumb test/CodeGen/Thumb2

successfully.

llvm-svn: 98775
2010-03-17 23:14:23 +00:00
Johnny Chen
5c58c86098 Refines 98745 so that it only contains the patch related to the output of the
addressing modes to omit the '+' from the assembler syntax #+/-<imm> or +/-<Rm>.

This patch removes the impl of printT2AddrModeImm8s4OffsetOperand() from
ARMAsmPrinter.cpp.  It is used by disassembler as of now.

llvm-svn: 98774
2010-03-17 23:01:59 +00:00
Bob Wilson
2fcf1547f2 Clean up whitespace.
llvm-svn: 98769
2010-03-17 21:16:45 +00:00
Bob Wilson
aa67850cc5 Increase format field from 5 to 6 bits. ARMII::FormMask was increased to 0x3f
in svn r74988 but the format field was never widened.

llvm-svn: 98768
2010-03-17 21:13:43 +00:00
Benjamin Kramer
35de5cfb4c Initialize Size member to appease valgrind.
llvm-svn: 98763
2010-03-17 19:55:31 +00:00
Johnny Chen
7cea0e9dd5 98745 contains something unrelated to the patch.
Remove it from ARMAddressingModes.h.

llvm-svn: 98751
2010-03-17 18:32:39 +00:00
Johnny Chen
0212e0df47 Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]

llvm-svn: 98745
2010-03-17 17:52:21 +00:00
Chris Lattner
962d3d700b fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.

llvm-svn: 98712
2010-03-17 05:41:18 +00:00
Bob Wilson
3778e7f389 Revert 98683. It is breaking something in the disassembler.
llvm-svn: 98692
2010-03-16 23:01:13 +00:00
Bob Wilson
79f10e6233 Remove redundant writeback flag from ARM address mode 6. Also remove the
optional register update argument, which is currently unused -- when we add
support for that, it can just be a separate operand.

llvm-svn: 98683
2010-03-16 21:44:40 +00:00
Chris Lattner
cf7f134913 reapply r98656 unmodified, which exposed the asmprinter not
handling constant unions.

llvm-svn: 98680
2010-03-16 21:25:55 +00:00
Johnny Chen
54bb1efbe0 Disambiguate the *_UPD and * variants by specifying the writeback flag as 1.
This is for the disassembly work.

There are cases where this is not possible, for example, A8.6.53 LDM Encoding T1.
In such case, we'll use an adhoc approach to deduce the Opcode programmatically.

llvm-svn: 98679
2010-03-16 21:25:05 +00:00
Daniel Dunbar
faade5305c Revert r98656, its breaking all over the place.
llvm-svn: 98662
2010-03-16 19:35:34 +00:00
Chris Lattner
7a96045d0a improve support for uniontype and ConstantUnion, patch by Tim Northover!
llvm-svn: 98656
2010-03-16 19:15:03 +00:00
Bob Wilson
aee6e76a7d Remove redundant writeback flag in ARM addressing mode 5.
llvm-svn: 98648
2010-03-16 18:38:09 +00:00
Bob Wilson
279818d473 Remove the writeback flag from ARM's address mode 4. Now that we have separate
instructions for ld/st with writeback, the flag is completely redundant.

llvm-svn: 98643
2010-03-16 17:46:45 +00:00
Bob Wilson
92cb518b94 Fix unused variable warnings.
llvm-svn: 98642
2010-03-16 17:44:45 +00:00
Bob Wilson
34aca030c5 --- Reverse-merging r98637 into '.':
U    test/CodeGen/ARM/tls2.ll
U    test/CodeGen/ARM/arm-negative-stride.ll
U    test/CodeGen/ARM/2009-10-30.ll
U    test/CodeGen/ARM/globals.ll
U    test/CodeGen/ARM/str_pre-2.ll
U    test/CodeGen/ARM/ldrd.ll
U    test/CodeGen/ARM/2009-10-27-double-align.ll
U    test/CodeGen/Thumb2/thumb2-strb.ll
U    test/CodeGen/Thumb2/ldr-str-imm12.ll
U    test/CodeGen/Thumb2/thumb2-strh.ll
U    test/CodeGen/Thumb2/thumb2-ldr.ll
U    test/CodeGen/Thumb2/thumb2-str_pre.ll
U    test/CodeGen/Thumb2/thumb2-str.ll
U    test/CodeGen/Thumb2/thumb2-ldrh.ll
U    utils/TableGen/TableGen.cpp
U    utils/TableGen/DisassemblerEmitter.cpp
D    utils/TableGen/RISCDisassemblerEmitter.h
D    utils/TableGen/RISCDisassemblerEmitter.cpp
U    Makefile.rules
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/Makefile
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
D    lib/Target/ARM/Disassembler
U    lib/Target/ARM/ARMInstrFormats.td
U    lib/Target/ARM/ARMAddressingModes.h
U    lib/Target/ARM/Thumb2ITBlockPass.cpp

llvm-svn: 98640
2010-03-16 16:59:47 +00:00
Johnny Chen
ff030064fb Initial ARM/Thumb disassembler check-in. It consists of a tablgen backend
(RISCDisassemblerEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]

llvm-svn: 98637
2010-03-16 16:36:54 +00:00
Bob Wilson
67c88e4977 Stop using the old pre-UAL syntax for LDM/STM instruction suffixes.
This does not move entirely to UAL syntax, since the default "increment after"
suffix is empty but we still use "IA" for that.

llvm-svn: 98635
2010-03-16 16:19:07 +00:00
Chris Lattner
b91b5cdb03 fix the same bug on the x86-64 side of the fence.
llvm-svn: 98616
2010-03-16 06:39:08 +00:00
Chris Lattner
53210a1f20 fix the encoding of TAILJMPd. This fixes Benchmarks/Olden/bisort
with the integrated assembler!

llvm-svn: 98615
2010-03-16 06:30:18 +00:00
Bob Wilson
cb28bed4f6 Wrap a long line and add some parens to be consistent.
llvm-svn: 98596
2010-03-16 00:31:15 +00:00
Daniel Dunbar
241d3cb048 MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.
- Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue.
 - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol.

llvm-svn: 98592
2010-03-15 23:51:06 +00:00
Dan Gohman
db6002b964 Recognize code for doing vector gather/scatter index calculations with
32-bit indices. Instead of shuffling each element out of the index vector,
when all indices are needed, just store the input vector to the stack and
load the elements out.

llvm-svn: 98588
2010-03-15 23:23:03 +00:00
Bob Wilson
ac5881b842 Translate "cc" clobber in ARM inline assembly to ARM::CCRRegisterClass.
Radar 7459078.

llvm-svn: 98586
2010-03-15 23:09:18 +00:00
Daniel Dunbar
476b525e01 MC/Mach-O/x86_64: Temporary labels in cstring sections require symbols (and external relocations, but we don't have x86_64 relocations yet).
llvm-svn: 98583
2010-03-15 21:56:50 +00:00
Bill Wendling
5493cf6715 Now that the default for Darwin platforms is to place the LSDA into the TEXT
section, remove the target-specific code that performs this.

llvm-svn: 98580
2010-03-15 21:09:38 +00:00
Chris Lattner
d815f6badb use Mang->getSymbol()
llvm-svn: 98578
2010-03-15 20:37:57 +00:00
Bill Wendling
b8ec72ddcb Place the LSDA into the TEXT section for x86 Darwin. If the global it's pointing
to is local to the translation unit, we need to place fill the value of that
symbol into the non-lazy pointer.

This should conclude all Darwin changes for placing the LSDA into the TEXT
section. There is some cleanup to do. I.e., there's no longer a special need for
target-specific code here. But that can come later.

llvm-svn: 98564
2010-03-15 19:04:37 +00:00
Evan Cheng
bcd8655d1d Avoid sibcall optimization if either caller or callee is using sret semantics.
llvm-svn: 98561
2010-03-15 18:54:48 +00:00
Chris Lattner
28d2398af5 do some serious surgery on CellSPU to get it back into a world
where it uses types consistently.

llvm-svn: 98532
2010-03-15 05:53:47 +00:00
Chris Lattner
2c1e56e067 fix a few more ambiguous types.
llvm-svn: 98531
2010-03-15 05:53:30 +00:00
Chris Lattner
f2c6e96a15 add some missing types
llvm-svn: 98530
2010-03-15 05:35:37 +00:00
Jeffrey Yasskin
f468a14fb1 Tell Valgrind when we modify already-executed machine code so it knows
to re-instrument the code.  We depend on the system valgrind.h to
avoid adding a new license.

llvm-svn: 98529
2010-03-15 04:57:55 +00:00
Chris Lattner
5d97a9a10d fix an ambiguous pattern, contrary to expectations, scalar_to_vector
doesn't have a type constraint on the scalar because we don't have
an 'sAny' type.

llvm-svn: 98527
2010-03-15 00:52:43 +00:00
Chris Lattner
241e8fa570 tidy indentation
llvm-svn: 98523
2010-03-14 22:44:11 +00:00
Chris Lattner
1b5fdcde7a no really, all 64-bit cpu's have cmov support. This should
fix the rest of the buildbot failures on non-x86 hosts.

llvm-svn: 98522
2010-03-14 22:39:35 +00:00
Chris Lattner
7d4cb40969 all 64-bit cpus have cmov, this should fix CodeGen/X86/cmov.ll
(at least) on non-x86 builders.

llvm-svn: 98520
2010-03-14 22:24:34 +00:00
Evan Cheng
6bc9eccbe4 Fix jit encoding bugs.
llvm-svn: 98510
2010-03-14 19:28:34 +00:00
Chris Lattner
c50b8b27f5 fix PR6605, X86ISD::CMP always returns i32 (EFLAGS), not
the operand type.

llvm-svn: 98507
2010-03-14 18:44:35 +00:00
Anton Korobeynikov
90fcfccc91 Add substarget feature for FP16
llvm-svn: 98503
2010-03-14 18:42:38 +00:00
Anton Korobeynikov
48357cdc62 Add codegen support for FP16 on ARM
llvm-svn: 98502
2010-03-14 18:42:31 +00:00
Chris Lattner
1469c1b01e add support for pentium class CPUs which do not have cmov,
PR4841.  Patch by Craig Smith!

llvm-svn: 98496
2010-03-14 18:31:44 +00:00
Chris Lattner
fbf6891967 comment fix.
llvm-svn: 98494
2010-03-14 17:10:52 +00:00
Chris Lattner
239d05bad6 shrink 4-byte branches to 1-byte branches when lowering from
MachineInstr -> MCInst.  This is what the assembler backend wants,
it relaxes from smaller to larger things.  This fixes rdar://7750815

llvm-svn: 98493
2010-03-14 17:04:18 +00:00
Chris Lattner
9331acc6d7 get MMI out of the label uniquing business, just go to MCContext
to get unique assembler temporary labels.

llvm-svn: 98489
2010-03-14 08:36:50 +00:00
Chris Lattner
23ec7363b8 Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.

llvm-svn: 98482
2010-03-14 08:12:40 +00:00
Chris Lattner
ba3b320aa3 change the DBG_LABEL MachineInstr to always be created
with an MCSymbol instead of an immediate.

llvm-svn: 98481
2010-03-14 07:56:48 +00:00
Chris Lattner
853b4f38df switch GC_LABEL to use an MCSymbol operand instead of a label ID operand.
llvm-svn: 98474
2010-03-14 07:27:07 +00:00
Evan Cheng
7d8c39bb1c Do not force indirect tailcall through fixed registers: eax, r11. Add support to allow loads to be folded to tail call instructions.
llvm-svn: 98465
2010-03-14 03:48:46 +00:00
Chris Lattner
5fef80c5aa change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".

llvm-svn: 98463
2010-03-14 02:33:54 +00:00
Chris Lattner
149cf816bb change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's.  This cleans up and regularizes a bunch 
of code and makes way for future progress.

Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places.  This is very sad and disturbing. :(

One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction.  There should not be any 
functionality change from doing this, but I'm not an EH expert.

llvm-svn: 98459
2010-03-14 01:41:15 +00:00
Daniel Dunbar
8b64742f0c X86_64: Fix encoding for the rest of the 64i32 instructions too.
llvm-svn: 98458
2010-03-13 22:57:53 +00:00
Daniel Dunbar
a6526284f4 X86: Fix ADD64i32 encoding.
llvm-svn: 98457
2010-03-13 22:49:39 +00:00
Chris Lattner
ceaa2343e7 eliminate the now-unneeded context argument of MBB::getSymbol()
llvm-svn: 98451
2010-03-13 21:04:28 +00:00
Chris Lattner
e7538fa303 rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter.  Now MachineModuleInfo
creates it and owns it by value.  This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code.  This also allows MachineFunction to 
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.

llvm-svn: 98450
2010-03-13 20:55:24 +00:00
Daniel Dunbar
6d5fa0c9d6 MC/X86_64: Fix matching of leaq.
llvm-svn: 98444
2010-03-13 19:31:44 +00:00
Daniel Dunbar
de2f4ae158 MC/X86_64: Fix matching of callq.
llvm-svn: 98443
2010-03-13 19:31:38 +00:00
Chris Lattner
7bc8284fed simplify some overly general code. The stack always grows down on x86.
llvm-svn: 98431
2010-03-13 08:04:35 +00:00
Benjamin Kramer
3e9e66d9e4 Fix another warning. There is a functionality change but I believe it's correct.
llvm-svn: 98430
2010-03-13 07:50:22 +00:00
Bob Wilson
163aa28fa1 Attempt to appease the arm-linux buildbot by fixing the JIT encodings for new
base register updating load/store-multiple instructions.

llvm-svn: 98427
2010-03-13 07:34:35 +00:00
Chris Lattner
14eafddc99 switch to the text section at the start of the .s file for darwin/x86
targets.  This is a temporary hack for the .o file writer that Daniel
wants :)

llvm-svn: 98413
2010-03-13 02:10:00 +00:00
Bob Wilson
0e8a3d7a13 Change ARM ld/st multiple instructions to have variant instructions for
writebacks to the address register.  This gets rid of the hack that the
first register on the list was the magic writeback register operand.  There
was an implicit constraint that if that operand was not reg0 it had to match
the base register operand.  The post-RA scheduler's antidependency breaker
did not understand that constraint and sometimes changed one without the
other.  This also fixes Radar 7495976 and should help the verifier work
better for ARM code.

There are now new ld/st instructions explicit writeback operands and explicit
constraints that tie those registers together.

llvm-svn: 98409
2010-03-13 01:08:20 +00:00
Daniel Dunbar
9ffe22ec23 MC/X86: Add temporary hack to match shrl $1,%eax correctly, to support testing
other functionality on 403.gcc compiled at -O0.

llvm-svn: 98405
2010-03-13 00:47:29 +00:00
Bob Wilson
99388e001e Combine the code to build VLDM and VSTM instructions, since they are
mostly the same.

llvm-svn: 98402
2010-03-13 00:43:32 +00:00
Bob Wilson
a9130d7c7d Tidy up. No functional changes.
llvm-svn: 98398
2010-03-12 22:50:09 +00:00
Bob Wilson
41bb0dca48 Remove obsolete comments. VLDM is implemented in ARMInstrVFP.td.
llvm-svn: 98395
2010-03-12 22:00:08 +00:00
Jeffrey Yasskin
876e602378 Fix LLVM build when the user specifies CPPFLAGS on the make command line.
llvm-svn: 98394
2010-03-12 21:42:14 +00:00
Chris Lattner
4d7171c334 remove special case code that isn't needed anymore.
llvm-svn: 98391
2010-03-12 21:21:19 +00:00
Chris Lattner
5a5ea25649 inline GetGlobalValueSymbol into the rest its callers and
remove it.

llvm-svn: 98390
2010-03-12 21:19:23 +00:00
Chris Lattner
7a2e6110bc inline the now-trivial implementation of GetGlobalValueSymbol into
some of its callers.

llvm-svn: 98388
2010-03-12 21:09:07 +00:00
Chris Lattner
33f470bec2 eliminate the X86 version of GetGlobalValueSymbol, allowing
it to be non-virtual and soon disappear.

llvm-svn: 98387
2010-03-12 21:06:41 +00:00
Chris Lattner
41dbe0a1bd prune #includes, this file should be removed pending hte cygwin stub issue being resolved.
llvm-svn: 98386
2010-03-12 21:04:31 +00:00
Chris Lattner
ff05ae7a33 move fastcall/stdcall mangling up into Mangler.
llvm-svn: 98384
2010-03-12 21:03:47 +00:00
Daniel Dunbar
14b9ff70e1 MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...
llvm-svn: 98380
2010-03-12 21:00:45 +00:00
Chris Lattner
c101ad818c give Mangler access to TargetData.
llvm-svn: 98378
2010-03-12 20:47:28 +00:00
Chris Lattner
5611fd3bc7 make DecorateCygMingName a static method.
llvm-svn: 98377
2010-03-12 20:43:52 +00:00
Chris Lattner
4781fd7ca5 minor tidying, only do work if a function is
actually X86_StdCall or X86_FastCall.

llvm-svn: 98374
2010-03-12 19:48:03 +00:00
Chris Lattner
63328f1348 eliminate the string form of DecorateCygMingName
llvm-svn: 98373
2010-03-12 19:42:40 +00:00
Chris Lattner
2fd7c89502 remove the FnArgWords cache to make way for future changes.
llvm-svn: 98372
2010-03-12 19:31:03 +00:00
Bill Wendling
21a9744045 Add a beta-test for placing the LSDA into the TEXT section on X86.
llvm-svn: 98370
2010-03-12 19:20:40 +00:00
Devang Patel
04d151f5a6 Fix llc crash on invalid input.
llvm-svn: 98369
2010-03-12 19:18:30 +00:00
Chris Lattner
741b3e4e5f Remove some dead code. This method only gets called on
definitions.

llvm-svn: 98368
2010-03-12 19:14:18 +00:00
Chris Lattner
0bcd93798a use Mang->getSymbol instead of duplicating the logic, reduce indentation.
llvm-svn: 98367
2010-03-12 19:04:14 +00:00
Chris Lattner
01e70df9b2 finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.

llvm-svn: 98366
2010-03-12 18:55:20 +00:00
Chris Lattner
683801add5 simplify code to use OutContext.GetOrCreateTemporarySymbol with
no arguments instead of having to come up with a unique name.
This also makes the code less fragile.

llvm-svn: 98364
2010-03-12 18:47:50 +00:00
Chris Lattner
956582f876 make the mangler take an MCContext instead of an MAI.
No functionality change.

llvm-svn: 98363
2010-03-12 18:44:54 +00:00
Benjamin Kramer
a06403442b Use StringRef::substr instead of std::string::substr to avoid using a free'd
string temporary. This should fix PR6590.

llvm-svn: 98349
2010-03-12 13:54:59 +00:00
Bill Wendling
be42dd3e27 The same situation that effected ARM effects PPC with regards to placing the
LSDA into the TEXT section. We need to generate non-lazy pointers to it on
Mach-O. However, the object the NLP points to may be local to the translation
unit. If so, then the NLP needs to have the value of that object specified
instead of "0", which the linker interprets as "external".

llvm-svn: 98325
2010-03-12 02:00:43 +00:00
Chris Lattner
07e124cec5 make TargetLoweringObjectFile::getExprForDwarfReference
just make unnamed temp symbols instead of having to come
up with its own names.

llvm-svn: 98324
2010-03-12 01:56:43 +00:00
Bill Wendling
54c10efb5d MC-ize PPC's asm printing of stubs.
llvm-svn: 98300
2010-03-11 23:39:44 +00:00
Chris Lattner
5aefaeb42e fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457

llvm-svn: 98292
2010-03-11 21:55:20 +00:00
Dan Gohman
6b1b9e37d7 Remove getWidenVectorType, which is no longer used.
llvm-svn: 98289
2010-03-11 21:39:57 +00:00
Johnny Chen
8d150046ba Set the (Format)F filed of t2Int_MemBarrierV7 & t2Int_SyncBarrierV7 to ThumbFrm,
instead of Pseudo, which helps Thumb decoder to recognize them as Thumb instr.

llvm-svn: 98285
2010-03-11 21:02:50 +00:00
Bill Wendling
368a68ac82 revert r98270.
llvm-svn: 98281
2010-03-11 19:50:31 +00:00
Chris Lattner
1ce9dfd498 rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.

llvm-svn: 98278
2010-03-11 19:41:58 +00:00
Evan Cheng
20dbd70316 Bad bad bug. x86 force indirect tail call address into eax when it's meant to force it into a call preserved register instead. Change it to ecx for now.
llvm-svn: 98270
2010-03-11 18:49:14 +00:00
Richard Osborne
8caa985467 Remove dead code. (S|U)MUL_LO is now lowered to LMUL or MACC(S|U)
llvm-svn: 98269
2010-03-11 18:38:59 +00:00
Richard Osborne
0dcde97cbc Add dag combine to simplify lmul(x, 0, a, b)
llvm-svn: 98258
2010-03-11 16:26:35 +00:00
Richard Osborne
22c1716d0d Switch XCore over to using inline jump table entries.
llvm-svn: 98256
2010-03-11 14:58:56 +00:00
Eric Christopher
bbdbe41a97 Have fast-isel understand llvm.objectsize. Update testcase for slightly
different codegen.

llvm-svn: 98244
2010-03-11 06:20:22 +00:00
Daniel Dunbar
285a34c8c8 MC: Sketch initial MCAsmLayout class, which encapsulates the current layout of an assembly file. The MCAsmLayout is also available for use by MCExpr::EvaluateAs{Absolute,Relocatable}, to allow target specific hooks and "absolutizing" of symbols.
llvm-svn: 98227
2010-03-11 02:28:59 +00:00
Daniel Dunbar
f7f88fba2d MC: Sketch some TargetAsmBackend hooks we are going to need.
llvm-svn: 98221
2010-03-11 01:34:21 +00:00
Daniel Dunbar
10c975db78 MC: Provide the target triple to AsmBackend constructors.
llvm-svn: 98220
2010-03-11 01:34:16 +00:00
Bill Wendling
e0a7f83429 When outputing a non-lazy pointer for a stub, we may need to fill in the value
for the NLP because the object it's pointing to may be internal to the file.

This seems counter-intuitive, but bear with me. When we place the LSDA into the
TEXT section, the type info pointers need to be indirect and pc-rel. We
accomplish this by using NLPs. However, sometimes the types are local to the
file. GCC gets around this by not using a NLP in this case, but a "regular"
indirection like this:

GCC_except_tbl:
  .long Lfoo-.

__ZTIA:  @ This is local
  ...

Lfoo:
  .long __ZTIA

LLVM prefers NLPs on Darwin. In fact, it's more optimal for load performance to
use them.

llvm-svn: 98218
2010-03-11 01:18:13 +00:00
Johnny Chen
5b54a7fca1 Added Thumb2 LDRD/STRD pre/post variants for disassembly only.
Plus fixed the encoding of t2LDRDpci such that P = 1 and W = 0 (offset mode).

llvm-svn: 98217
2010-03-11 01:13:36 +00:00
Bob Wilson
1ce9157601 Fix ARM buildbot breakage.
llvm-svn: 98215
2010-03-11 00:46:22 +00:00
Chris Lattner
d6d11e53ab add support, testcases, and dox for the new GHC calling
convention.  Patch by David Terei!

llvm-svn: 98212
2010-03-11 00:22:57 +00:00
Bob Wilson
b7efefe008 Lower small memcpys to load/stores on Thumb2.
Radar 7686922.

llvm-svn: 98210
2010-03-11 00:20:49 +00:00
Chris Lattner
3a1f8cf234 Work around a bug in the openbsd assembler on i386,
which doesn't support .quad correctly because it is
"really really old".  PR6528.

Yet another reason the mc assembler should take over ;-)

llvm-svn: 98205
2010-03-11 00:06:19 +00:00
Bob Wilson
e49828788b Fix an obvious typo in an assert.
Patch by Sean Callanan.

llvm-svn: 98200
2010-03-10 22:38:45 +00:00
Bill Wendling
df325dee9d Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.

llvm-svn: 98199
2010-03-10 22:34:10 +00:00
Dale Johannesen
987770c05d Progress towards shepherding debug info through SelectionDAG.
No functional effect yet.  This is still evolving and should
not be viewed as final.

llvm-svn: 98195
2010-03-10 22:13:47 +00:00
Chris Lattner
d14ff9f87b move PR6576 here.
llvm-svn: 98194
2010-03-10 21:42:42 +00:00
Jim Grosbach
c7983b0537 Make sure the LR gets pushed in functions that use vaargs. This fixes
400.perlbench for the nightly tests.

llvm-svn: 98183
2010-03-10 20:01:30 +00:00
Jim Grosbach
283a9fe231 comment why we use custom epilogue for t1 functions using vaargs.
llvm-svn: 98182
2010-03-10 19:59:47 +00:00
Johnny Chen
db62f78f10 Factored out the disassembly printing of CPS option, MSR mask, and Negative Zero
operands into their own PrintMethod, in order not to pollute the printOperand()
impl with disassembly only Imm modifiers.

llvm-svn: 98172
2010-03-10 18:59:38 +00:00
Richard Osborne
e018a3f184 The backend now makes a reasonable job of targeting lmul / macc
llvm-svn: 98169
2010-03-10 18:14:47 +00:00
Richard Osborne
41c5f84f1d Handle MVT::i64 type in DAG combine for ISD::ADD. Fold 64 bit
expression add(add(mul(x,y),a),b) -> lmul(x,y,a,b) if all
operands are zero extended.

llvm-svn: 98168
2010-03-10 18:12:27 +00:00
Richard Osborne
8e7cdbef01 Fix checking of intermediates having one use in isADDADDMUL
llvm-svn: 98164
2010-03-10 17:16:29 +00:00
Richard Osborne
a1f3ed1aeb Extract recognition of patterns such as add(add(mul(x,y),a),b)
into a seperate function.

llvm-svn: 98162
2010-03-10 17:10:35 +00:00
Richard Osborne
6120fdbd30 Fix thinko.
llvm-svn: 98158
2010-03-10 16:27:11 +00:00
Richard Osborne
d400202a43 Fold add(add(mul(x,y),a),b) -> lmul(x,y,a,b) if the intermediate
results are unused elsewhere.

llvm-svn: 98157
2010-03-10 16:19:31 +00:00
Richard Osborne
c19c2bd177 Prefer LMUL to MACCU as LMUL has no tied operands.
llvm-svn: 98153
2010-03-10 13:27:10 +00:00
Richard Osborne
43210638f1 Custom lower (S|U)MUL_LOHI -> MACC(S|U)
llvm-svn: 98152
2010-03-10 13:20:07 +00:00
Richard Osborne
ed6df27ad0 Fix indentation
llvm-svn: 98151
2010-03-10 11:42:05 +00:00
Richard Osborne
c88a8e8d66 Lower add (mul a, b), c into MACCU / MACCS nodes which translate
directly to the maccu / maccs instructions. We handle this in
ExpandADDSUB since after type legalisation it is messy to
recognise these operations.

llvm-svn: 98150
2010-03-10 11:41:08 +00:00
Chris Lattner
e34dde1e83 move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!

llvm-svn: 98145
2010-03-10 07:20:42 +00:00
Chris Lattner
ed0b8d36e4 set the temporary bit on MCSymbols correctly.
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Jim Grosbach
aa8617389c Clear up the last (famous last words) frame index value reuse issues for Thumb1.
llvm-svn: 98109
2010-03-10 00:13:42 +00:00
Daniel Dunbar
0bc3059b94 MC/X86: Rename alternate spellings of ADD{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
llvm-svn: 98098
2010-03-09 22:50:46 +00:00
Daniel Dunbar
d92e9bc7c1 MC/X86: Rename alternate spellings of CMP{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
llvm-svn: 98097
2010-03-09 22:50:40 +00:00
Jim Grosbach
f328c5334f Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

llvm-svn: 98086
2010-03-09 21:45:49 +00:00
Johnny Chen
7cca4927aa MSR (Move to Special Register from ARM core register) requires a mask to specify
what fields of the CPSR or SPSR are affected.

llvm-svn: 98085
2010-03-09 21:39:34 +00:00
Dale Johannesen
4b8f3692f4 The address of an indirect call must be in R12 on Darwin.
Make it so.  (This patch is in LowerCall_Darwin, which seems
to be used by SVR4 code as well; since that doesn't belong here,
I haven't worried about this case.)

llvm-svn: 98077
2010-03-09 20:15:42 +00:00
Jim Grosbach
195c494922 scavenged frame index value re-use gets confused when more than one base
register is involved for thumb1. Work around this for the moment by only
re-using SP-relative offsets. This is temporary 'til the code can distinguish
multiple base registers.

llvm-svn: 98071
2010-03-09 19:07:28 +00:00
Bill Wendling
c9cfc16363 The ARM EH experiment worked!
Place the LSDA into the TEXT section for ARM platforms. This involves making the
encoding indirect, pcrel, and sdata4 instead of an absolute pointer. The
references to the type infos are then non-lazy pointers. Revision 98019 changed
the encoding of non-lazy pointers to add the symbol to the non-lazy pointer
definition if it's a local symbol (otherwise, it's external and set to '0' so
that the loader can adjust it to the real value). This paved the way for this
change to work on ARM.

llvm-svn: 98068
2010-03-09 18:31:07 +00:00
Richard Osborne
4077517135 In cases where the carry / borrow unused converted ladd / lsub
to an add or a sub.

llvm-svn: 98059
2010-03-09 16:34:25 +00:00
Richard Osborne
e33e24e6cb Canonicalize ladd constant to RHS.
llvm-svn: 98058
2010-03-09 16:13:57 +00:00
Richard Osborne
173efed224 Add DAG combine for ladd / lsub.
llvm-svn: 98057
2010-03-09 16:07:47 +00:00
Dan Gohman
18aa7d328e Don't try to fold V_SET0 and V_SETALLONES to loads in medium and
large code models.

llvm-svn: 98042
2010-03-09 03:01:40 +00:00
Bill Wendling
344fec6285 This is part of an LLC-beta test used to test <rdar://problem/6804645>. Please
bear with the awful code. It won't last in its current state beyond tonight.

llvm-svn: 98040
2010-03-09 02:46:12 +00:00
Bill Wendling
a2ed617fa9 Print blank line and clear stubs vector.
llvm-svn: 98019
2010-03-09 00:43:34 +00:00
Bill Wendling
a9e3eb7d2d MC-ize the stub printing in ARM.
llvm-svn: 98018
2010-03-09 00:40:17 +00:00
Chris Lattner
d8ca814af2 don't reset defaults.
llvm-svn: 98004
2010-03-08 23:18:21 +00:00
Bob Wilson
116599fe52 Fix a crash compiling 254.gap for Thumb2. The Thumb2 add/sub with 12-bit
immediate instructions cannot set the condition codes, so they do not have
the extra cc_out operand.  We hit an assertion during tail duplication
because the instruction being duplicated had more operands that expected.

llvm-svn: 98001
2010-03-08 22:56:15 +00:00
Kevin Enderby
23e37f3e39 Fix the vmxon entry in the X86InstrInfo.td so it has the correct prefix bytes
for the encoding and is not the same as vmptrld.

llvm-svn: 97992
2010-03-08 22:17:26 +00:00
Daniel Dunbar
66c79cf44d X86: Fix encoding for TEST{8,16,32}rr.
llvm-svn: 97982
2010-03-08 21:10:36 +00:00
Devang Patel
176dc29a62 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.

llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
a716e313d6 Revert r97947.
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Chris Lattner
014fa780b4 disambiguate some types, add a fixme about some
inconsistent intrinsics.

llvm-svn: 97959
2010-03-08 18:59:49 +00:00
Chris Lattner
006063d36e fix some more ambiguous patterns, remove another nontemporalstore
pattern which is broken (source and address swapped).

llvm-svn: 97958
2010-03-08 18:57:56 +00:00
Chris Lattner
6ba2e68770 Correct immediate sizes.
llvm-svn: 97957
2010-03-08 18:55:15 +00:00
Chris Lattner
b198628a6b fix a type compatibility bug. imm is i32 in the input
pattern, not i64.

llvm-svn: 97956
2010-03-08 18:52:55 +00:00
Chris Lattner
49ef2cd57b fix a bunch of partially ambiguous patterns on ARM. As an
example, this:

(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))

is ambiguous because DPR contains both f64 and v2f32.  tblgen
currently accidentally picks f64 because it's first in the 
regclass.

llvm-svn: 97955
2010-03-08 18:51:21 +00:00
Chris Lattner
862cd1ca18 Fix a bunch of ambiguous patterns which tblgen happens to infer types
for, due to a bug.

llvm-svn: 97953
2010-03-08 18:44:04 +00:00
Chris Lattner
27862700e5 tidy up
llvm-svn: 97950
2010-03-08 18:29:38 +00:00
Devang Patel
1527b2657b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.

llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Chris Lattner
9643f038b9 remove a non-temporal store pattern which is not tested and
could never have matched because the operand list was backwards.

llvm-svn: 97933
2010-03-08 03:18:28 +00:00
Wesley Peck
bc2c6d7b1b Re-committing the failed r97807 commit with changes to eliminate warnings.
llvm-svn: 97891
2010-03-06 23:23:12 +00:00
Anton Korobeynikov
f6f8265c1c Describe what's going on with mingw alloca and why do we need separate instruction.
llvm-svn: 97888
2010-03-06 20:07:32 +00:00
Anton Korobeynikov
e0e616a74d Initial bits of ARMv4-only support.
Patch by John Tytgat!

llvm-svn: 97886
2010-03-06 19:39:36 +00:00
Anton Korobeynikov
74dea2d5cb Lower dynamic stack allocation on mingw32 to separate instruction.
We cannot use a normal call here since it has extra unmodelled side
effects (it changes stack pointer). This should fix PR5292.

llvm-svn: 97884
2010-03-06 19:32:29 +00:00
Anton Korobeynikov
6c841e6a44 Do not use '&' prefix for globals when register base field is non-zero, otherwise msp430-as will silently miscompile the code (TI's assembler report an error though).
This fixes PR6349

llvm-svn: 97877
2010-03-06 11:41:12 +00:00
Chris Lattner
8e294fcf0a clean this up.
llvm-svn: 97870
2010-03-06 07:02:28 +00:00
Chris Lattner
b2ed5cb501 revert r97807, it introduced build warnings.
llvm-svn: 97869
2010-03-06 04:32:46 +00:00
Jim Grosbach
7d1602fb3b Thumb1 epilogue code generation needs to take into account that callee-saved
registers may be restored via a pop instruction, not just a tRestore.
This fixes nightly test 471.omnetep for Thumb1.

llvm-svn: 97867
2010-03-06 03:28:39 +00:00
Evan Cheng
ee117a9429 Fix typo.
llvm-svn: 97818
2010-03-05 19:55:55 +00:00
Chris Lattner
e1452aba94 fix bss section printing for cell, patch by Kalle Raiskila!
llvm-svn: 97814
2010-03-05 18:55:36 +00:00
Wesley Peck
79c2f7afcc Reworking the stack layout that the MicroBlaze backend generates.
The MicroBlaze backend was generating stack layouts that did not
conform correctly to the ABI. This update generates stack layouts
which are closer to what GCC does.

Variable arguments support was added as well but the stack layout
for varargs has not been finalized.

llvm-svn: 97807
2010-03-05 15:26:02 +00:00
Evan Cheng
eb43cbfc75 Fix an oops in x86 sibcall optimization. If the ByVal callee argument is itself passed as a pointer, then it's obviously not safe to do a tail call.
llvm-svn: 97797
2010-03-05 08:38:04 +00:00
Evan Cheng
04b9deff58 Rever 96389 and 96990. They are causing some miscompilation that I do not fully understand.
llvm-svn: 97782
2010-03-05 03:08:23 +00:00
Johnny Chen
dd24501890 Trivial comment change.
llvm-svn: 97776
2010-03-05 01:45:46 +00:00
Bill Wendling
a92a5b8a6c Revert r97766. It's deleting a tag.
llvm-svn: 97768
2010-03-05 00:33:59 +00:00
Bill Wendling
55b4dfcd9d Micro-optimization:
This code:

float floatingPointComparison(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

produces this:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jne             0x00000004
0000000000000016        jp              0x00000002
0000000000000018        jmp             0x00000008
000000000000001a        addsd           0x00000006(%rip),%xmm0
0000000000000022        cvtsd2ss        %xmm0,%xmm0
0000000000000026        ret

The "jne/jp/jmp" sequence can be reduced to this instead:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jp              0x00000002
0000000000000016        je              0x00000008
0000000000000018        addsd           0x00000006(%rip),%xmm0
0000000000000020        cvtsd2ss        %xmm0,%xmm0
0000000000000024        ret

for a savings of 2 bytes.

This xform can happen when we recognize that jne and jp jump to the same "true"
MBB, the unconditional jump would jump to the "false" MBB, and the "true" branch
is the fall-through MBB.

llvm-svn: 97766
2010-03-05 00:24:26 +00:00
Johnny Chen
b6d35fd803 Drop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version
of either sxtb16 or uxtb16, and the unified syntax does not specify ".w".

llvm-svn: 97760
2010-03-04 22:24:41 +00:00
Bob Wilson
188e15d7a5 pr6478: The frame pointer spill frame index is only defined when there is a
frame pointer.

llvm-svn: 97755
2010-03-04 21:42:36 +00:00
Bob Wilson
73b96c00d2 pr6480: Don't try producing ld/st-multiple instructions when the address is
an undef value.  This is only going to come up for bugpoint-reduced tests --
correct programs will not access memory at undefined addresses -- so it's not
worth the effort of doing anything more aggressive.

llvm-svn: 97745
2010-03-04 21:04:38 +00:00
Jakob Stoklund Olesen
3408cd6de1 Fix the remaining MUL8 and DIV8 to define AX instead of AL,AH.
These instructions technically define AL,AH, but a trick in X86ISelDAGToDAG
reads AX in order to avoid reading AH with a REX instruction.

Fix PR6489.

llvm-svn: 97742
2010-03-04 20:42:07 +00:00
Dan Gohman
265f85f6d8 Fix recognition of 16-bit bswap for C front-ends which emit the
clobber registers in a different order.

llvm-svn: 97741
2010-03-04 19:58:08 +00:00
Chris Lattner
27a8ee8574 not committing what you test = bad.
llvm-svn: 97740
2010-03-04 19:54:45 +00:00
Chris Lattner
dfd345bf39 make gep matching in fastisel match the base of the gep as a
register if it isn't possible to match the indexes *and* the base.
This fixes some fast isel rejects of load instructions on oggenc.

llvm-svn: 97739
2010-03-04 19:48:19 +00:00
Johnny Chen
1ee942da0d Added 32-bit Thumb instructions for Preload Data (PLD, PLDW) and Preload
Instruction (PLI) for disassembly only.

According to A8.6.120 PLI (immediate, literal), for example, different
instructions are generated for "pli [pc, #0]" and "pli [pc, #-0"].  The
disassembler solves it by mapping -0 (negative zero) to -1, -1 to -2, ..., etc.

llvm-svn: 97731
2010-03-04 17:40:44 +00:00
Chris Lattner
3d7dc22a7a add a comment.
llvm-svn: 97709
2010-03-04 01:43:43 +00:00
John McCall
282b01ff42 Teach the pic16 target to recognize pic16-*-* triples.
llvm-svn: 97691
2010-03-04 00:21:47 +00:00
Johnny Chen
c903faa636 Modified the asm string of 16-bit Thumb MUL instruction so that it prints:
MULS <Rdm>, <Rn>, <Rdm>

according to A8.6.105 MUL Encoding T1.

llvm-svn: 97675
2010-03-03 23:15:43 +00:00
Andrew Lenharth
89d887d0bc Fix PR6444, note still doesn't compile libgcc2 all the way, but fixes that error. May not fix it in an ABI complient way. It wasn't clear what gcc does
llvm-svn: 97660
2010-03-03 20:15:31 +00:00
Johnny Chen
c25f4d30f9 Added 32-bit Thumb instructions LDRT, LDRBT, LDRHT,,LDRSBT, LDRSHT, STRT, STRBT,
and STRHT for disassembly only.

llvm-svn: 97655
2010-03-03 18:45:36 +00:00
Chris Lattner
2e934b978c remove nvload and two patterns that use it which are
better done by dag combine.

llvm-svn: 97633
2010-03-03 02:14:54 +00:00
Johnny Chen
6ecb4d7b7c Added 32-bit Thumb instructions t2NOP, t2YIELD, t2WFE, t2WFI, t2SEV, and t2DBG
for disassembly only.

llvm-svn: 97632
2010-03-03 02:09:43 +00:00
Chris Lattner
88f948aec4 factor the 'in the default address space' check out to a single
'dsload' pattern.  tblgen doesn't check patterns to see if they're
textually identical.  This allows better factoring.

llvm-svn: 97630
2010-03-03 01:52:59 +00:00
Chris Lattner
b178d16c23 factor the 'sign extended from 8 bit' patterns better so
that they are not destination type specific.  This allows
tblgen to factor them and the type check is redundant with
what the isel does anyway.

llvm-svn: 97629
2010-03-03 01:45:01 +00:00
Evan Cheng
70b7ecdef9 - Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).

llvm-svn: 97628
2010-03-03 01:44:33 +00:00
Evan Cheng
4e3c0e66f7 Eliminate unused instruction classes.
llvm-svn: 97617
2010-03-03 00:43:15 +00:00
Johnny Chen
7be11bea79 Added 32-bit Thumb instructions t2DMB variants, t2DSB variants, and t2ISBsy for
disassembly only.

llvm-svn: 97614
2010-03-03 00:16:28 +00:00
Chris Lattner
eed11ae4f8 merge two loops over all nodes in the graph into one.
llvm-svn: 97606
2010-03-02 23:12:51 +00:00
Chris Lattner
27d98e4772 eliminate PreprocessForRMW now that isel handles it.
We still preprocess calls and fp return stuff.

llvm-svn: 97598
2010-03-02 22:33:56 +00:00
Chris Lattner
f781ca5fcb remove 300 lines of code that is now dead in the MSP430 backend
now that isel handles chains more aggressively.  This also
allows us to make isLegalToFold non-virtual.

llvm-svn: 97597
2010-03-02 22:30:08 +00:00
Chris Lattner
9c9c1158cb Fix some issues in WalkChainUsers dealing with
CopyToReg/CopyFromReg/INLINEASM.  These are annoying because
they have the same opcode before an after isel.  Fix this by
setting their NodeID to -1 to indicate that they are selected,
just like what automatically happens when selecting things that
end up being machine nodes.

With that done, give IsLegalToFold a new flag that causes it to
ignore chains.  This lets the HandleMergeInputChains routine be
the one place that validates chains after a match is successful,
enabling the new hotness in chain processing.  This smarter
chain processing eliminates the need for "PreprocessRMW" in the
X86 and MSP430 backends and enables MSP to start matching it's
multiple mem operand instructions more aggressively.

I currently #if out the dead code in the X86 backend and MSP 
backend, I'll remove it for real in a follow-on patch.

The testcase changes are:
  test/CodeGen/X86/sse3.ll: we generate better code
  test/CodeGen/X86/store_op_load_fold2.ll: PreprocessRMW was 
      miscompiling this before, we now generate correct code
      Convert it to filecheck while I'm at it.
  test/CodeGen/MSP430/Inst16mm.ll: Add a testcase for mem/mem
      folding to make anton happy. :)

llvm-svn: 97596
2010-03-02 22:20:06 +00:00
Johnny Chen
96f78fcb96 Added 32-bit Thumb instruction CLREX (Clear-Exclusive) for disassembly only.
llvm-svn: 97595
2010-03-02 22:11:06 +00:00
Johnny Chen
dc6ad68a6d Removed the extra S from the multiclass def T2I_adde_sube_s_irs as well as from
the opc string passed in, since it's a given from the class inheritance of T2sI.
The fixed the extra 's' in adcss & sbcss when disassembly printing.

llvm-svn: 97582
2010-03-02 19:38:59 +00:00
Johnny Chen
88f05c26a5 Added 32-bit Thumb instructions: CPS, SDIV, UDIV, SXTB16, SXTAB16, UXTAB16, SEL,
SMMULR, SMMLAR, SMMLSR, TBB, TBH, and 16-bit Thumb instruction CPS for
disassembly only.

llvm-svn: 97573
2010-03-02 18:14:57 +00:00
Johnny Chen
9b5f5645e4 AL is an optional mnemonic extension for always, except in IT instructions.
Add printMandatoryPredicateOperand() PrintMethod for IT predicate printing.

Ref: A8.3 Conditional execution
llvm-svn: 97571
2010-03-02 17:57:15 +00:00
Johnny Chen
ddbf29a06c Change some asm shift opcode strings to lowercase.
llvm-svn: 97567
2010-03-02 17:03:18 +00:00
Xerxes Ranby
8f57e7907a fix typo add missing (
llvm-svn: 97565
2010-03-02 13:42:03 +00:00
Xerxes Ranby
1adef1fad2 Unbreak llvm-arm-linux buildbot and fix PR5309.
llvm-svn: 97564
2010-03-02 13:26:18 +00:00
Chris Lattner
1707a88a2c Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)

llvm-svn: 97555
2010-03-02 06:34:30 +00:00
Eric Christopher
ca6b8de375 Only save vector registers if we've defined for the vector registers.
Fixes PR5309.

llvm-svn: 97554
2010-03-02 06:25:00 +00:00
Bill Wendling
5990930d72 Remove dead parameter passing.
llvm-svn: 97536
2010-03-02 01:55:18 +00:00
Dan Gohman
37bf232609 Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,
respectively.

llvm-svn: 97531
2010-03-02 01:11:08 +00:00
Chris Lattner
745181da4b remove a little hack I did for the old isel, not needed
now that it is gone.

llvm-svn: 97516
2010-03-01 22:51:11 +00:00
Evan Cheng
c0a816fd16 Remove the optimize for code size limitation on r67917. Optimize 64-bit imul by constants into leas + shl regardless if optimizing for code size. The size saving from using imulq isn't worth it. Also, the lea and shl instructions may expose further optimization.
llvm-svn: 97507
2010-03-01 22:00:11 +00:00
Chris Lattner
fa3b904028 remove a terrible hack that disabled assertions from this file because of build time
problems.  rdar://7697850.

llvm-svn: 97500
2010-03-01 21:20:46 +00:00
Chris Lattner
21ad1fd291 stop using generated sdnodexforms.
llvm-svn: 97485
2010-03-01 19:38:53 +00:00
Johnny Chen
37f3172799 Added STRHT for disassembly only and fixed a bug in AI3sthpo class where the W
bit should be set to 0 instead of 1.

llvm-svn: 97481
2010-03-01 19:22:00 +00:00
Dan Gohman
6b91ee1f38 Add explicit keywords.
llvm-svn: 97460
2010-03-01 17:56:46 +00:00
Dan Gohman
0d46f3e9e6 This is now done.
llvm-svn: 97450
2010-03-01 17:43:57 +00:00
Nathan Keynes
0226482410 Add JIT support to the TODO list (test commit)
llvm-svn: 97443
2010-03-01 10:40:41 +00:00
Mikhail Glushenkov
47b3719d4b 80-col violations/trailing whitespace.
llvm-svn: 97427
2010-02-28 22:54:30 +00:00
Chris Lattner
a6e6c1681f remove redundant instruction.
llvm-svn: 97374
2010-02-28 07:23:21 +00:00
Dan Gohman
4b0dac5a8d Add a flag to addPassesToEmit* to disable the Verifier pass run
after LSR, so that clients can opt in.

llvm-svn: 97357
2010-02-28 00:41:59 +00:00
Dan Gohman
3177cfd002 Implement XMM subregs.
Extracting the low element of a vector is now done with EXTRACT_SUBREG,
and the zero-extension performed by load movss is now modeled with
SUBREG_TO_REG, and so on.

Register-to-register movss and movsd are no longer considered copies;
they are two-address instructions which insert a scalar into a vector.

llvm-svn: 97354
2010-02-28 00:17:42 +00:00
Dan Gohman
99c6bcbc13 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +00:00
Chris Lattner
a574e6c6cf remove a bogus pattern, which had the same pattern as STDU
but codegen'd differently.  This really wanted to use some
sort of subreg to get the low 4 bytes of the G8RC register
or something.  However, it's invalid and nothing is testing
it, so I'm just zapping the bogosity.

llvm-svn: 97345
2010-02-27 21:15:32 +00:00
Chris Lattner
d35abb1c89 fix an incorrect (overly conservative) predicate.
llvm-svn: 97316
2010-02-27 08:18:55 +00:00
Evan Cheng
94051bc37e Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.
llvm-svn: 97310
2010-02-27 07:36:59 +00:00
Johnny Chen
0f20ffea08 Added the follwoing 32-bit Thumb instructions for disassembly only:
o Parallel addition and subtraction, signed/unsigned
o Miscellaneous operations: QADD, QDADD, QSUB, QDSUB
o Unsigned sum of absolute differences [and accumulate]: USAD8, USADA8
o Signed/Unsigned saturate: SSAT, SSAT16, USAT, USAT16
o Signed multiply accumulate long (halfwords): SMLAL<x><y>
o Signed multiply accumulate/subtract [long] (dual): SMLAD[x], SMLALD[X], SMLSD[X], SMLSLD[X]
o Signed dual multiply add/subtract [long]: SMUAD[X], SMUSD[X]

llvm-svn: 97276
2010-02-26 22:04:29 +00:00
Jakob Stoklund Olesen
7221654c33 Merge PPC instructions FMRS and FMRD into a single FMR instruction.
This is possible because F8RC is a subclass of F4RC. We keep FMRSD around so
fextend has a pattern.

Also allow folding of memory operands on FMRSD.

llvm-svn: 97275
2010-02-26 21:53:24 +00:00
Jakob Stoklund Olesen
755ba2ee84 Use the right floating point load/store instructions in PPCInstrInfo::foldMemoryOperandImpl().
The PowerPC floating point registers can represent both f32 and f64 via the
two register classes F4RC and F8RC. F8RC is considered a subclass of F4RC to
allow cross-class coalescing. This coalescing only affects whether registers
are spilled as f32 or f64.

Spill slots must be accessed with load/store instructions corresponding to the
class of the spilled register. PPCInstrInfo::foldMemoryOperandImpl was looking
at the instruction opcode which is wrong.

X86 has similar floating point register classes, but doesn't try to fold
memory operands, so there is no problem there.

llvm-svn: 97262
2010-02-26 21:09:24 +00:00
Dale Johannesen
516867fd79 Move dbg_value generation to target-independent FastISel,
as X86 is currently the only FastISel target.  Per review.

llvm-svn: 97255
2010-02-26 20:01:55 +00:00
Sanjiv Gupta
487b119dc9 The cloner has nothing to do if any of the main or ISR entrypoints are not
present in the module.

llvm-svn: 97232
2010-02-26 18:32:18 +00:00
Sanjiv Gupta
8a971a1dc5 Reapply things reverted back in 97220, with the fixed test case.
llvm-svn: 97228
2010-02-26 17:59:28 +00:00
Dan Gohman
e382448355 movl is a cheaper way to materialize 0 without clobbering EFLAGS than movabsq.
llvm-svn: 97227
2010-02-26 16:49:27 +00:00
Richard Osborne
fe30a8a2c1 Fix XCoreTargetLowering::isLegalAddressingMode() to handle VoidTy.
Previously LoopStrengthReduce would sometimes be unable to find
a legal formula, causing an assertion failure.

llvm-svn: 97226
2010-02-26 16:44:51 +00:00
Chandler Carruth
78f5a17a0c Revert r97211 and r97213 to get the build green again.
llvm-svn: 97220
2010-02-26 08:43:09 +00:00
Sanjiv Gupta
56ab10dfb2 Currently in LLVM, names of libcalls are assigned during TargetLowering
object construction. There is no provision to change them when the 
code for a function generated. 
So we have to change these names while printing assembly.

llvm-svn: 97213
2010-02-26 07:31:15 +00:00
Sanjiv Gupta
7caf38490a Before converting an operand to mem, check if it is legal to do so.
llvm-svn: 97211
2010-02-26 07:27:35 +00:00
Dan Gohman
e794389ad0 Delete a bunch of redundant predicates.
llvm-svn: 97201
2010-02-26 01:14:30 +00:00
Johnny Chen
47fd2a4774 Added the following 32-bit Thumb instructions for disassembly only: SMC, RFE,
and SRS.

llvm-svn: 97164
2010-02-25 20:25:24 +00:00
Johnny Chen
8737e46553 Added the 32-bit Thumb instructions (BXJ) for disassembly only.
llvm-svn: 97163
2010-02-25 19:05:29 +00:00
Johnny Chen
b05edcba36 Added the 32-bit Thumb instructions (MRS and MSR) for disassembly only.
llvm-svn: 97159
2010-02-25 18:46:43 +00:00
Daniel Dunbar
7448368e5b Fix TextAlignFillValue in a few places
llvm-svn: 97151
2010-02-25 18:07:10 +00:00
Johnny Chen
30a910f458 Added the following 16-bit Thumb instructions for disassembly only: YIELD, WFE,
WFI, SEV, SETEND.

llvm-svn: 97149
2010-02-25 17:51:03 +00:00
Dan Gohman
084112437d Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.

llvm-svn: 97137
2010-02-25 15:20:39 +00:00
Sanjiv Gupta
11798e6c79 Each field of auxiliary debug entry is only 1 byte long.
llvm-svn: 97108
2010-02-25 03:54:49 +00:00
Johnny Chen
bbe3592817 Added tNOP for disassembly only.
llvm-svn: 97105
2010-02-25 03:28:51 +00:00