This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add intrinsics support for RISCV XTHeadVdot Extension
Needs ReviewPublic

Authored by JojoR on Jan 9 2023, 7:35 PM.

Details

Summary

This patch adds clang support for XTHeadVdot extension,
which is documented here, it's based on standard vector extension v1.0:

https://github.com/T-head-Semi/thead-extension-spec

Diff Detail

Event Timeline

JojoR created this revision.Jan 9 2023, 7:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 7:35 PM
JojoR requested review of this revision.Jan 9 2023, 7:35 PM
jrtc27 added inline comments.Jan 9 2023, 8:04 PM
clang/include/clang/Basic/riscv_vector.td
2345

This is an ugly name that isn't consistent with anything...

clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/xtheadvdot-vmaqa.c
5

Still not sure if these should be in riscv_vector.h or not... probably makes sense but a part of me says no

JojoR updated this revision to Diff 487657.Jan 9 2023, 8:16 PM
JojoR marked an inline comment as done.
JojoR added inline comments.
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/xtheadvdot-vmaqa.c
5

Any suggestions ?

JojoR updated this revision to Diff 487658.Jan 9 2023, 8:21 PM
kito-cheng added inline comments.Jan 10 2023, 5:48 AM
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/xtheadvdot-vmaqa.c
5

Separated header file would be better, maybe thead_vector.h, and also extend the pragma syntax to #pragma clang riscv intrinsic thead-vector.

so the content of thead_vector.h only need header guard #pragma clang riscv intrinsic thead-vector.

JojoR added inline comments.Jan 17 2023, 1:09 AM
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/xtheadvdot-vmaqa.c
5

Ok & thanks, I will update later :)

JojoR updated this revision to Diff 501029.Feb 27 2023, 9:51 PM

Separated header file would be better, maybe thead_vector.h, and also extend the pragma syntax to #pragma clang riscv intrinsic thead-vector.
so the content of thead_vector.h only need header guard #pragma clang riscv intrinsic thead-vector.

@kito-cheng From RVV pragma implementation, the 'xtheadvdot' intrinsics could been filtered out according to command line.
Of course I could add thead_vector.h and include vector.h, but is it really necessary ?

JojoR added a comment.Mar 7 2023, 6:12 PM

Separated header file would be better, maybe thead_vector.h, and also extend the pragma syntax to #pragma clang riscv intrinsic thead-vector.
so the content of thead_vector.h only need header guard #pragma clang riscv intrinsic thead-vector.

@kito-cheng From RVV pragma implementation, the 'xtheadvdot' intrinsics could been filtered out according to command line.
Of course I could add thead_vector.h and include vector.h, but is it really necessary ?

@kito-cheng Ping ...

FYI: https://reviews.llvm.org/D148308, this patch has implemented a new pragma, you can reference that to separated t-head stuffs from riscv_vector.h

Unit tests?

evandro removed a subscriber: evandro.Jul 21 2023, 3:49 PM