Commit Graph

528 Commits

Author SHA1 Message Date
Nate Begeman
fc1b1dad88 Add ISD::UNDEF node
Teach the SelectionDAG code how to expand and promote it
Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp
  arguments, but not shadowing their value.  This allows us to do the right
  thing with both fixed and vararg floating point arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 22:34:39 +00:00
Nate Begeman
6cb2e1b124 Fix Olden/bh, CR0 was being set in the wrong order
LowerCallTo and ISD::CALL are going to need to be modified, regs are being
set in the wrong order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20981 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 08:57:43 +00:00
Nate Begeman
31318e4b6c Also apply Chris's fix to FP select and SETCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 07:21:30 +00:00
Chris Lattner
3071019026 Move the selection of the arms of the select operation up to the conditional
part to make sure we get the side effects and to avoid confusing the CFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20977 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 07:10:02 +00:00
Nate Begeman
a7e11a4bb5 Fix stores to global addresses
Fix calls with no arguments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 05:57:17 +00:00
Nate Begeman
04730361b5 Support indexed loads and stores. This drops Shootout/matrix time from
18.8 to 14.8 seconds.  The Pattern ISel is now often faster than the
Simple ISel, esp. on memory intensive code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20973 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 04:45:11 +00:00
Nate Begeman
6b55997df5 Implement FP_TO_SINT and FP_TO_UINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20972 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 02:59:27 +00:00
Nate Begeman
6d369ccae0 Add support for adding 0.0 and -0.0 to the constant pool, since we lie and
say that we support them, for the purposes of generating fsel instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20970 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 01:08:07 +00:00
Nate Begeman
dffcfccc13 Factor out common code, support FP comparison in folded SetCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20969 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 00:32:34 +00:00
Nate Begeman
3e89716ad7 fsel generation for f32 and f64 select
generate compare immediate for integer compare with constant
fold setcc into branch
fold setcc into select

Code generation quality for Shootout is now on par with the Simple ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 23:55:40 +00:00
Nate Begeman
96fc681d7e Pass the correct values to the chain argument for node construction during
LowerCallTo.
Handle ISD::ADD in SelectAddr, allowing us to have nonzero immediates for
loads and stores, amazing!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20946 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 02:05:53 +00:00
Nate Begeman
74d734574e Rewrite LowerCallTo and Select(ISD::CALL) to properly handle float varargs
Tell the SelectionDAG ISel to expand SEXTLOAD of i1 and i8, rather than
  complicate the code in ISD::SEXTLOAD to do it by hand
Combine the FP and Int ISD::LOAD codegen
Generate better code for constant pool loads

