xref: /netbsd-src/common/lib/libc/arch/powerpc/atomic/atomic_dec.S (revision 09ff5f3b480cb7eb269d9eec28950bf196ce206c)
1*09ff5f3bSriastradh/*	$NetBSD: atomic_dec.S,v 1.8 2022/04/06 22:47:56 riastradh Exp $	*/
2bc7bf35cSad
3bc7bf35cSad/*-
4bc7bf35cSad * Copyright (c) 2007 The NetBSD Foundation, Inc.
5bc7bf35cSad * All rights reserved.
6bc7bf35cSad *
7bc7bf35cSad * This code is derived from software contributed to The NetBSD Foundation
8bc7bf35cSad * by Jason R. Thorpe.
9bc7bf35cSad *
10bc7bf35cSad * Redistribution and use in source and binary forms, with or without
11bc7bf35cSad * modification, are permitted provided that the following conditions
12bc7bf35cSad * are met:
13bc7bf35cSad * 1. Redistributions of source code must retain the above copyright
14bc7bf35cSad *    notice, this list of conditions and the following disclaimer.
15bc7bf35cSad * 2. Redistributions in binary form must reproduce the above copyright
16bc7bf35cSad *    notice, this list of conditions and the following disclaimer in the
17bc7bf35cSad *    documentation and/or other materials provided with the distribution.
18bc7bf35cSad *
19bc7bf35cSad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20bc7bf35cSad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21bc7bf35cSad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22bc7bf35cSad * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23bc7bf35cSad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24bc7bf35cSad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25bc7bf35cSad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26bc7bf35cSad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27bc7bf35cSad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28bc7bf35cSad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29bc7bf35cSad * POSSIBILITY OF SUCH DAMAGE.
30bc7bf35cSad */
31bc7bf35cSad
32bc7bf35cSad#include "atomic_op_asm.h"
33bc7bf35cSad
34*09ff5f3bSriastradh__RCSID("$NetBSD: atomic_dec.S,v 1.8 2022/04/06 22:47:56 riastradh Exp $")
35bc7bf35cSad	.text
366dd4b41fSmattATOMIC_OP_32_ARG(dec,addi,-1)
376dd4b41fSmattATOMIC_OP_32_ARG_NV(dec,addi,-1)
38bc7bf35cSad
39bc7bf35cSadATOMIC_OP_ALIAS(atomic_dec_uint,_atomic_dec_32)
40bc7bf35cSadATOMIC_OP_ALIAS(atomic_dec_uint_nv,_atomic_dec_32_nv)
416dd4b41fSmatt
426dd4b41fSmattSTRONG_ALIAS(_atomic_dec_uint,_atomic_dec_32)
43bc7bf35cSadSTRONG_ALIAS(_atomic_dec_uint_nv,_atomic_dec_32_nv)
446dd4b41fSmatt
456dd4b41fSmatt#if defined(_LP64)
466dd4b41fSmattATOMIC_OP_64_ARG(dec,addi,-1)
476dd4b41fSmattATOMIC_OP_64_ARG_NV(dec,addi,-1)
486dd4b41fSmatt
496dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ulong,_atomic_dec_64)
506dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ulong_nv,_atomic_dec_64_nv)
516dd4b41fSmatt
526dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ptr,_atomic_dec_64)
536dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ptr_nv,_atomic_dec_64_nv)
546dd4b41fSmatt
556dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ulong,_atomic_dec_64)
566dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ulong_nv,_atomic_dec_64_nv)
576dd4b41fSmatt
586dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ptr,_atomic_dec_64)
596dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ptr_nv,_atomic_dec_64_nv)
606dd4b41fSmatt#else
616dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ulong,_atomic_dec_32)
62bc7bf35cSadATOMIC_OP_ALIAS(atomic_dec_ulong_nv,_atomic_dec_32_nv)
636dd4b41fSmatt
646dd4b41fSmattATOMIC_OP_ALIAS(atomic_dec_ptr,_atomic_dec_32)
65bc7bf35cSadATOMIC_OP_ALIAS(atomic_dec_ptr_nv,_atomic_dec_32_nv)
666dd4b41fSmatt
676dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ulong,_atomic_dec_32)
686dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ulong_nv,_atomic_dec_32_nv)
696dd4b41fSmatt
706dd4b41fSmattSTRONG_ALIAS(_atomic_dec_ptr,_atomic_dec_32)
71bc7bf35cSadSTRONG_ALIAS(_atomic_dec_ptr_nv,_atomic_dec_32_nv)
72bc7bf35cSad#endif
73