This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.
ClosedPublic

Authored by khchen on Mar 18 2021, 3:11 AM.

Details

Summary

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.

Diff Detail

Event Timeline

khchen created this revision.Mar 18 2021, 3:11 AM
khchen requested review of this revision.Mar 18 2021, 3:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2021, 3:11 AM
khchen updated this revision to Diff 332307.Mar 22 2021, 9:01 AM

Remove half type in TypeList.

khchen updated this revision to Diff 332341.Mar 22 2021, 9:56 AM

update tests, remove target-feature zfh.

craig.topper added inline comments.Mar 22 2021, 3:40 PM
clang/include/clang/Basic/riscv_vector.td
90

Fore -> For

93

equivalent*

clang/utils/TableGen/RISCVVEmitter.cpp
94

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.

620

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

625

Can we do

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

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

1027

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.

1065

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

khchen updated this revision to Diff 332660.Mar 23 2021, 6:52 AM
khchen marked 8 inline comments as done.
  1. address Craig's comments.
  2. add 'REQUIRES: riscv-registered-target' for tests.

LGTM, thanks

craig.topper accepted this revision.Mar 23 2021, 12:02 PM

LGTM

clang/utils/TableGen/RISCVVEmitter.cpp
23

Drop this now that we're not using Regex

This revision is now accepted and ready to land.Mar 23 2021, 12:02 PM
clang/include/clang/Basic/riscv_vector.td