1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

1817 Commits

Author SHA1 Message Date
Chris Lattner
210ffe4b77 Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiled
this LLVM function:

int %foo() {
        ret int cast (int** getelementptr (int** null, int 1) to int)
}

into:

foo:
        mov %EAX, 0
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

now we compile it into:

foo:
        mov %EAX, 4
        ret

This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and
Java front-ends as well..

-Chris

llvm-svn: 14834
2004-07-15 00:58:53 +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
Brian Gaeke
4dc7caee0e Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
llvm-svn: 14806
2004-07-14 05:40:50 +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
da8ed5f4d5 Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
llvm-svn: 14781
2004-07-12 23:37:18 +00:00
Misha Brukman
b7f3d7b04b Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Chris Lattner
e0ccf04c10 Implement TargetRegistrationListener
llvm-svn: 14759
2004-07-11 06:03:21 +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
9e183d06a6 Delete the allocate*TargetMachine function, which is now dead .
llvm-svn: 14755
2004-07-11 04:16:31 +00:00
Chris Lattner
646bc16b63 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)

llvm-svn: 14749
2004-07-11 04:00:19 +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
Chris Lattner
3c3babb91d Initial impl of this file. Yes this is pretty useless right now, but it
will grow in time.

llvm-svn: 14743
2004-07-11 02:44:26 +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
Brian Gaeke
0601002727 Support setcc on fp values.
llvm-svn: 14687
2004-07-08 09:08:35 +00:00
Brian Gaeke
23d171a9ed Add floating-point branches and compares. Compares don't complete
until the next cycle, and there's no interlock, so they effectively
have a delay slot.

llvm-svn: 14686
2004-07-08 09:08:22 +00:00
Brian Gaeke
99a4b4ecc6 Fix bug where SwitchSection would fail to change to ".bss" successfully.
llvm-svn: 14685
2004-07-08 08:08:23 +00:00
Brian Gaeke
79c41545a7 Fix bug involving bool arguments to binary operators.
Fix typo in comment.

llvm-svn: 14684
2004-07-08 08:08:10 +00:00
Brian Gaeke
2de292734d Fix bug in copying long constants to register pairs. We were getting
the top and bottom halves backwards...how embarrassing.
Support 'cast long to long' and other similar no-op casts to long.
Support 'ret long'.

llvm-svn: 14683
2004-07-08 07:52:13 +00:00
Brian Gaeke
04176a23a7 Support 'ret float'
llvm-svn: 14681
2004-07-08 07:22:27 +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
Chris Lattner
8d61e9ad98 Add #includes
llvm-svn: 14625
2004-07-04 17:19:21 +00:00
Reid Spencer
50ec3f9325 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +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
Brian Gaeke
318c4cf9c2 Fix use-before-def thinko
llvm-svn: 14570
2004-07-02 07:01:31 +00:00
Chris Lattner
c83e510819 Fix potential problems with unreachable basic blocks.
Also, while noone's looking, add support for constant expressions.  Wait,
I said not to look!

llvm-svn: 14566
2004-07-02 05:49:11 +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
Chris Lattner
6da0499f4b Remove dead blocks
llvm-svn: 14564
2004-07-02 05:46:41 +00:00
Brian Gaeke
b92c136437 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.

llvm-svn: 14559
2004-07-02 04:57:37 +00:00
Brian Gaeke
62ceddefe8 RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!

llvm-svn: 14558
2004-07-02 04:57:35 +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