1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

6318 Commits

Author SHA1 Message Date
Evan Cheng
40a5de9cd9 Revert an unintended change.
llvm-svn: 32239
2006-12-05 22:03:40 +00:00
Evan Cheng
adeea85f7d - Switch X86-64 JIT to large code size model.
- Re-enable some codegen niceties for X86-64 static relocation model codegen.
- Clean ups, etc.

llvm-svn: 32238
2006-12-05 19:50:18 +00:00
Chris Lattner
6a9de21df5 If we have ScalarSSE, we can select bitconvert into single instructions.
This compiles bitcast.ll:test3/test4 into:

_test3:
        movd %xmm0, %eax
        ret
_test4:
        movd %edi, %xmm0
        ret

llvm-svn: 32230
2006-12-05 18:45:06 +00:00
Chris Lattner
0edf53eb71 Add a perf optzn corresponding to PR1033.
llvm-svn: 32229
2006-12-05 18:25:10 +00:00
Chris Lattner
4ad68ab4d7 Fix PR1033 and CodeGen/X86/bitcast.ll, by expanding bitcast to a load/store pair.
This could be better, readme entry pending.

llvm-svn: 32228
2006-12-05 18:22:22 +00:00
Rafael Espindola
5e8a6ca4c0 expand memmove and memcpy
llvm-svn: 32226
2006-12-05 17:57:23 +00:00
Rafael Espindola
38062acebb add support for the "r" asm constraint
patch by Lauro Ramos Venancio

llvm-svn: 32224
2006-12-05 17:37:31 +00:00
Chris Lattner
7368984a3d Fix typo noticed by Lauro Ramos Venancio, thanks!
llvm-svn: 32223
2006-12-05 17:29:40 +00:00
Rafael Espindola
da1fffc4e1 add support for weak linkage
llvm-svn: 32222
2006-12-05 17:00:17 +00:00
Evan Cheng
32c16b7d3a JIT large code model support.
llvm-svn: 32220
2006-12-05 07:29:55 +00:00
Evan Cheng
2c48ef5aab Asm printing bug.
llvm-svn: 32218
2006-12-05 06:43:58 +00:00
Evan Cheng
2c35691a02 - Fix X86-64 JIT by temporarily disabling code that treats GV address as 32-bit
immediate in small code model. The JIT cannot ensure GV's are placed in the
lower 4G.
- Some preliminary support for large code model.

llvm-svn: 32215
2006-12-05 04:01:03 +00:00
Evan Cheng
b16bf52453 Update
llvm-svn: 32214
2006-12-05 03:58:23 +00:00
Chris Lattner
0be88afd90 Add support for 64-bit 'r' constraint. Patch by by Rafael ~Avila de Espíndol!
This fixes PR1029 and Regression/CodeGen/X86/x86-64-asm.ll

llvm-svn: 32206
2006-12-04 22:38:21 +00:00
Jim Laskey
1dcda902cd Restoration of the stack pointer after a deallocation of a alloca was not
updating the SP link.

llvm-svn: 32202
2006-12-04 22:04:42 +00:00
Evan Cheng
11e73ffe93 Non-darwin gcc should default to static relocation to match gcc.
llvm-svn: 32184
2006-12-04 18:07:10 +00:00
Evan Cheng
bf13611e84 Match TargetInstrInfo changes.
llvm-svn: 32098
2006-12-01 21:52:58 +00:00
Evan Cheng
5c7e78886c convertToThreeAddress() is now responsible for updating live info as well as inserting the new MI's.
llvm-svn: 32097
2006-12-01 21:52:41 +00:00
Evan Cheng
c5ad9caeff Add weak reference directive.
llvm-svn: 32091
2006-12-01 20:47:11 +00:00
Evan Cheng
1d611158eb Copy and paste error. An initialized global cannot be a weak reference.
llvm-svn: 32075
2006-12-01 17:39:22 +00:00
Jim Laskey
8f43fbf759 1. In ppc64 mode we need only use one GPR.
2. Float values need to be promoted to double when they are vararg.

