projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Windows build system: get uplink right.
[oweals/openssl.git]
/
crypto
/
x86cpuid.pl
diff --git
a/crypto/x86cpuid.pl
b/crypto/x86cpuid.pl
index 3b6c469d082613eec9e2078c859cc87277035156..48c4cf204b73b9d849c97b482d5f3edaa6232c40 100644
(file)
--- a/
crypto/x86cpuid.pl
+++ b/
crypto/x86cpuid.pl
@@
-4,6
+4,10
@@
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
push(@INC, "${dir}perlasm", "perlasm");
require "x86asm.pl";
push(@INC, "${dir}perlasm", "perlasm");
require "x86asm.pl";
+$output = pop;
+open OUT,">$output";
+*STDOUT=*OUT;
+
&asm_init($ARGV[0],"x86cpuid");
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&asm_init($ARGV[0],"x86cpuid");
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
@@
-69,6
+73,7
@@
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&inc ("esi"); # number of cores
&mov ("eax",1);
&inc ("esi"); # number of cores
&mov ("eax",1);
+ &xor ("ecx","ecx");
&cpuid ();
&bt ("edx",28);
&jnc (&label("generic"));
&cpuid ();
&bt ("edx",28);
&jnc (&label("generic"));
@@
-80,6
+85,16
@@
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&jmp (&label("generic"));
&set_label("intel");
&jmp (&label("generic"));
&set_label("intel");
+ &cmp ("edi",7);
+ &jb (&label("cacheinfo"));
+
+ &mov ("esi",&wparam(0));
+ &mov ("eax",7);
+ &xor ("ecx","ecx");
+ &cpuid ();
+ &mov (&DWP(8,"esi"),"ebx");
+
+&set_label("cacheinfo");
&cmp ("edi",4);
&mov ("edi",-1);
&jb (&label("nocacheinfo"));
&cmp ("edi",4);
&mov ("edi",-1);
&jb (&label("nocacheinfo"));
@@
-91,17
+106,9
@@
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&shr ("edi",14);
&and ("edi",0xfff); # number of cores -1 per L1D
&shr ("edi",14);
&and ("edi",0xfff); # number of cores -1 per L1D
- &cmp ("edi",7);
- &jb (&label("nocacheinfo"));
-
- &mov ("esi",&wparam(0));
- &mov ("eax",7);
- &xor ("ecx","ecx");
- &cpuid ();
- &mov (&DWP(8,"esi"),"ebx");
-
&set_label("nocacheinfo");
&mov ("eax",1);
&set_label("nocacheinfo");
&mov ("eax",1);
+ &xor ("ecx","ecx");
&cpuid ();
&and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0
&cmp ("ebp",0);
&cpuid ();
&and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0
&cmp ("ebp",0);
@@
-466,9
+473,23
@@
my $max = "ebp";
&ret ();
&function_end_B("OPENSSL_ia32_rdrand");
&ret ();
&function_end_B("OPENSSL_ia32_rdrand");
+&function_begin_B("OPENSSL_ia32_rdseed");
+ &mov ("ecx",8);
+&set_label("loop");
+ &rdseed ("eax");
+ &jc (&label("break"));
+ &loop (&label("loop"));
+&set_label("break");
+ &cmp ("eax",0);
+ &cmove ("eax","ecx");
+ &ret ();
+&function_end_B("OPENSSL_ia32_rdseed");
+
&initseg("OPENSSL_cpuid_setup");
&hidden("OPENSSL_cpuid_setup");
&hidden("OPENSSL_ia32cap_P");
&asm_finish();
&initseg("OPENSSL_cpuid_setup");
&hidden("OPENSSL_cpuid_setup");
&hidden("OPENSSL_ia32cap_P");
&asm_finish();
+
+close STDOUT;