aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/InstSelectSimple.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename MachineInstrInfo -> TargetInstrInfoChris Lattner2003-01-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5272 91177308-0d34-0410-b5e6-96231b3b80d8
* * Adjust to use new interfaces, eliminating CurReg stuffChris Lattner2003-01-131-410/+802
| | | | | | | | | | | | | | | | | | | * Support arbitrary FP constants * Fix bugs in frame layout for function calls and incoming arguments * Insert copies for constant arguments to PHI nodes into the BOTTOM of predecessor blocks, not the top. * Implement _floating point_ support: setcc, return, load, store, cast * Fix several bugs in the cast instruction * Abstract out call emission and load/store for FP * Implement malloc/free without previous lowering pass. * Make use of new forms of MachineOperand * Implement _long_ support! * Fix many bugs in FP support * Change branch from je/jne to je/jmp * Simplify code generated for GEP instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5223 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename FunctionFrameInfo to MachineFrameInfoChris Lattner2002-12-281-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5201 91177308-0d34-0410-b5e6-96231b3b80d8
* * Use the new Abstract Frame Manager to handle incoming arguments andChris Lattner2002-12-281-100/+186
| | | | | | | | fixed size allocas * Revamp call emission to work with new frame manager git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5178 91177308-0d34-0410-b5e6-96231b3b80d8
* * Simplify Value classesChris Lattner2002-12-251-183/+243
| | | | | | | | * Add initial support for FP constants * Add initial FP support for several instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5154 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to compile with GCC 2.96Chris Lattner2002-12-241-6/+49
| | | | | | | Changes to support configurable pointer size and endianness git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5130 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't force setCC instructions into ALChris Lattner2002-12-181-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5104 91177308-0d34-0410-b5e6-96231b3b80d8
* Build add instructions of the correct form!Chris Lattner2002-12-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5090 91177308-0d34-0410-b5e6-96231b3b80d8
* Two fixes:Chris Lattner2002-12-161-21/+23
| | | | | | | | | * Only load incoming arguments into virtual registers once at the beginning of the function * Assign different virtual registers to each reference to constants/globals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5088 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure stack manipulation refers to ESP the right number of timesChris Lattner2002-12-161-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5086 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some special cases to make common getelementptr cases easier to read/fasterChris Lattner2002-12-161-41/+73
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5084 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-12-161-11/+12
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5069 91177308-0d34-0410-b5e6-96231b3b80d8
* Give passes nice names!Chris Lattner2002-12-151-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5059 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to cast from a bool typeChris Lattner2002-12-151-6/+12
| | | | | | | | Add support for boolean constants add getClassB method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5034 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement indirect function callsChris Lattner2002-12-131-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5024 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bork in doMultiplyChris Lattner2002-12-131-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5021 91177308-0d34-0410-b5e6-96231b3b80d8
* Add sanity checksChris Lattner2002-12-131-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5020 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert phi code at top of blockChris Lattner2002-12-131-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5015 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Target/X86/InstSelectSimple.cpp:Brian Gaeke2002-12-131-1/+1
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5014 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cast bool to XChris Lattner2002-12-131-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5012 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename all BMI MachineBasicBlock operands to MBB.Brian Gaeke2002-12-131-21/+22
| | | | | | | | Try to mess around with emitGEPOperation's elementSizeReg to make it work, again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5011 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish up iterator stuphChris Lattner2002-12-131-32/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5009 91177308-0d34-0410-b5e6-96231b3b80d8
* Code gen phi's correctlyChris Lattner2002-12-131-39/+109
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5004 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Target/X86/InstSelectSimple.cpp: Start counting arguments with 2,Brian Gaeke2002-12-131-8/+9
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4999 91177308-0d34-0410-b5e6-96231b3b80d8
* InstSelectSimple.cpp: Give promote32 a comment. Add initialBrian Gaeke2002-12-131-4/+23
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4998 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement getelementptr constant exprsChris Lattner2002-12-131-31/+42
| | | | | | | | Implement ConstantPointerRefs Treat long/ulongs as if they were integers. A hack, but an effective one git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4995 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-12-131-1/+27
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4994 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extranous #includeChris Lattner2002-12-131-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4980 91177308-0d34-0410-b5e6-96231b3b80d8
* This checkin is brought to you by the brian gaeke allnighter fund.Brian Gaeke2002-12-121-28/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4973 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a lot of cast functionality (no FP or 64)Brian Gaeke2002-12-061-34/+62
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4944 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of function calls that return voidChris Lattner2002-12-041-9/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4925 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement initial support for return values from call instructionsChris Lattner2002-12-041-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4924 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the stack pointer after a function call, proportional to the number ofMisha Brukman2002-12-041-0/+9
| | | | | | | arguments pushed onto the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4922 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove think-o assertionChris Lattner2002-12-041-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4917 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid crashing on Arguments, just silently miscompileChris Lattner2002-12-041-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4916 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug I introduced in a previous changeChris Lattner2002-12-041-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4909 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for referencing global variables/functionsChris Lattner2002-12-041-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4907 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix instsel for callsChris Lattner2002-12-031-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4891 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the buildChris Lattner2002-12-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4884 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-12-031-3/+14
| | | | | | | Add support for cast ... to bool in visitCastInst (it's a start, anyways...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4883 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-12-031-1/+3
| | | | | | | | X86Implicit.cpp, X86Implicit.h: New files. InstSelectSimple.cpp: Add some clarifications in visitCallInst comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4874 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't add implicit regsChris Lattner2002-12-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4840 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-11-301-49/+74
| | | | | | | | | InstSelectSimple.cpp: Refactor out conversion of byte, short -> int from visitReturnInst() to new method, promote32(). Use it in both visitReturnInst() and visitCallInst(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4839 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-11-291-4/+24
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4838 91177308-0d34-0410-b5e6-96231b3b80d8
* brgBrian Gaeke2002-11-261-3/+33
| | | | | | | | InstSelectSimple.cpp: Add some comments that say what I'm going to do for calls and casts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4832 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Target/X86/InstSelectSimple.cpp: Add visitCallInst, visitCastInst.Brian Gaeke2002-11-221-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4821 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't add implicit operandsChris Lattner2002-11-211-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4817 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove implicit information from instruction selectorChris Lattner2002-11-211-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4811 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that prevented compilation of multiple functionsChris Lattner2002-11-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4809 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the SetCC X86 instructions to reflect the fact that they are theChris Lattner2002-11-211-2/+2
| | | | | | | register versions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4800 91177308-0d34-0410-b5e6-96231b3b80d8