1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 22:12:57 +02:00
Commit Graph

164 Commits

Author SHA1 Message Date
Chris Lattner
e6ad4941fc Add information about register file aliasing
llvm-svn: 5073
2002-12-16 15:54:59 +00:00
Chris Lattner
68af8985f4 Add call clobber info
llvm-svn: 5072
2002-12-16 15:54:42 +00:00
Chris Lattner
566fb4c7b7 Rename createSimpleX86RegisterAllocator to createSimpleRegisterAllocator
llvm-svn: 5071
2002-12-16 14:38:13 +00:00
Brian Gaeke
e4da1d5de6 brg
Fix some bugs in use of MBB vs. BB and iterators that are invalidated before
we use them.

Reference targetClass by enum name, not by number.

llvm-svn: 5069
2002-12-16 04:23:29 +00:00
Chris Lattner
4964e751cd Correct the setting of Def flags on registers that are modified!
llvm-svn: 5065
2002-12-15 22:38:47 +00:00
Chris Lattner
ea2d8ad746 Give passes nice names!
llvm-svn: 5059
2002-12-15 21:13:40 +00:00
Chris Lattner
4214ac384a Simplify interfaces used by regalloc to insert code
llvm-svn: 5052
2002-12-15 20:06:35 +00:00
Chris Lattner
ce23fdeee2 Changes to make new TargetRegisterClass interface.
llvm-svn: 5050
2002-12-15 19:29:34 +00:00
Chris Lattner
caa325a559 * Simplify TargetRegisterClass implementations
* Change regclass iterators to use an extra level of pointers

llvm-svn: 5047
2002-12-15 18:40:36 +00:00
Chris Lattner
50d99540cf Add support to cast from a bool type
Add support for boolean constants
add getClassB method

llvm-svn: 5034
2002-12-15 08:02:15 +00:00
Chris Lattner
534876a78c Use MachineOperand::isFoo methods instead of our own global functions
llvm-svn: 5033
2002-12-15 08:01:39 +00:00
Chris Lattner
bd4d66147f Implement indirect function calls
llvm-svn: 5024
2002-12-13 14:13:27 +00:00
Misha Brukman
3587ffc7b1 Make function code generation printing debug-only.
llvm-svn: 5023
2002-12-13 13:16:14 +00:00
Chris Lattner
c7db3e855f Fix bork in doMultiply
llvm-svn: 5021
2002-12-13 13:07:42 +00:00
Chris Lattner
7d5d4f7ab4 Add sanity checks
llvm-svn: 5020
2002-12-13 13:04:04 +00:00
Misha Brukman
2f2cf00a9f Cleaned up the code: factored out switch/case into a separate function, put
constants in an array for quick lookup. Stole the idea from elsewhere in
Jello.

llvm-svn: 5017
2002-12-13 12:00:06 +00:00
Chris Lattner
de2f97c5e6 Insert phi code at top of block
llvm-svn: 5015
2002-12-13 11:52:34 +00:00
Brian Gaeke
460fe53768 lib/Target/X86/InstSelectSimple.cpp:
The MachineBasicBlock variable name patrol hereby fines Chris Lattner
one bag of nachos, for shadowing global names while his license to do so
was under suspension.

llvm-svn: 5014
2002-12-13 11:39:18 +00:00
Chris Lattner
2c2a5f128e Implement cast bool to X
llvm-svn: 5012
2002-12-13 11:31:59 +00:00
Brian Gaeke
b101130d19 Rename all BMI MachineBasicBlock operands to MBB.
Try to mess around with emitGEPOperation's elementSizeReg to make it work,
again.

llvm-svn: 5011
2002-12-13 11:22:48 +00:00
Chris Lattner
cad7e99ea1 Finish up iterator stuph
llvm-svn: 5009
2002-12-13 10:50:40 +00:00
Misha Brukman
b6fb990276 Treat longs as ints => pretend they're all 32-bit values and squeeze them into
32-bit registers.

llvm-svn: 5008
2002-12-13 10:43:09 +00:00
Chris Lattner
416a9ca8f1 Code gen phi's correctly
llvm-svn: 5004
2002-12-13 10:09:43 +00:00
Chris Lattner
505ace489e Print X86 PHI nodes in a sane manner
llvm-svn: 5003
2002-12-13 09:59:26 +00:00
Misha Brukman
fb02408496 Added moveReg2Reg() and moveImm2Reg() to accomodate moving data around due to
PHI nodes.

llvm-svn: 5001
2002-12-13 09:54:12 +00:00
Brian Gaeke
34ad176df5 lib/Target/X86/InstSelectSimple.cpp: Start counting arguments with 2,
because arguments start two stack slots off of EBP. Break out of the
 for loop once the argument is found. Increment the counter at the end
 of the loop instead of the beginning. Use addRegOffset and compute
 the scale * index part at compile time instead of using the fancy
 load instruction. Just because an instruction set has wacky addressing
 modes doesn't mean we ought to use them (at least, if you believe Dave
 Patterson).

lib/Target/X86/X86InstrBuilder.h: Add some comments.

test/Regression/Jello/test-loadstore.ll:  Let main return int 0.

llvm-svn: 4999
2002-12-13 09:28:50 +00:00
Brian Gaeke
5da234a1d7 InstSelectSimple.cpp: Give promote32 a comment. Add initial
implementation of getReg() for arguments.

MachineCodeEmitter.cpp: Fix using EBP with index, scale and no
 displacement (whew!) due to Chris.

Printer.cpp: Fix printing out index and scale in memory references.

llvm-svn: 4998
2002-12-13 07:56:18 +00:00
Chris Lattner
9e7b73b55f Implement getelementptr constant exprs
Implement ConstantPointerRefs
Treat long/ulongs as if they were integers.  A hack, but an effective one

llvm-svn: 4995
2002-12-13 06:56:29 +00:00
Brian Gaeke
641c6fa60a brg
InstSelectSimple.cpp: Add stub implementation of visitFreeInst.
 Add comments that mention how we are failing to implement malloc/free.
 Add initial implementation of visitAllocaInst.

X86TargetMachine.cpp: Include llvm/Transforms/Scalar.h.
 Add LowerAllocations pass before instruction selection.

jello/Makefile: Add scalaropts.a.

llvm-svn: 4994
2002-12-13 06:46:31 +00:00
Chris Lattner
62454d83f0 Emit the right form of mod/rm mod field
llvm-svn: 4986
2002-12-13 05:05:05 +00:00
Chris Lattner
7ec625a157 Nicify a bit
llvm-svn: 4985
2002-12-13 05:04:37 +00:00
Chris Lattner
4cc9894c71 Fix encoding of CBW instruction
llvm-svn: 4983
2002-12-13 04:41:31 +00:00
Misha Brukman
20c9c61c6d Moves now select correct opcode based on the data size.
llvm-svn: 4981
2002-12-13 04:24:53 +00:00
Chris Lattner
10f305cec7 Remove extranous #include
llvm-svn: 4980
2002-12-13 04:12:24 +00:00
Chris Lattner
723ca2522d Rename MemArg* to Arg*
llvm-svn: 4979
2002-12-13 03:51:55 +00:00
Chris Lattner
b698cd8236 Make mem size an assert
Add mem size flags to all instructions using an imm

llvm-svn: 4978
2002-12-13 03:50:13 +00:00
Misha Brukman
6a5788bb6f This is supposed to provide correct size for datatypes. Supposedly.
llvm-svn: 4977
2002-12-13 02:13:15 +00:00
Misha Brukman
bf2857eb5c Added the flag to mark instructions which are really 2-address instructions in
X86, but would be 3-address in any normail architecture.

