/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* compile-time and runtime tests for whether to use Power ISA-specific
* extensions */
#include"ppc.h" #include"mozilla/Unused.h"
#include <stdio.h> #include <stdlib.h>
#ifdefined(XP_LINUX) // Use the getauxval() function if available. // ARCH_3_00 wasn't defined until glibc 2.23, so include just in case. # include <sys/auxv.h> # ifndef PPC_FEATURE2_ARCH_3_00 # define PPC_FEATURE2_ARCH_3_00 0x00800000 # endif #endif
if (cap & PPC_FEATURE_HAS_ALTIVEC) {
cpu_flags |= PPC_FLAG_VMX;
} if (cap & PPC_FEATURE_HAS_VSX) {
cpu_flags |= PPC_FLAG_VSX;
} if (cap2 & PPC_FEATURE2_ARCH_3_00) {
cpu_flags |= PPC_FLAG_VSX3;
} #else // Non-Linux detection here. Currently, on systems other than Linux, // no CPU SIMD features will be detected. #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.