Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
d7ff6d12
Commit
d7ff6d12
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Do not use 'new' as a variable name. That makes the C++ compiler rather unhappy.
parent
c468efd8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/atomic.h
+18
-18
18 additions, 18 deletions
src/atomic.h
with
18 additions
and
18 deletions
src/atomic.h
+
18
−
18
View file @
d7ff6d12
...
@@ -52,14 +52,14 @@ __attribute__((always_inline)) INLINE static void atomic_min_f(
...
@@ -52,14 +52,14 @@ __attribute__((always_inline)) INLINE static void atomic_min_f(
int
as_int
;
int
as_int
;
}
cast_type
;
}
cast_type
;
cast_type
assumed
,
old
,
new
;
cast_type
test_val
,
old
_val
,
new
_val
;
old
.
as_float
=
*
address
;
old
_val
.
as_float
=
*
address
;
do
{
do
{
assumed
.
as_int
=
old
.
as_int
;
test_val
.
as_int
=
old
_val
.
as_int
;
new
.
as_float
=
min
(
old
.
as_float
,
y
);
new
_val
.
as_float
=
min
(
old
_val
.
as_float
,
y
);
old
.
as_int
=
atomic_cas
(
int_ptr
,
assumed
.
as_int
,
new
.
as_int
);
old
_val
.
as_int
=
atomic_cas
(
int_ptr
,
test_val
.
as_int
,
new
_val
.
as_int
);
}
while
(
assumed
.
as_int
!=
old
.
as_int
);
}
while
(
test_val
.
as_int
!=
old
_val
.
as_int
);
}
}
/**
/**
...
@@ -80,14 +80,14 @@ __attribute__((always_inline)) INLINE static void atomic_max_f(
...
@@ -80,14 +80,14 @@ __attribute__((always_inline)) INLINE static void atomic_max_f(
int
as_int
;
int
as_int
;
}
cast_type
;
}
cast_type
;
cast_type
assumed
,
old
,
new
;
cast_type
test_val
,
old
_val
,
new
_val
;
old
.
as_float
=
*
address
;
old
_val
.
as_float
=
*
address
;
do
{
do
{
assumed
.
as_int
=
old
.
as_int
;
test_val
.
as_int
=
old
_val
.
as_int
;
new
.
as_float
=
max
(
old
.
as_float
,
y
);
new
_val
.
as_float
=
max
(
old
_val
.
as_float
,
y
);
old
.
as_int
=
atomic_cas
(
int_ptr
,
assumed
.
as_int
,
new
.
as_int
);
old
_val
.
as_int
=
atomic_cas
(
int_ptr
,
test_val
.
as_int
,
new
_val
.
as_int
);
}
while
(
assumed
.
as_int
!=
old
.
as_int
);
}
while
(
test_val
.
as_int
!=
old
_val
.
as_int
);
}
}
/**
/**
...
@@ -108,14 +108,14 @@ __attribute__((always_inline)) INLINE static void atomic_add_f(
...
@@ -108,14 +108,14 @@ __attribute__((always_inline)) INLINE static void atomic_add_f(
int
as_int
;
int
as_int
;
}
cast_type
;
}
cast_type
;
cast_type
assumed
,
old
,
new
;
cast_type
test_val
,
old
_val
,
new
_val
;
old
.
as_float
=
*
address
;
old
_val
.
as_float
=
*
address
;
do
{
do
{
assumed
.
as_int
=
old
.
as_int
;
test_val
.
as_int
=
old
_val
.
as_int
;
new
.
as_float
=
old
.
as_float
+
y
;
new
_val
.
as_float
=
old
_val
.
as_float
+
y
;
old
.
as_int
=
atomic_cas
(
int_ptr
,
assumed
.
as_int
,
new
.
as_int
);
old
_val
.
as_int
=
atomic_cas
(
int_ptr
,
test_val
.
as_int
,
new
_val
.
as_int
);
}
while
(
assumed
.
as_int
!=
old
.
as_int
);
}
while
(
test_val
.
as_int
!=
old
_val
.
as_int
);
}
}
#endif
/* SWIFT_ATOMIC_H */
#endif
/* SWIFT_ATOMIC_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment