Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
0ddbafab
Commit
0ddbafab
authored
Mar 05, 2015
by
Jisi Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #175 from martiert/tile-support
Add support for the TILE-Gx processor family.
parents
4573e110
e85de03b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
0 deletions
+83
-0
Makefile.am
src/Makefile.am
+1
-0
atomicops.h
src/google/protobuf/stubs/atomicops.h
+2
-0
atomicops_internals_tile_gcc.h
src/google/protobuf/stubs/atomicops_internals_tile_gcc.h
+77
-0
platform_macros.h
src/google/protobuf/stubs/platform_macros.h
+3
-0
No files found.
src/Makefile.am
View file @
0ddbafab
...
...
@@ -54,6 +54,7 @@ nobase_include_HEADERS = \
google/protobuf/stubs/atomicops.h
\
google/protobuf/stubs/atomicops_internals_aix.h
\
google/protobuf/stubs/atomicops_internals_arm64_gcc.h
\
google/protobuf/stubs/atomicops_internals_tile_gcc.h
\
google/protobuf/stubs/atomicops_internals_arm_gcc.h
\
google/protobuf/stubs/atomicops_internals_arm_qnx.h
\
google/protobuf/stubs/atomicops_internals_atomicword_compat.h
\
...
...
src/google/protobuf/stubs/atomicops.h
View file @
0ddbafab
...
...
@@ -207,6 +207,8 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR
#include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h>
#elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX)
#include <google/protobuf/stubs/atomicops_internals_arm_qnx.h>
#elif defined(GOOGLE_PROTOBUF_ARCH_TILE)
#include <google/protobuf/stubs/atomicops_internals_tile_gcc.h>
#elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) || defined(GOOGLE_PROTOBUF_ARCH_MIPS64)
#include <google/protobuf/stubs/atomicops_internals_mips_gcc.h>
#elif defined(__native_client__)
...
...
src/google/protobuf/stubs/atomicops_internals_tile_gcc.h
0 → 100644
View file @
0ddbafab
#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
namespace
google
{
namespace
protobuf
{
namespace
internal
{
inline
void
NoBarrier_Store
(
volatile
Atomic32
*
ptr
,
Atomic32
value
)
{
asm
volatile
(
"st4 %0, %1"
:
"=r"
(
*
ptr
)
:
"m"
(
value
));
}
inline
Atomic32
NoBarrier_Load
(
volatile
const
Atomic32
*
ptr
)
{
Atomic32
dest
;
asm
volatile
(
"ld4s %0, %1"
:
"=r"
(
dest
)
:
"m"
(
*
ptr
));
return
dest
;
}
inline
void
NoBarrier_Store
(
volatile
Atomic64
*
ptr
,
Atomic64
value
)
{
asm
volatile
(
"st %0, %1"
:
"=r"
(
*
ptr
)
:
"m"
(
value
));
}
inline
Atomic64
NoBarrier_Load
(
volatile
const
Atomic64
*
ptr
)
{
Atomic64
dest
;
asm
volatile
(
"ld %0, %1"
:
"=r"
(
dest
)
:
"m"
(
*
ptr
));
return
dest
;
}
inline
Atomic64
Acquire_Load
(
volatile
const
Atomic64
*
ptr
)
{
return
NoBarrier_Load
(
ptr
);
}
inline
void
Release_Store
(
volatile
Atomic64
*
ptr
,
Atomic64
value
)
{
NoBarrier_Store
(
ptr
,
value
);
}
inline
Atomic64
Acquire_CompareAndSwap
(
volatile
Atomic64
*
ptr
,
Atomic64
old_value
,
Atomic64
new_value
)
{
Atomic64
tmp
;
asm
volatile
(
"mtspr CMPEXCH_VALUE, %3
\n\t
"
"cmpexch %0, %1, %2"
:
"=r"
(
tmp
),
"=m"
(
*
ptr
)
:
"r"
(
new_value
),
"r"
(
old_value
));
return
tmp
;
}
inline
Atomic64
NoBarrier_AtomicExchange
(
volatile
Atomic64
*
ptr
,
Atomic64
new_value
)
{
Atomic64
old_value
;
asm
volatile
(
"exch %0, %1, %2"
:
"=r"
(
old_value
),
"=m"
(
*
ptr
)
:
"r"
(
new_value
));
return
old_value
;
}
inline
Atomic64
NoBarrier_AtomicIncrement
(
volatile
Atomic64
*
ptr
,
Atomic64
value
)
{
Atomic64
dest
;
asm
volatile
(
"fetchadd %0, %1, %2"
:
"=r"
(
dest
),
"=m"
(
*
ptr
)
:
"r"
(
value
));
return
*
ptr
;
}
}
}
}
#endif
src/google/protobuf/stubs/platform_macros.h
View file @
0ddbafab
...
...
@@ -52,6 +52,9 @@
#elif defined(__ARMEL__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__tile__)
#define GOOGLE_PROTOBUF_ARCH_TILE 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
#elif defined(__aarch64__)
#define GOOGLE_PROTOBUF_ARCH_AARCH64 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
...
...
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