Module Name:    src
Committed By:   matt
Date:           Wed Sep  5 01:03:54 UTC 2012

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

Log Message:
Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
decent code for it.  Fixes PR/46898.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/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/arm/include/byte_swap.h
diff -u src/sys/arch/arm/include/byte_swap.h:1.11 src/sys/arch/arm/include/byte_swap.h:1.12
--- src/sys/arch/arm/include/byte_swap.h:1.11	Fri Jul 20 18:53:34 2012
+++ src/sys/arch/arm/include/byte_swap.h	Wed Sep  5 01:03:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.11 2012/07/20 18:53:34 matt Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.12 2012/09/05 01:03:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2002 The NetBSD Foundation, Inc.
@@ -94,15 +94,16 @@ __byte_swap_u16_variable(uint16_t v)
 		__asm("rev16\t%0, %1" : "=r" (v) : "0" (v));
 		return v;
 	}
-#elif !defined(__thumb__)
+#elif !defined(__thumb__) && 0	/* gcc produces decent code for this */
 	if (!__builtin_constant_p(v)) {
+		uint32_t v0 = v;
 		__asm volatile(
 			"mov	%0, %1, ror #8\n"
 			"orr	%0, %0, %0, lsr #16\n"
 			"bic	%0, %0, %0, lsl #16"
-		: "=&r" (v)
-		: "0" (v));
-		return (v);
+		: "=&r" (v0)
+		: "0" (v0));
+		return v0;
 	}
 #endif
 	v &= 0xffff;

Reply via email to