1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

446 Commits

Author SHA1 Message Date
Bob Wilson
b8eaf1ed72 Rename ARM instruction formats NEONGetLnFrm, NEONSetLnFrm and NEONDupFrm to
"N..." instead of "NEON..." for consistency with the other NEON format names.

llvm-svn: 106921
2010-06-25 23:56:05 +00:00
Bob Wilson
3ace799cfe Remove unused NEONFrm and ThumbMiscFrm ARM instruction formats.
Renumber MiscFrm to 25.

llvm-svn: 106916
2010-06-25 23:45:37 +00:00
Dan Gohman
8f0bc55ea5 Silence compiler warnings.
llvm-svn: 106360
2010-06-19 00:02:06 +00:00
Dan Gohman
1ccf40774e Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra
entry.

llvm-svn: 106296
2010-06-18 18:13:55 +00:00
Bob Wilson
5e3c60fb63 Add instruction encoding for the Neon VMOV immediate instruction. This changes
the machine instruction representation of the immediate value to be encoded
into an integer with similar fields as the actual VMOV instruction.  This makes
things easier for the disassembler, since it can just stuff the bits into the
immediate operand, but harder for the asm printer since it has to decode the
value to be printed.  Testcase for the encoding will follow later when MC has
more support for ARM.

llvm-svn: 105836
2010-06-11 21:34:50 +00:00
Bruno Cardoso Lopes
255fda615d Reapply r105521, this time appending "LLU" to 64 bit
immediates to avoid breaking the build.

llvm-svn: 105652
2010-06-08 22:51:23 +00:00
Chris Lattner
33d0622cdc revert r105521, which is breaking the buildbots with stuff like this:
In file included from X86InstrInfo.cpp:16:
X86GenInstrInfo.inc:2789: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2790: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2792: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2793: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2808: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2809: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2816: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2817: error: integer constant is too large for 'long' type

llvm-svn: 105524
2010-06-05 04:17:30 +00:00
Bruno Cardoso Lopes
b05131d907 Initial AVX support for some instructions. No patterns matched
yet, only assembly encoding support.

llvm-svn: 105521
2010-06-05 03:53:24 +00:00
Johnny Chen
c23127cb7e Modified some assert() msg strings; no other functionality change.
llvm-svn: 102008
2010-04-21 18:37:48 +00:00
Johnny Chen
6e4b1607ee Thumb instructions which have reglist operands at the end and predicate operands
before reglist were not properly handled with respect to IT Block.  Fix that by
creating a new method ARMBasicMCBuilder::DoPredicateOperands() used by those
instructions for disassembly.  Add a test case.

llvm-svn: 101974
2010-04-21 01:01:19 +00:00
Johnny Chen
d7ffae797f Better error-handling of getBitFieldInvMask() where msb < lsb (encoding error),
instead of just asserting.

llvm-svn: 101942
2010-04-20 21:29:28 +00:00
Johnny Chen
bd5bf58029 For t2LDRT, t2LDRBT, t2LDRHT, t2LDRSBT, and t2LDRSHT, if Rn(Inst{19-16})=='1111',
transform the Opcode to the corresponding t2LDR*pci counterpart.

Ref: A8.6.86 LDRT, A8.6.65 LDRBT, A8.6.77 LDRHT, A8.6.81 LDRSBT, A8.6.85 LDRSHT
llvm-svn: 101915
2010-04-20 17:28:50 +00:00
Johnny Chen
4f388a02d6 Better error-handling for DisassembleThumb2DPModImm() with 2-reg operands where
d==15 is considered illegal.  Return false instead of assert().

