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/riscv/atomic Switch to new ABI (a0/a1 r...
details: https://anonhg.NetBSD.org/src/rev/2e97abd7de2e
branches: trunk
changeset: 336914:2e97abd7de2e
user: matt <matt%NetBSD.org@localhost>
date: Fri Mar 27 06:42:37 2015 +0000
description:
Switch to new ABI (a0/a1 replace v0/v1)
diffstat:
common/lib/libc/arch/riscv/atomic/atomic_add_32.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_add_64.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_and_32.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_and_64.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_cas_32.S | 24 +++++++++++----------
common/lib/libc/arch/riscv/atomic/atomic_cas_64.S | 24 +++++++++++----------
common/lib/libc/arch/riscv/atomic/atomic_nand_32.S | 24 +++++++++++----------
common/lib/libc/arch/riscv/atomic/atomic_nand_64.S | 24 +++++++++++----------
common/lib/libc/arch/riscv/atomic/atomic_or_32.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_or_64.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_sub_32.S | 12 +++++-----
common/lib/libc/arch/riscv/atomic/atomic_sub_64.S | 12 +++++-----
common/lib/libc/arch/riscv/atomic/atomic_swap_32.S | 4 +-
common/lib/libc/arch/riscv/atomic/atomic_swap_64.S | 4 +-
common/lib/libc/arch/riscv/atomic/atomic_xor_32.S | 8 +++---
common/lib/libc/arch/riscv/atomic/atomic_xor_64.S | 8 +++---
16 files changed, 100 insertions(+), 92 deletions(-)
diffs (truncated from 514 to 300 lines):
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_add_32.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_add_32.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_add_32.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_add_32.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_add_32.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
ENTRY_NP(_atomic_inc_32)
li a1, 1
ENTRY_NP(_atomic_add_32)
- amoadd.w.aq v0, a1, 0(a0)
+ amoadd.w.aq a0, a1, 0(a0)
ret
END(_atomic_add_32)
END(_atomic_inc_32)
@@ -64,8 +64,8 @@
ENTRY_NP(_atomic_inc_32_nv)
li a1, 1
ENTRY_NP(_atomic_add_32_nv)
- amoadd.w.aq v0, a1, 0(a0) /* update memory and get old value */
- INT_ADD v0, v0, a1 /* turn into new value */
+ amoadd.w.aq t0, a1, 0(a0) /* update memory and get old value */
+ INT_ADD a0, t0, a1 /* turn into new value */
ret
END(_atomic_add_32_nv)
END(_atomic_inc_32_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_add_64.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_add_64.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_add_64.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_add_64.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_add_64.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
ENTRY_NP(_atomic_inc_64)
li a1, 1
ENTRY_NP(_atomic_add_64)
- amoadd.d.aq v0, a1, 0(a0)
+ amoadd.d.aq a0, a1, 0(a0)
ret
END(_atomic_add_64)
END(_atomic_inc_64)
@@ -56,8 +56,8 @@
ENTRY_NP(_atomic_inc_64_nv)
li a1, 1
ENTRY_NP(_atomic_add_64_nv)
- amoadd.d.aq v0, a1, 0(a0) /* update memory and get old value */
- LONG_ADD v0, v0, a1 /* turn into new value */
+ amoadd.d.aq t0, a1, 0(a0) /* update memory and get old value */
+ LONG_ADD a0, t0, a1 /* turn into new value */
ret
END(_atomic_add_64_nv)
END(_atomic_inc_64_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_and_32.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_and_32.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_and_32.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_and_32.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_and_32.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_and_32)
- amoand.w.aq v0, a1, 0(a0)
+ amoand.w.aq a0, a1, 0(a0)
ret
END(_atomic_and_32)
@@ -47,8 +47,8 @@
CRT_ALIAS(__atomic_fetch_and_4,_atomic_and_32)
ENTRY_NP(_atomic_and_32_nv)
- amoand.w.aq v0, a1, 0(a0) /* update memory and get old value */
- and v0, v0, a1 /* turn into new value */
+ amoand.w.aq t0, a1, 0(a0) /* update memory and get old value */
+ and a0, t0, a1 /* turn into new value */
ret
END(_atomic_and_32_nv)
ATOMIC_OP_ALIAS(atomic_and_32_nv,_atomic_and_32_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_and_64.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_and_64.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_and_64.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_and_64.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_and_64.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_and_64)
- amoand.d.aq v0, a1, 0(a0)
+ amoand.d.aq a0, a1, 0(a0)
ret
END(_atomic_and_64)
@@ -43,8 +43,8 @@
CRT_ALIAS(__atomic_fetch_and_8,_atomic_and_64)
ENTRY_NP(_atomic_and_64_nv)
- amoand.d.aq v0, a1, 0(a0) /* update memory and get old value */
- and v0, v0, a1 /* turn into new value */
+ amoand.d.aq t0, a1, 0(a0) /* update memory and get old value */
+ and a0, t0, a1 /* turn into new value */
ret
END(_atomic_and_64_nv)
ATOMIC_OP_ALIAS(atomic_and_64_nv,_atomic_and_64_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_cas_32.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_cas_32.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_cas_32.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_32.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_cas_32.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -31,10 +31,11 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_cas_32)
-1: lr.w v0, 0(a0)
- bne a1, v0, 2f
- sc.w v1, a2, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.w a0, 0(t0)
+ bne a1, a0, 2f
+ sc.w t1, a2, 0(t0)
+ bnez t1, 1b
2:
ret
END(_atomic_cas_32)
@@ -55,12 +56,13 @@
CRT_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32)
ENTRY_NP(_atomic_bool_cas_32)
- li v0, 0
-1: lr.w v1, 0(a0)
- bne a1, v1, 2f
- sc.w v1, a2, 0(a0)
- bnez v1, 1b
- li v0, 1
+ mv t0, a0
+ li a0, 0
+1: lr.w t1, 0(t0)
+ bne a1, t1, 2f
+ sc.w t1, a2, 0(t0)
+ bnez t1, 1b
+ li a0, 1
2:
ret
END(_atomic_bool_cas_32)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_cas_64.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_cas_64.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_cas_64.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_64.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_cas_64.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -32,10 +32,11 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_cas_64)
-1: lr.d v0, 0(a0)
- bne a1, v0, 2f
- sc.d v1, a2, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.d a0, 0(t0)
+ bne a1, a0, 2f
+ sc.d t1, a2, 0(t0)
+ bnez t1, 1b
2:
ret
END(_atomic_cas_64)
@@ -53,12 +54,13 @@
CRT_ALIAS(__sync_val_compare_and_swap_8,_atomic_cas_64)
ENTRY_NP(_atomic_bool_cas_64)
- li v0, 0
-1: lr.d v1, 0(a0)
- bne a1, v1, 2f
- sc.d v1, a2, 0(a0)
- bnez v1, 1b
- li v0, 1
+ mv t0, a0
+ li a0, 0
+1: lr.d t1, 0(t0)
+ bne a1, t1, 2f
+ sc.d t1, a2, 0(t0)
+ bnez t1, 1b
+ li a0, 1
2:
ret
END(_atomic_bool_cas_64)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_nand_32.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_nand_32.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_nand_32.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_nand_32.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_nand_32.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -31,11 +31,12 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_nand_32)
-1: lr.w v0, 0(a0)
- not t0, v0
- and t0, t0, a1
- sc.w v1, t0, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.w a0, 0(t0)
+ not t2, a0
+ and t2, t2, a1
+ sc.w t1, t2, 0(t0)
+ bnez t1, 1b
ret
END(_atomic_nand_32)
@@ -50,11 +51,12 @@
CRT_ALIAS(__atomic_fetch_nand_4,_atomic_nand_32)
ENTRY_NP(_atomic_nand_32_nv)
-1: lr.w v0, 0(a0)
- not v0, v0
- and v0, v0, a1
- sc.w v1, v0, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.w a0, 0(t0)
+ not a0, a0
+ and a0, a0, a1
+ sc.w t1, a0, 0(t0)
+ bnez t1, 1b
ret
END(_atomic_nand_32_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_nand_64.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_nand_64.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_nand_64.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_nand_64.S,v 1.1 2014/09/19 17:36:24 matt Exp $ */
+/* $NetBSD: atomic_nand_64.S,v 1.2 2015/03/27 06:42:37 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -31,11 +31,12 @@
#include "atomic_op_asm.h"
ENTRY_NP(_atomic_nand_64)
-1: lr.d v0, 0(a0)
- not t0, v0
- and t0, t0, a1
- sc.d v1, t0, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.d a0, 0(t0)
+ not t2, a0
+ and t2, t2, a1
+ sc.d t1, t2, 0(t0)
+ bnez t1, 1b
ret
END(_atomic_nand_64)
@@ -46,11 +47,12 @@
CRT_ALIAS(__atomic_fetch_nand_8,_atomic_nand_64)
ENTRY_NP(_atomic_nand_64_nv)
-1: lr.d v0, 0(a0)
- not v0, v0
- and v0, v0, a1
- sc.d v1, v0, 0(a0)
- bnez v1, 1b
+ mv t0, a0
+1: lr.d a0, 0(t0)
+ not a0, a0
+ and a0, a0, a1
+ sc.d t1, a0, 0(t0)
+ bnez t1, 1b
ret
END(_atomic_nand_64_nv)
diff -r 125939643e05 -r 2e97abd7de2e common/lib/libc/arch/riscv/atomic/atomic_or_32.S
--- a/common/lib/libc/arch/riscv/atomic/atomic_or_32.S Fri Mar 27 06:34:31 2015 +0000
+++ b/common/lib/libc/arch/riscv/atomic/atomic_or_32.S Fri Mar 27 06:42:37 2015 +0000
@@ -1,4 +1,4 @@
Home |
Main Index |
Thread Index |
Old Index