Commit Graph

787 Commits

Author SHA1 Message Date
Misha Brukman
b5b9adc5a0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6376 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:39:01 +00:00
Misha Brukman
91aee47a1b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6375 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:37:00 +00:00
Misha Brukman
71ed1c997b Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6373 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:35:43 +00:00
Misha Brukman
24b22a18ec Added entries for each of the instructions with annotations ('r' or 'i').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6372 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:33:39 +00:00
Misha Brukman
6ddd9d87a7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6371 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:32:38 +00:00
Misha Brukman
86172ab3d6 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6369 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:24:48 +00:00
Misha Brukman
51aa21c702 Moved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
that Makefile.common would see it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6367 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:04:38 +00:00
Misha Brukman
79caf1fe26 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:01:10 +00:00
Misha Brukman
0cc640e6c8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 21:45:05 +00:00
Misha Brukman
3de36f5309 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 .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 20:07:58 +00:00
Misha Brukman
998800cb87 Added definitions for a bunch of floating-point instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6356 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 20:03:29 +00:00
Vikram S. Adve
a22eace55b Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags.  Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 00:06:48 +00:00
Vikram S. Adve
5f2180c533 (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".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 00:05:23 +00:00
Vikram S. Adve
78a4f23a8e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6339 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 00:02:22 +00:00
Vikram S. Adve
645fea33be 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-25 21:59:47 +00:00
Vikram S. Adve
9e49824d70 Bug fix: padding bytes within a structure should go after each field!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-25 21:59:09 +00:00
Vikram S. Adve
c2f0939320 Bug fix: sign-extension was not happening for C = -MININT since C == -C!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-25 21:58:11 +00:00
Vikram S. Adve
5b1b47b824 Add support for compiling varargs functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6325 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-25 15:59:47 +00:00
Misha Brukman
12745c55e1 Reword to remove reference to how things worked in the past.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 01:08:43 +00:00
Misha Brukman
e9d883828a Implement the TargetInstrInfo's createNOPinstr() and isNOPinstr() interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 00:09:50 +00:00
Misha Brukman
f96eb64666 Cleaned up code layout; no functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-23 19:20:57 +00:00
Misha Brukman
6b77ec4156 Cleaned up code layout. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:49:18 +00:00
Misha Brukman
c2312df45c Kill `using' directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:24:35 +00:00
Misha Brukman
c97a2075d9 Fixed `volatile' typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 19:34:28 +00:00
Misha Brukman
81b0686f09 Cleaned up code layout, spacing, etc. for readability purposes and to be more
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)

No functional changes were made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6265 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 18:48:06 +00:00
Misha Brukman
77c9fcb797 Cleaned up code layout, spacing, etc. for readability purposes and to be more
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)

No functional changes were made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6262 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 18:05:35 +00:00
Misha Brukman
ee563cb978 Namespacified vector' and cerr' to always use the `std::' namespace.
Eliminated `using' directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6261 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 17:59:06 +00:00
Misha Brukman
1a1046b7bc The word operands' has an r' in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6250 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 20:36:39 +00:00
Misha Brukman
a98cd4578f Sparc instruction opcodes now all live under the `V9' namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6249 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 20:32:24 +00:00
Chris Lattner
ee92637cfa Remove wierd printout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6145 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 20:10:12 +00:00
Misha Brukman
fd6b30ec89 Added the initial version of the TableGen description for the Sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6021 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-07 21:52:39 +00:00
Chris Lattner
5ff7ef5396 Eliminate use of NonCopyable so that doxygen documentation doesn't link
the Annotation classes with the noncopyable classes for no reason


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5973 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-01 20:28:45 +00:00
Chris Lattner
10daaa1416 Remove two fields from TargetData which are target specific.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5963 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-26 20:11:09 +00:00
Chris Lattner
7a5adc3ac0 IntegerRegSize is always 8 for sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5961 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-26 19:44:35 +00:00
Chris Lattner
4deaf3b5c0 Fix obvious type-o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5932 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 05:23:10 +00:00
Chris Lattner
ec8aae3e11 Trivial cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5899 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-24 18:35:51 +00:00
Chris Lattner
2ee82e05e3 Remove unneccesary &*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5871 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:36:11 +00:00
Chris Lattner
155e68feea Add support for the Switch instruction by running the lowerSwitch pass first
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5867 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:24:55 +00:00
Misha Brukman
63e04f3ccb Just some code beautification changes I had sitting around in my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5859 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 23:00:08 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Misha Brukman
2c821cc06e Fixed compilation errors, command-line argument declarations, cleaned up code to
look nicer and removed useless stuff.

Also renamed a few variables, moved them into namespaces, converted outputting
to a file into a print to std::cerr with a DEBUG() guard, as all passes should
do anyway.

No functional changes have been made. However, this code now compiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5769 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-10 19:19:23 +00:00
Misha Brukman
8baa01c1d7 Made the code readable:
* Lines must be wrapped at 80 chars. This is a hard limit.
* Consistent style on functions, braces, if, for, etc. Code must be readable.

No functional changes have been made, even though I added a new typedef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5768 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-09 21:51:34 +00:00
Guochun Shi
6fbe5fbce1 change the include file names and some class names to make it compile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5764 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-06 23:56:19 +00:00
Guochun Shi
f1c154f5e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5755 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-27 17:57:44 +00:00
Chris Lattner
795ba6cabd Move sparc specific code into the Sparc backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5317 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:36:50 +00:00
Chris Lattner
ac4dfd0643 Fix warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5316 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:36:30 +00:00
Chris Lattner
3c3c82d05d Adjust to simpler interfaces
Eliminate dependency on RegClass.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5315 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:14:32 +00:00
Chris Lattner
9d4ed15c9e Adjust to new interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5314 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:14:01 +00:00
Chris Lattner
af3cdcf9b0 Move headers around
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:02:16 +00:00
Chris Lattner
4cfd622252 Header is moved into local directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5311 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 21:00:02 +00:00