src/cpu/ppc/vm/vm_version_ppc.hpp

Wed, 27 Nov 2013 16:16:21 -0800

author
goetz
date
Wed, 27 Nov 2013 16:16:21 -0800
changeset 6490
41b780b43b74
parent 6458
ec28f9c041ff
child 6515
71a71b0bc844
permissions
-rw-r--r--

8029015: PPC64 (part 216): opto: trap based null and range checks
Summary: On PPC64 use tdi instruction that does a compare and raises SIGTRAP for NULL and range checks.
Reviewed-by: kvn

goetz@6458 1 /*
goetz@6458 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
goetz@6458 3 * Copyright 2012, 2013 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@6458 36 isel,
goetz@6458 37 lxarxeh,
goetz@6458 38 cmpb,
goetz@6458 39 popcntb,
goetz@6458 40 popcntw,
goetz@6458 41 fcfids,
goetz@6458 42 vand,
goetz@6458 43 dcba,
goetz@6458 44 num_features // last entry to count features
goetz@6458 45 };
goetz@6458 46 enum Feature_Flag_Set {
goetz@6458 47 unknown_m = 0,
goetz@6458 48 fsqrt_m = (1 << fsqrt ),
goetz@6458 49 isel_m = (1 << isel ),
goetz@6458 50 lxarxeh_m = (1 << lxarxeh),
goetz@6458 51 cmpb_m = (1 << cmpb ),
goetz@6458 52 popcntb_m = (1 << popcntb),
goetz@6458 53 popcntw_m = (1 << popcntw),
goetz@6458 54 fcfids_m = (1 << fcfids ),
goetz@6458 55 vand_m = (1 << vand ),
goetz@6458 56 dcba_m = (1 << dcba ),
goetz@6458 57 all_features_m = -1
goetz@6458 58 };
goetz@6458 59 static int _features;
goetz@6458 60 static int _measured_cache_line_size;
goetz@6458 61 static const char* _features_str;
goetz@6458 62 static bool _is_determine_features_test_running;
goetz@6458 63
goetz@6458 64 static void print_features();
goetz@6458 65 static void determine_features(); // also measures cache line size
goetz@6458 66 static void determine_section_size();
goetz@6458 67 static void power6_micro_bench();
goetz@6458 68 public:
goetz@6458 69 // Initialization
goetz@6458 70 static void initialize();
goetz@6458 71
goetz@6458 72 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
goetz@6458 73 // CPU instruction support
goetz@6458 74 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
goetz@6458 75 static bool has_isel() { return (_features & isel_m) != 0; }
goetz@6458 76 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
goetz@6458 77 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
goetz@6458 78 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
goetz@6458 79 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
goetz@6458 80 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
goetz@6458 81 static bool has_vand() { return (_features & vand_m) != 0; }
goetz@6458 82 static bool has_dcba() { return (_features & dcba_m) != 0; }
goetz@6458 83
goetz@6458 84 static const char* cpu_features() { return _features_str; }
goetz@6458 85
goetz@6458 86 static int get_cache_line_size() { return _measured_cache_line_size; }
goetz@6458 87
goetz@6458 88 // Assembler testing
goetz@6458 89 static void allow_all();
goetz@6458 90 static void revert();
goetz@6458 91 };
goetz@6458 92
goetz@6458 93 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP

mercurial