1 /* contrib/powerpc-vsx/linux_aux.c
3 * Copyright (c) 2017 Glenn Randers-Pehrson
4 * Written by Vadim Barkov, 2017.
6 * This code is released under the libpng license.
7 * For conditions of distribution and use, see the disclaimer
11 * BUG REPORTS: png-mng-implement@sourceforge.net
13 * png_have_vsx implemented for Linux by using the auxiliary vector mechanism.
15 * This code is strict ANSI-C and is probably moderately portable; it does
16 * however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
23 png_have_vsx(png_structp png_ptr)
25 unsigned long auxv = getauxval(AT_HWCAP);
29 if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX))