//===- Nios2InstrInfo.td - Target Description for Nios2 ------*- tablegen -*-=// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the Nios2 implementation of the TargetInstrInfo class. // //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // Instruction format superclass //===----------------------------------------------------------------------===// include "Nios2InstrFormats.td" //===----------------------------------------------------------------------===// // Nios2 Operand, Complex Patterns and Transformations Definitions. //===----------------------------------------------------------------------===// def simm16 : Operand { let DecoderMethod= "DecodeSimm16"; } // Node immediate fits as 16-bit sign extended on target immediate. // e.g. addi, andi def immSExt16 : PatLeaf<(imm), [{ return isInt<16>(N->getSExtValue()); }]>; //===----------------------------------------------------------------------===// // Instructions specific format //===----------------------------------------------------------------------===// // Arithmetic and logical instructions with 2 register operands. class ArithLogicI op, string instr_asm, SDNode OpNode, Operand Od, PatLeaf imm_type, RegisterClass RC> : FI { let isReMaterializable = 1; } //===----------------------------------------------------------------------===// // Nios2 R1 Instructions //===----------------------------------------------------------------------===// /// Arithmetic Instructions (ALU Immediate) def ADDi : ArithLogicI<0x04, "addi", add, simm16, immSExt16, CPURegs>;