Commit 130e12d0 authored by jyan's avatar jyan Committed by Commit bot

[turbofan] Fix shift_left/right in unittest

x86 automatically truncates the shift amount to be 5-bits. But not
all architectures do that.

R=rossberg@chromium.org, jarin@chromium.org, joransiu@ca.ibm.com, bjaideep@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2616743002
Cr-Commit-Position: refs/heads/master@{#42099}
parent 3166d429
...@@ -223,8 +223,8 @@ class TyperTest : public TypedGraphTest { ...@@ -223,8 +223,8 @@ class TyperTest : public TypedGraphTest {
namespace { namespace {
int32_t shift_left(int32_t x, int32_t y) { return x << y; } int32_t shift_left(int32_t x, int32_t y) { return x << (y & 0x1f); }
int32_t shift_right(int32_t x, int32_t y) { return x >> y; } int32_t shift_right(int32_t x, int32_t y) { return x >> (y & 0x1f); }
int32_t bit_or(int32_t x, int32_t y) { return x | y; } int32_t bit_or(int32_t x, int32_t y) { return x | y; }
int32_t bit_and(int32_t x, int32_t y) { return x & y; } int32_t bit_and(int32_t x, int32_t y) { return x & y; }
int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; } int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; }
......
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