| OLD | NEW |
| 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 __ movl(RAX, Immediate(0xfff0)); | 1019 __ movl(RAX, Immediate(0xfff0)); |
| 1020 __ andl(RCX, RAX); | 1020 __ andl(RCX, RAX); |
| 1021 __ movl(RAX, Immediate(1)); | 1021 __ movl(RAX, Immediate(1)); |
| 1022 __ orl(RCX, RAX); | 1022 __ orl(RCX, RAX); |
| 1023 __ movl(RAX, RCX); | 1023 __ movl(RAX, RCX); |
| 1024 __ ret(); | 1024 __ ret(); |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 | 1027 |
| 1028 ASSEMBLER_TEST_RUN(Bitwise, test) { | 1028 ASSEMBLER_TEST_RUN(Bitwise, test) { |
| 1029 uint64_t f1; | 1029 uint64_t f1 = 0; |
| 1030 uint64_t f2; | 1030 uint64_t f2 = 0; |
| 1031 typedef int (*Bitwise)(void*, void*); | 1031 typedef int (*Bitwise)(void*, void*); |
| 1032 int result = reinterpret_cast<Bitwise>(test->entry())(&f1, &f2); | 1032 int result = reinterpret_cast<Bitwise>(test->entry())(&f1, &f2); |
| 1033 EXPECT_EQ(256 + 1, result); | 1033 EXPECT_EQ(256 + 1, result); |
| 1034 EXPECT_EQ(kMaxUint32, f1); | 1034 EXPECT_EQ(kMaxUint32, f1); |
| 1035 EXPECT_EQ(kMaxUint32, f2); | 1035 EXPECT_EQ(kMaxUint32, f2); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 | 1038 |
| 1039 ASSEMBLER_TEST_GENERATE(Bitwise64, assembler) { | 1039 ASSEMBLER_TEST_GENERATE(Bitwise64, assembler) { |
| 1040 Label error; | 1040 Label error; |
| (...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3456 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); | 3456 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); |
| 3457 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); | 3457 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); |
| 3458 | 3458 |
| 3459 EXPECT_EQ(0, range_of(Bool::True().raw())); | 3459 EXPECT_EQ(0, range_of(Bool::True().raw())); |
| 3460 } | 3460 } |
| 3461 | 3461 |
| 3462 | 3462 |
| 3463 } // namespace dart | 3463 } // namespace dart |
| 3464 | 3464 |
| 3465 #endif // defined TARGET_ARCH_X64 | 3465 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |