Commit Graph

4942 Commits

Author SHA1 Message Date
Chris Lattner
74fa64b072 implement vaarg. Varargs now should work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24986 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 06:37:38 +00:00
Chris Lattner
c4769bb529 implement vastart. The dag isel compiles this:
void test3(va_list Y);
void test2(int F, ...) {
  va_list X;
  va_start(X, F);
  test3(X);
}

into this:

test2:
        save -104, %o6, %o6
        st %i5, [%i6+88]
        st %i4, [%i6+84]
        st %i3, [%i6+80]
        st %i2, [%i6+76]
        st %i1, [%i6+72]
        add %i6, 72, %o0
        st %o0, [%i6+-4]
        call test3
        nop
        restore %g0, %g0, %g0
        retl
        nop

The simple isel emits:

test2:
        save -96, %o6, %o6
        st %i0, [%i6+68]
        st %i1, [%i6+72]
        st %i2, [%i6+76]
        st %i3, [%i6+80]
        st %i4, [%i6+84]
        st %i5, [%i6+88]
        or %g0, 1, %l0
        or %g0, 4, %l1
        umul %l0, %l1, %l0
        add %l0, 7, %l0
        and %l0, -8, %l0
        sub %o6, %l0, %o6
        add %o6, 96, %l0
        add %i6, 72, %l1
        st %l1, [%l0]
        ld [%l0], %o0
        call test3
        nop
        restore %g0, %g0, %g0
        retl
        nop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 06:24:04 +00:00
