RISCVScheduleZb.td 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. //===-- RISCVScheduleB.td - RISCV Scheduling Definitions B -*- tablegen -*-===//
  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. /// Define scheduler resources associated with def operands.
  9. // Zba extension
  10. def WriteSHXADD : SchedWrite; // sh1add/sh2add/sh3add
  11. def WriteSHXADD32 : SchedWrite; // sh1add.uw/sh2add.uw/sh3add.uw
  12. // Zbb extension
  13. def WriteRotateImm : SchedWrite;
  14. def WriteRotateImm32 : SchedWrite;
  15. def WriteRotateReg : SchedWrite;
  16. def WriteRotateReg32 : SchedWrite;
  17. def WriteCLZ : SchedWrite;
  18. def WriteCLZ32 : SchedWrite;
  19. def WriteCTZ : SchedWrite;
  20. def WriteCTZ32 : SchedWrite;
  21. def WriteCPOP : SchedWrite;
  22. def WriteCPOP32 : SchedWrite;
  23. def WriteREV8 : SchedWrite;
  24. def WriteORCB : SchedWrite;
  25. // Zbc extension
  26. def WriteCLMUL : SchedWrite; // CLMUL/CLMULR/CLMULH
  27. // Zbs extension
  28. def WriteSingleBit : SchedWrite; // BCLR/BSET/BINV/BEXT
  29. def WriteSingleBitImm: SchedWrite; // BCLRI/BSETI/BINVI/BEXTI
  30. // Zbkb extension
  31. def WriteBREV8 : SchedWrite; // brev8
  32. def WritePACK : SchedWrite; // pack/packh
  33. def WritePACK32 : SchedWrite; // packw
  34. def WriteZIP : SchedWrite; // zip/unzip
  35. // Zbkx extension
  36. def WriteXPERM : SchedWrite; // xperm4/xperm8
  37. /// Define scheduler resources associated with use operands.
  38. // Zba extension
  39. def ReadSHXADD : SchedRead; // sh1add/sh2add/sh3add
  40. def ReadSHXADD32 : SchedRead; // sh1add.uw/sh2add.uw/sh3add.uw
  41. // Zbb extension
  42. def ReadRotateImm : SchedRead;
  43. def ReadRotateImm32 : SchedRead;
  44. def ReadRotateReg : SchedRead;
  45. def ReadRotateReg32 : SchedRead;
  46. def ReadCLZ : SchedRead;
  47. def ReadCLZ32 : SchedRead;
  48. def ReadCTZ : SchedRead;
  49. def ReadCTZ32 : SchedRead;
  50. def ReadCPOP : SchedRead;
  51. def ReadCPOP32 : SchedRead;
  52. def ReadREV8 : SchedRead;
  53. def ReadORCB : SchedRead;
  54. // Zbc extension
  55. def ReadCLMUL : SchedRead; // CLMUL/CLMULR/CLMULH
  56. // Zbs extension
  57. def ReadSingleBit : SchedRead; // BCLR/BSET/BINV/BEXT
  58. def ReadSingleBitImm: SchedRead; // BCLRI/BSETI/BINVI/BEXTI
  59. // Zbkb extension
  60. def ReadBREV8 : SchedRead; // brev8
  61. def ReadPACK : SchedRead; // pack/packh
  62. def ReadPACK32 : SchedRead; // packw
  63. def ReadZIP : SchedRead; // zip/unzip
  64. // Zbkx extension
  65. def ReadXPERM : SchedRead; // xperm4/xperm8
  66. /// Define default scheduler resources for B.
  67. multiclass UnsupportedSchedZba {
  68. let Unsupported = true in {
  69. def : WriteRes<WriteSHXADD, []>;
  70. def : WriteRes<WriteSHXADD32, []>;
  71. def : ReadAdvance<ReadSHXADD, 0>;
  72. def : ReadAdvance<ReadSHXADD32, 0>;
  73. }
  74. }
  75. multiclass UnsupportedSchedZbb {
  76. let Unsupported = true in {
  77. def : WriteRes<WriteRotateImm, []>;
  78. def : WriteRes<WriteRotateImm32, []>;
  79. def : WriteRes<WriteRotateReg, []>;
  80. def : WriteRes<WriteRotateReg32, []>;
  81. def : WriteRes<WriteCLZ, []>;
  82. def : WriteRes<WriteCLZ32, []>;
  83. def : WriteRes<WriteCTZ, []>;
  84. def : WriteRes<WriteCTZ32, []>;
  85. def : WriteRes<WriteCPOP, []>;
  86. def : WriteRes<WriteCPOP32, []>;
  87. def : WriteRes<WriteREV8, []>;
  88. def : WriteRes<WriteORCB, []>;
  89. def : ReadAdvance<ReadRotateImm, 0>;
  90. def : ReadAdvance<ReadRotateImm32, 0>;
  91. def : ReadAdvance<ReadRotateReg, 0>;
  92. def : ReadAdvance<ReadRotateReg32, 0>;
  93. def : ReadAdvance<ReadCLZ, 0>;
  94. def : ReadAdvance<ReadCLZ32, 0>;
  95. def : ReadAdvance<ReadCTZ, 0>;
  96. def : ReadAdvance<ReadCTZ32, 0>;
  97. def : ReadAdvance<ReadCPOP, 0>;
  98. def : ReadAdvance<ReadCPOP32, 0>;
  99. def : ReadAdvance<ReadREV8, 0>;
  100. def : ReadAdvance<ReadORCB, 0>;
  101. }
  102. }
  103. multiclass UnsupportedSchedZbc {
  104. let Unsupported = true in {
  105. def : WriteRes<WriteCLMUL, []>;
  106. def : ReadAdvance<ReadCLMUL, 0>;
  107. }
  108. }
  109. multiclass UnsupportedSchedZbs {
  110. let Unsupported = true in {
  111. def : WriteRes<WriteSingleBit, []>;
  112. def : WriteRes<WriteSingleBitImm, []>;
  113. def : ReadAdvance<ReadSingleBit, 0>;
  114. def : ReadAdvance<ReadSingleBitImm, 0>;
  115. }
  116. }
  117. multiclass UnsupportedSchedZbkb {
  118. let Unsupported = true in {
  119. def : WriteRes<WriteBREV8, []>;
  120. def : WriteRes<WritePACK, []>;
  121. def : WriteRes<WritePACK32, []>;
  122. def : WriteRes<WriteZIP, []>;
  123. def : ReadAdvance<ReadBREV8, 0>;
  124. def : ReadAdvance<ReadPACK, 0>;
  125. def : ReadAdvance<ReadPACK32, 0>;
  126. def : ReadAdvance<ReadZIP, 0>;
  127. }
  128. }
  129. multiclass UnsupportedSchedZbkx {
  130. let Unsupported = true in {
  131. def : WriteRes<WriteXPERM, []>;
  132. def : ReadAdvance<ReadXPERM, 0>;
  133. }
  134. }