src/cpu/ppc/vm/vm_version_ppc.hpp

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.hpp	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,96 @@
     1.4 +/*
     1.5 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright 2012, 2014 SAP AG. All rights reserved.
     1.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 + *
     1.9 + * This code is free software; you can redistribute it and/or modify it
    1.10 + * under the terms of the GNU General Public License version 2 only, as
    1.11 + * published by the Free Software Foundation.
    1.12 + *
    1.13 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.15 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.16 + * version 2 for more details (a copy is included in the LICENSE file that
    1.17 + * accompanied this code).
    1.18 + *
    1.19 + * You should have received a copy of the GNU General Public License version
    1.20 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.22 + *
    1.23 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.24 + * or visit www.oracle.com if you need additional information or have any
    1.25 + * questions.
    1.26 + *
    1.27 + */
    1.28 +
    1.29 +#ifndef CPU_PPC_VM_VM_VERSION_PPC_HPP
    1.30 +#define CPU_PPC_VM_VM_VERSION_PPC_HPP
    1.31 +
    1.32 +#include "runtime/globals_extension.hpp"
    1.33 +#include "runtime/vm_version.hpp"
    1.34 +
    1.35 +class VM_Version: public Abstract_VM_Version {
    1.36 +protected:
    1.37 +  enum Feature_Flag {
    1.38 +    fsqrt,
    1.39 +    fsqrts,
    1.40 +    isel,
    1.41 +    lxarxeh,
    1.42 +    cmpb,
    1.43 +    popcntb,
    1.44 +    popcntw,
    1.45 +    fcfids,
    1.46 +    vand,
    1.47 +    dcba,
    1.48 +    num_features // last entry to count features
    1.49 +  };
    1.50 +  enum Feature_Flag_Set {
    1.51 +    unknown_m             = 0,
    1.52 +    fsqrt_m               = (1 << fsqrt  ),
    1.53 +    fsqrts_m              = (1 << fsqrts ),
    1.54 +    isel_m                = (1 << isel   ),
    1.55 +    lxarxeh_m             = (1 << lxarxeh),
    1.56 +    cmpb_m                = (1 << cmpb   ),
    1.57 +    popcntb_m             = (1 << popcntb),
    1.58 +    popcntw_m             = (1 << popcntw),
    1.59 +    fcfids_m              = (1 << fcfids ),
    1.60 +    vand_m                = (1 << vand   ),
    1.61 +    dcba_m                = (1 << dcba   ),
    1.62 +    all_features_m        = -1
    1.63 +  };
    1.64 +  static int  _features;
    1.65 +  static int  _measured_cache_line_size;
    1.66 +  static const char* _features_str;
    1.67 +  static bool _is_determine_features_test_running;
    1.68 +
    1.69 +  static void print_features();
    1.70 +  static void determine_features(); // also measures cache line size
    1.71 +  static void determine_section_size();
    1.72 +  static void power6_micro_bench();
    1.73 +public:
    1.74 +  // Initialization
    1.75 +  static void initialize();
    1.76 +
    1.77 +  static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
    1.78 +  // CPU instruction support
    1.79 +  static bool has_fsqrt()   { return (_features & fsqrt_m) != 0; }
    1.80 +  static bool has_fsqrts()  { return (_features & fsqrts_m) != 0; }
    1.81 +  static bool has_isel()    { return (_features & isel_m) != 0; }
    1.82 +  static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
    1.83 +  static bool has_cmpb()    { return (_features & cmpb_m) != 0; }
    1.84 +  static bool has_popcntb() { return (_features & popcntb_m) != 0; }
    1.85 +  static bool has_popcntw() { return (_features & popcntw_m) != 0; }
    1.86 +  static bool has_fcfids()  { return (_features & fcfids_m) != 0; }
    1.87 +  static bool has_vand()    { return (_features & vand_m) != 0; }
    1.88 +  static bool has_dcba()    { return (_features & dcba_m) != 0; }
    1.89 +
    1.90 +  static const char* cpu_features() { return _features_str; }
    1.91 +
    1.92 +  static int get_cache_line_size()  { return _measured_cache_line_size; }
    1.93 +
    1.94 +  // Assembler testing
    1.95 +  static void allow_all();
    1.96 +  static void revert();
    1.97 +};
    1.98 +
    1.99 +#endif // CPU_PPC_VM_VM_VERSION_PPC_HPP

mercurial