Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/include Disable arm32 __asm for _byte_swap_u16_...
details: https://anonhg.NetBSD.org/src/rev/834b467625d6
branches: trunk
changeset: 781417:834b467625d6
user: matt <matt%NetBSD.org@localhost>
date: Wed Sep 05 01:03:53 2012 +0000
description:
Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
decent code for it. Fixes PR/46898.
diffstat:
sys/arch/arm/include/byte_swap.h | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (30 lines):
diff -r 0862ec52f2e5 -r 834b467625d6 sys/arch/arm/include/byte_swap.h
--- a/sys/arch/arm/include/byte_swap.h Wed Sep 05 00:22:41 2012 +0000
+++ b/sys/arch/arm/include/byte_swap.h Wed Sep 05 01:03:53 2012 +0000
@@ -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 @@
__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;
Home |
Main Index |
Thread Index |
Old Index