mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
RVV: Enable some function for intrinsic >= v1.0
According to README of rvv-intrinsic-doc, Clang 19 and GCC 14 supports the v1.0 version. But __riscv_v_intrinsic is 12000 on Clang 19, so need Clang >= 20 to test this patch. I test it with Clang 21. Change-Id: I0e75efcdab3e7bc0ce1acd19eca3568b47c84cbf Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6995438 Reviewed-by: Justin Green <greenjustin@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
738a53ce27
commit
e237e8d7fb
@ -823,7 +823,11 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector)
|
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector)
|
||||||
#if defined(__riscv_v_intrinsic) && __riscv_v_intrinsic > 11000
|
#if defined(__riscv_v_intrinsic) && __riscv_v_intrinsic >= 100000
|
||||||
|
// Since v1.0, vcreate intrinsic is introduced
|
||||||
|
#define LIBYUV_RVV_HAS_VCREATE
|
||||||
|
#endif
|
||||||
|
#if defined(__riscv_v_intrinsic) && __riscv_v_intrinsic >= 12000
|
||||||
// Since v0.12, TUPLE_TYPE is introduced for segment load and store.
|
// Since v0.12, TUPLE_TYPE is introduced for segment load and store.
|
||||||
#define LIBYUV_RVV_HAS_TUPLE_TYPE
|
#define LIBYUV_RVV_HAS_TUPLE_TYPE
|
||||||
// Since v0.12, VXRM(fixed-point rounding mode) is included in arguments of
|
// Since v0.12, VXRM(fixed-point rounding mode) is included in arguments of
|
||||||
@ -832,7 +836,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The following are available for RVV 1.2
|
|
||||||
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector)
|
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector)
|
||||||
#define HAS_ABGRTOYJROW_RVV
|
#define HAS_ABGRTOYJROW_RVV
|
||||||
#define HAS_ABGRTOYROW_RVV
|
#define HAS_ABGRTOYROW_RVV
|
||||||
@ -858,10 +861,9 @@ extern "C" {
|
|||||||
#define HAS_SPLITRGBROW_RVV
|
#define HAS_SPLITRGBROW_RVV
|
||||||
#define HAS_SPLITUVROW_RVV
|
#define HAS_SPLITUVROW_RVV
|
||||||
#define HAS_SPLITXRGBROW_RVV
|
#define HAS_SPLITXRGBROW_RVV
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available for RVV 1.1
|
// The following are available for RVV v0.11 and RVV v1.0
|
||||||
// TODO(fbarchard): Port to RVV 1.2 (tuple)
|
// TODO(fbarchard): Port to RVV v0.12 (tuple)
|
||||||
// missing support for vcreate_v:
|
// missing support for vcreate_v:
|
||||||
// __riscv_vcreate_v_u16m2x2
|
// __riscv_vcreate_v_u16m2x2
|
||||||
// __riscv_vcreate_v_u16m2x4
|
// __riscv_vcreate_v_u16m2x4
|
||||||
@ -872,8 +874,8 @@ extern "C" {
|
|||||||
// __riscv_vcreate_v_u8m2x3
|
// __riscv_vcreate_v_u8m2x3
|
||||||
// __riscv_vcreate_v_u8m2x4
|
// __riscv_vcreate_v_u8m2x4
|
||||||
// __riscv_vcreate_v_u8m4x2
|
// __riscv_vcreate_v_u8m4x2
|
||||||
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) && \
|
#if !defined(LIBYUV_RVV_HAS_TUPLE_TYPE) || \
|
||||||
!defined(LIBYUV_RVV_HAS_TUPLE_TYPE)
|
(defined(LIBYUV_RVV_HAS_TUPLE_TYPE) && defined(LIBYUV_RVV_HAS_VCREATE))
|
||||||
#define HAS_AB64TOARGBROW_RVV
|
#define HAS_AB64TOARGBROW_RVV
|
||||||
#define HAS_AR64TOAB64ROW_RVV
|
#define HAS_AR64TOAB64ROW_RVV
|
||||||
#define HAS_ARGBATTENUATEROW_RVV
|
#define HAS_ARGBATTENUATEROW_RVV
|
||||||
@ -908,6 +910,7 @@ extern "C" {
|
|||||||
#define HAS_RGB24TOARGBROW_RVV
|
#define HAS_RGB24TOARGBROW_RVV
|
||||||
#define HAS_RGBATOARGBROW_RVV
|
#define HAS_RGBATOARGBROW_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)
|
||||||
|
|||||||
@ -157,10 +157,11 @@ extern "C" {
|
|||||||
#define HAS_SCALEARGBROWDOWN2_RVV
|
#define HAS_SCALEARGBROWDOWN2_RVV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The following are available on RVV 1.1
|
|
||||||
// TODO: Port to RVV 1.2
|
|
||||||
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) && \
|
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) && \
|
||||||
defined(__riscv_v_intrinsic) && __riscv_v_intrinsic == 11000
|
defined(__riscv_v_intrinsic)
|
||||||
|
// The following are available on RVV v0.11 and RVV v1.0
|
||||||
|
// TODO: Port to RVV v0.12
|
||||||
|
#if __riscv_v_intrinsic == 11000 || __riscv_v_intrinsic >= 100000
|
||||||
#define HAS_SCALEROWDOWN34_0_BOX_RVV
|
#define HAS_SCALEROWDOWN34_0_BOX_RVV
|
||||||
#define HAS_SCALEROWDOWN34_1_BOX_RVV
|
#define HAS_SCALEROWDOWN34_1_BOX_RVV
|
||||||
#define HAS_SCALEROWDOWN38_2_BOX_RVV
|
#define HAS_SCALEROWDOWN38_2_BOX_RVV
|
||||||
@ -171,12 +172,7 @@ extern "C" {
|
|||||||
#define HAS_SCALEROWDOWN38_RVV
|
#define HAS_SCALEROWDOWN38_RVV
|
||||||
#define HAS_SCALEROWUP2_BILINEAR_RVV
|
#define HAS_SCALEROWUP2_BILINEAR_RVV
|
||||||
#define HAS_SCALEROWUP2_LINEAR_RVV
|
#define HAS_SCALEROWUP2_LINEAR_RVV
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available on RVV
|
|
||||||
#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) && \
|
|
||||||
defined(__riscv_v_intrinsic) && __riscv_v_intrinsic == 11000
|
|
||||||
#define HAS_SCALEARGBFILTERCOLS_RVV
|
|
||||||
#define HAS_SCALEARGBROWDOWN2BOX_RVV
|
#define HAS_SCALEARGBROWDOWN2BOX_RVV
|
||||||
#define HAS_SCALEARGBROWDOWN2LINEAR_RVV
|
#define HAS_SCALEARGBROWDOWN2LINEAR_RVV
|
||||||
#define HAS_SCALEARGBROWDOWNEVENBOX_RVV
|
#define HAS_SCALEARGBROWDOWNEVENBOX_RVV
|
||||||
@ -194,6 +190,12 @@ extern "C" {
|
|||||||
#define HAS_SCALEUVROWDOWN2LINEAR_RVV
|
#define HAS_SCALEUVROWDOWN2LINEAR_RVV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The following are available on RVV v0.11
|
||||||
|
#if __riscv_v_intrinsic == 11000
|
||||||
|
#define HAS_SCALEARGBFILTERCOLS_RVV
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Scale ARGB vertically with bilinear interpolation.
|
// Scale ARGB vertically with bilinear interpolation.
|
||||||
void ScalePlaneVertical(int src_height,
|
void ScalePlaneVertical(int src_height,
|
||||||
int dst_width,
|
int dst_width,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user