Commit Graph

4 Commits

Author SHA1 Message Date
Stefan Brüns
85e8c09ff6 Fix GetTimeCounter for Aarch64 variants
Neither GCC nor Clang define an __arm64__ preprocessor macro, but use
__aarch64__ (MSVC uses _MARM_64). Add a "64" suffix to the define, i.e.
NETGEN_ARCH_ARM64 to make it more obvious in only refers to aarch64, and
to be in line with NETGEN_ARCH_AMD64.

Replace the (Clang specific) __builtin_readcyclecounter with inline
asm:
- The function return cycles (i.e. varies with CPU frequency), not time
- It may return 0, depending on the PMU settings
- It may cause an illegal instruction, in case it is not trapped by the
  kernel, e.g. on FreeBSD.

Reading the generic timer/counter CNTVCT_EL0 instead of PMCCNTR_EL0 avoids
these pitfalls. The inline asm works on GCC and Clang, instead of
Clang only for the builtin.
2021-03-03 17:30:33 +01:00
Joachim Schöberl
f53c069308 prepare SIMD for arm64 2021-01-30 20:05:28 +01:00
Matthias Hochsteger
dbe894fea3 Support for Apple M1 2020-12-15 10:43:11 +01:00
Matthias Hochsteger
2d667a08dc move (refactored) SIMD headers from ngsolve into ngcore 2020-12-11 20:54:41 +01:00