Module Name: src Committed By: skrll Date: Fri Dec 11 12:41:10 UTC 2015
Modified Files: src/common/lib/libc/arch/arm/atomic: atomic_nand_16.S atomic_nand_32.S atomic_nand_64.S atomic_nand_8.S sync_fetch_and_nand_8.S Log Message: Use gcc 4.4 and later operation for nand, i.e. *ptr = ~(tmp & value) instead of *ptr = ~tmp & value There was also another bug in sync_fetch_and_nand_8 which I've also fixed. PR port-arm32/50513: Incorrect logic for atomic_nand_xx.S To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S \ src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S \ src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S cvs rdiff -u -r1.4 -r1.5 \ src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S:1.3 --- src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S:1.2 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S Fri Dec 11 12:41:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_16.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_nand_16.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -36,8 +36,8 @@ ENTRY_NP(_atomic_nand_16) mov ip, r0 1: ldrexh r0, [ip] /* load old value (to be returned) */ - mvns r3, r0 /* complement source */ - ands r3, r3, r1 /* calculate new value */ + ands r3, r0, r1 /* calculate new value step 1 */ + mvns r3, r3 /* ... complement for new value */ strexh r2, r3, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again */ @@ -57,8 +57,8 @@ STRONG_ALIAS(_atomic_nand_ushort,_atomic ENTRY_NP(_atomic_nand_16_nv) mov ip, r0 /* need r0 for return value */ 1: ldrexh r0, [ip] /* load old value */ - mvns r0, r0 /* complement source */ - ands r0, r0, r1 /* calculate new value (return value) */ + ands r0, r0, r1 /* calculate new value step 1 */ + mvns r0, r0 /* ... complement for new value */ strexh r2, r0, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again? */ Index: src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S:1.3 --- src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S:1.2 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S Fri Dec 11 12:41:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_32.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_nand_32.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -36,8 +36,8 @@ ENTRY_NP(_atomic_nand_32) mov ip, r0 1: ldrex r0, [ip] /* load old value (to be returned) */ - mvns r3, r0 /* complement source */ - ands r3, r3, r1 /* calculate new value */ + ands r3, r0, r1 /* calculate new value step 1 */ + mvns r3, r3 /* ... complement for new value */ strex r2, r3, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again */ @@ -59,8 +59,8 @@ STRONG_ALIAS(_atomic_nand_ulong,_atomic_ ENTRY_NP(_atomic_nand_32_nv) mov ip, r0 /* need r0 for return value */ 1: ldrex r0, [ip] /* load old value */ - mvns r0, r0 /* complement source */ - ands r0, r0, r1 /* calculate new value (return value) */ + ands r0, r0, r1 /* calculate new value step 1 */ + mvns r0, r0 /* ... complement for new value */ strex r2, r0, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again? */ Index: src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S:1.3 --- src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S:1.2 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S Fri Dec 11 12:41:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_8.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_nand_8.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -36,8 +36,8 @@ ENTRY_NP(_atomic_nand_8) mov ip, r0 1: ldrexb r0, [ip] /* load old value (to be returned) */ - mvns r3, r0 /* complement source */ - ands r3, r3, r1 /* calculate new value */ + ands r3, r0, r1 /* calculate new value step 1 */ + mvns r3, r3 /* ... complement for new value */ strexb r2, r3, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again */ @@ -57,8 +57,8 @@ STRONG_ALIAS(_atomic_nand_uchar,_atomic_ ENTRY_NP(_atomic_nand_8_nv) mov ip, r0 /* need r0 for return value */ 1: ldrexb r0, [ip] /* load old value */ - mvns r0, r0 /* complement source */ - ands r0, r0, r1 /* calculate new value (return value) */ + ands r0, r0, r1 /* calculate new value step 1*/ + mvns r0, r0 /* ... complement for new value */ strexb r2, r0, [ip] /* try to store */ cmp r2, #0 /* succeed? */ bne 1b /* no, try again? */ Index: src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S:1.4 --- src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S:1.3 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S Fri Dec 11 12:41:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_64.S,v 1.3 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_nand_64.S,v 1.4 2015/12/11 12:41:10 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -40,10 +40,10 @@ ENTRY_NP(_atomic_nand_64_nv) #endif mov ip, r0 /* need r0 for return value */ 1: ldrexd r0, r1, [ip] /* load old value */ - mvns r0, r0 /* complement old value */ - mvns r1, r1 /* complement old value */ - ands r0, r0, r2 /* calculate new value */ - ands r1, r1, r3 /* calculate new value */ + ands r0, r0, r2 /* calculate new value step 1 */ + ands r1, r1, r3 /* calculate new value step 2 */ + mvns r0, r0 /* ... complement for new value */ + mvns r1, r1 /* ... complement for new value */ strexd r4, r0, r1, [ip] /* try to store */ cmp r4, #0 /* succeed? */ bne 1b /* no, try again? */ Index: src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S diff -u src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S:1.4 src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S:1.5 --- src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S:1.4 Sun May 17 22:08:24 2015 +++ src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S Fri Dec 11 12:41:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sync_fetch_and_nand_8.S,v 1.4 2015/05/17 22:08:24 justin Exp $ */ +/* $NetBSD: sync_fetch_and_nand_8.S,v 1.5 2015/12/11 12:41:10 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -41,10 +41,10 @@ ENTRY_NP(__sync_fetch_and_nand_8) mov r2, r1 #endif 1: ldrexd r0, r1, [ip] /* load old value */ - mvns r4, r0 /* complement old value */ - mvns r5, r0 /* complement old value */ - ands r4, r4, r2 /* calculate new value */ - ands r5, r5, r3 /* calculate new value */ + ands r4, r0, r2 /* calculate new value step 1 */ + ands r5, r1, r3 /* calculate new value step 1 */ + mvns r4, r4 /* complement new value */ + mvns r5, r5 /* complement new value */ strexd r6, r4, r5, [ip] /* try to store */ cmp r6, #0 /* succeed? */ bne 1b /* no, try again */