Chris Lattner
e6ee868a8d remove benchmark list, remove issues addressed by the dag-dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24984 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 06:09:30 +00:00
Chris Lattner
21f66859e4 make sure bit_convert's are expanded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 05:15:23 +00:00
Chris Lattner
53e884587b make sure bit_converts are expanded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24978 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 05:13:35 +00:00
Chris Lattner
3cb7187d5f fix the int<->fp instructions, which apparently take a single float register
to represent the int part (because it's always 32-bits)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 05:00:16 +00:00
Chris Lattner
a01874fc89 Use BIT_CONVERT to simplify this code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 02:31:39 +00:00
Chris Lattner
1b95e0ba92 Simplify some code by using BIT_CONVERT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24974 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 00:59:59 +00:00
Chris Lattner
a01c0ccb63 clean up .td file by using evan's new FLAG thing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24967 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:18:39 +00:00
Chris Lattner
0fcd40f501 remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24965 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:16:08 +00:00
Chris Lattner
cec26fc3bf fix handling of weak linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24964 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:15:17 +00:00
Chris Lattner
39706e68a5 move some random notes out of my email into someplace useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24956 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 17:19:28 +00:00
Duraid Madina
64aa0ea4e9 this is a hack, which may or may not hang around. In short:
whimper out of doing things the Right Way, and hack up a generic
'BRCALL' instruction, that gets generated when calls are lowered.
This gets selected by hand in the DAG isel, where it gets turned
into real (i.e. in tablegen) br.call instructions.

BUG: this dies on void calls, but seems to work otherwise?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24952 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 13:29:14 +00:00
Duraid Madina
8617f3cf14 we can't do this directly in lowering, so we need this case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24951 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 07:14:45 +00:00
Duraid Madina
3d821e26a1 oops, back this out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24950 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 07:13:51 +00:00
Duraid Madina
a6ec3cbac1 we can't all have brains now, can we
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24948 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 06:41:39 +00:00
Duraid Madina
98b3a83d83 this should take care of calls to varadic functions, but it doesn.,t
BUG: calling printf(string, float) will load the float into the wrong
register, completely forget about loading the string, etce


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24947 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 06:39:57 +00:00
Duraid Madina
0b3c4d8221 we need to emit the getf.d instruction in lowering, so add it
to IA64ISD


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24946 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 06:38:38 +00:00
Duraid Madina
98d1378343 I shoulda done this a *long* time ago (tm): implement calls properly,
i.e. r1/r12/rp are saved/restored regardless of scheduling/luck

TODO: calls to external symbols, indirect (function descriptor) calls,
      performance (we're being paranoid right now)

BUG: the code for handling calls to vararg functions breaks if FP
args are passed (this will make printf() go haywire so a bunch of
tests will fail)

BUG: this seems to trigger some legalize nastiness


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24942 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 04:07:40 +00:00
Duraid Madina
a36153a961 kill SelectCALL() in the DAG isel, we handle this in lowering now, like
SPARCv8. (we copy sparcv8's workaround for tablegen not being nice about
ISD::CALL/TAILCALL)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 03:58:17 +00:00
Duraid Madina
a0a11d289d update tablegen files - nothing to see here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 03:56:03 +00:00
Evan Cheng
5bc4da4893 Bye bye HACKTROCITY.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24935 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 02:26:21 +00:00
Evan Cheng
351dc967ba Added special flag node FLAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24934 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 02:25:14 +00:00
Evan Cheng
3a03ebb377 * Fix a GlobalAddress lowering bug.
* Teach DAG combiner about X86ISD::SETCC by adding a TargetLowering hook.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24921 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 23:05:39 +00:00
Evan Cheng
793ca4caa4 Oops. Accidentally deleted RET pattern. It's still needed for return void;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24920 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 22:22:16 +00:00
Jim Laskey
e81aecbae6 Disengage DEBUG_LOC from non-PPC targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24919 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 20:51:37 +00:00
Evan Cheng
d5781fca4f * Added support for X86 RET with an additional operand to specify number of
bytes to pop off stack.
* Added support for X86 SETCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 20:21:51 +00:00
Chris Lattner
5c82f4dcdc add some nodes, forgot to commit this last night :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24901 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 16:22:46 +00:00
Chris Lattner
c515ad18f8 This was meant to go in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24900 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 07:50:26 +00:00
Chris Lattner
58fe459e36 Rewrite FP stackifier support in the X86InstrInfo.td file, splitting patterns
that were overloaded to work before and after the stackifier runs.  With the
new clean world, it is possible to write patterns for these instructions: woo!

This also adds a few simple patterns here and there, though there are a lot
still missing.  These should be easy to add though. :)

See the comments under "Floating Point Stack Support" for more details on
the new world order.

This patch as absolutely no effect on the generated code, woo!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24899 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 07:47:04 +00:00
Chris Lattner
9fb2422c49 Wrap some long lines: no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24898 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 05:34:58 +00:00
Chris Lattner
7669a51c34 remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24896 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 05:27:51 +00:00
Evan Cheng
8263c5e920 Remove ISD::RET select code. Now tblgen'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24889 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 02:41:57 +00:00
Evan Cheng
b077b842b6 * Added lowering hook for external weak global address. It inserts a load
for Darwin.
* Added lowering hook for ISD::RET. It inserts CopyToRegs for the return
  value (or store / fld / copy to ST(0) for floating point value). This
  eliminate the need to write C++ code to handle RET with variable number
  of operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 02:39:21 +00:00
Evan Cheng
bbc8ddbea3 SSE2 floating point load / store patterns. SSE2 fp to int conversion patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 22:59:51 +00:00
Evan Cheng
6a3bfd97f2 Flip the meaning of FPContractions to reflect Requires<[]> change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24884 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 20:08:53 +00:00
Chris Lattner
aca0901dd3 Run lower-switch after lower-invoke.
Only run lower-allocations and lower-select for the simple isel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24881 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 08:00:11 +00:00
Chris Lattner
85e42b45ac Reserve G1 for frame offset stuff and use it to handle large stack frames.
For example, instead of emitting this:

test:
        save -40112, %o6, %o6   ;; imm too large
        add %i6, -40016, %o0    ;; imm too large
        call caller
        nop
        restore %g0, %g0, %g0
        retl
        nop

emit this:

test:
        sethi 4194264, %g1
        or %g1, 848, %g1
        save %o6, %g1, %o6
        sethi 4194264, %g1
        add %g1, %i6, %g1
        add %i1, 944, %o0
        call caller
        nop
        restore %g0, %g0, %g0
        retl
        nop

which doesn't cause the assembler to barf.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24880 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 07:56:31 +00:00
Evan Cheng
a5386b0823 Added X86 readport patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24879 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 07:38:38 +00:00
Evan Cheng
7226158d7e Added a hook to print out names of target specific DAG nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24877 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 06:22:03 +00:00
Nate Begeman
9e4dd9dfc9 Pattern-match return. Includes gross hack!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24874 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 00:26:01 +00:00
Nate Begeman
88276b887c Fix a couple of the FIXMEs, thanks to suggestion from Chris. This allows
us to load and store vectors directly at a pointer (offset of zero) by
using r0 as the base register.  This also requires some asm printer work
to satisfy the darwin assembler.

For
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, %tmp1
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}

