/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
(void)reg_eax; // Avoid compiler warning on unused-but-set variable.
return flags & mask;
}
// Fine-Grain Measurement Functions // // If you are timing a small region of code, access the timestamp counter // (TSC) via: // // unsigned int start = x86_tsc_start(); // ... // unsigned int end = x86_tsc_end(); // unsigned int diff = end - start; // // The start/end functions introduce a few more instructions than using // x86_readtsc directly, but prevent the CPU's out-of-order execution from // affecting the measurement (by having earlier/later instructions be evaluated // in the time interval). See the white paper, "How to Benchmark Code // Execution Times on Intel(R) IA-32 and IA-64 Instruction Set Architectures" by // Gabriele Paoloni for more information. // // If you are timing a large function (CPU time > a couple of seconds), use // x86_readtsc64 to read the timestamp counter in a 64-bit integer. The // out-of-order leakage that can occur is minimal compared to total runtime. staticINLINEunsignedint x86_readtsc(void) { #ifdefined(__GNUC__) unsignedint tsc;
__asm__ __volatile__("rdtsc\n\t" : "=a"(tsc) :); return tsc; #elifdefined(__SUNPRO_C) || defined(__SUNPRO_CC) unsignedint tsc; asmvolatile("rdtsc\n\t" : "=a"(tsc) :); return tsc; #else #if VPX_ARCH_X86_64 return (unsignedint)__rdtsc(); #else
__asm rdtsc; #endif #endif
} // 64-bit CPU cycle counter staticINLINE uint64_t x86_readtsc64(void) { #ifdefined(__GNUC__)
uint32_t hi, lo;
__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi)); return ((uint64_t)hi << 32) | lo; #elifdefined(__SUNPRO_C) || defined(__SUNPRO_CC)
uint_t hi, lo; asmvolatile("rdtsc\n\t" : "=a"(lo), "=d"(hi)); return ((uint64_t)hi << 32) | lo; #else #if VPX_ARCH_X86_64 return (uint64_t)__rdtsc(); #else
__asm rdtsc; #endif #endif
}
staticINLINEunsignedint x87_set_double_precision(void) { unsignedint mode = x87_get_control_word(); // Intel 64 and IA-32 Architectures Developer's Manual: Vol. 1 // https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-1-manual.pdf // 8.1.5.2 Precision Control Field // Bits 8 and 9 (0x300) of the x87 FPU Control Word ("Precision Control") // determine the number of bits used in floating point calculations. To match // later SSE instructions restrict x87 operations to Double Precision (0x200). // Precision PC Field // Single Precision (24-Bits) 00B // Reserved 01B // Double Precision (53-Bits) 10B // Extended Precision (64-Bits) 11B
x87_set_control_word((mode & ~0x300u) | 0x200u); return mode;
}
#ifdef __cplusplus
} // extern "C" #endif
#endif// VPX_VPX_PORTS_X86_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-07)
¤
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 und die Messung sind noch experimentell.