Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/env/J9CPU.hpp
6000 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2020 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef J9_CPU_INCL
24
#define J9_CPU_INCL
25
26
/*
27
* The following #define and typedef must appear before any #includes in this file
28
*/
29
#ifndef J9_CPU_CONNECTOR
30
#define J9_CPU_CONNECTOR
31
namespace J9 { class CPU; }
32
namespace J9 { typedef CPU CPUConnector; }
33
#endif
34
35
#include "env/OMRCPU.hpp"
36
37
namespace J9
38
{
39
class OMR_EXTENSIBLE CPU : public OMR::CPUConnector
40
{
41
protected:
42
43
CPU() : OMR::CPUConnector() {}
44
CPU(const OMRProcessorDesc& processorDescription) : OMR::CPUConnector(processorDescription) {}
45
46
/**
47
* @brief Contains the list of processor features exploited by the compiler, initialized via TR::CPU::initializeFeatureMasks()
48
*/
49
static OMRProcessorDesc _supportedFeatureMasks;
50
51
/**
52
* @brief _isSupportedFeatureMasksEnabled tells you whether _supportedFeatureMasks was used for masking out unused processor features
53
*/
54
static bool _isSupportedFeatureMasksEnabled;
55
56
public:
57
58
/**
59
* @brief A factory method used to construct a CPU object based on the underlying hardware
60
* @param[in] omrPortLib : the port library
61
* @return TR::CPU
62
*/
63
static TR::CPU detect(OMRPortLibrary * const omrPortLib);
64
65
/**
66
* @brief A factory method used to construct a CPU object based on user customized processorDescription
67
* @param[in] OMRProcessorDesc : the processor description
68
* @return TR::CPU
69
*/
70
static TR::CPU customize(OMRProcessorDesc processorDescription);
71
72
/**
73
* @brief Intialize _supportedFeatureMasks to the list of processor features that will be exploited by the compiler and set _isSupportedFeatureMasksEnabled to true
74
* @return void
75
*/
76
static void enableFeatureMasks();
77
78
bool supportsFeature(uint32_t feature);
79
80
const char *getProcessorVendorId();
81
uint32_t getProcessorSignature();
82
};
83
}
84
85
#endif
86
87