1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

62 Commits

Author SHA1 Message Date
Bill Schmidt
f400d5844e [PowerPC] Add comment explaining preprocessor directive.
llvm-svn: 187320
2013-07-28 03:23:32 +00:00
Bill Schmidt
795f27eb7f Revert 187318
llvm-svn: 187319
2013-07-28 02:13:24 +00:00
Bill Schmidt
0c824086d1 [PowerPC] Remove unnecessary preprocessor checking.
The tests !defined(__ppc__) && !defined(__powerpc__) are not needed
or helpful when verifying that code is being compiled for a 64-bit
target.  The simpler test provided by this revision is sufficient to
tell if the target is 64-bit.

llvm-svn: 187318
2013-07-28 02:08:13 +00:00
Rafael Espindola
326babb234 Revert "[PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc."
This reverts commit r187248. It broke many bots.

llvm-svn: 187254
2013-07-26 22:13:57 +00:00
Bill Schmidt
149eda1b1e [PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc.
Both GCC and LLVM will implicitly define __ppc__ and __powerpc__ for
all PowerPC targets, whether 32- or 64-bit.  They will both implicitly
define __ppc64__ and __powerpc64__ for 64-bit PowerPC targets, and not
for 32-bit targets.  We cannot be sure that all other possible
compilers used to compile Clang/LLVM define both __ppc__ and
__powerpc__, for example, so it is best to check for both when relying
on either inside the Clang/LLVM code base.

This patch makes sure we always check for both variants.  In addition,
it fixes one unnecessary check in lib/Target/PowerPC/PPCJITInfo.cpp.
(At least one of __ppc__ and __powerpc__ should always be defined when
compiling for a PowerPC target, no matter which compiler is used, so
testing for them is unnecessary.)

There are some places in the compiler that check for other variants,
like __POWERPC__ and _POWER, and I have left those in place.  There is
no need to add them elsewhere.  This seems to be in Apple-specific
code, and I won't take a chance on breaking it.

There is no intended change in behavior; thus, no test cases are
added.

llvm-svn: 187248
2013-07-26 21:39:15 +00:00
David Fang
e8ec195aa6 allow tests to run on powerpc-darwin8 again, checking for __ppc__
llvm-svn: 187027
2013-07-24 07:52:16 +00:00
NAKAMURA Takumi
c21b0543b6 PPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.
g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

llvm-svn: 186396
2013-07-16 09:59:51 +00:00
Joerg Sonnenberger
cf53a1cf64 Reduce large list of macros to the primary platform macros. Distingiush
between ELF (Linux, FreeBSD, NetBSD) and OSX as platform for the
assembler dialect.

llvm-svn: 186252
2013-07-13 17:59:55 +00:00
Benjamin Kramer
5e957f2bca Make the visibility of LLVMPPCCompilationCallback work with GCC.
GCC warns about the attribute being ignored if it occurs after void*.
There seems to be some kind of incompatibility between clang and gcc here, but
I can't fathom who's right.

void* LLVM_LIBRARY_VISIBILITY foo(); // clang: hidden, gcc: default
LLVM_LIBRARY_VISIBILITY void *bar(); // clang: hidden, gcc: hidden
void LLVM_LIBRARY_VISIBILITY qux();  // clang: hidden, gcc: hidden

llvm-svn: 175394
2013-02-17 14:30:32 +00:00
Rafael Espindola
64454b7056 Give these callbacks hidden visibility. It is better to not export them more
than we need to and some ELF linkers complain about directly accessing symbols
with default visibility.

llvm-svn: 175268
2013-02-15 14:15:59 +00:00
Rafael Espindola
50b6c2a0e2 Don't make assumptions about the mangling of static functions in extern "C"
blocks. We still don't have consensus if we should try to change clang or
the standard, but llvm should work with compilers that implement the current
standard and mangle those functions.

llvm-svn: 175267
2013-02-15 14:08:43 +00:00
Rafael Espindola
11ec830693 Revert r175120 and r175121. Clang is producing the expected asm names again.
llvm-svn: 175133
2013-02-14 03:33:34 +00:00
Rafael Espindola
cd4cd16ea7 Don't asume that a static function in an extern "C" block will not be mangled.
Since functions with internal linkage don't have language linkage, it is valid
to overload them:

extern "C" {
       static int foo();
       static int foo(int);
}

So we mangle them.

llvm-svn: 175120
2013-02-14 01:58:08 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth
a490793037 Use the new script to sort the includes of every file under lib.
Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

llvm-svn: 169131
2012-12-03 16:50:05 +00:00
Roman Divacky
6c6b0716b9 Mark .opd @progbits, thus avoiding a warning from asm.
llvm-svn: 156494
2012-05-09 18:24:23 +00:00
Anton Korobeynikov
e70c37c738 Make PPCCompilationCallbackC function to be static, so there will be no need to issue call via
PLT when LLVM is built as shared library. This mimics the X86 backend towards the approach.

llvm-svn: 153938
2012-04-03 06:59:28 +00:00
Roman Divacky
8e45ba75fc Make PPC64CompilationCallback compilable no non-darwin platforms.
Patch by Nathan Whitehorn!

llvm-svn: 133059
2011-06-15 15:29:47 +00:00
Michael J. Spencer
4a63404543 I swear I did a make clean and make before committing all this...
llvm-svn: 120304
2010-11-29 18:47:54 +00:00
Jeffrey Yasskin
7a710b57f5 Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes
JITTest.FunctionIsRecompiledAndRelinked.)

