1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

336 Commits

Author SHA1 Message Date
Jim Grosbach
2341e082fc Thumb2 assembly parsing and encoding for UMAAL/UMLAL/UMULL.
llvm-svn: 140095
2011-09-19 23:31:02 +00:00
Jim Grosbach
6da9e6b23d Thumb2 assembly parsing and encoding for TBB/TBH.
llvm-svn: 140078
2011-09-19 22:21:13 +00:00
Jim Grosbach
c7fa5f0c00 Thumb2 assembly parsing and encoding for SXTB/SXTB16/SXTH.
llvm-svn: 140047
2011-09-19 20:29:33 +00:00
Jim Grosbach
57328aa902 ARM asm parsing should handle pre-indexed writeback w/o immediate.
For example, 'ldrb r9, [sp]!' is odd, but valid.

llvm-svn: 140035
2011-09-19 18:42:21 +00:00
Jim Grosbach
95242bff08 Thumb2 assembly parsing and encoding for SUB(immediate).
llvm-svn: 139966
2011-09-16 22:58:42 +00:00
Jim Grosbach
d521731d40 Thumb2 assembly parsing and encoding for STR.
More addressing mode encoding bits. Handle pre increment for STR/STRB/STRH
and STR(register).

llvm-svn: 139949
2011-09-16 21:55:56 +00:00
Jim Grosbach
13af7198d5 Thumb2 assembly parsing and encoding for STMIA.
llvm-svn: 139938
2011-09-16 20:50:13 +00:00
Jim Grosbach
0f1615c381 Thumb2 assembly parsing and encoding for SMMULL.
llvm-svn: 139921
2011-09-16 18:05:48 +00:00
Jim Grosbach
f41c168102 Kill some dead code.
llvm-svn: 139904
2011-09-16 16:45:40 +00:00
Jim Grosbach
94fec9618a Tidy up a bit.
llvm-svn: 139903
2011-09-16 16:39:25 +00:00
Jim Grosbach
d382581509 Thumb2 assembly parsing and encoding for SMLAL.
llvm-svn: 139902
2011-09-16 16:38:00 +00:00
Owen Anderson
86f1fb2955 Fix a crasher in Thumb2 MOV-immediate encoding for certain inputs.
llvm-svn: 139747
2011-09-14 22:46:14 +00:00
Jim Grosbach
585e3c779f Thumb2 assembly parsing and encoding for MUL.
llvm-svn: 139735
2011-09-14 21:00:40 +00:00
Jim Grosbach
b1c70aab3e Thumb2 assembly parsing and encoding for MSR/MRS.
Fix a bug in handling default flags for both ARM and Thumb encodings.

llvm-svn: 139721
2011-09-14 20:03:46 +00:00
Jim Grosbach
932d409524 Thumb2 assembly parsing for MOV in IT block.
Select the right 16 vs. 32 bit encoding in an IT block.

llvm-svn: 139714
2011-09-14 19:12:11 +00:00
Jim Grosbach
41c8bdfdd9 ARM fix assembly parser handling of ranges in register lists.
Clean up register list handling in general a bit to explicitly check things
like all the registers being from the same register class.

rdar://8883573

llvm-svn: 139707
2011-09-14 18:08:35 +00:00
Jim Grosbach
b2ddf62001 Remove unnecessary scope resolution operator.
llvm-svn: 139656
2011-09-13 22:56:44 +00:00
Jim Grosbach
90b78a6f1f There's only 16 regs legal in a register list.
llvm-svn: 139637
2011-09-13 20:35:57 +00:00
Owen Anderson
b4ed08c465 Teach the Thumb ASM parser that BKPT is allowed in IT blocks, even though it is always executed unconditionally.
llvm-svn: 139610
2011-09-13 17:59:19 +00:00
Jim Grosbach
0b277b24ea Tidy up a bit.
llvm-svn: 139559
2011-09-12 23:36:42 +00:00
Jim Grosbach
52492b1cf3 Thumb2 parsing and encoding for MOV(immediate).
Some aliases for MOV(register) also to keep existing T1 tests happy when
run in thumbv7 mode.

llvm-svn: 139440
2011-09-10 00:15:36 +00:00
Owen Anderson
a7838cb723 Thumb unconditional branches are allowed in IT blocks, and therefore should have a predicate operand, unlike conditional branches.
llvm-svn: 139415
2011-09-09 21:48:23 +00:00
Jim Grosbach
6225a96bf5 Thumb2 assembly parsing and encoding for MLA and MLS.
llvm-svn: 139399
2011-09-09 20:24:45 +00:00
Jim Grosbach
eb2d668899 Thumb2 assembly parsing and encoding for LDREX/LDREXB/LDREXD/LDREXH.
llvm-svn: 139381
2011-09-09 18:37:27 +00:00
Jim Grosbach
9f150bfedf Thumb2 assembly parsing and encoding for LDRD(immediate).
Refactor operand handling for STRD as well. Tests for that forthcoming.

llvm-svn: 139322
2011-09-08 22:07:06 +00:00
Jim Grosbach
1aa191032a Thumb2 assembly parsing and encoding for LDR pre-indexed w/ writeback.
Adjust encoding of writeback load/store instructions to better reflect the
way the operand types are represented.

llvm-svn: 139270
2011-09-08 00:39:19 +00:00
Jim Grosbach
8b54d19514 Thumb2 assembly parsing and encoding for LDRBT.
llvm-svn: 139267
2011-09-07 23:39:14 +00:00
Jim Grosbach
a3ff9eeb85 Thumb2 assembly parsing and encoding for LDR(register).
llvm-svn: 139264
2011-09-07 23:10:15 +00:00
Jim Grosbach
20642fb479 Thumb2 parsing and encoding for LDR(immediate).
The immediate offset of the non-writeback i8 form (encoding T4) allows
negative offsets only. The positive offset form of the encoding is the
LDRT instruction. Immediate offsets in the range [0,255] use encoding T3
instead.

