-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8297549: RISC-V: Add support for Vector API vector load const operation #11344
Conversation
👋 Welcome back dzhang! A progress list of the required criteria for merging this PR into |
@DingliZhang The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Can you also run whole tier2 please ? |
Thank you for your suggestion, of course! I will add the results of whole tier2 later. |
@DingliZhang This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 136 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@RealFYang) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Hi @VladimirKempik I've run tier2 and updated the test status at the top of the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
@VladimirKempik @RealFYang @zifeihan Thanks for the review! |
@DingliZhang |
/sponsor |
Going to push as commit 687fd71.
Your commit was automatically rebased without conflicts. |
@RealFYang @DingliZhang Pushed as commit 687fd71. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The instruction which is matched
VectorLoadConst
will create index starting from 0 and incremented by 1. In detail, the instruction populates the destination vector by setting the first element to 0 and monotonically incrementing the value by 1 for each subsequent element.We can add support of
VectorLoadConst
for RISC-V byvid.v
. It was implemented by referring to RVV v1.0 [1].We can use the JMH test from #10332. Tests are performed on qemu with parameter
-cpu rv64,v=true,vlen=256,vext_spec=v1.0
. By adding the-XX:+PrintAssembly
, the compilation log offloatIndexVector
is as follows:The above nodes match the logic of
Compute indexes with "vec + iota * scale"
in #10332, which is the operation corresponding toaddIndex
in benchmark:jdk/test/micro/org/openjdk/bench/jdk/incubator/vector/IndexVectorBenchmark.java
Lines 92 to 97 in d610211
At the same time, the following assembly code will be generated when running the
floatIndexVector
case, there will be one more instruction thanintIndexVector
:0x10072d7/0x5208a157
is the machine code forvsetvli/vid.v
and0x4a219157
is the additional machine code forvfcvt.f.x.v
, which are the opcodes generated byis_floating_point_type(bt)
:After we implement these nodes, by using
-XX:+UseRVV
, the number of assembly instructions is reduced by about ~50% because of the different execution paths with the number of loops, similar toAddTest
[3].[1] https://github.com/riscv/riscv-v-spec/blob/v1.0/v-spec.adoc
[2] https://github.com/openjdk/jdk/blob/857b0f9b05bc711f3282a0da85fcff131fffab91/test/micro/org/openjdk/bench/jdk/incubator/vector/IndexVectorBenchmark.java
[3] https://github.com/zifeihan/vector-api-test-rvv/blob/master/vector-api-rvv-performance.md
Please take a look and have some reviews. Thanks a lot.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11344/head:pull/11344
$ git checkout pull/11344
Update a local copy of the PR:
$ git checkout pull/11344
$ git pull https://git.openjdk.org/jdk pull/11344/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11344
View PR using the GUI difftool:
$ git pr show -t 11344
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11344.diff