1 //===- PTXInstrFormats.td - PTX Instruction Formats ----------*- tblgen -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 11 // Rounding Mode Specifier 12 /*class RoundingMode<bits<3> val> { 13 bits<3> Value = val; 14 } 15 16 def RndDefault : RoundingMode<0>; 17 def RndNearestEven : RoundingMode<1>; 18 def RndNearestZero : RoundingMode<2>; 19 def RndNegInf : RoundingMode<3>; 20 def RndPosInf : RoundingMode<4>; 21 def RndApprox : RoundingMode<5>;*/ 22 23 24 // Rounding Mode Operand 25 def RndMode : Operand<i32> { 26 let PrintMethod = "printRoundingMode"; 27 } 28 29 def RndDefault : PatLeaf<(i32 0)>; 30 31 // PTX Predicate operand, default to (0, 0) = (zero-reg, none). 32 // Leave PrintMethod empty; predicate printing is defined elsewhere. 33 def pred : PredicateOperand<OtherVT, (ops RegPred, i32imm), 34 (ops (i1 zero_reg), (i32 2))>; 35 36 def RndModeOperand : Operand<OtherVT> { 37 let MIOperandInfo = (ops i32imm); 38 } 39 40 // Instruction Types 41 let Namespace = "PTX" in { 42 43 class InstPTX<dag oops, dag iops, string asmstr, list<dag> pattern> 44 : Instruction { 45 dag OutOperandList = oops; 46 dag InOperandList = !con(iops, (ins pred:$_p)); 47 let AsmString = asmstr; // Predicate printing is defined elsewhere. 48 let Pattern = pattern; 49 let isPredicable = 1; 50 } 51 } 52