llvm-svn: 139254
2011-09-07 20:58:57 +00:00
Jim Grosbach
20689d28e7 Thumb2 parsing and encoding for LDMIA.
Choose 32-bit vs. 16-bit encoding when there's no .w suffix in post-processing
as match classes are insufficient to handle the context-sensitiveness of
the writeback operand's legality for the 16-bit encodings.

llvm-svn: 139242
2011-09-07 18:05:34 +00:00
Jim Grosbach
7969f880c0 Better diagnostic location information for mnemonic suffices.
llvm-svn: 139232
2011-09-07 16:06:04 +00:00
Jim Grosbach
b5dcc965a7 Thumb2 parsing and encoding for CLREX.
llvm-svn: 139172
2011-09-06 20:27:04 +00:00
Jim Grosbach
86c318e475 ARM .code directive should always go to the streamer.
Even if there's no mode switch performed, the .code directive should still
be sent to the output streamer. Otherwise, for example, an output asm stream
is not equivalent to the input stream which generated it (a dependency on
the input target triple arm vs. thumb is introduced which was not originally
there).

llvm-svn: 139155
2011-09-06 18:46:23 +00:00
Jim Grosbach
44483a9ba5 Thumb2 parsing and encoding of B instruction.
Tweak handling of IT blocks a bit to enable this. The differentiation between
B and Bcc needs special sauce.

llvm-svn: 139049
2011-09-02 23:22:08 +00:00
Jim Grosbach
36ea6726dd ARM 'rscs' mnemonic is carry-setting 'rsc', not 'rs' with a 'cs' condition code.
llvm-svn: 138952
2011-09-01 18:22:13 +00:00
Owen Anderson
d8157fabfb t2Bcc is allowed to have a predicate without a preceding IT instruction.
llvm-svn: 138946
2011-09-01 17:47:45 +00:00
Jim Grosbach
2b04342a91 Thumb2 assembly parsing and encoding for ADD(immediate).
llvm-svn: 138922
2011-09-01 00:28:52 +00:00
Jim Grosbach
3dd66f0c98 Thumb2 t2Bcc should encode as t2B when condition is 'always'.
llvm-svn: 138898
2011-08-31 21:17:31 +00:00
Jim Grosbach
74f916342a Remove FIXME. Thumb2 MOV instruction will use separate custom tricks.
When we want encoding T3 (the wide encoding), we can explicitly check for
that and twiddle the CanAcceptCarrySet accordingly. For now, just correctly
handle encodings T1 and T2 when in Thumb2 mode.

llvm-svn: 138879
2011-08-31 18:39:39 +00:00
Jim Grosbach
4dddfb237c tBcc is OK to be predicated in Thumb2 outside of IT blocks (obviously).
llvm-svn: 138873
2011-08-31 18:29:05 +00:00
Jim Grosbach
a4c1e9d88a Tweak Thumb1 ADD encoding selection a bit.
When the destination register of an add immediate instruction is
explicitly specified, encoding T1 is preferred, else encoding T2 is
preferred.

llvm-svn: 138862
2011-08-31 17:07:33 +00:00
Jim Grosbach
a1aa6a2e8b Thumb2 parsing and encoding for IT blocks.
llvm-svn: 138773
2011-08-29 22:24:09 +00:00
Owen Anderson
e14d6edccc Improve handling of #-0 offsets for many more pre-indexed addressing modes.
llvm-svn: 138754
2011-08-29 19:36:44 +00:00
Owen Anderson
8719e2c1c3 Add support for parsing #-0 on non-memory-operand immediate values, and add a testcase that necessitates it.
llvm-svn: 138739
2011-08-29 17:17:09 +00:00
Jim Grosbach
fb526fdc70 ARM assembly parsing tweak for pldw.
llvm-svn: 138669
2011-08-26 22:21:51 +00:00
Jim Grosbach
6071776c8a Thumb2 assembler parsing and encoding of IT instruction.
This handles only the handling of the IT instruction itself, not the
processing and validation of the instructions in the IT block. That's next,
and will include encoding tests for IT itself.

llvm-svn: 138665
2011-08-26 21:43:41 +00:00
Owen Anderson
af51fd9868 invalid-LDR_PRE-arm.txt was already passing, but for the wrong reasons. We were failing to specify enough fixed bits of LDR_PRE/LDRB_PRE, resulting in decoding conflicts. Separate them into immediate vs. register versions, allowing us to specify the necessary fixed bits. This in turn results in the test being decoded properly, and being rejected as UNPREDICTABLE rather than a hard failure.
llvm-svn: 138653
2011-08-26 20:43:14 +00:00
Jim Grosbach
e8641a3bc7 Explicitly disallow predication in Thumb1 assembly.
llvm-svn: 138562
2011-08-25 17:23:55 +00:00
Jim Grosbach
7374e16344 Thumb .n mnemonic qualifiers can be ignored for now.
We'll need to pay attention to them when we start getting more serious about
the details of parsing thumb2 assembly.

llvm-svn: 138500
2011-08-24 22:19:48 +00:00
Jim Grosbach
effaf1e15d Thumb parsing and encoding for SUB (SP minu immediate).
Fix FiXME in test file. Remove FIXME for SUB (SP minus register) since that
form is Thumb2 only.

llvm-svn: 138494
2011-08-24 21:42:27 +00:00