aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
AgeCommit message (Collapse)Author
2003-09-30Add statistic for # of emitWord() calls.Brian Gaeke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8772 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05Added some optimizations:Misha Brukman
* 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
2003-08-29* Use alloca() to force GCC not to eliminate frame pointerMisha Brukman
* 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
2003-08-15Now that the JIT memory manager allocates as many bytes as necessary rather thanMisha Brukman
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
2003-08-15Fix register and parameter numbers in saving double FP registers.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7884 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15* Must save FP registers when calling CompilationCallback(), because FPMisha Brukman
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
2003-08-14Unbreak SPARC backend: addPassesToJITCompile andBrian Gaeke
addPassesToEmitMachineCode now both take a FunctionPassManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7837 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06Use the registers g1 and g5 as temporaries for making far jumps and far calls,Misha Brukman
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
2003-08-06SparcV9CodeEmitter.cpp:Misha Brukman
* 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
2003-08-01DEBUG got moved to Debug.hChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7495 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29* Correctly emit a far call if the target address does not fit into 30 bitsMisha Brukman
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
2003-07-26This code doesn't modify the LLVM structure, keep stuff constChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7343 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16Fixed the number translation scheme for the integer condition code registers: itMisha Brukman
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
2003-07-15Correctly handle calls to functions which are further away than 2**32 bits willMisha Brukman
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
2003-07-14* Added support for the %ccr registerMisha Brukman
* 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
2003-07-03Apparently, the "regType" and "regClass" used in the Sparc backend are not bothMisha Brukman
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
2003-06-06Print address out as hex.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06Fixed a bunch of test cases in test/Regression/Jello which could not get theMisha Brukman
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
2003-06-06* If a global is not a function, just ask the MachineCodeEmitter for the addrMisha Brukman
* 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
2003-06-06Put all debug print statements under the DEBUG() guard to make output clean soMisha Brukman
that tests can automatically diff the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05Fixed confusion between register classes and register types.Misha Brukman
Now %fcc registers are recognized correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6640 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05Added lazy function resolution to the JIT.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6633 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04* Instead of re-inventing the MachineConstantPool emitter that's already givenMisha Brukman
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
2003-06-03Constants are laid out in memory in PC-relative form.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02Clean up after merging in SparcEmitter.cpp; branches and return work again.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02Merged in tools/lli/JIT/SparcEmitter.cpp, coupled with the JITResolver takenMisha Brukman
from lib/Target/X86/X86CodeEmitter.cpp . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6530 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02Deal with %lo/%lm/%hm/%hh flags in getMachineOpValue().Brian Gaeke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6522 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31Removed useless code -- the byte order of output code is correct as is.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6462 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30Added:Misha Brukman
* ability to save BasicBlock references to be resolved later * register remappings from the enum values to the real hardware numbers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6449 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27Fixed an error preventing compilation.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6381 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27Keep track of the current BasicBlock being processed so that a referencingMisha Brukman
MachineInstr can later be patched up correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6378 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27Broke out class definition from SparcV9CodeEmitter, and added ability to take aMisha Brukman
MachineCodeEmitter to make a pass-through debugger -- output to memory and to std::cerr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27SparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main functionMisha Brukman
that assembles instructions is generated via TableGen (and hence must be built before building this directory, but that's already the case in the top-level Makefile). Also added is .cvsignore to ignore the generated file `SparcV9CodeEmitter.inc', which is included by SparcV9CodeEmitter.cpp . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6357 91177308-0d34-0410-b5e6-96231b3b80d8