hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp
author simonis
Fri, 06 Sep 2013 20:16:09 +0200
changeset 22831 1e2ba1d62103
child 25918 79e4c4d9f5c9
permissions -rw-r--r--
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     1
/*
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     3
 * Copyright 2012, 2013 SAP AG. All rights reserved.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     5
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     8
 * published by the Free Software Foundation.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     9
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    14
 * accompanied this code).
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    15
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    19
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    22
 * questions.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    23
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    24
 */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    25
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    26
#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_XLC_HPP
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    27
#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_XLC_HPP
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    28
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    29
#include "prims/jni.h"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    30
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    31
// This file holds compiler-dependent includes,
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    32
// globally used constants & types, class (forward)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    33
// declarations and a few frequently used utility functions.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    34
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    35
#include <ctype.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    36
#include <string.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    37
#include <stdarg.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    38
#include <stddef.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    39
#include <stdio.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    40
#include <stdlib.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    41
#include <wchar.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    42
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    43
#include <math.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    44
#ifndef FP_PZERO
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    45
// Linux doesn't have positive/negative zero
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    46
#define FP_PZERO FP_ZERO
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    47
#endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    48
#if (!defined fpclass)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    49
#define fpclass fpclassify
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    50
#endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    51
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    52
#include <time.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    53
#include <fcntl.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    54
#include <dlfcn.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    55
#include <pthread.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    56
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    57
#include <limits.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    58
#include <errno.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    59
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    60
#include <stdint.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    61
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    62
// Use XLC compiler builtins instead of inline assembler
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    63
#define USE_XLC_BUILTINS
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    64
#ifdef USE_XLC_BUILTINS
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    65
#include <builtins.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    66
  #if __IBMCPP__ < 1000
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    67
  // the funtion prototype for __dcbtst(void *) is missing in XLC V8.0
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    68
  // I could compile a little test, where I provided the prototype.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    69
  // The generated code was correct there. This is the prototype:
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    70
  // extern "builtin" void __dcbtst (void *);
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    71
  // For now we don't make use of it when compiling with XLC V8.0
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    72
  #else
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    73
  // __IBMCPP__ >= 1000
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    74
  // XLC V10 provides the prototype for __dcbtst (void *);
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    75
  #define USE_XLC_PREFETCH_WRITE_BUILTIN
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    76
  #endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    77
#endif // USE_XLC_BUILTINS
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    78
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    79
// NULL vs NULL_WORD:
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    80
// On Linux NULL is defined as a special type '__null'. Assigning __null to
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    81
// integer variable will cause gcc warning. Use NULL_WORD in places where a
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    82
// pointer is stored as integer value.  On some platforms, sizeof(intptr_t) >
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    83
// sizeof(void*), so here we want something which is integer type, but has the
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    84
// same size as a pointer.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    85
#ifdef __GNUC__
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    86
  #error XLC and __GNUC__?
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    87
#else
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    88
  #define NULL_WORD  NULL
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    89
#endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    90
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    91
// AIX also needs a 64 bit NULL to work as a null address pointer.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    92
// Most system includes on AIX would define it as an int 0 if not already defined with one
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    93
// exception: /usr/include/dirent.h will unconditionally redefine NULL to int 0 again.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    94
// In this case you need to copy the following defines to a position after #include <dirent.h>
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    95
// (see jmv_aix.h).
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    96
#ifdef AIX
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    97
  #ifdef _LP64
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    98
    #undef NULL
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    99
    #define NULL 0L
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   100
  #else
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   101
    #ifndef NULL
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   102
      #define NULL 0
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   103
    #endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   104
  #endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   105