llvm-svn: 4974
2002-12-12 23:19:11 +00:00
Brian Gaeke
9b38597288 This checkin is brought to you by the brian gaeke allnighter fund.
(lib/Target/X86) InstSelectSimple.cpp:
 Include llvm/DerivedTypes.h and iostream.
 Refactor visitMul out into a wrapper around doMultiply(), so that we
  can do multiplications on temporary values when we are doing
  getelementptrs.
 Refactor part of getReg out into makeAnotherReg, so that we can create
  registers willy-nilly to hold temporary values, when we are doing
  getelementptrs.
 Add stub implementations of visitMallocInst and visitAllocaInst.
 Add initial implementation of visitGetElementPtrInst.
 In copyConstantToRegister:
  We throw a *lot* of our asserts here. So, when we want to throw an
   assert, print out to stderr whatever expr or whatever constant made
   us barf.
  Support copying ConstantPointerNull to register, using a move immediate
   of zero.
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.
 Teach visitCallInst to extract byte- and short-class return values
  from subregs of EAX.  Add a FIXME note about how we would do it for
  float-class return values.
 Add a FIXME note about how we would cast float to int and back.

X86InstrInfo.def:
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.

(tools/jello) GlobalVars.cpp:
 Include iostream.
 If we have to emit a floating-point constant to memory, gamble and use
  the same method as for ints.
 If we have to emit a ConstantPointerNull to memory, try using a "void *"
  and "NULL".
 Otherwise, if we are going to throw an assert, print out whatever constant
  made us barf, first.

llvm-svn: 4973
2002-12-12 15:33:40 +00:00
Brian Gaeke
250d5a3e95 Implement a lot of cast functionality (no FP or 64)
llvm-svn: 4944
2002-12-06 10:49:33 +00:00
Brian Gaeke
dbc34a2a95 Target/X86/Printer.cpp: Add sizePtr function, and use it instead of
" <SIZE> PTR " string when emitting assembly.

Target/X86/X86InstrInfo.def: Tidy up a bit:
 Squashed everything down to 118 chars wide, wrapping lines so that
 comment is at the same point on each line. Rename "NoImpRegs" as
 "NoIR". (most instructions have NoImpRegs twice on a line, so this
 saves 10 columns).

 Also, annotate various instructions with flags for size of memory operand.
  (MemArg16, MemArg32, MemArg64, etc.)

Target/X86/X86InstrInfo.h: Define flags for size of memory operand.
 (MemArg16, MemArg32, MemArg64, etc.)

llvm-svn: 4932
2002-12-05 08:30:40 +00:00
Misha Brukman
7dc6877ce2 Implemented functions for emitting prologues and epilogues;
removed EBP from the list of callee-saved registers (it isn't one).

llvm-svn: 4929
2002-12-04 23:57:03 +00:00
Misha Brukman
e93c7f9d32 Added push and pop instructions.
llvm-svn: 4928
2002-12-04 23:56:26 +00:00
Chris Lattner
70aa4e41ce Fix handling of function calls that return void
llvm-svn: 4925
2002-12-04 23:50:28 +00:00
Chris Lattner
b71d7b4dab Implement initial support for return values from call instructions
llvm-svn: 4924
2002-12-04 23:45:28 +00:00
Misha Brukman
f8634130dc Adjust the stack pointer after a function call, proportional to the number of
arguments pushed onto the stack.

llvm-svn: 4922
2002-12-04 19:22:53 +00:00
Misha Brukman
cf80ad35f3 Added instructions to add/subtract imm32 to/from a reg32.
llvm-svn: 4921
2002-12-04 19:15:22 +00:00
Chris Lattner
96edaabdb2 Fix bogus assertion failures
llvm-svn: 4919
2002-12-04 17:32:52 +00:00
Chris Lattner
b538ae0dba Avoid bad assertion
llvm-svn: 4918
2002-12-04 17:28:40 +00:00
Chris Lattner
feeb16616e Remove think-o assertion
llvm-svn: 4917
2002-12-04 17:18:30 +00:00