Page MenuHomePhabricator

[3/N][RISCV] Model vxrm in C intrinsics for RVV fixed-point instruction vaadd
Needs ReviewPublic

Authored by eopXD on Wed, May 24, 7:11 PM.

Details

Summary

Depends on D151396.

This is the 3rd patch of the patch-set. For the cover letter of the
patch-set, please checkout D151395.

This commit consists of change in both clang front-end and RISC-
back-end.

In the front-end, this commit adds an additional operand to the C
intrinsics of vaadd, vaaddu, vasub, and vasubu, that models
the control of the rounding mode.

In the back-end, using vaadd as an example, this commit replaces the
existing int.riscv.vaadd.* with int.riscv.vaadd.rm.* that was
introduced in the previous patch, with the extra operand that models
the control of the rounding mode (vxrm) for RVV fixed-point
intrinsics.

Note: The first 3 commit of the patch-set shows the intent to model the
rounding mode for fixed-point intrinsics by applying change to
vaadd, vaaddu, vasub, and vasubu. The proceeding patch will
apply the change to the rest of the other fixed-point instructions.

Diff Detail

Unit TestsFailed

TimeTest
3,710 msx64 debian > AddressSanitizer-x86_64-linux-dynamic.TestCases/Linux::auto_memory_profile_test.cpp
Script: -- : 'RUN: at line 6'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libasan /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/Linux/auto_memory_profile_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/auto_memory_profile_test.cpp.tmp

Event Timeline

eopXD created this revision.Wed, May 24, 7:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, May 24, 7:11 PM
eopXD requested review of this revision.Wed, May 24, 7:11 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptWed, May 24, 7:11 PM
eopXD updated this revision to Diff 525413.Wed, May 24, 7:46 PM

Bump CI.

craig.topper added inline comments.Wed, May 24, 8:22 PM
clang/include/clang/Basic/riscv_vector.td
2134

Extra blank line

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaadd.c
16

The vxrm argument is unused

llvm/include/llvm/IR/IntrinsicsRISCV.td
1363–1364

Why did the intrinsic change names?

craig.topper added inline comments.Wed, May 24, 8:37 PM
llvm/include/llvm/IR/IntrinsicsRISCV.td
1363–1364

Nevermind. I misread this.

eopXD updated this revision to Diff 525463.EditedThu, May 25, 12:17 AM
eopXD marked 3 inline comments as done.

Address comments from Craig. Now the patch includes changes to vaadd, vaaddu, vasub, and vasubu.

eopXD marked an inline comment as done.Thu, May 25, 12:18 AM
eopXD added inline comments.
llvm/include/llvm/IR/IntrinsicsRISCV.td
1363–1364

Marking this as done.

eopXD edited the summary of this revision. (Show Details)Thu, May 25, 12:19 AM
eopXD edited the summary of this revision. (Show Details)Thu, May 25, 12:22 AM
eopXD updated this revision to Diff 525473.Thu, May 25, 12:37 AM

Bump CI because previous diff failed in patch application.

eopXD updated this revision to Diff 525951.Thu, May 25, 11:14 PM

Resolve test failure.

craig.topper added inline comments.Wed, May 31, 1:01 PM
clang/include/clang/Basic/riscv_vector.td
2079

enum name needs __ prefix

2080

These need __ prefix