Commit c64959bd by Michael Meissner Committed by Michael Meissner

Fix spacing issue.

From-SVN: r253696
parent 912a7ec3
2017-10-12 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/amo.h: Fix spacing issue.
2017-10-12 Jakub Jelinek <jakub@redhat.com> 2017-10-12 Jakub Jelinek <jakub@redhat.com>
PR target/82498 PR target/82498
/* Power ISA 3.0 atomic memory operation include file. /* Power ISA 3.0 atomic memory operation include file.
Copyright (C) 2017 Free Software Foundation, Inc. Copyright (C) 2017 Free Software Foundation, Inc.
Contributed by Michael Meissner <meissner@linux.vnet.ibm.com>. Contributed by Michael Meissner <meissner@linux.vnet.ibm.com>.
...@@ -23,17 +23,17 @@ ...@@ -23,17 +23,17 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */ <http://www.gnu.org/licenses/>. */
#ifndef _AMO_H #ifndef _AMO_H
#define _AMO_H #define _AMO_H
#if !defined(_ARCH_PWR9) || !defined(_ARCH_PPC64) #if !defined(_ARCH_PWR9) || !defined(_ARCH_PPC64)
#error "The atomic memory operations require Power 64-bit ISA 3.0" #error "The atomic memory operations require Power 64-bit ISA 3.0"
#else #else
#include <stdint.h> #include <stdint.h>
/* Enumeration of the LWAT/LDAT sub-opcodes. */ /* Enumeration of the LWAT/LDAT sub-opcodes. */
enum _AMO_LD { enum _AMO_LD {
_AMO_LD_ADD = 0x00, /* Fetch and Add. */ _AMO_LD_ADD = 0x00, /* Fetch and Add. */
_AMO_LD_XOR = 0x01, /* Fetch and Xor. */ _AMO_LD_XOR = 0x01, /* Fetch and Xor. */
_AMO_LD_IOR = 0x02, /* Fetch and Ior. */ _AMO_LD_IOR = 0x02, /* Fetch and Ior. */
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
_AMO_LD_INC_BOUNDED = 0x18, /* Fetch and Increment Bounded. */ _AMO_LD_INC_BOUNDED = 0x18, /* Fetch and Increment Bounded. */
_AMO_LD_INC_EQUAL = 0x19, /* Fetch and Increment Equal. */ _AMO_LD_INC_EQUAL = 0x19, /* Fetch and Increment Equal. */
_AMO_LD_DEC_BOUNDED = 0x1A /* Fetch and Decrement Bounded. */ _AMO_LD_DEC_BOUNDED = 0x1A /* Fetch and Decrement Bounded. */
}; };
/* Implementation of the simple LWAT/LDAT operations that take one register and /* Implementation of the simple LWAT/LDAT operations that take one register and
modify one word or double-word of memory and return the value that was modify one word or double-word of memory and return the value that was
previously in the memory location. previously in the memory location.
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
points to a suitably aligned memory location. Asm volatile is used to points to a suitably aligned memory location. Asm volatile is used to
prevent the optimizer from moving the operation. */ prevent the optimizer from moving the operation. */
#define _AMO_LD_SIMPLE(NAME, TYPE, OPCODE, FC) \ #define _AMO_LD_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ TYPE \ static __inline__ TYPE \
NAME (TYPE *_PTR, TYPE _VALUE) \ NAME (TYPE *_PTR, TYPE _VALUE) \
{ \ { \
unsigned __int128 _TMP; \ unsigned __int128 _TMP; \
TYPE _RET; \ TYPE _RET; \
__asm__ volatile ("mr %L1,%3\n" \ __asm__ volatile ("mr %L1,%3\n" \
...@@ -69,36 +69,36 @@ ...@@ -69,36 +69,36 @@
: "+Q" (_PTR[0]), "=&r" (_TMP), "=r" (_RET) \ : "+Q" (_PTR[0]), "=&r" (_TMP), "=r" (_RET) \
: "r" (_VALUE), "n" (FC)); \ : "r" (_VALUE), "n" (FC)); \
return _RET; \ return _RET; \
} }
_AMO_LD_SIMPLE (amo_lwat_add, uint32_t, "lwat", _AMO_LD_ADD) _AMO_LD_SIMPLE (amo_lwat_add, uint32_t, "lwat", _AMO_LD_ADD)
_AMO_LD_SIMPLE (amo_lwat_xor, uint32_t, "lwat", _AMO_LD_XOR) _AMO_LD_SIMPLE (amo_lwat_xor, uint32_t, "lwat", _AMO_LD_XOR)
_AMO_LD_SIMPLE (amo_lwat_ior, uint32_t, "lwat", _AMO_LD_IOR) _AMO_LD_SIMPLE (amo_lwat_ior, uint32_t, "lwat", _AMO_LD_IOR)
_AMO_LD_SIMPLE (amo_lwat_and, uint32_t, "lwat", _AMO_LD_AND) _AMO_LD_SIMPLE (amo_lwat_and, uint32_t, "lwat", _AMO_LD_AND)
_AMO_LD_SIMPLE (amo_lwat_umax, uint32_t, "lwat", _AMO_LD_UMAX) _AMO_LD_SIMPLE (amo_lwat_umax, uint32_t, "lwat", _AMO_LD_UMAX)
_AMO_LD_SIMPLE (amo_lwat_umin, uint32_t, "lwat", _AMO_LD_UMIN) _AMO_LD_SIMPLE (amo_lwat_umin, uint32_t, "lwat", _AMO_LD_UMIN)
_AMO_LD_SIMPLE (amo_lwat_swap, uint32_t, "lwat", _AMO_LD_SWAP) _AMO_LD_SIMPLE (amo_lwat_swap, uint32_t, "lwat", _AMO_LD_SWAP)
_AMO_LD_SIMPLE (amo_lwat_sadd, int32_t, "lwat", _AMO_LD_ADD) _AMO_LD_SIMPLE (amo_lwat_sadd, int32_t, "lwat", _AMO_LD_ADD)
_AMO_LD_SIMPLE (amo_lwat_smax, int32_t, "lwat", _AMO_LD_SMAX) _AMO_LD_SIMPLE (amo_lwat_smax, int32_t, "lwat", _AMO_LD_SMAX)
_AMO_LD_SIMPLE (amo_lwat_smin, int32_t, "lwat", _AMO_LD_SMIN) _AMO_LD_SIMPLE (amo_lwat_smin, int32_t, "lwat", _AMO_LD_SMIN)
_AMO_LD_SIMPLE (amo_lwat_sswap, int32_t, "lwat", _AMO_LD_SWAP) _AMO_LD_SIMPLE (amo_lwat_sswap, int32_t, "lwat", _AMO_LD_SWAP)
_AMO_LD_SIMPLE (amo_ldat_add, uint64_t, "ldat", _AMO_LD_ADD) _AMO_LD_SIMPLE (amo_ldat_add, uint64_t, "ldat", _AMO_LD_ADD)
_AMO_LD_SIMPLE (amo_ldat_xor, uint64_t, "ldat", _AMO_LD_XOR) _AMO_LD_SIMPLE (amo_ldat_xor, uint64_t, "ldat", _AMO_LD_XOR)
_AMO_LD_SIMPLE (amo_ldat_ior, uint64_t, "ldat", _AMO_LD_IOR) _AMO_LD_SIMPLE (amo_ldat_ior, uint64_t, "ldat", _AMO_LD_IOR)
_AMO_LD_SIMPLE (amo_ldat_and, uint64_t, "ldat", _AMO_LD_AND) _AMO_LD_SIMPLE (amo_ldat_and, uint64_t, "ldat", _AMO_LD_AND)
_AMO_LD_SIMPLE (amo_ldat_umax, uint64_t, "ldat", _AMO_LD_UMAX) _AMO_LD_SIMPLE (amo_ldat_umax, uint64_t, "ldat", _AMO_LD_UMAX)
_AMO_LD_SIMPLE (amo_ldat_umin, uint64_t, "ldat", _AMO_LD_UMIN) _AMO_LD_SIMPLE (amo_ldat_umin, uint64_t, "ldat", _AMO_LD_UMIN)
_AMO_LD_SIMPLE (amo_ldat_swap, uint64_t, "ldat", _AMO_LD_SWAP) _AMO_LD_SIMPLE (amo_ldat_swap, uint64_t, "ldat", _AMO_LD_SWAP)
_AMO_LD_SIMPLE (amo_ldat_sadd, int64_t, "ldat", _AMO_LD_ADD) _AMO_LD_SIMPLE (amo_ldat_sadd, int64_t, "ldat", _AMO_LD_ADD)
_AMO_LD_SIMPLE (amo_ldat_smax, int64_t, "ldat", _AMO_LD_SMAX) _AMO_LD_SIMPLE (amo_ldat_smax, int64_t, "ldat", _AMO_LD_SMAX)
_AMO_LD_SIMPLE (amo_ldat_smin, int64_t, "ldat", _AMO_LD_SMIN) _AMO_LD_SIMPLE (amo_ldat_smin, int64_t, "ldat", _AMO_LD_SMIN)
_AMO_LD_SIMPLE (amo_ldat_sswap, int64_t, "ldat", _AMO_LD_SWAP) _AMO_LD_SIMPLE (amo_ldat_sswap, int64_t, "ldat", _AMO_LD_SWAP)
/* Enumeration of the STWAT/STDAT sub-opcodes. */ /* Enumeration of the STWAT/STDAT sub-opcodes. */
enum _AMO_ST { enum _AMO_ST {
_AMO_ST_ADD = 0x00, /* Store Add. */ _AMO_ST_ADD = 0x00, /* Store Add. */
_AMO_ST_XOR = 0x01, /* Store Xor. */ _AMO_ST_XOR = 0x01, /* Store Xor. */
_AMO_ST_IOR = 0x02, /* Store Ior. */ _AMO_ST_IOR = 0x02, /* Store Ior. */
...@@ -108,45 +108,45 @@ ...@@ -108,45 +108,45 @@
_AMO_ST_UMIN = 0x06, /* Store Unsigned Minimum. */ _AMO_ST_UMIN = 0x06, /* Store Unsigned Minimum. */
_AMO_ST_SMIN = 0x07, /* Store Signed Minimum. */ _AMO_ST_SMIN = 0x07, /* Store Signed Minimum. */
_AMO_ST_TWIN = 0x18 /* Store Twin. */ _AMO_ST_TWIN = 0x18 /* Store Twin. */
}; };
/* Implementation of the simple STWAT/STDAT operations that take one register /* Implementation of the simple STWAT/STDAT operations that take one register
and modify one word or double-word of memory. No value is returned. and modify one word or double-word of memory. No value is returned.
The STWAT/STDAT opcode requires the address to be a single register, and The STWAT/STDAT opcode requires the address to be a single register, and
that points to a suitably aligned memory location. Asm volatile is used to that points to a suitably aligned memory location. Asm volatile is used to
prevent the optimizer from moving the operation. */ prevent the optimizer from moving the operation. */
#define _AMO_ST_SIMPLE(NAME, TYPE, OPCODE, FC) \ #define _AMO_ST_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ void \ static __inline__ void \
NAME (TYPE *_PTR, TYPE _VALUE) \ NAME (TYPE *_PTR, TYPE _VALUE) \
{ \ { \
__asm__ volatile (OPCODE " %1,%P0,%2" \ __asm__ volatile (OPCODE " %1,%P0,%2" \
: "+Q" (_PTR[0]) \ : "+Q" (_PTR[0]) \
: "r" (_VALUE), "n" (FC)); \ : "r" (_VALUE), "n" (FC)); \
return; \ return; \
} }
_AMO_ST_SIMPLE (amo_stwat_add, uint32_t, "stwat", _AMO_ST_ADD) _AMO_ST_SIMPLE (amo_stwat_add, uint32_t, "stwat", _AMO_ST_ADD)
_AMO_ST_SIMPLE (amo_stwat_xor, uint32_t, "stwat", _AMO_ST_XOR) _AMO_ST_SIMPLE (amo_stwat_xor, uint32_t, "stwat", _AMO_ST_XOR)
_AMO_ST_SIMPLE (amo_stwat_ior, uint32_t, "stwat", _AMO_ST_IOR) _AMO_ST_SIMPLE (amo_stwat_ior, uint32_t, "stwat", _AMO_ST_IOR)
_AMO_ST_SIMPLE (amo_stwat_and, uint32_t, "stwat", _AMO_ST_AND) _AMO_ST_SIMPLE (amo_stwat_and, uint32_t, "stwat", _AMO_ST_AND)
_AMO_ST_SIMPLE (amo_stwat_umax, uint32_t, "stwat", _AMO_ST_UMAX) _AMO_ST_SIMPLE (amo_stwat_umax, uint32_t, "stwat", _AMO_ST_UMAX)
_AMO_ST_SIMPLE (amo_stwat_umin, uint32_t, "stwat", _AMO_ST_UMIN) _AMO_ST_SIMPLE (amo_stwat_umin, uint32_t, "stwat", _AMO_ST_UMIN)
_AMO_ST_SIMPLE (amo_stwat_sadd, int32_t, "stwat", _AMO_ST_ADD) _AMO_ST_SIMPLE (amo_stwat_sadd, int32_t, "stwat", _AMO_ST_ADD)
_AMO_ST_SIMPLE (amo_stwat_smax, int32_t, "stwat", _AMO_ST_SMAX) _AMO_ST_SIMPLE (amo_stwat_smax, int32_t, "stwat", _AMO_ST_SMAX)
_AMO_ST_SIMPLE (amo_stwat_smin, int32_t, "stwat", _AMO_ST_SMIN) _AMO_ST_SIMPLE (amo_stwat_smin, int32_t, "stwat", _AMO_ST_SMIN)
_AMO_ST_SIMPLE (amo_stdat_add, uint64_t, "stdat", _AMO_ST_ADD) _AMO_ST_SIMPLE (amo_stdat_add, uint64_t, "stdat", _AMO_ST_ADD)
_AMO_ST_SIMPLE (amo_stdat_xor, uint64_t, "stdat", _AMO_ST_XOR) _AMO_ST_SIMPLE (amo_stdat_xor, uint64_t, "stdat", _AMO_ST_XOR)
_AMO_ST_SIMPLE (amo_stdat_ior, uint64_t, "stdat", _AMO_ST_IOR) _AMO_ST_SIMPLE (amo_stdat_ior, uint64_t, "stdat", _AMO_ST_IOR)
_AMO_ST_SIMPLE (amo_stdat_and, uint64_t, "stdat", _AMO_ST_AND) _AMO_ST_SIMPLE (amo_stdat_and, uint64_t, "stdat", _AMO_ST_AND)
_AMO_ST_SIMPLE (amo_stdat_umax, uint64_t, "stdat", _AMO_ST_UMAX) _AMO_ST_SIMPLE (amo_stdat_umax, uint64_t, "stdat", _AMO_ST_UMAX)
_AMO_ST_SIMPLE (amo_stdat_umin, uint64_t, "stdat", _AMO_ST_UMIN) _AMO_ST_SIMPLE (amo_stdat_umin, uint64_t, "stdat", _AMO_ST_UMIN)
_AMO_ST_SIMPLE (amo_stdat_sadd, int64_t, "stdat", _AMO_ST_ADD) _AMO_ST_SIMPLE (amo_stdat_sadd, int64_t, "stdat", _AMO_ST_ADD)
_AMO_ST_SIMPLE (amo_stdat_smax, int64_t, "stdat", _AMO_ST_SMAX) _AMO_ST_SIMPLE (amo_stdat_smax, int64_t, "stdat", _AMO_ST_SMAX)
_AMO_ST_SIMPLE (amo_stdat_smin, int64_t, "stdat", _AMO_ST_SMIN) _AMO_ST_SIMPLE (amo_stdat_smin, int64_t, "stdat", _AMO_ST_SMIN)
#endif /* _ARCH_PWR9 && _ARCH_PPC64. */ #endif /* _ARCH_PWR9 && _ARCH_PPC64. */
#endif /* _POWERPC_AMO_H. */ #endif /* _POWERPC_AMO_H. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment