1//===- ARMTargetParser.def - ARM target parsing defines ---------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file provides defines to build up the ARM target parser's logic. 11// 12//===----------------------------------------------------------------------===// 13 14// NOTE: NO INCLUDE GUARD DESIRED! 15 16#ifndef ARM_FPU 17#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) 18#endif 19ARM_FPU("invalid", FK_INVALID, FV_NONE, NS_None, FR_None) 20ARM_FPU("none", FK_NONE, FV_NONE, NS_None, FR_None) 21ARM_FPU("vfp", FK_VFP, FV_VFPV2, NS_None, FR_None) 22ARM_FPU("vfpv2", FK_VFPV2, FV_VFPV2, NS_None, FR_None) 23ARM_FPU("vfpv3", FK_VFPV3, FV_VFPV3, NS_None, FR_None) 24ARM_FPU("vfpv3-fp16", FK_VFPV3_FP16, FV_VFPV3_FP16, NS_None, FR_None) 25ARM_FPU("vfpv3-d16", FK_VFPV3_D16, FV_VFPV3, NS_None, FR_D16) 26ARM_FPU("vfpv3-d16-fp16", FK_VFPV3_D16_FP16, FV_VFPV3_FP16, NS_None, FR_D16) 27ARM_FPU("vfpv3xd", FK_VFPV3XD, FV_VFPV3, NS_None, FR_SP_D16) 28ARM_FPU("vfpv3xd-fp16", FK_VFPV3XD_FP16, FV_VFPV3_FP16, NS_None, FR_SP_D16) 29ARM_FPU("vfpv4", FK_VFPV4, FV_VFPV4, NS_None, FR_None) 30ARM_FPU("vfpv4-d16", FK_VFPV4_D16, FV_VFPV4, NS_None, FR_D16) 31ARM_FPU("fpv4-sp-d16", FK_FPV4_SP_D16, FV_VFPV4, NS_None, FR_SP_D16) 32ARM_FPU("fpv5-d16", FK_FPV5_D16, FV_VFPV5, NS_None, FR_D16) 33ARM_FPU("fpv5-sp-d16", FK_FPV5_SP_D16, FV_VFPV5, NS_None, FR_SP_D16) 34ARM_FPU("fp-armv8", FK_FP_ARMV8, FV_VFPV5, NS_None, FR_None) 35ARM_FPU("neon", FK_NEON, FV_VFPV3, NS_Neon, FR_None) 36ARM_FPU("neon-fp16", FK_NEON_FP16, FV_VFPV3_FP16, NS_Neon, FR_None) 37ARM_FPU("neon-vfpv4", FK_NEON_VFPV4, FV_VFPV4, NS_Neon, FR_None) 38ARM_FPU("neon-fp-armv8", FK_NEON_FP_ARMV8, FV_VFPV5, NS_Neon, FR_None) 39ARM_FPU("crypto-neon-fp-armv8", FK_CRYPTO_NEON_FP_ARMV8, FV_VFPV5, NS_Crypto, 40 FR_None) 41ARM_FPU("softvfp", FK_SOFTVFP, FV_NONE, NS_None, FR_None) 42#undef ARM_FPU 43 44#ifndef ARM_ARCH 45#define ARM_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT) 46#endif 47ARM_ARCH("invalid", AK_INVALID, nullptr, nullptr, 48 ARMBuildAttrs::CPUArch::Pre_v4, FK_NONE, AEK_NONE) 49ARM_ARCH("armv2", AK_ARMV2, "2", "v2", ARMBuildAttrs::CPUArch::Pre_v4, 50 FK_NONE, AEK_NONE) 51ARM_ARCH("armv2a", AK_ARMV2A, "2A", "v2a", ARMBuildAttrs::CPUArch::Pre_v4, 52 FK_NONE, AEK_NONE) 53ARM_ARCH("armv3", AK_ARMV3, "3", "v3", ARMBuildAttrs::CPUArch::Pre_v4, 54 FK_NONE, AEK_NONE) 55ARM_ARCH("armv3m", AK_ARMV3M, "3M", "v3m", ARMBuildAttrs::CPUArch::Pre_v4, 56 FK_NONE, AEK_NONE) 57ARM_ARCH("armv4", AK_ARMV4, "4", "v4", ARMBuildAttrs::CPUArch::v4, 58 FK_NONE, AEK_NONE) 59ARM_ARCH("armv4t", AK_ARMV4T, "4T", "v4t", ARMBuildAttrs::CPUArch::v4T, 60 FK_NONE, AEK_NONE) 61ARM_ARCH("armv5t", AK_ARMV5T, "5T", "v5", ARMBuildAttrs::CPUArch::v5T, 62 FK_NONE, AEK_NONE) 63ARM_ARCH("armv5te", AK_ARMV5TE, "5TE", "v5e", ARMBuildAttrs::CPUArch::v5TE, 64 FK_NONE, AEK_DSP) 65ARM_ARCH("armv5tej", AK_ARMV5TEJ, "5TEJ", "v5e", ARMBuildAttrs::CPUArch::v5TEJ, 66 FK_NONE, AEK_DSP) 67ARM_ARCH("armv6", AK_ARMV6, "6", "v6", ARMBuildAttrs::CPUArch::v6, 68 FK_VFPV2, AEK_DSP) 69ARM_ARCH("armv6k", AK_ARMV6K, "6K", "v6k", ARMBuildAttrs::CPUArch::v6K, 70 FK_VFPV2, AEK_DSP) 71ARM_ARCH("armv6t2", AK_ARMV6T2, "6T2", "v6t2", ARMBuildAttrs::CPUArch::v6T2, 72 FK_NONE, AEK_DSP) 73ARM_ARCH("armv6kz", AK_ARMV6KZ, "6KZ", "v6kz", ARMBuildAttrs::CPUArch::v6KZ, 74 FK_VFPV2, (AEK_SEC | AEK_DSP)) 75ARM_ARCH("armv6-m", AK_ARMV6M, "6-M", "v6m", ARMBuildAttrs::CPUArch::v6_M, 76 FK_NONE, AEK_NONE) 77ARM_ARCH("armv7-a", AK_ARMV7A, "7-A", "v7", ARMBuildAttrs::CPUArch::v7, 78 FK_NEON, AEK_DSP) 79ARM_ARCH("armv7-r", AK_ARMV7R, "7-R", "v7r", ARMBuildAttrs::CPUArch::v7, 80 FK_NONE, (AEK_HWDIV | AEK_DSP)) 81ARM_ARCH("armv7-m", AK_ARMV7M, "7-M", "v7m", ARMBuildAttrs::CPUArch::v7, 82 FK_NONE, AEK_HWDIV) 83ARM_ARCH("armv7e-m", AK_ARMV7EM, "7E-M", "v7em", ARMBuildAttrs::CPUArch::v7E_M, 84 FK_NONE, (AEK_HWDIV | AEK_DSP)) 85ARM_ARCH("armv8-a", AK_ARMV8A, "8-A", "v8", ARMBuildAttrs::CPUArch::v8, 86 FK_CRYPTO_NEON_FP_ARMV8, (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | 87 AEK_HWDIV | AEK_DSP | AEK_CRC)) 88ARM_ARCH("armv8.1-a", AK_ARMV8_1A, "8.1-A", "v8.1a", ARMBuildAttrs::CPUArch::v8, 89 FK_CRYPTO_NEON_FP_ARMV8, (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | 90 AEK_HWDIV | AEK_DSP | AEK_CRC)) 91ARM_ARCH("armv8.2-a", AK_ARMV8_2A, "8.2-A", "v8.2a", ARMBuildAttrs::CPUArch::v8, 92 FK_CRYPTO_NEON_FP_ARMV8, (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | 93 AEK_HWDIV | AEK_DSP | AEK_CRC)) 94// Non-standard Arch names. 95ARM_ARCH("iwmmxt", AK_IWMMXT, "iwmmxt", "", ARMBuildAttrs::CPUArch::v5TE, 96 FK_NONE, AEK_NONE) 97ARM_ARCH("iwmmxt2", AK_IWMMXT2, "iwmmxt2", "", ARMBuildAttrs::CPUArch::v5TE, 98 FK_NONE, AEK_NONE) 99ARM_ARCH("xscale", AK_XSCALE, "xscale", "", ARMBuildAttrs::CPUArch::v5TE, 100 FK_NONE, AEK_NONE) 101ARM_ARCH("armv7s", AK_ARMV7S, "7-S", "v7s", ARMBuildAttrs::CPUArch::v7, 102 FK_NEON_VFPV4, AEK_DSP) 103ARM_ARCH("armv7k", AK_ARMV7K, "7-K", "v7k", ARMBuildAttrs::CPUArch::v7, 104 FK_NONE, AEK_DSP) 105#undef ARM_ARCH 106 107#ifndef ARM_ARCH_EXT_NAME 108#define ARM_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) 109#endif 110// FIXME: This would be nicer were it tablegen 111ARM_ARCH_EXT_NAME("invalid", AEK_INVALID, nullptr, nullptr) 112ARM_ARCH_EXT_NAME("none", AEK_NONE, nullptr, nullptr) 113ARM_ARCH_EXT_NAME("crc", AEK_CRC, "+crc", "-crc") 114ARM_ARCH_EXT_NAME("crypto", AEK_CRYPTO, "+crypto","-crypto") 115ARM_ARCH_EXT_NAME("fp", AEK_FP, nullptr, nullptr) 116ARM_ARCH_EXT_NAME("idiv", (AEK_HWDIVARM | AEK_HWDIV), nullptr, nullptr) 117ARM_ARCH_EXT_NAME("mp", AEK_MP, nullptr, nullptr) 118ARM_ARCH_EXT_NAME("simd", AEK_SIMD, nullptr, nullptr) 119ARM_ARCH_EXT_NAME("sec", AEK_SEC, nullptr, nullptr) 120ARM_ARCH_EXT_NAME("virt", AEK_VIRT, nullptr, nullptr) 121ARM_ARCH_EXT_NAME("fp16", AEK_FP16, "+fullfp16", "-fullfp16") 122ARM_ARCH_EXT_NAME("os", AEK_OS, nullptr, nullptr) 123ARM_ARCH_EXT_NAME("iwmmxt", AEK_IWMMXT, nullptr, nullptr) 124ARM_ARCH_EXT_NAME("iwmmxt2", AEK_IWMMXT2, nullptr, nullptr) 125ARM_ARCH_EXT_NAME("maverick", AEK_MAVERICK, nullptr, nullptr) 126ARM_ARCH_EXT_NAME("xscale", AEK_XSCALE, nullptr, nullptr) 127#undef ARM_ARCH_EXT_NAME 128 129#ifndef ARM_HW_DIV_NAME 130#define ARM_HW_DIV_NAME(NAME, ID) 131#endif 132ARM_HW_DIV_NAME("invalid", AEK_INVALID) 133ARM_HW_DIV_NAME("none", AEK_NONE) 134ARM_HW_DIV_NAME("thumb", AEK_HWDIV) 135ARM_HW_DIV_NAME("arm", AEK_HWDIVARM) 136ARM_HW_DIV_NAME("arm,thumb", (AEK_HWDIVARM | AEK_HWDIV)) 137#undef ARM_HW_DIV_NAME 138 139#ifndef ARM_CPU_NAME 140#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) 141#endif 142ARM_CPU_NAME("arm2", AK_ARMV2, FK_NONE, true, AEK_NONE) 143ARM_CPU_NAME("arm3", AK_ARMV2A, FK_NONE, true, AEK_NONE) 144ARM_CPU_NAME("arm6", AK_ARMV3, FK_NONE, true, AEK_NONE) 145ARM_CPU_NAME("arm7m", AK_ARMV3M, FK_NONE, true, AEK_NONE) 146ARM_CPU_NAME("arm8", AK_ARMV4, FK_NONE, false, AEK_NONE) 147ARM_CPU_NAME("arm810", AK_ARMV4, FK_NONE, false, AEK_NONE) 148ARM_CPU_NAME("strongarm", AK_ARMV4, FK_NONE, true, AEK_NONE) 149ARM_CPU_NAME("strongarm110", AK_ARMV4, FK_NONE, false, AEK_NONE) 150ARM_CPU_NAME("strongarm1100", AK_ARMV4, FK_NONE, false, AEK_NONE) 151ARM_CPU_NAME("strongarm1110", AK_ARMV4, FK_NONE, false, AEK_NONE) 152ARM_CPU_NAME("arm7tdmi", AK_ARMV4T, FK_NONE, true, AEK_NONE) 153ARM_CPU_NAME("arm7tdmi-s", AK_ARMV4T, FK_NONE, false, AEK_NONE) 154ARM_CPU_NAME("arm710t", AK_ARMV4T, FK_NONE, false, AEK_NONE) 155ARM_CPU_NAME("arm720t", AK_ARMV4T, FK_NONE, false, AEK_NONE) 156ARM_CPU_NAME("arm9", AK_ARMV4T, FK_NONE, false, AEK_NONE) 157ARM_CPU_NAME("arm9tdmi", AK_ARMV4T, FK_NONE, false, AEK_NONE) 158ARM_CPU_NAME("arm920", AK_ARMV4T, FK_NONE, false, AEK_NONE) 159ARM_CPU_NAME("arm920t", AK_ARMV4T, FK_NONE, false, AEK_NONE) 160ARM_CPU_NAME("arm922t", AK_ARMV4T, FK_NONE, false, AEK_NONE) 161ARM_CPU_NAME("arm9312", AK_ARMV4T, FK_NONE, false, AEK_NONE) 162ARM_CPU_NAME("arm940t", AK_ARMV4T, FK_NONE, false, AEK_NONE) 163ARM_CPU_NAME("ep9312", AK_ARMV4T, FK_NONE, false, AEK_NONE) 164ARM_CPU_NAME("arm10tdmi", AK_ARMV5T, FK_NONE, true, AEK_NONE) 165ARM_CPU_NAME("arm1020t", AK_ARMV5T, FK_NONE, false, AEK_NONE) 166ARM_CPU_NAME("arm9e", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 167ARM_CPU_NAME("arm946e-s", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 168ARM_CPU_NAME("arm966e-s", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 169ARM_CPU_NAME("arm968e-s", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 170ARM_CPU_NAME("arm10e", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 171ARM_CPU_NAME("arm1020e", AK_ARMV5TE, FK_NONE, false, AEK_NONE) 172ARM_CPU_NAME("arm1022e", AK_ARMV5TE, FK_NONE, true, AEK_NONE) 173ARM_CPU_NAME("arm926ej-s", AK_ARMV5TEJ, FK_NONE, true, AEK_NONE) 174ARM_CPU_NAME("arm1136j-s", AK_ARMV6, FK_NONE, false, AEK_NONE) 175ARM_CPU_NAME("arm1136jf-s", AK_ARMV6, FK_VFPV2, true, AEK_NONE) 176ARM_CPU_NAME("arm1136jz-s", AK_ARMV6, FK_NONE, false, AEK_NONE) 177ARM_CPU_NAME("arm1176j-s", AK_ARMV6K, FK_NONE, true, AEK_NONE) 178ARM_CPU_NAME("arm1176jz-s", AK_ARMV6KZ, FK_NONE, false, AEK_NONE) 179ARM_CPU_NAME("mpcore", AK_ARMV6K, FK_VFPV2, false, AEK_NONE) 180ARM_CPU_NAME("mpcorenovfp", AK_ARMV6K, FK_NONE, false, AEK_NONE) 181ARM_CPU_NAME("arm1176jzf-s", AK_ARMV6KZ, FK_VFPV2, true, AEK_NONE) 182ARM_CPU_NAME("arm1156t2-s", AK_ARMV6T2, FK_NONE, true, AEK_NONE) 183ARM_CPU_NAME("arm1156t2f-s", AK_ARMV6T2, FK_VFPV2, false, AEK_NONE) 184ARM_CPU_NAME("cortex-m0", AK_ARMV6M, FK_NONE, true, AEK_NONE) 185ARM_CPU_NAME("cortex-m0plus", AK_ARMV6M, FK_NONE, false, AEK_NONE) 186ARM_CPU_NAME("cortex-m1", AK_ARMV6M, FK_NONE, false, AEK_NONE) 187ARM_CPU_NAME("sc000", AK_ARMV6M, FK_NONE, false, AEK_NONE) 188ARM_CPU_NAME("cortex-a5", AK_ARMV7A, FK_NEON_VFPV4, false, (AEK_SEC | AEK_MP)) 189ARM_CPU_NAME("cortex-a7", AK_ARMV7A, FK_NEON_VFPV4, false, 190 (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV)) 191ARM_CPU_NAME("cortex-a8", AK_ARMV7A, FK_NEON, true, AEK_SEC) 192ARM_CPU_NAME("cortex-a9", AK_ARMV7A, FK_NEON_FP16, false, (AEK_SEC | AEK_MP)) 193ARM_CPU_NAME("cortex-a12", AK_ARMV7A, FK_NEON_VFPV4, false, 194 (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV)) 195ARM_CPU_NAME("cortex-a15", AK_ARMV7A, FK_NEON_VFPV4, false, 196 (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV)) 197ARM_CPU_NAME("cortex-a17", AK_ARMV7A, FK_NEON_VFPV4, false, 198 (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV)) 199ARM_CPU_NAME("krait", AK_ARMV7A, FK_NEON_VFPV4, false, 200 (AEK_HWDIVARM | AEK_HWDIV)) 201ARM_CPU_NAME("cortex-r4", AK_ARMV7R, FK_NONE, true, AEK_NONE) 202ARM_CPU_NAME("cortex-r4f", AK_ARMV7R, FK_VFPV3_D16, false, AEK_NONE) 203ARM_CPU_NAME("cortex-r5", AK_ARMV7R, FK_VFPV3_D16, false, 204 (AEK_MP | AEK_HWDIVARM)) 205ARM_CPU_NAME("cortex-r7", AK_ARMV7R, FK_VFPV3_D16_FP16, false, 206 (AEK_MP | AEK_HWDIVARM)) 207ARM_CPU_NAME("sc300", AK_ARMV7M, FK_NONE, false, AEK_NONE) 208ARM_CPU_NAME("cortex-m3", AK_ARMV7M, FK_NONE, true, AEK_NONE) 209ARM_CPU_NAME("cortex-m4", AK_ARMV7EM, FK_FPV4_SP_D16, true, AEK_NONE) 210ARM_CPU_NAME("cortex-m7", AK_ARMV7EM, FK_FPV5_D16, false, AEK_NONE) 211ARM_CPU_NAME("cortex-a35", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, AEK_CRC) 212ARM_CPU_NAME("cortex-a53", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, true, AEK_CRC) 213ARM_CPU_NAME("cortex-a57", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, AEK_CRC) 214ARM_CPU_NAME("cortex-a72", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, AEK_CRC) 215ARM_CPU_NAME("cyclone", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, AEK_CRC) 216// Non-standard Arch names. 217ARM_CPU_NAME("iwmmxt", AK_IWMMXT, FK_NONE, true, AEK_NONE) 218ARM_CPU_NAME("xscale", AK_XSCALE, FK_NONE, true, AEK_NONE) 219ARM_CPU_NAME("swift", AK_ARMV7S, FK_NEON_VFPV4, true, 220 (AEK_HWDIVARM | AEK_HWDIV)) 221// Invalid CPU 222ARM_CPU_NAME("invalid", AK_INVALID, FK_INVALID, true, AEK_INVALID) 223#undef ARM_CPU_NAME 224