| 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 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 } | 2291 } |
| 2292 | 2292 |
| 2293 | 2293 |
| 2294 ASSEMBLER_TEST_RUN(PackedIntOperations, test) { | 2294 ASSEMBLER_TEST_RUN(PackedIntOperations, test) { |
| 2295 typedef uint32_t (*PackedIntOperationsCode)(); | 2295 typedef uint32_t (*PackedIntOperationsCode)(); |
| 2296 uint32_t res = reinterpret_cast<PackedIntOperationsCode>(test->entry())(); | 2296 uint32_t res = reinterpret_cast<PackedIntOperationsCode>(test->entry())(); |
| 2297 EXPECT_EQ(static_cast<uword>(0x5), res); | 2297 EXPECT_EQ(static_cast<uword>(0x5), res); |
| 2298 } | 2298 } |
| 2299 | 2299 |
| 2300 | 2300 |
| 2301 ASSEMBLER_TEST_GENERATE(PackedIntOperations2, assembler) { |
| 2302 // Note: on Windows 64 XMM6-XMM15 are callee save. |
| 2303 const intptr_t cpu_register_set = 0; |
| 2304 const intptr_t fpu_register_set = |
| 2305 ((1 << XMM10) | (1 << XMM11)) & CallingConventions::kVolatileXmmRegisters; |
| 2306 __ PushRegisters(cpu_register_set, fpu_register_set); |
| 2307 __ movl(RAX, Immediate(0x2)); |
| 2308 __ movd(XMM10, RAX); |
| 2309 __ shufps(XMM10, XMM10, Immediate(0x0)); |
| 2310 __ movl(RAX, Immediate(0x1)); |
| 2311 __ movd(XMM11, RAX); |
| 2312 __ shufps(XMM11, XMM11, Immediate(0x0)); |
| 2313 __ addpl(XMM10, XMM11); // 0x3 |
| 2314 __ addpl(XMM10, XMM10); // 0x6 |
| 2315 __ subpl(XMM10, XMM11); // 0x5 |
| 2316 __ pushq(RAX); |
| 2317 __ movss(Address(RSP, 0), XMM10); |
| 2318 __ popq(RAX); |
| 2319 __ PopRegisters(cpu_register_set, fpu_register_set); |
| 2320 __ ret(); |
| 2321 } |
| 2322 |
| 2323 |
| 2324 ASSEMBLER_TEST_RUN(PackedIntOperations2, test) { |
| 2325 typedef uint32_t (*PackedIntOperationsCode)(); |
| 2326 uint32_t res = reinterpret_cast<PackedIntOperationsCode>(test->entry())(); |
| 2327 EXPECT_EQ(static_cast<uword>(0x5), res); |
| 2328 } |
| 2329 |
| 2330 |
| 2301 ASSEMBLER_TEST_GENERATE(PackedFPOperations2, assembler) { | 2331 ASSEMBLER_TEST_GENERATE(PackedFPOperations2, assembler) { |
| 2302 __ movq(RAX, Immediate(bit_cast<int32_t, float>(4.0f))); | 2332 __ movq(RAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
| 2303 __ movd(XMM0, RAX); | 2333 __ movd(XMM0, RAX); |
| 2304 __ shufps(XMM0, XMM0, Immediate(0x0)); | 2334 __ shufps(XMM0, XMM0, Immediate(0x0)); |
| 2305 | 2335 |
| 2306 __ movaps(XMM11, XMM0); // Copy XMM0 | 2336 __ movaps(XMM11, XMM0); // Copy XMM0 |
| 2307 __ reciprocalps(XMM11); // 0.25 | 2337 __ reciprocalps(XMM11); // 0.25 |
| 2308 __ sqrtps(XMM11); // 0.5 | 2338 __ sqrtps(XMM11); // 0.5 |
| 2309 __ rsqrtps(XMM0); // ~0.5 | 2339 __ rsqrtps(XMM0); // ~0.5 |
| 2310 __ subps(XMM0, XMM11); // ~0.0 | 2340 __ subps(XMM0, XMM11); // ~0.0 |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3573 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); | 3603 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); |
| 3574 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); | 3604 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); |
| 3575 | 3605 |
| 3576 EXPECT_EQ(0, range_of(Bool::True().raw())); | 3606 EXPECT_EQ(0, range_of(Bool::True().raw())); |
| 3577 } | 3607 } |
| 3578 | 3608 |
| 3579 | 3609 |
| 3580 } // namespace dart | 3610 } // namespace dart |
| 3581 | 3611 |
| 3582 #endif // defined TARGET_ARCH_X64 | 3612 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |