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

Side by Side Diff: runtime/lib/typed_data.cc

Issue 148043003: Add Float64x2, Float64x2List, etc... with runtime and dart2js implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 TYPED_DATA_NATIVES(GetUint16, SetUint16, Smi, Value, 2, uint16_t) 293 TYPED_DATA_NATIVES(GetUint16, SetUint16, Smi, Value, 2, uint16_t)
294 TYPED_DATA_NATIVES(GetInt32, SetInt32, Integer, AsInt64Value, 4, int32_t) 294 TYPED_DATA_NATIVES(GetInt32, SetInt32, Integer, AsInt64Value, 4, int32_t)
295 TYPED_DATA_NATIVES(GetUint32, SetUint32, Integer, AsInt64Value, 4, uint32_t) 295 TYPED_DATA_NATIVES(GetUint32, SetUint32, Integer, AsInt64Value, 4, uint32_t)
296 TYPED_DATA_NATIVES(GetInt64, SetInt64, Integer, AsInt64Value, 8, int64_t) 296 TYPED_DATA_NATIVES(GetInt64, SetInt64, Integer, AsInt64Value, 8, int64_t)
297 TYPED_DATA_UINT64_NATIVES(GetUint64, SetUint64, Integer) 297 TYPED_DATA_UINT64_NATIVES(GetUint64, SetUint64, Integer)
298 TYPED_DATA_NATIVES(GetFloat32, SetFloat32, Double, value, 4, float) 298 TYPED_DATA_NATIVES(GetFloat32, SetFloat32, Double, value, 4, float)
299 TYPED_DATA_NATIVES(GetFloat64, SetFloat64, Double, value, 8, double) 299 TYPED_DATA_NATIVES(GetFloat64, SetFloat64, Double, value, 8, double)
300 TYPED_DATA_NATIVES( 300 TYPED_DATA_NATIVES(
301 GetFloat32x4, SetFloat32x4, Float32x4, value, 16, simd128_value_t) 301 GetFloat32x4, SetFloat32x4, Float32x4, value, 16, simd128_value_t)
302 TYPED_DATA_NATIVES(GetInt32x4, SetInt32x4, Int32x4, value, 16, simd128_value_t) 302 TYPED_DATA_NATIVES(GetInt32x4, SetInt32x4, Int32x4, value, 16, simd128_value_t)
303 TYPED_DATA_NATIVES(
304 GetFloat64x2, SetFloat64x2, Float64x2, value, 16, simd128_value_t)
303 305
304 306
305 DEFINE_NATIVE_ENTRY(ByteData_ToEndianInt16, 2) { 307 DEFINE_NATIVE_ENTRY(ByteData_ToEndianInt16, 2) {
306 GET_NON_NULL_NATIVE_ARGUMENT(Smi, host_value, arguments->NativeArgAt(0)); 308 GET_NON_NULL_NATIVE_ARGUMENT(Smi, host_value, arguments->NativeArgAt(0));
307 GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1)); 309 GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
308 int16_t value = host_value.Value(); 310 int16_t value = host_value.Value();
309 if (little_endian.value()) { 311 if (little_endian.value()) {
310 value = Utils::HostToLittleEndian16(value); 312 value = Utils::HostToLittleEndian16(value);
311 } else { 313 } else {
312 value = Utils::HostToBigEndian16(value); 314 value = Utils::HostToBigEndian16(value);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 value = bit_cast<double>( 414 value = bit_cast<double>(
413 Utils::HostToLittleEndian64(bit_cast<uint64_t>(value))); 415 Utils::HostToLittleEndian64(bit_cast<uint64_t>(value)));
414 } else { 416 } else {
415 value = bit_cast<double>( 417 value = bit_cast<double>(
416 Utils::HostToBigEndian64(bit_cast<uint64_t>(value))); 418 Utils::HostToBigEndian64(bit_cast<uint64_t>(value)));
417 } 419 }
418 return Double::New(value); 420 return Double::New(value);
419 } 421 }
420 422
421 } // namespace dart 423 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698