Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
9449ae94
Unverified
Commit
9449ae94
authored
Jan 09, 2019
by
Alex Strelnikov
Committed by
GitHub
Jan 09, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #243 from ThomsonTan/FixIntrinsic
_umul128 intrinsic is x64 only and not available on Windows ARM64
parents
b16aeb67
aca0473d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
absl/numeric/int128.h
+3
-3
No files found.
absl/numeric/int128.h
View file @
9449ae94
...
@@ -43,10 +43,10 @@
...
@@ -43,10 +43,10 @@
// builtin type. We need to make sure not to define operator wchar_t()
// builtin type. We need to make sure not to define operator wchar_t()
// alongside operator unsigned short() in these instances.
// alongside operator unsigned short() in these instances.
#define ABSL_INTERNAL_WCHAR_T __wchar_t
#define ABSL_INTERNAL_WCHAR_T __wchar_t
#if defined(_
WIN
64)
#if defined(_
M_X
64)
#include <intrin.h>
#include <intrin.h>
#pragma intrinsic(_umul128)
#pragma intrinsic(_umul128)
#endif // defined(_
WIN
64)
#endif // defined(_
M_X
64)
#else // defined(_MSC_VER)
#else // defined(_MSC_VER)
#define ABSL_INTERNAL_WCHAR_T wchar_t
#define ABSL_INTERNAL_WCHAR_T wchar_t
#endif // defined(_MSC_VER)
#endif // defined(_MSC_VER)
...
@@ -675,7 +675,7 @@ inline uint128 operator*(uint128 lhs, uint128 rhs) {
...
@@ -675,7 +675,7 @@ inline uint128 operator*(uint128 lhs, uint128 rhs) {
// can be used for uint128 storage.
// can be used for uint128 storage.
return
static_cast
<
unsigned
__int128
>
(
lhs
)
*
return
static_cast
<
unsigned
__int128
>
(
lhs
)
*
static_cast
<
unsigned
__int128
>
(
rhs
);
static_cast
<
unsigned
__int128
>
(
rhs
);
#elif defined(_MSC_VER) && defined(_
WIN
64)
#elif defined(_MSC_VER) && defined(_
M_X
64)
uint64_t
carry
;
uint64_t
carry
;
uint64_t
low
=
_umul128
(
Uint128Low64
(
lhs
),
Uint128Low64
(
rhs
),
&
carry
);
uint64_t
low
=
_umul128
(
Uint128Low64
(
lhs
),
Uint128Low64
(
rhs
),
&
carry
);
return
MakeUint128
(
Uint128Low64
(
lhs
)
*
Uint128High64
(
rhs
)
+
return
MakeUint128
(
Uint128Low64
(
lhs
)
*
Uint128High64
(
rhs
)
+
...
...
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