1//===- NVPTX.td - Describe the NVPTX Target Machine -----------*- tblgen -*-==// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8// This is the top level entry point for the NVPTX target. 9//===----------------------------------------------------------------------===// 10 11//===----------------------------------------------------------------------===// 12// Target-independent interfaces 13//===----------------------------------------------------------------------===// 14 15include "llvm/Target/Target.td" 16 17include "NVPTXRegisterInfo.td" 18include "NVPTXInstrInfo.td" 19 20//===----------------------------------------------------------------------===// 21// Subtarget Features. 22// - We use the SM version number instead of explicit feature table. 23// - Need at least one feature to avoid generating zero sized array by 24// TableGen in NVPTXGenSubtarget.inc. 25//===----------------------------------------------------------------------===// 26 27// SM Versions 28def SM20 : SubtargetFeature<"sm_20", "SmVersion", "20", 29 "Target SM 2.0">; 30def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21", 31 "Target SM 2.1">; 32def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30", 33 "Target SM 3.0">; 34def SM32 : SubtargetFeature<"sm_32", "SmVersion", "32", 35 "Target SM 3.2">; 36def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35", 37 "Target SM 3.5">; 38def SM37 : SubtargetFeature<"sm_37", "SmVersion", "37", 39 "Target SM 3.7">; 40def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50", 41 "Target SM 5.0">; 42def SM52 : SubtargetFeature<"sm_52", "SmVersion", "52", 43 "Target SM 5.2">; 44def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53", 45 "Target SM 5.3">; 46def SM60 : SubtargetFeature<"sm_60", "SmVersion", "60", 47 "Target SM 6.0">; 48def SM61 : SubtargetFeature<"sm_61", "SmVersion", "61", 49 "Target SM 6.1">; 50def SM62 : SubtargetFeature<"sm_62", "SmVersion", "62", 51 "Target SM 6.2">; 52def SM70 : SubtargetFeature<"sm_70", "SmVersion", "70", 53 "Target SM 7.0">; 54def SM72 : SubtargetFeature<"sm_72", "SmVersion", "72", 55 "Target SM 7.2">; 56def SM75 : SubtargetFeature<"sm_75", "SmVersion", "75", 57 "Target SM 7.5">; 58def SM80 : SubtargetFeature<"sm_80", "SmVersion", "80", 59 "Target SM 8.0">; 60def SM86 : SubtargetFeature<"sm_86", "SmVersion", "86", 61 "Target SM 8.6">; 62 63// PTX Versions 64def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32", 65 "Use PTX version 3.2">; 66def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40", 67 "Use PTX version 4.0">; 68def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41", 69 "Use PTX version 4.1">; 70def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42", 71 "Use PTX version 4.2">; 72def PTX43 : SubtargetFeature<"ptx43", "PTXVersion", "43", 73 "Use PTX version 4.3">; 74def PTX50 : SubtargetFeature<"ptx50", "PTXVersion", "50", 75 "Use PTX version 5.0">; 76def PTX60 : SubtargetFeature<"ptx60", "PTXVersion", "60", 77 "Use PTX version 6.0">; 78def PTX61 : SubtargetFeature<"ptx61", "PTXVersion", "61", 79 "Use PTX version 6.1">; 80def PTX63 : SubtargetFeature<"ptx63", "PTXVersion", "63", 81 "Use PTX version 6.3">; 82def PTX64 : SubtargetFeature<"ptx64", "PTXVersion", "64", 83 "Use PTX version 6.4">; 84def PTX65 : SubtargetFeature<"ptx65", "PTXVersion", "65", 85 "Use PTX version 6.5">; 86def PTX70 : SubtargetFeature<"ptx70", "PTXVersion", "70", 87 "Use PTX version 7.0">; 88def PTX71 : SubtargetFeature<"ptx71", "PTXVersion", "71", 89 "Use PTX version 7.1">; 90def PTX72 : SubtargetFeature<"ptx72", "PTXVersion", "72", 91 "Use PTX version 7.2">; 92 93//===----------------------------------------------------------------------===// 94// NVPTX supported processors. 95//===----------------------------------------------------------------------===// 96 97class Proc<string Name, list<SubtargetFeature> Features> 98 : Processor<Name, NoItineraries, Features>; 99 100def : Proc<"sm_20", [SM20]>; 101def : Proc<"sm_21", [SM21]>; 102def : Proc<"sm_30", [SM30]>; 103def : Proc<"sm_32", [SM32, PTX40]>; 104def : Proc<"sm_35", [SM35]>; 105def : Proc<"sm_37", [SM37, PTX41]>; 106def : Proc<"sm_50", [SM50, PTX40]>; 107def : Proc<"sm_52", [SM52, PTX41]>; 108def : Proc<"sm_53", [SM53, PTX42]>; 109def : Proc<"sm_60", [SM60, PTX50]>; 110def : Proc<"sm_61", [SM61, PTX50]>; 111def : Proc<"sm_62", [SM62, PTX50]>; 112def : Proc<"sm_70", [SM70, PTX60]>; 113def : Proc<"sm_72", [SM72, PTX61]>; 114def : Proc<"sm_75", [SM75, PTX63]>; 115def : Proc<"sm_80", [SM80, PTX70]>; 116def : Proc<"sm_86", [SM86, PTX71]>; 117 118def NVPTXInstrInfo : InstrInfo { 119} 120 121def NVPTX : Target { 122 let InstructionSet = NVPTXInstrInfo; 123} 124