linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: drop REG_OUT macro from hweight functions
@ 2019-07-28 11:51 Alexey Dobriyan
  2019-07-29  9:43 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Dobriyan @ 2019-07-28 11:51 UTC (permalink / raw)
  To: tglx, mingo, bp, hpa; +Cc: x86, linux-kernel

Output register is always RAX/EAX.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/arch_hweight.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/arch/x86/include/asm/arch_hweight.h
+++ b/arch/x86/include/asm/arch_hweight.h
@@ -6,10 +6,8 @@
 
 #ifdef CONFIG_64BIT
 #define REG_IN "D"
-#define REG_OUT "a"
 #else
 #define REG_IN "a"
-#define REG_OUT "a"
 #endif
 
 static __always_inline unsigned int __arch_hweight32(unsigned int w)
@@ -17,7 +15,7 @@ static __always_inline unsigned int __arch_hweight32(unsigned int w)
 	unsigned int res;
 
 	asm (ALTERNATIVE("call __sw_hweight32", "popcntl %1, %0", X86_FEATURE_POPCNT)
-			 : "="REG_OUT (res)
+			 : "=a" (res)
 			 : REG_IN (w));
 
 	return res;
@@ -45,7 +43,7 @@ static __always_inline unsigned long __arch_hweight64(__u64 w)
 	unsigned long res;
 
 	asm (ALTERNATIVE("call __sw_hweight64", "popcntq %1, %0", X86_FEATURE_POPCNT)
-			 : "="REG_OUT (res)
+			 : "=a" (res)
 			 : REG_IN (w));
 
 	return res;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-30 13:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 11:51 [PATCH] x86: drop REG_OUT macro from hweight functions Alexey Dobriyan
2019-07-29  9:43 ` Peter Zijlstra
2019-07-29 10:04   ` Peter Zijlstra
2019-07-29 20:44     ` Alexey Dobriyan
2019-07-30  8:08       ` Peter Zijlstra
2019-07-30 13:42         ` hpa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).