1 /*
   2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package jdk.vm.ci.hotspot.sparc;
  24 
  25 import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
  26 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
  27 
  28 /**
  29  * Used to access native configuration details.
  30  *
  31  * All non-static, public fields in this class are so that they can be compiled as constants.
  32  */
  33 class SPARCHotSpotVMConfig extends HotSpotVMConfigAccess {
  34 
  35     SPARCHotSpotVMConfig(HotSpotVMConfigStore config) {
  36         super(config);
  37     }
  38 
  39     final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
  40 
  41     // @formatter:off
  42     // CPU capabilities:
  43     //
  44     // FIXME: Using a 64-bit value is insufficient to support future capability
  45     //        sets (including co-processor capabilities such as DAX).
  46     final long vmVersionFeatures = getFieldValue("Abstract_VM_Version::_features", Long.class, "uint64_t");
  47 
  48     //
  49     // SPARC specific values:
  50     //
  51     // NOTE: Values changed into an enumeration (that do indeed fit within a
  52     //       32-bit integer) instead of the exported (64-bit wide) bit-masks.
  53     final int sparc_ADI      = getConstant("VM_Version::ISA_ADI",      Integer.class);
  54     final int sparc_AES      = getConstant("VM_Version::ISA_AES",      Integer.class);
  55     final int sparc_BLK_INIT = getConstant("VM_Version::ISA_BLK_INIT", Integer.class);
  56     final int sparc_CAMELLIA = getConstant("VM_Version::ISA_CAMELLIA", Integer.class);
  57     final int sparc_CBCOND   = getConstant("VM_Version::ISA_CBCOND",   Integer.class);
  58     final int sparc_CRC32C   = getConstant("VM_Version::ISA_CRC32C",   Integer.class);
  59     final int sparc_DES      = getConstant("VM_Version::ISA_DES",      Integer.class);
  60     final int sparc_DICTUNP  = getConstant("VM_Version::ISA_DICTUNP",  Integer.class);
  61     final int sparc_FMAF     = getConstant("VM_Version::ISA_FMAF",     Integer.class);
  62     final int sparc_FPCMPSHL = getConstant("VM_Version::ISA_FPCMPSHL", Integer.class);
  63     final int sparc_HPC      = getConstant("VM_Version::ISA_HPC",      Integer.class);
  64     final int sparc_IMA      = getConstant("VM_Version::ISA_IMA",      Integer.class);
  65     final int sparc_KASUMI   = getConstant("VM_Version::ISA_KASUMI",   Integer.class);
  66     final int sparc_MD5      = getConstant("VM_Version::ISA_MD5",      Integer.class);
  67     final int sparc_MME      = getConstant("VM_Version::ISA_MME",      Integer.class);
  68     final int sparc_MONT     = getConstant("VM_Version::ISA_MONT",     Integer.class);
  69     final int sparc_MPMUL    = getConstant("VM_Version::ISA_MPMUL",    Integer.class);
  70     final int sparc_MWAIT    = getConstant("VM_Version::ISA_MWAIT",    Integer.class);
  71     final int sparc_PAUSE    = getConstant("VM_Version::ISA_PAUSE",    Integer.class);
  72     final int sparc_PAUSE_NSEC = getConstant("VM_Version::ISA_PAUSE_NSEC", Integer.class);
  73     final int sparc_POPC     = getConstant("VM_Version::ISA_POPC",     Integer.class);
  74     final int sparc_RLE      = getConstant("VM_Version::ISA_RLE",      Integer.class);
  75     final int sparc_SHA1     = getConstant("VM_Version::ISA_SHA1",     Integer.class);
  76     final int sparc_SHA256   = getConstant("VM_Version::ISA_SHA256",   Integer.class);
  77     final int sparc_SHA3     = getConstant("VM_Version::ISA_SHA3",     Integer.class);
  78     final int sparc_SHA512   = getConstant("VM_Version::ISA_SHA512",   Integer.class);
  79     final int sparc_SPARC5   = getConstant("VM_Version::ISA_SPARC5",   Integer.class);
  80     final int sparc_SPARC5B  = getConstant("VM_Version::ISA_SPARC5B",  Integer.class);
  81     final int sparc_SPARC6   = getConstant("VM_Version::ISA_SPARC6",   Integer.class);
  82     final int sparc_V9       = getConstant("VM_Version::ISA_V9",       Integer.class);
  83     final int sparc_VAMASK   = getConstant("VM_Version::ISA_VAMASK",   Integer.class);
  84     final int sparc_VIS1     = getConstant("VM_Version::ISA_VIS1",     Integer.class);
  85     final int sparc_VIS2     = getConstant("VM_Version::ISA_VIS2",     Integer.class);
  86     final int sparc_VIS3     = getConstant("VM_Version::ISA_VIS3",     Integer.class);
  87     final int sparc_VIS3B    = getConstant("VM_Version::ISA_VIS3B",    Integer.class);
  88     final int sparc_VIS3C    = getConstant("VM_Version::ISA_VIS3C",    Integer.class);
  89     final int sparc_XMONT    = getConstant("VM_Version::ISA_XMONT",    Integer.class);
  90     final int sparc_XMPMUL   = getConstant("VM_Version::ISA_XMPMUL",   Integer.class);
  91 
  92     final int sparc_BLK_ZEROING = getConstant("VM_Version::CPU_BLK_ZEROING", Integer.class);
  93     final int sparc_FAST_BIS    = getConstant("VM_Version::CPU_FAST_BIS",    Integer.class);
  94     final int sparc_FAST_CMOVE  = getConstant("VM_Version::CPU_FAST_CMOVE",  Integer.class);
  95     final int sparc_FAST_IDIV   = getConstant("VM_Version::CPU_FAST_IDIV",   Integer.class);
  96     final int sparc_FAST_IND_BR = getConstant("VM_Version::CPU_FAST_IND_BR", Integer.class);
  97     final int sparc_FAST_LD     = getConstant("VM_Version::CPU_FAST_LD",     Integer.class);
  98     final int sparc_FAST_RDPC   = getConstant("VM_Version::CPU_FAST_RDPC",   Integer.class);
  99 
 100     final boolean useBlockZeroing = getFlag("UseBlockZeroing", Boolean.class);
 101     final int blockZeroingLowLimit = getFlag("BlockZeroingLowLimit", Integer.class);
 102     // @formatter:on
 103 }