aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Great renaming: Sparc --> SparcV9Brian Gaeke2004-02-251-29/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11826 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MOTy::UseType enum into MachineOperand. This eliminates theAlkis Evlogimenos2004-02-221-1/+1
| | | | | | | | | | switch statements in the constructors and simplifies the implementation of the getUseType() member function. You will have to specify defs using MachineOperand::Def instead of MOTy::Def though (similarly for Use and UseAndDef). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11715 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove getAllocatedRegNum(). Use getReg() instead.Alkis Evlogimenos2004-02-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11393 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MachineBasicBlock's vector of MachineInstr pointers into anAlkis Evlogimenos2004-02-121-1/+1
| | | | | | | | | | ilist of MachineInstr objects. This allows constant time removal and insertion of MachineInstr instances from anywhere in each MachineBasicBlock. It also allows for constant time splicing of MachineInstrs into or out of MachineBasicBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove assert as the only integer registers on the sparc are physical.Alkis Evlogimenos2004-02-111-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix previous broken commit. A MachineOperand may have opType ==Alkis Evlogimenos2004-02-111-2/+4
| | | | | | | | MO_VirtualRegister but if the register number is one of a physical register is it considered as a physical register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11315 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove assert as it is meaningless. MachineOperands can be tagged asAlkis Evlogimenos2004-02-111-2/+0
| | | | | | | MO_VirtualRegister but actually be representing a physical register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11310 91177308-0d34-0410-b5e6-96231b3b80d8
* Remvoe use of MO.isVirtualRegister(), turn an assertion into an assert()Chris Lattner2004-02-101-5/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11280 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove use of isPhysicalRegisterChris Lattner2004-02-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11277 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist some sparc specific code into the sparc targetChris Lattner2003-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10554 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip JIT specific stuff out of TargetMachine, as per PR176Chris Lattner2003-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10542 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganized the Sparc backend to be more modular -- each differentMisha Brukman2003-12-171-27/+36
| | | | | | | | | | | | | | implementation of a Target{RegInfo, InstrInfo, Machine, etc} now has a separate header and a separate implementation file. This means that instead of a massive SparcInternals.h that forces a recompilation of the whole target whenever a minor detail is changed, you should only recompile a few files. Note that SparcInternals.h is still around; its contents should be minimized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10500 91177308-0d34-0410-b5e6-96231b3b80d8
* Change interface of MachineOperand as follows:Alkis Evlogimenos2003-12-141-8/+8
| | | | | | | | | | | | | | | | a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse() b) add isUse(), isDef() c) rename opHiBits32() to isHiBits32(), opLoBits32() to isLoBits32(), opHiBits64() to isHiBits64(), opLoBits64() to isLoBits64(). This results to much more readable code, for example compare "op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used very often in the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
* * Add code to flush the ICache, which any self-respecting SMC must doMisha Brukman2003-11-211-5/+8
| | | | | | | | | * Restore registers *after* everything else to avoid any possible side effects This fixes McCat-imp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10147 91177308-0d34-0410-b5e6-96231b3b80d8
* Include the file before we close the llvm namespace.Misha Brukman2003-11-131-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9954 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR103Brian Gaeke2003-11-091-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9830 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement branching to a PC-relative constant (not a BasicBlock).Misha Brukman2003-11-071-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9793 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to emitting MachineConstantPool the way it was meant to be done.Misha Brukman2003-11-071-45/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9777 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor leftover fixups from replaceMachineCodeForFunction () change.Brian Gaeke2003-10-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9295 91177308-0d34-0410-b5e6-96231b3b80d8
* Make replaceMachineCodeForFunction return void.Brian Gaeke2003-10-201-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9288 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor jump insertion code from CompilationCallback() into insertJumpAtAddr().Brian Gaeke2003-10-171-27/+33
| | | | | | | | | Make insertFarJumpAtAddr() return void, because nothing uses its return value. Remove some commented-out code. Implement replaceMachineCodeForFunction() for SPARC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9203 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove WordsEmitted statistic; there's already a non-backend-specificBrian Gaeke2003-10-131-3/+10
| | | | | | | | | jello statistic for this (just divide #-bytes-of-code-emitted by 4). Rewrite head-of-file comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9098 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling.Misha Brukman2003-10-101-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
* Add statistic for # of emitWord() calls.Brian Gaeke2003-09-301-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8772 91177308-0d34-0410-b5e6-96231b3b80d8
* Added some optimizations:Misha Brukman2003-09-051-34/+66
| | | | | | | | | | | | | * Generate a single BA instead of 6-instruction JUMP if possible (this occurs both in the creation and overwriting of the stub code) * If possible, rewrite the ORIGINAL call to call the generated function directly, thus bypassing the stub entirely Also added some statistics on how often calls are overwritten and how often the CompilationCallback is invoked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8376 91177308-0d34-0410-b5e6-96231b3b80d8
* * Use alloca() to force GCC not to eliminate frame pointerMisha Brukman2003-08-291-115/+90
| | | | | | | | | | * Break apart saving and restoring registers into separate functions * Instead of saving single and double FP registers, just save the double registers -- aliasing helps preserve the single FP registers as well. * Request just as much memory for a stub as we actually use git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8200 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that the JIT memory manager allocates as many bytes as necessary rather thanMisha Brukman2003-08-151-1/+2
| | | | | | | | rounding up to a page, we need to request (num instrs * 4) bytes. However, I think that 64 bytes is overkill for the stub function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7888 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix register and parameter numbers in saving double FP registers.Misha Brukman2003-08-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7884 91177308-0d34-0410-b5e6-96231b3b80d8
* * Must save FP registers when calling CompilationCallback(), because FPMisha Brukman2003-08-151-24/+168
| | | | | | | | | registers are global, are NOT windowed, and hence can be clobbered! * Removed unused register shorthand notations * Fixed and cleaned up comments in inline assembly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7853 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak SPARC backend: addPassesToJITCompile andBrian Gaeke2003-08-141-1/+1
| | | | | | | addPassesToEmitMachineCode now both take a FunctionPassManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7837 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the registers g1 and g5 as temporaries for making far jumps and far calls,Misha Brukman2003-08-061-64/+48
| | | | | | | | | | | | because saving i1 and i2 to their ``designated'' stack slots corrupts unknown memory in other functions, standard libraries, and worse. In addition, this has the benefit of improving JIT performance because we eliminate writing out 4 instructions in CompilationCallback() and 2 loads and 2 stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7653 91177308-0d34-0410-b5e6-96231b3b80d8
* SparcV9CodeEmitter.cpp:Misha Brukman2003-08-061-211/+166
| | | | | | | | | | | | | | | * Doxygen-ified comments * Added capability to make far calls (i.e., beyond 30 bits in CALL instr) which implies that we need to delete function references that were added by the call to addFunctionReference() because the actual call instruction is 10 instructions away (thanks to 64-bit address construction) * Cleaned up code that generates far jumps by using an array+loop SparcV9CodeEmitter.h: * Explained more of the side-effects of emitFarCall() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7639 91177308-0d34-0410-b5e6-96231b3b80d8
* DEBUG got moved to Debug.hChris Lattner2003-08-011-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7495 91177308-0d34-0410-b5e6-96231b3b80d8
* * Correctly emit a far call if the target address does not fit into 30 bitsMisha Brukman2003-07-291-17/+15
| | | | | | | | instead of assert()ing * Fixed a nasty bug where '07' was used instead of register 'o7' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7382 91177308-0d34-0410-b5e6-96231b3b80d8
* This code doesn't modify the LLVM structure, keep stuff constChris Lattner2003-07-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7343 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed the number translation scheme for the integer condition code registers: itMisha Brukman2003-07-161-31/+8
| | | | | | | | | | | now works in instructions which require a 2-bit or 3-bit INTcc code. Incidentally, that means that the representation of INTcc registers is now the same in both integer and FP instructions. Thus, code became much simpler and cleaner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7185 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly handle calls to functions which are further away than 2**32 bits willMisha Brukman2003-07-151-6/+95
| | | | | | | | | | | | | allow, i.e. make a sequence of instructions to enable an indirect call using jump-and-link and 2 temporary registers (which we save and ultimately restore). Warning: if the delay slot of a function call is used to do meaningful work and not just a NOP, this behavior is incorrect. However, the Sparc backend does not yet utilize the delay slots effectively, so it is not necessary to make an overly complicated algorithm for something that's not used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7178 91177308-0d34-0410-b5e6-96231b3b80d8
* * Added support for the %ccr registerMisha Brukman2003-07-141-72/+23
| | | | | | | | | * FP double registers are now coded correctly * Removed function which converted registers based on register types, it was broken (because regTypes are broken) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7175 91177308-0d34-0410-b5e6-96231b3b80d8
* Apparently, the "regType" and "regClass" used in the Sparc backend are not bothMisha Brukman2003-07-031-39/+90
| | | | | | | | | | | | correct: empirically, "regType" is wrong for a number of registers. Thus, one can only rely on the "regClass" to figure out what kind of register one is dealing with. This change switches to using only "regClass" and adds a few extra DEBUG() print statements and a few clean-ups in comments and code, mostly minor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7103 91177308-0d34-0410-b5e6-96231b3b80d8
* Print address out as hex.Misha Brukman2003-06-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6657 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bunch of test cases in test/Regression/Jello which could not get theMisha Brukman2003-06-061-2/+13
| | | | | | | address of a floating-point (allocated via ConstantPool) correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6647 91177308-0d34-0410-b5e6-96231b3b80d8
* * If a global is not a function, just ask the MachineCodeEmitter for the addrMisha Brukman2003-06-061-3/+3
| | | | | | | * Do not block a print statement with a DEBUG() guard if we're going to abort() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6645 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all debug print statements under the DEBUG() guard to make output clean soMisha Brukman2003-06-061-35/+36
| | | | | | | that tests can automatically diff the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6642 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed confusion between register classes and register types.Misha Brukman2003-06-051-2/+4
| | | | | | | Now %fcc registers are recognized correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6640 91177308-0d34-0410-b5e6-96231b3b80d8
* Added lazy function resolution to the JIT.Misha Brukman2003-06-051-31/+219
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6633 91177308-0d34-0410-b5e6-96231b3b80d8
* * Instead of re-inventing the MachineConstantPool emitter that's already givenMisha Brukman2003-06-041-97/+138
| | | | | | | | | | | | | | | | | | | | | in Emitter.cpp, just convert the Sparc version of the constant pool into what's already supported and inter-operate. * Implemented a first pass at lazy function resolution in the JITResolver. That required adding a SparcV9CodeEmitter pointer to simplify generating bit-patterns of the instructions. * SparcV9CodeEmitter now creates and destroys static TheJITResolver, which makes sense because the SparcV9CodeEmitter is the only user of TheJITResolver, and lives for the entire duration of the JIT (via PassManager which lives in VM). * Changed all return values in the JITResolver to uint64_t because of the 64-bit Sparc architecture. * Added a new version of getting the value of a GlobalValue in the SparcV9CodeEmitter, which now works for already-generated functions (JITted or library functions). * Removed little-used and unused functions, cleaning up the internal view of the SparcV9CodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6612 91177308-0d34-0410-b5e6-96231b3b80d8
* Constants are laid out in memory in PC-relative form.Misha Brukman2003-06-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6568 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up after merging in SparcEmitter.cpp; branches and return work again.Misha Brukman2003-06-021-11/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6536 91177308-0d34-0410-b5e6-96231b3b80d8