summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
Commit message (Collapse)AuthorAgeFilesLines
* What year is it! This file has no reason to be written in C, and has doubly noRichard Smith2014-04-201-1821/+0
| | | | | | | | | | reason to expose a global symbol 'decodeInstruction' nor to pollute the global scope with a bunch of external linkage entities (some of which conflict with others elsewhere in LLVM). This is just the initial transition to C++; more cleanups to follow. llvm-svn: 206717
* [X86] Check return value of readSIB in disassembler so errors propagate. In ↵Craig Topper2014-03-201-5/+2
| | | | | | particular this makes a too short instruction with a missing SIB byte fail. llvm-svn: 204305
* Remove A6/A7 opcode maps. They can all be handled with a TB map, opcode of ↵Craig Topper2014-02-191-26/+0
| | | | | | 0xa6/0xa7, and adding MRM_C0/MRM_E0 forms. Removes 376K from the disassembler tables. llvm-svn: 201641
* Fix diassembler handling of rex.b when mod=00/01/10 and bbb=101. Mod=00 ↵Craig Topper2014-02-171-4/+3
| | | | | | should ignore the base register entirely. Mod=01/10 should treat this as R13 plus displacment. Fixes PR18860. llvm-svn: 201507
* Avoid C++ comment in C sourcesAlp Toker2014-01-261-1/+1
| | | | | | lib/Target/X86/Disassembler/X86DisassemblerDecoder.c:1361:7: error: C++ style comments are not allowed in ISO C90 llvm-svn: 200153
* Set displacementSize to 1 for instrucitons with mod==0x1. Fixes PR17310. ↵Craig Topper2014-01-251-0/+3
| | | | | | Modified from patch by James Courtier-Dutton. llvm-svn: 200100
* [x86] Allow address-size overrides for STOS[BWLQ] (PR9385)David Woodhouse2014-01-221-0/+1
| | | | llvm-svn: 199804
* [x86] Allow segment and address-size overrides for LODS[BWLQ] (PR9385)David Woodhouse2014-01-221-0/+1
| | | | llvm-svn: 199803
* [x86] Fix 16-bit disassembly of JCXZ/JECXZDavid Woodhouse2014-01-201-0/+19
| | | | llvm-svn: 199653
* [x86] Fix 16-bit handling of OpSize bitDavid Woodhouse2014-01-201-3/+5
| | | | | | | | | | When disassembling in 16-bit mode the meaning of the OpSize bit is inverted. Instructions found in the IC_OPSIZE context will actually *not* have the 0x66 prefix, and instructions in the IC context will have the 0x66 prefix. Make use of the existing special-case handling for the 0x66 prefix being in the wrong place, to cope with this. llvm-svn: 199650
* VEX_PREFIX_66 doesn't need to set the hasOpSize flag since VEX instructions ↵Craig Topper2014-01-171-11/+0
| | | | | | don't use the size fields it controls. llvm-svn: 199470
* Remove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are ↵Craig Topper2014-01-011-36/+5
| | | | | | really more like OrRegFrm so we don't need a difference since we can just mask bits. llvm-svn: 198278
* Second attempt at Removing special form of AddRegFrm used by FP ↵Craig Topper2014-01-011-6/+1
| | | | | | instructions. These instructions can be handled by MRMXr instead. llvm-svn: 198276
* Revert r198238 and add FP disassembler tests. It didn't work and I didn't ↵Craig Topper2013-12-311-0/+3
| | | | | | realized we had no FP disassembler test cases. llvm-svn: 198265
* Remove old comment referring to an argument that no longer exists.Craig Topper2013-12-311-2/+0
| | | | llvm-svn: 198263
* Remove special form of AddRegFrm used by FP instructions. These instructions ↵Craig Topper2013-12-301-3/+0
| | | | | | can be handled by MRMXr instead. llvm-svn: 198238
* AVX-512: decoder for AVX-512, made by Alexey Bader.Elena Demikhovsky2013-12-251-66/+191
| | | | llvm-svn: 198013
* X86 Disassembler: remove unused bool typedef-nameDavid Majnemer2013-11-051-2/+0
| | | | llvm-svn: 194062
* Replace C++ style comment with a C style comment to satisfy some of the ↵Craig Topper2013-10-031-1/+1
| | | | | | build bots. llvm-svn: 191880
* Add XOP disassembler support. Fixes PR13933.Craig Topper2013-10-031-34/+138
| | | | llvm-svn: 191874
* Remove 0 as a valid encoding for the m-mmmm field.Craig Topper2013-10-011-2/+0
| | | | llvm-svn: 191732
* Remove unneeded fields from disassembler internal instruction format.Craig Topper2013-10-011-16/+0
| | | | llvm-svn: 191731
* Various x86 disassembler fixes.Craig Topper2013-09-301-36/+0
| | | | | | | | | | | Add VEX_LIG to scalar FMA4 instructions. Use VEX_LIG in some of the inheriting checks in disassembler table generator. Make use of VEX_L_W, VEX_L_W_XS, VEX_L_W_XD contexts. Don't let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from their non-L forms unless VEX_LIG is set. Let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from all of their non-L or non-W cases. Increase ranking on VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE so they get chosen over non-L/non-W forms. llvm-svn: 191649
* Build fixRichard Mitton2013-08-301-1/+1
| | | | llvm-svn: 189699
* Fixed a bug where diassembling an instruction that had a prefix would cause ↵Richard Mitton2013-08-301-7/+9
| | | | | | LLVM to identify a 1-byte instruction, but then upon querying it for that 1-byte instruction would cause an undefined opcode. llvm-svn: 189698
* Added encoding prefixes for KNL instructions (EVEX).Elena Demikhovsky2013-07-281-0/+2
| | | | | | | Added 512-bit operands printing. Added instruction formats for KNL instructions. llvm-svn: 187324
* Update the X86 disassembler to use xacquire and xrelease when appropriate.Kevin Enderby2013-06-201-0/+21
| | | | | | | | | | | | | | | | | This is a bit tricky as the xacquire and xrelease hints use the same bytes, 0xf2 and 0xf3, as the repne and rep prefixes. Fortunately llvm has different llvm MCInst Opcode enums for rep/xrelease and repne/xacquire. So to make this work a boolean was added the InternalInstruction struct as part of the Prefix state which is set with the added logic in readPrefixes() when decoding an instruction to determine if these prefix bytes are to be disassembled as xacquire or xrelease. Then we let the matcher pick the normal prefix instructionID and we change the Opcode after that when it is set into the MCInst being created. rdar://11019859 llvm-svn: 184490
* X86DisassemblerDecoder.c: Make this C89-compliant.NAKAMURA Takumi2013-03-251-1/+1
| | | | llvm-svn: 177910
* Whitespace.NAKAMURA Takumi2013-03-251-160/+160
| | | | llvm-svn: 177909
* x86 -- disassemble the REP/REPNE prefix when neededDave Zarzycki2013-03-251-7/+20
| | | | | | This fixes Apple bug: 13493622 llvm-svn: 177887
* Fix typoJoerg Sonnenberger2012-10-291-2/+2
| | | | llvm-svn: 166945
* Add a new compression type to ModRM table that detects when the memory modRM ↵Craig Topper2012-09-131-0/+4
| | | | | | byte represent 8 instructions and the reg modRM byte represents up to 64 instructions. Reduces modRM table from 43k entreis to 25k entries. Based on a patch from Manman Ren. llvm-svn: 163774
* Use const properly so that we dont remove const qualifier from region and MIIRoman Divacky2012-09-051-3/+3
| | | | | | by casting. Found with gcc48. llvm-svn: 163247
* Fix integer undefined behavior due to signed left shift overflow in LLVM.Richard Smith2012-08-241-1/+1
| | | | | | Reviewed offline by chandlerc. llvm-svn: 162623
* Add more indirection to the disassembler tables to reduce amount of space ↵Craig Topper2012-08-011-7/+9
| | | | | | used to store the operand types and encodings. Store only the unique combinations in a separate table and store indices in the instruction table. Saves about 32K of static data. llvm-svn: 161101
* Add support for AVX enhanced comparison predicates. Patch from Kay Tiong Khoo.Craig Topper2012-04-031-0/+3
| | | | llvm-svn: 153935
* C files in llvm still have to be C89 compliant, remove C++-style comments.Benjamin Kramer2012-03-101-4/+6
| | | | llvm-svn: 152495
* Fix the x86 disassembler to at least print the lock prefix if it is the firstKevin Enderby2012-03-091-0/+7
| | | | | | | prefix. Added a FIXME to remind us this still does not work when it is not the first prefix. llvm-svn: 152414
* X86 disassembler support for jcxz, jecxz, and jrcxz. Fixes PR11643. Patch by ↵Craig Topper2012-02-271-0/+2
| | | | | | Kay Tiong Khoo. llvm-svn: 151510
* Updated the llvm-mc disassembler C API to support for the X86 target.Kevin Enderby2012-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | rdar://10873652 As part of this I updated the llvm-mc disassembler C API to always call the SymbolLookUp call back even if there is no getOpInfo call back. If there is a getOpInfo call back that is tried first and then if that gets no information then the SymbolLookUp is called. I also made the code more robust by memset(3)'ing to zero the LLVMOpInfo1 struct before then setting SymbolicOp.Value before for the call to getOpInfo. And also don't use any values from the LLVMOpInfo1 struct if getOpInfo returns 0. And also don't use any of the ReferenceType or ReferenceName values from SymbolLookUp if it returns NULL. rdar://10873563 and rdar://10873683 For the X86 target also fixed bugs so the annotations get printed. Also fixed a few places in the ARM target that was not producing symbolic operands for some instructions. rdar://10878166 llvm-svn: 151267
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-191-3/+1
| | | | llvm-svn: 150918
* Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, ↵Jia Liu2012-02-181-1/+1
| | | | | | MSP430, PPC, PTX, Sparc, X86, XCore. llvm-svn: 150878
* Don't mix declarations and code.Benjamin Kramer2012-02-111-7/+5
| | | | llvm-svn: 150305
* Reuse the enum names from X86Desc in the X86Disassembler.Benjamin Kramer2012-02-111-4/+9
| | | | | | | This requires some gymnastics to make it available for C code. Remove the names from the disassembler tables, making them relocation free. llvm-svn: 150303
* More tweaks to get the size of the X86 disassembler tables down.Craig Topper2012-02-091-0/+4
| | | | llvm-svn: 150167
* Flatten some of the arrays in the X86 disassembler tables to reduce space ↵Craig Topper2012-02-091-5/+4
| | | | | | needed to store pointers on 64-bit hosts and reduce relocations needed at startup. Part of PR11953. llvm-svn: 150161
* Persuade GCC that there is nothing worth warning about here (there isn't).Duncan Sands2012-02-051-1/+1
| | | | llvm-svn: 149834
* Remove unnecessary default cases in switches that cover all enum values.David Blaikie2012-01-101-3/+0
| | | | llvm-svn: 147855
* Silence warnings of a mysterious compiler that still defaults to C89.Benjamin Kramer2012-01-041-2/+2
| | | | llvm-svn: 147553
* X86Disassembler: Fix undefined behavior found by GCC 4.6Benjamin Kramer2012-01-011-3/+5
| | | | llvm-svn: 147404
OpenPOWER on IntegriCloud