1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

80 Commits

Author SHA1 Message Date
Chris Lattner
ea33ca1e96 Rename FunctionFrameInfo to MachineFrameInfo
llvm-svn: 5201
2002-12-28 21:08:28 +00:00
Chris Lattner
f3b903dcc8 * Use the new Abstract Frame Manager to handle incoming arguments and
fixed size allocas
* Revamp call emission to work with new frame manager

llvm-svn: 5178
2002-12-28 20:24:02 +00:00
Chris Lattner
53e9d39bc2 * Simplify Value classes
* Add initial support for FP constants
* Add initial FP support for several instructions

llvm-svn: 5154
2002-12-25 05:13:53 +00:00
Chris Lattner
16378bf522 Changes to compile with GCC 2.96
Changes to support configurable pointer size and endianness

llvm-svn: 5130
2002-12-24 00:03:11 +00:00
Chris Lattner
c21fd773b8 Don't force setCC instructions into AL
llvm-svn: 5104
2002-12-18 01:44:31 +00:00
Chris Lattner
c7e6dd2341 Build add instructions of the correct form!
llvm-svn: 5090
2002-12-16 23:36:57 +00:00
Chris Lattner
f5da16f2f6 Two fixes:
* Only load incoming arguments into virtual registers once at the
    beginning of the function
  * Assign different virtual registers to each reference to constants/globals

llvm-svn: 5088
2002-12-16 22:54:46 +00:00
Chris Lattner
2e17697e81 Make sure stack manipulation refers to ESP the right number of times
llvm-svn: 5086
2002-12-16 22:29:06 +00:00
Chris Lattner
de4d89ef9f Add some special cases to make common getelementptr cases easier to read/faster
llvm-svn: 5084
2002-12-16 19:32:50 +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
ea2d8ad746 Give passes nice names!
llvm-svn: 5059
2002-12-15 21:13:40 +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
bd4d66147f Implement indirect function calls
llvm-svn: 5024
2002-12-13 14:13:27 +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
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
Chris Lattner
416a9ca8f1 Code gen phi's correctly
llvm-svn: 5004
2002-12-13 10:09:43 +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
10f305cec7 Remove extranous #include
llvm-svn: 4980
2002-12-13 04:12:24 +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
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
Chris Lattner
feeb16616e Remove think-o assertion
llvm-svn: 4917
2002-12-04 17:18:30 +00:00
Chris Lattner
e21cfc9b6c Avoid crashing on Arguments, just silently miscompile
llvm-svn: 4916
2002-12-04 17:15:34 +00:00
Chris Lattner
6c1a85e870 Fix a bug I introduced in a previous change
llvm-svn: 4909
2002-12-04 06:56:56 +00:00
Chris Lattner
73ac28801e Add support for referencing global variables/functions
llvm-svn: 4907
2002-12-04 06:45:19 +00:00
Chris Lattner
a31be4e958 Fix instsel for calls
llvm-svn: 4891
2002-12-03 20:30:12 +00:00
Chris Lattner
5629544811 Fix the build
llvm-svn: 4884
2002-12-03 18:15:59 +00:00
Brian Gaeke
c850694f49 brg
Add support for cast ... to bool in visitCastInst (it's a start, anyways...)

llvm-svn: 4883
2002-12-03 07:36:03 +00:00
Brian Gaeke
48759a6af9 brg
X86Implicit.cpp, X86Implicit.h: New files.
InstSelectSimple.cpp: Add some clarifications in visitCallInst comments.

llvm-svn: 4874
2002-12-03 00:51:09 +00:00
Chris Lattner
d7ae75d381 Don't add implicit regs
llvm-svn: 4840
2002-12-01 23:24:58 +00:00
Brian Gaeke
1700fefdeb brg
InstSelectSimple.cpp: Refactor out conversion of byte, short -> int
  from visitReturnInst() to new method, promote32().
 Use it in both visitReturnInst() and visitCallInst().

llvm-svn: 4839
2002-11-30 11:57:28 +00:00
Brian Gaeke
b6fc905124 brg
InstSelectSimple.cpp: First draft of visitCallInst method, handling
 int/float args.
X86InstrInfo.def: Add entries for CALL with 32-bit pc relative arg, and
 PUSH with 32-bit reg arg.

llvm-svn: 4838
2002-11-29 12:01:58 +00:00
Brian Gaeke
d944e15946 brg
InstSelectSimple.cpp: Add some comments that say what I'm going to do for
 calls and casts.

llvm-svn: 4832
2002-11-26 10:43:30 +00:00
Brian Gaeke
2d771c7b5f lib/Target/X86/InstSelectSimple.cpp: Add visitCallInst, visitCastInst.
llvm-svn: 4821
2002-11-22 11:07:01 +00:00
Chris Lattner
a147d38780 Don't add implicit operands
llvm-svn: 4817
2002-11-21 22:49:20 +00:00
Chris Lattner
2112a6d7b8 Remove implicit information from instruction selector
llvm-svn: 4811
2002-11-21 18:54:29 +00:00
Chris Lattner
d2207d5464 Fix a bug that prevented compilation of multiple functions
llvm-svn: 4809
2002-11-21 17:26:58 +00:00
Chris Lattner
b1b5855551 Rename the SetCC X86 instructions to reflect the fact that they are the
register versions

llvm-svn: 4800
2002-11-21 16:19:42 +00:00
Chris Lattner
d6236d8100 Simplify setcc code a bit
llvm-svn: 4799
2002-11-21 15:52:38 +00:00
Chris Lattner
32bfb6a115 Dont' set flags
llvm-svn: 4797
2002-11-21 01:59:50 +00:00