Skip to content

simd: Use __riscv_vsetvl_eXXm1 function to get the actual width of RVV instructions - #10310

Merged
edsiper merged 1 commit into
masterfrom
cosmo0920-rigid-vlen-handlings-on-rvv
May 8, 2025
Merged

simd: Use __riscv_vsetvl_eXXm1 function to get the actual width of RVV instructions#10310
edsiper merged 1 commit into
masterfrom
cosmo0920-rigid-vlen-handlings-on-rvv

Conversation

@cosmo0920

@cosmo0920 cosmo0920 commented May 8, 2025

Copy link
Copy Markdown
Contributor

This is because RVV instructions are truely hardware dependent. So, we need to obtain the actual width with the specific instriction of RVV extentions.

We use 1 segment of 8 or 32 elements of RVV or other SIMD instructions.
So, in RVV, we need to obtain the actual size of VLEN on the RISC-V CPU.
This could be enabled with the following instructions:

  • __riscv_vsetvl_e8m1
  • __riscv_vsetvl_e32m1

Note that the current implementation is also good but it is only effective for VLEN = 128 environments.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

…V instructions

This is because RVV instructions are truely hardware dependent.
So, we need to obtain the actual width with the specific instriction of
RVV extentions.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@leonardo-albertovich

Copy link
Copy Markdown
Contributor

@edsiper shouldn't we move the simd stuff to cfl while it's still small so we can use it in other places in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants