• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16def RndDefault     : RoundingMode<0>;
17def RndNearestEven : RoundingMode<1>;
18def RndNearestZero : RoundingMode<2>;
19def RndNegInf      : RoundingMode<3>;
20def RndPosInf      : RoundingMode<4>;
21def RndApprox      : RoundingMode<5>;*/
22
23
24// Rounding Mode Operand
25def RndMode : Operand<i32> {
26  let PrintMethod = "printRoundingMode";
27}
28
29def 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.
33def pred : PredicateOperand<OtherVT, (ops RegPred, i32imm),
34                                     (ops (i1 zero_reg), (i32 2))>;
35
36def RndModeOperand : Operand<OtherVT> {
37  let MIOperandInfo = (ops i32imm);
38}
39
40// Instruction Types
41let 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