Commit Graph

3975 Commits

Author SHA1 Message Date
Nate Begeman
3dee17581c Fix some comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22530 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 23:11:27 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Nate Begeman
54eed36da5 Implement the optimization for the Red Zone on Darwin. This removes the
unnecessary SP manipulation in leaf routines that don't need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22522 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:06:29 +00:00
Chris Lattner
45ff4faeed fix some warnings when compiled with 32-bit hosts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22521 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:58:01 +00:00
Jeff Cohen
9eb59ec548 Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:53:44 +00:00
Chris Lattner
b65975a6ed add a note about the red zone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22518 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-26 19:07:51 +00:00
Chris Lattner
2e00d7d0ae Wrap some long lines, fix emission of weak global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22517 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-26 19:03:27 +00:00
Nate Begeman
4ad870ddcc Update the PPC readme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22516 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-26 18:59:06 +00:00
Nate Begeman
7b4f0a81ff Fix an optimization put in for accessing static globals. This obviates
the need to build PIC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22512 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-25 21:15:28 +00:00
Andrew Lenharth
f075cac445 fix compile error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22508 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-23 07:46:48 +00:00
Chris Lattner
aa68f7fa09 PowerPC no-pic code is not quite ready for prime-time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22507 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 22:58:34 +00:00
Andrew Lenharth
6b137d818a Handle more imm forms, and load small negative i32 constants without hitting memory (should do the same for arbitrary zero extended small negative constants)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22505 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 22:24:01 +00:00
Andrew Lenharth
38396f8a93 finally found the gcc defined constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22502 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 21:00:30 +00:00
Andrew Lenharth
0934ae02af Alpha JIT (beta)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22500 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 20:52:16 +00:00
Andrew Lenharth
f3f951af3f simpilfy instruction encoding (and make the lines way shorter, aka Misha happification)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22499 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 20:50:29 +00:00
Andrew Lenharth
908bc862d5 update interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22498 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 20:49:37 +00:00
Nate Begeman
2497e6391f Support building non-PIC
Remove the LoadHiAddr pseudo-instruction.
Optimization of stores to and loads from statics.
Force JIT to use new non-PIC codepaths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22494 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-21 20:44:43 +00:00
Chris Lattner
2130c08930 revert to using 4-byte alignment for doubles, as specified by the ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22493 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-21 19:17:18 +00:00
Nate Begeman
18ed029a7b Support assembling fsqrt on darwin. This will be implemented better when
PowerPC gets subtarget support up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22489 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-21 01:25:49 +00:00
Nate Begeman
adeb43ddf4 Generate mfocrf when targeting g5. Generate fsqrt/fsqrts when targetin g5.
8-byte align doubles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22486 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-20 22:42:00 +00:00
Nate Begeman
a3fd400fa8 Integrate SelectFPExpr into SelectExpr. This gets PPC32 closer to being
automatically generated from a target description.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22470 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-19 16:51:05 +00:00
Reid Spencer
a0f5bf306c For: memory operations -> stores
This is the first incremental patch to implement this feature. It adds no
functionality to LLVM but setup up the information needed from targets in
order to implement the optimization correctly. Each target needs to specify
the maximum number of store operations for conversion of the llvm.memset,
llvm.memcpy, and llvm.memmove intrinsics into a sequence of store operations.
The limit needs to be chosen at the threshold of performance for such an
optimization (generally smallish). The target also needs to specify whether
the target can support unaligned stores for multi-byte store operations.
This helps ensure the optimization doesn't generate code that will trap on
an alignment errors.
More patches to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22468 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-19 04:52:44 +00:00
Nate Begeman
5a8441ea3f Teach the legalizer how to promote SINT_TO_FP to a wider SINT_TO_FP that
the target natively supports.  This eliminates some special-case code from
the x86 backend and generates better code as well.

For an i8 to f64 conversion, before & after:

_x87 before:
        subl $2, %esp
        movb 6(%esp), %al
        movsbw %al, %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret

_x87 after:
        subl $2, %esp
        movsbw 6(%esp), %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret

_sse before:
        subl $12, %esp
        movb 16(%esp), %al
        movsbl %al, %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret

_sse after:
        subl $12, %esp
        movsbl 16(%esp), %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22452 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 02:02:34 +00:00
Nate Begeman
11cefd926a Teach the register allocator that movaps is also a move instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22451 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 02:00:20 +00:00
Nate Begeman
9035b99abf A couple more darwinisms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22450 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 01:59:47 +00:00
Chris Lattner
a28381cac2 Remove all knowledge of UINT_TO_FP from the X86 backend, relying on the
legalizer to eliminate them.  With this comes the expected code quality
improvements, such as, for this:

double foo(unsigned short X) { return X; }

we now generate this:

_foo:
        subl $4, %esp
        movzwl 8(%esp), %eax
        movl %eax, (%esp)
        fildl (%esp)
        addl $4, %esp
        ret

instead of this:

