This is an archive of the discontinued LLVM Phabricator instance.

[Clang][RISCV] Add vsetvl and vsetvlmax.
ClosedPublic

Authored by khchen on Feb 16 2021, 11:23 PM.

Diff Detail

Event Timeline

khchen created this revision.Feb 16 2021, 11:23 PM
khchen requested review of this revision.Feb 16 2021, 11:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2021, 11:23 PM
craig.topper added inline comments.Feb 25 2021, 1:11 PM
clang/include/clang/Basic/riscv_vector.td
165

Why do we need a flag? Can we just make ManualCodegen and ManualCodegenMask default to empty rather than a code sequence that we should never use? Then we can just detect them not being empty in place of the flag.

clang/utils/TableGen/RISCVVEmitter.cpp
921

!HeaderCodeStr.empty()

1039–1040

It doesn't make sense to me to skip the emitExtDefStr for !hasAutoDef. The intrinsics without a definition are still sorted with the others. If they happen to have non-zero extensions and on the boundary of the different extension regions in the sorted list we still need to manage the #if/#endif for that boundary.

khchen updated this revision to Diff 326612.Feb 25 2021, 11:39 PM
khchen marked 3 inline comments as done.

address Craig's comments.

clang/utils/TableGen/RISCVVEmitter.cpp
1039–1040

You are right, thanks for catch bug!

craig.topper added inline comments.Mar 15 2021, 1:48 PM
clang/lib/Basic/Targets/RISCV.cpp
163

I'm not sure if it makes sense to expose these from the compiler. Should we define them in the header instead? They don't look useful without the header. Most of the defines from the compiler are expressing capabilities like what features are enabled so these seem different.

168

Are intending to support e128?

clang/utils/TableGen/RISCVVEmitter.cpp
775

!HeaderCode.empty()

khchen updated this revision to Diff 331267.Mar 17 2021, 7:51 AM
khchen marked 2 inline comments as done.
  1. address Craig's comments.
  2. update test by using 2>&1 instead of 2>%t
khchen marked an inline comment as done.Mar 17 2021, 8:59 AM
khchen added inline comments.
clang/lib/Basic/Targets/RISCV.cpp
168

remove! thanks

This revision is now accepted and ready to land.Mar 17 2021, 12:13 PM