Rafael Espindola
257de5c4a2
Implement cfi_def_cfa_register.
...
llvm-svn: 122612
2010-12-29 00:26:06 +00:00
Rafael Espindola
061209eaf3
Initial .cfi_offset implementation.
...
llvm-svn: 122611
2010-12-29 00:09:59 +00:00
Rafael Espindola
d93ec3572d
Don't produce a "DW_CFA_advance_loc 0".
...
llvm-svn: 122609
2010-12-28 23:38:03 +00:00
Rafael Espindola
3fdd045643
Implement .cfi_remember_state and .cfi_restore_state.
...
llvm-svn: 122602
2010-12-28 18:36:23 +00:00
Rafael Espindola
c97d642bf7
Relax address updates in the eh_frame section.
...
llvm-svn: 122591
2010-12-28 05:39:27 +00:00
Rafael Espindola
0552cb0638
Start adding basic support for emitting the call frame instructions.
...
llvm-svn: 122590
2010-12-28 04:15:37 +00:00
Rafael Espindola
12c30aed07
Add support for .cfi_lsda.
...
llvm-svn: 122584
2010-12-27 15:56:22 +00:00
Daniel Dunbar
2d0cf8e149
MC/Mach-O/Thumb: Select appropriate relocation types for Thumb.
...
llvm-svn: 122583
2010-12-27 14:49:49 +00:00
Rafael Espindola
7f947794d7
Handle reloc_riprel_4byte_movq_load. Should make the bots happy.
...
llvm-svn: 122579
2010-12-27 02:03:24 +00:00
Rafael Espindola
e7e67fce10
Add support for the same encodings of the personality function that gnu as
...
supports.
llvm-svn: 122577
2010-12-27 00:36:05 +00:00
Rafael Espindola
2ebe553431
Add support for @note. Patch by Jörg Sonnenberger.
...
llvm-svn: 122568
2010-12-26 21:30:59 +00:00
Rafael Espindola
99f1527316
Add basic support for .cfi_personality.
...
llvm-svn: 122566
2010-12-26 20:20:31 +00:00
Chris Lattner
2129ce0891
Generalize a previous change, fixing PR8855 - an valid large immediate
...
rejected by the mc assembler.
llvm-svn: 122557
2010-12-25 21:36:35 +00:00
Daniel Dunbar
592854a10a
MC/Mach-O/ARM: Start handling some Thumb branches.
...
llvm-svn: 122547
2010-12-24 16:41:46 +00:00
Kevin Enderby
ff7e68c5e7
In llvm-mc parse a Hash token as a full line comment. Allows handling of
...
preprocessed .s files and matches darwin gas. rdar://8798690
Also fix a comment on the next line of AsmParser.cpp after this new code.
llvm-svn: 122531
2010-12-24 00:12:02 +00:00
Daniel Dunbar
e6ec0e7149
MC/Mach-O/ARM: Don't try to use scattered relocs for BR24 fixups.
...
llvm-svn: 122441
2010-12-22 21:26:43 +00:00
Rafael Espindola
5004de4d8b
Add reduced test from 8845.
...
llvm-svn: 122438
2010-12-22 21:15:13 +00:00
Daniel Dunbar
cb8ac619a2
MC/Mach-O/ARM: We always use the SECTDIFF reloc type on ARM, which is
...
esp. important given that the LOCAL_SECTDIFF enumeration got redefined.
llvm-svn: 122412
2010-12-22 16:52:19 +00:00
Daniel Dunbar
e44a2c1166
MC/Mach-O/ARM: Add enough relocation logic to get BR24 relocations.
...
llvm-svn: 122407
2010-12-22 16:19:24 +00:00
Rafael Espindola
7c995a90fc
Simplify the handling of .size expressions.
...
llvm-svn: 122404
2010-12-22 16:03:00 +00:00
Wesley Peck
e8ec7a4d1f
Teach the MBlaze disassembler to disassemble special purpose registers.
...
llvm-svn: 122269
2010-12-20 21:18:04 +00:00
Roman Divacky
42b3eee794
Set the value of absolute symbols.
...
llvm-svn: 122268
2010-12-20 21:14:39 +00:00
Roman Divacky
13b5260f62
Print all 64bits for st_value and st_size. Adjust tests accordingly.
...
llvm-svn: 122263
2010-12-20 20:49:43 +00:00
Wesley Peck
af2890a051
Teach the MBlaze asm parser how to parse special purpose register names.
...
llvm-svn: 122261
2010-12-20 20:43:24 +00:00
Roman Divacky
ed5bb14415
Add support for lexing single quotes like 'c'.
...
This fixed 8615.
llvm-svn: 122150
2010-12-18 08:56:37 +00:00
Rafael Espindola
4c1b83e53f
Add a test that shows that we produce no fixups when computing the difference
...
of two symbols in the same fragment.
llvm-svn: 122145
2010-12-18 05:07:45 +00:00
Rafael Espindola
dff6c18a5e
Test for push being relaxed.
...
llvm-svn: 122124
2010-12-18 01:16:59 +00:00
Daniel Dunbar
1f9fd0b79b
MC/Expr: Implemnt more aggressive folding during symbol evaluation using
...
IsSymbolRefDifferenceFullyResolved(). For example, we will now fold away
something like:
--
_a:
...
L0:
...
L1:
...
.long (L1 - L0) / 2
--
llvm-svn: 122043
2010-12-17 05:50:33 +00:00
Rafael Espindola
bd13ceed72
"Fix" FDE alignment to match what gas does.
...
llvm-svn: 122006
2010-12-17 00:28:02 +00:00
Rafael Espindola
3ee4530406
Make pushq produce signed relocations.
...
llvm-svn: 122005
2010-12-16 22:50:01 +00:00
Bob Wilson
438a9a1367
Add Neon VCVT instructions for f32 <-> f16 conversions.
...
Clang is now providing intrinsics for these and so we need to support them
in the backend. Radar 8068427.
llvm-svn: 121902
2010-12-15 22:14:12 +00:00
Bob Wilson
1082705e72
Fix misspelled target triples in MC/ARM test commands.
...
llvm-svn: 121901
2010-12-15 22:14:01 +00:00
Rafael Espindola
94d026d157
Relax alignment fragments.
...
With this we don't need the EffectiveSize field anymore. Without that field
LayoutFragment only updates offsets and we don't need to invalidate the
current fragment when it is relaxed (only the ones following it).
This is also a very small improvement in the accuracy of the layout info as
we now use the after relaxation size immediately.
llvm-svn: 121857
2010-12-15 08:45:53 +00:00
Rafael Espindola
f55f520a7a
Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.
...
Since we now don't update addresses so early, we might relax a bit more than
we need to. This is simillar to the issue in PR8467.
llvm-svn: 121856
2010-12-15 07:39:29 +00:00
Kevin Enderby
6b3ae489f8
Add some more MC tests for ARM arithmetic instructions that update or don't
...
update the condition codes. These come from my test generator and are just
the ones that MC currently assembles correctly.
llvm-svn: 121830
2010-12-15 01:24:36 +00:00
Daniel Dunbar
3f9b9dc852
MC/ARM: Fix-up fixup offset for fixup_arm_branch target specific fixup.
...
llvm-svn: 121772
2010-12-14 17:37:16 +00:00
Rafael Espindola
0e665e502d
Fixed version of 121434 with no new memory leaks.
...
llvm-svn: 121471
2010-12-10 07:39:47 +00:00
Rafael Espindola
011e168728
Revert my previous patch to make the valgrind bots happy.
...
llvm-svn: 121461
2010-12-10 04:01:09 +00:00
Rafael Espindola
03ad1e8f1f
Initial support for the cfi directives. This is just enough to get
...
f:
.cfi_startproc
nop
.cfi_endproc
assembled (on ELF).
llvm-svn: 121434
2010-12-09 23:48:29 +00:00
Kevin Enderby
55cb19813e
Add support for parsing ARM arithmetic instructions that update or don't update
...
the condition codes. Where the ones that do have an 's' suffix and the ones
that don't don't have the suffix. The trick is if MatchInstructionImpl() fails
we try again after adding a CCOut operand with the correct value and removing
the 's' if present. Four simple test cases added for now, lots more to come.
llvm-svn: 121401
2010-12-09 19:19:43 +00:00
Kevin Enderby
988dab6b5c
Allow a slash, '/', as a prefix separator for X86. rdar://8741045
...
llvm-svn: 121320
2010-12-08 23:57:59 +00:00
Rafael Espindola
866531d633
Fix absolute recording of differences of symbols in two sections. Reduced from ctor_dtor_count-2.cpp.
...
llvm-svn: 121152
2010-12-07 17:12:32 +00:00
Rafael Espindola
da64b6aa50
Fix relocations with weak definitions.
...
llvm-svn: 121114
2010-12-07 05:57:28 +00:00
Rafael Espindola
9ede5ef045
Fix pcrel relocations that cross sections.
...
llvm-svn: 121107
2010-12-07 03:50:14 +00:00
Rafael Espindola
c98cc0b286
Fix a crash reduced from gcc produced assembly.
...
llvm-svn: 121085
2010-12-07 01:09:54 +00:00
Owen Anderson
81f8b084e6
Second attempt at converting Thumb2's LDRpci, including updating the gazillion places that need to know about it.
...
llvm-svn: 121082
2010-12-07 00:45:21 +00:00
Rafael Espindola
3e954d16f4
Second try at making direct object emission produce the same results
...
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc
bootstrap on darwin10 using darwin9's assembler and linker.
llvm-svn: 121006
2010-12-06 17:27:56 +00:00
Rafael Espindola
f56c11276e
Don't use PadSectionToAlignment on windows.
...
llvm-svn: 120978
2010-12-06 03:03:44 +00:00
Rafael Espindola
9215947c83
There are two reasons why we might want to use
...
foo = a - b
.long foo
instead of just
.long a - b
First, on darwin9 64 bits the assembler produces the wrong result. Second,
if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not
consider a - b to be a constant but will if the dummy foo is created.
Split how we handle these cases. The first one is something MC should take care
of. The second one has to be handled by the caller.
llvm-svn: 120889
2010-12-04 03:21:47 +00:00
Rafael Espindola
50b6170457
Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoid
...
doing that if the target is darwin10 or newer.
This fixes
*) Direct object emission was producing objects without the workaround on
darwin9.
*) Assembly printing was producing objects with the workaround on linux.
llvm-svn: 120866
2010-12-04 00:31:13 +00:00
Jim Grosbach
8cef570ed9
Encode the 32-bit wide Thumb (and Thumb2) instructions with the high order
...
halfword being emitted to the stream first. rdar://8728174
llvm-svn: 120848
2010-12-03 22:31:40 +00:00
Jim Grosbach
c69ad2176a
When using the 'push' mnemonic for Thumb2 stmdb, be explicit when it's the
...
32-bit wide version by adding the .w suffix.
llvm-svn: 120838
2010-12-03 20:33:01 +00:00
Rafael Espindola
16b64c646a
Rename temporary symbols if they conflict with artificial symbols created
...
by the assembler. This was blocking parsing any large .s produced by clang for
example.
Fixes PR8596.
llvm-svn: 120603
2010-12-01 20:46:11 +00:00
Owen Anderson
8802c68592
Add correct encodings for STRD and LDRD, including fixup support. Additionally, update these to unified syntax.
...
llvm-svn: 120589
2010-12-01 19:18:46 +00:00
Owen Anderson
e2a8781847
Add tests for more forms of Thumb2 loads and stores.
...
llvm-svn: 120436
2010-11-30 18:15:21 +00:00
Bill Wendling
ae920bcc50
Add parsing for the Thumb t_addrmode_s4 addressing mode. This can almost
...
certainly be made more generic. But it does allow us to parse something like:
ldr r3, [r2, r4]
correctly in Thumb mode.
llvm-svn: 120408
2010-11-30 07:44:32 +00:00
Owen Anderson
b6e1c56c79
Correct Thumb2 encodings for a much wider range of loads and stores.
...
llvm-svn: 120364
2010-11-30 00:14:31 +00:00
Owen Anderson
14abbb1a2e
Provide Thumb2 encodings for basic loads and stores.
...
llvm-svn: 120340
2010-11-29 22:44:32 +00:00
Benjamin Kramer
84bf47f2d8
Fix some broken CHECK lines.
...
llvm-svn: 120332
2010-11-29 22:34:55 +00:00
Bill Wendling
c0055893db
Add more Thumb encodings.
...
llvm-svn: 120279
2010-11-29 01:07:48 +00:00
Bill Wendling
b54752da15
More Thumb encodings.
...
llvm-svn: 120278
2010-11-29 01:00:43 +00:00
Bill Wendling
8f0b624061
Add Thumb encodings for REV instructions.
...
llvm-svn: 120277
2010-11-29 00:42:50 +00:00
Bill Wendling
d233cab1eb
Add more Thumb encodings.
...
llvm-svn: 120272
2010-11-29 00:18:15 +00:00
Chris Lattner
a11c5c5c32
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
6f5680f4a0
Implement the data16 prefix.
...
llvm-svn: 120224
2010-11-27 20:29:45 +00:00
Daniel Dunbar
6153e5cd7b
macho-dump: Fix typo.
...
llvm-svn: 120185
2010-11-27 04:00:06 +00:00
Rafael Espindola
e3dc1c951c
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
a8488b04e1
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
1a81f03f87
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
97690e2d7d
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
81ecba9559
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
38daba991e
Testcase for r120017.
...
llvm-svn: 120099
2010-11-24 18:03:57 +00:00
Rafael Espindola
dc299d2615
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
6f069fc35f
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
a472e7be70
Add encoding for ARM "trap" instruction.
...
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Chris Lattner
4aaa7fbb98
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
ee6aea622f
Handle PCRel relocations with absolute values. Fixes PR8656.
...
llvm-svn: 119917
2010-11-21 00:48:25 +00:00
Kevin Enderby
214e641d8d
Added support for the Mach-O .symbol_resolver directive. rdar://8673046
...
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Bill Wendling
50a1812023
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
ef43273c51
Add support for parsing the writeback ("!") token.
...
llvm-svn: 119761
2010-11-18 23:43:05 +00:00
Owen Anderson
c0d5d13769
More tests.
...
llvm-svn: 119756
2010-11-18 23:30:10 +00:00
Owen Anderson
ca14474db4
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
25dc3a4fe6
More Thumb2 encodings.
...
llvm-svn: 119737
2010-11-18 21:15:19 +00:00
Owen Anderson
eec8c82d32
Fill out the set of Thumb2 multiplication operator encodings.
...
llvm-svn: 119733
2010-11-18 20:32:18 +00:00
Owen Anderson
b7970b2c6a
Try again at providing Thumb2 encodings for basic multiplication operators.
...
llvm-svn: 119601
2010-11-18 01:08:42 +00:00
Owen Anderson
e8906ba112
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
47a64ab90c
Provide correct Thumb2 encodings for basic multiplication operators.
...
llvm-svn: 119593
2010-11-18 00:19:10 +00:00
Wesley Peck
890a8357af
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
ea6ac4cdff
Second attempt at correct encodings for Thumb2 bitfield instructions.
...
llvm-svn: 119575
2010-11-17 22:16:31 +00:00
Owen Anderson
2adebbb603
Revert r119551, which broke buildbots.
...
llvm-svn: 119555
2010-11-17 20:48:51 +00:00
Owen Anderson
c7750780fc
Provide Thumb2 encodings for bitfield instructions.
...
llvm-svn: 119551
2010-11-17 20:35:29 +00:00
Owen Anderson
d88cfe5453
More miscellaneous Thumb2 encodings.
...
llvm-svn: 119546
2010-11-17 19:57:38 +00:00
Rafael Espindola
b6fcca35a2
Add support for .int.
...
llvm-svn: 119512
2010-11-17 16:24:40 +00:00
Rafael Espindola
9186952072
Add support for .2byte, .4byte and .8byte.
...
Fixes PR8631.
llvm-svn: 119511
2010-11-17 16:15:42 +00:00
Bill Wendling
f0a1acba8c
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
47e7ef8c8f
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
e15bf6b98d
Test encodings for LDM and STM.
...
llvm-svn: 119315
2010-11-16 01:38:20 +00:00
Owen Anderson
686fae59e6
Add Thumb2 encodings for mov and friends.
...
llvm-svn: 119295
2010-11-16 00:29:56 +00:00
Rafael Espindola
53a8ae85b7
Change the 11 byte nop to be a single instruction.
...
llvm-svn: 119286
2010-11-15 23:10:30 +00:00
Owen Anderson
db1a4541c2
Provide Thumb2 encodings for sxtb and friends.
...
llvm-svn: 119185
2010-11-15 21:12:05 +00:00