Misha Brukman [Tue, 27 May 2003 22:43:19 +0000 (22:43 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 22:39:01 +0000 (22:39 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 22:37:00 +0000 (22:37 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 22:32:38 +0000 (22:32 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 22:24:48 +0000 (22:24 +0000)]
* 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
Misha Brukman [Tue, 27 May 2003 22:19:58 +0000 (22:19 +0000)]
* Now outputting a static function getBinaryCodeForInstr() (JIT-accessible)
* For debugging purposes:
+ output the predefined bit pattern of the instruction
* Fixed inefficiency: only load an operand from MachineInstr once
* Bug fix: did not advance bit index when seeing named bit-fields "annul", "cc"
and "predict"
* Added a catch-all for non-supported instructions at the end of switch stmt.
Misha Brukman [Tue, 27 May 2003 22:01:10 +0000 (22:01 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 21:45:05 +0000 (21:45 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 21:42:05 +0000 (21:42 +0000)]
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.
Misha Brukman [Tue, 27 May 2003 21:40:39 +0000 (21:40 +0000)]
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...
Misha Brukman [Tue, 27 May 2003 20:07:58 +0000 (20:07 +0000)]
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 .
Vikram S. Adve [Tue, 27 May 2003 00:06:48 +0000 (00:06 +0000)]
Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".
Vikram S. Adve [Tue, 27 May 2003 00:05:23 +0000 (00:05 +0000)]
(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".
Vikram S. Adve [Tue, 27 May 2003 00:02:22 +0000 (00:02 +0000)]
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.
Misha Brukman [Sun, 25 May 2003 16:38:24 +0000 (16:38 +0000)]
Do not show errors when moving file. The error is shown the first time anyone
runs `utils/cvsupdate' since there is no `cvs.out' file for mv to move, and it
is reported as such.
Misha Brukman [Sat, 24 May 2003 00:08:39 +0000 (00:08 +0000)]
NOP instructions are pseudo-instructions. We should not have them explicitly in
our representation, since they are usually special cases of already-existing
instructions.
This abstracts away methods that let a pass create and verify a NOP instruction,
without relying on a `NOP' enum to be in existence in the target's instruction
info descriptor.
Brian Gaeke [Fri, 23 May 2003 20:27:07 +0000 (20:27 +0000)]
gccld.cpp:
Fix typo in header.
Add IsArchive static method.
Roll LoadLibraryFromDirectory() into LoadLibrary(), and factor
LoadLibraryExactName() out of the result. Instead of treating the current
directory specially, just insert it into LibPaths in the beginning of
main().
Make LoadLibrary() take a "search" flag that says whether to search for the
correct library, or just trust that LibName is right.
Make LinkLibrary() take a "search" flag, and pass it to LoadLibrary().
Change the for-loop over InputFilenames to detect ar archives and link them
in as libraries without searching.
Change the for-loop over Libraries to explicitly turn on the "search" flag
to LinkLibrary() that makes LoadLibrary() search for the correct library
(i.e., when processing -lNAME options.)
Chris Lattner [Fri, 23 May 2003 20:03:32 +0000 (20:03 +0000)]
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.
Chris Lattner [Thu, 22 May 2003 19:48:00 +0000 (19:48 +0000)]
* Revert to old behavior of ignoring a module if it doesn't contain a main
function and no symbols were explicitly marked to be externalized.
* Add new -internalize-public-api-list option that can be used if the symbol
list is small, and making a new file is annoying.
Chris Lattner [Thu, 22 May 2003 18:35:38 +0000 (18:35 +0000)]
Fix bug: Assembler/2003-05-03-BytecodeReaderProblem.llx
by emitting the type planes before any constants (which could be constant
expressions involving undefined types!)