src/cpu/ppc/vm/vm_version_ppc.hpp

Thu, 22 Sep 2016 12:17:24 +0200

author
mdoerr
date
Thu, 22 Sep 2016 12:17:24 +0200
changeset 9497
f892c3b6b651
parent 8608
0d78aecb0948
child 9572
624a0741915c
child 9662
6eedcffa129d
permissions
-rw-r--r--

8164920: ppc: enhancement of CRC32 intrinsic
Reviewed-by: goetz, mdoerr
Contributed-by: Hiroshi H Horii <horii@jp.ibm.com>

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

mercurial