Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1 | // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | (function(global, utils) { |
| 6 | |
| 7 | "use strict"; |
| 8 | |
| 9 | %CheckIsBootstrapping(); |
| 10 | |
| 11 | // ------------------------------------------------------------------- |
| 12 | // Imports |
| 13 | |
| 14 | var GlobalSIMD = global.SIMD; |
| 15 | var MakeTypeError; |
| 16 | var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
| 17 | |
| 18 | utils.Import(function(from) { |
| 19 | MakeTypeError = from.MakeTypeError; |
| 20 | }); |
| 21 | |
| 22 | // ------------------------------------------------------------------- |
| 23 | |
| 24 | macro SIMD_FLOAT_TYPES(FUNCTION) |
| 25 | FUNCTION(Float32x4, float32x4, 4) |
| 26 | endmacro |
| 27 | |
| 28 | macro SIMD_INT_TYPES(FUNCTION) |
| 29 | FUNCTION(Int32x4, int32x4, 4) |
| 30 | FUNCTION(Int16x8, int16x8, 8) |
| 31 | FUNCTION(Int8x16, int8x16, 16) |
| 32 | endmacro |
| 33 | |
| 34 | macro SIMD_UINT_TYPES(FUNCTION) |
| 35 | FUNCTION(Uint32x4, uint32x4, 4) |
| 36 | FUNCTION(Uint16x8, uint16x8, 8) |
| 37 | FUNCTION(Uint8x16, uint8x16, 16) |
| 38 | endmacro |
| 39 | |
| 40 | macro SIMD_BOOL_TYPES(FUNCTION) |
| 41 | FUNCTION(Bool32x4, bool32x4, 4) |
| 42 | FUNCTION(Bool16x8, bool16x8, 8) |
| 43 | FUNCTION(Bool8x16, bool8x16, 16) |
| 44 | endmacro |
| 45 | |
| 46 | macro SIMD_ALL_TYPES(FUNCTION) |
| 47 | SIMD_FLOAT_TYPES(FUNCTION) |
| 48 | SIMD_INT_TYPES(FUNCTION) |
| 49 | SIMD_UINT_TYPES(FUNCTION) |
| 50 | SIMD_BOOL_TYPES(FUNCTION) |
| 51 | endmacro |
| 52 | |
| 53 | macro DECLARE_GLOBALS(NAME, TYPE, LANES) |
| 54 | var GlobalNAME = GlobalSIMD.NAME; |
| 55 | endmacro |
| 56 | |
| 57 | SIMD_ALL_TYPES(DECLARE_GLOBALS) |
| 58 | |
| 59 | macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES) |
| 60 | function NAMECheckJS(a) { |
| 61 | return %NAMECheck(a); |
| 62 | } |
| 63 | |
| 64 | function NAMEToString() { |
| 65 | var value = %_ValueOf(this); |
| 66 | if (typeof(value) !== 'TYPE') { |
| 67 | throw MakeTypeError(kIncompatibleMethodReceiver, |
| 68 | "NAME.prototype.toString", this); |
| 69 | } |
| 70 | var str = "SIMD.NAME("; |
| 71 | str += %NAMEExtractLane(value, 0); |
| 72 | for (var i = 1; i < LANES; i++) { |
| 73 | str += ", " + %NAMEExtractLane(value, i); |
| 74 | } |
| 75 | return str + ")"; |
| 76 | } |
| 77 | |
| 78 | function NAMEToLocaleString() { |
| 79 | var value = %_ValueOf(this); |
| 80 | if (typeof(value) !== 'TYPE') { |
| 81 | throw MakeTypeError(kIncompatibleMethodReceiver, |
| 82 | "NAME.prototype.toLocaleString", this); |
| 83 | } |
| 84 | var str = "SIMD.NAME("; |
| 85 | str += %NAMEExtractLane(value, 0).toLocaleString(); |
| 86 | for (var i = 1; i < LANES; i++) { |
| 87 | str += ", " + %NAMEExtractLane(value, i).toLocaleString(); |
| 88 | } |
| 89 | return str + ")"; |
| 90 | } |
| 91 | |
| 92 | function NAMEValueOf() { |
| 93 | var value = %_ValueOf(this); |
| 94 | if (typeof(value) !== 'TYPE') { |
| 95 | throw MakeTypeError(kIncompatibleMethodReceiver, |
| 96 | "NAME.prototype.valueOf", this); |
| 97 | } |
| 98 | return value; |
| 99 | } |
| 100 | |
| 101 | function NAMEExtractLaneJS(instance, lane) { |
| 102 | return %NAMEExtractLane(instance, lane); |
| 103 | } |
| 104 | endmacro |
| 105 | |
| 106 | SIMD_ALL_TYPES(DECLARE_COMMON_FUNCTIONS) |
| 107 | |
| 108 | macro DECLARE_SHIFT_FUNCTIONS(NAME, TYPE, LANES) |
| 109 | function NAMEShiftLeftByScalarJS(instance, shift) { |
| 110 | return %NAMEShiftLeftByScalar(instance, shift); |
| 111 | } |
| 112 | |
| 113 | function NAMEShiftRightByScalarJS(instance, shift) { |
| 114 | return %NAMEShiftRightByScalar(instance, shift); |
| 115 | } |
| 116 | endmacro |
| 117 | |
| 118 | SIMD_INT_TYPES(DECLARE_SHIFT_FUNCTIONS) |
| 119 | SIMD_UINT_TYPES(DECLARE_SHIFT_FUNCTIONS) |
| 120 | |
| 121 | macro SIMD_SMALL_INT_TYPES(FUNCTION) |
| 122 | FUNCTION(Int16x8) |
| 123 | FUNCTION(Int8x16) |
| 124 | FUNCTION(Uint8x16) |
| 125 | FUNCTION(Uint16x8) |
| 126 | endmacro |
| 127 | |
| 128 | macro DECLARE_SMALL_INT_FUNCTIONS(NAME) |
| 129 | function NAMEAddSaturateJS(a, b) { |
| 130 | return %NAMEAddSaturate(a, b); |
| 131 | } |
| 132 | |
| 133 | function NAMESubSaturateJS(a, b) { |
| 134 | return %NAMESubSaturate(a, b); |
| 135 | } |
| 136 | endmacro |
| 137 | |
| 138 | SIMD_SMALL_INT_TYPES(DECLARE_SMALL_INT_FUNCTIONS) |
| 139 | |
| 140 | macro DECLARE_SIGNED_FUNCTIONS(NAME, TYPE, LANES) |
| 141 | function NAMENegJS(a) { |
| 142 | return %NAMENeg(a); |
| 143 | } |
| 144 | endmacro |
| 145 | |
| 146 | SIMD_FLOAT_TYPES(DECLARE_SIGNED_FUNCTIONS) |
| 147 | SIMD_INT_TYPES(DECLARE_SIGNED_FUNCTIONS) |
| 148 | |
| 149 | macro DECLARE_BOOL_FUNCTIONS(NAME, TYPE, LANES) |
| 150 | function NAMEReplaceLaneJS(instance, lane, value) { |
| 151 | return %NAMEReplaceLane(instance, lane, value); |
| 152 | } |
| 153 | |
| 154 | function NAMEAnyTrueJS(s) { |
| 155 | return %NAMEAnyTrue(s); |
| 156 | } |
| 157 | |
| 158 | function NAMEAllTrueJS(s) { |
| 159 | return %NAMEAllTrue(s); |
| 160 | } |
| 161 | endmacro |
| 162 | |
| 163 | SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS) |
| 164 | |
| 165 | macro SIMD_NUMERIC_TYPES(FUNCTION) |
| 166 | SIMD_FLOAT_TYPES(FUNCTION) |
| 167 | SIMD_INT_TYPES(FUNCTION) |
| 168 | SIMD_UINT_TYPES(FUNCTION) |
| 169 | endmacro |
| 170 | |
| 171 | macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES) |
| 172 | function NAMEReplaceLaneJS(instance, lane, value) { |
| 173 | return %NAMEReplaceLane(instance, lane, TO_NUMBER(value)); |
| 174 | } |
| 175 | |
| 176 | function NAMESelectJS(selector, a, b) { |
| 177 | return %NAMESelect(selector, a, b); |
| 178 | } |
| 179 | |
| 180 | function NAMEAddJS(a, b) { |
| 181 | return %NAMEAdd(a, b); |
| 182 | } |
| 183 | |
| 184 | function NAMESubJS(a, b) { |
| 185 | return %NAMESub(a, b); |
| 186 | } |
| 187 | |
| 188 | function NAMEMulJS(a, b) { |
| 189 | return %NAMEMul(a, b); |
| 190 | } |
| 191 | |
| 192 | function NAMEMinJS(a, b) { |
| 193 | return %NAMEMin(a, b); |
| 194 | } |
| 195 | |
| 196 | function NAMEMaxJS(a, b) { |
| 197 | return %NAMEMax(a, b); |
| 198 | } |
| 199 | |
| 200 | function NAMEEqualJS(a, b) { |
| 201 | return %NAMEEqual(a, b); |
| 202 | } |
| 203 | |
| 204 | function NAMENotEqualJS(a, b) { |
| 205 | return %NAMENotEqual(a, b); |
| 206 | } |
| 207 | |
| 208 | function NAMELessThanJS(a, b) { |
| 209 | return %NAMELessThan(a, b); |
| 210 | } |
| 211 | |
| 212 | function NAMELessThanOrEqualJS(a, b) { |
| 213 | return %NAMELessThanOrEqual(a, b); |
| 214 | } |
| 215 | |
| 216 | function NAMEGreaterThanJS(a, b) { |
| 217 | return %NAMEGreaterThan(a, b); |
| 218 | } |
| 219 | |
| 220 | function NAMEGreaterThanOrEqualJS(a, b) { |
| 221 | return %NAMEGreaterThanOrEqual(a, b); |
| 222 | } |
| 223 | |
| 224 | function NAMELoadJS(tarray, index) { |
| 225 | return %NAMELoad(tarray, index); |
| 226 | } |
| 227 | |
| 228 | function NAMEStoreJS(tarray, index, a) { |
| 229 | return %NAMEStore(tarray, index, a); |
| 230 | } |
| 231 | endmacro |
| 232 | |
| 233 | SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) |
| 234 | |
| 235 | macro SIMD_LOGICAL_TYPES(FUNCTION) |
| 236 | SIMD_INT_TYPES(FUNCTION) |
| 237 | SIMD_UINT_TYPES(FUNCTION) |
| 238 | SIMD_BOOL_TYPES(FUNCTION) |
| 239 | endmacro |
| 240 | |
| 241 | macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES) |
| 242 | function NAMEAndJS(a, b) { |
| 243 | return %NAMEAnd(a, b); |
| 244 | } |
| 245 | |
| 246 | function NAMEOrJS(a, b) { |
| 247 | return %NAMEOr(a, b); |
| 248 | } |
| 249 | |
| 250 | function NAMEXorJS(a, b) { |
| 251 | return %NAMEXor(a, b); |
| 252 | } |
| 253 | |
| 254 | function NAMENotJS(a) { |
| 255 | return %NAMENot(a); |
| 256 | } |
| 257 | endmacro |
| 258 | |
| 259 | SIMD_LOGICAL_TYPES(DECLARE_LOGICAL_FUNCTIONS) |
| 260 | |
| 261 | macro SIMD_FROM_TYPES(FUNCTION) |
| 262 | FUNCTION(Float32x4, Int32x4) |
| 263 | FUNCTION(Float32x4, Uint32x4) |
| 264 | FUNCTION(Int32x4, Float32x4) |
| 265 | FUNCTION(Int32x4, Uint32x4) |
| 266 | FUNCTION(Uint32x4, Float32x4) |
| 267 | FUNCTION(Uint32x4, Int32x4) |
| 268 | FUNCTION(Int16x8, Uint16x8) |
| 269 | FUNCTION(Uint16x8, Int16x8) |
| 270 | FUNCTION(Int8x16, Uint8x16) |
| 271 | FUNCTION(Uint8x16, Int8x16) |
| 272 | endmacro |
| 273 | |
| 274 | macro DECLARE_FROM_FUNCTIONS(TO, FROM) |
| 275 | function TOFromFROMJS(a) { |
| 276 | return %TOFromFROM(a); |
| 277 | } |
| 278 | endmacro |
| 279 | |
| 280 | SIMD_FROM_TYPES(DECLARE_FROM_FUNCTIONS) |
| 281 | |
| 282 | macro SIMD_FROM_BITS_TYPES(FUNCTION) |
| 283 | FUNCTION(Float32x4, Int32x4) |
| 284 | FUNCTION(Float32x4, Uint32x4) |
| 285 | FUNCTION(Float32x4, Int16x8) |
| 286 | FUNCTION(Float32x4, Uint16x8) |
| 287 | FUNCTION(Float32x4, Int8x16) |
| 288 | FUNCTION(Float32x4, Uint8x16) |
| 289 | FUNCTION(Int32x4, Float32x4) |
| 290 | FUNCTION(Int32x4, Uint32x4) |
| 291 | FUNCTION(Int32x4, Int16x8) |
| 292 | FUNCTION(Int32x4, Uint16x8) |
| 293 | FUNCTION(Int32x4, Int8x16) |
| 294 | FUNCTION(Int32x4, Uint8x16) |
| 295 | FUNCTION(Uint32x4, Float32x4) |
| 296 | FUNCTION(Uint32x4, Int32x4) |
| 297 | FUNCTION(Uint32x4, Int16x8) |
| 298 | FUNCTION(Uint32x4, Uint16x8) |
| 299 | FUNCTION(Uint32x4, Int8x16) |
| 300 | FUNCTION(Uint32x4, Uint8x16) |
| 301 | FUNCTION(Int16x8, Float32x4) |
| 302 | FUNCTION(Int16x8, Int32x4) |
| 303 | FUNCTION(Int16x8, Uint32x4) |
| 304 | FUNCTION(Int16x8, Uint16x8) |
| 305 | FUNCTION(Int16x8, Int8x16) |
| 306 | FUNCTION(Int16x8, Uint8x16) |
| 307 | FUNCTION(Uint16x8, Float32x4) |
| 308 | FUNCTION(Uint16x8, Int32x4) |
| 309 | FUNCTION(Uint16x8, Uint32x4) |
| 310 | FUNCTION(Uint16x8, Int16x8) |
| 311 | FUNCTION(Uint16x8, Int8x16) |
| 312 | FUNCTION(Uint16x8, Uint8x16) |
| 313 | FUNCTION(Int8x16, Float32x4) |
| 314 | FUNCTION(Int8x16, Int32x4) |
| 315 | FUNCTION(Int8x16, Uint32x4) |
| 316 | FUNCTION(Int8x16, Int16x8) |
| 317 | FUNCTION(Int8x16, Uint16x8) |
| 318 | FUNCTION(Int8x16, Uint8x16) |
| 319 | FUNCTION(Uint8x16, Float32x4) |
| 320 | FUNCTION(Uint8x16, Int32x4) |
| 321 | FUNCTION(Uint8x16, Uint32x4) |
| 322 | FUNCTION(Uint8x16, Int16x8) |
| 323 | FUNCTION(Uint8x16, Uint16x8) |
| 324 | FUNCTION(Uint8x16, Int8x16) |
| 325 | endmacro |
| 326 | |
| 327 | macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) |
| 328 | function TOFromFROMBitsJS(a) { |
| 329 | return %TOFromFROMBits(a); |
| 330 | } |
| 331 | endmacro |
| 332 | |
| 333 | SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) |
| 334 | |
| 335 | |
| 336 | macro SIMD_LOADN_STOREN_TYPES(FUNCTION) |
| 337 | FUNCTION(Float32x4, 1) |
| 338 | FUNCTION(Float32x4, 2) |
| 339 | FUNCTION(Float32x4, 3) |
| 340 | FUNCTION(Int32x4, 1) |
| 341 | FUNCTION(Int32x4, 2) |
| 342 | FUNCTION(Int32x4, 3) |
| 343 | FUNCTION(Uint32x4, 1) |
| 344 | FUNCTION(Uint32x4, 2) |
| 345 | FUNCTION(Uint32x4, 3) |
| 346 | endmacro |
| 347 | |
| 348 | macro DECLARE_LOADN_STOREN_FUNCTIONS(NAME, COUNT) |
| 349 | function NAMELoadCOUNTJS(tarray, index) { |
| 350 | return %NAMELoadCOUNT(tarray, index); |
| 351 | } |
| 352 | |
| 353 | function NAMEStoreCOUNTJS(tarray, index, a) { |
| 354 | return %NAMEStoreCOUNT(tarray, index, a); |
| 355 | } |
| 356 | endmacro |
| 357 | |
| 358 | SIMD_LOADN_STOREN_TYPES(DECLARE_LOADN_STOREN_FUNCTIONS) |
| 359 | |
| 360 | //------------------------------------------------------------------- |
| 361 | |
| 362 | macro SIMD_X4_TYPES(FUNCTION) |
| 363 | FUNCTION(Float32x4) |
| 364 | FUNCTION(Int32x4) |
| 365 | FUNCTION(Uint32x4) |
| 366 | FUNCTION(Bool32x4) |
| 367 | endmacro |
| 368 | |
| 369 | macro DECLARE_X4_FUNCTIONS(NAME) |
| 370 | function NAMESplat(s) { |
| 371 | return %CreateNAME(s, s, s, s); |
| 372 | } |
| 373 | |
| 374 | function NAMESwizzleJS(a, c0, c1, c2, c3) { |
| 375 | return %NAMESwizzle(a, c0, c1, c2, c3); |
| 376 | } |
| 377 | |
| 378 | function NAMEShuffleJS(a, b, c0, c1, c2, c3) { |
| 379 | return %NAMEShuffle(a, b, c0, c1, c2, c3); |
| 380 | } |
| 381 | endmacro |
| 382 | |
| 383 | SIMD_X4_TYPES(DECLARE_X4_FUNCTIONS) |
| 384 | |
| 385 | macro SIMD_X8_TYPES(FUNCTION) |
| 386 | FUNCTION(Int16x8) |
| 387 | FUNCTION(Uint16x8) |
| 388 | FUNCTION(Bool16x8) |
| 389 | endmacro |
| 390 | |
| 391 | macro DECLARE_X8_FUNCTIONS(NAME) |
| 392 | function NAMESplat(s) { |
| 393 | return %CreateNAME(s, s, s, s, s, s, s, s); |
| 394 | } |
| 395 | |
| 396 | function NAMESwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { |
| 397 | return %NAMESwizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); |
| 398 | } |
| 399 | |
| 400 | function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7) { |
| 401 | return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7); |
| 402 | } |
| 403 | endmacro |
| 404 | |
| 405 | SIMD_X8_TYPES(DECLARE_X8_FUNCTIONS) |
| 406 | |
| 407 | macro SIMD_X16_TYPES(FUNCTION) |
| 408 | FUNCTION(Int8x16) |
| 409 | FUNCTION(Uint8x16) |
| 410 | FUNCTION(Bool8x16) |
| 411 | endmacro |
| 412 | |
| 413 | macro DECLARE_X16_FUNCTIONS(NAME) |
| 414 | function NAMESplat(s) { |
| 415 | return %CreateNAME(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); |
| 416 | } |
| 417 | |
| 418 | function NAMESwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 419 | c12, c13, c14, c15) { |
| 420 | return %NAMESwizzle(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 421 | c12, c13, c14, c15); |
| 422 | } |
| 423 | |
| 424 | function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
| 425 | c11, c12, c13, c14, c15) { |
| 426 | return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
| 427 | c11, c12, c13, c14, c15); |
| 428 | } |
| 429 | endmacro |
| 430 | |
| 431 | SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) |
| 432 | |
| 433 | //------------------------------------------------------------------- |
| 434 | |
| 435 | function Float32x4Constructor(c0, c1, c2, c3) { |
| 436 | if (!IS_UNDEFINED(new.target)) { |
| 437 | throw MakeTypeError(kNotConstructor, "Float32x4"); |
| 438 | } |
| 439 | return %CreateFloat32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
| 440 | TO_NUMBER(c2), TO_NUMBER(c3)); |
| 441 | } |
| 442 | |
| 443 | |
| 444 | function Int32x4Constructor(c0, c1, c2, c3) { |
| 445 | if (!IS_UNDEFINED(new.target)) { |
| 446 | throw MakeTypeError(kNotConstructor, "Int32x4"); |
| 447 | } |
| 448 | return %CreateInt32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
| 449 | TO_NUMBER(c2), TO_NUMBER(c3)); |
| 450 | } |
| 451 | |
| 452 | |
| 453 | function Uint32x4Constructor(c0, c1, c2, c3) { |
| 454 | if (!IS_UNDEFINED(new.target)) { |
| 455 | throw MakeTypeError(kNotConstructor, "Uint32x4"); |
| 456 | } |
| 457 | return %CreateUint32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
| 458 | TO_NUMBER(c2), TO_NUMBER(c3)); |
| 459 | } |
| 460 | |
| 461 | |
| 462 | function Bool32x4Constructor(c0, c1, c2, c3) { |
| 463 | if (!IS_UNDEFINED(new.target)) { |
| 464 | throw MakeTypeError(kNotConstructor, "Bool32x4"); |
| 465 | } |
| 466 | return %CreateBool32x4(c0, c1, c2, c3); |
| 467 | } |
| 468 | |
| 469 | |
| 470 | function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
| 471 | if (!IS_UNDEFINED(new.target)) { |
| 472 | throw MakeTypeError(kNotConstructor, "Int16x8"); |
| 473 | } |
| 474 | return %CreateInt16x8(TO_NUMBER(c0), TO_NUMBER(c1), |
| 475 | TO_NUMBER(c2), TO_NUMBER(c3), |
| 476 | TO_NUMBER(c4), TO_NUMBER(c5), |
| 477 | TO_NUMBER(c6), TO_NUMBER(c7)); |
| 478 | } |
| 479 | |
| 480 | |
| 481 | function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
| 482 | if (!IS_UNDEFINED(new.target)) { |
| 483 | throw MakeTypeError(kNotConstructor, "Uint16x8"); |
| 484 | } |
| 485 | return %CreateUint16x8(TO_NUMBER(c0), TO_NUMBER(c1), |
| 486 | TO_NUMBER(c2), TO_NUMBER(c3), |
| 487 | TO_NUMBER(c4), TO_NUMBER(c5), |
| 488 | TO_NUMBER(c6), TO_NUMBER(c7)); |
| 489 | } |
| 490 | |
| 491 | |
| 492 | function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
| 493 | if (!IS_UNDEFINED(new.target)) { |
| 494 | throw MakeTypeError(kNotConstructor, "Bool16x8"); |
| 495 | } |
| 496 | return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); |
| 497 | } |
| 498 | |
| 499 | |
| 500 | function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 501 | c12, c13, c14, c15) { |
| 502 | if (!IS_UNDEFINED(new.target)) { |
| 503 | throw MakeTypeError(kNotConstructor, "Int8x16"); |
| 504 | } |
| 505 | return %CreateInt8x16(TO_NUMBER(c0), TO_NUMBER(c1), |
| 506 | TO_NUMBER(c2), TO_NUMBER(c3), |
| 507 | TO_NUMBER(c4), TO_NUMBER(c5), |
| 508 | TO_NUMBER(c6), TO_NUMBER(c7), |
| 509 | TO_NUMBER(c8), TO_NUMBER(c9), |
| 510 | TO_NUMBER(c10), TO_NUMBER(c11), |
| 511 | TO_NUMBER(c12), TO_NUMBER(c13), |
| 512 | TO_NUMBER(c14), TO_NUMBER(c15)); |
| 513 | } |
| 514 | |
| 515 | |
| 516 | function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 517 | c12, c13, c14, c15) { |
| 518 | if (!IS_UNDEFINED(new.target)) { |
| 519 | throw MakeTypeError(kNotConstructor, "Uint8x16"); |
| 520 | } |
| 521 | return %CreateUint8x16(TO_NUMBER(c0), TO_NUMBER(c1), |
| 522 | TO_NUMBER(c2), TO_NUMBER(c3), |
| 523 | TO_NUMBER(c4), TO_NUMBER(c5), |
| 524 | TO_NUMBER(c6), TO_NUMBER(c7), |
| 525 | TO_NUMBER(c8), TO_NUMBER(c9), |
| 526 | TO_NUMBER(c10), TO_NUMBER(c11), |
| 527 | TO_NUMBER(c12), TO_NUMBER(c13), |
| 528 | TO_NUMBER(c14), TO_NUMBER(c15)); |
| 529 | } |
| 530 | |
| 531 | |
| 532 | function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 533 | c12, c13, c14, c15) { |
| 534 | if (!IS_UNDEFINED(new.target)) { |
| 535 | throw MakeTypeError(kNotConstructor, "Bool8x16"); |
| 536 | } |
| 537 | return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, |
| 538 | c13, c14, c15); |
| 539 | } |
| 540 | |
| 541 | |
| 542 | function Float32x4AbsJS(a) { |
| 543 | return %Float32x4Abs(a); |
| 544 | } |
| 545 | |
| 546 | |
| 547 | function Float32x4SqrtJS(a) { |
| 548 | return %Float32x4Sqrt(a); |
| 549 | } |
| 550 | |
| 551 | |
| 552 | function Float32x4RecipApproxJS(a) { |
| 553 | return %Float32x4RecipApprox(a); |
| 554 | } |
| 555 | |
| 556 | |
| 557 | function Float32x4RecipSqrtApproxJS(a) { |
| 558 | return %Float32x4RecipSqrtApprox(a); |
| 559 | } |
| 560 | |
| 561 | |
| 562 | function Float32x4DivJS(a, b) { |
| 563 | return %Float32x4Div(a, b); |
| 564 | } |
| 565 | |
| 566 | |
| 567 | function Float32x4MinNumJS(a, b) { |
| 568 | return %Float32x4MinNum(a, b); |
| 569 | } |
| 570 | |
| 571 | |
| 572 | function Float32x4MaxNumJS(a, b) { |
| 573 | return %Float32x4MaxNum(a, b); |
| 574 | } |
| 575 | |
| 576 | |
| 577 | %AddNamedProperty(GlobalSIMD, toStringTagSymbol, 'SIMD', READ_ONLY | DONT_ENUM); |
| 578 | |
| 579 | macro SETUP_SIMD_TYPE(NAME, TYPE, LANES) |
| 580 | %SetCode(GlobalNAME, NAMEConstructor); |
| 581 | %FunctionSetPrototype(GlobalNAME, {}); |
| 582 | %AddNamedProperty(GlobalNAME.prototype, 'constructor', GlobalNAME, |
| 583 | DONT_ENUM); |
| 584 | %AddNamedProperty(GlobalNAME.prototype, toStringTagSymbol, 'NAME', |
| 585 | DONT_ENUM | READ_ONLY); |
| 586 | utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [ |
| 587 | 'toLocaleString', NAMEToLocaleString, |
| 588 | 'toString', NAMEToString, |
| 589 | 'valueOf', NAMEValueOf, |
| 590 | ]); |
| 591 | endmacro |
| 592 | |
| 593 | SIMD_ALL_TYPES(SETUP_SIMD_TYPE) |
| 594 | |
| 595 | //------------------------------------------------------------------- |
| 596 | |
| 597 | utils.InstallFunctions(GlobalFloat32x4, DONT_ENUM, [ |
| 598 | 'splat', Float32x4Splat, |
| 599 | 'check', Float32x4CheckJS, |
| 600 | 'extractLane', Float32x4ExtractLaneJS, |
| 601 | 'replaceLane', Float32x4ReplaceLaneJS, |
| 602 | 'neg', Float32x4NegJS, |
| 603 | 'abs', Float32x4AbsJS, |
| 604 | 'sqrt', Float32x4SqrtJS, |
| 605 | 'reciprocalApproximation', Float32x4RecipApproxJS, |
| 606 | 'reciprocalSqrtApproximation', Float32x4RecipSqrtApproxJS, |
| 607 | 'add', Float32x4AddJS, |
| 608 | 'sub', Float32x4SubJS, |
| 609 | 'mul', Float32x4MulJS, |
| 610 | 'div', Float32x4DivJS, |
| 611 | 'min', Float32x4MinJS, |
| 612 | 'max', Float32x4MaxJS, |
| 613 | 'minNum', Float32x4MinNumJS, |
| 614 | 'maxNum', Float32x4MaxNumJS, |
| 615 | 'lessThan', Float32x4LessThanJS, |
| 616 | 'lessThanOrEqual', Float32x4LessThanOrEqualJS, |
| 617 | 'greaterThan', Float32x4GreaterThanJS, |
| 618 | 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, |
| 619 | 'equal', Float32x4EqualJS, |
| 620 | 'notEqual', Float32x4NotEqualJS, |
| 621 | 'select', Float32x4SelectJS, |
| 622 | 'swizzle', Float32x4SwizzleJS, |
| 623 | 'shuffle', Float32x4ShuffleJS, |
| 624 | 'fromInt32x4', Float32x4FromInt32x4JS, |
| 625 | 'fromUint32x4', Float32x4FromUint32x4JS, |
| 626 | 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, |
| 627 | 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS, |
| 628 | 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, |
| 629 | 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS, |
| 630 | 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, |
| 631 | 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS, |
| 632 | 'load', Float32x4LoadJS, |
| 633 | 'load1', Float32x4Load1JS, |
| 634 | 'load2', Float32x4Load2JS, |
| 635 | 'load3', Float32x4Load3JS, |
| 636 | 'store', Float32x4StoreJS, |
| 637 | 'store1', Float32x4Store1JS, |
| 638 | 'store2', Float32x4Store2JS, |
| 639 | 'store3', Float32x4Store3JS, |
| 640 | ]); |
| 641 | |
| 642 | utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ |
| 643 | 'splat', Int32x4Splat, |
| 644 | 'check', Int32x4CheckJS, |
| 645 | 'extractLane', Int32x4ExtractLaneJS, |
| 646 | 'replaceLane', Int32x4ReplaceLaneJS, |
| 647 | 'neg', Int32x4NegJS, |
| 648 | 'add', Int32x4AddJS, |
| 649 | 'sub', Int32x4SubJS, |
| 650 | 'mul', Int32x4MulJS, |
| 651 | 'min', Int32x4MinJS, |
| 652 | 'max', Int32x4MaxJS, |
| 653 | 'and', Int32x4AndJS, |
| 654 | 'or', Int32x4OrJS, |
| 655 | 'xor', Int32x4XorJS, |
| 656 | 'not', Int32x4NotJS, |
| 657 | 'shiftLeftByScalar', Int32x4ShiftLeftByScalarJS, |
| 658 | 'shiftRightByScalar', Int32x4ShiftRightByScalarJS, |
| 659 | 'lessThan', Int32x4LessThanJS, |
| 660 | 'lessThanOrEqual', Int32x4LessThanOrEqualJS, |
| 661 | 'greaterThan', Int32x4GreaterThanJS, |
| 662 | 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, |
| 663 | 'equal', Int32x4EqualJS, |
| 664 | 'notEqual', Int32x4NotEqualJS, |
| 665 | 'select', Int32x4SelectJS, |
| 666 | 'swizzle', Int32x4SwizzleJS, |
| 667 | 'shuffle', Int32x4ShuffleJS, |
| 668 | 'fromFloat32x4', Int32x4FromFloat32x4JS, |
| 669 | 'fromUint32x4', Int32x4FromUint32x4JS, |
| 670 | 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, |
| 671 | 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS, |
| 672 | 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, |
| 673 | 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS, |
| 674 | 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, |
| 675 | 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS, |
| 676 | 'load', Int32x4LoadJS, |
| 677 | 'load1', Int32x4Load1JS, |
| 678 | 'load2', Int32x4Load2JS, |
| 679 | 'load3', Int32x4Load3JS, |
| 680 | 'store', Int32x4StoreJS, |
| 681 | 'store1', Int32x4Store1JS, |
| 682 | 'store2', Int32x4Store2JS, |
| 683 | 'store3', Int32x4Store3JS, |
| 684 | ]); |
| 685 | |
| 686 | utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [ |
| 687 | 'splat', Uint32x4Splat, |
| 688 | 'check', Uint32x4CheckJS, |
| 689 | 'extractLane', Uint32x4ExtractLaneJS, |
| 690 | 'replaceLane', Uint32x4ReplaceLaneJS, |
| 691 | 'add', Uint32x4AddJS, |
| 692 | 'sub', Uint32x4SubJS, |
| 693 | 'mul', Uint32x4MulJS, |
| 694 | 'min', Uint32x4MinJS, |
| 695 | 'max', Uint32x4MaxJS, |
| 696 | 'and', Uint32x4AndJS, |
| 697 | 'or', Uint32x4OrJS, |
| 698 | 'xor', Uint32x4XorJS, |
| 699 | 'not', Uint32x4NotJS, |
| 700 | 'shiftLeftByScalar', Uint32x4ShiftLeftByScalarJS, |
| 701 | 'shiftRightByScalar', Uint32x4ShiftRightByScalarJS, |
| 702 | 'lessThan', Uint32x4LessThanJS, |
| 703 | 'lessThanOrEqual', Uint32x4LessThanOrEqualJS, |
| 704 | 'greaterThan', Uint32x4GreaterThanJS, |
| 705 | 'greaterThanOrEqual', Uint32x4GreaterThanOrEqualJS, |
| 706 | 'equal', Uint32x4EqualJS, |
| 707 | 'notEqual', Uint32x4NotEqualJS, |
| 708 | 'select', Uint32x4SelectJS, |
| 709 | 'swizzle', Uint32x4SwizzleJS, |
| 710 | 'shuffle', Uint32x4ShuffleJS, |
| 711 | 'fromFloat32x4', Uint32x4FromFloat32x4JS, |
| 712 | 'fromInt32x4', Uint32x4FromInt32x4JS, |
| 713 | 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS, |
| 714 | 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS, |
| 715 | 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS, |
| 716 | 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS, |
| 717 | 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS, |
| 718 | 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS, |
| 719 | 'load', Uint32x4LoadJS, |
| 720 | 'load1', Uint32x4Load1JS, |
| 721 | 'load2', Uint32x4Load2JS, |
| 722 | 'load3', Uint32x4Load3JS, |
| 723 | 'store', Uint32x4StoreJS, |
| 724 | 'store1', Uint32x4Store1JS, |
| 725 | 'store2', Uint32x4Store2JS, |
| 726 | 'store3', Uint32x4Store3JS, |
| 727 | ]); |
| 728 | |
| 729 | utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ |
| 730 | 'splat', Bool32x4Splat, |
| 731 | 'check', Bool32x4CheckJS, |
| 732 | 'extractLane', Bool32x4ExtractLaneJS, |
| 733 | 'replaceLane', Bool32x4ReplaceLaneJS, |
| 734 | 'and', Bool32x4AndJS, |
| 735 | 'or', Bool32x4OrJS, |
| 736 | 'xor', Bool32x4XorJS, |
| 737 | 'not', Bool32x4NotJS, |
| 738 | 'anyTrue', Bool32x4AnyTrueJS, |
| 739 | 'allTrue', Bool32x4AllTrueJS, |
| 740 | 'swizzle', Bool32x4SwizzleJS, |
| 741 | 'shuffle', Bool32x4ShuffleJS, |
| 742 | ]); |
| 743 | |
| 744 | utils.InstallFunctions(GlobalInt16x8, DONT_ENUM, [ |
| 745 | 'splat', Int16x8Splat, |
| 746 | 'check', Int16x8CheckJS, |
| 747 | 'extractLane', Int16x8ExtractLaneJS, |
| 748 | 'replaceLane', Int16x8ReplaceLaneJS, |
| 749 | 'neg', Int16x8NegJS, |
| 750 | 'add', Int16x8AddJS, |
| 751 | 'sub', Int16x8SubJS, |
| 752 | 'addSaturate', Int16x8AddSaturateJS, |
| 753 | 'subSaturate', Int16x8SubSaturateJS, |
| 754 | 'mul', Int16x8MulJS, |
| 755 | 'min', Int16x8MinJS, |
| 756 | 'max', Int16x8MaxJS, |
| 757 | 'and', Int16x8AndJS, |
| 758 | 'or', Int16x8OrJS, |
| 759 | 'xor', Int16x8XorJS, |
| 760 | 'not', Int16x8NotJS, |
| 761 | 'shiftLeftByScalar', Int16x8ShiftLeftByScalarJS, |
| 762 | 'shiftRightByScalar', Int16x8ShiftRightByScalarJS, |
| 763 | 'lessThan', Int16x8LessThanJS, |
| 764 | 'lessThanOrEqual', Int16x8LessThanOrEqualJS, |
| 765 | 'greaterThan', Int16x8GreaterThanJS, |
| 766 | 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, |
| 767 | 'equal', Int16x8EqualJS, |
| 768 | 'notEqual', Int16x8NotEqualJS, |
| 769 | 'select', Int16x8SelectJS, |
| 770 | 'swizzle', Int16x8SwizzleJS, |
| 771 | 'shuffle', Int16x8ShuffleJS, |
| 772 | 'fromUint16x8', Int16x8FromUint16x8JS, |
| 773 | 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, |
| 774 | 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, |
| 775 | 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS, |
| 776 | 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS, |
| 777 | 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, |
| 778 | 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS, |
| 779 | 'load', Int16x8LoadJS, |
| 780 | 'store', Int16x8StoreJS, |
| 781 | ]); |
| 782 | |
| 783 | utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [ |
| 784 | 'splat', Uint16x8Splat, |
| 785 | 'check', Uint16x8CheckJS, |
| 786 | 'extractLane', Uint16x8ExtractLaneJS, |
| 787 | 'replaceLane', Uint16x8ReplaceLaneJS, |
| 788 | 'add', Uint16x8AddJS, |
| 789 | 'sub', Uint16x8SubJS, |
| 790 | 'addSaturate', Uint16x8AddSaturateJS, |
| 791 | 'subSaturate', Uint16x8SubSaturateJS, |
| 792 | 'mul', Uint16x8MulJS, |
| 793 | 'min', Uint16x8MinJS, |
| 794 | 'max', Uint16x8MaxJS, |
| 795 | 'and', Uint16x8AndJS, |
| 796 | 'or', Uint16x8OrJS, |
| 797 | 'xor', Uint16x8XorJS, |
| 798 | 'not', Uint16x8NotJS, |
| 799 | 'shiftLeftByScalar', Uint16x8ShiftLeftByScalarJS, |
| 800 | 'shiftRightByScalar', Uint16x8ShiftRightByScalarJS, |
| 801 | 'lessThan', Uint16x8LessThanJS, |
| 802 | 'lessThanOrEqual', Uint16x8LessThanOrEqualJS, |
| 803 | 'greaterThan', Uint16x8GreaterThanJS, |
| 804 | 'greaterThanOrEqual', Uint16x8GreaterThanOrEqualJS, |
| 805 | 'equal', Uint16x8EqualJS, |
| 806 | 'notEqual', Uint16x8NotEqualJS, |
| 807 | 'select', Uint16x8SelectJS, |
| 808 | 'swizzle', Uint16x8SwizzleJS, |
| 809 | 'shuffle', Uint16x8ShuffleJS, |
| 810 | 'fromInt16x8', Uint16x8FromInt16x8JS, |
| 811 | 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS, |
| 812 | 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS, |
| 813 | 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS, |
| 814 | 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS, |
| 815 | 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS, |
| 816 | 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS, |
| 817 | 'load', Uint16x8LoadJS, |
| 818 | 'store', Uint16x8StoreJS, |
| 819 | ]); |
| 820 | |
| 821 | utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ |
| 822 | 'splat', Bool16x8Splat, |
| 823 | 'check', Bool16x8CheckJS, |
| 824 | 'extractLane', Bool16x8ExtractLaneJS, |
| 825 | 'replaceLane', Bool16x8ReplaceLaneJS, |
| 826 | 'and', Bool16x8AndJS, |
| 827 | 'or', Bool16x8OrJS, |
| 828 | 'xor', Bool16x8XorJS, |
| 829 | 'not', Bool16x8NotJS, |
| 830 | 'anyTrue', Bool16x8AnyTrueJS, |
| 831 | 'allTrue', Bool16x8AllTrueJS, |
| 832 | 'swizzle', Bool16x8SwizzleJS, |
| 833 | 'shuffle', Bool16x8ShuffleJS, |
| 834 | ]); |
| 835 | |
| 836 | utils.InstallFunctions(GlobalInt8x16, DONT_ENUM, [ |
| 837 | 'splat', Int8x16Splat, |
| 838 | 'check', Int8x16CheckJS, |
| 839 | 'extractLane', Int8x16ExtractLaneJS, |
| 840 | 'replaceLane', Int8x16ReplaceLaneJS, |
| 841 | 'neg', Int8x16NegJS, |
| 842 | 'add', Int8x16AddJS, |
| 843 | 'sub', Int8x16SubJS, |
| 844 | 'addSaturate', Int8x16AddSaturateJS, |
| 845 | 'subSaturate', Int8x16SubSaturateJS, |
| 846 | 'mul', Int8x16MulJS, |
| 847 | 'min', Int8x16MinJS, |
| 848 | 'max', Int8x16MaxJS, |
| 849 | 'and', Int8x16AndJS, |
| 850 | 'or', Int8x16OrJS, |
| 851 | 'xor', Int8x16XorJS, |
| 852 | 'not', Int8x16NotJS, |
| 853 | 'shiftLeftByScalar', Int8x16ShiftLeftByScalarJS, |
| 854 | 'shiftRightByScalar', Int8x16ShiftRightByScalarJS, |
| 855 | 'lessThan', Int8x16LessThanJS, |
| 856 | 'lessThanOrEqual', Int8x16LessThanOrEqualJS, |
| 857 | 'greaterThan', Int8x16GreaterThanJS, |
| 858 | 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, |
| 859 | 'equal', Int8x16EqualJS, |
| 860 | 'notEqual', Int8x16NotEqualJS, |
| 861 | 'select', Int8x16SelectJS, |
| 862 | 'swizzle', Int8x16SwizzleJS, |
| 863 | 'shuffle', Int8x16ShuffleJS, |
| 864 | 'fromUint8x16', Int8x16FromUint8x16JS, |
| 865 | 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, |
| 866 | 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, |
| 867 | 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS, |
| 868 | 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, |
| 869 | 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS, |
| 870 | 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS, |
| 871 | 'load', Int8x16LoadJS, |
| 872 | 'store', Int8x16StoreJS, |
| 873 | ]); |
| 874 | |
| 875 | utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [ |
| 876 | 'splat', Uint8x16Splat, |
| 877 | 'check', Uint8x16CheckJS, |
| 878 | 'extractLane', Uint8x16ExtractLaneJS, |
| 879 | 'replaceLane', Uint8x16ReplaceLaneJS, |
| 880 | 'add', Uint8x16AddJS, |
| 881 | 'sub', Uint8x16SubJS, |
| 882 | 'addSaturate', Uint8x16AddSaturateJS, |
| 883 | 'subSaturate', Uint8x16SubSaturateJS, |
| 884 | 'mul', Uint8x16MulJS, |
| 885 | 'min', Uint8x16MinJS, |
| 886 | 'max', Uint8x16MaxJS, |
| 887 | 'and', Uint8x16AndJS, |
| 888 | 'or', Uint8x16OrJS, |
| 889 | 'xor', Uint8x16XorJS, |
| 890 | 'not', Uint8x16NotJS, |
| 891 | 'shiftLeftByScalar', Uint8x16ShiftLeftByScalarJS, |
| 892 | 'shiftRightByScalar', Uint8x16ShiftRightByScalarJS, |
| 893 | 'lessThan', Uint8x16LessThanJS, |
| 894 | 'lessThanOrEqual', Uint8x16LessThanOrEqualJS, |
| 895 | 'greaterThan', Uint8x16GreaterThanJS, |
| 896 | 'greaterThanOrEqual', Uint8x16GreaterThanOrEqualJS, |
| 897 | 'equal', Uint8x16EqualJS, |
| 898 | 'notEqual', Uint8x16NotEqualJS, |
| 899 | 'select', Uint8x16SelectJS, |
| 900 | 'swizzle', Uint8x16SwizzleJS, |
| 901 | 'shuffle', Uint8x16ShuffleJS, |
| 902 | 'fromInt8x16', Uint8x16FromInt8x16JS, |
| 903 | 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS, |
| 904 | 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS, |
| 905 | 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS, |
| 906 | 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS, |
| 907 | 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS, |
| 908 | 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS, |
| 909 | 'load', Uint8x16LoadJS, |
| 910 | 'store', Uint8x16StoreJS, |
| 911 | ]); |
| 912 | |
| 913 | utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ |
| 914 | 'splat', Bool8x16Splat, |
| 915 | 'check', Bool8x16CheckJS, |
| 916 | 'extractLane', Bool8x16ExtractLaneJS, |
| 917 | 'replaceLane', Bool8x16ReplaceLaneJS, |
| 918 | 'and', Bool8x16AndJS, |
| 919 | 'or', Bool8x16OrJS, |
| 920 | 'xor', Bool8x16XorJS, |
| 921 | 'not', Bool8x16NotJS, |
| 922 | 'anyTrue', Bool8x16AnyTrueJS, |
| 923 | 'allTrue', Bool8x16AllTrueJS, |
| 924 | 'swizzle', Bool8x16SwizzleJS, |
| 925 | 'shuffle', Bool8x16ShuffleJS, |
| 926 | ]); |
| 927 | |
| 928 | utils.Export(function(to) { |
| 929 | to.Float32x4ToString = Float32x4ToString; |
| 930 | to.Int32x4ToString = Int32x4ToString; |
| 931 | to.Uint32x4ToString = Uint32x4ToString; |
| 932 | to.Bool32x4ToString = Bool32x4ToString; |
| 933 | to.Int16x8ToString = Int16x8ToString; |
| 934 | to.Uint16x8ToString = Uint16x8ToString; |
| 935 | to.Bool16x8ToString = Bool16x8ToString; |
| 936 | to.Int8x16ToString = Int8x16ToString; |
| 937 | to.Uint8x16ToString = Uint8x16ToString; |
| 938 | to.Bool8x16ToString = Bool8x16ToString; |
| 939 | }); |
| 940 | |
| 941 | }) |