#endif // AIX
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   106
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   107
// Compiler-specific primitive types
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   108
// All defs of int (uint16_6 etc) are defined in AIX' /usr/include/stdint.h
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   109
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   110
// Additional Java basic types
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   111
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   112
typedef uint8_t  jubyte;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   113
typedef uint16_t jushort;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   114
typedef uint32_t juint;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   115
typedef uint64_t julong;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   116
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   117
//----------------------------------------------------------------------------------------------------
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   118
// Special (possibly not-portable) casts
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   119
// Cast floats into same-size integers and vice-versa w/o changing bit-pattern
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   120
// %%%%%% These seem like standard C++ to me--how about factoring them out? - Ungar
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   121
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   122
inline jint    jint_cast   (jfloat  x)           { return *(jint*   )&x; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   123
inline jlong   jlong_cast  (jdouble x)           { return *(jlong*  )&x; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   124
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   125
inline jfloat  jfloat_cast (jint    x)           { return *(jfloat* )&x; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   126
inline jdouble jdouble_cast(jlong   x)           { return *(jdouble*)&x; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   127
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   128
//----------------------------------------------------------------------------------------------------
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   129
// Constant for jlong (specifying an long long canstant is C++ compiler specific)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   130
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   131
// Build a 64bit integer constant
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   132
#define CONST64(x)  (x ## LL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   133
#define UCONST64(x) (x ## ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   134
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   135
const jlong min_jlong = CONST64(0x8000000000000000);
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   136
const jlong max_jlong = CONST64(0x7fffffffffffffff);
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   137
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   138
//----------------------------------------------------------------------------------------------------
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   139
// Debugging
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   140
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   141
#define DEBUG_EXCEPTION ::abort();
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   142
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   143
extern "C" void breakpoint();
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   144
#define BREAKPOINT ::breakpoint()
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   145
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   146
// checking for nanness
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   147
#ifdef AIX
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   148
inline int g_isnan(float  f) { return isnan(f); }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   149
inline int g_isnan(double f) { return isnan(f); }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   150
#else
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   151
#error "missing platform-specific definition here"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   152
#endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   153
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   154
// Checking for finiteness
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   155
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   156
inline int g_isfinite(jfloat  f)                 { return finite(f); }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   157
inline int g_isfinite(jdouble f)                 { return finite(f); }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   158
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   159
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   160
// Wide characters
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   161
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   162
inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   163
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   164
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   165
// Portability macros
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   166
#define PRAGMA_INTERFACE             #pragma interface
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   167
#define PRAGMA_IMPLEMENTATION        #pragma implementation
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   168
#define VALUE_OBJ_CLASS_SPEC
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   169
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   170
// Formatting.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   171
#ifdef _LP64
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   172
#define FORMAT64_MODIFIER "l"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   173
#else // !_LP64
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   174
#define FORMAT64_MODIFIER "ll"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   175
#endif // _LP64
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   176
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   177
// Cannot use xlc's offsetof as implementation of hotspot's
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   178
// offset_of(), because xlc warns about applying offsetof() to non-POD
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   179
// object and xlc cannot compile the expression offsetof(DataLayout,
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   180
// _cells[index]) in DataLayout::cell_offset() .  Therefore we define
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   181
// offset_of as it is defined for gcc.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   182
#define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   183
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   184
// Some constant sizes used throughout the AIX port
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   185
#define SIZE_1K   ((uint64_t)         0x400ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   186
#define SIZE_4K   ((uint64_t)        0x1000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   187
#define SIZE_64K  ((uint64_t)       0x10000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   188
#define SIZE_1M   ((uint64_t)      0x100000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   189
#define SIZE_4M   ((uint64_t)      0x400000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   190
#define SIZE_8M   ((uint64_t)      0x800000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   191
#define SIZE_16M  ((uint64_t)     0x1000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   192
#define SIZE_256M ((uint64_t)    0x10000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   193
#define SIZE_1G   ((uint64_t)    0x40000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   194
#define SIZE_2G   ((uint64_t)    0x80000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   195
#define SIZE_4G   ((uint64_t)   0x100000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   196
#define SIZE_16G  ((uint64_t)   0x400000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   197
#define SIZE_32G  ((uint64_t)   0x800000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   198
#define SIZE_64G  ((uint64_t)  0x1000000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   199
#define SIZE_1T   ((uint64_t) 0x10000000000ULL)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   200
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   201
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   202
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_XLC_HPP