OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 patch class Float32x4 { |
| 6 /* patch */ factory Float32x4(double x, double y, double z, double w) { |
| 7 return new _Float32x4(x, y, z, w); |
| 8 } |
| 9 /* patch */ factory Float32x4.zero() { |
| 10 return new _Float32x4.zero(); |
| 11 } |
| 12 } |
| 13 |
| 14 patch class Uint32x4 { |
| 15 /* patch */ factory Uint32x4(int x, int y, int z, int w) { |
| 16 return new _Uint32x4(x, y, z, w); |
| 17 } |
| 18 /* patch */ factory Uint32x4.bool(bool x, bool y, bool z, bool w) { |
| 19 return new _Uint32x4.bool(x, y, z, w); |
| 20 } |
| 21 } |
| 22 |
| 23 |
| 24 patch class Float32x4List { |
| 25 /* patch */ factory Float32x4List(int length) { |
| 26 return new _Float32x4Array(length); |
| 27 } |
| 28 |
| 29 /* patch */ factory Float32x4List.transferable(int length) { |
| 30 return _newTransferable(length); |
| 31 } |
| 32 |
| 33 /* patch */ factory Float32x4List.view(ByteArray array, |
| 34 [int start = 0, int length]) { |
| 35 return new _Float32x4ArrayView(array, start, length); |
| 36 } |
| 37 |
| 38 static _ExternalFloat32x4Array _newTransferable(int length) |
| 39 native "Float32x4List_newTransferable"; |
| 40 } |
| 41 |
| 42 |
| 43 // Expose native square root. |
| 44 double _sqrt(double x) native "Math_sqrt"; |
| 45 class _Float32x4Dart implements Float32x4 { |
| 46 final Float32List _storage = new Float32List(4); |
| 47 _Float32x4Dart.empty() { |
| 48 } |
| 49 _Float32x4Dart.copy(Float32List other) { |
| 50 _storage[0] = other._storage[0]; |
| 51 _storage[1] = other._storage[1]; |
| 52 _storage[2] = other._storage[2]; |
| 53 _storage[3] = other._storage[3]; |
| 54 } |
| 55 factory _Float32x4Dart(double x, double y, double z, double w) { |
| 56 var instance = new _Float32x4Dart.empty(); |
| 57 instance._storage[0] = x; |
| 58 instance._storage[1] = y; |
| 59 instance._storage[2] = z; |
| 60 instance._storage[3] = w; |
| 61 return instance; |
| 62 } |
| 63 factory _Float32x4Dart.zero() { |
| 64 var instance = new _Float32x4Dart.empty(); |
| 65 return instance; |
| 66 } |
| 67 Float32x4 operator +(Float32x4 other) { |
| 68 var instance = new _Float32x4Dart.empty(); |
| 69 instance._storage[0] = _storage[0] + other._storage[0]; |
| 70 instance._storage[1] = _storage[1] + other._storage[1]; |
| 71 instance._storage[2] = _storage[2] + other._storage[2]; |
| 72 instance._storage[3] = _storage[3] + other._storage[3]; |
| 73 return instance; |
| 74 } |
| 75 Float32x4 operator -() { |
| 76 var instance = new _Float32x4Dart.empty(); |
| 77 instance._storage[0] = -_storage[0]; |
| 78 instance._storage[1] = -_storage[1]; |
| 79 instance._storage[2] = -_storage[2]; |
| 80 instance._storage[3] = -_storage[3]; |
| 81 return instance; |
| 82 } |
| 83 Float32x4 operator -(Float32x4 other) { |
| 84 var instance = new _Float32x4Dart.empty(); |
| 85 instance._storage[0] = _storage[0] - other._storage[0]; |
| 86 instance._storage[1] = _storage[1] - other._storage[1]; |
| 87 instance._storage[2] = _storage[2] - other._storage[2]; |
| 88 instance._storage[3] = _storage[3] - other._storage[3]; |
| 89 return instance; |
| 90 } |
| 91 Float32x4 operator *(Float32x4 other) { |
| 92 var instance = new _Float32x4Dart.empty(); |
| 93 instance._storage[0] = _storage[0] * other._storage[0]; |
| 94 instance._storage[1] = _storage[1] * other._storage[1]; |
| 95 instance._storage[2] = _storage[2] * other._storage[2]; |
| 96 instance._storage[3] = _storage[3] * other._storage[3]; |
| 97 return instance; |
| 98 } |
| 99 Float32x4 operator /(Float32x4 other) { |
| 100 var instance = new _Float32x4Dart.empty(); |
| 101 instance._storage[0] = _storage[0] / other._storage[0]; |
| 102 instance._storage[1] = _storage[1] / other._storage[1]; |
| 103 instance._storage[2] = _storage[2] / other._storage[2]; |
| 104 instance._storage[3] = _storage[3] / other._storage[3]; |
| 105 return instance; |
| 106 } |
| 107 Uint32x4 lessThan(Float32x4 other) { |
| 108 bool _x = _storage[0] < other._storage[0]; |
| 109 bool _y = _storage[1] < other._storage[1]; |
| 110 bool _z = _storage[2] < other._storage[2]; |
| 111 bool _w = _storage[3] < other._storage[3]; |
| 112 return new Uint32x4.bool(_x, _y, _z, _w); |
| 113 } |
| 114 Uint32x4 lessThanOrEqual(Float32x4 other) { |
| 115 bool _x = _storage[0] <= other._storage[0]; |
| 116 bool _y = _storage[1] <= other._storage[1]; |
| 117 bool _z = _storage[2] <= other._storage[2]; |
| 118 bool _w = _storage[3] <= other._storage[3]; |
| 119 return new Uint32x4.bool(_x, _y, _z, _w); |
| 120 } |
| 121 Uint32x4 greaterThan(Float32x4 other) { |
| 122 bool _x = _storage[0] > other._storage[0]; |
| 123 bool _y = _storage[1] > other._storage[1]; |
| 124 bool _z = _storage[2] > other._storage[2]; |
| 125 bool _w = _storage[3] > other._storage[3]; |
| 126 return new Uint32x4.bool(_x, _y, _z, _w); |
| 127 } |
| 128 Uint32x4 greaterThanOrEqual(Float32x4 other) { |
| 129 bool _x = _storage[0] >= other._storage[0]; |
| 130 bool _y = _storage[1] >= other._storage[1]; |
| 131 bool _z = _storage[2] >= other._storage[2]; |
| 132 bool _w = _storage[3] >= other._storage[3]; |
| 133 return new Uint32x4.bool(_x, _y, _z, _w); |
| 134 } |
| 135 Uint32x4 equal(Float32x4 other) { |
| 136 bool _x = _storage[0] == other._storage[0]; |
| 137 bool _y = _storage[1] == other._storage[1]; |
| 138 bool _z = _storage[2] == other._storage[2]; |
| 139 bool _w = _storage[3] == other._storage[3]; |
| 140 return new Uint32x4.bool(_x, _y, _z, _w); |
| 141 } |
| 142 Uint32x4 notEqual(Float32x4 other) { |
| 143 bool _x = _storage[0] != other._storage[0]; |
| 144 bool _y = _storage[1] != other._storage[1]; |
| 145 bool _z = _storage[2] != other._storage[2]; |
| 146 bool _w = _storage[3] != other._storage[3]; |
| 147 return new Uint32x4.bool(_x, _y, _z, _w); |
| 148 } |
| 149 Float32x4 scale(double s) { |
| 150 var instance = new _Float32x4Dart.copy(this); |
| 151 instance._storage[0] *= s; |
| 152 instance._storage[1] *= s; |
| 153 instance._storage[2] *= s; |
| 154 instance._storage[3] *= s; |
| 155 return instance; |
| 156 } |
| 157 Float32x4 abs() { |
| 158 var instance = new _Float32x4Dart.copy(this); |
| 159 instance._storage[0] = instance._storage[0].abs(); |
| 160 instance._storage[1] = instance._storage[1].abs(); |
| 161 instance._storage[2] = instance._storage[2].abs(); |
| 162 instance._storage[3] = instance._storage[3].abs(); |
| 163 return instance; |
| 164 } |
| 165 Float32x4 clamp(Float32x4 lowerLimit, |
| 166 Float32x4 upperLimit) { |
| 167 var instance = new _Float32x4Dart.copy(this); |
| 168 if (instance._storage[0] > upperLimit._storage[0]) { |
| 169 instance._storage[0] = upperLimit._storage[0]; |
| 170 } |
| 171 if (instance._storage[1] > upperLimit._storage[1]) { |
| 172 instance._storage[1] = upperLimit._storage[1]; |
| 173 } |
| 174 if (instance._storage[2] > upperLimit._storage[2]) { |
| 175 instance._storage[2] = upperLimit._storage[2]; |
| 176 } |
| 177 if (instance._storage[3] > upperLimit._storage[3]) { |
| 178 instance._storage[3] = upperLimit._storage[3]; |
| 179 } |
| 180 if (instance._storage[0] < lowerLimit._storage[0]) { |
| 181 instance._storage[0] = lowerLimit._storage[0]; |
| 182 } |
| 183 if (instance._storage[1] < lowerLimit._storage[1]) { |
| 184 instance._storage[1] = lowerLimit._storage[1]; |
| 185 } |
| 186 if (instance._storage[2] < lowerLimit._storage[2]) { |
| 187 instance._storage[2] = lowerLimit._storage[2]; |
| 188 } |
| 189 if (instance._storage[3] < lowerLimit._storage[3]) { |
| 190 instance._storage[3] = lowerLimit._storage[3]; |
| 191 } |
| 192 return instance; |
| 193 } |
| 194 double get x => _storage[0]; |
| 195 double get y => _storage[1]; |
| 196 double get z => _storage[2]; |
| 197 double get w => _storage[3]; |
| 198 Float32x4 get xxxx { |
| 199 var instance = new _Float32x4Dart.empty(); |
| 200 instance._storage[0] = _storage[0]; |
| 201 instance._storage[1] = _storage[0]; |
| 202 instance._storage[2] = _storage[0]; |
| 203 instance._storage[3] = _storage[0]; |
| 204 return instance; |
| 205 } |
| 206 Float32x4 get yyyy { |
| 207 var instance = new _Float32x4Dart.empty(); |
| 208 instance._storage[0] = _storage[1]; |
| 209 instance._storage[1] = _storage[1]; |
| 210 instance._storage[2] = _storage[1]; |
| 211 instance._storage[3] = _storage[1]; |
| 212 return instance; |
| 213 } |
| 214 Float32x4 get zzzz { |
| 215 var instance = new _Float32x4Dart.empty(); |
| 216 instance._storage[0] = _storage[2]; |
| 217 instance._storage[1] = _storage[2]; |
| 218 instance._storage[2] = _storage[2]; |
| 219 instance._storage[3] = _storage[2]; |
| 220 return instance; |
| 221 } |
| 222 Float32x4 get wwww { |
| 223 var instance = new _Float32x4Dart.empty(); |
| 224 instance._storage[0] = _storage[3]; |
| 225 instance._storage[1] = _storage[3]; |
| 226 instance._storage[2] = _storage[3]; |
| 227 instance._storage[3] = _storage[3]; |
| 228 return instance; |
| 229 } |
| 230 Float32x4 withX(double x) { |
| 231 var instance = new _Float32x4Dart.copy(this); |
| 232 instance._storage[0] = x; |
| 233 return instance; |
| 234 } |
| 235 Float32x4 withY(double y) { |
| 236 var instance = new _Float32x4Dart.copy(this); |
| 237 instance._storage[1] = y; |
| 238 return instance; |
| 239 } |
| 240 Float32x4 withZ(double z) { |
| 241 var instance = new _Float32x4Dart.copy(this); |
| 242 instance._storage[2] = z; |
| 243 return instance; |
| 244 } |
| 245 Float32x4 withW(double w) { |
| 246 var instance = new _Float32x4Dart.copy(this); |
| 247 instance._storage[3] = w; |
| 248 return instance; |
| 249 } |
| 250 Float32x4 min(Float32x4 other) { |
| 251 var instance = new _Float32x4Dart.copy(this); |
| 252 if (instance._storage[0] > other._storage[0]) { |
| 253 instance._storage[0] = other._storage[0]; |
| 254 } |
| 255 if (instance._storage[1] > other._storage[1]) { |
| 256 instance._storage[1] = other._storage[1]; |
| 257 } |
| 258 if (instance._storage[2] > other._storage[2]) { |
| 259 instance._storage[2] = other._storage[2]; |
| 260 } |
| 261 if (instance._storage[3] > other._storage[3]) { |
| 262 instance._storage[3] = other._storage[3]; |
| 263 } |
| 264 return instance; |
| 265 } |
| 266 Float32x4 max(Float32x4 other) { |
| 267 var instance = new _Float32x4Dart.copy(this); |
| 268 if (instance._storage[0] < other._storage[0]) { |
| 269 instance._storage[0] = other._storage[0]; |
| 270 } |
| 271 if (instance._storage[1] < other._storage[1]) { |
| 272 instance._storage[1] = other._storage[1]; |
| 273 } |
| 274 if (instance._storage[2] < other._storage[2]) { |
| 275 instance._storage[2] = other._storage[2]; |
| 276 } |
| 277 if (instance._storage[3] < other._storage[3]) { |
| 278 instance._storage[3] = other._storage[3]; |
| 279 } |
| 280 return instance; |
| 281 } |
| 282 Float32x4 sqrt() { |
| 283 var instance = new _Float32x4Dart.empty(); |
| 284 instance._storage[0] = _sqrt(_storage[0]); |
| 285 instance._storage[1] = _sqrt(_storage[1]); |
| 286 instance._storage[2] = _sqrt(_storage[2]); |
| 287 instance._storage[3] = _sqrt(_storage[3]); |
| 288 return instance; |
| 289 } |
| 290 Float32x4 reciprocal() { |
| 291 var instance = new _Float32x4Dart.empty(); |
| 292 instance._storage[0] = (1.0 / _storage[0]); |
| 293 instance._storage[1] = (1.0 / _storage[1]); |
| 294 instance._storage[2] = (1.0 / _storage[2]); |
| 295 instance._storage[3] = (1.0 / _storage[3]); |
| 296 return instance; |
| 297 } |
| 298 Float32x4 reciprocalSqrt() { |
| 299 var instance = new _Float32x4Dart.empty(); |
| 300 instance._storage[0] = _sqrt(1.0 / _storage[0]); |
| 301 instance._storage[1] = _sqrt(1.0 / _storage[1]); |
| 302 instance._storage[2] = _sqrt(1.0 / _storage[2]); |
| 303 instance._storage[3] = _sqrt(1.0 / _storage[3]); |
| 304 return instance; |
| 305 } |
| 306 Uint32x4 toUint32x4() { |
| 307 Uint32List view = new Uint32List.view(_storage.asByteArray()); |
| 308 return new Uint32x4(view[0], view[1], view[2], view[3]); |
| 309 } |
| 310 } |
| 311 |
| 312 class _Uint32x4Dart implements Uint32x4 { |
| 313 final Uint32List _storage = new Uint32List(4); |
| 314 _Uint32x4Dart.empty() { |
| 315 } |
| 316 _Uint32x4Dart.copy(_Uint32x4Dart other) { |
| 317 _storage[0] = other._storage[0]; |
| 318 _storage[1] = other._storage[1]; |
| 319 _storage[2] = other._storage[2]; |
| 320 _storage[3] = other._storage[3]; |
| 321 } |
| 322 factory _Uint32x4Dart(int x, int y, int z, int w) { |
| 323 var instance = new _Uint32x4Dart.empty(); |
| 324 instance._storage[0] = x; |
| 325 instance._storage[1] = y; |
| 326 instance._storage[2] = z; |
| 327 instance._storage[3] = w; |
| 328 return instance; |
| 329 } |
| 330 factory _Uint32x4Dart.bool(bool x, bool y, bool z, bool w) { |
| 331 var instance = new _Uint32x4Dart.empty(); |
| 332 instance._storage[0] = x ? 0xFFFFFFFF : 0x0; |
| 333 instance._storage[1] = y ? 0xFFFFFFFF : 0x0; |
| 334 instance._storage[2] = z ? 0xFFFFFFFF : 0x0; |
| 335 instance._storage[3] = w ? 0xFFFFFFFF : 0x0; |
| 336 return instance; |
| 337 } |
| 338 Uint32x4 operator |(Uint32x4 other) { |
| 339 var instance = new _Uint32x4Dart.empty(); |
| 340 instance._storage[0] = _storage[0] | other._storage[0]; |
| 341 instance._storage[1] = _storage[1] | other._storage[1]; |
| 342 instance._storage[2] = _storage[2] | other._storage[2]; |
| 343 instance._storage[3] = _storage[3] | other._storage[3]; |
| 344 return instance; |
| 345 } |
| 346 Uint32x4 operator &(Uint32x4 other) { |
| 347 var instance = new _Uint32x4Dart.empty(); |
| 348 instance._storage[0] = _storage[0] & other._storage[0]; |
| 349 instance._storage[1] = _storage[1] & other._storage[1]; |
| 350 instance._storage[2] = _storage[2] & other._storage[2]; |
| 351 instance._storage[3] = _storage[3] & other._storage[3]; |
| 352 return instance; |
| 353 } |
| 354 Uint32x4 operator ^(Uint32x4 other) { |
| 355 var instance = new _Uint32x4Dart.empty(); |
| 356 instance._storage[0] = _storage[0] ^ other._storage[0]; |
| 357 instance._storage[1] = _storage[1] ^ other._storage[1]; |
| 358 instance._storage[2] = _storage[2] ^ other._storage[2]; |
| 359 instance._storage[3] = _storage[3] ^ other._storage[3]; |
| 360 return instance; |
| 361 } |
| 362 int get x => _storage[0]; |
| 363 int get y => _storage[1]; |
| 364 int get z => _storage[2]; |
| 365 int get w => _storage[3]; |
| 366 Uint32x4 withX(int x) { |
| 367 var instance = new _Uint32x4Dart.copy(this); |
| 368 instance._storage[0] = x & 0xFFFFFFFF; |
| 369 return instance; |
| 370 } |
| 371 Uint32x4 withY(int y) { |
| 372 var instance = new _Uint32x4Dart.copy(this); |
| 373 instance._storage[1] = y & 0xFFFFFFFF; |
| 374 return instance; |
| 375 } |
| 376 Uint32x4 withZ(int z) { |
| 377 var instance = new _Uint32x4Dart.copy(this); |
| 378 instance._storage[2] = z & 0xFFFFFFFF; |
| 379 return instance; |
| 380 } |
| 381 Uint32x4 withW(int w) { |
| 382 var instance = new _Uint32x4Dart.copy(this); |
| 383 instance._storage[3] = w & 0xFFFFFFFF; |
| 384 return instance; |
| 385 } |
| 386 bool get flagX => _storage[0] != 0x0; |
| 387 bool get flagY => _storage[1] != 0x0; |
| 388 bool get flagZ => _storage[2] != 0x0; |
| 389 bool get flagW => _storage[3] != 0x0; |
| 390 Uint32x4 withFlagX(bool x) { |
| 391 var instance = new _Uint32x4Dart.copy(this); |
| 392 instance._storage[0] = x ? 0xFFFFFFFF : 0x0; |
| 393 return instance; |
| 394 } |
| 395 Uint32x4 withFlagY(bool y) { |
| 396 var instance = new _Uint32x4Dart.copy(this); |
| 397 instance._storage[1] = y ? 0xFFFFFFFF : 0x0; |
| 398 return instance; |
| 399 } |
| 400 Uint32x4 withFlagZ(bool z) { |
| 401 var instance = new _Uint32x4Dart.copy(this); |
| 402 instance._storage[2] = z ? 0xFFFFFFFF : 0x0; |
| 403 return instance; |
| 404 } |
| 405 Uint32x4 withFlagW(bool w) { |
| 406 var instance = new _Uint32x4Dart.copy(this); |
| 407 instance._storage[3] = w ? 0xFFFFFFFF : 0x0; |
| 408 return instance; |
| 409 } |
| 410 Float32x4 select(Float32x4 trueValue, |
| 411 Float32x4 falseValue) { |
| 412 Uint32x4 trueMask = trueValue.toUint32x4(); |
| 413 Uint32x4 falseMask = falseValue.toUint32x4(); |
| 414 var instance = new _Uint32x4Dart.empty(); |
| 415 instance._storage[0] = (_storage[0] & trueMask._storage[0]); |
| 416 instance._storage[1] = (_storage[1] & trueMask._storage[1]); |
| 417 instance._storage[2] = (_storage[2] & trueMask._storage[2]); |
| 418 instance._storage[3] = (_storage[3] & trueMask._storage[3]); |
| 419 instance._storage[0] |= (~_storage[0] & falseMask._storage[0]); |
| 420 instance._storage[1] |= (~_storage[1] & falseMask._storage[1]); |
| 421 instance._storage[2] |= (~_storage[2] & falseMask._storage[2]); |
| 422 instance._storage[3] |= (~_storage[3] & falseMask._storage[3]); |
| 423 return instance.toFloat32x4(); |
| 424 } |
| 425 Float32x4 toFloat32x4() { |
| 426 Float32List view = new Float32List.view(_storage.asByteArray()); |
| 427 return new Float32x4(view[0], view[1], view[2], view[3]); |
| 428 } |
| 429 } |
| 430 |
| 431 class _Float32x4 implements Float32x4 { |
| 432 factory _Float32x4(double x, double y, double z, double w) |
| 433 native "Float32x4_fromDoubles"; |
| 434 factory _Float32x4.zero() native "Float32x4_zero"; |
| 435 Float32x4 operator +(Float32x4 other) { |
| 436 return _add(other); |
| 437 } |
| 438 Float32x4 _add(Float32x4 other) native "Float32x4_add"; |
| 439 Float32x4 operator -() { |
| 440 return _negate(); |
| 441 } |
| 442 Float32x4 _negate() native "Float32x4_negate"; |
| 443 Float32x4 operator -(Float32x4 other) { |
| 444 return _sub(other); |
| 445 } |
| 446 Float32x4 _sub(Float32x4 other) native "Float32x4_sub"; |
| 447 Float32x4 operator *(Float32x4 other) { |
| 448 return _mul(other); |
| 449 } |
| 450 Float32x4 _mul(Float32x4 other) native "Float32x4_mul"; |
| 451 Float32x4 operator /(Float32x4 other) { |
| 452 return _div(other); |
| 453 } |
| 454 Float32x4 _div(Float32x4 other) native "Float32x4_div"; |
| 455 Uint32x4 lessThan(Float32x4 other) { |
| 456 return _cmplt(other); |
| 457 } |
| 458 Uint32x4 _cmplt(Float32x4 other) native "Float32x4_cmplt"; |
| 459 Uint32x4 lessThanOrEqual(Float32x4 other) { |
| 460 return _cmplte(other); |
| 461 } |
| 462 Uint32x4 _cmplte(Float32x4 other) native "Float32x4_cmplte"; |
| 463 Uint32x4 greaterThan(Float32x4 other) { |
| 464 return _cmpgt(other); |
| 465 } |
| 466 Uint32x4 _cmpgt(Float32x4 other) native "Float32x4_cmpgt"; |
| 467 Uint32x4 greaterThanOrEqual(Float32x4 other) { |
| 468 return _cmpgte(other); |
| 469 } |
| 470 Uint32x4 _cmpgte(Float32x4 other) native "Float32x4_cmpgte"; |
| 471 Uint32x4 equal(Float32x4 other) { |
| 472 return _cmpequal(other); |
| 473 } |
| 474 Uint32x4 _cmpequal(Float32x4 other) |
| 475 native "Float32x4_cmpequal"; |
| 476 Uint32x4 notEqual(Float32x4 other) { |
| 477 return _cmpnequal(other); |
| 478 } |
| 479 Uint32x4 _cmpnequal(Float32x4 other) |
| 480 native "Float32x4_cmpnequal"; |
| 481 Float32x4 scale(double s) { |
| 482 return _scale(s); |
| 483 } |
| 484 Float32x4 _scale(double s) native "Float32x4_scale"; |
| 485 Float32x4 abs() { |
| 486 return _abs(); |
| 487 } |
| 488 Float32x4 _abs() native "Float32x4_abs"; |
| 489 Float32x4 clamp(Float32x4 lowerLimit, |
| 490 Float32x4 upperLimit) { |
| 491 return _clamp(lowerLimit, upperLimit); |
| 492 } |
| 493 Float32x4 _clamp(Float32x4 lowerLimit, |
| 494 Float32x4 upperLimit) |
| 495 native "Float32x4_clamp"; |
| 496 double get x native "Float32x4_getX"; |
| 497 double get y native "Float32x4_getY"; |
| 498 double get z native "Float32x4_getZ"; |
| 499 double get w native "Float32x4_getW"; |
| 500 Float32x4 get xxxx native "Float32x4_getXXXX"; |
| 501 Float32x4 get yyyy native "Float32x4_getYYYY"; |
| 502 Float32x4 get zzzz native "Float32x4_getZZZZ"; |
| 503 Float32x4 get wwww native "Float32x4_getWWWW"; |
| 504 Float32x4 withX(double x) native "Float32x4_setX"; |
| 505 Float32x4 withY(double y) native "Float32x4_setY"; |
| 506 Float32x4 withZ(double z) native "Float32x4_setZ"; |
| 507 Float32x4 withW(double w) native "Float32x4_setW"; |
| 508 Float32x4 min(Float32x4 other) { |
| 509 return _min(other); |
| 510 } |
| 511 Float32x4 _min(Float32x4 other) native "Float32x4_min"; |
| 512 Float32x4 max(Float32x4 other) { |
| 513 return _max(other); |
| 514 } |
| 515 Float32x4 _max(Float32x4 other) native "Float32x4_max"; |
| 516 Float32x4 sqrt() { |
| 517 return _sqrt(); |
| 518 } |
| 519 Float32x4 _sqrt() native "Float32x4_sqrt"; |
| 520 Float32x4 reciprocal() { |
| 521 return _reciprocal(); |
| 522 } |
| 523 Float32x4 _reciprocal() native "Float32x4_reciprocal"; |
| 524 Float32x4 reciprocalSqrt() { |
| 525 return _reciprocalSqrt(); |
| 526 } |
| 527 Float32x4 _reciprocalSqrt() native "Float32x4_reciprocalSqrt"; |
| 528 Uint32x4 toUint32x4() { |
| 529 return _toUint32x4(); |
| 530 } |
| 531 Uint32x4 _toUint32x4() native "Float32x4_toUint32x4"; |
| 532 } |
| 533 |
| 534 class _Uint32x4 implements Uint32x4 { |
| 535 factory _Uint32x4(int x, int y, int z, int w) |
| 536 native "Uint32x4_fromInts"; |
| 537 factory _Uint32x4.bool(bool x, bool y, bool z, bool w) |
| 538 native "Uint32x4_fromBools"; |
| 539 Uint32x4 operator |(Uint32x4 other) { |
| 540 return _or(other); |
| 541 } |
| 542 Uint32x4 _or(Uint32x4 other) native "Uint32x4_or"; |
| 543 Uint32x4 operator &(Uint32x4 other) { |
| 544 return _and(other); |
| 545 } |
| 546 Uint32x4 _and(Uint32x4 other) native "Uint32x4_and"; |
| 547 Uint32x4 operator ^(Uint32x4 other) { |
| 548 return _xor(other); |
| 549 } |
| 550 Uint32x4 _xor(Uint32x4 other) native "Uint32x4_xor"; |
| 551 int get x native "Uint32x4_getX"; |
| 552 int get y native "Uint32x4_getY"; |
| 553 int get z native "Uint32x4_getZ"; |
| 554 int get w native "Uint32x4_getW"; |
| 555 Uint32x4 withX(int x) native "Uint32x4_setX"; |
| 556 Uint32x4 withY(int y) native "Uint32x4_setY"; |
| 557 Uint32x4 withZ(int z) native "Uint32x4_setZ"; |
| 558 Uint32x4 withW(int w) native "Uint32x4_setW"; |
| 559 bool get flagX native "Uint32x4_getFlagX"; |
| 560 bool get flagY native "Uint32x4_getFlagY"; |
| 561 bool get flagZ native "Uint32x4_getFlagZ"; |
| 562 bool get flagW native "Uint32x4_getFlagW"; |
| 563 Uint32x4 withFlagX(bool x) native "Uint32x4_setFlagX"; |
| 564 Uint32x4 withFlagY(bool y) native "Uint32x4_setFlagY"; |
| 565 Uint32x4 withFlagZ(bool z) native "Uint32x4_setFlagZ"; |
| 566 Uint32x4 withFlagW(bool w) native "Uint32x4_setFlagW"; |
| 567 Float32x4 select(Float32x4 trueValue, |
| 568 Float32x4 falseValue) { |
| 569 return _select(trueValue, falseValue); |
| 570 } |
| 571 Float32x4 _select(Float32x4 trueValue, |
| 572 Float32x4 falseValue) |
| 573 native "Uint32x4_select"; |
| 574 Float32x4 toFloat32x4() { |
| 575 return _toFloat32x4(); |
| 576 } |
| 577 Float32x4 _toFloat32x4() native "Uint32x4_toFloat32x4"; |
| 578 } |
| 579 |
| 580 |
| 581 class _Float32x4Array extends _ByteArrayBase |
| 582 implements Float32x4List { |
| 583 factory _Float32x4Array(int length) { |
| 584 return _new(length); |
| 585 } |
| 586 factory _Float32x4Array.view(ByteArray array, |
| 587 [int start = 0, int length]) { |
| 588 if (length == null) { |
| 589 length = (array.lengthInBytes() - start) ~/ _BYTES_PER_ELEMENT; |
| 590 } |
| 591 return new _Float32x4ArrayView(array, start, length); |
| 592 } |
| 593 Float32x4 operator [](int index) { |
| 594 return _getIndexed(index); |
| 595 } |
| 596 int operator []=(int index, Float32x4 value) { |
| 597 _setIndexed(index, value); |
| 598 } |
| 599 Iterator<Float32x4> get iterator { |
| 600 return new _ByteArrayIterator<Float32x4>(this); |
| 601 } |
| 602 List<Float32x4> getRange(int start, int length) { |
| 603 _rangeCheck(this.length, start, length); |
| 604 List<Float32x4> result = _new(length); |
| 605 result.setRange(0, length, this, start); |
| 606 return result; |
| 607 } |
| 608 void setRange(int start, int length, List<Float32x4> from, |
| 609 [int startFrom = 0]) { |
| 610 if (from is _Float32x4Array) { |
| 611 _setRange(start * _BYTES_PER_ELEMENT, |
| 612 length * _BYTES_PER_ELEMENT, |
| 613 from, |
| 614 startFrom * _BYTES_PER_ELEMENT); |
| 615 } else { |
| 616 Arrays.copy(from, startFrom, this, start, length); |
| 617 } |
| 618 } |
| 619 String toString() { |
| 620 return Collections.collectionToString(this); |
| 621 } |
| 622 int bytesPerElement() { |
| 623 return _BYTES_PER_ELEMENT; |
| 624 } |
| 625 int lengthInBytes() { |
| 626 return _length() * _BYTES_PER_ELEMENT; |
| 627 } |
| 628 static const int _BYTES_PER_ELEMENT = 16; |
| 629 static _Float32x4Array _new(int length) |
| 630 native "Float32x4Array_new"; |
| 631 Float32x4 _getIndexed(int index) |
| 632 native "Float32x4Array_getIndexed"; |
| 633 int _setIndexed(int index, Float32x4 value) |
| 634 native "Float32x4Array_setIndexed"; |
| 635 } |
| 636 |
| 637 |
| 638 class _Float32x4ArrayView extends _ByteArrayViewBase |
| 639 implements Float32x4List { |
| 640 _Float32x4ArrayView(ByteArray array, |
| 641 [int offsetInBytes = 0, int _length]) |
| 642 : super(array, _requireInteger(offsetInBytes), |
| 643 _requireIntegerOrNull( |
| 644 _length, |
| 645 ((array.lengthInBytes() - offsetInBytes) ~/ _BYTES_PER_ELEMENT))) { |
| 646 _rangeCheck(array.lengthInBytes(), _offset, length * _BYTES_PER_ELEMENT); |
| 647 } |
| 648 |
| 649 Float32x4 operator [](int index) { |
| 650 if (index < 0 || index >= length) { |
| 651 String message = "$index must be in the range [0..$length)"; |
| 652 throw new RangeError(message); |
| 653 } |
| 654 return _array.getFloat32x4(_offset + (index * _BYTES_PER_ELEMENT)); |
| 655 } |
| 656 |
| 657 void operator []=(int index, Float32x4 value) { |
| 658 if (index < 0 || index >= length) { |
| 659 String message = "$index must be in the range [0..$length)"; |
| 660 throw new RangeError(message); |
| 661 } |
| 662 _array.setFloat32x4(_offset + (index * _BYTES_PER_ELEMENT), value); |
| 663 } |
| 664 |
| 665 Iterator<Float32x4> get iterator { |
| 666 return new _ByteArrayIterator<Float32x4>(this); |
| 667 } |
| 668 |
| 669 List<Float32x4> getRange(int start, int length) { |
| 670 _rangeCheck(this.length, start, length); |
| 671 List<Float32x4> result = new Float32List(length); |
| 672 result.setRange(0, length, this, start); |
| 673 return result; |
| 674 } |
| 675 |
| 676 void setRange(int start, int length, List<Float32x4> from, |
| 677 [int startFrom = 0]) { |
| 678 Arrays.copy(from, startFrom, this, start, length); |
| 679 } |
| 680 |
| 681 String toString() { |
| 682 return Collections.collectionToString(this); |
| 683 } |
| 684 |
| 685 int bytesPerElement() { |
| 686 return _BYTES_PER_ELEMENT; |
| 687 } |
| 688 |
| 689 int lengthInBytes() { |
| 690 return length * _BYTES_PER_ELEMENT; |
| 691 } |
| 692 |
| 693 ByteArray asByteArray([int start = 0, int length]) { |
| 694 if (length == null) { |
| 695 length = this.lengthInBytes(); |
| 696 } |
| 697 _rangeCheck(this.length, start, length); |
| 698 return _array.subByteArray(_offset + start, length); |
| 699 } |
| 700 |
| 701 static const int _BYTES_PER_ELEMENT = 16; |
| 702 } |
| 703 |
| 704 |
| 705 class _ExternalFloat32x4Array extends _ByteArrayBase |
| 706 implements Float32x4List { |
| 707 Float32x4 operator [](int index) { |
| 708 return _getIndexed(index); |
| 709 } |
| 710 |
| 711 int operator []=(int index, Float32x4 value) { |
| 712 _setIndexed(index, value); |
| 713 } |
| 714 |
| 715 Iterator<Float32x4> get iterator { |
| 716 return new _ByteArrayIterator<Float32x4>(this); |
| 717 } |
| 718 |
| 719 List<Float32x4> getRange(int start, int length) { |
| 720 _rangeCheck(this.length, start, length); |
| 721 List<Float32x4> result = new Float32x4List(length); |
| 722 result.setRange(0, length, this, start); |
| 723 return result; |
| 724 } |
| 725 |
| 726 void setRange(int start, int length, List<Float32x4> from, |
| 727 [int startFrom = 0]) { |
| 728 if (from is _ExternalFloat32x4Array) { |
| 729 _setRange(start * _BYTES_PER_ELEMENT, |
| 730 length * _BYTES_PER_ELEMENT, |
| 731 from, |
| 732 startFrom * _BYTES_PER_ELEMENT); |
| 733 } else { |
| 734 Arrays.copy(from, startFrom, this, start, length); |
| 735 } |
| 736 } |
| 737 |
| 738 String toString() { |
| 739 return Collections.collectionToString(this); |
| 740 } |
| 741 |
| 742 int bytesPerElement() { |
| 743 return _BYTES_PER_ELEMENT; |
| 744 } |
| 745 |
| 746 int lengthInBytes() { |
| 747 return _length() * _BYTES_PER_ELEMENT; |
| 748 } |
| 749 |
| 750 static const int _BYTES_PER_ELEMENT = 16; |
| 751 |
| 752 Float32x4 _getIndexed(int index) |
| 753 native "ExternalFloat32x4Array_getIndexed"; |
| 754 int _setIndexed(int index, Float32x4 value) |
| 755 native "ExternalFloat32x4Array_setIndexed"; |
| 756 } |
OLD | NEW |