src/hotspot/cpu/x86/c2_init_x86.cpp
author ihse
Tue, 22 Oct 2019 09:51:52 +0200
branchihse-cflags-rewrite-branch
changeset 58736 e878a0b7cff0
parent 53868 1bd7233074c1
permissions -rw-r--r--
Add doubunder on solaris in two places.
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
53868
1bd7233074c1 8219486: Missing reg_mask_init() breaks x86_32 build
rkennke
parents: 53841
diff changeset
    32
LP64_ONLY(extern void reg_mask_init();)
53841
48b50573dee4 8217909: Make unused r12 register (without compressed oops) available to regalloc in C2
rkennke
parents: 47216
diff changeset
    33
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
void Compile::pd_compiler2_init() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  // QQQ presumably all 64bit cpu's support this. Seems like the ifdef could
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  // simply be left out.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
#ifndef AMD64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  if (!VM_Version::supports_cmov()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    ConditionalMoveLimit = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
#endif // AMD64
30624
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    43
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    44
  if (UseAVX < 3) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    45
    int delta = XMMRegisterImpl::max_slots_per_register * XMMRegisterImpl::number_of_registers;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    46
    int bottom = ConcreteRegisterImpl::max_fpr;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    47
    int top = bottom + delta;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    48
    int middle = bottom + (delta / 2);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    49
    int xmm_slots = XMMRegisterImpl::max_slots_per_register;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    50
    int lower = xmm_slots / 2;
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    51
    // 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
    52
    // Note: vm2opto is allocated to ConcreteRegisterImpl::number_of_registers
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    53
    for (int i = bottom; i < middle; i += xmm_slots) {
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    54
      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
    55
        OptoReg::invalidate(j);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    56
      }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    57
    }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    58
    // 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
    59
    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
    60
      OptoReg::invalidate(i);
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    61
    }
2e1803c8a26d 8076276: Add support for AVX512
kvn
parents: 7397
diff changeset
    62
  }
53868
1bd7233074c1 8219486: Missing reg_mask_init() breaks x86_32 build
rkennke
parents: 53841
diff changeset
    63
  LP64_ONLY(reg_mask_init();)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
}