Commit Graph

3297 Commits

Author SHA1 Message Date
Andrew Lenharth 111e5e6490 update interface
llvm-svn: 22498
2005-07-22 20:49:37 +00:00
Nate Begeman a9443f29b0 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.

llvm-svn: 22494
2005-07-21 20:44:43 +00:00
Chris Lattner 53208ecf34 revert to using 4-byte alignment for doubles, as specified by the ABI
llvm-svn: 22493
2005-07-21 19:17:18 +00:00
Nate Begeman 15527113ab Support assembling fsqrt on darwin. This will be implemented better when
PowerPC gets subtarget support up.

llvm-svn: 22489
2005-07-21 01:25:49 +00:00
Nate Begeman 8465fe8b4b Generate mfocrf when targeting g5. Generate fsqrt/fsqrts when targetin g5.
8-byte align doubles.

llvm-svn: 22486
2005-07-20 22:42:00 +00:00
Nate Begeman 0851f1aaa1 Integrate SelectFPExpr into SelectExpr. This gets PPC32 closer to being
automatically generated from a target description.

llvm-svn: 22470
2005-07-19 16:51:05 +00:00
Reid Spencer d37d854cb2 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.

llvm-svn: 22468
2005-07-19 04:52:44 +00:00
Nate Begeman 7e74c834c1 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

llvm-svn: 22452
2005-07-16 02:02:34 +00:00
Nate Begeman 8293d0e232 Teach the register allocator that movaps is also a move instruction
llvm-svn: 22451
2005-07-16 02:00:20 +00:00
Nate Begeman 57b9ed522d A couple more darwinisms
llvm-svn: 22450
2005-07-16 01:59:47 +00:00
Chris Lattner 507a27592f 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

llvm-svn: 22449
2005-07-16 00:28:20 +00:00
Nate Begeman a0b5e035ea Get closer to fully working scalar FP in SSE regs. This gets singlesource
working, and Olden/power.

llvm-svn: 22441
2005-07-15 00:38:55 +00:00
Nate Begeman 0f38dc4970 Add support for printing the sse scalar comparison instruction mnemonics.
llvm-svn: 22440
2005-07-14 22:52:25 +00:00
John Criswell 3870f9d31a 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.

llvm-svn: 22437
2005-07-14 19:41:16 +00:00
Nate Begeman 8dd96ec769 Check in the last of the darwin-specific code necessary to get shootout
working before modifying the asm printer to use the subtarget info.

llvm-svn: 22408
2005-07-12 18:34:58 +00:00
Nate Begeman 5fc86e8314 Remove some code that moved to the generic asm printer a long time ago.
llvm-svn: 22407
2005-07-12 18:34:15 +00:00
Andrew Lenharth 20b534a4fd Fix povray and minor cleanups
llvm-svn: 22397
2005-07-12 04:20:52 +00:00
Jeff Cohen ddc8b78cda I don't know how this ever compiled with gcc, but VC++ correctly rejects it.
llvm-svn: 22394
2005-07-12 02:59:38 +00:00
Nate Begeman df8946dede Clean up the TargetSubtarget class a bit, removing an unnecessary argument
to the constructor.

llvm-svn: 22392
2005-07-12 02:41:19 +00:00
Chris Lattner 351817b1f9 Minor changes to improve comments and fix the build on _WIN32 systems.
llvm-svn: 22391
2005-07-12 02:36:10 +00:00
Chris Lattner f873f4d504 Add a note
llvm-svn: 22390
2005-07-12 02:35:36 +00:00
Nate Begeman f26625e1de 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.

llvm-svn: 22389
2005-07-12 01:41:54 +00:00
Nate Begeman 83b492b83c Commit some pending darwin changes before subtarget support.
llvm-svn: 22388
2005-07-12 01:37:28 +00:00
Chris Lattner fd564c6bc9 fix a warning
llvm-svn: 22385
2005-07-11 22:46:18 +00:00
Chris Lattner 9bdb1c3818 Output .size directives to tell the assembler the size of each function.
llvm-svn: 22381
2005-07-11 06:29:14 +00:00
Chris Lattner 0d2f043c41 Fix crazy indentation
llvm-svn: 22380
2005-07-11 06:25:47 +00:00
Chris Lattner d831209c34 Refactor things a bit to allow the ELF code emitter to run the X86 machine code emitter
after itself.

