1 #!/usr/bin/env perl
2
3 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
4 push(@INC, "${dir}perlasm", "perlasm");
5 require "x86asm.pl";
6
7 &asm_init($ARGV[0],"x86cpuid");
8
9 for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
10
11 &function_begin("OPENSSL_ia32_cpuid");
12 &xor ("edx","edx");
13 &pushf ();
14 &pop ("eax");
15 &mov ("ecx","eax");
16 &xor ("eax",1<<21);
17 &push ("eax");
18 &popf ();
19 &pushf ();
20 &pop ("eax");
21 &xor ("ecx","eax");
22 &xor ("eax","eax");
23 &bt ("ecx",21);
24 &jnc (&label("nocpuid"));
336 &test ("ecx",-4);
337 &lea ("edx",&DWP(4,"edx"));
338 &jnz (&label("aligned"));
339 &cmp ("ecx",0);
340 &jne (&label("little"));
341 &ret ();
342 &function_end_B("OPENSSL_cleanse");
343
344 &function_begin_B("OPENSSL_ia32_rdrand");
345 &mov ("ecx",8);
346 &set_label("loop");
347 &rdrand ("eax");
348 &jc (&label("break"));
349 &loop (&label("loop"));
350 &set_label("break");
351 &cmp ("eax",0);
352 &cmove ("eax","ecx");
353 &ret ();
354 &function_end_B("OPENSSL_ia32_rdrand");
355
356 &initseg("OPENSSL_cpuid_setup");
357
358 &asm_finish();
|
1 #!/usr/bin/env perl
2
3 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
4 push(@INC, "${dir}", "perlasm");
5 require "x86asm.pl";
6
7 &asm_init($ARGV[0],"x86cpuid");
8
9 for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
10
11 &function_begin("OPENSSL_ia32_cpuid");
12 &xor ("edx","edx");
13 &pushf ();
14 &pop ("eax");
15 &mov ("ecx","eax");
16 &xor ("eax",1<<21);
17 &push ("eax");
18 &popf ();
19 &pushf ();
20 &pop ("eax");
21 &xor ("ecx","eax");
22 &xor ("eax","eax");
23 &bt ("ecx",21);
24 &jnc (&label("nocpuid"));
336 &test ("ecx",-4);
337 &lea ("edx",&DWP(4,"edx"));
338 &jnz (&label("aligned"));
339 &cmp ("ecx",0);
340 &jne (&label("little"));
341 &ret ();
342 &function_end_B("OPENSSL_cleanse");
343
344 &function_begin_B("OPENSSL_ia32_rdrand");
345 &mov ("ecx",8);
346 &set_label("loop");
347 &rdrand ("eax");
348 &jc (&label("break"));
349 &loop (&label("loop"));
350 &set_label("break");
351 &cmp ("eax",0);
352 &cmove ("eax","ecx");
353 &ret ();
354 &function_end_B("OPENSSL_ia32_rdrand");
355
356 &initseg("illumos_locking_setup");
357 &initseg("OPENSSL_cpuid_setup");
358
359 &hidden("illumos_locking_setup");
360 &hidden("OPENSSL_cpuid_setup");
361 &hidden("OPENSSL_ia32cap_P");
362
363 &asm_finish();
|