This should fix the build on LLVM 16 and earlier, at the cost of turning all non-RVV optimisations off.
Unified · Split
| @@ -93,10 +93,10 @@ ffbuild/.config: $(CONFIGURABLE_COMPONENTS) · 92 unmodified lines | |||
| 93 | SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ | 93 | SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ |
| 94 | HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ | 94 | HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ |
| 95 | ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ | 95 | ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ |
| 96 | ALTIVEC-OBJS VSX-OBJS RVV-OBJS MMX-OBJS X86ASM-OBJS \ | 96 | ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \ |
| 97 | MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ | 97 | MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ |
| 98 | MMI-OBJS LSX-OBJS LASX-OBJS OBJS SLIBOBJS SHLIBOBJS \ | 98 | MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS \ |
| 99 | STLIBOBJS HOSTOBJS TESTOBJS | 99 | OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS |
| 100 | 100 | ||
| 101 | define RESET | 101 | define RESET |
| 102 | $(1) := | 102 | $(1) := |
| @@ -2154,6 +2154,7 @@ ARCH_EXT_LIST_PPC=" · 2153 unmodified lines | |||
| 2154 | " | 2154 | " |
| 2155 | 2155 | ||
| 2156 | ARCH_EXT_LIST_RISCV=" | 2156 | ARCH_EXT_LIST_RISCV=" |
| 2157 | rv | ||
| 2157 | rvv | 2158 | rvv |
| 2158 | " | 2159 | " |
| 2159 | 2160 | ||
| @@ -2679,7 +2680,8 @@ ppc4xx_deps="ppc" · 519 unmodified lines | |||
| 2679 | vsx_deps="altivec" | 2680 | vsx_deps="altivec" |
| 2680 | power8_deps="vsx" | 2681 | power8_deps="vsx" |
| 2681 | 2682 | ||
| 2682 | rvv_deps="riscv" | 2683 | rv_deps="riscv" |
| 2684 | rvv_deps="rv" | ||
| 2683 | 2685 | ||
| 2684 | loongson2_deps="mips" | 2686 | loongson2_deps="mips" |
| 2685 | loongson3_deps="mips" | 2687 | loongson3_deps="mips" |
| @@ -6243,6 +6245,7 @@ elif enabled ppc; then · 3557 unmodified lines | |||
| 6243 | 6245 | ||
| 6244 | elif enabled riscv; then | 6246 | elif enabled riscv; then |
| 6245 | 6247 | ||
| 6248 | enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"' | ||
| 6246 | enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"' | 6249 | enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"' |
| 6247 | 6250 | ||
| 6248 | elif enabled x86; then | 6251 | elif enabled x86; then |
| @@ -15,6 +15,7 @@ OBJS-$(HAVE_LASX) += $(LASX-OBJS) $(LASX-OBJS-yes) · 14 unmodified lines | |||
| 15 | OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes) | 15 | OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes) |
| 16 | OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes) | 16 | OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes) |
| 17 | 17 | ||
| 18 | OBJS-$(HAVE_RV) += $(RV-OBJS) $(RV-OBJS-yes) | ||
| 18 | OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes) | 19 | OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes) |
| 19 | 20 | ||
| 20 | OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes) | 21 | OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes) |
| @@ -1,15 +1,15 @@ | |||
| 1 | OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o riscv/sbrdsp_init.o | 1 | OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o riscv/sbrdsp_init.o |
| 2 | RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o riscv/sbrdsp_rvv.o | 2 | RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o riscv/sbrdsp_rvv.o |
| 3 | OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_init.o \ | 3 | OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_init.o |
| 4 | riscv/ac3dsp_rvb.o | 4 | RV-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvb.o |
| 5 | RVV-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvv.o | 5 | RVV-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvv.o |
| 6 | OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o | 6 | OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o |
| 7 | RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o | 7 | RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o |
| 8 | OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \ | 8 | OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o |
| 9 | riscv/audiodsp_rvf.o | 9 | RV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvf.o |
| 10 | RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o | 10 | RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o |
| 11 | OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \ | 11 | OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o |
| 12 | riscv/bswapdsp_rvb.o | 12 | RV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvb.o |
| 13 | RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o | 13 | RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o |
| 14 | OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o | 14 | OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o |
| 15 | RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o | 15 | RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o |
| @@ -35,8 +35,8 @@ OBJS-$(CONFIG_LLVIDENCDSP) += riscv/llvidencdsp_init.o · 19 unmodified lines | |||
| 35 | RVV-OBJS-$(CONFIG_LLVIDENCDSP) += riscv/llvidencdsp_rvv.o | 35 | RVV-OBJS-$(CONFIG_LLVIDENCDSP) += riscv/llvidencdsp_rvv.o |
| 36 | OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o | 36 | OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o |
| 37 | RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o | 37 | RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o |
| 38 | OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \ | 38 | OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o |
| 39 | riscv/pixblockdsp_rvi.o | 39 | RV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvi.o |
| 40 | RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o | 40 | RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o |
| 41 | OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_init.o | 41 | OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_init.o |
| 42 | RVV-OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_rvv.o | 42 | RVV-OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_rvv.o |
| @@ -31,6 +31,7 @@ void ff_float_to_fixed24_rvv(int32_t *dst, const float *src, size_t len); · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c) | 32 | av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c) |
| 33 | { | 33 | { |
| 34 | #if HAVE_RV | ||
| 34 | int flags = av_get_cpu_flags(); | 35 | int flags = av_get_cpu_flags(); |
| 35 | 36 | ||
| 36 | if (flags & AV_CPU_FLAG_RVB_ADDR) { | 37 | if (flags & AV_CPU_FLAG_RVB_ADDR) { |
| @@ -39,4 +40,5 @@ av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c) · 2 unmodified lines | |||
| 39 | if (flags & AV_CPU_FLAG_RVV_F32) | 40 | if (flags & AV_CPU_FLAG_RVV_F32) |
| 40 | c->float_to_fixed24 = ff_float_to_fixed24_rvv; | 41 | c->float_to_fixed24 = ff_float_to_fixed24_rvv; |
| 41 | } | 42 | } |
| 43 | #endif | ||
| 42 | } | 44 | } |
| @@ -33,6 +33,7 @@ void ff_vector_clipf_rvv(float *dst, const float *src, int len, float min, float · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) | 34 | av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) |
| 35 | { | 35 | { |
| 36 | #if HAVE_RV | ||
| 36 | int flags = av_get_cpu_flags(); | 37 | int flags = av_get_cpu_flags(); |
| 37 | 38 | ||
| 38 | if (flags & AV_CPU_FLAG_RVF) | 39 | if (flags & AV_CPU_FLAG_RVF) |
| @@ -47,4 +48,5 @@ av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) · 8 unmodified lines | |||
| 47 | c->vector_clipf = ff_vector_clipf_rvv; | 48 | c->vector_clipf = ff_vector_clipf_rvv; |
| 48 | } | 49 | } |
| 49 | #endif | 50 | #endif |
| 51 | #endif | ||
| 50 | } | 52 | } |
| @@ -30,6 +30,7 @@ void ff_bswap16_buf_rvv(uint16_t *dst, const uint16_t *src, int len); · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) | 31 | av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) |
| 32 | { | 32 | { |
| 33 | #if HAVE_RV | ||
| 33 | int flags = av_get_cpu_flags(); | 34 | int flags = av_get_cpu_flags(); |
| 34 | 35 | ||
| 35 | if (flags & AV_CPU_FLAG_RVB_ADDR) { | 36 | if (flags & AV_CPU_FLAG_RVB_ADDR) { |
| @@ -42,4 +43,5 @@ av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) · 6 unmodified lines | |||
| 42 | c->bswap16_buf = ff_bswap16_buf_rvv; | 43 | c->bswap16_buf = ff_bswap16_buf_rvv; |
| 43 | #endif | 44 | #endif |
| 44 | } | 45 | } |
| 46 | #endif | ||
| 45 | } | 47 | } |
| @@ -45,6 +45,7 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, · 44 unmodified lines | |||
| 45 | AVCodecContext *avctx, | 45 | AVCodecContext *avctx, |
| 46 | unsigned high_bit_depth) | 46 | unsigned high_bit_depth) |
| 47 | { | 47 | { |
| 48 | #if HAVE_RV | ||
| 48 | int cpu_flags = av_get_cpu_flags(); | 49 | int cpu_flags = av_get_cpu_flags(); |
| 49 | 50 | ||
| 50 | if (cpu_flags & AV_CPU_FLAG_RVI) { | 51 | if (cpu_flags & AV_CPU_FLAG_RVI) { |
| @@ -69,4 +70,5 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, · 18 unmodified lines | |||
| 69 | c->diff_pixels = ff_diff_pixels_rvv; | 70 | c->diff_pixels = ff_diff_pixels_rvv; |
| 70 | } | 71 | } |
| 71 | #endif | 72 | #endif |
| 73 | #endif | ||
| 72 | } | 74 | } |
| @@ -1,3 +1,3 @@ | |||
| 1 | OBJS += riscv/rgb2rgb.o | 1 | OBJS += riscv/rgb2rgb.o |
| 2 | OBJS += riscv/rgb2rgb_rvb.o | 2 | RV-OBJS += riscv/rgb2rgb_rvb.o |
| 3 | RVV-OBJS += riscv/rgb2rgb_rvv.o | 3 | RVV-OBJS += riscv/rgb2rgb_rvv.o |
| @@ -42,6 +42,7 @@ void ff_yuyvtoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, · 41 unmodified lines | |||
| 42 | 42 | ||
| 43 | av_cold void rgb2rgb_init_riscv(void) | 43 | av_cold void rgb2rgb_init_riscv(void) |
| 44 | { | 44 | { |
| 45 | #if HAVE_RV | ||
| 45 | int flags = av_get_cpu_flags(); | 46 | int flags = av_get_cpu_flags(); |
| 46 | 47 | ||
| 47 | #if (__riscv_xlen == 64) | 48 | #if (__riscv_xlen == 64) |
| @@ -61,4 +62,5 @@ av_cold void rgb2rgb_init_riscv(void) · 13 unmodified lines | |||
| 61 | } | 62 | } |
| 62 | } | 63 | } |
| 63 | #endif | 64 | #endif |
| 65 | #endif | ||
| 64 | } | 66 | } |
| @@ -68,7 +68,7 @@ CHECKASMOBJS-$(CONFIG_AVUTIL) += $(AVUTILOBJS) · 67 unmodified lines | |||
| 68 | 68 | ||
| 69 | CHECKASMOBJS-$(ARCH_AARCH64) += aarch64/checkasm.o | 69 | CHECKASMOBJS-$(ARCH_AARCH64) += aarch64/checkasm.o |
| 70 | CHECKASMOBJS-$(HAVE_ARMV5TE_EXTERNAL) += arm/checkasm.o | 70 | CHECKASMOBJS-$(HAVE_ARMV5TE_EXTERNAL) += arm/checkasm.o |
| 71 | CHECKASMOBJS-$(ARCH_RISCV) += riscv/checkasm.o | 71 | CHECKASMOBJS-$(HAVE_RV) += riscv/checkasm.o |
| 72 | CHECKASMOBJS-$(HAVE_X86ASM) += x86/checkasm.o | 72 | CHECKASMOBJS-$(HAVE_X86ASM) += x86/checkasm.o |
| 73 | 73 | ||
| 74 | CHECKASMOBJS += $(CHECKASMOBJS-yes) checkasm.o | 74 | CHECKASMOBJS += $(CHECKASMOBJS-yes) checkasm.o |
| @@ -738,7 +738,7 @@ int main(int argc, char *argv[]) · 737 unmodified lines | |||
| 738 | if (have_vfp(av_get_cpu_flags()) || have_neon(av_get_cpu_flags())) | 738 | if (have_vfp(av_get_cpu_flags()) || have_neon(av_get_cpu_flags())) |
| 739 | checkasm_checked_call = checkasm_checked_call_vfp; | 739 | checkasm_checked_call = checkasm_checked_call_vfp; |
| 740 | #endif | 740 | #endif |
| 741 | #if ARCH_RISCV | 741 | #if ARCH_RISCV && HAVE_RV |
| 742 | struct sigaction act = { | 742 | struct sigaction act = { |
| 743 | .sa_handler = checkasm_handle_signal, | 743 | .sa_handler = checkasm_handle_signal, |
| 744 | .sa_flags = 0, | 744 | .sa_flags = 0, |
| @@ -217,7 +217,7 @@ void checkasm_set_function(void *, sigjmp_buf); · 216 unmodified lines | |||
| 217 | void *checkasm_get_wrapper(void); | 217 | void *checkasm_get_wrapper(void); |
| 218 | void checkasm_handle_signal(int signum); | 218 | void checkasm_handle_signal(int signum); |
| 219 | 219 | ||
| 220 | #if (__riscv_xlen == 64) && defined (__riscv_d) | 220 | #if HAVE_RV && (__riscv_xlen == 64) && defined (__riscv_d) |
| 221 | #define declare_new(ret, ...) \ | 221 | #define declare_new(ret, ...) \ |
| 222 | int checked_call_signum = 0; \ | 222 | int checked_call_signum = 0; \ |
| 223 | sigjmp_buf checked_call_jb; \ | 223 | sigjmp_buf checked_call_jb; \ |
| @@ -227,6 +227,9 @@ void checkasm_handle_signal(int signum); · 3 unmodified lines | |||
| 227 | (checked_call_signum = sigsetjmp(checked_call_jb, 1)) == 0 \ | 227 | (checked_call_signum = sigsetjmp(checked_call_jb, 1)) == 0 \ |
| 228 | ? checked_call(__VA_ARGS__) \ | 228 | ? checked_call(__VA_ARGS__) \ |
| 229 | : (checkasm_fail_signal(checked_call_signum), 0)) | 229 | : (checkasm_fail_signal(checked_call_signum), 0)) |
| 230 | #else | ||
| 231 | #define declare_new(ret, ...) | ||
| 232 | #define call_new(...) ((func_type *)func_new)(__VA_ARGS__) | ||
| 230 | #endif | 233 | #endif |
| 231 | #else | 234 | #else |
| 232 | #define declare_new(ret, ...) | 235 | #define declare_new(ret, ...) |