Daniel Dunbar
14b4e621b0
MC/Mach-O: Use the SECTDIFF relocation type for (A - B + constant) where A is external.
...
- I'm not sure why, but this is what 'as' does.
llvm-svn: 98115
2010-03-10 00:58:25 +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
Daniel Dunbar
f33a8c5ab6
MC/Mach-O: For PCrel relocations, we need to compensate for the PCrel adjustment when determining if we need a scattered relocation.
...
llvm-svn: 98082
2010-03-09 21:27:58 +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
42f1b1b255
MC/Macho-O: Align the zerofill section itself to the maximum alignment.
...
llvm-svn: 97991
2010-03-08 22:03:42 +00:00
Daniel Dunbar
3292ad448b
MC/Mach-O: Fix address compution for zero fill sections.
...
llvm-svn: 97984
2010-03-08 21:10:42 +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
Kevin Enderby
11cce486ac
This is a patch to the assembler frontend to detect when aligning a text
...
section with TextAlignFillValue and calls EmitCodeAlignment() instead of
calling EmitValueToAlignment(). This allows x86 assembly code to be aligned
with optimal nops.
llvm-svn: 97158
2010-02-25 18:46:04 +00:00
Chris Lattner
b29b154904
make pcrel immediate values relative to the start of the field,
...
not the end of the field, fixing rdar://7651978
llvm-svn: 96330
2010-02-16 05:03:17 +00:00
Chris Lattner
8530ba626c
add encoder support and tests for rdtscp
...
llvm-svn: 96076
2010-02-13 03:42:24 +00:00
Daniel Dunbar
09733841aa
MC/AsmParser: Attempt to constant fold expressions up-front. This ensures we avoid fixups for obvious cases like '-(16)'.
...
llvm-svn: 96064
2010-02-13 01:28:07 +00:00
Chris Lattner
d4fe983f23
rip out the 'heinous' x86 MCCodeEmitter implementation.
...
We still have the templated X86 JIT emitter, *and* the
almost-copy in X86InstrInfo for getting instruction sizes.
llvm-svn: 96059
2010-02-13 00:49:29 +00:00
Chris Lattner
5b01ab848c
remove special cases for vmlaunch, vmresume, vmxoff, and swapgs
...
fix swapgs to be spelled right.
llvm-svn: 96058
2010-02-13 00:41:14 +00:00
Daniel Dunbar
4ef0be5df5
MC/X86: Push immediate operands as immediates not expressions when possible.
...
llvm-svn: 96055
2010-02-13 00:17:21 +00:00
Chris Lattner
c80a6de0a9
add some disassemble testcases for weird instructions
...
llvm-svn: 96045
2010-02-12 23:46:48 +00:00
Chris Lattner
4170bb81da
implement the rest of correct x86-64 encoder support for
...
rip-relative addresses, and add a testcase.
llvm-svn: 96040
2010-02-12 23:24:09 +00:00
Chris Lattner
9307e00dc0
fix the encodings of monitor and mwait, which were completely
...
busted in both encoders. I'm not bothering to fix it in the
old one at this point.
llvm-svn: 95947
2010-02-12 01:06:22 +00:00
Kevin Enderby
b1094f1489
Remove the few # TAILCALL comments that snuck in. As they may fail on linux.
...
llvm-svn: 95827
2010-02-11 00:18:12 +00:00
Kevin Enderby
3763f70025
Update the X86 assembler matcher test case now that a few more things match
...
with some of the recent changes that have gone into llvm-mc.
llvm-svn: 95826
2010-02-11 00:13:43 +00:00
Daniel Dunbar
b20be19ae6
MC/X86 AsmMatcher: Fix a use after free spotted by d0k, and de-XFAIL
...
x86_32-encoding.s in on expectation of it passing.
llvm-svn: 95806
2010-02-10 21:19:28 +00:00
Daniel Dunbar
7f6e51fc2a
XFAIL this on linux until I figure out what is happening.
...
llvm-svn: 95804
2010-02-10 21:01:04 +00:00
Kevin Enderby
9be8c4c590
Replace this file containing 4 tests of x86 32-bit encodings with a file
...
containing the subset of the full auto generated test case that currently
encodes correctly. Again it is useful as we bring up the the new encoder
to make sure currently working stuff stays working.
llvm-svn: 95791
2010-02-10 19:13:56 +00:00
Kevin Enderby
f31bc700f1
Fix the encoding of the movntdqa X86 instruction. It was missing the 0x66
...
prefix which is part of the opcode encoding.
llvm-svn: 95729
2010-02-10 00:10:31 +00:00
Chris Lattner
2457a30898
fix X86 encoder to output [disp] only addresses with no SIB byte
...
in X86-32 mode. This is still required in x86-64 mode to avoid
forming [disp+rip] encoding. Rewrite the SIB byte decision logic
to be actually understandable.
llvm-svn: 95693
2010-02-09 21:47:19 +00:00
Chris Lattner
682f64dc8d
Implement x86 asm parsing support for %st and %st(4)
...
llvm-svn: 95634
2010-02-09 00:49:22 +00:00
Chris Lattner
e1b8c529a4
fix incorrect encoding of SBB8mi that Kevin noticed.
...
llvm-svn: 95448
2010-02-05 22:56:11 +00:00
Chris Lattner
9d4e878b6a
fix a case where we'd mis-encode fisttp because of an incorrect (and
...
redundant with a correct one) pattern that was added for the disassembler.
llvm-svn: 95446
2010-02-05 22:49:06 +00:00
Chris Lattner
bec530a499
remove fixme
...
llvm-svn: 95444
2010-02-05 22:46:46 +00:00
Kevin Enderby
57859abd72
Added support for X86 instruction prefixes so llvm-mc can assemble them. The
...
Lock prefix, Repeat string operation prefixes and the Segment override prefixes.
Also added versions of the move string and store string instructions without the
repeat prefixes to X86InstrInfo.td. And finally marked the rep versions of
move/store string records in X86InstrInfo.td as isCodeGenOnly = 1 so tblgen is
happy building the disassembler files.
llvm-svn: 95252
2010-02-03 21:04:42 +00:00
Daniel Dunbar
c6f8382263
AsmParser/X86: Add temporary hack to allow parsing "sal". Eventually we need
...
some mechanism for specifying alternative syntaxes, but I'm not sure what form
that should take yet.
llvm-svn: 95158
2010-02-02 23:46:47 +00:00
Chris Lattner
c49053be3f
remove the # TAILCALL markers, which was causing the to fail.
...
It's unclear if the matcher is nondeterminstic of what here,
but I'm getting matches without TAILCALL and some other hosts
are getting matches with it.
llvm-svn: 95149
2010-02-02 22:36:29 +00:00
Daniel Dunbar
d01668aaf5
MCAssembler/Darwin: Add a test (on Darwin) that we assemble a bunch of
...
instructions exactly like 'as', and produce equivalent .o files.
llvm-svn: 95143
2010-02-02 22:00:15 +00:00
Daniel Dunbar
eb0b81040a
MC/Mach-O: Set SOME_INSTRUCTIONS bit for sections.
...
llvm-svn: 95135
2010-02-02 21:44:01 +00:00
Chris Lattner
7c37b4942d
this apparently depends on the host somehow.
...
llvm-svn: 95122
2010-02-02 20:57:28 +00:00
Chris Lattner
136eeef6b6
disable this test for now.
...
llvm-svn: 95120
2010-02-02 20:41:39 +00:00
Kevin Enderby
a10566900d
Added another version of the X86 assembler matcher test case.
...
This test case is different subset of the full auto generated test case, and a
larger subset that is in x86_32-bit.s (that set will encode correctly). These
instructions can pass though llvm-mc as it were a logical cat(1) and then
reassemble to the same instruction. It is useful as we bring up the parser and
matcher so we don't break things that currently work.
llvm-svn: 95107
2010-02-02 19:05:57 +00:00
Daniel Dunbar
23e8bc782c
MC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
...
something totally broken and parsing them as immediates, but the .td file also
had the wrong match class so things sortof worked. Except, that is, that we
would parse
movl $0, %eax
as
movl 0, %eax
Feel free to guess how well that worked.
llvm-svn: 94869
2010-01-30 01:02:48 +00:00
Daniel Dunbar
b0a870919b
MC/X86: Add a nice X86 assembler matcher test case from Kevin Enderby.
...
- This test case is auto generated, and has been verified to round-trip
correctly through llvm-mc by checking the assembled .o file before and after
piping through llvm-mc. It will be extended over time as the matcher grows
support for more instructions.
llvm-svn: 94857
2010-01-29 23:32:40 +00:00
Chris Lattner
5f919913e8
wirte up .file and .file to the mc asmparser.
...
llvm-svn: 94438
2010-01-25 19:02:58 +00:00
Chris Lattner
5d31547fec
fix a parsing problem on instructions like:
...
movw $8, (_cost_table_-L97$pb)+66(%eax)
After the parens, we could still have a binop.
llvm-svn: 94345
2010-01-24 01:07:33 +00:00
Chris Lattner
e46549ed67
teach MCAsmStreamer::EmitBytes to use .ascii and .asciz
...
llvm-svn: 94259
2010-01-23 00:15:00 +00:00
Daniel Dunbar
5d1a686840
Mark EH_RETURN64 as CodeGenOnly.
...
llvm-svn: 94205
2010-01-22 20:16:37 +00:00
Chris Lattner
7c3ff46d45
add an MCAsmStreamer::EmitFill specialization of EmitFill that
...
emits one directive instead of N. Not doing this would be a
significant regression on the # bytes generated by .fill.
llvm-svn: 93889
2010-01-19 18:52:28 +00:00
Chris Lattner
79166b498e
only darwin has zerofill
...
llvm-svn: 93866
2010-01-19 06:21:23 +00:00
Chris Lattner
de6faded57
specify a triple to use, fixing the test on non-x86-64 hosts.
...
llvm-svn: 91900
2009-12-22 07:01:12 +00:00
Chris Lattner
226e849772
various cleanups, make the disassemble reject lines with too much
...
data on them, for example:
addb %al, (%rax)
simple-tests.txt:11:5: error: excess data detected in input
0 0 0 0 0
^
llvm-svn: 91896
2009-12-22 06:56:51 +00:00
Chris Lattner
3b333ebfb8
rewrite the file parser for the disassembler, implementing support for
...
comments. Also, check in a simple testcase for the disassembler,
including a test for r91864
llvm-svn: 91894
2009-12-22 06:37:58 +00:00
Daniel Dunbar
9483297711
Force triple in tests.
...
llvm-svn: 84257
2009-10-16 16:30:02 +00:00
Daniel Dunbar
af3162e523
MC: Tweak variable assignment diagnostics, and make reassignment of non-absolute
...
variables and symbols invalid.
llvm-svn: 84232
2009-10-16 01:57:39 +00:00