Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
b81dcb7c
Commit
b81dcb7c
authored
Oct 30, 2018
by
yonghong-song
Committed by
GitHub
Oct 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2021 from cyphar/32bit-uint128
frontends: disable uint128_t on 32-bit builds
parents
895aefda
329faafd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/cc/frontends/b/type_helper.h
src/cc/frontends/b/type_helper.h
+8
-0
No files found.
src/cc/frontends/b/type_helper.h
View file @
b81dcb7c
...
@@ -26,7 +26,9 @@ enum FieldType {
...
@@ -26,7 +26,9 @@ enum FieldType {
UINT16_T
,
UINT16_T
,
UINT32_T
,
UINT32_T
,
UINT64_T
,
UINT64_T
,
#ifdef __SIZEOF_INT128__
UINT128_T
,
UINT128_T
,
#endif
VOID
VOID
};
};
...
@@ -36,7 +38,9 @@ static inline size_t enum_to_size(const FieldType t) {
...
@@ -36,7 +38,9 @@ static inline size_t enum_to_size(const FieldType t) {
case
UINT16_T
:
return
sizeof
(
uint16_t
);
case
UINT16_T
:
return
sizeof
(
uint16_t
);
case
UINT32_T
:
return
sizeof
(
uint32_t
);
case
UINT32_T
:
return
sizeof
(
uint32_t
);
case
UINT64_T
:
return
sizeof
(
uint64_t
);
case
UINT64_T
:
return
sizeof
(
uint64_t
);
#ifdef __SIZEOF_INT128__
case
UINT128_T
:
return
sizeof
(
__uint128_t
);
case
UINT128_T
:
return
sizeof
(
__uint128_t
);
#endif
default:
default:
return
0
;
return
0
;
}
}
...
@@ -82,8 +86,10 @@ static inline FieldType bits_to_enum(int v) {
...
@@ -82,8 +86,10 @@ static inline FieldType bits_to_enum(int v) {
return
UINT32_T
;
return
UINT32_T
;
}
else
if
(
v
==
64
)
{
}
else
if
(
v
==
64
)
{
return
UINT64_T
;
return
UINT64_T
;
#ifdef __SIZEOF_INT128__
}
else
if
(
v
>=
128
)
{
}
else
if
(
v
>=
128
)
{
return
UINT128_T
;
return
UINT128_T
;
#endif
}
}
return
VOID
;
return
VOID
;
}
}
...
@@ -101,7 +107,9 @@ static inline size_t align_offset(size_t offset, FieldType ft) {
...
@@ -101,7 +107,9 @@ static inline size_t align_offset(size_t offset, FieldType ft) {
case
UINT32_T
:
case
UINT32_T
:
return
offset
%
32
>
0
?
offset
+
(
32
-
offset
%
32
)
:
offset
;
return
offset
%
32
>
0
?
offset
+
(
32
-
offset
%
32
)
:
offset
;
case
UINT64_T
:
case
UINT64_T
:
#ifdef __SIZEOF_INT128__
case
UINT128_T
:
case
UINT128_T
:
#endif
return
offset
%
64
>
0
?
offset
+
(
64
-
offset
%
64
)
:
offset
;
return
offset
%
64
>
0
?
offset
+
(
64
-
offset
%
64
)
:
offset
;
default:
default:
;
;
...
...
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