/src/keystone/llvm/lib/Target/AArch64/AArch64GenSubtargetInfo.inc
Line | Count | Source |
1 | | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
2 | | |* *| |
3 | | |* Subtarget Enumeration Source Fragment *| |
4 | | |* *| |
5 | | |* Automatically generated file, do not edit! *| |
6 | | |* *| |
7 | | \*===----------------------------------------------------------------------===*/ |
8 | | |
9 | | |
10 | | #ifdef GET_SUBTARGETINFO_ENUM |
11 | | #undef GET_SUBTARGETINFO_ENUM |
12 | | namespace llvm_ks { |
13 | | namespace AArch64 { |
14 | | enum : uint64_t { |
15 | | FeatureCRC = 0, |
16 | | FeatureCrypto = 1, |
17 | | FeatureFPARMv8 = 2, |
18 | | FeatureFullFP16 = 3, |
19 | | FeatureNEON = 4, |
20 | | FeaturePerfMon = 5, |
21 | | FeatureReserveX18 = 6, |
22 | | FeatureSPE = 7, |
23 | | FeatureStrictAlign = 8, |
24 | | FeatureZCRegMove = 9, |
25 | | FeatureZCZeroing = 10, |
26 | | HasV8_1aOps = 11, |
27 | | HasV8_2aOps = 12, |
28 | | ProcA35 = 13, |
29 | | ProcA53 = 14, |
30 | | ProcA57 = 15, |
31 | | ProcCyclone = 16, |
32 | | ProcExynosM1 = 17 |
33 | | }; |
34 | | } |
35 | | } // end llvm namespace |
36 | | #endif // GET_SUBTARGETINFO_ENUM |
37 | | |
38 | | |
39 | | #ifdef GET_SUBTARGETINFO_MC_DESC |
40 | | #undef GET_SUBTARGETINFO_MC_DESC |
41 | | namespace llvm_ks { |
42 | | // Sorted (by key) array of values for CPU features. |
43 | | extern const llvm_ks::SubtargetFeatureKV AArch64FeatureKV[] = { |
44 | | { "a35", "Cortex-A35 ARM processors", { AArch64::ProcA35 }, { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCrypto, AArch64::FeatureCRC, AArch64::FeaturePerfMon } }, |
45 | | { "a53", "Cortex-A53 ARM processors", { AArch64::ProcA53 }, { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCrypto, AArch64::FeatureCRC, AArch64::FeaturePerfMon } }, |
46 | | { "a57", "Cortex-A57 ARM processors", { AArch64::ProcA57 }, { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCrypto, AArch64::FeatureCRC, AArch64::FeaturePerfMon } }, |
47 | | { "crc", "Enable ARMv8 CRC-32 checksum instructions", { AArch64::FeatureCRC }, { } }, |
48 | | { "crypto", "Enable cryptographic instructions", { AArch64::FeatureCrypto }, { } }, |
49 | | { "cyclone", "Cyclone", { AArch64::ProcCyclone }, { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCrypto, AArch64::FeatureCRC, AArch64::FeaturePerfMon, AArch64::FeatureZCRegMove, AArch64::FeatureZCZeroing } }, |
50 | | { "exynosm1", "Samsung Exynos-M1 processors", { AArch64::ProcExynosM1 }, { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCrypto, AArch64::FeatureCRC, AArch64::FeaturePerfMon } }, |
51 | | { "fp-armv8", "Enable ARMv8 FP", { AArch64::FeatureFPARMv8 }, { } }, |
52 | | { "fullfp16", "Full FP16", { AArch64::FeatureFullFP16 }, { AArch64::FeatureFPARMv8 } }, |
53 | | { "neon", "Enable Advanced SIMD instructions", { AArch64::FeatureNEON }, { AArch64::FeatureFPARMv8 } }, |
54 | | { "perfmon", "Enable ARMv8 PMUv3 Performance Monitors extension", { AArch64::FeaturePerfMon }, { } }, |
55 | | { "reserve-x18", "Reserve X18, making it unavailable as a GPR", { AArch64::FeatureReserveX18 }, { } }, |
56 | | { "spe", "Enable Statistical Profiling extension", { AArch64::FeatureSPE }, { } }, |
57 | | { "strict-align", "Disallow all unaligned memory access", { AArch64::FeatureStrictAlign }, { } }, |
58 | | { "v8.1a", "Support ARM v8.1a instructions", { AArch64::HasV8_1aOps }, { AArch64::FeatureCRC } }, |
59 | | { "v8.2a", "Support ARM v8.2a instructions", { AArch64::HasV8_2aOps }, { AArch64::HasV8_1aOps } }, |
60 | | { "zcm", "Has zero-cycle register moves", { AArch64::FeatureZCRegMove }, { } }, |
61 | | { "zcz", "Has zero-cycle zeroing instructions", { AArch64::FeatureZCZeroing }, { } } |
62 | | }; |
63 | | |
64 | | // Sorted (by key) array of values for CPU subtype. |
65 | | extern const llvm_ks::SubtargetFeatureKV AArch64SubTypeKV[] = { |
66 | | { "cortex-a35", "Select the cortex-a35 processor", { AArch64::ProcA35 }, { } }, |
67 | | { "cortex-a53", "Select the cortex-a53 processor", { AArch64::ProcA53 }, { } }, |
68 | | { "cortex-a57", "Select the cortex-a57 processor", { AArch64::ProcA57 }, { } }, |
69 | | { "cortex-a72", "Select the cortex-a72 processor", { AArch64::ProcA57 }, { } }, |
70 | | { "cyclone", "Select the cyclone processor", { AArch64::ProcCyclone }, { } }, |
71 | | { "exynos-m1", "Select the exynos-m1 processor", { AArch64::ProcExynosM1 }, { } }, |
72 | | { "generic", "Select the generic processor", { AArch64::FeatureFPARMv8, AArch64::FeatureNEON, AArch64::FeatureCRC, AArch64::FeaturePerfMon }, { } } |
73 | | }; |
74 | | |
75 | | #ifdef DBGFIELD |
76 | | #error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro" |
77 | | #endif |
78 | | #ifndef NDEBUG |
79 | | #define DBGFIELD(x) x, |
80 | | #else |
81 | | #define DBGFIELD(x) |
82 | | #endif |
83 | | |
84 | | // =============================================================== |
85 | | // Data tables for the new per-operand machine model. |
86 | | |
87 | | #undef DBGFIELD |
88 | 1.58k | static inline MCSubtargetInfo *createAArch64MCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) { |
89 | 1.58k | return new MCSubtargetInfo(TT, CPU, FS, AArch64FeatureKV, AArch64SubTypeKV, NULL); |
90 | 1.58k | } |
91 | | |
92 | | } // end llvm namespace |
93 | | #endif // GET_SUBTARGETINFO_MC_DESC |
94 | | |
95 | | |
96 | | #ifdef GET_SUBTARGETINFO_TARGET_DESC |
97 | | #undef GET_SUBTARGETINFO_TARGET_DESC |
98 | | #include "llvm/Support/Debug.h" |
99 | | #include "llvm/Support/raw_ostream.h" |
100 | | // ParseSubtargetFeatures - Parses features string setting specified |
101 | | // subtarget options. |
102 | | void llvm_ks::AArch64Subtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) { |
103 | | DEBUG(dbgs() << "\nFeatures:" << FS); |
104 | | DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n"); |
105 | | InitMCProcessorInfo(CPU, FS); |
106 | | const FeatureBitset& Bits = getFeatureBits(); |
107 | | if (Bits[AArch64::FeatureCRC]) HasCRC = true; |
108 | | if (Bits[AArch64::FeatureCrypto]) HasCrypto = true; |
109 | | if (Bits[AArch64::FeatureFPARMv8]) HasFPARMv8 = true; |
110 | | if (Bits[AArch64::FeatureFullFP16]) HasFullFP16 = true; |
111 | | if (Bits[AArch64::FeatureNEON]) HasNEON = true; |
112 | | if (Bits[AArch64::FeaturePerfMon]) HasPerfMon = true; |
113 | | if (Bits[AArch64::FeatureReserveX18]) ReserveX18 = true; |
114 | | if (Bits[AArch64::FeatureSPE]) HasSPE = true; |
115 | | if (Bits[AArch64::FeatureStrictAlign]) StrictAlign = true; |
116 | | if (Bits[AArch64::FeatureZCRegMove]) HasZeroCycleRegMove = true; |
117 | | if (Bits[AArch64::FeatureZCZeroing]) HasZeroCycleZeroing = true; |
118 | | if (Bits[AArch64::HasV8_1aOps]) HasV8_1aOps = true; |
119 | | if (Bits[AArch64::HasV8_2aOps]) HasV8_2aOps = true; |
120 | | if (Bits[AArch64::ProcA35] && ARMProcFamily < CortexA35) ARMProcFamily = CortexA35; |
121 | | if (Bits[AArch64::ProcA53] && ARMProcFamily < CortexA53) ARMProcFamily = CortexA53; |
122 | | if (Bits[AArch64::ProcA57] && ARMProcFamily < CortexA57) ARMProcFamily = CortexA57; |
123 | | if (Bits[AArch64::ProcCyclone] && ARMProcFamily < Cyclone) ARMProcFamily = Cyclone; |
124 | | if (Bits[AArch64::ProcExynosM1] && ARMProcFamily < ExynosM1) ARMProcFamily = ExynosM1; |
125 | | } |
126 | | #endif // GET_SUBTARGETINFO_TARGET_DESC |