8016491: PPC64 (part 2): Clean up PPC defines.
authorgoetz
Wed, 19 Jun 2013 12:29:30 +0200
changeset 22806 7d1955769e90
parent 22805 81f8eafc5a3a
child 22807 1cf02ef734e2
8016491: PPC64 (part 2): Clean up PPC defines. Summary: 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
hotspot/make/linux/platform_ppc
hotspot/src/os/bsd/vm/os_bsd.cpp
hotspot/src/os/linux/vm/os_linux.cpp
hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp
hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
hotspot/src/share/vm/runtime/frame.cpp
hotspot/src/share/vm/runtime/frame.hpp
hotspot/src/share/vm/runtime/sharedRuntime.cpp
hotspot/src/share/vm/runtime/sharedRuntime.hpp
hotspot/src/share/vm/runtime/vm_version.cpp
hotspot/src/share/vm/utilities/macros.hpp
--- a/hotspot/make/linux/platform_ppc	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/make/linux/platform_ppc	Wed Jun 19 12:29:30 2013 +0200
@@ -14,4 +14,4 @@
 
 gnu_dis_arch = ppc
 
-sysdefs = -DLINUX -D_GNU_SOURCE -DPPC
+sysdefs = -DLINUX -D_GNU_SOURCE -DPPC32
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jun 19 12:29:30 2013 +0200
@@ -205,7 +205,7 @@
 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
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jun 19 12:29:30 2013 +0200
@@ -247,7 +247,7 @@
 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
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp	Wed Jun 19 12:29:30 2013 +0200
@@ -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"
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed Jun 19 12:29:30 2013 +0200
@@ -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"
--- a/hotspot/src/share/vm/runtime/frame.cpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Wed Jun 19 12:29:30 2013 +0200
@@ -918,7 +918,7 @@
     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 @@
     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();
 
--- a/hotspot/src/share/vm/runtime/frame.hpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Wed Jun 19 12:29:30 2013 +0200
@@ -346,7 +346,7 @@
   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
 
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 19 12:29:30 2013 +0200
@@ -406,7 +406,7 @@
 
 #endif
 
-#if defined(__SOFTFP__) || defined(PPC)
+#if defined(__SOFTFP__) || defined(PPC32)
 double SharedRuntime::dsqrt(double f) {
   return sqrt(f);
 }
--- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp	Wed Jun 19 12:29:30 2013 +0200
@@ -140,7 +140,7 @@
   static double dabs(double f);
 #endif
 
-#if defined(__SOFTFP__) || defined(PPC)
+#if defined(__SOFTFP__) || defined(PPC32)
   static double dsqrt(double f);
 #endif
 
--- a/hotspot/src/share/vm/runtime/vm_version.cpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp	Wed Jun 19 12:29:30 2013 +0200
@@ -186,7 +186,7 @@
                  IA64_ONLY("ia64")               \
                  AMD64_ONLY("amd64")             \
                  ARM_ONLY("arm")                 \
-                 PPC_ONLY("ppc")                 \
+                 PPC32_ONLY("ppc")               \
                  SPARC_ONLY("sparc")
 #endif // ZERO
 
@@ -248,7 +248,7 @@
       #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 ""
--- a/hotspot/src/share/vm/utilities/macros.hpp	Wed Jun 19 12:15:50 2013 +0200
+++ b/hotspot/src/share/vm/utilities/macros.hpp	Wed Jun 19 12:29:30 2013 +0200
@@ -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)