_foo:
        subl $4, %esp
        movw 8(%esp), %ax
        movzwl %ax, %eax   ;; Load not folded into this.
        movl %eax, (%esp)
        fildl (%esp)
        addl $4, %esp
        ret

-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22449 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 00:28:20 +00:00
Nate Begeman
16b04f3d5e Get closer to fully working scalar FP in SSE regs. This gets singlesource
working, and Olden/power.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22441 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-15 00:38:55 +00:00
Nate Begeman
6c7cb29038 Add support for printing the sse scalar comparison instruction mnemonics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22440 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-14 22:52:25 +00:00
John Criswell
ce4e1e419e Fixed PR#596:
Add parenthesis around the value being negated; that way, if the value
begins with a minus sign (e.g. negative integer), we won't generate a
C predecrement operator by mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22437 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-14 19:41:16 +00:00
Nate Begeman
d3a490a08e Check in the last of the darwin-specific code necessary to get shootout
working before modifying the asm printer to use the subtarget info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22408 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 18:34:58 +00:00
Nate Begeman
63b3f9acae Remove some code that moved to the generic asm printer a long time ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22407 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 18:34:15 +00:00
Andrew Lenharth
fec0e4024f Fix povray and minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22397 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 04:20:52 +00:00
Jeff Cohen
74fa8d67e1 I don't know how this ever compiled with gcc, but VC++ correctly rejects it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22394 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 02:59:38 +00:00
Nate Begeman
0e219eb9b8 Clean up the TargetSubtarget class a bit, removing an unnecessary argument
to the constructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22392 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 02:41:19 +00:00
Chris Lattner
b151acadc8 Minor changes to improve comments and fix the build on _WIN32 systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22391 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 02:36:10 +00:00
Chris Lattner
3249bfc828 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22390 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 02:35:36 +00:00
Nate Begeman
fb5792f416 Implement Subtarget support
Implement the X86 Subtarget.

This consolidates the checks for target triple, and setting options based
on target triple into one place.  This allows us to convert the asm printer
and isel over from being littered with "forDarwin", "forCygwin", etc. into
just having the appropriate flags for each subtarget feature controlling
the code for that feature.

This patch also implements indirect external and weak references in the
X86 pattern isel, for darwin.  Next up is to convert over the asm printers
to use this new interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22389 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 01:41:54 +00:00
Nate Begeman
73213f6c07 Commit some pending darwin changes before subtarget support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22388 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 01:37:28 +00:00
Chris Lattner
df3623e962 fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22385 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 22:46:18 +00:00
Chris Lattner
c569d79a2a Output .size directives to tell the assembler the size of each function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22381 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 06:29:14 +00:00
Chris Lattner
b12c9fa565 Fix crazy indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22380 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 06:25:47 +00:00
Chris Lattner
81b6ed7ed1 Refactor things a bit to allow the ELF code emitter to run the X86 machine code emitter
after itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22376 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 05:17:48 +00:00
Chris Lattner
efb4bf0de6 Remove prototype for non-existant function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22372 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 04:20:55 +00:00
Chris Lattner
bce81ae51e Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
This is the last MVTSDNode.

This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.

Also, remove some uses of dyn_cast that should really be cast (which is
cheaper in a release build).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22368 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-10 01:56:13 +00:00
Chris Lattner
9fadb4c1c0 Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22366 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-10 00:29:18 +00:00
Nate Begeman
72b286b0a0 Add support for assembling .s files on mac os x for intel
Add support for running bugpoint on mac os x for intel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22351 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 00:23:26 +00:00
Andrew Lenharth
a48f3ce18a clean up prolouge and epilouge
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22346 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 19:52:58 +00:00
Chris Lattner
8d4b9eddc0 Restore some code that was accidentally removed by Nate's patch yesterday.
This fixes the regressions from last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22344 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 17:12:53 +00:00
Nate Begeman
b8aa3ac678 Fix a typo in my checkin today that caused regressions. Oops!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22341 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 06:32:01 +00:00
Nate Begeman
f63be7d395 First round of support for doing scalar FP using the SSE2 ISA extension and
XMM registers.  There are many known deficiencies and fixmes, which will be
addressed ASAP.  The major benefit of this work is that it will allow the
LLVM register allocator to allocate FP registers across basic blocks.

The x86 backend will still default to x87 style FP.  To enable this work,
you must pass -enable-sse-scalar-fp and either -sse2 or -sse3 to llc.

An example before and after would be for:
double foo(double *P) { double Sum = 0; int i; for (i = 0; i < 1000; ++i)
                        Sum += P[i]; return Sum; }

The inner loop looks like the following:
x87:
.LBB_foo_1:     # no_exit
        fldl (%esp)
        faddl (%eax,%ecx,8)
        fstpl (%esp)
        incl %ecx
        cmpl $1000, %ecx
        #FP_REG_KILL
        jne .LBB_foo_1  # no_exit

SSE2:
        addsd (%eax,%ecx,8), %xmm0
        incl %ecx
        cmpl $1000, %ecx
        #FP_REG_KILL
        jne .LBB_foo_1  # no_exit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-06 18:59:04 +00:00