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
ef6c2c53
Commit
ef6c2c53
authored
Mar 07, 2012
by
Walter Lee
Committed by
Walter Lee
Mar 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename some internal atomic macros to have a less generic prefix.
From-SVN: r185074
parent
ca538e97
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
libgcc/ChangeLog
+12
-0
libgcc/config/tilepro/atomic.c
+6
-12
libgcc/config/tilepro/atomic.h
+0
-0
No files found.
libgcc/ChangeLog
View file @
ef6c2c53
2012-03-07 Walter Lee <walt@tilera.com>
* config/tilepro/atomic.c: Rename "atomic_" prefix to
"arch_atomic_".
(atomic_xor): Rename and move definition to
config/tilepro/atomic.h.
(atomic_nand): Ditto.
* config/tilepro/atomic.h: Rename "atomic_" prefix to
"arch_atomic_".
(arch_atomic_xor): Move from config/tilepro/atomic.c.
(arch_atomic_nand): Ditto.
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
PR target/52507
PR target/52507
...
...
libgcc/config/tilepro/atomic.c
View file @
ef6c2c53
...
@@ -63,18 +63,12 @@ post_atomic_barrier (int model)
...
@@ -63,18 +63,12 @@ post_atomic_barrier (int model)
#define __unused __attribute__((unused))
#define __unused __attribute__((unused))
/* Provide additional methods not implemented by atomic.h. */
#define atomic_xor(mem, mask) \
__atomic_update_cmpxchg(mem, mask, __old ^ __value)
#define atomic_nand(mem, mask) \
__atomic_update_cmpxchg(mem, mask, ~(__old & __value))
#define __atomic_fetch_and_do(type, size, opname) \
#define __atomic_fetch_and_do(type, size, opname) \
type \
type \
__atomic_fetch_##opname##_##size(type* p, type i, int model) \
__atomic_fetch_##opname##_##size(type* p, type i, int model) \
{ \
{ \
pre_atomic_barrier(model); \
pre_atomic_barrier(model); \
type rv = atomic_##opname(p, i); \
type rv = a
rch_a
tomic_##opname(p, i); \
post_atomic_barrier(model); \
post_atomic_barrier(model); \
return rv; \
return rv; \
}
}
...
@@ -96,7 +90,7 @@ type \
...
@@ -96,7 +90,7 @@ type \
__atomic_##opname##_fetch_##size(type* p, type i, int model) \
__atomic_##opname##_fetch_##size(type* p, type i, int model) \
{ \
{ \
pre_atomic_barrier(model); \
pre_atomic_barrier(model); \
type rv = a
tomic_##opname(p, i) op i;
\
type rv = a
rch_atomic_##opname(p, i) op i;
\
post_atomic_barrier(model); \
post_atomic_barrier(model); \
return rv; \
return rv; \
}
}
...
@@ -120,7 +114,7 @@ __atomic_compare_exchange_##size(volatile type* ptr, type* oldvalp, \
...
@@ -120,7 +114,7 @@ __atomic_compare_exchange_##size(volatile type* ptr, type* oldvalp, \
{ \
{ \
type oldval = *oldvalp; \
type oldval = *oldvalp; \
pre_atomic_barrier(models); \
pre_atomic_barrier(models); \
type retval = a
tomic_val_compare_and_exchange(ptr, oldval, newval);
\
type retval = a
rch_atomic_val_compare_and_exchange(ptr, oldval, newval);
\
post_atomic_barrier(models); \
post_atomic_barrier(models); \
bool success = (retval == oldval); \
bool success = (retval == oldval); \
*oldvalp = retval; \
*oldvalp = retval; \
...
@@ -131,7 +125,7 @@ type \
...
@@ -131,7 +125,7 @@ type \
__atomic_exchange_##size(volatile type* ptr, type val, int model) \
__atomic_exchange_##size(volatile type* ptr, type val, int model) \
{ \
{ \
pre_atomic_barrier(model); \
pre_atomic_barrier(model); \
type retval = atomic_exchange(ptr, val); \
type retval = a
rch_a
tomic_exchange(ptr, val); \
post_atomic_barrier(model); \
post_atomic_barrier(model); \
return retval; \
return retval; \
}
}
...
@@ -159,7 +153,7 @@ __atomic_compare_exchange_##size(volatile type* ptr, type* guess, \
...
@@ -159,7 +153,7 @@ __atomic_compare_exchange_##size(volatile type* ptr, type* guess, \
type oldval = (oldword >> shift) & valmask; \
type oldval = (oldword >> shift) & valmask; \
if (__builtin_expect((oldval == *guess), 1)) { \
if (__builtin_expect((oldval == *guess), 1)) { \
unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \
unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \
oldword = atomic_val_compare_and_exchange(p, oldword, word); \
oldword = a
rch_a
tomic_val_compare_and_exchange(p, oldword, word); \
oldval = (oldword >> shift) & valmask; \
oldval = (oldword >> shift) & valmask; \
} \
} \
post_atomic_barrier(models); \
post_atomic_barrier(models); \
...
@@ -187,7 +181,7 @@ proto \
...
@@ -187,7 +181,7 @@ proto \
oldval = (oldword >> shift) & valmask; \
oldval = (oldword >> shift) & valmask; \
val = expr; \
val = expr; \
unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \
unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \
xword = a
tomic_val_compare_and_exchange(p, oldword, word);
\
xword = a
rch_atomic_val_compare_and_exchange(p, oldword, word);
\
} while (__builtin_expect(xword != oldword, 0)); \
} while (__builtin_expect(xword != oldword, 0)); \
bottom \
bottom \
}
}
...
...
libgcc/config/tilepro/atomic.h
View file @
ef6c2c53
This diff is collapsed.
Click to expand it.
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