hotspot/src/cpu/x86/vm/c2_init_x86.cpp
author lana
Sat, 25 Mar 2017 01:44:22 +0000
changeset 44469 900705f4b1f3
parent 34162 16b54851eaf6
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "opto/compile.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "opto/node.hpp"
30624
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    28
#include "opto/optoreg.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// processor dependent initialization for i486
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
void Compile::pd_compiler2_init() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  // QQQ presumably all 64bit cpu's support this. Seems like the ifdef could
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  // simply be left out.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
#ifndef AMD64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  if (!VM_Version::supports_cmov()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    ConditionalMoveLimit = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
#endif // AMD64
30624
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    41
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    42
  if (UseAVX < 3) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    43
    int delta = XMMRegisterImpl::max_slots_per_register * XMMRegisterImpl::number_of_registers;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    44
    int bottom = ConcreteRegisterImpl::max_fpr;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    45
    int top = bottom + delta;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    46
    int middle = bottom + (delta / 2);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    47
    int xmm_slots = XMMRegisterImpl::max_slots_per_register;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    48
    int lower = xmm_slots / 2;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    49
    // mark bad every register that we cannot get to if AVX less than 3, we have all slots in the array
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    50
    // Note: vm2opto is allocated to ConcreteRegisterImpl::number_of_registers
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    51
    for (int i = bottom; i < middle; i += xmm_slots) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    52
      for (OptoReg::Name j = OptoReg::Name(i + lower); j<OptoReg::Name(i + xmm_slots); j = OptoReg::add(j, 1)) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    53
        OptoReg::invalidate(j);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    54
      }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    55
    }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    56
    // mark the upper zmm bank bad and all the mask registers bad in this case
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    57
    for (OptoReg::Name i = OptoReg::Name(middle); i<OptoReg::Name(_last_Mach_Reg - 1); i = OptoReg::add(i, 1)) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    58
      OptoReg::invalidate(i);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    59
    }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    60
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
}