llvm-svn: 101852
2010-04-20 01:01:57 +00:00
Johnny Chen
1b36569ba8 More IT instruction error-handling improvements from fuzzing.
llvm-svn: 101839
2010-04-20 00:15:41 +00:00
Johnny Chen
2d0dca9099 Better error handling of invalid IT mask '0000', instead of just asserting.
llvm-svn: 101827
2010-04-19 23:02:58 +00:00
Johnny Chen
fe24cdbba8 According to A8.6.16 B (Encoding T3) and A8.3 Conditional execution -- A8.3.1
Pseudocode details of conditional, Condition bits '111x' indicate the
instruction is always executed.  That is, '1111' is a leagl condition field
value, which is now mapped to ARMCC::AL.

Also add a test case for condition field '1111'.

llvm-svn: 101817
2010-04-19 21:19:52 +00:00
Johnny Chen
b386de1758 Better error-handling for DisassembleThumb2DPSoReg() where the 3-reg operand
instructions should have Rd (Inst{11-8}) != 0b1111.

Ref: A6.3 32-bit Thumb instruction encoding
     A6.3.11 Data-processing (shifted register)
llvm-svn: 101788
2010-04-19 17:16:40 +00:00
Johnny Chen
091c01cb2f ARM disassembler did not react to recent changes to the NEON instruction table.
VLD1q*_UPD and VST1q*_UPD have the ${dst:dregpair} operand now.

llvm-svn: 101784
2010-04-19 16:20:34 +00:00
Johnny Chen
8de98d4036 Cast to (uint64_t) instead of relying on the "ul" suffix.
llvm-svn: 101573
2010-04-16 23:30:28 +00:00
Johnny Chen
2b1390e9bc Fixed logic error. Should check Builder for validity before calling SetSession
on it.

llvm-svn: 101563
2010-04-16 23:02:25 +00:00
Johnny Chen
44087236da Fixed a bug in DisassembleN1RegModImmFrm() where a break stmt was missing for a
case.  Also, the 0xFF hex literal involved in the shift for ESize64 should be
suffixed "ul" to preserve the shift result.

Implemented printHex*ImmOperand() by copying from ARMAsmPrinter.cpp and added a
test case for DisassembleN1RegModImmFrm()/printHex64ImmOperand().

llvm-svn: 101557
2010-04-16 22:40:20 +00:00
Johnny Chen
6fdcb6241d DEBUG() print out "Unknown format" msg.
llvm-svn: 101382
2010-04-15 18:13:51 +00:00
Johnny Chen
b74c5b564c Wrap the error msgs in DEBUG() macro so that they won't appear in NDEBUG build.
llvm-svn: 101329
2010-04-15 01:20:56 +00:00
Johnny Chen
a793a40572 Fixed another assert exposed by fuzzing. Now, the DisassembleVFPLdStMulFrm()
function checks whether we have a valid submode for VLDM/VSTM (must be either
"ia" or "db") before calling ARM_AM::getAM5Opc(AMSubMode, unsigned char).

llvm-svn: 101306
2010-04-14 22:37:17 +00:00
Johnny Chen
f609eeff77 For t2BFI disassembly, apply the same error checking as in r101205.
Change the error msg to read "Encoding error: msb < lsb".

llvm-svn: 101293
2010-04-14 22:04:45 +00:00
Johnny Chen
ad1fee5287 Fixed another assert exposed by fuzzing. The utility function getRegisterEnum()
was asserting because the (RegClass, RegNum) combination doesn't make sense from
an encoding point of view.

Since getRegisterEnum() is used all over the place, to change the code to check
for encoding error after each call would not only bloat the code, but also make
it less readable.  An Err flag is added to the ARMBasicMCBuilder where a client
can set a non-zero value to indicate some kind of error condition while building
up the MCInst.  ARMBasicMCBuilder::BuildIt() checks this flag and returns false
if a non-zero value is detected.

llvm-svn: 101290
2010-04-14 21:03:13 +00:00
Johnny Chen
07ed32d767 Fixed another assert exposed by fuzzing. Now, when an encoding error occurs
involing getBFCInvMask() where lsb <= msb does not hold true, the disassembler
just returns false, instead of assert, to indicate disassembly error.

