1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

3295 Commits

Author SHA1 Message Date
Misha Brukman
51eb037b1e Correctly write out binary data as chars, before they're cast to ints.
llvm-svn: 6385
2003-05-28 18:27:19 +00:00
Misha Brukman
45acae8fa4 Fixed ordering of elements in instructions: although the binary instructions
list (rd, rs1, imm), in that order (bit-wise), the actual assembly syntax is
instr rd, imm, rs1, and that is how they are constructed in the instruction
selector. This fixes the discrepancy.

Also fixed some comments along the same lines and fixed page numbers referring
to where instructions are described in the Sparc manual.

llvm-svn: 6384
2003-05-28 17:49:29 +00:00
Brian Gaeke
85c00e2ef2 Add dependency to make TableGen rule fire.
llvm-svn: 6383
2003-05-28 17:41:09 +00:00
Misha Brukman
69c46ee879 Fixed an error preventing compilation.
llvm-svn: 6381
2003-05-27 22:48:28 +00:00
Misha Brukman
3da906bb36 Added the 'r' and 'i' annotations to instructions as their opcode names have
changed.

llvm-svn: 6380
2003-05-27 22:44:44 +00:00
Misha Brukman
4960b8db94 Added a debugging code emitter that prints code to a file, debug to std::cerr,
and passes the real code to a memory-outputting code emitter. This may be
removed at a later point in development.

llvm-svn: 6379
2003-05-27 22:43:19 +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
87d98c1707 Added 'r' and 'i' annotations to instructions as SparcInstr.def has changed.
llvm-svn: 6377
2003-05-27 22:40:34 +00:00
Misha Brukman
e534d3bde2 Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Non-obvious change: since I have changed ST and STD to be STF and STDF to
(a) closer resemble their name (NOT assembly text) in the Sparc manual, and
(b) clearly specify that they they are floating-point opcodes,
I made the same changes in this file.

llvm-svn: 6376
2003-05-27 22:39:01 +00:00
Misha Brukman
1d3512486a Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Here I had to make one non-trivial change: add a function to get a version of
the opcode that takes an immediate, given an opcode that takes all registers.

This is required because sometimes it is not known at construction time which
opcode is used because opcodes are passed around between functions.

llvm-svn: 6375
2003-05-27 22:37:00 +00:00
Misha Brukman
4a16c0cab3 Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
llvm-svn: 6373
2003-05-27 22:35:43 +00:00
Misha Brukman
1b839ffe58 Added entries for each of the instructions with annotations ('r' or 'i').
llvm-svn: 6372
2003-05-27 22:33:39 +00:00
Misha Brukman
806f354c57 One of the first major changes to make the work of JITting easier: adding
annotations on instructions to specify which format they are (i.e., do they take
2 registers and 1 immediate or just 3 registers) as that changes their binary
representation and hence, code emission.

