1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

98 Commits

Author SHA1 Message Date
Misha Brukman
4b944fcdf9 The generated instruction selector isn't (yet) functional
llvm-svn: 14894
2004-07-16 20:31:13 +00:00
Misha Brukman
c3c9dc04ac * Output non-lazy linking stubs for external global variables
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time

llvm-svn: 14893
2004-07-16 20:29:04 +00:00
Misha Brukman
0d35548f37 Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
has been eliminated

llvm-svn: 14891
2004-07-16 19:32:12 +00:00
Misha Brukman
0a92212542 * Add spaces between words and numbers in comments printed out for longs/floats
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman

llvm-svn: 14890
2004-07-16 19:01:13 +00:00
Brian Gaeke
53dc31efcd Do IMPLICIT_DEFs on incoming args' hard regs, to avoid confusing the regalloc.
Support single-fp incoming args.
Support single-fp outgoing args ('call' operands).
Support double-fp return values.

llvm-svn: 14880
2004-07-16 10:31:25 +00:00
Chris Lattner
60fb3d60a8 The powerpc is now gone. However it is now just known as the Skeleton target.
llvm-svn: 14877
2004-07-16 07:14:34 +00:00
Chris Lattner
b9ec0b791c Revert stuff that I didn't mean to checkin
llvm-svn: 14844
2004-07-15 02:33:38 +00:00
Chris Lattner
c4888ccda7 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Misha Brukman
d6a9646f29 Make sure MTSPR instruction is inserted into the BasicBlock
llvm-svn: 14822
2004-07-14 18:26:31 +00:00
Misha Brukman
0f42826f30 Don't define the same register twice when loading a ConstantPointerRef to a reg
llvm-svn: 14819
2004-07-14 17:57:04 +00:00
Misha Brukman
73d729838f * Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)

llvm-svn: 14818
2004-07-14 15:29:51 +00:00
Misha Brukman
79b089abff * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored

llvm-svn: 14799
2004-07-13 15:35:45 +00:00
Misha Brukman
449715a57d Correctly load FP constants out of the constant pool.
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman
b7f3d7b04b Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Chris Lattner
773f2d65c2 Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.

llvm-svn: 14757
2004-07-11 04:17:58 +00:00
Chris Lattner
6331eb6bbe Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

llvm-svn: 14756
2004-07-11 04:17:10 +00:00
Chris Lattner
b67e3b01bc Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
2ada866a78 Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Chris Lattner
164659f141 Add compilability
llvm-svn: 14744
2004-07-11 02:48:28 +00:00
Misha Brukman
f8f753f04b * Add support for indexing into structures, thanks to Chris (x86)
The large diff is because of indentation of a whole region
* Fix querying predecessor blocks in SelectPHINodes(), thanks to Brian (v8)
* Add support for external functions malloc() and free()
* Fix some code indentation

Remember, kids: It's not plagiarism if you "creatively borrow" from your
sources.  It's called "research"!

llvm-svn: 14723
2004-07-09 15:45:07 +00:00
Misha Brukman
1881beb0b3 Read/write the offset value for stack-relative loads via correct instr operand.
llvm-svn: 14722
2004-07-09 15:37:16 +00:00
Misha Brukman
b83ace891d Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functions
llvm-svn: 14703
2004-07-08 19:41:16 +00:00
Misha Brukman
db4cddea8d * Use several Function* for external functions instead of a std::map
* Non-const FP values must be loaded into int regs (for vararg fns) via memory

llvm-svn: 14701
2004-07-08 18:27:59 +00:00
Misha Brukman
869f2b7219 * Add support for loading FP constants from the constant pool
* Load FP values into int regs as well for vararg functions; without memory ops!

llvm-svn: 14700
2004-07-08 18:02:38 +00:00
Misha Brukman
3bbd3cd1de * Fix header comment, excise references to X86
* Add suport for printing out references to constant pool indices

llvm-svn: 14699
2004-07-08 17:58:04 +00:00
Misha Brukman
93b47cc963 * Use a map for caching lookups to external functions (fp div/rem)
* Tabs to spaces

llvm-svn: 14673
2004-07-07 20:07:22 +00:00
Misha Brukman
f2473e6267 * Wrap long lines (comments and code)
* Tabs to spaces

llvm-svn: 14672
2004-07-07 20:01:36 +00:00
Misha Brukman
d5a439760c Add fmod() to the Module being compiled so that it gets a stub in the asm file
llvm-svn: 14670
2004-07-07 15:36:18 +00:00
Misha Brukman
ef78244e72 * Add support for calling vararg functions (must pass doubles in int regs too)
* Make visitSetCondInst() share condition-generating code with EmitComparison()
* There are 13 FPRs for function-passing arguments, not 8
* Do not rely on registers being sequential, use an array lookup
* In unimplemented switch cases, send an error and abort instead of silent
  fall-through
* Add doInitialization() for adding function prototypes for external math fns
* Minor changes: fix indentation, spacing, code clarity

llvm-svn: 14653
2004-07-06 22:51:53 +00:00
Misha Brukman
4543cea6ae Use the more compact bl' instead of cryptic (but equivalent) bcl 20,31'
llvm-svn: 14652
2004-07-06 22:40:34 +00:00
Misha Brukman
0b6de12a84 * Add utility functions: convert SetCC => PPC opcode and invert PPC opcode
* If SetCondInst is folded into BranchInst (and it is the only user), do not
  emit code for SetCondInst
* Fix assembly opcodes in comments in visitSetCondInst()
* Fix codegen of conditional branches

llvm-svn: 14643
2004-07-06 15:32:44 +00:00
Misha Brukman
607dd868a8 Add FIXME notes for spilling int/fp regs (need to calculate stack space).
llvm-svn: 14581
2004-07-02 17:54:38 +00:00
Chris Lattner
a99a36881f Fix all of those problems that the PPC backend has running 176.gcc :)
llvm-svn: 14565
2004-07-02 05:48:42 +00:00
Misha Brukman
c9ecaeb69d * Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated)

llvm-svn: 14554
2004-07-01 21:35:00 +00:00
Misha Brukman
f5deab6100 * Get rid of constant-expr handling code: we use the ConstantExpr lowering pass
* Use the SetCC handling code in the format of Brian's V8
* Add FIXMEs where calls to functions are being made without adding them to the
  Module first... they cause missing symbols at assembly-time.

llvm-svn: 14553
2004-07-01 21:34:10 +00:00
Misha Brukman
1546c2e9c0 Wrap long line
llvm-svn: 14552
2004-07-01 21:27:59 +00:00
Misha Brukman
e409874a9f * Do not allocate r0 as we use it indiscriminantly in the instr selector.
* Do not define CR register class because we don't (yet) have the i4 type

llvm-svn: 14551
2004-07-01 21:24:50 +00:00
Misha Brukman
b296163bb1 Check if operand has an allocated reg before requesting it.
llvm-svn: 14550
2004-07-01 21:09:12 +00:00
Misha Brukman
efcb6b8c2c * Coalesce the handy CALL* alias opcodes with the standard ones
* Congregate more branch-and-link opcodes together
* Mark FP, CPR, and special registers as volatile across calls

llvm-svn: 14511
2004-06-30 22:00:45 +00:00
Misha Brukman
7089b3d426 * Allow more registers to be allocated from the general register pool
* Define the condition register class

llvm-svn: 14510
2004-06-30 21:54:50 +00:00
Misha Brukman
08a07e969f * Inquire about the number of operands from the instruction directly
* Only check for a register if we are sure the instruction has one allocated

llvm-svn: 14509
2004-06-30 21:54:12 +00:00
Misha Brukman
49e6aa1ba7 Always assume a function may have calls because the printer may add `bl' to get
the PC in a code sequence for global variables.

llvm-svn: 14506
2004-06-30 00:09:12 +00:00
Misha Brukman
3422760e16 * Don't save LR when outputting globals: it's already saved on the stack once
for the function
* Registers aren't necessarily sequential wrt their enums, don't rely on it
  when emitting function arguments into sequential registers
* Remove X86-specific comments about AL/BL/AH/BH/EDX/etc
* Add an abort() for an unimplemented signed right shift
* The src operand for a GEP was never emitted!  Fixed.
* We can skip zero-valued GEP indices as they are no-ops.

"Hello, World!" now works.

llvm-svn: 14505
2004-06-29 23:45:05 +00:00
Misha Brukman
e9166fd352 * Stop using BBNumbering, we don't really need it
* Only increment labelNumber once, because it's used by both Load{hi,lo}Addr
* There is no .bss section on PowerPC
* Use .align 2 instead of other random numbers

llvm-svn: 14504
2004-06-29 23:40:57 +00:00
Misha Brukman
79a92e35b4 Set up the prologue and epilogue to be more like the manual and GCC output.
llvm-svn: 14502
2004-06-29 23:38:26 +00:00
Misha Brukman
2242e8d27f * Use LA instead of LWZ for LoadLoAddr
* Specify the isCall bit and caller-save registers for some call instrs

llvm-svn: 14501
2004-06-29 23:37:36 +00:00
Misha Brukman
a0721ac147 Only allocate non-volatile registers R13-31 (for now).
llvm-svn: 14500
2004-06-29 23:35:32 +00:00
Misha Brukman
ddf07d1c08 Lower ConstantExpressions before the code generator.
llvm-svn: 14497
2004-06-29 23:33:20 +00:00
Misha Brukman
01841234e8 * Fix saving LR in function prologue
* Adjust epilogue restore sequence to match the PowerPC documentation

llvm-svn: 14480
2004-06-29 17:14:42 +00:00
Misha Brukman
08f6a46ce2 Assembly syntax/comment fixes by Nate Begeman.
llvm-svn: 14479
2004-06-29 17:13:26 +00:00