Module Name:    src
Committed By:   joerg
Date:           Thu Jan 14 02:06:04 UTC 2010

Modified Files:
        src/sys/arch/amd64/include: byte_swap.h

Log Message:
Provide inline assembly version of bswap64.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/include/byte_swap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/include/byte_swap.h
diff -u src/sys/arch/amd64/include/byte_swap.h:1.6 src/sys/arch/amd64/include/byte_swap.h:1.7
--- src/sys/arch/amd64/include/byte_swap.h:1.6	Sun Oct 26 00:08:15 2008
+++ src/sys/arch/amd64/include/byte_swap.h	Thu Jan 14 02:06:04 2010
@@ -1,7 +1,7 @@
-/*	$NetBSD: byte_swap.h,v 1.6 2008/10/26 00:08:15 mrg Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.7 2010/01/14 02:06:04 joerg Exp $	*/
 
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -42,6 +42,15 @@
 #include <sys/types.h>
 __BEGIN_DECLS
 
+#define	__BYTE_SWAP_U64_VARIABLE __byte_swap_u64_variable
+static __inline uint64_t __byte_swap_u64_variable(uint64_t);
+static __inline uint64_t
+__byte_swap_u64_variable(uint64_t x)
+{
+	__asm volatile ( "bswap %1" : "=r" (x) : "0" (x));
+	return (x);
+}
+
 #define	__BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
 static __inline uint32_t __byte_swap_u32_variable(uint32_t);
 static __inline uint32_t

Reply via email to