llvm-svn: 32074
2006-12-01 16:30:47 +00:00
Jim Laskey
a8db40105b ExternalWeak case in wrong location.
llvm-svn: 32073
2006-12-01 14:37:39 +00:00
Evan Cheng
04e66b07dc Fix 2005-05-08-FPStackifierPHI.ll failure.
llvm-svn: 32071
2006-12-01 10:11:51 +00:00
Evan Cheng
3cc87db480 A initialized global variable cannot be extern weak. However, if a global value's initializer is itself a external weak symbol, emit the weak reference.
llvm-svn: 32069
2006-12-01 09:13:26 +00:00
Evan Cheng
6f5f81722b Darwin PPC external weak linkage support.
llvm-svn: 32068
2006-12-01 07:56:37 +00:00
Evan Cheng
d326e5b35e Minor code clean up.
llvm-svn: 32067
2006-12-01 07:38:23 +00:00
Evan Cheng
5b43e8613e Fix indentation.
llvm-svn: 32066
2006-12-01 07:17:00 +00:00
Evan Cheng
1dfe5221c1 Darwin X86 external weak linkage support.
llvm-svn: 32065
2006-12-01 07:15:24 +00:00
Chris Lattner
860908f98c Fix the CodeGen/PowerPC/vec_constants.ll regression.
llvm-svn: 32057
2006-12-01 01:45:39 +00:00
Anton Korobeynikov
f627d28d9c Introducing external weak linkage. Darwin codegen should be added later.
llvm-svn: 32052
2006-12-01 00:25:12 +00:00
Anton Korobeynikov
25535e6c64 Factor out GVRequiresExtraLoad() from .h to .cpp
llvm-svn: 32048
2006-11-30 22:42:55 +00:00
Evan Cheng
456101ebb9 - Use a different wrapper node for RIP-relative GV, etc.
- Proper support for both small static and PIC modes under X86-64
- Some (non-optimal) support for medium modes.

llvm-svn: 32046
2006-11-30 21:55:46 +00:00
Evan Cheng
d8be97599a MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor
llvm-svn: 32034
2006-11-30 07:12:03 +00:00
Evan Cheng
08e6984667 Remove the ugly SPARCV9 TargetInstrDescriptors hack.
llvm-svn: 32033
2006-11-30 07:10:43 +00:00
Evan Cheng
f64e341522 In PIC mode, GV not requiring an extra load can be used as address immediate.
llvm-svn: 32028
2006-11-29 23:48:14 +00:00
Evan Cheng
1e3f41acde Clean up.
llvm-svn: 32027
2006-11-29 23:46:27 +00:00
Evan Cheng
7e20347607 Fix for PR1018 - Better support for X86-64 Linux in small code model.
llvm-svn: 32026
2006-11-29 23:19:46 +00:00
Chris Lattner
3219b522c8 Fix bug codegen'ing FP constant vectors with integer splats. Make sure the
created intrinsics have the right integer types.  This fixes
PowerPC/2006-11-29-AltivecFPSplat.ll

llvm-svn: 32024
2006-11-29 19:58:49 +00:00
Jim Laskey
00bcb51943 Offset for load of 32-bit arg in 64-bit world was incorrect.
llvm-svn: 32019
2006-11-29 13:37:09 +00:00
Evan Cheng
f968824cdb Custom lower READCYCLECOUNTER for x86-64.
llvm-svn: 32017
2006-11-29 08:28:13 +00:00
Chris Lattner
e72dff706e done
llvm-svn: 32013
2006-11-29 07:21:46 +00:00
Evan Cheng
52f30d0ff2 16-byte stack alignment for X86-64 ELF. Patch by Dan Gohman.
llvm-svn: 32004
2006-11-29 02:00:40 +00:00
Chris Lattner
4e07e4aa24 Upgrade the ugly darwin 64-bit bswap idiom (bswap %eax / bswap %edx /
xchgl %eax, %edx) to llvm.bswap.i64.  This compiles:

