Support RVV v0.12 intrinsics for row_rvv.cc & scale_rvv.cc

1. Add two defined marco LIBYUV_RVV_HAS_TUPLE_TYPE & LIBYUV_RVV_HAS_VXRM_ARG

Intrinsic v0.12 introduces
- tuple type in segment load & store
- vxrm argument in fixed-point intrinsics (e.g vnclip)

These two marcos are controled by __riscv_v_intrinsic.

2. Support RVV v0.12 intrinsics in row_rvv.cc & scale_rvv.cc

Change-Id: I921f91d9dc8fdda031e7b6647d0e296aa2793c39
Signed-off-by: Bruce Lai <bruce.lai@sifive.com>
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4767120
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Bruce Lai 2023-08-09 19:41:31 -07:00 committed by Frank Barchard
parent 5adc2ce2cb
commit 7758c961c5
5 changed files with 2100 additions and 6 deletions

View File

@ -841,8 +841,15 @@ extern "C" {
#endif #endif
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) #if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector)
#if __riscv_v_intrinsic > 11000
// Since v0.12, TUPLE_TYPE is introduced for segment load and store.
#define LIBYUV_RVV_HAS_TUPLE_TYPE
// Since v0.12, VXRM(fixed-point rounding mode) is included in arguments of
// fixed-point intrinsics.
#define LIBYUV_RVV_HAS_VXRM_ARG
#endif
#define HAS_COPYROW_RVV #define HAS_COPYROW_RVV
#if __riscv_v_intrinsic == 11000
#define HAS_AB64TOARGBROW_RVV #define HAS_AB64TOARGBROW_RVV
#define HAS_ABGRTOYJROW_RVV #define HAS_ABGRTOYJROW_RVV
#define HAS_ABGRTOYROW_RVV #define HAS_ABGRTOYROW_RVV
@ -900,7 +907,6 @@ extern "C" {
#define HAS_SPLITUVROW_RVV #define HAS_SPLITUVROW_RVV
#define HAS_SPLITXRGBROW_RVV #define HAS_SPLITXRGBROW_RVV
#endif #endif
#endif
#if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
#if defined(VISUALC_HAS_AVX2) #if defined(VISUALC_HAS_AVX2)

View File

@ -184,7 +184,6 @@ extern "C" {
// #define HAS_SCALEARGBROWDOWNEVEN_RVV // #define HAS_SCALEARGBROWDOWNEVEN_RVV
#define HAS_SCALEUVROWDOWN4_RVV #define HAS_SCALEUVROWDOWN4_RVV
#define HAS_SCALEUVROWDOWNEVEN_RVV #define HAS_SCALEUVROWDOWNEVEN_RVV
#if __riscv_v_intrinsic == 11000
#define HAS_SCALEARGBROWDOWN2_RVV #define HAS_SCALEARGBROWDOWN2_RVV
#define HAS_SCALEARGBROWDOWN2BOX_RVV #define HAS_SCALEARGBROWDOWN2BOX_RVV
#define HAS_SCALEARGBROWDOWN2LINEAR_RVV #define HAS_SCALEARGBROWDOWN2LINEAR_RVV
@ -208,7 +207,6 @@ extern "C" {
#define HAS_SCALEUVROWUP2_BILINEAR_RVV #define HAS_SCALEUVROWUP2_BILINEAR_RVV
#define HAS_SCALEUVROWUP2_LINEAR_RVV #define HAS_SCALEUVROWUP2_LINEAR_RVV
#endif #endif
#endif
// Scale ARGB vertically with bilinear interpolation. // Scale ARGB vertically with bilinear interpolation.
void ScalePlaneVertical(int src_height, void ScalePlaneVertical(int src_height,

View File

@ -43,6 +43,7 @@ if(RISCV_COMPILER_FLAGS STREQUAL "")
list(APPEND RISCV_COMPILER_FLAGS "-march=rv64gc") list(APPEND RISCV_COMPILER_FLAGS "-march=rv64gc")
endif() endif()
endif() endif()
add_compile_options("-Wuninitialized")
message(STATUS "RISCV_COMPILER_FLAGS: ${RISCV_COMPILER_FLAGS}") message(STATUS "RISCV_COMPILER_FLAGS: ${RISCV_COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${RISCV_COMPILER_FLAGS} ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "${RISCV_COMPILER_FLAGS} ${CMAKE_C_FLAGS}")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff