This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][Clang] Add RVV Widening Integer Add/Subtract intrinsic functions.
ClosedPublic

Authored by khchen on Mar 29 2021, 11:41 AM.

Diff Detail

Event Timeline

khchen created this revision.Mar 29 2021, 11:41 AM
khchen requested review of this revision.Mar 29 2021, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2021, 11:41 AM
khchen updated this revision to Diff 334178.Mar 30 2021, 8:53 AM

Create a common class.

craig.topper added inline comments.Mar 31 2021, 4:43 PM
clang/include/clang/Basic/riscv_vector.td
345

sufffix->suffix

365

sufffix->suffix

375

widden->widen

375

I'm not sure having a multiclass that takes a bool is better than just having 2 different multiclasses.

388

widden->widen

clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vwadd.c
36

Why do scalars require _wx or _vx, but vector don't need a suffix?

khchen updated this revision to Diff 334647.Apr 1 2021, 4:33 AM

Address Craig's comments. Sorry for a lot of typos.

clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vwadd.c
36

https://github.com/riscv/rvv-intrinsic-doc/blob/master/rvv-intrinsic-rfc.md#widening-vector-scalar-arithmetic-instructions
There is different overloading naming rule for _wx and _vx, and I just keep the default naming rule for vector version because I felt the overloading rule did not care about the naming consistent.

But in https://github.com/riscv/rvv-intrinsic-doc/pull/76 we start to make overloading name seems more consistent. So I think making this case consistent is ok to me.

I could send a PR to intrinsic-doc, what do you think?

khchen marked 6 inline comments as done.Apr 1 2021, 4:34 AM
khchen updated this revision to Diff 334648.Apr 1 2021, 4:39 AM

update missed part for Log2LMUL.

khchen added inline comments.Apr 6 2021, 4:10 AM
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vwadd.c
36

Should I update this patch for https://github.com/riscv/rvv-intrinsic-doc/pull/77 PR?

craig.topper added inline comments.Apr 6 2021, 10:06 AM
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vwadd.c
36

I think that makes sense. It's more consistent for someone writing intrinsic code if the suffix is always there.

This revision is now accepted and ready to land.Apr 7 2021, 10:07 AM
clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vwsub.c