Move the SCT List extension parser into libssl.
[openssl.git] / crypto / x86cpuid.pl
index e8a75181afce09206f72fd82bb77db5f7b1493ab..86772329bc7bd5a2492e59fdddb25e7901b0f6c2 100644 (file)
@@ -81,6 +81,16 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &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"));
@@ -92,15 +102,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &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);
        &xor    ("ecx","ecx");
@@ -468,6 +469,18 @@ my $max = "ebp";
        &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");