1 //===-- MSP430.td - Describe the MSP430 Target Machine -----*- tablegen -*-===// 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 MSP430 target. 9 //===----------------------------------------------------------------------===// 10 11 //===----------------------------------------------------------------------===// 12 // Target-independent interfaces 13 //===----------------------------------------------------------------------===// 14 15 include "llvm/Target/Target.td" 16 17 //===----------------------------------------------------------------------===// 18 // Subtarget Features. 19 //===----------------------------------------------------------------------===// 20 def FeatureX 21 : SubtargetFeature<"ext", "ExtendedInsts", "true", 22 "Enable MSP430-X extensions">; 23 24 def FeatureHWMult16 25 : SubtargetFeature<"hwmult16", "HWMultMode", "HWMult16", 26 "Enable 16-bit hardware multiplier">; 27 28 def FeatureHWMult32 29 : SubtargetFeature<"hwmult32", "HWMultMode", "HWMult32", 30 "Enable 32-bit hardware multiplier">; 31 32 def FeatureHWMultF5 33 : SubtargetFeature<"hwmultf5", "HWMultMode", "HWMultF5", 34 "Enable F5 series hardware multiplier">; 35 36 //===----------------------------------------------------------------------===// 37 // MSP430 supported processors. 38 //===----------------------------------------------------------------------===// 39 class Proc<string Name, list<SubtargetFeature> Features> 40 : Processor<Name, NoItineraries, Features>; 41 42 def : Proc<"generic", []>; 43 def : Proc<"msp430", []>; 44 def : Proc<"msp430x", [FeatureX]>; 45 46 //===----------------------------------------------------------------------===// 47 // Register File Description 48 //===----------------------------------------------------------------------===// 49 50 include "MSP430RegisterInfo.td" 51 52 //===----------------------------------------------------------------------===// 53 // Calling Convention Description 54 //===----------------------------------------------------------------------===// 55 56 include "MSP430CallingConv.td" 57 58 //===----------------------------------------------------------------------===// 59 // Instruction Descriptions 60 //===----------------------------------------------------------------------===// 61 62 include "MSP430InstrInfo.td" 63 64 def MSP430InstrInfo : InstrInfo; 65 66 //===---------------------------------------------------------------------===// 67 // Assembly Printers 68 //===---------------------------------------------------------------------===// 69 70 def MSP430AsmWriter : AsmWriter { 71 string AsmWriterClassName = "InstPrinter"; 72 } 73 74 //===---------------------------------------------------------------------===// 75 // Assembly Parsers 76 //===---------------------------------------------------------------------===// 77 78 def MSP430AsmParser : AsmParser { 79 let AllowDuplicateRegisterNames = 1; 80 let ShouldEmitMatchRegisterAltName = 1; 81 } 82 83 //===----------------------------------------------------------------------===// 84 // Target Declaration 85 //===----------------------------------------------------------------------===// 86 87 def MSP430 : Target { 88 let InstructionSet = MSP430InstrInfo; 89 let AssemblyParsers = [MSP430AsmParser]; 90 } 91 92