4 $win64a=1 if ($output =~ /win64a\.[s|asm]/);
5 open STDOUT
,">$output" || die "can't open $output: $!";
7 print<<___
if(defined($win64a));
18 PUBLIC OPENSSL_atomic_add
20 OPENSSL_atomic_add PROC
21 mov eax
,DWORD PTR
[rcx
]
22 \
$Lspin: lea r8
,DWORD PTR
[rdx
+rax
]
23 lock cmpxchg DWORD PTR
[rcx
],r8d
28 OPENSSL_atomic_add ENDP
30 PUBLIC OPENSSL_wipe_cpu
45 lea rax
,QWORD PTR
[rsp
+8]
49 OPENSSL_ia32_cpuid PROC
87 OPENSSL_ia32_cpuid ENDP
91 EXTRN OPENSSL_cpuid_setup
:PROC
92 DQ OPENSSL_cpuid_setup
96 print<<___
if(!defined($win64a));
105 .size OPENSSL_rdtsc
,.-OPENSSL_rdtsc
107 .globl OPENSSL_atomic_add
108 .type OPENSSL_atomic_add
,\
@function
112 .Lspin
: leaq
(%rsi,%rax),%r8
113 lock; cmpxchgl
%r8d,(%rdi)
118 .size OPENSSL_atomic_add
,.-OPENSSL_atomic_add
120 .globl OPENSSL_wipe_cpu
121 .type OPENSSL_wipe_cpu
,\
@function
150 .size OPENSSL_wipe_cpu
,.-OPENSSL_wipe_cpu
152 .globl OPENSSL_ia32_cpuid
160 cmp \
$0x756e6547,%ebx # "Genu"
163 cmp \
$0x49656e69,%edx # "ineI"
166 cmp \
$0x6c65746e,%ecx # "ntel"
172 bt \
$28,%edx # test hyper-threading bit
176 or \
$1<<20,%edx # use reserved bit to engage RC4_CHAR
178 cmp \
$15,%ah # examine Family ID
180 or \
$1<<30,%edx # use reserved bit to skip unrolled loop
183 cmp \
$1,%bl # see if cache is shared
192 .size OPENSSL_ia32_cpuid
,.-OPENSSL_ia32_cpuid
195 call OPENSSL_cpuid_setup