3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_
16 #define CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_
18 #include "cpu_features_macros.h"
19 #include "internal/hwcaps.h"
21 CPU_FEATURES_START_CPP_NAMESPACE
49 int pseries_perfmon_compat : 1;
64 int htm_no_suspend : 1;
66 // Make sure to update PPCFeaturesEnum below if you add a field here.
73 // This function is guaranteed to be malloc, memset and memcpy free.
74 PPCInfo GetPPCInfo(void);
77 char platform[64]; // 0 terminated string
78 char model[64]; // 0 terminated string
79 char machine[64]; // 0 terminated string
80 char cpu[64]; // 0 terminated string
84 PPCPlatformStrings GetPPCPlatformStrings(void);
86 ////////////////////////////////////////////////////////////////////////////////
87 // Introspection functions
90 PPC_32, /* 32 bit mode execution */
91 PPC_64, /* 64 bit mode execution */
92 PPC_601_INSTR, /* Old POWER ISA */
93 PPC_HAS_ALTIVEC, /* SIMD Unit*/
94 PPC_HAS_FPU, /* Floating Point Unit */
95 PPC_HAS_MMU, /* Memory management unit */
97 PPC_UNIFIED_CACHE, /* Unified instruction and data cache */
98 PPC_HAS_SPE, /* Signal processing extention unit */
99 PPC_HAS_EFP_SINGLE, /* SPE single precision fpu */
100 PPC_HAS_EFP_DOUBLE, /* SPE double precision fpu */
101 PPC_NO_TB, /* No timebase */
105 PPC_CELL, /* Cell broadband engine */
106 PPC_BOOKE, /* Embedded ISA */
107 PPC_SMT, /* Simultaneous multi-threading */
109 PPC_ARCH_2_05, /* ISA 2.05 - POWER6 */
110 PPC_PA6T, /* PA Semi 6T core ISA */
111 PPC_HAS_DFP, /* Decimal floating point unit */
113 PPC_ARCH_2_06, /* ISA 2.06 - POWER7 */
114 PPC_HAS_VSX, /* Vector-scalar extension */
115 PPC_PSERIES_PERFMON_COMPAT, /* Set of backwards compatibile performance
119 PPC_ARCH_2_07, /* ISA 2.07 - POWER8 */
120 PPC_HTM, /* Hardware Transactional Memory */
121 PPC_DSCR, /* Data stream control register */
122 PPC_EBB, /* Event base branching */
123 PPC_ISEL, /* Integer select instructions */
124 PPC_TAR, /* Target address register */
125 PPC_VEC_CRYPTO, /* Vector cryptography instructions */
126 PPC_HTM_NOSC, /* Transactions aborted when syscall made*/
127 PPC_ARCH_3_00, /* ISA 3.00 - POWER9 */
128 PPC_HAS_IEEE128, /* VSX IEEE Binary Float 128-bit */
129 PPC_DARN, /* Deliver a random number instruction */
130 PPC_SCV, /* scv syscall */
131 PPC_HTM_NO_SUSPEND, /* TM w/out suspended state */
135 int GetPPCFeaturesEnumValue(const PPCFeatures* features, PPCFeaturesEnum value);
137 const char* GetPPCFeaturesEnumName(PPCFeaturesEnum);
139 CPU_FEATURES_END_CPP_NAMESPACE
141 #endif // CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_