[packages/highway] - disable also static initialization if rdtscp is not supported

qboosh qboosh at pld-linux.org
Wed Oct 6 21:43:56 CEST 2021


commit 6347ba873f1a6a061d5c0e92aa340e294020878b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Oct 6 21:48:32 2021 +0200

    - disable also static initialization if rdtscp is not supported

 highway-rdtscp.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/highway-rdtscp.patch b/highway-rdtscp.patch
index edf2e73..3b21f4b 100644
--- a/highway-rdtscp.patch
+++ b/highway-rdtscp.patch
@@ -42,3 +42,18 @@ index 8e00cca..91c5713 100644
    const InputVec& unique = UniqueInputs(inputs, num_inputs);
  
    const size_t num_skip = NumSkip(func, arg, unique, p);  // never 0
+--- highway-0.14.2/hwy/nanobenchmark.cc.orig	2021-10-06 06:25:11.981599545 +0200
++++ highway-0.14.2/hwy/nanobenchmark.cc	2021-10-06 21:31:31.524075329 +0200
+@@ -431,6 +431,12 @@ double Now() {
+ }
+ 
+ uint64_t TimerResolution() {
++#if HWY_ARCH_X86
++  /* TimerResolution() is used to initialize static variable, used in Measure() function */
++  if (!platform::HasRDTSCP())
++    return 0;
++#endif
++
+   // Nested loop avoids exceeding stack/L1 capacity.
+   timer::Ticks repetitions[Params::kTimerSamples];
+   for (size_t rep = 0; rep < Params::kTimerSamples; ++rep) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/highway.git/commitdiff/74709daff4b6f30b0d6db9885b20a73c92a7b661



More information about the pld-cvs-commit mailing list