baf801d0623c6e88ed9dd057b8a8df05cccd85a7
[openssl.git] / crypto / amd64cpuid.pl
1 #!/usr/bin/env perl
2
3 $output=shift;
4 $win64a=1 if ($output =~ /win64a\.[s|asm]/);
5 open STDOUT,">$output" || die "can't open $output: $!";
6
7 print<<___ if(defined($win64a));
8 TEXT    SEGMENT
9 PUBLIC  OPENSSL_rdtsc
10 ALIGN   16
11 OPENSSL_rdtsc   PROC NEAR
12         rdtsc
13         shl     rdx,32
14         or      rax,rdx
15         ret
16 OPENSSL_rdtsc   ENDP
17 TEXT    ENDS
18 END
19 ___
20 print<<___ if(!defined($win64a));
21 .text
22 .globl  OPENSSL_rdtsc
23 .align  16
24 OPENSSL_rdtsc:
25         rdtsc
26         shl     \$32,%rdx
27         or      %rdx,%rax
28         ret
29 .size   OPENSSL_rdtsc,.-OPENSSL_rdtsc
30 ___