Commit Graph

821 Commits

Author SHA1 Message Date
Owen Anderson 50d662b6cb Provide Thumb2 encodings for basic loads and stores.
llvm-svn: 120340
2010-11-29 22:44:32 +00:00
Benjamin Kramer e6840ef4b3 Fix some broken CHECK lines.
llvm-svn: 120332
2010-11-29 22:34:55 +00:00
Bill Wendling 232e52cfb7 Add more Thumb encodings.
llvm-svn: 120279
2010-11-29 01:07:48 +00:00
Bill Wendling ccba1a8d95 More Thumb encodings.
llvm-svn: 120278
2010-11-29 01:00:43 +00:00
Bill Wendling 9600e97c60 Add Thumb encodings for REV instructions.
llvm-svn: 120277
2010-11-29 00:42:50 +00:00
Bill Wendling 775899eb2e Add more Thumb encodings.
llvm-svn: 120272
2010-11-29 00:18:15 +00:00
Chris Lattner 7e8a99b1c3 fix PR8686, accepting a 'b' suffix at the end of all the setcc
instructions.  I choose to handle this with an asmparser hack,
though it could be handled by changing all the instruction definitions
to allow be "setneb" instead of "setne".  The asm parser hack is
better in this case, because we want the disassembler to produce
setne, not setneb.

llvm-svn: 120260
2010-11-28 20:23:50 +00:00
Rafael Espindola eab0800695 Implement the data16 prefix.
llvm-svn: 120224
2010-11-27 20:29:45 +00:00
Daniel Dunbar 1440fd3539 macho-dump: Fix typo.
llvm-svn: 120185
2010-11-27 04:00:06 +00:00
Rafael Espindola 7c2acd022e Use multiple 0x66 prefixes so that all nops up to 15 bytes are a single instruction.
llvm-svn: 120147
2010-11-25 17:14:16 +00:00
Rafael Espindola f8e127eaf6 Factor some code to parseSectionFlags and fix the default type of a section.
llvm-svn: 120145
2010-11-25 15:32:56 +00:00
Rafael Espindola 9f75d5df0b Behave a bit more like gnu as and use the symbol (instead of the section)
for any relocation to a symbol defined in a tls section.

llvm-svn: 120121
2010-11-24 21:57:39 +00:00
Rafael Espindola 708ac4d6ad Relocate with the symbol if the relocation is of kind NTPOFF.
Patch by David Meyer, I added the test.

llvm-svn: 120104
2010-11-24 19:23:50 +00:00
Rafael Espindola e98d483b71 Fix and add tests for all cases in x86 and x86_64 where gnu as implicitly
sets the type of a symbol to STT_TLS.

llvm-svn: 120100
2010-11-24 18:51:21 +00:00
Rafael Espindola af9a7a3e92 Testcase for r120017.
llvm-svn: 120099
2010-11-24 18:03:57 +00:00
Rafael Espindola 4e70ac7b68 If a symbol is used as tls, mark it as tls even if not declare as so. Probably
fixes PR8659.

llvm-svn: 120076
2010-11-24 02:19:40 +00:00
Rafael Espindola 3c7cab1402 Produce a relocation for pcrel absolute values. Based on a patch by David Meyer.
llvm-svn: 120006
2010-11-23 07:20:12 +00:00
Bill Wendling c01d679928 Add encoding for ARM "trap" instruction.
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Chris Lattner b4cd1819fa implement PR8524, apparently mainline gas accepts movq as an alias for movd
when transfering between i64 gprs and mmx regs.

llvm-svn: 119931
2010-11-21 08:18:57 +00:00
Rafael Espindola 26cb15a549 Handle PCRel relocations with absolute values. Fixes PR8656.
llvm-svn: 119917
2010-11-21 00:48:25 +00:00
Kevin Enderby 8be14414f6 Added support for the Mach-O .symbol_resolver directive. rdar://8673046
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Bill Wendling 945b776b6e Add MC encodings for some Thumb instructions. Test for a few of them. The "bx
lr" instruction cannot be tested just yet. It requires matching a "condition
code", but adding one of those makes things go south quickly...

