NVPTXInstrFormats.td 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //===- NVPTXInstrFormats.td - NVPTX Instruction Formats-------*- tblgen -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //===----------------------------------------------------------------------===//
  9. // Describe NVPTX instructions format
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // Vector instruction type enum
  13. class VecInstTypeEnum<bits<4> val> {
  14. bits<4> Value=val;
  15. }
  16. def VecNOP : VecInstTypeEnum<0>;
  17. // Generic NVPTX Format
  18. class NVPTXInst<dag outs, dag ins, string asmstr, list<dag> pattern>
  19. : Instruction {
  20. field bits<14> Inst;
  21. let Namespace = "NVPTX";
  22. dag OutOperandList = outs;
  23. dag InOperandList = ins;
  24. let AsmString = asmstr;
  25. let Pattern = pattern;
  26. // TSFlagFields
  27. bits<4> VecInstType = VecNOP.Value;
  28. bit IsSimpleMove = false;
  29. bit IsLoad = false;
  30. bit IsStore = false;
  31. bit IsTex = false;
  32. bit IsSust = false;
  33. bit IsSurfTexQuery = false;
  34. bit IsTexModeUnified = false;
  35. // The following field is encoded as log2 of the vector size minus one,
  36. // with 0 meaning the operation is not a surface instruction. For example,
  37. // if IsSuld == 2, then the instruction is a suld instruction with vector size
  38. // 2**(2-1) = 2.
  39. bits<2> IsSuld = 0;
  40. let TSFlags{3...0} = VecInstType;
  41. let TSFlags{4...4} = IsSimpleMove;
  42. let TSFlags{5...5} = IsLoad;
  43. let TSFlags{6...6} = IsStore;
  44. let TSFlags{7} = IsTex;
  45. let TSFlags{9...8} = IsSuld;
  46. let TSFlags{10} = IsSust;
  47. let TSFlags{11} = IsSurfTexQuery;
  48. let TSFlags{12} = IsTexModeUnified;
  49. }