[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-23 Thread Zakk Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG88c2d4c8eb0e: [RISCV][Clang] Add RVV Vector Indexed Load 
intrinsic functions. (authored by khchen).

Changed prior to commit:
  https://reviews.llvm.org/D98848?vs=332660&id=332850#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/test/CodeGen/RISCV/rvv-intrinsics/vloxei.c
  clang/test/CodeGen/RISCV/rvv-intrinsics/vluxei.c
  clang/utils/TableGen/RISCVVEmitter.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-23 Thread Craig Topper via Phabricator via cfe-commits
craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.

LGTM




Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:23
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Regex.h"
 #include "llvm/TableGen/Error.h"

Drop this now that we're not using Regex


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-23 Thread Liao Chunyu via Phabricator via cfe-commits
liaolucy added a comment.

LGTM, thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-23 Thread Zakk Chen via Phabricator via cfe-commits
khchen updated this revision to Diff 332660.
khchen marked 8 inline comments as done.
khchen added a comment.

1. address Craig's comments.
2. add 'REQUIRES: riscv-registered-target' for tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/test/CodeGen/RISCV/rvv-intrinsics/vloxei.c
  clang/test/CodeGen/RISCV/rvv-intrinsics/vluxei.c
  clang/utils/TableGen/RISCVVEmitter.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-22 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments.



Comment at: clang/include/clang/Basic/riscv_vector.td:90
+//  equivalent integer vector type with EEW and corresponding ELMUL (elmul 
=
+//  (eew/sew) * lmul). Fore example, vector type is __rvv_float16m4
+//  (SEW=16, LMUL=4) and Log2EEW is 3 (EEW=8), and then equivalent vector

Fore -> For



Comment at: clang/include/clang/Basic/riscv_vector.td:93
+//  type is __rvv_uint8m2_t (elmul=(8/16)*4 = 2). Ignore to define a new
+//  builtins if its qeuivalent type has illegal lmul.
 //

equivalent*



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:95
+  const std::string &getShortStr() {
+if (ShortStr.empty())
+  initShortStr();

Why would it be empty? Don't we call initShortStr in the constructor? This at 
least needs a comment explaining why it is different than the other get*Str 
functions.



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:621
+  // Extract and compute complex type transformer. It can only appear one time.
+  const Regex ComplexEx("\\((.*:.*)\\).*");
+  SmallVector Matches;

Do we really need a regex here? Can't we just check that it starts with '(' and 
then do a find for the ')'?



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:626
+   "only allow one complex type transformer");
+Transformer.consume_front(Twine("(" + Matches[1] + ")").str());
+auto UpdateAndCheckComplexProto = [&]() {

Can we do

```
Transformer = Transformer.drop_front(Matches[1].size() + 2);
```



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:1011
+size_t Idx = 0;
+// Bypass complex prototype because it could have primitive type
+// char.

I'd write this as "Skip over complex prototype because it could contain 
primitive type character."



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:1026
+  parsePrototypes(Prototypes, SuffixStrs,
+  [&](StringRef Proto, SmallVector &Result) {
+auto T = computeType(Type, Log2LMUL, Proto);

You don't need to pass SuffixStrs into parsePrototypes you can just capture it 
in the lambda and use SuffixStrs.push_back() in the lambda.



Comment at: clang/utils/TableGen/RISCVVEmitter.cpp:1066
+parsePrototypes(Prototypes, ProtoSeq,
+[](StringRef Proto, SmallVector &Result) {
+  Result.push_back(Proto.str());

Just capture ProtoSeq in the lambda capture list and use ProtoSeq.push_back in 
the body.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-22 Thread Zakk Chen via Phabricator via cfe-commits
khchen updated this revision to Diff 332341.
khchen added a comment.

update tests, remove target-feature zfh.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/test/CodeGen/RISCV/rvv-intrinsics/vloxei.c
  clang/test/CodeGen/RISCV/rvv-intrinsics/vluxei.c
  clang/utils/TableGen/RISCVVEmitter.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-22 Thread Zakk Chen via Phabricator via cfe-commits
khchen updated this revision to Diff 332307.
khchen added a comment.

Remove half type in TypeList.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98848

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/test/CodeGen/RISCV/rvv-intrinsics/vloxei.c
  clang/test/CodeGen/RISCV/rvv-intrinsics/vluxei.c
  clang/utils/TableGen/RISCVVEmitter.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D98848: [RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

2021-03-18 Thread Zakk Chen via Phabricator via cfe-commits
khchen created this revision.
khchen added reviewers: craig.topper, jrtc27, rogfer01, frasercrmck, HsiangKai, 
evandro.
Herald added subscribers: vkmr, dexonsmith, luismarques, apazos, 
sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, arphaman, the_o, 
brucehoult, MartinMosbeck, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, 
sabuasal, simoncook, johnrusso, rbar, asb.
khchen requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

Support Complex type transformer to define more complexity legal type.

Overall our downstream implementation there are only four instructions need to
use complex type transformer, it's not a common case.
I still feel using a string for prototypes is simple and clear.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98848

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/test/CodeGen/RISCV/rvv-intrinsics/vloxei.c
  clang/test/CodeGen/RISCV/rvv-intrinsics/vluxei.c
  clang/utils/TableGen/RISCVVEmitter.cpp

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits