1 //===- MSP430InstrInfo.td - MSP430 Instruction defs -----------*- tblgen-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the MSP430 instructions in TableGen format.
12 //===----------------------------------------------------------------------===//
14 include "MSP430InstrFormats.td"
16 //===----------------------------------------------------------------------===//
18 //===----------------------------------------------------------------------===//
19 class SDTCisI8<int OpNum> : SDTCisVT<OpNum, i8>;
20 class SDTCisI16<int OpNum> : SDTCisVT<OpNum, i16>;
22 //===----------------------------------------------------------------------===//
24 //===----------------------------------------------------------------------===//
26 //===----------------------------------------------------------------------===//
27 // MSP430 Specific Node Definitions.
28 //===----------------------------------------------------------------------===//
29 def retflag : SDNode<"MSP430ISD::RET_FLAG", SDTNone,
30 [SDNPHasChain, SDNPOptInFlag]>;
32 //===----------------------------------------------------------------------===//
33 // Pseudo Instructions
34 //===----------------------------------------------------------------------===//
36 def NOP : Pseudo<(outs), (ins), "nop", []>;
38 //===----------------------------------------------------------------------===//
40 //===----------------------------------------------------------------------===//
42 // FIXME: Provide proper encoding!
43 let isReturn = 1, isTerminator = 1 in {
44 def RETI : Pseudo<(outs), (ins), "ret", [(retflag)]>;
47 //===----------------------------------------------------------------------===//
50 // FIXME: Provide proper encoding!
51 let neverHasSideEffects = 1 in {
52 def MOV16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src),
53 "mov.w\t{$src, $dst|$dst, $src}",
57 // FIXME: Provide proper encoding!
58 let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
59 def MOV16ri : Pseudo<(outs GR16:$dst), (ins i16imm:$src),
60 "mov.w\t{$src, $dst|$dst, $src}",
61 [(set GR16:$dst, imm:$src)]>;
64 //===----------------------------------------------------------------------===//
65 // Arithmetic Instructions
68 let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
70 // FIXME: Provide proper encoding!
71 def ADD16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
72 "add.w\t{$src2, $dst|$dst, $src2}",
73 [(set GR16:$dst, (add GR16:$src1, GR16:$src2)),