summaryrefslogtreecommitdiffstats
path: root/crypto/x86cpuid.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-02-14 17:24:12 +0100
committerAndy Polyakov <appro@openssl.org>2014-02-14 17:24:12 +0100
commitf4d456408d9d7bca31f34765d1a05fbd9fa55826 (patch)
treee52d1370e39be0b3d428d0b34b5a0c281a589e85 /crypto/x86cpuid.pl
parent5599c7331b90d9d29c9914c2a95c16d91485415a (diff)
x86[_64]cpuid.pl: add low-level RDSEED.
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 ef1216a8b2..86772329bc 100644
--- a/crypto/x86cpuid.pl
+++ b/crypto/x86cpuid.pl
@@ -469,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");