/* * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// Read additional info using OS-specific interfaces staticvoid get_os_cpu_info();
// Sets the SVE length and returns a new actual value or negative on error. // If the len is larger than the system largest supported SVE vector length, // the function sets the largest supported value. staticint set_and_get_current_sve_vector_length(int len); staticint get_current_sve_vector_length();
staticbool expensive_load(int ld_size, int scale) { if (cpu_family() == CPU_ARM) { // Half-word load with index shift by 1 (aka scale is 2) has // extra cycle latency, e.g. ldrsh w0, [x1,w2,sxtw #1]. if (ld_size == 2 && scale == 2) { returntrue;
}
} returnfalse;
}
// The CPU implementer codes can be found in // ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile // https://developer.arm.com/docs/ddi0487/latest // Arm can assign codes that are not published in the manual. // Apple's code is defined in // https://github.com/apple/darwin-xnu/blob/33eb983/osfmk/arm/cpuid.h#L62 enum Family {
CPU_AMPERE = 0xC0,
CPU_ARM = 'A',
CPU_BROADCOM = 'B',
CPU_CAVIUM = 'C',
CPU_DEC = 'D',
CPU_HISILICON = 'H',
CPU_INFINEON = 'I',
CPU_MOTOROLA = 'M',
CPU_NVIDIA = 'N',
CPU_AMCC = 'P',
CPU_QUALCOM = 'Q',
CPU_MARVELL = 'V',
CPU_INTEL = 'i',
CPU_APPLE = 'a',
};
#ifdef __APPLE__ // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64) staticbool is_cpu_emulated(); #endif
// For common 64/128-bit unpredicated vector operations, we may prefer // emitting NEON instructions rather than the corresponding SVE instructions. staticbool use_neon_for_vector(int vector_length_in_bytes) { return vector_length_in_bytes <= 16;
}
};
#endif// CPU_AARCH64_VM_VERSION_AARCH64_HPP
¤ Dauer der Verarbeitung: 0.24 Sekunden
(vorverarbeitet)
¤
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.