8016491: PPC64 (part 2): Clean up PPC defines

Distinguish PPC, PPC64 and PPC32. PPC should guard code needed on any PPC system. PPC32 and PPC64 should guard code needed in a port for the ppc64 or ppc32 instruction set.

Reviewed-by: kvn
This commit is contained in:
Goetz Lindenmaier 2013-06-19 12:29:30 +02:00
parent 5ecd1c9655
commit 036382cefd
11 changed files with 34 additions and 14 deletions

View File

@ -14,4 +14,4 @@ compiler = gcc
gnu_dis_arch = ppc
sysdefs = -DLINUX -D_GNU_SOURCE -DPPC
sysdefs = -DLINUX -D_GNU_SOURCE -DPPC32

View File

@ -205,7 +205,7 @@ static char cpu_arch[] = "i386";
static char cpu_arch[] = "amd64";
#elif defined(ARM)
static char cpu_arch[] = "arm";
#elif defined(PPC)
#elif defined(PPC32)
static char cpu_arch[] = "ppc";
#elif defined(SPARC)
# ifdef _LP64

View File

@ -247,7 +247,7 @@ static char cpu_arch[] = "i386";
static char cpu_arch[] = "amd64";
#elif defined(ARM)
static char cpu_arch[] = "arm";
#elif defined(PPC)
#elif defined(PPC32)
static char cpu_arch[] = "ppc";
#elif defined(SPARC)
# ifdef _LP64

View File

@ -36,7 +36,7 @@
// Atomically copy 64 bits of data
static void atomic_copy64(volatile void *src, volatile void *dst) {
#if defined(PPC) && !defined(_LP64)
#if defined(PPC32)
double tmp;
asm volatile ("lfd %0, 0(%1)\n"
"stfd %0, 0(%2)\n"

View File

@ -36,7 +36,7 @@
// Atomically copy 64 bits of data
static void atomic_copy64(volatile void *src, volatile void *dst) {
#if defined(PPC) && !defined(_LP64)
#if defined(PPC32)
double tmp;
asm volatile ("lfd %0, 0(%1)\n"
"stfd %0, 0(%2)\n"

View File

@ -918,7 +918,7 @@ void frame::oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f,
cld_f->do_cld(m->method_holder()->class_loader_data());
}
#if !defined(PPC) || defined(ZERO)
#if !defined(PPC32) || defined(ZERO)
if (m->is_native()) {
#ifdef CC_INTERP
interpreterState istate = get_interpreterState();
@ -927,11 +927,11 @@ void frame::oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f,
f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
#endif /* CC_INTERP */
}
#else // PPC
#else // PPC32
if (m->is_native() && m->is_static()) {
f->do_oop(interpreter_frame_mirror_addr());
}
#endif // PPC
#endif // PPC32
int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();

View File

@ -346,7 +346,7 @@ class frame VALUE_OBJ_CLASS_SPEC {
void interpreter_frame_set_method(Method* method);
Method** interpreter_frame_method_addr() const;
ConstantPoolCache** interpreter_frame_cache_addr() const;
#ifdef PPC
#ifdef PPC32
oop* interpreter_frame_mirror_addr() const;
#endif

View File

@ -406,7 +406,7 @@ double SharedRuntime::dabs(double f) {
#endif
#if defined(__SOFTFP__) || defined(PPC)
#if defined(__SOFTFP__) || defined(PPC32)
double SharedRuntime::dsqrt(double f) {
return sqrt(f);
}

View File

@ -140,7 +140,7 @@ class SharedRuntime: AllStatic {
static double dabs(double f);
#endif
#if defined(__SOFTFP__) || defined(PPC)
#if defined(__SOFTFP__) || defined(PPC32)
static double dsqrt(double f);
#endif

View File

@ -186,7 +186,7 @@ const char* Abstract_VM_Version::jre_release_version() {
IA64_ONLY("ia64") \
AMD64_ONLY("amd64") \
ARM_ONLY("arm") \
PPC_ONLY("ppc") \
PPC32_ONLY("ppc") \
SPARC_ONLY("sparc")
#endif // ZERO
@ -248,7 +248,7 @@ const char* Abstract_VM_Version::internal_vm_info_string() {
#define FLOAT_ARCH_STR "-e500v2"
#elif defined(ARM)
#define FLOAT_ARCH_STR "-vfp"
#elif defined(PPC)
#elif defined(PPC32)
#define FLOAT_ARCH_STR "-hflt"
#else
#define FLOAT_ARCH_STR ""

View File

@ -340,14 +340,34 @@
#define NOT_SPARC(code) code
#endif
#ifdef PPC
#if defined(PPC32) || defined(PPC64)
#ifndef PPC
#define PPC
#endif
#define PPC_ONLY(code) code
#define NOT_PPC(code)
#else
#undef PPC
#define PPC_ONLY(code)
#define NOT_PPC(code) code
#endif
#ifdef PPC32
#define PPC32_ONLY(code) code
#define NOT_PPC32(code)
#else
#define PPC32_ONLY(code)
#define NOT_PPC32(code) code
#endif
#ifdef PPC64
#define PPC64_ONLY(code) code
#define NOT_PPC64(code)
#else
#define PPC64_ONLY(code)
#define NOT_PPC64(code) code
#endif
#ifdef E500V2
#define E500V2_ONLY(code) code
#define NOT_E500V2(code)