144 if (PrefetchCopyIntervalInBytes >= 32768)
145 PrefetchCopyIntervalInBytes = 32760;
146 }
147
148 if (AllocatePrefetchDistance !=-1 && (AllocatePrefetchDistance & 7)) {
149 warning("AllocatePrefetchDistance must be multiple of 8");
150 AllocatePrefetchDistance &= ~7;
151 }
152
153 if (AllocatePrefetchStepSize & 7) {
154 warning("AllocatePrefetchStepSize must be multiple of 8");
155 AllocatePrefetchStepSize &= ~7;
156 }
157
158 if (SoftwarePrefetchHintDistance != -1 &&
159 (SoftwarePrefetchHintDistance & 7)) {
160 warning("SoftwarePrefetchHintDistance must be -1, or a multiple of 8");
161 SoftwarePrefetchHintDistance &= ~7;
162 }
163
164 unsigned long auxv = getauxval(AT_HWCAP);
165
166 char buf[512];
167
168 _features = auxv;
169
170 int cpu_lines = 0;
171 if (FILE *f = fopen("/proc/cpuinfo", "r")) {
172 // need a large buffer as the flags line may include lots of text
173 char buf[1024], *p;
174 while (fgets(buf, sizeof (buf), f) != NULL) {
175 if ((p = strchr(buf, ':')) != NULL) {
176 long v = strtol(p+1, NULL, 0);
177 if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
178 _cpu = v;
179 cpu_lines++;
180 } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
181 _variant = v;
182 } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
183 if (_model != v) _model2 = _model;
184 _model = v;
185 } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
186 _revision = v;
187 } else if (strncmp(buf, "flags", sizeof("flags") - 1) == 0) {
188 if (strstr(p+1, "dcpop")) {
189 _dcpop = true;
190 }
191 }
192 }
193 }
194 fclose(f);
195 }
196
|
144 if (PrefetchCopyIntervalInBytes >= 32768)
145 PrefetchCopyIntervalInBytes = 32760;
146 }
147
148 if (AllocatePrefetchDistance !=-1 && (AllocatePrefetchDistance & 7)) {
149 warning("AllocatePrefetchDistance must be multiple of 8");
150 AllocatePrefetchDistance &= ~7;
151 }
152
153 if (AllocatePrefetchStepSize & 7) {
154 warning("AllocatePrefetchStepSize must be multiple of 8");
155 AllocatePrefetchStepSize &= ~7;
156 }
157
158 if (SoftwarePrefetchHintDistance != -1 &&
159 (SoftwarePrefetchHintDistance & 7)) {
160 warning("SoftwarePrefetchHintDistance must be -1, or a multiple of 8");
161 SoftwarePrefetchHintDistance &= ~7;
162 }
163
164 uint64_t auxv = getauxval(AT_HWCAP);
165
166 char buf[512];
167
168 _features = auxv;
169
170 int cpu_lines = 0;
171 if (FILE *f = fopen("/proc/cpuinfo", "r")) {
172 // need a large buffer as the flags line may include lots of text
173 char buf[1024], *p;
174 while (fgets(buf, sizeof (buf), f) != NULL) {
175 if ((p = strchr(buf, ':')) != NULL) {
176 int64_t v = strtol(p+1, NULL, 0);
177 if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
178 _cpu = v;
179 cpu_lines++;
180 } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
181 _variant = v;
182 } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
183 if (_model != v) _model2 = _model;
184 _model = v;
185 } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
186 _revision = v;
187 } else if (strncmp(buf, "flags", sizeof("flags") - 1) == 0) {
188 if (strstr(p+1, "dcpop")) {
189 _dcpop = true;
190 }
191 }
192 }
193 }
194 fclose(f);
195 }
196
|