aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgxw <guxiwei-hf@loongson.cn>2024-01-18 14:57:26 +0800
committerCosmin Truta <ctruta@gmail.com>2024-01-18 18:13:23 +0200
commit70d10da35cdf498a36a394109a445b0b5bb6f2fa (patch)
treee242d572a04b1763e8a7a91a392a844110a2e952
parent064f992187ac746debb94f3e2f68989e8d0e174f (diff)
downloadlibpng-70d10da35cdf498a36a394109a445b0b5bb6f2fa.tar.gz
MIPS: Fixed undefined MSA interfaces
When compiling on the MIPS platform using the following command: ./configure --enable-hardware-optimizations && make The options '-mmsa -mfp64' are not being passed. PNG_MIPS_MSA_IMPLEMENTATION is defined as 2, leading to the initialization of unimplemented MSA interfaces.
-rw-r--r--mips/mips_init.c8
-rw-r--r--pngpriv.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/mips/mips_init.c b/mips/mips_init.c
index bb8db07d6..5c6fa1dbf 100644
--- a/mips/mips_init.c
+++ b/mips/mips_init.c
@@ -21,7 +21,7 @@
#ifdef PNG_READ_SUPPORTED
-#if PNG_MIPS_MSA_OPT > 0 || PNG_MIPS_MMI_IMPLEMENTATION > 0
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do MIPS MSA run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
@@ -129,7 +129,7 @@ png_init_filter_functions_mips(png_structp pp, unsigned int bpp)
#endif /* PNG_MIPS_MMI_IMPLEMENTATION > 0 */
MIPS_MSA_INIT:
-#if PNG_MIPS_MSA_OPT > 0
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
/* The switch statement is compiled in for MIPS_MSA_API, the call to
* png_have_msa is compiled in for MIPS_MSA_CHECK. If both are defined
* the check is only performed if the API has not set the MSA option on
@@ -197,8 +197,8 @@ MIPS_MSA_INIT:
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
}
-#endif /* PNG_MIPS_MSA_OPT > 0 */
+#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 */
return;
}
-#endif /* PNG_MIPS_MSA_OPT > 0 || PNG_MIPS_MMI_IMPLEMENTATION > 0 */
+#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0 */
#endif /* READ */
diff --git a/pngpriv.h b/pngpriv.h
index f2f289f91..6c7280cf5 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -268,7 +268,6 @@
#endif
#if PNG_MIPS_MSA_OPT > 0
-# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_mips
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# if defined(__mips_msa)
# if defined(__clang__)
@@ -284,6 +283,7 @@
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# define PNG_MIPS_MSA_IMPLEMENTATION 1
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_mips
# endif
#else
# define PNG_MIPS_MSA_IMPLEMENTATION 0
@@ -1348,7 +1348,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
-#if PNG_MIPS_MSA_OPT > 0
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
@@ -2170,7 +2170,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
-#if PNG_MIPS_MSA_OPT > 0
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_mips,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif