Page MenuHomePhabricator

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

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

Diff Detail

Unit TestsFailed

TimeTest
140 msx64 debian > cfi-devirt-lld-thinlto-x86_64.icall::bad-signature.c
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang -m64 -fuse-ld=lld -flto=thin -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/cfi/Devirt-lld-thinlto-x86_64/icall/Output/bad-signature.c.tmp1 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/cfi/icall/bad-signature.c
120 msx64 debian > cfi-devirt-lld-x86_64.icall::bad-signature.c
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang -m64 -fuse-ld=lld -flto -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/cfi/Devirt-lld-x86_64/icall/Output/bad-signature.c.tmp1 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/cfi/icall/bad-signature.c
110 msx64 debian > cfi-standalone-lld-thinlto-x86_64.icall::bad-signature.c
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang -m64 -fuse-ld=lld -flto=thin -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/cfi/Standalone-lld-thinlto-x86_64/icall/Output/bad-signature.c.tmp1 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/cfi/icall/bad-signature.c
120 msx64 debian > cfi-standalone-lld-x86_64.icall::bad-signature.c
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang -m64 -fuse-ld=lld -flto -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/cfi/Standalone-lld-x86_64/icall/Output/bad-signature.c.tmp1 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/cfi/icall/bad-signature.c

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
355

sufffix->suffix

375

sufffix->suffix

385

widden->widen

385

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

398

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