diff --git a/CMakeLists.txt b/CMakeLists.txt index 3857b82..4c68989 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,8 +221,8 @@ endif() # Set definitions and sources for MIPS. if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)") - set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) - set(PNG_MIPS_MSA "on" + set(PNG_MIPS_MSA_POSSIBLE_VALUES on off check) + set(PNG_MIPS_MSA "check" CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default") set_property(CACHE PNG_MIPS_MSA PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES}) @@ -254,6 +254,12 @@ if(TARGET_ARCH MATCHES "^(mipsel|mips64el)") mips/filter_msa_intrinsics.c) add_definitions(-DPNG_MIPS_MSA_OPT=2) add_definitions(-DPNG_MIPS_MMI_OPT=0) + elseif(PNG_MIPS_MSA STREQUAL "check") + set(libpng_mips_sources + mips/mips_init.c + mips/filter_msa_intrinsics.c) + add_definitions(-DPNG_MIPS_MSA_CHECK_SUPPORTED) + add_definitions(-DPNG_MIPS_MMI_CHECK_SUPPORTED) elseif(PNG_MIPS_MMI STREQUAL "on") set(libpng_mips_sources mips/mips_init.c