As a result, all of Shootout, and likely many other programs are now
working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 00:15:26 +00:00
Nate Begeman
fdcf3418e0 Fix calls whose arguments fit entirely in registers to not break the Chain.
Implement SINT_TO_FP and UINT_TO_FP
Remove some dead code from the simple ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 19:38:35 +00:00
Nate Begeman
58f718cd97 Fix frame index code to generate legal PowerPC instructions. About half of
Shootout now works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 02:23:08 +00:00
Nate Begeman
01d05266f9 Fix external symbol printing in the AsmPrinter. Tell the ISel that we
don't support things like memcpy directly.  This allows a handful of the
Shootout programs to work, yay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 01:45:43 +00:00
Nate Begeman
23afcfb063 Fix BranchCC (it's still dumb), and implement FP select (also dumb)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20935 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 22:48:55 +00:00
Nate Begeman
74747861b9 Implement integer select and i1 sign extend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20934 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 22:24:51 +00:00
Nate Begeman
3316252034 Implement SetCC, fix ZERO_EXTEND_INREG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20933 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 21:54:38 +00:00
Chris Lattner
848132d671 fix a warning in the optimized build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20920 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 15:13:27 +00:00
Nate Begeman
f3d08f31b3 Implement div, rem, and frameindex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 00:03:27 +00:00
Nate Begeman
f70b576ccc Pattern ISel: fix argument loading for i64s (thanks chris)
Simple  ISel: fix i64 subtract


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20903 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 23:08:54 +00:00
Nate Begeman
ca12a2bd91 Remove fake instruction 'subc' (mnemonic for subfc).
More pattern isel updates


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20902 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 22:28:37 +00:00
Nate Begeman
9db505ca9d Implement proper loads and zero-extends of all types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20897 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 19:36:43 +00:00
Nate Begeman
7532e2f555 Fix that pesky floats in integer regs problem by assigning the f32 type to
the correct register class.  Also remove the loading of float data into int
regs part of varargs; it will need to be implemented differently later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 08:25:22 +00:00
Nate Begeman
f7e4338035 Get closer to having varargs working. There's still something strange
going on with copies between floating point and integer register files
being generated.  Once that is solved, varargs will be done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 07:46:36 +00:00
Nate Begeman
f26226155e Make 64bit args and float args work correct with calls. Thanks to Chris
for explaining EXTRACT_ELEMENT to me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20847 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 02:17:46 +00:00
Nate Begeman
307e7443b8 Next round of pattern isel changes, mostly dealing with calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20841 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 01:28:53 +00:00
Nate Begeman
c13a7f0eb3 Correct a documention link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 01:28:05 +00:00
Nate Begeman
c7b09f1f01 Support global addresses and fix call returns. Varargs still aren't
handled correctly for floating point arguments, or more than 8 arguemnts.
This does however, allow hello world to run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20832 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 08:34:25 +00:00
Nate Begeman
9e3e1b5d44 Implement next round of Pattern ISel fixes
1. void returns
2. multiplies
3. calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20822 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 23:35:30 +00:00
Nate Begeman
7ca541b75a Fix an incorrect argument being passed to BuildMI for indirect calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 23:34:38 +00:00
Nate Begeman
2daec45751 Commit Gabor Greif's patch to use iterators in lowering intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20816 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 20:07:16 +00:00
Chris Lattner
1bcb9abb30 eliminate dead variables, patch contributed by Gabor Greif!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20812 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 17:32:20 +00:00
Nate Begeman
5e9666129a Implement more of the PPC32 Pattern ISel:
1) dynamic stack alloc
2) loads
3) shifts
4) subtract
5) immediate form of add, and, or, xor
6) change flag from -pattern-isel to -enable-ppc-pattern-isel

Remove dead arguments from getGlobalBaseReg in the simple ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 06:28:42 +00:00
Chris Lattner
246fa6316d Fix silly "no newline at end of file" warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20809 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 06:16:18 +00:00
Nate Begeman
a9795f81e9 Addition of the PPC32 Pattern ISel. While it is far from complete, it will
be brought up to parity with the current simple ISel in the coming days.
Currently, -pattern-isel is required to trigger it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20805 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 04:41:43 +00:00
Misha Brukman
c7cd5e5672 We may be adding functions to the Module during initialization, so
conservatively, it's modified


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 19:22:14 +00:00
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
411eba0eaf Fix a crash handling 'undef bool', fixing an llc crash on 186.crafty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-08 22:53:09 +00:00
Chris Lattner
4318a3d0e9 cleanup the cfg after lsr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20410 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 21:56:00 +00:00
Chris Lattner
0c7490617a Add a temporary option for llc-beta: -enable-lsr-for-ppc, which turns on
Loop Strength Reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20399 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 06:19:22 +00:00
Chris Lattner
7a823bd01f Fix a problem where the PPC backend lost track of the fact that it had
to save and restore the LR register on entry and exit of a leaf function
that needed to access globals or the constant pool.  This should hopefully
fix oscar from sending the PPC tester spinning out of control.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20197 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 20:26:49 +00:00
Chris Lattner
3c70764907 Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14 20:22:02 +00:00
Chris Lattner
fbd4de1d9b Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19555 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14 19:31:00 +00:00
Chris Lattner
35e5c7c186 This hunk:
-  unsigned TrueValue = getReg(TrueVal, BB, BB->begin());
+  unsigned TrueValue = getReg(TrueVal);

Fixes the PPC regressions from last night.

The other hunk is just a clarity improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19263 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 23:07:31 +00:00
Chris Lattner
6dec0b09d5 Fix a FIXME: Select instructions on longs were miscompiled.
While we're at it, improve codegen of select instructions.  For this
testcase:

int %test(bool %C, int %A, int %B) {
  %D = select bool %C, int %A, int %B
  ret int %D
}

We used to generate this code:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        b .LBB_test_3   ;
.LBB_test_2:    ;
        or r5, r4, r4
.LBB_test_3:    ;
        or r3, r5, r5
        blr

Now we emit:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        or r4, r5, r5
.LBB_test_2:    ;
        or r3, r4, r4
        blr

