perlasm: fix symptom-less bugs, missing semicolons and 'my' declarations.
[openssl.git] / crypto / x86cpuid.pl
index 6595ff35fc1bbcbf6a4619a56088e48e7b2bd39b..808049a17db82ee8161bfe2230a8dee387f522fa 100644 (file)
@@ -19,9 +19,9 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &pushf  ();
        &pop    ("eax");
        &xor    ("ecx","eax");
        &pushf  ();
        &pop    ("eax");
        &xor    ("ecx","eax");
-       &bt     ("ecx",21);
-       &jnc    (&label("generic"));
        &xor    ("eax","eax");
        &xor    ("eax","eax");
+       &bt     ("ecx",21);
+       &jnc    (&label("nocpuid"));
        &cpuid  ();
        &mov    ("edi","eax");          # max value for standard query level
 
        &cpuid  ();
        &mov    ("edi","eax");          # max value for standard query level
 
@@ -119,10 +119,8 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &mov    ("esi","edx");
        &or     ("ebp","ecx");          # merge AMD XOP flag
 
        &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
        &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);
        &xor    ("ecx","ecx");
        &data_byte(0x0f,0x01,0xd0);     # xgetbv
        &and    ("eax",6);
@@ -138,6 +136,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
 &set_label("done");
        &mov    ("eax","esi");
        &mov    ("edx","ebp");
 &set_label("done");
        &mov    ("eax","esi");
        &mov    ("edx","ebp");
+&set_label("nocpuid");
 &function_end("OPENSSL_ia32_cpuid");
 
 &external_label("OPENSSL_ia32cap_P");
 &function_end("OPENSSL_ia32_cpuid");
 
 &external_label("OPENSSL_ia32cap_P");
@@ -166,7 +165,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
        &jnz    (&label("nohalt"));     # not enough privileges
 
        &pushf  ();
        &jnz    (&label("nohalt"));     # not enough privileges
 
        &pushf  ();
-       &pop    ("eax")
+       &pop    ("eax");
        &bt     ("eax",9);
        &jnc    (&label("nohalt"));     # interrupts are disabled
 
        &bt     ("eax",9);
        &jnc    (&label("nohalt"));     # interrupts are disabled
 
@@ -197,7 +196,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
 
 &function_begin_B("OPENSSL_far_spin");
        &pushf  ();
 
 &function_begin_B("OPENSSL_far_spin");
        &pushf  ();
-       &pop    ("eax")
+       &pop    ("eax");
        &bt     ("eax",9);
        &jnc    (&label("nospin"));     # interrupts are disabled
 
        &bt     ("eax",9);
        &jnc    (&label("nospin"));     # interrupts are disabled
 
@@ -281,7 +280,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
 #      arguments is 1 or 2!
 &function_begin_B("OPENSSL_indirect_call");
        {
 #      arguments is 1 or 2!
 &function_begin_B("OPENSSL_indirect_call");
        {
-       my $i,$max=7;           # $max has to be chosen as 4*n-1
+       my ($max,$i)=(7,);      # $max has to be chosen as 4*n-1
                                # in order to preserve eventual
                                # stack alignment
        &push   ("ebp");
                                # in order to preserve eventual
                                # stack alignment
        &push   ("ebp");