aes-s390x.pl: make it link.
[openssl.git] / crypto / x86cpuid.pl
index b8961ba4ad6412fce5c669fbbc2b35eddd98e15b..97adde383bb4e8d6ef0569892a02b3585469c416 100644 (file)
@@ -119,10 +119,8 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &mov    ("esi","edx");
        &or     ("ebp","ecx");          # merge AMD XOP flag
 
-       &bt     ("ecx",26);             # check XSAVE bit
-       &jnc    (&label("done"));
        &bt     ("ecx",27);             # check OSXSAVE bit
-       &jnc    (&label("clear_xmm"));
+       &jnc    (&label("clear_avx"));
        &xor    ("ecx","ecx");
        &data_byte(0x0f,0x01,0xd0);     # xgetbv
        &and    ("eax",6);
@@ -340,6 +338,18 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &ret    ();
 &function_end_B("OPENSSL_cleanse");
 
+&function_begin_B("OPENSSL_ia32_rdrand");
+       &mov    ("ecx",8);
+&set_label("loop");
+       &rdrand ("eax");
+       &jc     (&label("break"));
+       &loop   (&label("loop"));
+&set_label("break");
+       &cmp    ("eax",0);
+       &cmove  ("eax","ecx");
+       &ret    ();
+&function_end_B("OPENSSL_ia32_rdrand");
+
 &initseg("OPENSSL_cpuid_setup");
 
 &asm_finish();