summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Printer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Print % signs before register names; turn off "noprefix" mode in gas output.Brian Gaeke2003-08-111-16/+31
| | | | | | | | | Fixes test case test/Programs/LLVMSource/2003-08-03-ReservedWordGlobal.ll. Also: Refactor implicit-uses printing into its own method. Remove a couple of unused variables. llvm-svn: 7737
* Simplify some constant expressionsChris Lattner2003-08-041-13/+9
| | | | llvm-svn: 7556
* Remove illegal, unsupported escapes. This fixes program: Ptrdist-bcChris Lattner2003-08-031-2/+0
| | | | llvm-svn: 7552
* * Sort #includes, remove dupliatesChris Lattner2003-08-031-36/+25
| | | | | | | | * Use .zero to emit padding between struct elements * Emit .comm symbols when we can, this dramatically reduces the amount of gunk we have to print * Print global variable identifiers next to initializer more nicely. llvm-svn: 7551
* I think local symbols in X86 GAS have to start with .L, not justBrian Gaeke2003-07-311-3/+5
| | | | | | | .; so I have changed the basic block markers to start with .L. I also broke up a >80char line. llvm-svn: 7452
* Use unified CWriter-X86/Printer name mangler. Do not bother usingBrian Gaeke2003-07-241-88/+28
| | | | | | | SlotCalculator in CWriter. (Unfortunately, all this means a lot of X86/Printer's methods have to be de-constified again. Oh well.) llvm-svn: 7299
* It doesn't appear that we need to #include these.Brian Gaeke2003-07-241-3/+0
| | | | llvm-svn: 7291
* Constify most methods. We could have constified doInitialization andBrian Gaeke2003-07-241-16/+25
| | | | | | | | | | | doFinalization too except that would have made them shadow, not override, the parent class :-P. Allow *any* constant cast expression between pointers and longs, or vice-versa, or any widening (not just same-size) conversion that isLosslesslyConvertibleTo approves. This fixes oopack. llvm-svn: 7288
* Printer.cpp: Ditch addRequired/getAnalysis, because they leaveBrian Gaeke2003-07-231-55/+51
| | | | | | | | | | | Printer::doFinalization() out in the cold. Now we pass in a TargetMachine to Printer's constructor and get the TargetData from the TargetMachine. Don't pass TargetMachine or MRegisterInfo objects around in the Printer. Constify TargetData references. X86.h: Update comment and prototype of createX86CodePrinterPass(). X86TargetMachine.cpp: Update callers of createX86CodePrinterPass(). llvm-svn: 7275
* Add, rewrite, and/or reformat many comments.Brian Gaeke2003-07-231-80/+120
| | | | | | | | | | | | | | | | | | | | Stop passing ostreams around: we already have one perfectly good ostream and we can all share it. Stop stashing a pointer to TargetData in the Pass object, because that will lead to a crash if there are no functions in the module (ouch!) Instead, use addRequired() and getAnalysis(), like we always should have done. Move the check for ConstantExpr up before the check for isPrimitiveType, because we need to be able to catch e.g. ubyte (cast bool false to ubyte), whose type is primitive but which is nevertheless a ConstantExpr, by calling our specialized handler instead of the AsmWriter. This would result in assembler errors when we would try to output something like ".byte (cast bool false to ubyte)". GC some unused variable declarations. llvm-svn: 7265
* Simplify code by using ConstantInt::getRawValue instead of checking to seeChris Lattner2003-07-231-15/+6
| | | | | | whether the constant is signed or unsigned, then casting llvm-svn: 7252
* If we have a constant pointer reference to a function, we were printingBrian Gaeke2003-07-111-1/+22
| | | | | | | | out the entire llvm disassembly for the function at global constant-output time, which caused the assembler to barf in 164.gzip. This fixes that particular problem (though 164.gzip has other problems with X86 llc.) llvm-svn: 7168
* Fix some serious floating-point bugs (fixes test cases such as Oscar,Brian Gaeke2003-07-111-2/+51
| | | | | | | | | | | | | | Fhourstones, McCat-vor, and many others...) Printer.cpp: Print implicit uses for AddRegFrm instructions. Break gas bug workarounds up into separate stanzas of code for each bug. Add new workarounds for fild and fistp. X86InstrInfo.def: Add O_ST0 implicit uses for more FP instrs where they obviously apply. Also add PrintImplUses flags for FP instrs where they are necessary for gas to understand the output. llvm-svn: 7165
* Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]Brian Gaeke2003-07-071-2/+31
| | | | | | instructions, by outputting them as bytes. llvm-svn: 7115
* Nice tasty llc fixes. These should fix LLC for x86 for everything inBrian Gaeke2003-06-271-43/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SingleSource except oopack and Oscar. (Sorry, Oscar.) include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add accessors for ImplicitUses/Defs. lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you really wanted this, just use MI->print(O, TM); instead... lib/Target/X86: FloatingPoint.cpp: ...like this. X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses target-specific flag bit. X86InstrInfo.def: Add the PrintImplUses flag to all the instructions which implicitly use CL, because the assembler needs to see the CL in order to generate the right instruction. Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName to name constants in the constant pool for each function instead. This avoids keeping state between runOnMachineFunction() invocations, which is a no-no. Having MangledGlobals be global is a bogon I'd like to get rid of too, but making it a static member of Printer causes link errors (why???). Make NumberForBB into a member of Printer instead of a global, too. Make printOp and printMemReference into methods of Printer. X86InstrInfo::print is now Printer::printMachineInstruction, because TargetInstrInfo::print is history. (Because of this, we have to qualify the names of some TargetInstrInfo methods we call.) Print out the ImplicitUses field of any instruction we print that has the PrintImplUses bit set. llvm-svn: 6924
* Number constants from constant pool as CPIf_i where f is the function indexBrian Gaeke2003-06-261-10/+11
| | | | | | and i is the constant pool index. llvm-svn: 6920
* Integrate the C writer's name mangler.Brian Gaeke2003-06-251-15/+82
| | | | llvm-svn: 6908
* First draft of X86 LLC backend. This should be OK for small programs likeBrian Gaeke2003-06-251-30/+354
| | | | | | Shootout, but it has some issues with bigger programs. Work in progress. llvm-svn: 6907
* Fix output bug: Intel asm comment character is #, not ;.Brian Gaeke2003-06-191-1/+1
| | | | llvm-svn: 6792
* Add Initialization and Finalization methods for the Printer pass,Brian Gaeke2003-06-191-3/+26
| | | | | | | | | | | | to print various things on a module-by-module basis (currently, only the former is used). Don't print < > around names. The assembler can't take it. Print pseudoinstructions only as comments. The poor little assembler can't take that, either. llvm-svn: 6789
* Renamed opIsDef to opIsDefOnly.Vikram S. Adve2003-05-271-3/+6
| | | | llvm-svn: 6340
* Rename MachineInstrInfo -> TargetInstrInfoChris Lattner2003-01-141-4/+4
| | | | llvm-svn: 5272
* * Implement rudimentary output of the constant poolChris Lattner2003-01-131-19/+110
| | | | | | | | | * Implement support for MRMS?m instructions * Add Arg64 support * Add support for frame indexes and constant pool indexes * llvm-svn: 5225
* * Convert to a MachineFunctionPassChris Lattner2002-12-281-36/+37
| | | | | | | * Don't take a TM as a ctor parameter * Print [X - Y] instead of [X + -Y] when possible llvm-svn: 5180
* Add printer support for Pseudo instructionsChris Lattner2002-12-251-18/+33
| | | | llvm-svn: 5150
* Add support for the bswap instructionChris Lattner2002-12-231-3/+5
| | | | llvm-svn: 5114
* Give passes nice names!Chris Lattner2002-12-151-0/+4
| | | | llvm-svn: 5059
* Use MachineOperand::isFoo methods instead of our own global functionsChris Lattner2002-12-151-34/+20
| | | | llvm-svn: 5033
* Print X86 PHI nodes in a sane mannerChris Lattner2002-12-131-0/+16
| | | | llvm-svn: 5003
* InstSelectSimple.cpp: Give promote32 a comment. Add initialBrian Gaeke2002-12-131-2/+2
| | | | | | | | | | | implementation of getReg() for arguments. MachineCodeEmitter.cpp: Fix using EBP with index, scale and no displacement (whew!) due to Chris. Printer.cpp: Fix printing out index and scale in memory references. llvm-svn: 4998
* Rename MemArg* to Arg*Chris Lattner2002-12-131-7/+7
| | | | llvm-svn: 4979
* Target/X86/Printer.cpp: Add sizePtr function, and use it instead ofBrian Gaeke2002-12-051-2/+14
| | | | | | | | | | | | | | | | | | " <SIZE> PTR " string when emitting assembly. Target/X86/X86InstrInfo.def: Tidy up a bit: Squashed everything down to 118 chars wide, wrapping lines so that comment is at the same point on each line. Rename "NoImpRegs" as "NoIR". (most instructions have NoImpRegs twice on a line, so this saves 10 columns). Also, annotate various instructions with flags for size of memory operand. (MemArg16, MemArg32, MemArg64, etc.) Target/X86/X86InstrInfo.h: Define flags for size of memory operand. (MemArg16, MemArg32, MemArg64, etc.) llvm-svn: 4932
* Fix bogus assertion failuresChris Lattner2002-12-041-1/+1
| | | | llvm-svn: 4919
* Avoid bad assertionChris Lattner2002-12-041-1/+1
| | | | llvm-svn: 4918
* Add support for referencing global variables/functionsChris Lattner2002-12-041-2/+10
| | | | llvm-svn: 4907
* Split the machine code emitter completely out of the printerChris Lattner2002-12-031-199/+1
| | | | llvm-svn: 4882
* Remove commentChris Lattner2002-12-021-7/+0
| | | | | | Remove handling of OtherFrm llvm-svn: 4867
* Add rawfrm flagsChris Lattner2002-12-011-4/+23
| | | | llvm-svn: 4841
* Handle cmp Reg, 0 correctlyChris Lattner2002-11-211-10/+13
| | | | llvm-svn: 4819
* Fix off by one bugChris Lattner2002-11-211-1/+1
| | | | llvm-svn: 4816
* Minor code cleanupsChris Lattner2002-11-211-2/+1
| | | | llvm-svn: 4814
* Implement printing of store instructionsChris Lattner2002-11-211-5/+20
| | | | llvm-svn: 4813
* The big change here is to handle printing/emission of X86II::MRMSrcMemChris Lattner2002-11-211-23/+184
| | | | | | | instructions. Right now the only users are load instructions, and Misha's spill code llvm-svn: 4812
* Add printing support for /0 /1 type instructionsChris Lattner2002-11-211-1/+44
| | | | llvm-svn: 4803
* Support Registers of the form (B8+ rd) for exampleChris Lattner2002-11-211-10/+55
| | | | llvm-svn: 4798
* Implement printing more, implement opcode output moreChris Lattner2002-11-211-10/+57
| | | | llvm-svn: 4796
* Print another class of instructions correctly, giving us: xorl EDX, EDXChris Lattner2002-11-211-15/+37
| | | | | | for example. llvm-svn: 4793
* Check not only for MO_VirtualRegister, but MO_MachineRegister as well whenMisha Brukman2002-11-201-7/+14
| | | | | | printing out assembly. After all, we want the real thing too. llvm-svn: 4783
* Start trying to print instructions more correctly. For now we also print ↵Chris Lattner2002-11-181-2/+91
| | | | | | out the opcode for each instruction as well. llvm-svn: 4743
* Arrange to have a TargetMachine available in X86InstrInfo::printChris Lattner2002-11-171-3/+4
| | | | llvm-svn: 4734
OpenPOWER on IntegriCloud