This makes instructions more like how X86 defines them to be. Now, writers of
instruction selection must choose the correct opcode based on what instruction
type they are building, which they already know. Thus, the JIT doesn't have to
do the same work by `discovering' which operands an instruction really has.

As this involves lots of small changes to a lot of files in lib/target/Sparc,
I'll commit them individually because otherwise the diffs will be unreadable.

llvm-svn: 6371
2003-05-27 22:32:38 +00:00
Misha Brukman
ab3b2ea95c * Allow passing in an unsigned configuration to allocateSparcTargetMachine()
a default value is set in the header file.
* Fixed some code layout to make it more consistent with the rest of codebase
* Added addPassesToJITCompile() with relevant passes

llvm-svn: 6369
2003-05-27 22:24:48 +00:00
Misha Brukman
30ca3282a1 Moved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
that Makefile.common would see it.

llvm-svn: 6367
2003-05-27 22:04:38 +00:00
Misha Brukman
0d507cb055 Add prototypes to add passes to JIT compilation and code emission.
Also, added annotations to how instructions are modified (reg/imm operands).
Added prototype for adding register numbers to values pass for interfacing with
the target-independent register allocators in the JIT.

llvm-svn: 6366
2003-05-27 22:01:10 +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
4931c59635 Link in Sparc libs for the JIT, even on X86 to be able to support debugging
of Sparc JIT (printing out instrs) on X86. Con: this increases linking time.

llvm-svn: 6361
2003-05-27 21:42:05 +00:00
Misha Brukman
afffd58fe6 Allow for specification of which JIT to run on the commandline.
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.

Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)

In the future, perhaps this should be a ./configure option to enable/disable
target JITting...

llvm-svn: 6360
2003-05-27 21:40:39 +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
Misha Brukman
ae0cac1d7a Added definitions for a bunch of floating-point instructions.
llvm-svn: 6356
2003-05-27 20:03:29 +00:00
Chris Lattner
66432896b4 Fix constant folding to ALWAYS work.
llvm-svn: 6355
2003-05-27 19:16:07 +00:00
Chris Lattner
416e30b07b Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll
llvm-svn: 6352
2003-05-27 16:40:51 +00:00
Chris Lattner
6796f5a374 Make _sure_ we don't go into an infinite loop if a signal happens!
llvm-svn: 6351
2003-05-27 16:25:04 +00:00
Chris Lattner
8a6c3b5cbe * Actually USE the statistic that we made
* Implement SRoA for arrays

llvm-svn: 6349
2003-05-27 16:09:27 +00:00
Chris Lattner
5c093a1a93 Implementation of the simple "scalar replacement of aggregates" transformation
llvm-svn: 6346
2003-05-27 15:45:27 +00:00
Vikram S. Adve
ab50c0aee5 Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags.  Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".

llvm-svn: 6342
2003-05-27 00:06:48 +00:00
Vikram S. Adve
681b3c77fa (1) Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
    from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
    and related functions and flags.  Fixed several bugs where only
    "isDef" was being checked, not "isDefAndUse".

llvm-svn: 6341
2003-05-27 00:05:23 +00:00
Vikram S. Adve
743adbaff7 Renamed opIsDef to opIsDefOnly.
llvm-svn: 6340
2003-05-27 00:03:17 +00:00
Vikram S. Adve
66969014b2 Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.
Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

llvm-svn: 6339
2003-05-27 00:02:22 +00:00
Chris Lattner
1fde83c9b5 Fix bug: InstCombine/2003-05-26-CastMiscompile.ll
llvm-svn: 6338
2003-05-26 23:41:32 +00:00
Vikram S. Adve
ba61ed4fc2 Bug fix: right shift for int divide-by-power-of-2 was incorrect for
negative values.  Need to add one to a negative value before right shift!

llvm-svn: 6334
2003-05-25 21:59:47 +00:00
Vikram S. Adve
f8bb6381df Bug fix: padding bytes within a structure should go after each field!
llvm-svn: 6333
2003-05-25 21:59:09 +00:00
Vikram S. Adve
b78161976c Bug fix: sign-extension was not happening for C = -MININT since C == -C!
llvm-svn: 6332
2003-05-25 21:58:11 +00:00
Chris Lattner
fbb45c1b92 Fix problem with last checkin.
llvm-svn: 6328
2003-05-25 16:15:32 +00:00
Vikram S. Adve
5553ed755a Add support for compiling varargs functions.
llvm-svn: 6325
2003-05-25 15:59:47 +00:00
Misha Brukman
6ffaa5b188 Reword to remove reference to how things worked in the past.
llvm-svn: 6323
2003-05-24 01:08:43 +00:00
Misha Brukman
b7a0d570a8 Implement the TargetInstrInfo's createNOPinstr() and isNOPinstr() interface.
llvm-svn: 6320
2003-05-24 00:09:50 +00:00
Chris Lattner
500984b918 Fix Bug: Linker/2003-04-26-NullPtrLinkProblem.ll
This was a problem with constants having their types resolved to some new type,
but there was already a constant of the new type created.  Before, these types
were never merged together, now they are.

llvm-svn: 6314
2003-05-23 20:03:32 +00:00
Misha Brukman
b385c22d80 Cleaned up code layout; no functional changes.
llvm-svn: 6312
2003-05-23 19:20:57 +00:00
Chris Lattner
e58f6153f4 Remove using declarations
llvm-svn: 6306
2003-05-22 22:00:07 +00:00
Chris Lattner
6751acb59b Add using declarations
llvm-svn: 6305
2003-05-22 21:59:35 +00:00
Misha Brukman
daf2cc3c48 Cleaned up code layout. No functional changes.
llvm-svn: 6304
2003-05-22 21:49:18 +00:00
Chris Lattner
1cab8ed666 Remove using declarations and extraneous #includes
llvm-svn: 6303
2003-05-22 21:47:17 +00:00
Chris Lattner
2fb982f365 Fix static constructor ordering problem
llvm-svn: 6302
2003-05-22 21:31:52 +00:00
Misha Brukman
7d91017b21 Kill `using' directives.
llvm-svn: 6301
2003-05-22 21:24:35 +00:00
Chris Lattner
20c876a592 Remove using declarations
llvm-svn: 6300
2003-05-22 21:21:43 +00:00
Chris Lattner
e1d3dfec23 Make the list accept comma separated names
llvm-svn: 6295
2003-05-22 20:27:13 +00:00
Chris Lattner
7099c87692 Add new CommaSeparated option modifier
llvm-svn: 6294
2003-05-22 20:26:17 +00:00
Chris Lattner
802d657a39 Destroy using declarations
llvm-svn: 6291
2003-05-22 20:06:43 +00:00