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

Side by Side Diff: test/cctest/compiler/value-helper.h

Issue 2252863003: [turbofan] Add Float32(Max|Min) machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Type is number now. Created 4 years, 4 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 | « test/cctest/compiler/test-run-machops.cc ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_CCTEST_COMPILER_VALUE_HELPER_H_ 5 #ifndef V8_CCTEST_COMPILER_VALUE_HELPER_H_
6 #define V8_CCTEST_COMPILER_VALUE_HELPER_H_ 6 #define V8_CCTEST_COMPILER_VALUE_HELPER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) 325 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++)
326 326
327 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) 327 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++)
328 328
329 // TODO(bmeurer): Drop this crap once we switch to GTest/Gmock. 329 // TODO(bmeurer): Drop this crap once we switch to GTest/Gmock.
330 static inline void CheckFloatEq(volatile float x, volatile float y) { 330 static inline void CheckFloatEq(volatile float x, volatile float y) {
331 if (std::isnan(x)) { 331 if (std::isnan(x)) {
332 CHECK(std::isnan(y)); 332 CHECK(std::isnan(y));
333 } else { 333 } else {
334 CHECK_EQ(x, y); 334 CHECK_EQ(x, y);
335 CHECK_EQ(std::signbit(x), std::signbit(y));
335 } 336 }
336 } 337 }
337 338
338 #define CHECK_FLOAT_EQ(lhs, rhs) \ 339 #define CHECK_FLOAT_EQ(lhs, rhs) \
339 do { \ 340 do { \
340 volatile float tmp = lhs; \ 341 volatile float tmp = lhs; \
341 CheckFloatEq(tmp, rhs); \ 342 CheckFloatEq(tmp, rhs); \
342 } while (0) 343 } while (0)
343 344
344 static inline void CheckDoubleEq(volatile double x, volatile double y) { 345 static inline void CheckDoubleEq(volatile double x, volatile double y) {
345 if (std::isnan(x)) { 346 if (std::isnan(x)) {
346 CHECK(std::isnan(y)); 347 CHECK(std::isnan(y));
347 } else { 348 } else {
348 CHECK_EQ(x, y); 349 CHECK_EQ(x, y);
350 CHECK_EQ(std::signbit(x), std::signbit(y));
349 } 351 }
350 } 352 }
351 353
352 #define CHECK_DOUBLE_EQ(lhs, rhs) \ 354 #define CHECK_DOUBLE_EQ(lhs, rhs) \
353 do { \ 355 do { \
354 volatile double tmp = lhs; \ 356 volatile double tmp = lhs; \
355 CheckDoubleEq(tmp, rhs); \ 357 CheckDoubleEq(tmp, rhs); \
356 } while (0) 358 } while (0)
357 359
358 } // namespace compiler 360 } // namespace compiler
359 } // namespace internal 361 } // namespace internal
360 } // namespace v8 362 } // namespace v8
361 363
362 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ 364 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698