We now produce:
_foo:
        lvx v0, 0, r3
        vaddfp v0, v0, v0
        stvx v0, 0, r3
        blr

Instead of:
_foo:
        li r2, 0
        lvx v0, r2, r3
        vaddfp v0, v0, v0
        stvx v0, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24872 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 23:40:42 +00:00
Nate Begeman
7fd1edd32e Convert load/store over to being pattern matched
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24871 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 23:25:09 +00:00
Evan Cheng
898101c15f X86 conditional branch support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 23:12:38 +00:00
Evan Cheng
fcaa9957c9 It's essential we clear CodeGenMap after isel every basic block!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24867 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 22:36:02 +00:00
Chris Lattner
7c423b4df1 Fix pifft by correcting the case when a i64/f64 straddles O5 and memory:
we were storing into [FP+88] instead of [FP+92].
Improve codegen by emitting [FP+92], instead of emitting a copy of FP into
another GPR which wouldn't be coallesced because FP isn't register allocated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24859 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 07:57:53 +00:00
Chris Lattner
43875e63f3 don't emit 'add %o6, 0, %o6' instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 02:51:12 +00:00
Chris Lattner
eb0966693b Fix calls to functions returning i64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 02:15:51 +00:00
Chris Lattner
bcfdec73d1 Correct bool truncstore operand order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24855 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 02:06:50 +00:00
Chris Lattner
e2d97f8399 add the other bool zextload as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24854 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:44:58 +00:00
Chris Lattner
a1251f24b5 implement zextload bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24853 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:43:04 +00:00
Chris Lattner
61772c20ee mark some unsupported ops as unsupported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24852 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:39:40 +00:00
Chris Lattner
96d5bb79d4 Fix syntax for indirect calls. This fixes Olden/mst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24850 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:22:53 +00:00
Chris Lattner
6554beffe4 Keep stack frames 8-byte aligned. This fixes olden/voronoi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24849 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:15:13 +00:00
Chris Lattner
97561fc2eb apparently rdy isn't actually a psuedo instruction. Use rd %y
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24848 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 00:53:02 +00:00
Chris Lattner
beecfd2b2d add fneg/fabs support for doubles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24847 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 00:50:12 +00:00
Chris Lattner
da5a7fd8d4 Various cleanups to this pass, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24846 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 00:46:20 +00:00
Chris Lattner
f53d0bfbfd add bool truncstores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24845 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 00:19:21 +00:00
Chris Lattner
8ba0423660 Elimiante SP and FP, which weren't members of the IntRegs register class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 00:06:52 +00:00
Chris Lattner
379e6c0369 The sun assembler only supports .xword in V9 mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24842 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:36:45 +00:00
Chris Lattner
7a48e5018b Configure the asmwriter to allow constant pools to be printed correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24841 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:35:05 +00:00
Chris Lattner
b04c5c8eb2 add support for integer extloads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:18:37 +00:00
Chris Lattner
20ad53ffd7 Add support for undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24839 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:10:57 +00:00
Chris Lattner
311f8c21d0 Add support for calls to external symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:07:11 +00:00
Chris Lattner
e90ac3a3e7 we have no memcpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24837 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 23:00:27 +00:00
Chris Lattner
b4d899e21c Fix a crash on a call with no arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24836 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 22:57:47 +00:00
Chris Lattner
cf198eca97 This is handled by the autogen'd code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 21:06:11 +00:00
Chris Lattner
dab05f0e19 Change return lowering so that we can autogen the matching code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24832 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 21:03:04 +00:00
Chris Lattner
2db3ff66f1 Implement Calls for V8. This would be completely autogenerated except for
a small bug in tblgen.  When that is fixed, we can remove the ISD::Call case
in Select.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24830 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 15:55:15 +00:00
Chris Lattner
384e5efc0e Implement the full V8 ABI for incoming arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24825 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 13:33:06 +00:00
Chris Lattner
eee99bd459 Push ops list, asm string, and pattern all the way up to InstV8. Move the
InstV8 class to the InstrFormats file where it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24824 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 08:21:00 +00:00
Chris Lattner
3308449afc Give V8 select_cc, in the spirit of the PPC backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24823 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 08:13:54 +00:00
Chris Lattner
98f853698c remove some unused instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24822 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 07:15:17 +00:00
Chris Lattner
065c896b7a V8 doesn't have FP extload
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 07:13:32 +00:00
Chris Lattner
d5aae05281 simplifications, fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24820 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 07:09:06 +00:00
Chris Lattner
737f631532 add a node, for completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24819 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 07:05:21 +00:00
Chris Lattner
8fa54dc702 Add frameindex support
Add support for copying (e.g. returning) doubles
Add support for F<->I instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 06:59:57 +00:00
Chris Lattner
abfc2a7363 Tighten up some checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24817 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 06:40:34 +00:00
Nate Begeman
6aa45292c6 Since extload can also be used by FP, split STDIntExtLoad into two parts,
one for use with extload, one for use with sextload and zextload, which
are integer only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 02:48:48 +00:00
Chris Lattner
76acc872b3 Add constant pool support, including folding into addresses.
Pretty print addresses a bit, to not print [%r1+%g0]: just print [%r1]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24813 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 02:37:35 +00:00
Chris Lattner
e1389ad43a Teach the addressing mode stuff to fold "%lo" into 'ri' addressing modes,
allowing us to compile this:

