summaryrefslogtreecommitdiffstats
path: root/crypto/x86cpuid.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-08-10 18:53:13 +0000
committerAndy Polyakov <appro@openssl.org>2011-08-10 18:53:13 +0000
commit922ac25f6408919db3dc121d893aadc9e3ddfa8f (patch)
tree47f9b8734b591b43c72bb34a0d5643464c5d79ef /crypto/x86cpuid.pl
parentaed53d6c5a8f7c823ab3363d7300892773a5f430 (diff)
Add provisory support for RDRAND [from HEAD].
Diffstat (limited to 'crypto/x86cpuid.pl')
-rw-r--r--crypto/x86cpuid.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl
index b8961ba4ad..d3d67c81d1 100644
--- a/crypto/x86cpuid.pl
+++ b/crypto/x86cpuid.pl
@@ -340,6 +340,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();