llvm-svn: 119774
2010-11-19 01:33:10 +00:00
Bill Wendling 2063b84297 Add support for parsing the writeback ("!") token.
llvm-svn: 119761
2010-11-18 23:43:05 +00:00
Owen Anderson 690fa953e1 More tests.
llvm-svn: 119756
2010-11-18 23:30:10 +00:00
Owen Anderson 3517585249 Fix encodings for pkhbt, and fix some tests where I accidentally tested ARM mode instead of Thumb2.
llvm-svn: 119755
2010-11-18 23:29:56 +00:00
Owen Anderson 3fec5ff14b More Thumb2 encodings.
llvm-svn: 119737
2010-11-18 21:15:19 +00:00
Owen Anderson 3625098459 Fill out the set of Thumb2 multiplication operator encodings.
llvm-svn: 119733
2010-11-18 20:32:18 +00:00
Owen Anderson d127e7174b Try again at providing Thumb2 encodings for basic multiplication operators.
llvm-svn: 119601
2010-11-18 01:08:42 +00:00
Owen Anderson 28883834e1 Revert r119593 while I figure out my testing disagrees with the buildbot.
llvm-svn: 119597
2010-11-18 00:42:51 +00:00
Owen Anderson 64aaddcd64 Provide correct Thumb2 encodings for basic multiplication operators.
llvm-svn: 119593
2010-11-18 00:19:10 +00:00
Wesley Peck 307e4688c5 Now that the MBlaze backend is in its own directory, split the test cases into multiple files for different types of instructions.
llvm-svn: 119580
2010-11-17 22:54:43 +00:00
Owen Anderson 55425e7f78 Second attempt at correct encodings for Thumb2 bitfield instructions.
llvm-svn: 119575
2010-11-17 22:16:31 +00:00
Owen Anderson 6c37ceb182 Revert r119551, which broke buildbots.
llvm-svn: 119555
2010-11-17 20:48:51 +00:00
Owen Anderson 7464116bde Provide Thumb2 encodings for bitfield instructions.
llvm-svn: 119551
2010-11-17 20:35:29 +00:00
Owen Anderson bced7ae046 More miscellaneous Thumb2 encodings.
llvm-svn: 119546
2010-11-17 19:57:38 +00:00
Rafael Espindola b67912d5cd Add support for .int.
llvm-svn: 119512
2010-11-17 16:24:40 +00:00
Rafael Espindola 5c996894bd Add support for .2byte, .4byte and .8byte.
Fixes PR8631.

llvm-svn: 119511
2010-11-17 16:15:42 +00:00
Bill Wendling 9898ac97fd Proper encoding for VLDM and VSTM instructions. The register lists for these
instructions have to distinguish between lists of single- and double-precision
registers in order for the ASM matcher to do a proper job. In all other
respects, a list of single- or double-precision registers are the same as a list
of GPR registers.

llvm-svn: 119460
2010-11-17 04:32:08 +00:00
Rafael Espindola 7d19efd6ff A bit more of gnu as compatibility when handling relocations with aliases.
llvm-svn: 119328
2010-11-16 04:11:46 +00:00
Bill Wendling 92756fff57 Test encodings for LDM and STM.
llvm-svn: 119315
2010-11-16 01:38:20 +00:00
Owen Anderson 05a8daee21 Add Thumb2 encodings for mov and friends.
llvm-svn: 119295
2010-11-16 00:29:56 +00:00
Rafael Espindola d1993eb2a4 Change the 11 byte nop to be a single instruction.
llvm-svn: 119286
2010-11-15 23:10:30 +00:00
Owen Anderson 7d97a99f4c Provide Thumb2 encodings for sxtb and friends.
llvm-svn: 119185
2010-11-15 21:12:05 +00:00
Owen Anderson 2a3c22efba Add Thumb2 encodings for comparison and shift operators.
llvm-svn: 119176
2010-11-15 19:58:36 +00:00
Owen Anderson 0e7d728327 Add correct Thumb2 encodings for mvn and friends.
llvm-svn: 119170
2010-11-15 18:45:17 +00:00
Rafael Espindola 8c3039b67b Change MCExpr::EvaluateAsRelocatableImpl of variables to return the original
variable if recursing fails to simplify it.

Factor AliasedSymbol to be a method of MCSymbol.

Update MCAssembler::EvaluateFixup to match the change in
EvaluateAsRelocatableImpl.

Remove the WeakRefExpr hack, as the object writer now sees the weakref with
no extra effort needed.

Nothing else is using MCTargetExpr, but keep it for now.

Now that the ELF writer sees relocations with aliases, handle

    .weak    foo2
foo2:
    .weak    bar2
    .set    bar2,foo2
    .quad    bar2

the same way gas does and produce a relocation with bar2.

llvm-svn: 119152
2010-11-15 16:33:49 +00:00
Rafael Espindola 46c79ef113 Fix PR8565.
This moves most of the isUsed logic to the MCSymbol itself. With this we
get a bit more relaxed about allowing definitions after uses: uses that
don't evaluate their argument immediately (jmp foo) are accepted.

ddunbar, this was the smallest compromise I could think of that lets us
accept gcc (and clang!) assembly.

llvm-svn: 119144
2010-11-15 14:40:36 +00:00
Rafael Espindola 240028d11d Move the logic to decide with which symbol we produce a relocation (if any) to
a central location. This also makes us a bit more compatible with gas.

llvm-svn: 119094
2010-11-14 23:53:26 +00:00
Rafael Espindola a7d0bed336 Fix another case of a .comm directive without a corresponding .type
directive.

llvm-svn: 119073
2010-11-14 21:11:16 +00:00
Rafael Espindola b05ef7377a Fix the type of a symbol created with .comm and no corresponding .type.
llvm-svn: 119060
2010-11-14 19:40:55 +00:00