Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: test/unittests/compiler/typer-unittest.cc

Issue 2616743002: [turbofan] Fix shift_left/right in unittest (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <functional> 5 #include <functional>
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/compiler/js-operator.h" 8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 Type* subtype2 = RandomSubtype(type2); 216 Type* subtype2 = RandomSubtype(type2);
217 Type* subtype = TypeBinaryOp(op, subtype1, subtype2); 217 Type* subtype = TypeBinaryOp(op, subtype1, subtype2);
218 EXPECT_TRUE(subtype->Is(type)); 218 EXPECT_TRUE(subtype->Is(type));
219 } 219 }
220 } 220 }
221 }; 221 };
222 222
223 223
224 namespace { 224 namespace {
225 225
226 int32_t shift_left(int32_t x, int32_t y) { return x << y; } 226 int32_t shift_left(int32_t x, int32_t y) { return x << (y & 0x1f); }
227 int32_t shift_right(int32_t x, int32_t y) { return x >> y; } 227 int32_t shift_right(int32_t x, int32_t y) { return x >> (y & 0x1f); }
228 int32_t bit_or(int32_t x, int32_t y) { return x | y; } 228 int32_t bit_or(int32_t x, int32_t y) { return x | y; }
229 int32_t bit_and(int32_t x, int32_t y) { return x & y; } 229 int32_t bit_and(int32_t x, int32_t y) { return x & y; }
230 int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; } 230 int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; }
231 231
232 } // namespace 232 } // namespace
233 233
234 234
235 //------------------------------------------------------------------------------ 235 //------------------------------------------------------------------------------
236 // Soundness 236 // Soundness
237 // For simplicity, we currently only test soundness on expression operators 237 // For simplicity, we currently only test soundness on expression operators
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 TEST_BINARY_MONOTONICITY(Add) 369 TEST_BINARY_MONOTONICITY(Add)
370 TEST_BINARY_MONOTONICITY(Subtract) 370 TEST_BINARY_MONOTONICITY(Subtract)
371 TEST_BINARY_MONOTONICITY(Multiply) 371 TEST_BINARY_MONOTONICITY(Multiply)
372 TEST_BINARY_MONOTONICITY(Divide) 372 TEST_BINARY_MONOTONICITY(Divide)
373 TEST_BINARY_MONOTONICITY(Modulus) 373 TEST_BINARY_MONOTONICITY(Modulus)
374 #undef TEST_BINARY_MONOTONICITY 374 #undef TEST_BINARY_MONOTONICITY
375 375
376 } // namespace compiler 376 } // namespace compiler
377 } // namespace internal 377 } // namespace internal
378 } // namespace v8 378 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698