This is an archive of the discontinued LLVM Phabricator instance.

[10/11][POC][Clang][RISCV] Define vget for tuple type
ClosedPublic

Authored by eopXD on Apr 10 2023, 12:43 AM.

Details

Summary

For the cover letter of this patch-set, please checkout D146872.

Depends on D147915.

This is the 10th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Only vget for tuple type of NF=2, EEW=32, LMUL=1 is
defined now.

Diff Detail

Event Timeline

eopXD created this revision.Apr 10 2023, 12:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 12:43 AM
eopXD requested review of this revision.Apr 10 2023, 12:43 AM
eopXD retitled this revision from [10/N][POC][Clang] Define vget for tuple type to [10/11][POC][Clang][RISCV] Define vget for tuple type.Apr 10 2023, 12:59 AM
eopXD edited the summary of this revision. (Show Details)
craig.topper added inline comments.Apr 18 2023, 4:55 PM
clang/include/clang/Basic/riscv_vector.td
2545

Does SemaChecking.cpp already guarantee Index is less than Maxindex?

craig.topper added inline comments.Apr 18 2023, 4:58 PM
clang/include/clang/Basic/riscv_vector.td
2545

Actually it looks like maybe SemaChecking considers MaxIndex to be LMUL*NF? Does that mean vget can extract an LMUL1 value from an LMUL4 tuple?

eopXD updated this revision to Diff 516338.EditedApr 24 2023, 3:10 AM

Add test case for out of range vget and address comment from Craig.

eopXD marked 2 inline comments as done.Apr 24 2023, 3:11 AM
eopXD added inline comments.
clang/include/clang/Basic/riscv_vector.td
2545

Modified code under SemaChecking.cpp for vector tuple types.

eopXD edited the summary of this revision. (Show Details)May 17 2023, 12:58 AM
eopXD updated this revision to Diff 522946.May 17 2023, 1:40 AM
eopXD marked an inline comment as done.

Rebase and fix test case failure by only defining intrinsics for vint32m1x2_t.

eopXD edited the summary of this revision. (Show Details)May 17 2023, 1:40 AM
evandro removed a subscriber: evandro.May 17 2023, 3:52 PM
craig.topper added inline comments.May 18 2023, 6:31 PM
clang/include/clang/Basic/riscv_vector.td
2542

You can drop this assert. cast already has the same assert.

2545

Does this min do anything or does SemaChecking already guarantee it?

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vget_tuple.c
19

index argument is unused

clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/vget-index-out-of-range.c
343

index argument is unused

eopXD updated this revision to Diff 523643.May 18 2023, 8:15 PM
eopXD marked 4 inline comments as done.

Address comments from Craig.`

clang/include/clang/Basic/riscv_vector.td
2545

Yes, SemaChecking should be able to guard the value correctly and this line is redundant.

eopXD updated this revision to Diff 523646.May 18 2023, 8:25 PM

Update code.

This revision is now accepted and ready to land.May 18 2023, 9:39 PM
eopXD updated this revision to Diff 523865.May 19 2023, 11:05 AM

Add unsigned cast to eliminate compile warning.

This revision was landed with ongoing or failed builds.May 22 2023, 4:29 AM
This revision was automatically updated to reflect the committed changes.