summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1999-01-22 09:13:17 +0000
committermycroft <mycroft@NetBSD.org>1999-01-22 09:13:17 +0000
commit8bf9a67c76da23c3a5f5ba05db6683412fbbfc8d (patch)
tree05f20233aeab428585ce20aa2a3dc8aaeeb1d94c
parent1e215d9224a6a490fafae3789e6cf64919cbfe18 (diff)
One instruction shorter, and returns the same 32-bit result.
-rw-r--r--lib/libc/arch/arm32/gen/byte_swap_2.S13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libc/arch/arm32/gen/byte_swap_2.S b/lib/libc/arch/arm32/gen/byte_swap_2.S
index 75a970bdc1e..9058e900d8e 100644
--- a/lib/libc/arch/arm32/gen/byte_swap_2.S
+++ b/lib/libc/arch/arm32/gen/byte_swap_2.S
@@ -1,11 +1,11 @@
-/* $NetBSD: byte_swap_2.S,v 1.1 1999/01/15 13:31:16 bouyer Exp $ */
+/* $NetBSD: byte_swap_2.S,v 1.2 1999/01/22 09:13:17 mycroft Exp $ */
/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
- * by Neil A. Carson
+ * by Charles M. Hannum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,8 +43,7 @@ _ENTRY(_C_FUNC(__bswap16));
_ENTRY(_C_FUNC(ntohs));
_ENTRY(_C_FUNC(htons));
_END_ENTRY
- mov r1, r0, lsl #8
- mov r0, r0, lsr #8
- bic r0, r0, #0xFF00
- orr r0, r0, r1
+ and r1, r0, #0xFF00
+ mov r0, r0, lsl #8
+ orr r0, r0, r1, lsr #8
mov pc, lr