src/cpu/ppc/vm/vm_version_ppc.hpp

Wed, 24 Apr 2019 11:48:37 -0400

author
gromero
date
Wed, 24 Apr 2019 11:48:37 -0400
changeset 9662
6eedcffa129d
parent 9497
f892c3b6b651
child 9703
2fdf635bcf28
child 9713
c4567d28f31f
permissions
-rw-r--r--

8154156: PPC64: improve array copy stubs by using vector instructions
Reviewed-by: goetz, mdoerr
Contributed-by: Kazunori Ogata <ogatak@jp.ibm.com>

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

mercurial