summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* This patch introduces RegisterOperand class into Mips FPU instruction ↵Vladimir Medic2013-06-241-54/+83
| | | | | | definitions and adds dedicated parser methods to MipsAsmParser. It is the first in a series of patches that should fix the problems with parsing Mips FPU instructions and optimize the code in MipsAsmParser. llvm-svn: 184716
* Optimize register parsing for MipsAsmParser. Allow symbolic aliases for FPU ↵Vladimir Medic2013-06-201-48/+58
| | | | | | registers. llvm-svn: 184411
* The RenderMethod field in RegisterOperand class sets the name of the method ↵Vladimir Medic2013-06-191-14/+1
| | | | | | on the target specific operand to call to add the target specific operand to an MCInst. This patch defines RenderMethod for mips RegisterOperand classes and removes redundant code from MipsAsmParser.cpp llvm-svn: 184292
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-181-1/+1
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* Test commit for user vmedic, to verify commit access. One line of comment is ↵Vladimir Medic2013-06-041-1/+1
| | | | | | added to MipsAsmParser.cpp. llvm-svn: 183215
* Mips assembler: Improve set register alias handlingJack Carter2013-05-281-5/+28
| | | | | | | | | | | | | | | | This patch solves the problem of numeric register values not being accepted: ../set_alias.s:1:11: error: expected valid expression after comma .set r4,$4 ^ The parsing of .set directive is changed and handling of symbols in code as well to enable this feature. The test example is added. Patch by Vladimir Medic llvm-svn: 182807
* Mips assembler: .set reorder supportJack Carter2013-04-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Mips have delayslots for certain instructions like jumps and branches. These are instructions that follow the branch or jump and are executed before the jump or branch is completed. Early Mips compilers could not cope with delayslots and left them up to the assembler. The assembler would fill the delayslots with the appropriate instruction, usually just a nop to allow correct runtime behavior. The default behavior for this is set with .set reorder. To tell the assembler that you don't want it to mess with the delayslot one used .set noreorder. For backwards compatibility we need to support .set reorder and have it be the default behavior in the assembler. Our support for it is to insert a NOP directly after an instruction with a delayslot when in .set reorder mode. Contributer: Vladimir Medic llvm-svn: 180584
* Mips assembler: formatting and comment changes.Jack Carter2013-04-181-302/+294
| | | | | | This patch should not have any functional changes. llvm-svn: 179737
* Fix -Werror build.Evgeniy Stepanov2013-04-171-0/+2
| | | | | | Broken in r179657. llvm-svn: 179669
* Mips assembler: Enable handling of nested expressionsJack Carter2013-04-171-108/+200
| | | | | | | | | | This patch allows the Mips assembler to parse and emit nested expressions as instruction operands. It also extends the expansion of memory instructions when an offset is given as an expression. Contributer: Vladimir Medic llvm-svn: 179657
* Mips assembler: Explicit floating point condition register recognition.Jack Carter2013-04-151-0/+3
| | | | | | | | | | This patch allows the assembler to recognize $fcc0 as a valid register for conditional move instructions. Corresponding test cases have been added. Contributer: Vladimir Medic llvm-svn: 179567
* This patch that enables the Mips assembler to use symbols for offset for ↵Jack Carter2013-03-221-17/+150
| | | | | | | | | | | | instructions This patch uses the generated instruction info tables to identify memory/load store instructions. After successful matching and based on the operand type and size, it generates additional instructions to the output. Contributor: Vladimir Medic llvm-svn: 177685
* This patch enables the Mips .set directive to define aliasesJack Carter2013-03-211-6/+93
| | | | | | | | | | | | | | | | The .set directive in the Mips the assembler can be used to set the value of a symbol to an expression. This changes the symbol's value and type to conform to the expression's. Syntax: .set symbol, expression This patch implements the parsing of the above syntax and enables the parser to use defined symbols when parsing operands. Contributor: Vladimir Medic llvm-svn: 177667
* Silence anonymous type in anonymous union warnings.Eric Christopher2013-03-151-18/+23
| | | | llvm-svn: 177135
* Mips specific standalone assembler addressing mode %hi and %lo.Jack Carter2013-02-211-0/+5
| | | | | | | | | | | | The constructs %hi() and %lo() represent the high and low 16 bits of the address. Because the 16 bit offset field of an LW instruction is interpreted as signed, if bit 15 of the low part is 1 then the low part will act as a negative and 1 needs to be added to the high part. Contributer: Vladimir Medic llvm-svn: 175707
* ELF symbol table field st_other support, Jack Carter2013-02-201-85/+84
| | | | | | | | | | | | | | | | | | | | excluding visibility bits. Mips specific standalone assembler directive "set at". This directive changes the general purpose register that the assembler will use when given the symbolic register name $at. This does not include negative testing. That will come in a future patch. A side affect of this patch recognizes the different GPR register names for temporaries between old abi and new abi so a test case for that is included. Contributer: Vladimir Medic llvm-svn: 175686
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-201-19/+19
| | | | | | | | | | | | | | | | | | | s/AddDirectiveHandler/addDirectiveHandler/ s/ParseMSInlineAsm/parseMSInlineAsm/ s/ParseIdentifier/parseIdentifier/ s/ParseStringToEndOfStatement/parseStringToEndOfStatement/ s/ParseEscapedString/parseEscapedString/ s/EatToEndOfStatement/eatToEndOfStatement/ s/ParseExpression/parseExpression/ s/ParseParenExpression/parseParenExpression/ s/ParseAbsoluteExpression/parseAbsoluteExpression/ s/CheckForValidSection/checkForValidSection/ http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly No functional change intended. llvm-svn: 175675
* This patch implements parsing the .wordJack Carter2013-01-251-7/+42
| | | | | | | | directive for the Mips assembler. Contributer: Vladimir Medic llvm-svn: 173407
* This is a resubmittal. For some reason it broke the bots yesterdayJack Carter2013-01-171-1/+7
| | | | | | | | | | | | | but I cannot reproduce the problem and have scrubed my sources and even tested with llvm-lit -v --vg. The Mips RDHWR (Read Hardware Register) instruction was not tested for assembler or dissassembler consumption. This patch adds that functionality. Contributer: Vladimir Medic llvm-svn: 172685
* reverting 172579Jack Carter2013-01-161-4/+1
| | | | llvm-svn: 172594
* Akira,Jack Carter2013-01-161-1/+4
| | | | | | | | | | | | Hope you are feeling better. The Mips RDHWR (Read Hardware Register) instruction was not tested for assembler or dissassembler consumption. This patch adds that functionality. Contributer: Vladimir Medic llvm-svn: 172579
* MipsAsmParser: Try to unbreak tests to add extra check.NAKAMURA Takumi2013-01-121-2/+2
| | | | llvm-svn: 172315
* This patch tackles the problem of parsing Mips Jack Carter2013-01-121-77/+253
| | | | | | | | | | | | | | | | | | register names in the standalone assembler llvm-mc. Registers such as $A1 can represent either a 32 or 64 bit register based on the instruction using it. In addition, based on the abi, $T0 can represent different 32 bit registers. The problem is resolved by the Mips specific AsmParser td definitions changing to work together. Many cases of RegisterClass parameters are now RegisterOperand. Contributer: Vladimir Medic llvm-svn: 172284
* Change SMRange to be half-open (exclusive end) instead of closed (inclusive)Jordan Rose2013-01-071-27/+23
| | | | | | | | | | This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. llvm-svn: 171765
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* [ms-inline asm] Add support for creating AsmRewrites in the target specificChad Rosier2012-10-251-2/+3
| | | | | | AsmParser logic. To be used/tested in a subsequent commit. llvm-svn: 166714
* [ms-inline asm] Remove the MatchInstruction() function. Previously, this wasChad Rosier2012-10-131-6/+7
| | | | | | | | | | | the interface between the front-end and the MC layer when parsing inline assembly. Unfortunately, this is too deep into the parsing stack. Specifically, we're unable to handle target-independent assembly (i.e., assembly directives, labels, etc.). Note the MatchAndEmitInstruction() isn't the correct abstraction either. I'll be exposing target-independent hooks shortly, so this is really just a cleanup. llvm-svn: 165858
* [ms-inline asm] Use the new API introduced in r165830 in lieu of theChad Rosier2012-10-121-4/+1
| | | | | | MapAndConstraints vector. Also remove the unused Kind argument. llvm-svn: 165833
* Initial assembler implementation of Mips load address macroJack Carter2012-10-091-4/+96
| | | | | | | | | | | | | | | | | | | | | | | | This patch provides initial implementation of load address macro instruction for Mips. We have implemented two kinds of expansions with their variations depending on the size of immediate operand: 1) load address with immediate value directly: * la d,j => addiu d,$zero,j (for -32768 <= j <= 65535) * la d,j => lui d,hi16(j) ori d,d,lo16(j) (for any other 32 bit value of j) 2) load load address with register offset value * la d,j(s) => addiu d,s,j (for -32768 <= j <= 65535) * la d,j(s) => lui d,hi16(j) (for any other 32 bit value of j) ori d,d,lo16(j) addu d,d,s This patch does not cover the case when the address is loaded from the value of the label or function. Contributer: Vladimir Medic llvm-svn: 165561
* Improvements to MIPS64 assembler:David Chisnall2012-10-091-42/+77
| | | | | | | - Teach it about dadd[i] instructions and move pseudo-instruction - Make it parse the register names correctly (for N32 / N64) llvm-svn: 165506
* Minor changes based on post commit review:Jack Carter2012-10-061-29/+30
| | | | | Contributer: Vladimir Medic llvm-svn: 165350
* Minor changes based on post commit review:Jack Carter2012-10-051-13/+12
| | | | | Contributer: Vladimir Medic llvm-svn: 165346
* [ms-inline asm] Add a few typedefs to simplify future changes.Chad Rosier2012-10-051-1/+1
| | | | llvm-svn: 165324
* Implement methods that enable expansion of load immediate Jack Carter2012-10-041-28/+103
| | | | | | | | | | | | | | | | | | | | | | | | macro instruction (li) in the assembler. We have identified three possible expansions depending on the size of immediate operand: 1) for 0 ≤ j ≤ 65535. li d,j => ori d,$zero,j 2) for −32768 ≤ j < 0. li d,j => addiu d,$zero,j 3) for any other value of j that is representable as a 32-bit integer. li d,j => lui d,hi16(j) ori d,d,lo16(j) All of the above have been implemented in ths patch. Contributer: Vladimir Medic llvm-svn: 165199
* This patch is a partial implementation of mips .set assembler directive. ↵Jack Carter2012-10-041-43/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Directive is defined as follows: .set option The patch implements following options at - lets the assembler use the $at register for macros, but generates warnings if the source program uses $at noat - let source programs use $at without issuingwarnings. noreorder - prevents the assembler from reordering machine language instructions. nomacro - causes the assembler to print a warning whenever an assembler operation generates more than one machine language instruction. macro - lets the assembler generate multiple machine instructions from a single assembler instruction reorder - lets the assembler reorder machine language instructions to improve performance The above variants are parsed and their boolean values set or unset. The code to actually use them will come later. Following options are not implemented yet: nomips16 nomicromips move nomove Contributer: Vladimir Medic llvm-svn: 165194
* [ms-inline asm] Add the convertToMapAndConstraints() function that is used toChad Rosier2012-10-011-2/+5
| | | | | | | | | | | map constraints and MCInst operands to inline asm operands. This replaces the getMCInstOperandNum() function. The logic to determine the constraints are not in place, so we still default to a register constraint (i.e., "r"). Also, we no longer build the MCInst but rather return just the opcode to get the MCInstrDesc. llvm-svn: 164979
* Rather then have a wrapper function, have tblgen instantiate the implementation.Chad Rosier2012-09-241-17/+0
| | | | | | Also remove an unused argument. llvm-svn: 164567
* Rather then have a wrapper function, have tblgen instantiate the implementation.Chad Rosier2012-09-241-4/+0
| | | | llvm-svn: 164548
* [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.Chad Rosier2012-09-211-0/+4
| | | | llvm-svn: 164420
* Make helper function static.Benjamin Kramer2012-09-101-2/+1
| | | | llvm-svn: 163504
* MipsAsmParser: Fix a couple of string use-after-frees and misuses of classof.Benjamin Kramer2012-09-071-8/+8
| | | | llvm-svn: 163383
* The Mips standalone assembler intial directive support.Jack Carter2012-09-071-0/+43
| | | | | | | | | | Actually these are just stubs for parsing the directives. Semantic support will come later. Test cases included Contributer: Vladimir Medic llvm-svn: 163364
* The Mips standalone assembler fpu instruction support.Jack Carter2012-09-071-6/+219
| | | | | | | Test cases included Contributer: Vladimir Medic llvm-svn: 163363
* Remove unused variable introduced by r163346.David Blaikie2012-09-061-2/+0
| | | | llvm-svn: 163359
* The Mips standalone assembler memory instruction support.Jack Carter2012-09-061-7/+211
| | | | | | | | | This includes sb,sc,sh,sw,lb,lw,lbu,lh,lhu,ll,lw Test case included Contributer: Vladimir Medic llvm-svn: 163346
* Mips specific llvm assembler support for ALU instructions. This includesJack Carter2012-09-051-22/+367
| | | | | | | register support. Test case included. Contributer: Vladimir Medic llvm-svn: 163268
* Fix function name per coding standard.Chad Rosier2012-09-051-4/+4
| | | | llvm-svn: 163187
* [ms-inline asm] Asm operands can map to one or more MCOperands. Therefore, addChad Rosier2012-09-031-2/+3
| | | | | | | the NumMCOperands argument to the GetMCInstOperandNum() function that is set to the number of MCOperands this asm operand mapped to. llvm-svn: 163124
* [ms-inline asm] Add a comment.Chad Rosier2012-09-031-0/+3
| | | | llvm-svn: 163123
* [ms-inline asm] Add an interface to the GetMCInstOperandNum() function in theChad Rosier2012-09-031-0/+13
| | | | | | MCTargetAsmParser class. llvm-svn: 163122
OpenPOWER on IntegriCloud