-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19214 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:10:12 +00:00
Chris Lattner
47f9dd14b2 Specify all of the targets built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-16 17:26:44 +00:00
Chris Lattner
be686a8897 Factor out common .td file chunks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18982 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-16 16:31:57 +00:00
Chris Lattner
869f45937b Fix Regression/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll, and all programs
when compiled with debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 20:36:19 +00:00
Chris Lattner
8363ad6bfc CSE calls to getTypeSize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 20:31:00 +00:00
Chris Lattner
3ea78c4276 Use the target triple to pick this target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18830 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 17:40:28 +00:00
Chris Lattner
0284628e8e Fix several bugs in 'op x, imm' handling. Foremost is that we now emit
addi r3, r3, -1
instead of
   addi r3, r3, 1

for 'sub int X, 1'.

Secondarily, this fixes several cases where we could crash given an unsigned
constant.  And fixes a couple of minor missed optimization cases, such as
xor X, ~0U -> not X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18379 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 07:30:20 +00:00
Chris Lattner
35f2bbe8c6 Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18376 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:40:04 +00:00
Chris Lattner
e74ed0d53b Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18374 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:36:11 +00:00
Chris Lattner
7747040410 Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18371 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 06:29:10 +00:00
Chris Lattner
9d0087e043 The LLVM bool type shall have 1 byte alignment on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18311 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 21:16:45 +00:00
Nate Begeman
3330e08888 Remove the ISel->AsmPrinter link via the TargetMachine that was put in
place to help bring up the PowerPC back end on Darwin.  This code is no
longer serves any purpose now that the AsmPrinter does the right thing
all the time printing GlobalValues.  --Cruft.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18267 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-27 04:45:11 +00:00
Chris Lattner
15ee8adb00 There is no reason to store <x,x>, just store <x>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-26 20:25:17 +00:00
Nate Begeman
d4c8bea47f Enable optimization suggested by Chris Lattner to not emit reloc stubs for
static global variables whose addresses are taken.  This allows us to
convert the following code for taking the address of a static function foo

        addis r2, r30, ha16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")
        lwz r3, lo16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")(r2)

which also includes linker stub code emitted at the end of the .s file not
shown here, and replace it with this:

        addis r2, r30, ha16(l1__2E_foo_2-"L00001$pb")
        la r3, lo16(l1__2E_foo_2-"L00001$pb")(r2)

which in addition to not needing linker help, also has no load instruction.
For those not up on PowerPC mnemonics, la is shorthand for add immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18239 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 07:09:01 +00:00
Chris Lattner
fde839b4ff Fix the build on non ppc machines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18235 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 06:14:45 +00:00
Chris Lattner
2a0c0dff0b The JIT works enough
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 04:14:54 +00:00
Chris Lattner
5cbf3bc202 Fix encoding of fsel, fixing olden/power, McCat/bisort and several others.
All of Olden passes now! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18227 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 04:11:07 +00:00
Chris Lattner
a1ab451392 Fix encoding of fneg instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18226 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 03:53:44 +00:00
Chris Lattner
cd61ec837f Fix encoding of swari, fixing several programs, including Olden/mst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 03:40:20 +00:00
Chris Lattner
b752a97ca4 There is not a 1-1 mappign between llvm blocks and PPC blocks, do not use
LLVM blocks as the keys for the branch rewriter.  This fixes treeadd and
many other programs with the JIT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18223 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 00:33:57 +00:00
Chris Lattner
5efb75daed * Rename existing relocations to be more specific
* Add relocations for refernces to non-lazy darwin stubs and implement
  them correctly.

With this change, we can correctly references external globals, and now
all but two UnitTests and all but 1 Regression/C tests pass.

More importantly, bugpoint-jit will start giving us useful testcases,
instead of always telling us that references to external globals don't
work :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18222 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 22:30:08 +00:00
Nate Begeman
53e4aa57c6 Add the same optimization that we do loading from fixed alloca slots to
storing to fixed alloca slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 21:53:14 +00:00
Chris Lattner
73278080c8 Write CompilationCallback as an explicit assembly stub to avoid getting GCC's
prolog.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 21:01:46 +00:00
Chris Lattner
892afa9556 When rewriting the original call instruction, make sure to rewrite it to
call the right address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18213 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 18:00:02 +00:00
Chris Lattner
fb887e010d Force the intregs ptr into R2 and the FPregs ptr into R3. This fixes a really
obscure problem where we were doing:

lmw     r3,0(r9)

which is undefined on PPC.  Now we do:

lmw     r3,0(r2)

