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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/become.h" | 10 #include "vm/become.h" |
(...skipping 22334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
22345 Object::Allocate(Float32x4::kClassId, Float32x4::InstanceSize(), space); | 22345 Object::Allocate(Float32x4::kClassId, Float32x4::InstanceSize(), space); |
22346 NoSafepointScope no_safepoint; | 22346 NoSafepointScope no_safepoint; |
22347 result ^= raw; | 22347 result ^= raw; |
22348 } | 22348 } |
22349 result.set_value(value); | 22349 result.set_value(value); |
22350 return result.raw(); | 22350 return result.raw(); |
22351 } | 22351 } |
22352 | 22352 |
22353 | 22353 |
22354 simd128_value_t Float32x4::value() const { | 22354 simd128_value_t Float32x4::value() const { |
22355 #if defined(HOST_ARCH_ARM) | |
zra
2017/06/20 17:44:34
I think you should be able to use bit_cast here. A
| |
22356 simd128_value_t temp; | |
22357 memmove(&temp, &raw_ptr()->value_[0], sizeof(temp)); | |
22358 return temp; | |
22359 #else | |
22355 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); | 22360 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); |
22361 #endif | |
22356 } | 22362 } |
22357 | 22363 |
22358 | 22364 |
22359 void Float32x4::set_value(simd128_value_t value) const { | 22365 void Float32x4::set_value(simd128_value_t value) const { |
22366 #if defined(HOST_ARCH_ARM) | |
22367 memmove(const_cast<float*>(&raw_ptr()->value_[0]), &value, sizeof(value)); | |
22368 #else | |
22360 StoreSimd128(&raw_ptr()->value_[0], value); | 22369 StoreSimd128(&raw_ptr()->value_[0], value); |
22370 #endif | |
22361 } | 22371 } |
22362 | 22372 |
22363 | 22373 |
22364 void Float32x4::set_x(float value) const { | 22374 void Float32x4::set_x(float value) const { |
22365 StoreNonPointer(&raw_ptr()->value_[0], value); | 22375 StoreNonPointer(&raw_ptr()->value_[0], value); |
22366 } | 22376 } |
22367 | 22377 |
22368 | 22378 |
22369 void Float32x4::set_y(float value) const { | 22379 void Float32x4::set_y(float value) const { |
22370 StoreNonPointer(&raw_ptr()->value_[1], value); | 22380 StoreNonPointer(&raw_ptr()->value_[1], value); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
22480 return raw_ptr()->value_[2]; | 22490 return raw_ptr()->value_[2]; |
22481 } | 22491 } |
22482 | 22492 |
22483 | 22493 |
22484 int32_t Int32x4::w() const { | 22494 int32_t Int32x4::w() const { |
22485 return raw_ptr()->value_[3]; | 22495 return raw_ptr()->value_[3]; |
22486 } | 22496 } |
22487 | 22497 |
22488 | 22498 |
22489 simd128_value_t Int32x4::value() const { | 22499 simd128_value_t Int32x4::value() const { |
22500 #if defined(HOST_ARCH_ARM) | |
22501 simd128_value_t temp; | |
22502 memmove(&temp, &raw_ptr()->value_[0], sizeof(temp)); | |
22503 return temp; | |
22504 #else | |
22490 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); | 22505 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); |
22506 #endif | |
22491 } | 22507 } |
22492 | 22508 |
22493 | 22509 |
22494 void Int32x4::set_value(simd128_value_t value) const { | 22510 void Int32x4::set_value(simd128_value_t value) const { |
22511 #if defined(HOST_ARCH_ARM) | |
22512 memmove(const_cast<int32_t*>(&raw_ptr()->value_[0]), &value, sizeof(value)); | |
22513 #else | |
22495 StoreSimd128(&raw_ptr()->value_[0], value); | 22514 StoreSimd128(&raw_ptr()->value_[0], value); |
22515 #endif | |
22496 } | 22516 } |
22497 | 22517 |
22498 | 22518 |
22499 const char* Int32x4::ToCString() const { | 22519 const char* Int32x4::ToCString() const { |
22500 int32_t _x = x(); | 22520 int32_t _x = x(); |
22501 int32_t _y = y(); | 22521 int32_t _y = y(); |
22502 int32_t _z = z(); | 22522 int32_t _z = z(); |
22503 int32_t _w = w(); | 22523 int32_t _w = w(); |
22504 return OS::SCreate(Thread::Current()->zone(), "[%08x, %08x, %08x, %08x]", _x, | 22524 return OS::SCreate(Thread::Current()->zone(), "[%08x, %08x, %08x, %08x]", _x, |
22505 _y, _z, _w); | 22525 _y, _z, _w); |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
23419 return UserTag::null(); | 23439 return UserTag::null(); |
23420 } | 23440 } |
23421 | 23441 |
23422 | 23442 |
23423 const char* UserTag::ToCString() const { | 23443 const char* UserTag::ToCString() const { |
23424 const String& tag_label = String::Handle(label()); | 23444 const String& tag_label = String::Handle(label()); |
23425 return tag_label.ToCString(); | 23445 return tag_label.ToCString(); |
23426 } | 23446 } |
23427 | 23447 |
23428 } // namespace dart | 23448 } // namespace dart |
OLD | NEW |