llvm-svn: 101205
2010-04-14 02:05:29 +00:00
Johnny Chen
723cdf093a Fixed an assert() exposed by fuzzing. Now, instead of assert when an invalid
instruction encoding is encountered, we just return a NULL ARMBasicMCBuilder
instance and the client just returns false to indicate disassembly error.

llvm-svn: 101201
2010-04-14 01:17:37 +00:00
Sean Callanan
29a7152676 Fixed a nasty layering violation in the edis source
code.  It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.

Also removed hacky #define-controlled initialization
of targets in edis.  If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.

llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Johnny Chen
b024d0a612 Missed this one line for the previous checkin to fix build warnings.
llvm-svn: 100697
2010-04-07 22:21:03 +00:00
Johnny Chen
9fdf028fd3 Fixed warnings pointed out by clang.
llvm-svn: 100696
2010-04-07 22:03:27 +00:00
Johnny Chen
16c0653745 Fixed warnings pointed out by clang.
Next to work on is ARMDisassemblerCore.cpp.

llvm-svn: 100695
2010-04-07 21:52:48 +00:00
Johnny Chen
4dc93f2195 Fixed 3 warnings pointed out by clang.
llvm-svn: 100693
2010-04-07 21:23:48 +00:00
Johnny Chen
2c992fb384 Re-enable ARM/Thumb disassembler and add a workaround for a memcpy() call in
ARMDecoderEmitter.cpp, with FIXME comment.

llvm-svn: 100690
2010-04-07 20:53:12 +00:00
Johnny Chen
de83f26ce2 Get rid of traling whitespaces. No functionality change.
llvm-svn: 100404
2010-04-05 04:51:50 +00:00
Johnny Chen
ac6c45034f The disassembler impl. of MCDisassembler::getInstruction() was using the pattern
uint32_t insn;
  MemoryObject.readBytes(Address, 4, (uint8_t*)&insn, NULL)

to read 4 bytes of memory contents into a 32-bit uint variable.  This leaves the
interpretation of byte order up to the host machine and causes PPC test cases of
arm-tests, neon-tests, and thumb-tests to fail.  Fixed to use a byte array for
reading the memory contents and shift the bytes into place for the 32-bit uint
variable in the ARM case and 16-bit halfword in the Thumb case.

llvm-svn: 100403
2010-04-05 04:46:17 +00:00
Evan Cheng
466ece20a6 Temporarily remove to disable building of ARM disassembler.
llvm-svn: 100380
2010-04-05 01:57:50 +00:00
Evan Cheng
d765bcc4d9 Re-apply 100265 but instead disable building of ARM disassembly for now.
llvm-svn: 100379
2010-04-05 01:34:00 +00:00
Evan Cheng
dbf0c22d5b Reverting 100265 to try to get buildbots green again. Lots of self-hosting buildbots started complaining since this commit. Also xfail ARM disassembly tests.
llvm-svn: 100378
2010-04-05 01:04:27 +00:00
Johnny Chen
9da90c8593 Get rid of the middleman (ARMAlgorithm), which causes more trouble than the
abstraction it brings.  And also get rid of the atexit() handler, it does not
belong in the lib directory. :-)

llvm-svn: 100265
2010-04-03 04:10:56 +00:00
Johnny Chen
9b96a2cf47 Fix comment.
llvm-svn: 100259
2010-04-03 01:17:30 +00:00
Johnny Chen
313183d079 Register ARMAlgorithm::DoCleanup() to be called on exit to free the memory
occuplied by the cached ARMAlgorithm objects.

llvm-svn: 100258
2010-04-03 01:09:47 +00:00
Johnny Chen
fc49453e45 Fix another build warning.
llvm-svn: 100251
2010-04-02 23:43:38 +00:00
Johnny Chen
6d9cbe7270 Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) 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.

Reviewed by Chris Latter and Bob Wilson.

llvm-svn: 100233
2010-04-02 22:27:38 +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