Commit 8f23860e authored by Tom Tan's avatar Tom Tan Committed by Commit Bot

Change labs to std::abs for Windows ARM64

Because Windows ARM64 is in LLP64 data model, the long type as input parameter
for labs is still 32-bit. std::abs has overloads for both long and long long type, which
works for both LP64 and LLP64 data model (see below links).

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/abs-labs-llabs-abs64
https://en.cppreference.com/w/cpp/numeric/math/abs

Bug: chromium:893460
Change-Id: I477d22d550bd92bf9dcc974ac84b4fe5222c1e13
Reviewed-on: https://chromium-review.googlesource.com/c/1448715Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59358}
parent 1857b217
......@@ -14531,7 +14531,7 @@ static void AbsHelperX(int64_t value) {
__ Mov(x1, value);
if (value != kXMinInt) {
expected = labs(value);
expected = std::abs(value);
Label next;
// The result is representable.
......@@ -14541,7 +14541,7 @@ static void AbsHelperX(int64_t value) {
__ Bind(&next);
__ Abs(x13, x1, nullptr, &done);
} else {
// labs is undefined for kXMinInt but our implementation in the
// std::abs is undefined for kXMinInt but our implementation in the
// MacroAssembler will return kXMinInt in such a case.
expected = kXMinInt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment