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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 90643003: Experimental implementation: Exposing SIMD instructions into JavaScript Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 stream->Add(" length "); 348 stream->Add(" length ");
349 length()->PrintTo(stream); 349 length()->PrintTo(stream);
350 350
351 stream->Add(" index "); 351 stream->Add(" index ");
352 index()->PrintTo(stream); 352 index()->PrintTo(stream);
353 } 353 }
354 354
355 355
356 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) { 356 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) {
357 switch (kind) {
358 case GENERAL_REGISTERS: return spill_slot_count_++;
359 case DOUBLE_REGISTERS: return spill_slot_count_++;
360 case FLOAT32x4_REGISTERS:
361 case INT32x4_REGISTERS: {
362 spill_slot_count_++;
363 return spill_slot_count_++;
364 }
365 default:
366 UNREACHABLE();
367 return -1;
368 }
369
357 return spill_slot_count_++; 370 return spill_slot_count_++;
358 } 371 }
359 372
360 373
361 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) { 374 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
362 // All stack slots are Double stack slots on x64. 375 // All stack slots are Double stack slots on x64.
363 // Alternatively, at some point, start using half-size 376 // Alternatively, at some point, start using half-size
364 // stack slots for int32 values. 377 // stack slots for int32 values.
365 int index = GetNextSpillIndex(kind); 378 int index = GetNextSpillIndex(kind);
366 if (kind == DOUBLE_REGISTERS) { 379 switch (kind) {
367 return LDoubleStackSlot::Create(index, zone()); 380 case GENERAL_REGISTERS: return LStackSlot::Create(index, zone());
368 } else { 381 case DOUBLE_REGISTERS: return LDoubleStackSlot::Create(index, zone());
369 ASSERT(kind == GENERAL_REGISTERS); 382 case FLOAT32x4_REGISTERS: return LFloat32x4StackSlot::Create(index, zone());
370 return LStackSlot::Create(index, zone()); 383 case INT32x4_REGISTERS: return LInt32x4StackSlot::Create(index, zone());
384 default:
385 UNREACHABLE();
386 return NULL;
371 } 387 }
372 } 388 }
373 389
374 390
375 void LStoreNamedField::PrintDataTo(StringStream* stream) { 391 void LStoreNamedField::PrintDataTo(StringStream* stream) {
376 object()->PrintTo(stream); 392 object()->PrintTo(stream);
377 hydrogen()->access().PrintTo(stream); 393 hydrogen()->access().PrintTo(stream);
378 stream->Add(" <- "); 394 stream->Add(" <- ");
379 value()->PrintTo(stream); 395 value()->PrintTo(stream);
380 } 396 }
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } 1285 }
1270 1286
1271 1287
1272 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { 1288 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
1273 LOperand* input = UseRegisterAtStart(instr->value()); 1289 LOperand* input = UseRegisterAtStart(instr->value());
1274 LMathPowHalf* result = new(zone()) LMathPowHalf(input); 1290 LMathPowHalf* result = new(zone()) LMathPowHalf(input);
1275 return DefineSameAsFirst(result); 1291 return DefineSameAsFirst(result);
1276 } 1292 }
1277 1293
1278 1294
1295 const char* LNullarySIMDOperation::Mnemonic() const {
1296 switch (op()) {
1297 case kFloat32x4Zero: return "float32x4-zero";
1298 default:
1299 UNREACHABLE();
1300 return NULL;
1301 }
1302 }
1303
1304
1305 LInstruction* LChunkBuilder::DoNullarySIMDOperation(
1306 HNullarySIMDOperation* instr) {
1307 LNullarySIMDOperation* result =
1308 new(zone()) LNullarySIMDOperation(instr->op());
1309 switch (instr->op()) {
1310 case kFloat32x4Zero:
1311 return DefineAsRegister(result);
1312 default:
1313 UNREACHABLE();
1314 return NULL;
1315 }
1316 }
1317
1318
1319 const char* LUnarySIMDOperation::Mnemonic() const {
1320 switch (op()) {
1321 case kFloat32x4OrInt32x4Change: return "float32x4_int32x4-change";
1322 case kSIMDAbs: return "simd-abs";
1323 case kSIMDNeg: return "simd-neg";
1324 case kSIMDNegU32: return "simd-negu32";
1325 case kSIMDReciprocal: return "simd-reciprocal";
1326 case kSIMDReciprocalSqrt: return "simd-reciprocalSqrt";
1327 case kSIMDSqrt: return "simd-sqrt";
1328 case kSIMDBitsToFloat32x4: return "simd-bitsToFloat32x4";
1329 case kSIMDToFloat32x4: return "simd-toFloat32x4";
1330 case kSIMDBitsToInt32x4: return "simd-bitsToInt32x4";
1331 case kSIMDToInt32x4: return "simd-toInt32x4";
1332 case kFloat32x4Splat: return "float32x4-splat";
1333 case kInt32x4Splat: return "int32x4-splat";
1334 case kFloat32x4SignMask: return "float32x4-signMask";
1335 case kFloat32x4X: return "float32x4-x";
1336 case kFloat32x4Y: return "float32x4-y";
1337 case kFloat32x4Z: return "float32x4-z";
1338 case kFloat32x4W: return "float32x4-w";
1339 case kInt32x4SignMask: return "int32x4-signMask";
1340 case kInt32x4X: return "int32x4-x";
1341 case kInt32x4Y: return "int32x4-y";
1342 case kInt32x4Z: return "int32x4-z";
1343 case kInt32x4W: return "int32x4-w";
1344 case kInt32x4FlagX: return "int32x4-flagX";
1345 case kInt32x4FlagY: return "int32x4-flagY";
1346 case kInt32x4FlagZ: return "int32x4-flagZ";
1347 case kInt32x4FlagW: return "int32x4-flagW";
1348 default:
1349 UNREACHABLE();
1350 return NULL;
1351 }
1352 }
1353
1354
1355 LInstruction* LChunkBuilder::DoUnarySIMDOperation(HUnarySIMDOperation* instr) {
1356 LOperand* input = UseRegisterAtStart(instr->value());
1357 LUnarySIMDOperation* result =
1358 new(zone()) LUnarySIMDOperation(input, instr->op());
1359 switch (instr->op()) {
1360 case kFloat32x4OrInt32x4Change:
1361 return AssignEnvironment(DefineAsRegister(result));
1362 case kSIMDAbs:
1363 case kSIMDNeg:
1364 case kSIMDNegU32:
1365 case kSIMDReciprocal:
1366 case kSIMDReciprocalSqrt:
1367 case kSIMDSqrt:
1368 return DefineSameAsFirst(result);
1369 case kSIMDBitsToFloat32x4:
1370 case kSIMDToFloat32x4:
1371 case kSIMDBitsToInt32x4:
1372 case kSIMDToInt32x4:
1373 case kFloat32x4Splat:
1374 case kInt32x4Splat:
1375 case kFloat32x4SignMask:
1376 case kFloat32x4X:
1377 case kFloat32x4Y:
1378 case kFloat32x4Z:
1379 case kFloat32x4W:
1380 case kInt32x4SignMask:
1381 case kInt32x4X:
1382 case kInt32x4Y:
1383 case kInt32x4Z:
1384 case kInt32x4W:
1385 case kInt32x4FlagX:
1386 case kInt32x4FlagY:
1387 case kInt32x4FlagZ:
1388 case kInt32x4FlagW:
1389 return DefineAsRegister(result);
1390 default:
1391 UNREACHABLE();
1392 return NULL;
1393 }
1394 }
1395
1396
1397 const char* LBinarySIMDOperation::Mnemonic() const {
1398 switch (op()) {
1399 case kSIMDAdd: return "simd-add";
1400 case kSIMDSub: return "simd-sub";
1401 case kSIMDMul: return "simd-mul";
1402 case kSIMDDiv: return "simd-mul";
1403 case kSIMDMin: return "simd-min";
1404 case kSIMDMax: return "simd-max";
1405 case kSIMDScale: return "simd-scale";
1406 case kSIMDAnd: return "simd-and";
1407 case kSIMDOr: return "simd-or";
1408 case kSIMDXor: return "simd-xor";
1409 case kSIMDAddU32: return "simd-addu32";
1410 case kSIMDSubU32: return "simd-subu32";
1411 case kSIMDMulU32: return "simd-mulu32";
1412 case kSIMDShuffle: return "simd-shuffle";
1413 case kSIMDShuffleU32: return "simd-shuffleu32";
1414 case kSIMDLessThan: return "simd-lessThan";
1415 case kSIMDLessThanOrEqual: return "simd-lessThanOrEqual";
1416 case kSIMDEqual: return "simd-equal";
1417 case kSIMDNotEqual: return "simd-notEqual";
1418 case kSIMDGreaterThanOrEqual: return "simd-greaterThanOrEqual";
1419 case kSIMDGreaterThan: return "simd-greaterThan";
1420 case kSIMDWithX: return "simd-withX";
1421 case kSIMDWithY: return "simd-withY";
1422 case kSIMDWithZ: return "simd-withZ";
1423 case kSIMDWithW: return "simd-withW";
1424 case kSIMDWithXu32: return "simd-withXu32";
1425 case kSIMDWithYu32: return "simd-withYu32";
1426 case kSIMDWithZu32: return "simd-withZu32";
1427 case kSIMDWithWu32: return "simd-withWu32";
1428 case kSIMDWithFlagX: return "simd-withFlagX";
1429 case kSIMDWithFlagY: return "simd-withFlagY";
1430 case kSIMDWithFlagZ: return "simd-withFlagZ";
1431 case kSIMDWithFlagW: return "simd-withFlagW";
1432 default:
1433 UNREACHABLE();
1434 return NULL;
1435 }
1436 }
1437
1438
1439 LInstruction* LChunkBuilder::DoBinarySIMDOperation(
1440 HBinarySIMDOperation* instr) {
1441 switch (instr->op()) {
1442 case kSIMDAdd:
1443 case kSIMDSub:
1444 case kSIMDMul:
1445 case kSIMDDiv:
1446 case kSIMDMin:
1447 case kSIMDMax:
1448 case kSIMDScale:
1449 case kSIMDAnd:
1450 case kSIMDOr:
1451 case kSIMDXor:
1452 case kSIMDAddU32:
1453 case kSIMDSubU32:
1454 case kSIMDMulU32:
1455 case kSIMDWithX:
1456 case kSIMDWithY:
1457 case kSIMDWithZ:
1458 case kSIMDWithW:
1459 case kSIMDWithXu32:
1460 case kSIMDWithYu32:
1461 case kSIMDWithZu32:
1462 case kSIMDWithWu32:
1463 case kSIMDWithFlagX:
1464 case kSIMDWithFlagY:
1465 case kSIMDWithFlagZ:
1466 case kSIMDWithFlagW: {
1467 LOperand* left = UseRegisterAtStart(instr->left());
1468 LOperand* right = UseRegisterAtStart(instr->right());
1469 LBinarySIMDOperation* result =
1470 new(zone()) LBinarySIMDOperation(left, right, instr->op());
1471 if (instr->op() == kSIMDWithFlagX || instr->op() == kSIMDWithFlagY ||
1472 instr->op() == kSIMDWithFlagZ || instr->op() == kSIMDWithFlagW) {
1473 return AssignEnvironment(DefineSameAsFirst(result));
1474 } else {
1475 return DefineSameAsFirst(result);
1476 }
1477 }
1478 case kSIMDShuffle:
1479 case kSIMDShuffleU32: {
1480 LOperand* left = UseRegisterAtStart(instr->left());
1481 LOperand* right = UseOrConstant(instr->right());
1482 LBinarySIMDOperation* result =
1483 new(zone()) LBinarySIMDOperation(left, right, instr->op());
1484 return AssignEnvironment(DefineSameAsFirst(result));
1485 }
1486 case kSIMDLessThan:
1487 case kSIMDLessThanOrEqual:
1488 case kSIMDEqual:
1489 case kSIMDNotEqual:
1490 case kSIMDGreaterThanOrEqual:
1491 case kSIMDGreaterThan: {
1492 LOperand* left = UseRegisterAtStart(instr->left());
1493 LOperand* right = UseRegisterAtStart(instr->right());
1494 LBinarySIMDOperation* result =
1495 new(zone()) LBinarySIMDOperation(left, right, instr->op());
1496 return DefineAsRegister(result);
1497 }
1498 default:
1499 UNREACHABLE();
1500 return NULL;
1501 }
1502 }
1503
1504
1505 const char* LTernarySIMDOperation::Mnemonic() const {
1506 switch (op()) {
1507 case kSIMDSelect: return "simd-select";
1508 case kSIMDShuffleMix: return "simd-shuffleMix";
1509 case kSIMDClamp: return "simd-clamp";
1510 default:
1511 UNREACHABLE();
1512 return NULL;
1513 }
1514 }
1515
1516
1517 LInstruction* LChunkBuilder::DoTernarySIMDOperation(
1518 HTernarySIMDOperation* instr) {
1519 LOperand* first = UseRegisterAtStart(instr->first());
1520 LOperand* second = UseRegisterAtStart(instr->second());
1521 LOperand* third = instr->op() == kSIMDShuffleMix
1522 ? UseOrConstant(instr->third())
1523 : UseRegisterAtStart(instr->third());
1524 LTernarySIMDOperation* result =
1525 new(zone()) LTernarySIMDOperation(first, second, third, instr->op());
1526 switch (instr->op()) {
1527 case kSIMDSelect: {
1528 return DefineAsRegister(result);
1529 }
1530 case kSIMDShuffleMix: {
1531 return AssignEnvironment(DefineSameAsFirst(result));
1532 }
1533 case kSIMDClamp: {
1534 return DefineSameAsFirst(result);
1535 }
1536 default:
1537 UNREACHABLE();
1538 return NULL;
1539 }
1540 }
1541
1542
1543 const char* LQuarternarySIMDOperation::Mnemonic() const {
1544 switch (op()) {
1545 case kFloat32x4Constructor: return "float32x4-constructor";
1546 case kInt32x4Constructor: return "int32x4-constructor";
1547 case kInt32x4Bool: return "int32x4-bool";
1548 default:
1549 UNREACHABLE();
1550 return NULL;
1551 }
1552 }
1553
1554
1555 LInstruction* LChunkBuilder::DoQuarternarySIMDOperation(
1556 HQuarternarySIMDOperation* instr) {
1557 LOperand* x = UseRegisterAtStart(instr->x());
1558 LOperand* y = UseRegisterAtStart(instr->y());
1559 LOperand* z = UseRegisterAtStart(instr->z());
1560 LOperand* w = UseRegisterAtStart(instr->w());
1561 LQuarternarySIMDOperation* result =
1562 new(zone()) LQuarternarySIMDOperation(x, y, z, w, instr->op());
1563 if (instr->op() == kInt32x4Bool) {
1564 return AssignEnvironment(DefineAsRegister(result));
1565 } else {
1566 return DefineAsRegister(result);
1567 }
1568 }
1569
1570
1279 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { 1571 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1280 ASSERT(instr->key()->representation().IsTagged()); 1572 ASSERT(instr->key()->representation().IsTagged());
1281 LOperand* context = UseFixed(instr->context(), rsi); 1573 LOperand* context = UseFixed(instr->context(), rsi);
1282 LOperand* key = UseFixed(instr->key(), rcx); 1574 LOperand* key = UseFixed(instr->key(), rcx);
1283 LCallKeyed* result = new(zone()) LCallKeyed(context, key); 1575 LCallKeyed* result = new(zone()) LCallKeyed(context, key);
1284 return MarkAsCall(DefineFixed(result, rax), instr); 1576 return MarkAsCall(DefineFixed(result, rax), instr);
1285 } 1577 }
1286 1578
1287 1579
1288 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { 1580 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 from = Representation::Tagged(); 2153 from = Representation::Tagged();
1862 } 2154 }
1863 // Only mark conversions that might need to allocate as calling rather than 2155 // Only mark conversions that might need to allocate as calling rather than
1864 // all changes. This makes simple, non-allocating conversion not have to force 2156 // all changes. This makes simple, non-allocating conversion not have to force
1865 // building a stack frame. 2157 // building a stack frame.
1866 if (from.IsTagged()) { 2158 if (from.IsTagged()) {
1867 if (to.IsDouble()) { 2159 if (to.IsDouble()) {
1868 LOperand* value = UseRegister(instr->value()); 2160 LOperand* value = UseRegister(instr->value());
1869 LNumberUntagD* res = new(zone()) LNumberUntagD(value); 2161 LNumberUntagD* res = new(zone()) LNumberUntagD(value);
1870 return AssignEnvironment(DefineAsRegister(res)); 2162 return AssignEnvironment(DefineAsRegister(res));
2163 } else if (to.IsFloat32x4()) {
2164 LOperand* value = UseRegister(instr->value());
2165 LTaggedToFloat32x4* res = new(zone()) LTaggedToFloat32x4(value);
2166 return AssignEnvironment(DefineAsRegister(res));
2167 } else if (to.IsInt32x4()) {
2168 LOperand* value = UseRegister(instr->value());
2169 LTaggedToInt32x4* res = new(zone()) LTaggedToInt32x4(value);
2170 return AssignEnvironment(DefineAsRegister(res));
1871 } else if (to.IsSmi()) { 2171 } else if (to.IsSmi()) {
1872 HValue* val = instr->value(); 2172 HValue* val = instr->value();
1873 LOperand* value = UseRegister(val); 2173 LOperand* value = UseRegister(val);
1874 if (val->type().IsSmi()) { 2174 if (val->type().IsSmi()) {
1875 return DefineSameAsFirst(new(zone()) LDummyUse(value)); 2175 return DefineSameAsFirst(new(zone()) LDummyUse(value));
1876 } 2176 }
1877 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 2177 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
1878 } else { 2178 } else {
1879 ASSERT(to.IsInteger32()); 2179 ASSERT(to.IsInteger32());
1880 HValue* val = instr->value(); 2180 HValue* val = instr->value();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 if (instr->value()->CheckFlag(HInstruction::kUint32)) { 2244 if (instr->value()->CheckFlag(HInstruction::kUint32)) {
1945 LOperand* temp = FixedTemp(xmm1); 2245 LOperand* temp = FixedTemp(xmm1);
1946 return DefineAsRegister( 2246 return DefineAsRegister(
1947 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); 2247 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp));
1948 } else { 2248 } else {
1949 ASSERT(to.IsDouble()); 2249 ASSERT(to.IsDouble());
1950 LOperand* value = Use(instr->value()); 2250 LOperand* value = Use(instr->value());
1951 return DefineAsRegister(new(zone()) LInteger32ToDouble(value)); 2251 return DefineAsRegister(new(zone()) LInteger32ToDouble(value));
1952 } 2252 }
1953 } 2253 }
2254 } else if (from.IsFloat32x4()) {
2255 ASSERT(to.IsTagged());
2256 info()->MarkAsDeferredCalling();
2257 LOperand* value = UseRegister(instr->value());
2258 LOperand* temp = TempRegister();
2259
2260 // Make sure that temp and result_temp are different registers.
2261 LUnallocated* result_temp = TempRegister();
2262 LFloat32x4ToTagged* result = new(zone()) LFloat32x4ToTagged(value, temp);
2263 return AssignPointerMap(Define(result, result_temp));
2264 } else if (from.IsInt32x4()) {
2265 ASSERT(to.IsTagged());
2266 info()->MarkAsDeferredCalling();
2267 LOperand* value = UseRegister(instr->value());
2268 LOperand* temp = TempRegister();
2269
2270 // Make sure that temp and result_temp are different registers.
2271 LUnallocated* result_temp = TempRegister();
2272 LInt32x4ToTagged* result = new(zone()) LInt32x4ToTagged(value, temp);
2273 return AssignPointerMap(Define(result, result_temp));
1954 } 2274 }
1955 UNREACHABLE(); 2275 UNREACHABLE();
1956 return NULL; 2276 return NULL;
1957 } 2277 }
1958 2278
1959 2279
1960 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { 2280 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) {
1961 LOperand* value = UseRegisterAtStart(instr->value()); 2281 LOperand* value = UseRegisterAtStart(instr->value());
1962 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); 2282 return AssignEnvironment(new(zone()) LCheckNonSmi(value));
1963 } 2283 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2476 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2157 LLoadKeyed* result = NULL; 2477 LLoadKeyed* result = NULL;
2158 2478
2159 if (!instr->is_external()) { 2479 if (!instr->is_external()) {
2160 LOperand* obj = UseRegisterAtStart(instr->elements()); 2480 LOperand* obj = UseRegisterAtStart(instr->elements());
2161 result = new(zone()) LLoadKeyed(obj, key); 2481 result = new(zone()) LLoadKeyed(obj, key);
2162 } else { 2482 } else {
2163 ASSERT( 2483 ASSERT(
2164 (instr->representation().IsInteger32() && 2484 (instr->representation().IsInteger32() &&
2165 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 2485 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
2486 (elements_kind != EXTERNAL_FLOAT32x4_ELEMENTS) &&
2487 (elements_kind != EXTERNAL_INT32x4_ELEMENTS) &&
2166 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || 2488 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
2167 (instr->representation().IsDouble() && 2489 (instr->representation().IsDouble() &&
2168 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 2490 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
2169 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 2491 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))) ||
2492 (instr->representation().IsFloat32x4() &&
2493 elements_kind == EXTERNAL_FLOAT32x4_ELEMENTS) ||
2494 (instr->representation().IsInt32x4() &&
2495 elements_kind == EXTERNAL_INT32x4_ELEMENTS));
2170 LOperand* external_pointer = UseRegister(instr->elements()); 2496 LOperand* external_pointer = UseRegister(instr->elements());
2171 result = new(zone()) LLoadKeyed(external_pointer, key); 2497 result = new(zone()) LLoadKeyed(external_pointer, key);
2172 } 2498 }
2173 2499
2174 DefineAsRegister(result); 2500 DefineAsRegister(result);
2175 bool can_deoptimize = instr->RequiresHoleCheck() || 2501 bool can_deoptimize = instr->RequiresHoleCheck() ||
2176 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); 2502 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS);
2177 // An unsigned int array load might overflow and cause a deopt, make sure it 2503 // An unsigned int array load might overflow and cause a deopt, make sure it
2178 // has an environment. 2504 // has an environment.
2179 return can_deoptimize ? AssignEnvironment(result) : result; 2505 return can_deoptimize ? AssignEnvironment(result) : result;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 key = UseRegisterOrConstantAtStart(instr->key()); 2542 key = UseRegisterOrConstantAtStart(instr->key());
2217 } 2543 }
2218 } 2544 }
2219 2545
2220 return new(zone()) LStoreKeyed(object, key, val); 2546 return new(zone()) LStoreKeyed(object, key, val);
2221 } 2547 }
2222 2548
2223 ASSERT( 2549 ASSERT(
2224 (instr->value()->representation().IsInteger32() && 2550 (instr->value()->representation().IsInteger32() &&
2225 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 2551 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
2226 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || 2552 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS) &&
2553 (elements_kind != EXTERNAL_FLOAT32x4_ELEMENTS) &&
2554 (elements_kind != EXTERNAL_INT32x4_ELEMENTS)) ||
2227 (instr->value()->representation().IsDouble() && 2555 (instr->value()->representation().IsDouble() &&
2228 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 2556 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
2229 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 2557 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))) ||
2558 (instr->value()->representation().IsFloat32x4() &&
2559 elements_kind == EXTERNAL_FLOAT32x4_ELEMENTS) ||
2560 (instr->value()->representation().IsInt32x4() &&
2561 elements_kind == EXTERNAL_INT32x4_ELEMENTS));
2230 ASSERT(instr->elements()->representation().IsExternal()); 2562 ASSERT(instr->elements()->representation().IsExternal());
2231 bool val_is_temp_register = 2563 bool val_is_temp_register =
2232 elements_kind == EXTERNAL_PIXEL_ELEMENTS || 2564 elements_kind == EXTERNAL_PIXEL_ELEMENTS ||
2233 elements_kind == EXTERNAL_FLOAT_ELEMENTS; 2565 elements_kind == EXTERNAL_FLOAT_ELEMENTS;
2234 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) 2566 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value())
2235 : UseRegister(instr->value()); 2567 : UseRegister(instr->value());
2236 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2568 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2237 LOperand* external_pointer = UseRegister(instr->elements()); 2569 LOperand* external_pointer = UseRegister(instr->elements());
2238 return new(zone()) LStoreKeyed(external_pointer, key, val); 2570 return new(zone()) LStoreKeyed(external_pointer, key, val);
2239 } 2571 }
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2955 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2624 LOperand* object = UseRegister(instr->object()); 2956 LOperand* object = UseRegister(instr->object());
2625 LOperand* index = UseTempRegister(instr->index()); 2957 LOperand* index = UseTempRegister(instr->index());
2626 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2958 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2627 } 2959 }
2628 2960
2629 2961
2630 } } // namespace v8::internal 2962 } } // namespace v8::internal
2631 2963
2632 #endif // V8_TARGET_ARCH_X64 2964 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698