This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Simplify AVX check


Hi,

The only possible values in EAX are 0 or 6.  We can just subtract it by
-1 to get the possible/negative value.


H.J.
----
2011-07-23  H.J. Lu  <hongjiu.lu@intel.com>
 
	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Simplify
	AVX check.

diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 45a2dc2..829a617 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -148,10 +148,8 @@ L(have_avx):
 	// Get XFEATURE_ENABLED_MASK
 	xgetbv
 	andl	$0x6, %eax
-	cmpl	$0x6, %eax
-	// Nonzero if SSE and AVX state saving is enabled.
-	sete	%al
-2:	leal	-1(%eax,%eax), %eax
+	// EAX is 6 if SSE and AVX state saving is enabled.
+2:	dec	%eax
 	movl	%eax, L(have_avx)(%rip)
 	cmpl	$0, %eax
 
@@ -194,10 +192,8 @@ _dl_x86_64_save_sse:
 	// Get XFEATURE_ENABLED_MASK
 	xgetbv
 	andl	$0x6, %eax
-	cmpl	$0x6, %eax
-	// Nonzero if SSE and AVX state saving is enabled.
-	sete	%al
-2:	leal	-1(%eax,%eax), %eax
+	// EAX is 6 if SSE and AVX state saving is enabled.
+2:	dec	%eax
 	movl	%eax, L(have_avx)(%rip)
 	cmpl	$0, %eax
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]