by force, not relying on the GCC register allocator for luck :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 17:42:55 +00:00
Chris Lattner
69efbdd4f3 Fix a few more tests by encoding the extsb and other XForm11 instructions
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 03:52:02 +00:00
Chris Lattner
2f5091ac2a Fix the encoding of ORi and other DForm4 instructions. This brings us to
36/42 SingleSource/UnitTests passing!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18199 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 02:15:41 +00:00
Chris Lattner
00a8c01999 Loads are relocatable too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18198 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 02:03:44 +00:00
Chris Lattner
b765ff1219 Calls do not need a MovPCtoLR instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18197 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 02:00:06 +00:00
Chris Lattner
b9f26da5dd Get constant pools working. This fixes even more programs, allowing us to
pass 24/42 in UnitTests (up from 20).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18196 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 01:56:12 +00:00
Chris Lattner
8599d385a2 Rewrite branches more closely to correct. This makes more stuff pass, and
stops the infinite loops!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18194 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 01:35:12 +00:00
Chris Lattner
310a752872 Branch instructions explicitly represent CRx in them. bEcause of this, encode
them explicitly as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18193 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 01:15:19 +00:00
Nate Begeman
3b78e3b6a9 Fix encoding of bctrl, and remove some unused instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18192 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 00:16:37 +00:00
Chris Lattner
6f407893e2 Fix encoding of blr and bctr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18178 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 22:06:24 +00:00
Nate Begeman
65b7f3ed2a Use the correct register class as a constaint to gcc's inline assembly, so
that we don't end up trying to use r0 as a base register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18176 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:37:22 +00:00
Nate Begeman
ca6d0f53ff Save/Restore arg regs and nonvolatile regs the compiler might use during
CompilationCallback


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18175 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:34:18 +00:00
Chris Lattner
5afa9af81b Fix the encoding of OR, AND and many other instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18174 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:17:35 +00:00
Chris Lattner
d162032013 Remove argtype and argcount magic, which was used by the old asmprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18170 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 20:41:34 +00:00
Chris Lattner
583e32b653 Get rid of flags that are dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18169 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 20:37:41 +00:00
Chris Lattner
89d60de90e Fix encoding of rlwinm?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18165 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 19:23:32 +00:00
Chris Lattner
943f45208c Fix encodings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18164 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 19:23:18 +00:00
Chris Lattner
9ba12359e3 Enumerate CR registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18162 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 18:59:59 +00:00
Chris Lattner
d9d06b3af1 Initial implementation of exiting CompilationCallback
This should save all argument registers on entry and restore on exit, despite
that, simple things seem to work!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 18:49:46 +00:00
Chris Lattner
22cd028eef This method is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18160 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 18:47:55 +00:00
Chris Lattner
05ad23711e Remove this method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18159 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 18:47:42 +00:00
Chris Lattner
d7fa35c6d2 Squelch a bogus warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18156 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 15:56:38 +00:00
Nate Begeman
dd30751654 Don't return value from void function. This is only temporary anyway while
the JIT is made to work!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 10:04:49 +00:00
Chris Lattner
7598bbac66 Fix a minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18153 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:56:31 +00:00
Chris Lattner
c9a6b1f4f6 Be really paranoid about not breaking stuff yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:56:18 +00:00
Chris Lattner
e61198b323 Implement the first hunk of CompilationCallback. The pieces missing are the
ones noted, which require funny PPC specific inline assembly.

If some angel felt the desire to help me, I think this is that last bit missing
for JIT support (however, generic code emitter might night work right with
the constant pool yet).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18151 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:55:05 +00:00
Chris Lattner
7c83dc2714 Implement the stub needed to get into compilation callback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18147 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:27:02 +00:00
Chris Lattner
64729d064a Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:05:44 +00:00
Chris Lattner
9b3d989cb7 Initial implementation of the JIT interfaces. Relocation is done and stubs
for external functions work.  CompilationCallback has not been written, and
stubs for internal functions are not generated yet.  This means you can call
printf and exit, and use global variables, but cannot call functions local to
a module yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18145 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:02:06 +00:00
Chris Lattner
e94c517bb5 Emit relocations for the global variable using instructions. This gets us
LA, LOADHiAddr, CALLpcrel, and MovePCtoLR working, though the constant pool
probably is not right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18144 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 05:59:53 +00:00
Chris Lattner
163393732a Implement all of the methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18142 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 05:57:57 +00:00