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

Side by Side Diff: runtime/vm/assembler_x64_test.cc

Issue 14057004: Convert diamond shaped control flow into a single conditional instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Florian's comments Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 ASSEMBLER_TEST_RUN(ExtractSignBits, test) { 2284 ASSEMBLER_TEST_RUN(ExtractSignBits, test) {
2285 typedef int (*ExtractSignBits)(double d); 2285 typedef int (*ExtractSignBits)(double d);
2286 int res = reinterpret_cast<ExtractSignBits>(test->entry())(1.0); 2286 int res = reinterpret_cast<ExtractSignBits>(test->entry())(1.0);
2287 EXPECT_EQ(0, res); 2287 EXPECT_EQ(0, res);
2288 res = reinterpret_cast<ExtractSignBits>(test->entry())(-1.0); 2288 res = reinterpret_cast<ExtractSignBits>(test->entry())(-1.0);
2289 EXPECT_EQ(1, res); 2289 EXPECT_EQ(1, res);
2290 res = reinterpret_cast<ExtractSignBits>(test->entry())(-0.0); 2290 res = reinterpret_cast<ExtractSignBits>(test->entry())(-0.0);
2291 EXPECT_EQ(1, res); 2291 EXPECT_EQ(1, res);
2292 } 2292 }
2293 2293
2294
2295 ASSEMBLER_TEST_GENERATE(TestSetCC, assembler) {
2296 __ movq(RAX, Immediate(0xFFFFFFFF));
2297 __ cmpq(RAX, RAX);
2298 __ setcc(NOT_EQUAL, AL);
2299 __ ret();
2300 }
2301
2302
2303 ASSEMBLER_TEST_RUN(TestSetCC, test) {
2304 typedef uword (*TestSetCC)();
2305 uword res = reinterpret_cast<TestSetCC>(test->entry())();
2306 EXPECT_EQ(0xFFFFFF00, res);
2307 }
2308
2294 } // namespace dart 2309 } // namespace dart
2295 2310
2296 #endif // defined TARGET_ARCH_X64 2311 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698