summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
Commit message (Collapse)AuthorAgeFilesLines
* [X86][Disassembler] Fix LOCK prefix disassembler supportMaksim Panchenko2018-07-051-0/+2
| | | | | | | | | | | | | | | | | | | Summary: If LOCK prefix is not the first prefix in an instruction, LLVM disassembler silently drops the prefix. The fix is to select a proper instruction with a builtin LOCK prefix if one exists. Reviewers: craig.topper Reviewed By: craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49001 llvm-svn: 336400
* [X86][Disassembler] Use a local variable instead of using a field in the ↵Craig Topper2018-06-011-1/+0
| | | | | | instruction object. NFC llvm-svn: 333721
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-12/+12
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [X86] Add a new disassembler opcode map for 3DNow. Stop treating 3DNow as an ↵Craig Topper2018-03-241-2/+1
| | | | | | | | attribute. This reduces the size of llvm-mc by at least 150k since we no longer have to multiply the attribute across 7 tables. llvm-svn: 328416
* Fix layering by moving X86DisassemblerDecoderCommon to SupportDavid Blaikie2018-03-231-1/+1
| | | | | | | | | This is used from llvm tblgen and the X86Disassembler - the only common library (apart from TableGen, which probably doesn't make sense to have as a dependency from a release tool (rather than a use-while-building-llvm tool) of LLVM) llvm-svn: 328393
* [X86][3DNOW] Teach decoder about AMD 3DNow! instrsRafael Auler2018-02-151-1/+2
| | | | | | | | | | | | | | | | | | | Summary: This patch makes the decoder understand old AMD 3DNow! instructions that have never been properly supported in the X86 disassembler, despite being supported in other subsystems. Hopefully this should make the X86 decoder more complete with respect to binaries containing legacy code. Reviewers: craig.topper Reviewed By: craig.topper Subscribers: llvm-commits, maksfb, bruno Differential Revision: https://reviews.llvm.org/D43311 llvm-svn: 325295
* [X86] Fix disassembly of EVEX rounding control and SAE instructions.Craig Topper2017-10-231-0/+3
| | | | | | Fixes PR31955. llvm-svn: 316308
* [X86] Fix disassembling of EVEX instructions to stop accidentally decoding ↵Craig Topper2017-10-211-0/+1
| | | | | | | | | | | | the SIB index register as an XMM/YMM/ZMM register. This introduces a new operand type to encode the whether the index register should be XMM/YMM/ZMM. And new code to fixup the results created by readSIB. This has the nice effect of removing a bunch of code that hard coded the name of every GATHER and SCATTER instruction to map the index type. This fixes PR32807. llvm-svn: 316273
* This patch is a result of D37262: The issues with X86 prefixes. It closes ↵Andrew V. Tischenko2017-10-161-7/+9
| | | | | | PR7709, PR17697, PR19251, PR32809 and PR21640. There could be other bugs closed by this patch. llvm-svn: 315899
* Revert "The current version of LLVM X86 disassembler incorrectly interprets ↵Eric Christopher2017-08-291-3/+0
| | | | | | | | some possible sets of x86 prefixes. This patch is the first step to close PR7709 and PR17697. There will be next patch(es) to close relative PRs." temporarily while some regressions are addressed. This reverts commit r311882. llvm-svn: 311987
* The current version of LLVM X86 disassembler incorrectly interprets some ↵Andrew V. Tischenko2017-08-281-0/+3
| | | | | | | | | | | | | | possible sets of x86 prefixes. This patch is the first step to close PR7709 and PR17697. There will be next patch(es) to close relative PRs. Differential Revision: https://reviews.llvm.org/D36788 M lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp M lib/Target/X86/Disassembler/X86DisassemblerDecoder.h A test/MC/Disassembler/X86/prefixes-i386.s A test/MC/Disassembler/X86/prefixes-x86_64.s M test/MC/Disassembler/X86/prefixes.txt llvm-svn: 311882
* Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)Mehdi Amini2016-10-011-1/+1
| | | | llvm-svn: 283018
* [X86] Decode MPX BND registers.Ahmed Bougacha2016-07-141-0/+7
| | | | | | | | | | | | | We were able to assemble, but not disassemble. Note that fixupRMValue was truncating EA_REG_BND0-3 because we hit the uint8_t max. The control registers were already squarely above it, but I don't think they ever go in .r/m, only in .reg. I also did notice an extra REX.W in our encoding, but I think that's fine. llvm-svn: 275427
* [X86] Rip out orphaned method declarations and other dead code. NFC.Benjamin Kramer2015-10-151-2/+0
| | | | llvm-svn: 250406
* [X86] Add the debug registers DR8-DR15 so we can assemble and disassemble ↵Craig Topper2014-12-261-1/+9
| | | | | | references to them. llvm-svn: 224862
* [X86] Don't fail disassembly if REX.R/REX.B is used on an MMX register. ↵Craig Topper2014-12-261-1/+8
| | | | | | Similar fix to not fail to disassembler CR9-CR15 references. llvm-svn: 224861
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* Fix gcc -Wsign-compare warning in X86DisassemblerTables.cpp.Patrik Hagglund2014-04-281-1/+2
| | | | | | | | | | X86_MAX_OPERANDS is changed to unsigned. Also, add range-based for loops for affected loops. This in turn needed an ArrayRef instead of a pointer-to-array in InternalInstruction. llvm-svn: 207413
* C++ has a bool type! (And C's had one too, for 15 years...)Richard Smith2014-04-201-6/+4
| | | | llvm-svn: 206723
* More C++ification.Richard Smith2014-04-201-159/+124
| | | | llvm-svn: 206722
* Remove some more C junk from these files.Richard Smith2014-04-201-6/+6
| | | | llvm-svn: 206721
* Don't provide two different definitions of ModRMDecision, OpcodeDecision, ↵Richard Smith2014-04-201-6/+0
| | | | | | and ContextDecision in different source files (depending on #define magic). llvm-svn: 206720
* Don't define llvm::X86Disassembler::InstructionSpecifier in different ways inRichard Smith2014-04-201-3/+8
| | | | | | different source files. llvm-svn: 206719
* What year is it! This file has no reason to be written in C, and has doubly noRichard Smith2014-04-201-27/+22
| | | | | | | | | | 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
* Fix known typosAlp Toker2014-01-241-1/+1
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Remove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are ↵Craig Topper2014-01-011-2/+0
| | | | | | really more like OrRegFrm so we don't need a difference since we can just mask bits. llvm-svn: 198278
* AVX-512: decoder for AVX-512, made by Alexey Bader.Elena Demikhovsky2013-12-251-10/+40
| | | | llvm-svn: 198013
* Remove comma from the end of an enum.Craig Topper2013-10-031-1/+1
| | | | llvm-svn: 191877
* Add XOP disassembler support. Fixes PR13933.Craig Topper2013-10-031-4/+26
| | | | llvm-svn: 191874
* Remove unneeded fields from disassembler internal instruction format.Craig Topper2013-10-011-4/+0
| | | | llvm-svn: 191731
* Added encoding prefixes for KNL instructions (EVEX).Elena Demikhovsky2013-07-281-2/+70
| | | | | | | 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/+2
| | | | | | | | | | | | | | | | | 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
* Change unsigned to a uint16_t in static disassembler tables to reduce the ↵Craig Topper2012-09-111-1/+1
| | | | | | table size. llvm-svn: 163594
* Use const properly so that we dont remove const qualifier from region and MIIRoman Divacky2012-09-051-5/+5
| | | | | | by casting. Found with gcc48. llvm-svn: 163247
* Add more indirection to the disassembler tables to reduce amount of space ↵Craig Topper2012-08-011-1/+4
| | | | | | 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
* Tidy up trailing whitespaceCraig Topper2012-07-311-33/+33
| | | | llvm-svn: 161027
* X86: add GATHER intrinsics (AVX2) in LLVMManman Ren2012-06-261-0/+3
| | | | | | | | | | | | Support the following intrinsics: llvm.x86.avx2.gather.d.pd, llvm.x86.avx2.gather.q.pd llvm.x86.avx2.gather.d.pd.256, llvm.x86.avx2.gather.q.pd.256 llvm.x86.avx2.gather.d.ps, llvm.x86.avx2.gather.q.ps llvm.x86.avx2.gather.d.ps.256, llvm.x86.avx2.gather.q.ps.256 Modified Disassembler to handle VSIB addressing mode. llvm-svn: 159221
* Updated the llvm-mc disassembler C API to support for the X86 target.Kevin Enderby2012-02-231-0/+5
| | | | | | | | | | | | | | | | | | | | | 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
* 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-1/+1
| | | | llvm-svn: 150305
* Reuse the enum names from X86Desc in the X86Disassembler.Benjamin Kramer2012-02-111-1/+3
| | | | | | | 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
* Flatten some of the arrays in the X86 disassembler tables to reduce space ↵Craig Topper2012-02-091-1/+1
| | | | | | needed to store pointers on 64-bit hosts and reduce relocations needed at startup. Part of PR11953. llvm-svn: 150161
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* X86 table-generator and disassembler support for the AVXSean Callanan2011-03-151-13/+73
| | | | | | | | | instruction set. This code adds support for the VEX prefix and for the YMM registers accessible on AVX-enabled architectures. Instruction table support that enables AVX instructions for the disassembler is in an upcoming patch. llvm-svn: 127644
* Fixed a bug in the X86 disassembler where a member of theSean Callanan2011-02-211-1/+1
| | | | | | | | X86 instruction decode structure was being interpreted as being in units of bits, although it is actually stored in units of bytes. llvm-svn: 126147
* Make the disassembler tables const so they end up in read-only memory.Benjamin Kramer2010-10-231-2/+2
| | | | llvm-svn: 117206
* Eliminated the classification of control registers into %ecr_Sean Callanan2010-05-061-22/+11
| | | | | | | | | and %rcr_, leaving just %cr_ which is what people expect. Updated the disassembler to support this unified register set. Added a testcase to verify that the registers continue to be decoded correctly. llvm-svn: 103196
* Fixes to the X86 disassembler. The disassembler will nowSean Callanan2010-04-021-0/+11
| | | | | | | return an error status in all failure cases, printing messages to debugs() only when debugging is enabled. llvm-svn: 100229
* More fixes for Visual C++. Replaced several very smallSean Callanan2009-12-231-10/+10
| | | | | | static inline functions with macros. llvm-svn: 91973
* Changed REG_* to MODRM_REG_* to avoid conflictsSean Callanan2009-12-221-2/+2
| | | | | | with symbols in AuroraUX's global namespace. llvm-svn: 91879
OpenPOWER on IntegriCloud