-{ # try to detect if SSE2 or MMX extensions were used on Win32...
- if ($::win32 && grep {/\s+[x]*mm[0-7]/i} @out)
- { # One can argue that it's wasteful to craft every
- # SSE/MMX module with this snippet... Well, it's 72
- # bytes long and for the moment we have two modules.
- # Let's argue when we have 7 modules or so...
- #
- # $1<<10 sets a reserved bit to signal that variable
- # was initialized already...
- my $tmp=<<___;
-align 16
-${lprfx}OPENSSL_ia32cap_init:
- lea edx,[${under}OPENSSL_ia32cap_P]
- cmp DWORD [edx],0
- jne NEAR ${lprfx}nocpuid
- mov DWORD [edx],1<<10
- pushfd
- pop eax
- mov ecx,eax
- xor eax,1<<21
- push eax
- popfd
- pushfd
- pop eax
- xor eax,ecx
- bt eax,21
- jnc NEAR ${lprfx}nocpuid
- push edi
- push ebx
- mov edi,edx
- mov eax,1
- cpuid
- or edx,1<<10
- mov DWORD [edi],edx
- pop ebx
- pop edi
-${lprfx}nocpuid:
- ret
-
-segment .CRT\$XCU rdata align=4
-dd ${lprfx}OPENSSL_ia32cap_init
-segment .bss
-common ${under}OPENSSL_ia32cap_P 4
+{ if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out)
+ { my $comm=<<___;
+${drdecor}segment .bss
+${drdecor}common ${nmdecor}OPENSSL_ia32cap_P 16