llvm-svn: 93475
2010-01-14 23:15:26 +00:00
Jeffrey Yasskin
d50951dc1e Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.

llvm-svn: 91464
2009-12-15 22:42:46 +00:00
Jeffrey Yasskin
0a0b21f8c5 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.

llvm-svn: 89715
2009-11-23 23:35:19 +00:00
Jeffrey Yasskin
ed6d1ce9ae Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.

llvm-svn: 89708
2009-11-23 22:49:00 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Torok Edwin
358888da3a Implement changes from Chris's feedback.
Finish converting lib/Target.

llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Tilmann Scheller
8166687389 Refactor ABI code in the PowerPC backend.
Make CalculateParameterAndLinkageAreaSize() Darwin-specific.
Remove SVR4 specific code from LowerCALL_Darwin() and LowerFORMAL_ARGUMENTS_Darwin().
Rename MachoABI to DarwinABI for consistency.
Rename ELF ABI to SVR4 ABI for consistency.
Factor out common call return lowering between the Darwin and SVR4 ABI.
Factor out common call lowering between the Darwin and SVR4 ABI.

llvm-svn: 74766
2009-07-03 06:47:08 +00:00
Bruno Cardoso Lopes
4da7e7af43 First patch in the direction of splitting MachineCodeEmitter in two subclasses:
JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray

llvm-svn: 72631
2009-05-30 20:51:52 +00:00
Evan Cheng
3d9c134136 Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ptr.
llvm-svn: 58897
2008-11-08 08:02:53 +00:00
Dan Gohman
90f776986d Trim #includes.
llvm-svn: 57649
2008-10-16 20:18:31 +00:00
Chris Lattner
ef1aa7c9db Switch the PPC backend and target-independent JIT to use the libsystem
InvalidateInstructionCache method instead of calling through
a hook on the JIT.  This is a host feature, not a target feature.

llvm-svn: 52734
2008-06-25 17:18:44 +00:00
Anton Korobeynikov
6a779ad6fa Add one more 'magic' define :)
llvm-svn: 52420
2008-06-17 17:57:43 +00:00
Anton Korobeynikov
cdfbb1eae5 Unbreak non-PPC builds
llvm-svn: 52419
2008-06-17 17:38:31 +00:00
Anton Korobeynikov
5b04f6d658 Provide generic hooks for icache invalidation. Add PPC implementation.
Patch by Gary Benson!

llvm-svn: 52418
2008-06-17 17:30:05 +00:00
Chris Lattner
ddfa0590ae Add support for icache invalidation on non-darwin ppc systems.
Patch by Gary Benson!

llvm-svn: 52332
2008-06-16 17:04:06 +00:00
Chris Lattner
a9c89da681 Add FreeBSD/PPC support, patch by Marcel Moolenaar!
llvm-svn: 51538
2008-05-24 04:58:48 +00:00
Nicolas Geoffray
1f3211af01 Correlate stubs with functions in JIT: when emitting a stub, the JIT tells the memory manager which function
the stub will resolve.

llvm-svn: 49814
2008-04-16 20:46:05 +00:00
Chris Lattner
00ead854ef JITEmitter.cpp was trying to sync the icache for function stubs, but
was actually passing a completely incorrect size to sys_icache_invalidate.
Instead of having the JITEmitter do this (which doesn't have the correct 
size), just make the target sync its own stubs.

llvm-svn: 46354
2008-01-25 16:41:09 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Nicolas Geoffray
fff14eecb5 Implementation of compilation callback in PPC ELF32
llvm-svn: 37340
2007-05-29 16:33:18 +00:00
Chris Lattner
42cfb7c452 Improve JIT support for linux/ppc: Patch by Nicolas Geoffray!
llvm-svn: 34572
2007-02-25 05:04:13 +00:00
Jim Laskey
911ae665d0 Layout proper frame for ppc64.
llvm-svn: 32436
2006-12-11 18:10:54 +00:00
Jim Laskey
3fa703d088 Reverting until finding the cause of secondary bugs.
llvm-svn: 32413
2006-12-10 13:09:42 +00:00
Jim Laskey
a8f4c1d137 __PPC64CompilationCallback code was allowing registers to be clobbered by stub.
llvm-svn: 32412
2006-12-10 12:13:31 +00:00
Chris Lattner
5d79e6ff6c this is an initial patch to switch the ppc64 jit over to working in PIC mode,
which allows the code to be above the 2G marker.  We still need to JIT emit
dyld stubs to support external, weak, common, etc globals, but that will
happen tomorrow.

llvm-svn: 32348
2006-12-08 04:54:03 +00:00
Chris Lattner
ce8d432068 fix incorrect encoding of rldicr, used by ppc64 function stubs, etc.
llvm-svn: 32341
2006-12-07 23:44:07 +00:00
Bill Wendling
f13d78d3b8 What should be the last unnecessary <iostream>s in the library.
llvm-svn: 32333
2006-12-07 22:21:48 +00:00
Chris Lattner
b3b7cf3be6 wrap long lines
llvm-svn: 30662
2006-09-28 23:32:43 +00:00
Nate Begeman
2dfa13e74f First pass at supporting relocations. Relocations are written correctly to
the file now, however the relocated address is currently wrong.  Fixing
that will require some deep pondering.

llvm-svn: 30207
2006-09-08 22:42:09 +00:00
Nate Begeman
a67a1ec1cd Make ppc64 jit kinda work right. About 2/3 of Olden passes with this,
there are clearly some encoding bugs lurking in there somewhere.

llvm-svn: 29949
2006-08-29 02:30:59 +00:00