aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/riscv
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi@remlab.net>2023-12-05 17:54:26 +0200
committerRémi Denis-Courmont <remi@remlab.net>2023-12-08 17:21:09 +0200
commitb3825bbe452c8e4f129fa90bba1fed0ee7b87d71 (patch)
tree022ae13a579e7e282a307e009e7ce983aa2704f9 /libavcodec/riscv
parent0b9d009b4a85be31ed8ba1a9cece3b2db3e4d2f3 (diff)
downloadffmpeg-b3825bbe452c8e4f129fa90bba1fed0ee7b87d71.tar.gz
riscv: test for assembler support
This should fix the build on LLVM 16 and earlier, at the cost of turning all non-RVV optimisations off.
Diffstat (limited to 'libavcodec/riscv')
-rw-r--r--libavcodec/riscv/Makefile16
-rw-r--r--libavcodec/riscv/ac3dsp_init.c2
-rw-r--r--libavcodec/riscv/audiodsp_init.c2
-rw-r--r--libavcodec/riscv/bswapdsp_init.c2
-rw-r--r--libavcodec/riscv/pixblockdsp_init.c2
5 files changed, 16 insertions, 8 deletions
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 3c7fb63579..e9825c0856 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -1,15 +1,15 @@
OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o riscv/sbrdsp_init.o
RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o riscv/sbrdsp_rvv.o
-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_init.o \
- riscv/ac3dsp_rvb.o
+OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_init.o
+RV-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvb.o
RVV-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvv.o
OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o
RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o
-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \
- riscv/audiodsp_rvf.o
+OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o
+RV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvf.o
RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \
- riscv/bswapdsp_rvb.o
+OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o
+RV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvb.o
RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o
OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o
RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o
@@ -35,8 +35,8 @@ OBJS-$(CONFIG_LLVIDENCDSP) += riscv/llvidencdsp_init.o
RVV-OBJS-$(CONFIG_LLVIDENCDSP) += riscv/llvidencdsp_rvv.o
OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o
RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o
-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
- riscv/pixblockdsp_rvi.o
+OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o
+RV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvi.o
RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o
OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_init.o
RVV-OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_rvv.o
diff --git a/libavcodec/riscv/ac3dsp_init.c b/libavcodec/riscv/ac3dsp_init.c
index 118b2955ca..b9e14d56ca 100644
--- a/libavcodec/riscv/ac3dsp_init.c
+++ b/libavcodec/riscv/ac3dsp_init.c
@@ -31,6 +31,7 @@ void ff_float_to_fixed24_rvv(int32_t *dst, const float *src, size_t len);
av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c)
{
+#if HAVE_RV
int flags = av_get_cpu_flags();
if (flags & AV_CPU_FLAG_RVB_ADDR) {
@@ -39,4 +40,5 @@ av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c)
if (flags & AV_CPU_FLAG_RVV_F32)
c->float_to_fixed24 = ff_float_to_fixed24_rvv;
}
+#endif
}
diff --git a/libavcodec/riscv/audiodsp_init.c b/libavcodec/riscv/audiodsp_init.c
index 9ab59c011e..f606406429 100644
--- a/libavcodec/riscv/audiodsp_init.c
+++ b/libavcodec/riscv/audiodsp_init.c
@@ -33,6 +33,7 @@ void ff_vector_clipf_rvv(float *dst, const float *src, int len, float min, float
av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)
{
+#if HAVE_RV
int flags = av_get_cpu_flags();
if (flags & AV_CPU_FLAG_RVF)
@@ -47,4 +48,5 @@ av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)
c->vector_clipf = ff_vector_clipf_rvv;
}
#endif
+#endif
}
diff --git a/libavcodec/riscv/bswapdsp_init.c b/libavcodec/riscv/bswapdsp_init.c
index ed666c9b3a..d490c434e7 100644
--- a/libavcodec/riscv/bswapdsp_init.c
+++ b/libavcodec/riscv/bswapdsp_init.c
@@ -30,6 +30,7 @@ void ff_bswap16_buf_rvv(uint16_t *dst, const uint16_t *src, int len);
av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c)
{
+#if HAVE_RV
int flags = av_get_cpu_flags();
if (flags & AV_CPU_FLAG_RVB_ADDR) {
@@ -42,4 +43,5 @@ av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c)
c->bswap16_buf = ff_bswap16_buf_rvv;
#endif
}
+#endif
}
diff --git a/libavcodec/riscv/pixblockdsp_init.c b/libavcodec/riscv/pixblockdsp_init.c
index 3c623a9473..0584100cfc 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -45,6 +45,7 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
AVCodecContext *avctx,
unsigned high_bit_depth)
{
+#if HAVE_RV
int cpu_flags = av_get_cpu_flags();
if (cpu_flags & AV_CPU_FLAG_RVI) {
@@ -69,4 +70,5 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
c->diff_pixels = ff_diff_pixels_rvv;
}
#endif
+#endif
}