src/cpu/ppc/vm/vm_version_ppc.hpp

Thu, 04 Apr 2019 17:56:29 +0800

author
aoqi
date
Thu, 04 Apr 2019 17:56:29 +0800
changeset 9572
624a0741915c
parent 9497
f892c3b6b651
parent 8856
ac27a9c85bea
child 9703
2fdf635bcf28
permissions
-rw-r--r--

Merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * Copyright 2012, 2014 SAP AG. All rights reserved.
aoqi@0 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 5 *
aoqi@0 6 * This code is free software; you can redistribute it and/or modify it
aoqi@0 7 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 8 * published by the Free Software Foundation.
aoqi@0 9 *
aoqi@0 10 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 13 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 14 * accompanied this code).
aoqi@0 15 *
aoqi@0 16 * You should have received a copy of the GNU General Public License version
aoqi@0 17 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 19 *
aoqi@0 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 21 * or visit www.oracle.com if you need additional information or have any
aoqi@0 22 * questions.
aoqi@0 23 *
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 #ifndef CPU_PPC_VM_VM_VERSION_PPC_HPP
aoqi@0 27 #define CPU_PPC_VM_VM_VERSION_PPC_HPP
aoqi@0 28
aoqi@0 29 #include "runtime/globals_extension.hpp"
aoqi@0 30 #include "runtime/vm_version.hpp"
aoqi@0 31
aoqi@0 32 class VM_Version: public Abstract_VM_Version {
aoqi@0 33 protected:
aoqi@0 34 enum Feature_Flag {
aoqi@0 35 fsqrt,
aoqi@0 36 fsqrts,
aoqi@0 37 isel,
aoqi@0 38 lxarxeh,
aoqi@0 39 cmpb,
aoqi@0 40 popcntb,
aoqi@0 41 popcntw,
aoqi@0 42 fcfids,
aoqi@0 43 vand,
aoqi@0 44 dcba,
simonis@8608 45 vcipher,
mdoerr@9497 46 vpmsumb,
aoqi@0 47 num_features // last entry to count features
aoqi@0 48 };
aoqi@0 49 enum Feature_Flag_Set {
aoqi@0 50 unknown_m = 0,
aoqi@0 51 fsqrt_m = (1 << fsqrt ),
aoqi@0 52 fsqrts_m = (1 << fsqrts ),
aoqi@0 53 isel_m = (1 << isel ),
aoqi@0 54 lxarxeh_m = (1 << lxarxeh),
aoqi@0 55 cmpb_m = (1 << cmpb ),
aoqi@0 56 popcntb_m = (1 << popcntb),
aoqi@0 57 popcntw_m = (1 << popcntw),
aoqi@0 58 fcfids_m = (1 << fcfids ),
aoqi@0 59 vand_m = (1 << vand ),
aoqi@0 60 dcba_m = (1 << dcba ),
simonis@8608 61 vcipher_m = (1 << vcipher),
mdoerr@9497 62 vpmsumb_m = (1 << vpmsumb),
aoqi@0 63 all_features_m = -1
aoqi@0 64 };
aoqi@0 65 static int _features;
aoqi@0 66 static int _measured_cache_line_size;
aoqi@0 67 static const char* _features_str;
aoqi@0 68 static bool _is_determine_features_test_running;
aoqi@0 69
aoqi@0 70 static void print_features();
aoqi@0 71 static void determine_features(); // also measures cache line size
aoqi@0 72 static void determine_section_size();
aoqi@0 73 static void power6_micro_bench();
aoqi@0 74 public:
aoqi@0 75 // Initialization
aoqi@0 76 static void initialize();
aoqi@0 77
aoqi@0 78 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
aoqi@0 79 // CPU instruction support
aoqi@0 80 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
aoqi@0 81 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
aoqi@0 82 static bool has_isel() { return (_features & isel_m) != 0; }
aoqi@0 83 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
aoqi@0 84 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
aoqi@0 85 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
aoqi@0 86 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
aoqi@0 87 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
aoqi@0 88 static bool has_vand() { return (_features & vand_m) != 0; }
aoqi@0 89 static bool has_dcba() { return (_features & dcba_m) != 0; }
simonis@8608 90 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
mdoerr@9497 91 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
aoqi@0 92
aoqi@0 93 static const char* cpu_features() { return _features_str; }
aoqi@0 94
aoqi@0 95 static int get_cache_line_size() { return _measured_cache_line_size; }
aoqi@0 96
aoqi@0 97 // Assembler testing
aoqi@0 98 static void allow_all();
aoqi@0 99 static void revert();
aoqi@0 100 };
aoqi@0 101
aoqi@0 102 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP

mercurial