Welcome to mirror list, hosted at ThFree Co, Russian Federation.

amd64cpuinfo.c « bench - github.com/BLAKE2/BLAKE2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 479ec4bfb363db655e60cbbd4ce117c45aed35f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
   BLAKE2 reference source code package - benchmark tool

   Written in 2012 by Samuel Neves <sneves@dei.uc.pt>

   To the extent possible under law, the author(s) have dedicated all copyright
   and related and neighboring rights to this software to the public domain
   worldwide. This software is distributed without any warranty.

   You should have received a copy of the CC0 Public Domain Dedication along with
   this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/

unsigned long long cpucycles( void )
{
  unsigned long long result;
  asm volatile( ".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
                : "=a" ( result ) ::  "%rdx" );
  return result;
}