long long test2(long long A) {
  return _OSSwapInt64(A);
}

to:

_test2:
        movl 8(%esp), %eax
        movl 4(%esp), %edx
        bswapl %eax
        bswapl %edx
        ret

instead of:

_test2:
        movl 8(%esp), %edx
        movl 4(%esp), %eax
        bswap   %eax
        bswap   %edx
        xchgl   %eax, %edx
        ret

GCC manages (with -fomit-frame-pointer) the uglier:

_test2:
        subl    $4, %esp
        movl    8(%esp), %eax
        movl    12(%esp), %edx
        bswap   %eax
        bswap   %edx
        xchgl   %eax, %edx
        addl    $4, %esp
        ret

llvm-svn: 32001
2006-11-29 01:48:01 +00:00
Chris Lattner
50d2db3b77 Trivially lower 'bswap $0' into llvm.bswap. This fixes hexxagon with the
JIT on darwin/x86, which has htonl implemented as inline asm.

llvm-svn: 31999
2006-11-29 01:14:06 +00:00
Andrew Lenharth
e46a408fb9 gcc doesn't like an empty colbber list
llvm-svn: 31987
2006-11-28 23:07:32 +00:00
Andrew Lenharth
aee28a6544 Identities are default now
llvm-svn: 31980
2006-11-28 22:28:08 +00:00
Andrew Lenharth
a32f3e30b3 Make identity default, and fix PR1020
llvm-svn: 31979
2006-11-28 22:25:32 +00:00
Evan Cheng
27408161df New entries.
llvm-svn: 31976
2006-11-28 19:59:25 +00:00
Andrew Lenharth
7669b3acc5 update comments
llvm-svn: 31975
2006-11-28 19:56:02 +00:00
Andrew Lenharth
d93af28924 Get the asminfo for the target most closely matching the module and use that for inline asm
llvm-svn: 31974
2006-11-28 19:53:36 +00:00
Andrew Lenharth
c0ee1250ad X86 asm -> gcc asm translation table (incomplete)
llvm-svn: 31973
2006-11-28 19:52:49 +00:00
Andrew Lenharth
c51f451af5 Add per-target support for asm translation in the cbe
llvm-svn: 31972
2006-11-28 19:52:20 +00:00
Jim Laskey
7b0a74da3c Remove debug code.
llvm-svn: 31970
2006-11-28 18:27:02 +00:00
Jim Laskey
737f53b6aa Prime text sections to improve branch locality in large object files.
llvm-svn: 31969
2006-11-28 18:21:52 +00:00
Jim Laskey
a5c5ceb212 32-bit int space was not accounted for properly in lowerCall.
llvm-svn: 31966
2006-11-28 14:53:52 +00:00
Evan Cheng
62d19fbf98 Fix JIT encoding bugs for shift / rotate by one ops.
llvm-svn: 31952
2006-11-28 01:28:00 +00:00
Andrew Lenharth
f284b201e7 Preliminary support for inline asm in the cbe. The target specific ugliness
is still in Writer, but issolated to a single function. This might be split
into something in each target directory.  This is sufficient to get through
archie and an strcpy impl on linux-x86.

Module level asm is not handled.

llvm-svn: 31948
2006-11-27 23:50:49 +00:00
Evan Cheng
98fa7ab4d7 Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead
of opcode and number of operands.

llvm-svn: 31947
2006-11-27 23:37:22 +00:00
Reid Spencer
6010c0ef4a When truncating to bool, it is necessary to & with 1 for all casts that
can result in a bool. Previously PtrToInt, FPToUI and FPToSI were missing
this operation.

