Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc/arch/m68k/atomic Simplify the variants retur...
details: https://anonhg.NetBSD.org/src/rev/d54f782a89d8
branches: trunk
changeset: 326854:d54f782a89d8
user: martin <martin%NetBSD.org@localhost>
date: Thu Feb 20 16:33:23 2014 +0000
description:
Simplify the variants returning a bool
diffstat:
common/lib/libc/arch/m68k/atomic/atomic_cas.S | 32 +++++++++++++-------------
1 files changed, 16 insertions(+), 16 deletions(-)
diffs (59 lines):
diff -r b88fa8425ab1 -r d54f782a89d8 common/lib/libc/arch/m68k/atomic/atomic_cas.S
--- a/common/lib/libc/arch/m68k/atomic/atomic_cas.S Thu Feb 20 15:52:30 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_cas.S Thu Feb 20 16:33:23 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas.S,v 1.8 2014/02/18 16:19:28 martin Exp $ */
+/* $NetBSD: atomic_cas.S,v 1.9 2014/02/20 16:33:23 martin Exp $ */
/*-
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,11 +68,11 @@
movl 12(%sp), %d1
casl %d3, %d1, (%a0)
/* %d3 now contains the old value */
- clrl %d0 /* assume it did not work */
- cmpl %d3, %d2
- bne 1f
- movl #1, %d0 /* return success */
-1: rts
+ beq 1f
+ clrl %d0 /* return false */
+ rts
+1: movl #1, %d0 /* return success */
+ rts
END(__sync_bool_compare_and_swap_4)
ENTRY(_atomic_cas_16)
@@ -94,11 +94,11 @@
movw 10(%sp), %d1
casw %d3, %d1, (%a0)
/* %d3 now contains the old value */
- clrl %d0 /* assume it did not work */
- cmpw %d3, %d2
- bne 1f
- movl #1, %d0 /* return success */
-1: rts
+ beq 1f
+ clrl %d0 /* return failure */
+ rts
+1: movl #1, %d0 /* return success */
+ rts
END(__sync_bool_compare_and_swap_2)
ENTRY(_atomic_cas_8)
@@ -121,10 +121,10 @@
movb 9(%sp), %d1
casb %d3, %d1, (%a0)
/* %d3 now contains the old value */
- clrl %d0 /* assume it did not work */
- cmpb %d3, %d2
- bne 1f
- movl #1, %d0 /* return success */
-1: rts
+ beq 1f
+ clrl %d0 /* return failure */
+ rts
+1: movl #1, %d0 /* return success */
+ rts
END(__sync_bool_compare_and_swap_1)
Home |
Main Index |
Thread Index |
Old Index