to this:

%G1 = external global int
%G2 = external global int
void %test() {
        %X = load int* %G1
        store int %X, int* %G2
        ret void
}

test:
        save -96, %sp, %sp
        sethi %hi(G1), %l0
        ld [%l0+%lo(G1)], %l0
        sethi %hi(G2), %l1
        st %l0, [%l1+%lo(G2)]
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

test:
        save -96, %sp, %sp
        sethi %hi(G1), %l0
        or %g0, %lo(G1), %l1
        ld [%l1+%l0], %l0
        sethi %hi(G2), %l1
        or %g0, %lo(G2), %l2
        st %l0, [%l2+%l1]
        restore %g0, %g0, %g0
        retl
        nop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24812 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 02:27:00 +00:00
Chris Lattner
e357246c6b Add initial support for global variables, and fix a bug in addr mode selection
where we didn't select the operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24811 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 02:10:39 +00:00
Chris Lattner
04dd673aea Claiming that branch targets are registers is not very wholesome. Change them
to be basic blocks.  Also, add uncond branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 01:46:58 +00:00
Chris Lattner
456b9400dc Add unordered comparisons
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24809 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 01:41:39 +00:00
Chris Lattner
5b2dfc7cc1 Add patterns to the rest of the int condbranches and some of the fp branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24808 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 01:38:19 +00:00
Chris Lattner
4d55aca87a Add initial conditional branch support. This doesn't actually work yet due
to a bug in the scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24807 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 01:20:35 +00:00
Chris Lattner
38abcb500f Eliminate CMPri, which is a synonym for SUBCCri
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24805 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 23:52:08 +00:00
Chris Lattner
294974bd57 add fneg,fabs,fsqrt instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24803 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 23:20:27 +00:00
Chris Lattner
b4d5172af9 Add patterns for fround/fextend and the funny fsmuld instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24802 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 23:14:30 +00:00
Chris Lattner
10c6aed73c Add FP +,-,*,/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24801 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 23:10:46 +00:00
Chris Lattner
558bfe0cf5 Give patterns to F3_3 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24800 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 23:05:35 +00:00
Chris Lattner
d19fc65345 Implement 64-bit add/sub, make sure to receive and return 64-bit args with
the right halves in the right regs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 22:55:57 +00:00
Chris Lattner
7087e57872 implement div and rem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24798 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 22:39:19 +00:00
Chris Lattner
ee3d5fba54 implement MULHU/MULHS for 64-bit multiplies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24797 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 22:30:00 +00:00
Chris Lattner
37949f5c2b Add patterns for multiply, simplify Y register handling stuff, add RDY instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24796 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 22:22:53 +00:00
Chris Lattner
9034b883a4 Make the addressing modes smarter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24795 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 21:25:27 +00:00
Chris Lattner
87a63f812c remove some unused instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24794 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 21:13:50 +00:00
Chris Lattner
2cfdbb2716 add andn/orn/xorn patterns. This allows us to compile this:
long %test(ubyte, short, long %X, long %Y) {
  %A = xor long %X, -1
  %B = and long %Y, %A
  ret long %B
}