llvm-svn: 31938
2006-11-27 18:51:06 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Duraid Madina
02b497f15a fix storing bools to mem and unordered FP ops
llvm-svn: 31920
2006-11-26 04:34:26 +00:00
Reid Spencer
5ae73ed00d Add newline at end of file.
llvm-svn: 31902
2006-11-25 05:41:02 +00:00
Anton Korobeynikov
ddb73b4f1e Refactored *GVRequiresExtraLoad() to Subtarget method.
llvm-svn: 31887
2006-11-21 00:01:06 +00:00
Chris Lattner
ed9a2f6371 in ppc64-mode, don't allocate the 32-bit version of r13 either.
llvm-svn: 31884
2006-11-20 20:48:05 +00:00
Chris Lattner
ad5f088196 r13 is the thread pointer on darwin/ppc64, don't allocate it.
llvm-svn: 31882
2006-11-20 19:33:51 +00:00
Chris Lattner
86e39c84b6 Fix codegen for x86-64 on systems (like ppc or i386) that don't have 64-bit
features autodetected.  This fixes PR1010 and Regression/CodeGen/X86/xmm-r64.ll
on non-x86-64 hosts.

llvm-svn: 31879
2006-11-20 18:16:05 +00:00
Anton Korobeynikov
2449b29bdd We should perform extra load for dllimported calls
llvm-svn: 31874
2006-11-20 10:46:14 +00:00
Chris Lattner
eb9b1840b3 on ppc64, float arguments take 8-byte stack slots not 4-byte stack slots.
Also, valist should create a pointer RC reg class value, not a GPRC value.

llvm-svn: 31840
2006-11-18 01:57:19 +00:00
Chris Lattner
c4b759987a make sure to safe LR8 in the right stack slot for PPC64
llvm-svn: 31839
2006-11-18 01:34:43 +00:00
Chris Lattner
a55a2365bc Pretty print 'rldicr r2, r2, 2, 61' as 'sldi r2, r2, 2'.
llvm-svn: 31838
2006-11-18 01:23:56 +00:00
Chris Lattner
f50d87eb50 Rewrite the branch selector to be correct in the face of large functions.
The algorithm it used before wasn't 100% correct, we now use an iterative
expansion model.  This fixes assembler errors when compiling 403.gcc with
tail merging enabled.

Change the way the branch selector works overall: Now, the isel generates
PPC::BCC instructions (as it used to) directly, and these BCC instructions
are emitted to the output or jitted directly if branches don't need
expansion.  Only if branches need expansion are instructions rewritten
and created.  This should make branch select faster, and eliminates the
Bxx instructions from the .td file.

llvm-svn: 31837
2006-11-18 00:32:03 +00:00
Chris Lattner
a5439b7913 add encoding for BCC, after finally wrestling strange ppc/tblgen endianness
issues to the ground.