llvm-svn: 22376
2005-07-11 05:17:48 +00:00
Chris Lattner c3e38f7943 Remove prototype for non-existant function
llvm-svn: 22372
2005-07-11 04:20:55 +00:00
Chris Lattner 53676dfd33 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).

llvm-svn: 22368
2005-07-10 01:56:13 +00:00
Chris Lattner 36db1ed06f Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode
llvm-svn: 22366
2005-07-10 00:29:18 +00:00
Nate Begeman b62a4c8da6 Add support for assembling .s files on mac os x for intel
Add support for running bugpoint on mac os x for intel

llvm-svn: 22351
2005-07-08 00:23:26 +00:00
Andrew Lenharth 8d40dcbd18 clean up prolouge and epilouge
llvm-svn: 22346
2005-07-07 19:52:58 +00:00
Chris Lattner 2e81f65eb8 Restore some code that was accidentally removed by Nate's patch yesterday.
This fixes the regressions from last night.

llvm-svn: 22344
2005-07-07 17:12:53 +00:00
Nate Begeman fcd2f76cb6 Fix a typo in my checkin today that caused regressions. Oops!
llvm-svn: 22341
2005-07-07 06:32:01 +00:00
Nate Begeman 8a0933608a 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

llvm-svn: 22340
2005-07-06 18:59:04 +00:00
Chris Lattner a7220851c0 Make several cleanups to Andrews varargs change:
1. Pass Value*'s into lowering methods so that the proper pointers can be
   added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
   chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.
4. Now that we have Value*'s available in the lowering methods, pass them
   into any load/stores from the valist that are emitted

llvm-svn: 22339
2005-07-05 19:58:54 +00:00
Chris Lattner 91ae129b90 Fit to 80 columns
llvm-svn: 22336
2005-07-05 17:50:16 +00:00
Chris Lattner 1239d2d7ff Fix PowerPC varargs
llvm-svn: 22335
2005-07-05 17:48:31 +00:00
Andrew Lenharth 26fa89e0a7 check the correct VT
llvm-svn: 22332
2005-07-04 20:07:21 +00:00
Andrew Lenharth da852d51df fix loading address of fp symbols
llvm-svn: 22331
2005-07-03 20:06:13 +00:00
Chris Lattner 9f6ce0ebb3 Percolate the call up to the right superclass
llvm-svn: 22330
2005-07-03 17:34:39 +00:00
Nate Begeman 9a1dc72729 The statistic needs to be in the correct namespace.
llvm-svn: 22327
2005-07-01 23:56:38 +00:00
Chris Lattner d313b92b66 Varargs is apparently currently broken on PPC. This hacks it so that it
is at least overloading the right virtual methods.  The implementations
are currently wrong though.  This fixes Ptrdist/bc, but not other programs
(e.g. siod).

llvm-svn: 22326
2005-07-01 23:11:56 +00:00
Chris Lattner b97404687a Refactor X86AsmPrinter.cpp into multiple files. Patch contributed
by Aaron Gray, cleaned up by me.

llvm-svn: 22324
2005-07-01 22:44:09 +00:00
Andrew Lenharth 21da9b669e simplify call code, remove pseudo ops for div and rem, track more loads and stores
llvm-svn: 22323
2005-07-01 19:14:02 +00:00
Andrew Lenharth dd55b1566b simplify call code, remove pseudo ops for div and rem, track more loads and stores
llvm-svn: 22322
2005-07-01 19:12:13 +00:00
Chris Lattner e8ab64b5c3 remove some debugging code
llvm-svn: 22321
2005-07-01 06:40:58 +00:00
Nate Begeman 718387e491 Make the x86 asm printer darwin-aware. This mostly entails doing the same
thing as cygwin most of the time, and printing our alignments in log2
rather than number of bytes.

llvm-svn: 22316
2005-06-30 00:53:20 +00:00
Andrew Lenharth 2edc1881ac restore old srcValueNode behavior and try to to work around it
llvm-svn: 22315
2005-06-29 18:54:02 +00:00
Andrew Lenharth 8192568fbc tracking the instructions causing loads and stores provides more information than just the pointer being loaded or stored
llvm-svn: 22311
2005-06-29 15:57:19 +00:00