Page MenuHomePhabricator

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

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

Diff Detail

Event Timeline

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

Create a common class.

craig.topper added inline comments.Wed, Mar 31, 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.Thu, Apr 1, 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.Thu, Apr 1, 4:34 AM
khchen updated this revision to Diff 334648.Thu, Apr 1, 4:39 AM

update missed part for Log2LMUL.

khchen added inline comments.Tue, Apr 6, 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.Tue, Apr 6, 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.Wed, Apr 7, 10:07 AM