1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

30 Commits

Author SHA1 Message Date
Misha Brukman
cddc1c4f9c Now that the JIT memory manager allocates as many bytes as necessary rather than
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.

llvm-svn: 7888
2003-08-15 18:03:06 +00:00
Misha Brukman
16cd96bf4a Fix register and parameter numbers in saving double FP registers.
llvm-svn: 7884
2003-08-15 16:15:28 +00:00
Misha Brukman
a45f4930ed * Must save FP registers when calling CompilationCallback(), because FP
registers are global, are NOT windowed, and hence can be clobbered!
* Removed unused register shorthand notations
* Fixed and cleaned up comments in inline assembly

llvm-svn: 7853
2003-08-15 00:26:50 +00:00
Brian Gaeke
bff292410d Unbreak SPARC backend: addPassesToJITCompile and
addPassesToEmitMachineCode now both take a FunctionPassManager.

llvm-svn: 7837
2003-08-14 06:04:59 +00:00
Misha Brukman
ea0aa3f793 Use the registers g1 and g5 as temporaries for making far jumps and far calls,
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.

llvm-svn: 7653
2003-08-06 22:19:18 +00:00
Misha Brukman
2f831da9af SparcV9CodeEmitter.cpp:
* 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()

llvm-svn: 7639
2003-08-06 16:20:22 +00:00
Chris Lattner
277bb3482c DEBUG got moved to Debug.h
llvm-svn: 7495
2003-08-01 22:19:03 +00:00
Misha Brukman
9bcbe0c3bc * Correctly emit a far call if the target address does not fit into 30 bits
instead of assert()ing
* Fixed a nasty bug where '07' was used instead of register 'o7'

llvm-svn: 7382
2003-07-29 19:00:58 +00:00
Chris Lattner
406d31b4c2 This code doesn't modify the LLVM structure, keep stuff const
llvm-svn: 7343
2003-07-26 23:04:00 +00:00
Misha Brukman
8c9be85d5d Fixed the number translation scheme for the integer condition code registers: it
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.

llvm-svn: 7185
2003-07-16 20:30:40 +00:00
Misha Brukman
8cd8690ad5 Correctly handle calls to functions which are further away than 2**32 bits will
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.

llvm-svn: 7178
2003-07-15 19:09:43 +00:00
Misha Brukman
d594e21afa * Added support for the %ccr register
* FP double registers are now coded correctly
* Removed function which converted registers based on register types, it was
  broken (because regTypes are broken)

llvm-svn: 7175
2003-07-14 23:26:03 +00:00
Misha Brukman
20fcdbc808 Apparently, the "regType" and "regClass" used in the Sparc backend are not both
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.

llvm-svn: 7103
2003-07-03 18:36:47 +00:00
Misha Brukman
4f614afd11 Print address out as hex.
llvm-svn: 6657
2003-06-06 09:53:28 +00:00
Misha Brukman
960a2c69b5 Fixed a bunch of test cases in test/Regression/Jello which could not get the
address of a floating-point (allocated via ConstantPool) correctly.

llvm-svn: 6647
2003-06-06 04:41:22 +00:00
Misha Brukman
4720f1af42 * If a global is not a function, just ask the MachineCodeEmitter for the addr
* Do not block a print statement with a DEBUG() guard if we're going to abort()

llvm-svn: 6645
2003-06-06 03:35:37 +00:00
Misha Brukman
9136d8dd0d Put all debug print statements under the DEBUG() guard to make output clean so
that tests can automatically diff the output.

llvm-svn: 6642
2003-06-06 00:26:11 +00:00
Misha Brukman
c3b2d93a5c Fixed confusion between register classes and register types.
Now %fcc registers are recognized correctly.

llvm-svn: 6640
2003-06-05 23:51:10 +00:00
Misha Brukman
26e89721e8 Added lazy function resolution to the JIT.
llvm-svn: 6633
2003-06-05 20:52:06 +00:00
Misha Brukman
a8c409ad9b * Instead of re-inventing the MachineConstantPool emitter that's already given
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.

llvm-svn: 6612
2003-06-04 20:01:13 +00:00
Misha Brukman
e5c5705c02 Constants are laid out in memory in PC-relative form.
llvm-svn: 6568
2003-06-03 03:24:12 +00:00
Misha Brukman
5e6f3a150c Clean up after merging in SparcEmitter.cpp; branches and return work again.
llvm-svn: 6536
2003-06-02 05:24:46 +00:00
Misha Brukman
5f7d301059 Merged in tools/lli/JIT/SparcEmitter.cpp, coupled with the JITResolver taken
from lib/Target/X86/X86CodeEmitter.cpp .

llvm-svn: 6530
2003-06-02 04:12:39 +00:00
Brian Gaeke
1547687d07 Deal with %lo/%lm/%hm/%hh flags in getMachineOpValue().
llvm-svn: 6522
2003-06-02 02:13:26 +00:00
Misha Brukman
be11d6eed3 Removed useless code -- the byte order of output code is correct as is.
llvm-svn: 6462
2003-05-31 06:26:06 +00:00
Misha Brukman
d40446e90c Added:
* ability to save BasicBlock references to be resolved later
* register remappings from the enum values to the real hardware numbers

llvm-svn: 6449
2003-05-30 20:17:33 +00:00
Misha Brukman
69c46ee879 Fixed an error preventing compilation.
llvm-svn: 6381
2003-05-27 22:48:28 +00:00
Misha Brukman
6e1f75f37c Keep track of the current BasicBlock being processed so that a referencing
MachineInstr can later be patched up correctly.

llvm-svn: 6378
2003-05-27 22:41:44 +00:00
Misha Brukman
125a99a9a3 Broke out class definition from SparcV9CodeEmitter, and added ability to take a
MachineCodeEmitter to make a pass-through debugger -- output to memory and to
std::cerr.

llvm-svn: 6363
2003-05-27 21:45:05 +00:00
Misha Brukman
e315a4f211 SparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main function
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 .

llvm-svn: 6357
2003-05-27 20:07:58 +00:00