to this:

test:
        save -96, %sp, %sp
        andn %i4, %i2, %i0
        andn %i5, %i3, %i1
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

test:
        save -96, %sp, %sp
        xor %i2, -1, %l0
        xor %i3, -1, %l1
        and %i4, %l0, %i0
        and %i5, %l1, %i1
        restore %g0, %g0, %g0
        retl
        nop

The simpleisel emits:  :(

test:
        save -96, %sp, %sp
        or %g0, -1, %l0
        or %g0, -1, %l0
        or %g0, -1, %l0
        or %g0, -1, %l1
        xor %i2, %l0, %l0
        xor %i3, %l1, %l1
        and %i4, %l0, %i0
        and %i5, %l1, %i1
        restore %g0, %g0, %g0
        retl
        nop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24793 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 21:05:49 +00:00
Chris Lattner
217aabf89e Add support for 64-bit arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24792 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:59:06 +00:00
Chris Lattner
9a60ff654a Sparc doesn't have sext_inreg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24791 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:50:42 +00:00
Chris Lattner
53ec2035eb add patterns for FP stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24790 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:47:16 +00:00
Chris Lattner
d55e1ca5ef Add [reg+reg] integer stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24789 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:44:36 +00:00
Chris Lattner
d30a630636 Add store patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24788 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:42:55 +00:00
Chris Lattner
0b218434cc add truncstore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24787 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:42:29 +00:00
Chris Lattner
b575baf57d add fp load patterns, switch rest of loads and stores to use addrmodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24786 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:32:47 +00:00
Chris Lattner
1963783fab Add integer load[r+r] forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24785 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:26:45 +00:00
Chris Lattner
331355cf7d Rename load/store instructions to include an RI suffix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24784 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:18:49 +00:00
Chris Lattner
84e2abf116 Add patterns for the rest of the loads. Add 'ri' suffixes to the load and store insts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24783 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:18:24 +00:00
Chris Lattner
bc83fd9672 Add basic addressing mode support and one load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24782 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 20:04:49 +00:00
Chris Lattner
4543251834 eliminate some redundancy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24781 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 19:47:05 +00:00
Chris Lattner
b71f9f8488 Use a combination of sethi and or to build arbitrary immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24780 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 19:41:43 +00:00
Chris Lattner
57dd3bc460 Use sethi to build large immediates with zeros at the bottom
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24779 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 19:37:00 +00:00
Chris Lattner
d2cd46676c Add shift and small immediate support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24778 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 19:07:57 +00:00
Chris Lattner
f83cee6ac1 Add some basic reg-reg instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24777 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 18:53:33 +00:00
Chris Lattner
e33a3ff942 Add empty patterns to all F3_1 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24776 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 18:49:14 +00:00
Evan Cheng
bdce7b4090 Darwin API issue: indirect load of external and weak symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24775 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 09:13:43 +00:00
Chris Lattner
7b0902dcf8 Add some simple integer patterns. This allows us to compile this:
int %test(int %A) {
  %B = add int %A, 1
  %C = xor int %B, 123
  ret int %C
}

into this:

test:
        save -96, %sp, %sp
        add %i0, 1, %l0
        xor %l0, 123, %i0
        restore %g0, %g0, %g0
        retl
        nop

for example.  I guess it would make sense to add reg/reg versions too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24774 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 08:26:38 +00:00
Chris Lattner
4b4863188f Implement ret with operand, giving us this:
int %test(int %A) {
  ret int %A
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24773 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 08:15:09 +00:00
Chris Lattner
bc3d362d5b Add a pattern for 'ret'. This now compiles:
void %test() { ret void }

:)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24772 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 08:08:42 +00:00
Chris Lattner
f3bf50d2c8 Add empty patterns for F3_2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24771 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 08:06:43 +00:00
Chris Lattner
a01b75758c Implement LowerArguments, at least for the first 6 integer args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24770 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 08:03:24 +00:00
Chris Lattner
6c18b10ad4 Add the framework for a dag-dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24769 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:47:01 +00:00
Evan Cheng
433dbdaa63 Remove a few lines of dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24768 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:18:44 +00:00
Chris Lattner
576e46fc67 asmprinter done, added crucial missing step
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24767 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:17:59 +00:00
Chris Lattner
967abf37c5 Use the AsmPrinter for global variable init printing. This eliminates a
bunch of code and causes V8 to start using the fancy .asciz directive that
the sun assembler supports.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24766 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:17:08 +00:00
Chris Lattner
b5e9eb6089 Switch constant pool printing over to use the Shared AsmPrinter version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24765 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:11:43 +00:00
Chris Lattner
1dbed16fec Use the shared AsmPrinter code for some basic stuff. No functionality
change except for fewer .section directives emitted


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24764 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 07:04:29 +00:00
Evan Cheng
98abbfb2ef Added an idea about any_extend for performance tuning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24763 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 06:54:43 +00:00
Chris Lattner
0d8fcd3218 Convert the remaining instructions over, branches and calls. Fix a couple
minor bugs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24762 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 06:54:41 +00:00
Chris Lattner
dc6938ac23 convert FP instructions to use an asmstring and operand list, allowing FP
programs to work on V8 again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24761 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 06:32:52 +00:00
Evan Cheng
45f37bc527 Added truncate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24760 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 02:02:50 +00:00
Evan Cheng
1aabc4ea15 Added anyext, modelled as zext on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24759 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:47:57 +00:00
Evan Cheng
8dee8cca3a Added some isel ideas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24757 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:25:19 +00:00
Evan Cheng
aed7c721df Added support for cmp, test, and conditional move instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24756 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:24:02 +00:00
Evan Cheng
56323c761a Only lower SELECT when using DAG based isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24755 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:22:13 +00:00
Evan Cheng
7df96d6672 X86 lowers SELECT to a cmp / test followed by a conditional move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24754 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:21:05 +00:00
Jim Laskey
f5395cee6a Added source file/line correspondence for dwarf (PowerPC only at this point.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24748 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 22:45:29 +00:00
Chris Lattner
d9e0ba49a4 Weak and linkonce global vars should still have a .globl emitted for them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24747 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 21:46:14 +00:00
Nate Begeman
f492f9901a Add a second vector type to the VRRC register class, and fix some patterns
so that tablegen can infer all types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24746 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 09:19:13 +00:00
Chris Lattner
0647bf6965 add some notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24745 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 07:20:53 +00:00
Chris Lattner
13e1501c91 Add a couple more instrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24744 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 07:18:48 +00:00
Chris Lattner
3c1c514fae remove some dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24743 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 07:16:02 +00:00
Chris Lattner
17392e026a asmprint pseudo instrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24742 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 07:13:26 +00:00
Chris Lattner
d4f2ab5e00 Autogenerate asmprinter for F3_2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24741 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 07:10:02 +00:00
Chris Lattner
1c4f435603 Switch F3_1 instructions over to use AsmStrings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24740 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 06:52:00 +00:00
Chris Lattner
994b735de8 Plug in basic hooks for an autogenerated asm printer to fill in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24739 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 06:34:17 +00:00
Chris Lattner
96b84beb77 Add operand info for F3_[12] instructions, getting V8 back to basic functionality.
With this, Regression/CodeGen/SparcV8/basictest.ll now passes.  Lets hear it
for regression tests :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24738 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 06:25:42 +00:00
Chris Lattner
03a83c90da Remove JIT support, which doesn't work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24736 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 06:06:07 +00:00
Chris Lattner
3ff5751683 add some simple operand info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 06:02:58 +00:00
Chris Lattner
a637c32e38 Update the darwin handling of linkonce & weak functions and GV stubs. This
should work in all permutations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 00:22:14 +00:00