Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
c64959bd
Commit
c64959bd
authored
Oct 12, 2017
by
Michael Meissner
Committed by
Michael Meissner
Oct 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spacing issue.
From-SVN: r253696
parent
912a7ec3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
76 deletions
+80
-76
gcc/ChangeLog
+4
-0
gcc/config/rs6000/amo.h
+76
-76
No files found.
gcc/ChangeLog
View file @
c64959bd
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
>
PR
target
/
82498
gcc/config/rs6000/amo.h
View file @
c64959bd
/* 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.
Contributed by Michael Meissner <meissner@linux.vnet.ibm.com>.
...
...
@@ -23,17 +23,17 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef _AMO_H
#define _AMO_H
#ifndef _AMO_H
#define _AMO_H
#if !defined(_ARCH_PWR9) || !defined(_ARCH_PPC64)
#error "The atomic memory operations require Power 64-bit ISA 3.0"
#if !defined(_ARCH_PWR9) || !defined(_ARCH_PPC64)
#error "The atomic memory operations require Power 64-bit ISA 3.0"
#else
#include <stdint.h>
#else
#include <stdint.h>
/* Enumeration of the LWAT/LDAT sub-opcodes. */
enum
_AMO_LD
{
/* Enumeration of the LWAT/LDAT sub-opcodes. */
enum
_AMO_LD
{
_AMO_LD_ADD
=
0x00
,
/* Fetch and Add. */
_AMO_LD_XOR
=
0x01
,
/* Fetch and Xor. */
_AMO_LD_IOR
=
0x02
,
/* Fetch and Ior. */
...
...
@@ -47,9 +47,9 @@
_AMO_LD_INC_BOUNDED
=
0x18
,
/* Fetch and Increment Bounded. */
_AMO_LD_INC_EQUAL
=
0x19
,
/* Fetch and Increment Equal. */
_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
previously in the memory location.
...
...
@@ -57,10 +57,10 @@
points to a suitably aligned memory location. Asm volatile is used to
prevent the optimizer from moving the operation. */
#define _AMO_LD_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ TYPE \
NAME (TYPE *_PTR, TYPE _VALUE) \
{ \
#define _AMO_LD_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ TYPE \
NAME (TYPE *_PTR, TYPE _VALUE) \
{ \
unsigned __int128 _TMP; \
TYPE _RET; \
__asm__ volatile ("mr %L1,%3\n" \
...
...
@@ -69,36 +69,36 @@
: "+Q" (_PTR[0]), "=&r" (_TMP), "=r" (_RET) \
: "r" (_VALUE), "n" (FC)); \
return _RET; \
}
_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_ior
,
uint32_t
,
"lwat"
,
_AMO_LD_IOR
)
_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_umin
,
uint32_t
,
"lwat"
,
_AMO_LD_UMIN
)
_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_smax
,
int32_t
,
"lwat"
,
_AMO_LD_SMAX
)
_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_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_ior
,
uint64_t
,
"ldat"
,
_AMO_LD_IOR
)
_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_umin
,
uint64_t
,
"ldat"
,
_AMO_LD_UMIN
)
_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_smax
,
int64_t
,
"ldat"
,
_AMO_LD_SMAX
)
_AMO_LD_SIMPLE
(
amo_ldat_smin
,
int64_t
,
"ldat"
,
_AMO_LD_SMIN
)
_AMO_LD_SIMPLE
(
amo_ldat_sswap
,
int64_t
,
"ldat"
,
_AMO_LD_SWAP
)
/* Enumeration of the STWAT/STDAT sub-opcodes. */
enum
_AMO_ST
{
}
_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_ior
,
uint32_t
,
"lwat"
,
_AMO_LD_IOR
)
_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_umin
,
uint32_t
,
"lwat"
,
_AMO_LD_UMIN
)
_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_smax
,
int32_t
,
"lwat"
,
_AMO_LD_SMAX
)
_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_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_ior
,
uint64_t
,
"ldat"
,
_AMO_LD_IOR
)
_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_umin
,
uint64_t
,
"ldat"
,
_AMO_LD_UMIN
)
_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_smax
,
int64_t
,
"ldat"
,
_AMO_LD_SMAX
)
_AMO_LD_SIMPLE
(
amo_ldat_smin
,
int64_t
,
"ldat"
,
_AMO_LD_SMIN
)
_AMO_LD_SIMPLE
(
amo_ldat_sswap
,
int64_t
,
"ldat"
,
_AMO_LD_SWAP
)
/* Enumeration of the STWAT/STDAT sub-opcodes. */
enum
_AMO_ST
{
_AMO_ST_ADD
=
0x00
,
/* Store Add. */
_AMO_ST_XOR
=
0x01
,
/* Store Xor. */
_AMO_ST_IOR
=
0x02
,
/* Store Ior. */
...
...
@@ -108,45 +108,45 @@
_AMO_ST_UMIN
=
0x06
,
/* Store Unsigned Minimum. */
_AMO_ST_SMIN
=
0x07
,
/* Store Signed Minimum. */
_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.
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
prevent the optimizer from moving the operation. */
#define _AMO_ST_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ void \
NAME (TYPE *_PTR, TYPE _VALUE) \
{ \
#define _AMO_ST_SIMPLE(NAME, TYPE, OPCODE, FC) \
static __inline__ void \
NAME (TYPE *_PTR, TYPE _VALUE) \
{ \
__asm__ volatile (OPCODE " %1,%P0,%2" \
: "+Q" (_PTR[0]) \
: "r" (_VALUE), "n" (FC)); \
return; \
}
_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_ior
,
uint32_t
,
"stwat"
,
_AMO_ST_IOR
)
_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_umin
,
uint32_t
,
"stwat"
,
_AMO_ST_UMIN
)
_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_smin
,
int32_t
,
"stwat"
,
_AMO_ST_SMIN
)
_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_ior
,
uint64_t
,
"stdat"
,
_AMO_ST_IOR
)
_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_umin
,
uint64_t
,
"stdat"
,
_AMO_ST_UMIN
)
_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_smin
,
int64_t
,
"stdat"
,
_AMO_ST_SMIN
)
#endif
/* _ARCH_PWR9 && _ARCH_PPC64. */
#endif
/* _POWERPC_AMO_H. */
}
_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_ior
,
uint32_t
,
"stwat"
,
_AMO_ST_IOR
)
_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_umin
,
uint32_t
,
"stwat"
,
_AMO_ST_UMIN
)
_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_smin
,
int32_t
,
"stwat"
,
_AMO_ST_SMIN
)
_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_ior
,
uint64_t
,
"stdat"
,
_AMO_ST_IOR
)
_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_umin
,
uint64_t
,
"stdat"
,
_AMO_ST_UMIN
)
_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_smin
,
int64_t
,
"stdat"
,
_AMO_ST_SMIN
)
#endif
/* _ARCH_PWR9 && _ARCH_PPC64. */
#endif
/* _POWERPC_AMO_H. */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment