Blame sysdeps/i386/i686/hp-timing.h

Packit Service 3e830d
/* High precision, low overhead timing functions.  i686 version.
Packit Service 3e830d
   Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit Service 3e830d
   This file is part of the GNU C Library.
Packit Service 3e830d
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
Packit Service 3e830d
Packit Service 3e830d
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 3e830d
   modify it under the terms of the GNU Lesser General Public
Packit Service 3e830d
   License as published by the Free Software Foundation; either
Packit Service 3e830d
   version 2.1 of the License, or (at your option) any later version.
Packit Service 3e830d
Packit Service 3e830d
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 3e830d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 3e830d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 3e830d
   Lesser General Public License for more details.
Packit Service 3e830d
Packit Service 3e830d
   You should have received a copy of the GNU Lesser General Public
Packit Service 3e830d
   License along with the GNU C Library; if not, see
Packit Service 3e830d
   <http://www.gnu.org/licenses/>.  */
Packit Service 3e830d
Packit Service 3e830d
#ifndef _HP_TIMING_H
Packit Service 3e830d
#define _HP_TIMING_H	1
Packit Service 3e830d
Packit Service 3e830d
/* We always assume having the timestamp register.  */
Packit Service 3e830d
#define HP_TIMING_AVAIL		(1)
Packit Service 3e830d
#define HP_SMALL_TIMING_AVAIL	(1)
Packit Service 3e830d
Packit Service 3e830d
/* We indeed have inlined functions.  */
Packit Service 3e830d
#define HP_TIMING_INLINE	(1)
Packit Service 3e830d
Packit Service 3e830d
/* We use 64bit values for the times.  */
Packit Service 3e830d
typedef unsigned long long int hp_timing_t;
Packit Service 3e830d
Packit Service 3e830d
/* That's quite simple.  Use the `rdtsc' instruction.  Note that the value
Packit Service 3e830d
   might not be 100% accurate since there might be some more instructions
Packit Service 3e830d
   running in this moment.  This could be changed by using a barrier like
Packit Service 3e830d
   'cpuid' right before the `rdtsc' instruciton.  But we are not interested
Packit Service 3e830d
   in accurate clock cycles here so we don't do this.  */
Packit Service 3e830d
#define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("rdtsc" : "=A" (Var))
Packit Service 3e830d
Packit Service 3e830d
#include <hp-timing-common.h>
Packit Service 3e830d
Packit Service 3e830d
#endif	/* hp-timing.h */