riscv: Fix the run-time checking of the RVV availability

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Filip Wasil
2025-05-08 15:39:32 +02:00
committed by Cosmin Truta
parent 2b0eb78656
commit 7108843467
4 changed files with 17 additions and 13 deletions

View File

@@ -16,24 +16,22 @@
#include <riscv_vector.h>
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED
#include <signal.h>
#endif
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the
* run-time checks for CPU features if at all possible. In the case of the
* RISC-V Vector instructions there is no processor-specific way of detecting
* the presence of the required support, therefore run-time detection is
* extremely OS specific.
*
* You may set the macro PNG_RISCV_RVV_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_neon function. There
* a fragment of C source code which defines the png_have_rvv function. There
* are a number of implementations in contrib/riscv-rvv, but the only one that
* has partial support is contrib/riscv-rvv/linux.c - a generic Linux
* implementation which reads /proc/cpuinfo.
*/
#include <signal.h>
#ifndef PNG_RISCV_RVV_FILE
# if defined(__linux__)
# define PNG_RISCV_RVV_FILE "contrib/riscv-rvv/linux.c"