[PATCH] D109322: [RISCV] (2/2) Add the tail policy argument to builtins/intrinsics.

Zakk Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 23 00:57:04 PDT 2021


khchen added inline comments.
Herald added a subscriber: achieveartificialintelligence.


================
Comment at: clang/include/clang/Basic/riscv_vector.td:181
+  // no need to specify the tail policy.
+  bit HasPolicy = true;
+
----------------
Add more comment like:
If `HasPolicy`, masked operation have tail policy argument in the last position, and append `t` in function name. 
and update the HasVL comment too.

personally, I prefer the naming like `HasTailPolicy`, `HasTail` or `HasTailOperand`.


================
Comment at: clang/include/clang/Basic/riscv_vector.td:2186
+}] in
+def policy : RVVHeader;
----------------
It seems like we can rewrite `vsetvli/vsetvl` and ` vsetvlmax` instructions by using the `RVVHeader` mechanism?
We only need to have one mechanism to dump header code.


================
Comment at: clang/test/CodeGen/RISCV/rvv-intrinsics/vadd.c:14
 //
-vint8mf8_t test_vadd_vv_i8mf8(vint8mf8_t op1, vint8mf8_t op2, size_t vl) {
+vint8mf8_t test_vadd_vv_i8mf8 (vint8mf8_t op1, vint8mf8_t op2, size_t vl) {
   return vadd_vv_i8mf8(op1, op2, vl);
----------------
Nit: we don't need to add a space here.


================
Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:1180
     }
     // If HasVL, append 'z' to last operand
     if (HasVL) {
----------------
Nit: update this comment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109322/new/

https://reviews.llvm.org/D109322



More information about the cfe-commits mailing list