Commit c5022659 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

Don't emit SSE2 instructions unless were asked to.

PR: 1073
parent 51ff6bde
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ require "x86asm.pl";

&asm_init($ARGV[0],"x86cpuid");

for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }

&function_begin("OPENSSL_ia32_cpuid");
	&xor	("edx","edx");
	&pushf	();
@@ -115,6 +117,7 @@ require "x86asm.pl";
	&mov	("ecx",&DWP(0,"ecx"));
	&bt	(&DWP(0,"ecx"),1);
	&jnc	(&label("no_x87"));
	if ($sse2) {
		&bt	(&DWP(0,"ecx"),26);
		&jnc	(&label("no_sse2"));
		&pxor	("xmm0","xmm0");
@@ -126,6 +129,7 @@ require "x86asm.pl";
		&pxor	("xmm6","xmm6");
		&pxor	("xmm7","xmm7");
	&set_label("no_sse2");
	}
	# just a bunch of fldz to zap the fp/mm bank...
	&data_word(0xeed9eed9,0xeed9eed9,0xeed9eed9,0xeed9eed9);
	&emms	();