Skip to content

Commit fac80bb

Browse files
authored
Merge branch 'pnggroup:libpng16' into libpng16
2 parents 6f59276 + 816b008 commit fac80bb

File tree

6 files changed

+7
-157
lines changed

6 files changed

+7
-157
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
331331

332332
check_c_source_compiles("
333333
#include <riscv_vector.h>
334-
#include <asm/hwcap.h>
335-
#ifndef COMPAT_HWCAP_ISA_V /* added in linux-6.5 */
336-
#error \"COMPAT_HWCAP_ISA_V is not available\"
337-
#endif
338334
int main() {
339335
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
340336
uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A};

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,6 @@ then
707707

708708
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
709709
#include <riscv_vector.h>
710-
#include <asm/hwcap.h>
711-
#ifndef COMPAT_HWCAP_ISA_V /* added in linux-6.5 */
712-
#error "COMPAT_HWCAP_ISA_V is not available"
713-
#endif
714710
int main() {
715711
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
716712
uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A};

contrib/riscv-rvv/README

Lines changed: 0 additions & 85 deletions
This file was deleted.

contrib/riscv-rvv/linux.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

pngpriv.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,16 @@
303303
#endif
304304

305305
#if PNG_RISCV_RVV_OPT > 0
306+
#if __riscv_v >= 1000000 && __riscv_v < 1900000
306307
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_rvv
307308
# ifndef PNG_RISCV_RVV_IMPLEMENTATION
308309
/* Use the intrinsics code by default. */
309310
# define PNG_RISCV_RVV_IMPLEMENTATION 1
310311
# endif
311312
#else
312313
# define PNG_RISCV_RVV_IMPLEMENTATION 0
313-
#endif
314+
#endif /* __riscv_v >= 1000000 && __riscv_v < 1900000 */
315+
#endif /* PNG_RISCV_RVV_OPT > 0 */
314316

315317
/* Is this a build of a DLL where compilation of the object modules requires
316318
* different preprocessor settings to those required for a simple library? If
@@ -1546,7 +1548,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_lsx,(png_row_infop
15461548
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
15471549
#endif
15481550

1549-
#if PNG_RISCV_RVV_OPT > 0
1551+
#if PNG_RISCV_RVV_IMPLEMENTATION == 1
15501552
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_rvv,(png_row_infop
15511553
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
15521554
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_rvv,(png_row_infop
@@ -2175,7 +2177,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_lsx,
21752177
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
21762178
#endif
21772179

2178-
# if PNG_RISCV_RVV_OPT > 0
2180+
# if PNG_RISCV_RVV_IMPLEMENTATION == 1
21792181
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_rvv,
21802182
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
21812183
#endif

riscv/riscv_init.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,10 @@
1212

1313
#ifdef PNG_READ_SUPPORTED
1414

15-
#if PNG_RISCV_RVV_OPT > 0
15+
#if PNG_RISCV_RVV_IMPLEMENTATION == 1
1616

1717
#include <riscv_vector.h>
1818

19-
#include <signal.h>
20-
21-
#ifndef PNG_RISCV_RVV_FILE
22-
# if defined(__linux__)
23-
# define PNG_RISCV_RVV_FILE "contrib/riscv-rvv/linux.c"
24-
# else
25-
# error "No support for run-time RISC-V Vector checking; use compile-time options"
26-
# endif
27-
#endif
28-
29-
static int png_have_rvv();
30-
#ifdef PNG_RISCV_RVV_FILE
31-
# include PNG_RISCV_RVV_FILE
32-
#endif
33-
3419
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
3520
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
3621
#endif
@@ -40,14 +25,6 @@ png_init_filter_functions_rvv(png_structp pp, unsigned int bpp)
4025
{
4126
png_debug(1, "in png_init_filter_functions_rvv");
4227

43-
static volatile sig_atomic_t no_rvv = -1; /* not checked */
44-
45-
if (no_rvv < 0)
46-
no_rvv = !png_have_rvv();
47-
48-
if (no_rvv)
49-
return;
50-
5128
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_rvv;
5229

5330
if (bpp == 3)
@@ -64,5 +41,5 @@ png_init_filter_functions_rvv(png_structp pp, unsigned int bpp)
6441
}
6542
}
6643

67-
#endif /* PNG_RISCV_RVV_OPT > 0 */
44+
#endif /* PNG_RISCV_RVV_IMPLEMENTATION == 1 */
6845
#endif /* PNG_READ_SUPPORTED */

0 commit comments

Comments
 (0)