Skip to content

Conversation

@ihb2032
Copy link

@ihb2032 ihb2032 commented Sep 5, 2025

This commit introduces a set of preprocessor macros to detect the version of the RISC-V Vector (RVV) extension. This provides a standardized way to write code that conditionally compiles based on the availability and version of RVV support.

The new macros are:

  • FOLLY_RVV: Defines the major version number of the RVV extension.
  • FOLLY_RVV_MINOR: Defines the minor version number of the RVV extension.
  • FOLLY_RVV_PREREQ(major, minor): A utility macro to check if the current RVV version meets a minimum requirement.

These macros parse the __riscv_v predefined macro, if it exists. If the compiler does not support RVV or the extension is not enabled, FOLLY_RVV and FOLLY_RVV_MINOR default to 0, ensuring backward compatibility.

This change enables future development of RVV-specific optimizations within Folly, improving performance and compatibility on the RISC-V platform.

This commit introduces a set of preprocessor macros to detect the version of the RISC-V Vector (RVV) extension. This provides a standardized way to write code that conditionally compiles based on the availability and version of RVV support.

The new macros are:
- FOLLY_RVV: Defines the major version number of the RVV extension.
- FOLLY_RVV_MINOR: Defines the minor version number of the RVV extension.
- FOLLY_RVV_PREREQ(major, minor): A utility macro to check if the current RVV version meets a minimum requirement.

These macros parse the __riscv_v predefined macro, if it exists. If the compiler does not support RVV or the extension is not enabled, FOLLY_RVV and FOLLY_RVV_MINOR default to 0, ensuring backward compatibility.

This change enables future development of RVV-specific optimizations within Folly, improving performance and compatibility on the RISC-V platform.

Signed-off-by: lyd1992 <liuyudong@iscas.ac.cn>
Signed-off-by: ihb2032 <1355790728@qq.com>
@meta-cla meta-cla bot added the CLA Signed label Sep 5, 2025
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.

1 participant