llvm-svn: 31836
2006-11-17 23:53:28 +00:00
Chris Lattner
0d88b19f2f convert PPC::BCC to use the 'pred' operand instead of separate predicate
value and CR reg #.  This requires swapping the order of these everywhere
that touches BCC and requires us to write custom matching logic for
PPCcondbranch :(

llvm-svn: 31835
2006-11-17 22:37:34 +00:00
Chris Lattner
73329ae80d rename PPC::COND_BRANCH to PPC::BCC
llvm-svn: 31834
2006-11-17 22:14:47 +00:00
Chris Lattner
1527483a15 start using PPC predicates more consistently.
llvm-svn: 31833
2006-11-17 22:10:59 +00:00
Evan Cheng
a9176b38f9 For unsigned 8-bit division. Use movzbw to set the lower 8 bits of AX while
clearing the upper 8-bits instead of issuing two instructions. This also
eliminates the need to target the AH register which can be problematic on
x86-64.

llvm-svn: 31832
2006-11-17 22:10:14 +00:00
Jim Laskey
bc27bd0c6e Hopefully a good crack at making debugging work on intel -disable-fp-elim.
llvm-svn: 31830
2006-11-17 21:19:15 +00:00
Jim Laskey
a1f032c03a Assert unhandled case.
llvm-svn: 31828
2006-11-17 18:49:39 +00:00
Jim Laskey
b56f73f709 1. Ignore the -disable-fp-elim when the routine is a leaf.
2. Offsets on 64-bit stores are still in bytes.

llvm-svn: 31824
2006-11-17 16:09:31 +00:00
Jim Laskey
e0ff7bdbd3 Typo. Fix the nightly tests.
llvm-svn: 31823
2006-11-17 14:06:41 +00:00
Bill Wendling
b6061e32fa Removed even more std::cerr and #include <iostream> things.
llvm-svn: 31813
2006-11-17 07:52:03 +00:00
Chris Lattner
81683aa08b implement a todo: change a map into a vector
llvm-svn: 31805
2006-11-17 01:52:23 +00:00
Chris Lattner
e4e113818f fix typo
llvm-svn: 31799
2006-11-17 00:49:36 +00:00
Chris Lattner
237ee79d06 implicit_def_vrrc doesn't generate code.
llvm-svn: 31797
2006-11-16 23:49:52 +00:00
Evan Cheng
fc1b3d8bc8 Correct instructions for moving data between GR64 and SSE registers; also correct load i64 / store i64 from v2i64.
llvm-svn: 31795
2006-11-16 23:33:25 +00:00
Evan Cheng
a838021d2c Fix a potential bug: MOVPDI2DI, etc. are not copy instructions.
llvm-svn: 31794
2006-11-16 23:22:26 +00:00
Jim Laskey
8aac7dc0ee This is a general clean up of the PowerPC ABI. Address several problems and
bugs including making sure that the TOS links back to the previous frame,
that the maximum call frame size is not included twice when using frame
pointers, no longer growing the frame on calls, double storing of SP and
a cleaner/faster dynamic alloca.

llvm-svn: 31792
2006-11-16 22:43:37 +00:00
Chris Lattner
5dcf43138d fix a regression that I introduced. stdu should scale the offset by 4
before printing it.

llvm-svn: 31791
2006-11-16 21:45:30 +00:00
Evan Cheng
c653e70b2d Align stubs on 4 byte boundary. This fixes 447.dealII.
llvm-svn: 31790
2006-11-16 20:13:34 +00:00
Chris Lattner
41280ae60d add a statistic
llvm-svn: 31785
2006-11-16 18:13:49 +00:00
Chris Lattner
283e7306c1 fix broken encoding
llvm-svn: 31778
2006-11-16 01:01:28 +00:00
Chris Lattner
99d9dd8d07 add ppc64 r+i stores with update.
llvm-svn: 31776
2006-11-16 00:57:19 +00:00
Chris Lattner
4edb6f09fe add patterns for ppc32 preinc stores. ppc64 next.
llvm-svn: 31775
2006-11-16 00:41:37 +00:00
Chris Lattner
c4b9cff1f9 switch these back to the 'bad old way'
llvm-svn: 31774
2006-11-16 00:33:34 +00:00
Chris Lattner
f505815dad Fix ppc64 epilog bug.
llvm-svn: 31771
2006-11-15 23:35:30 +00:00
Chris Lattner
bd95b9d4ae Stop using isTwoAddress, switching to operand constraints instead.
Tell the codegen emitter that specific operands are not to be encoded, fixing
JIT regressions w.r.t. pre-inc loads and stores (e.g. lwzu, which we generate
even when general preinc loads are not enabled).

llvm-svn: 31770
2006-11-15 23:24:18 +00:00
Chris Lattner
1158705ea7 add a new field needed by the code emitter generator.
llvm-svn: 31768
2006-11-15 22:55:04 +00:00
Evan Cheng
2a92afa25d Properly transfer kill / dead info.
llvm-svn: 31765
2006-11-15 20:58:11 +00:00
Evan Cheng
1b3bde1c1b Kill / dead info has been moved to MI's.
llvm-svn: 31764
2006-11-15 20:56:39 +00:00
Evan Cheng
4625504fa4 commuteInstruction should propagate kill / dead info.
llvm-svn: 31763
2006-11-15 20:56:03 +00:00