//===- MSP430InstrInfo.td - MSP430 Instruction defs -----------*- tblgen-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file describes the MSP430 instructions in TableGen format. // //===----------------------------------------------------------------------===// include "MSP430InstrFormats.td" //===----------------------------------------------------------------------===// // Type Constraints. //===----------------------------------------------------------------------===// class SDTCisI8 : SDTCisVT; class SDTCisI16 : SDTCisVT; //===----------------------------------------------------------------------===// // Type Profiles. //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // MSP430 Specific Node Definitions. //===----------------------------------------------------------------------===// def retflag : SDNode<"MSP430ISD::RET_FLAG", SDTNone, [SDNPHasChain, SDNPOptInFlag]>; //===----------------------------------------------------------------------===// // Pseudo Instructions //===----------------------------------------------------------------------===// def NOP : Pseudo<(outs), (ins), "nop", []>; //===----------------------------------------------------------------------===// // Real Instructions //===----------------------------------------------------------------------===// // FIXME: Provide proper encoding! let isReturn = 1, isTerminator = 1 in { def RETI : Pseudo<(outs), (ins), "reti", [(retflag)]>; } //===----------------------------------------------------------------------===// // Move Instructions // FIXME: Provide proper encoding! let neverHasSideEffects = 1 in { def MOV16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src), "mov.w\t{$src, $dst|$dst, $src}", []>; } // FIXME: Provide proper encoding! let isReMaterializable = 1, isAsCheapAsAMove = 1 in { def MOV16ri : Pseudo<(outs GR16:$dst), (ins i16imm:$src), "mov.w\t{$src, $dst|$dst, $src}", [(set GR16:$dst, imm:$src)]>; } //===----------------------------------------------------------------------===// // Arithmetic Instructions let Defs = [SR] in { let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y // FIXME: Provide proper encoding! def ADD16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2), "add.w\t{$src2, $dst|$dst, $src2}", [(set GR16:$dst, (add GR16:$src1, GR16:$src2)), (implicit SR)]>; } }