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

Side by Side Diff: src/x64/assembler-x64.h

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/v8memory.h ('k') | src/x64/assembler-x64.cc » ('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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 const XMMRegister xmm9 = { 9 }; 293 const XMMRegister xmm9 = { 9 };
294 const XMMRegister xmm10 = { 10 }; 294 const XMMRegister xmm10 = { 10 };
295 const XMMRegister xmm11 = { 11 }; 295 const XMMRegister xmm11 = { 11 };
296 const XMMRegister xmm12 = { 12 }; 296 const XMMRegister xmm12 = { 12 };
297 const XMMRegister xmm13 = { 13 }; 297 const XMMRegister xmm13 = { 13 };
298 const XMMRegister xmm14 = { 14 }; 298 const XMMRegister xmm14 = { 14 };
299 const XMMRegister xmm15 = { 15 }; 299 const XMMRegister xmm15 = { 15 };
300 300
301 301
302 typedef XMMRegister DoubleRegister; 302 typedef XMMRegister DoubleRegister;
303 typedef XMMRegister Float32x4Register;
304 typedef XMMRegister Int32x4Register;
303 305
304 306
305 enum Condition { 307 enum Condition {
306 // any value < 0 is considered no_condition 308 // any value < 0 is considered no_condition
307 no_condition = -1, 309 no_condition = -1,
308 310
309 overflow = 0, 311 overflow = 0,
310 no_overflow = 1, 312 no_overflow = 1,
311 below = 2, 313 below = 2,
312 above_equal = 3, 314 above_equal = 3,
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 void fninit(); 1339 void fninit();
1338 1340
1339 void frndint(); 1341 void frndint();
1340 1342
1341 void sahf(); 1343 void sahf();
1342 1344
1343 // SSE instructions 1345 // SSE instructions
1344 void movaps(XMMRegister dst, XMMRegister src); 1346 void movaps(XMMRegister dst, XMMRegister src);
1345 void movss(XMMRegister dst, const Operand& src); 1347 void movss(XMMRegister dst, const Operand& src);
1346 void movss(const Operand& dst, XMMRegister src); 1348 void movss(const Operand& dst, XMMRegister src);
1347 void shufps(XMMRegister dst, XMMRegister src, byte imm8);
1348 1349
1349 void cvttss2si(Register dst, const Operand& src); 1350 void cvttss2si(Register dst, const Operand& src);
1350 void cvttss2si(Register dst, XMMRegister src); 1351 void cvttss2si(Register dst, XMMRegister src);
1351 void cvtlsi2ss(XMMRegister dst, Register src); 1352 void cvtlsi2ss(XMMRegister dst, Register src);
1352 1353
1353 void andps(XMMRegister dst, XMMRegister src); 1354 void andps(XMMRegister dst, XMMRegister src);
1354 void andps(XMMRegister dst, const Operand& src); 1355 void andps(XMMRegister dst, const Operand& src);
1355 void orps(XMMRegister dst, XMMRegister src); 1356 void orps(XMMRegister dst, XMMRegister src);
1356 void orps(XMMRegister dst, const Operand& src); 1357 void orps(XMMRegister dst, const Operand& src);
1357 void xorps(XMMRegister dst, XMMRegister src); 1358 void xorps(XMMRegister dst, XMMRegister src);
1358 void xorps(XMMRegister dst, const Operand& src); 1359 void xorps(XMMRegister dst, const Operand& src);
1359 1360
1360 void addps(XMMRegister dst, XMMRegister src); 1361 void addps(XMMRegister dst, XMMRegister src);
1361 void addps(XMMRegister dst, const Operand& src); 1362 void addps(XMMRegister dst, const Operand& src);
1362 void subps(XMMRegister dst, XMMRegister src); 1363 void subps(XMMRegister dst, XMMRegister src);
1363 void subps(XMMRegister dst, const Operand& src); 1364 void subps(XMMRegister dst, const Operand& src);
1364 void mulps(XMMRegister dst, XMMRegister src); 1365 void mulps(XMMRegister dst, XMMRegister src);
1365 void mulps(XMMRegister dst, const Operand& src); 1366 void mulps(XMMRegister dst, const Operand& src);
1366 void divps(XMMRegister dst, XMMRegister src); 1367 void divps(XMMRegister dst, XMMRegister src);
1367 void divps(XMMRegister dst, const Operand& src); 1368 void divps(XMMRegister dst, const Operand& src);
1368 1369
1369 void movmskps(Register dst, XMMRegister src); 1370 // SSE4_1 instructions
1371 void insertps(XMMRegister dst, XMMRegister src, byte imm8);
1372 void pinsrd(XMMRegister dst, Register src, byte imm8);
1370 1373
1371 // SSE2 instructions 1374 // SSE2 instructions
1372 void movd(XMMRegister dst, Register src); 1375 void movd(XMMRegister dst, Register src);
1373 void movd(Register dst, XMMRegister src); 1376 void movd(Register dst, XMMRegister src);
1374 void movq(XMMRegister dst, Register src); 1377 void movq(XMMRegister dst, Register src);
1375 void movq(Register dst, XMMRegister src); 1378 void movq(Register dst, XMMRegister src);
1376 void movq(XMMRegister dst, XMMRegister src); 1379 void movq(XMMRegister dst, XMMRegister src);
1380 void shufps(XMMRegister dst, XMMRegister src, byte imm8);
1377 1381
1378 // Don't use this unless it's important to keep the 1382 // Don't use this unless it's important to keep the
1379 // top half of the destination register unchanged. 1383 // top half of the destination register unchanged.
1380 // Used movaps when moving double values and movq for integer 1384 // Used movaps when moving double values and movq for integer
1381 // values in xmm registers. 1385 // values in xmm registers.
1382 void movsd(XMMRegister dst, XMMRegister src); 1386 void movsd(XMMRegister dst, XMMRegister src);
1383 1387
1384 void movsd(const Operand& dst, XMMRegister src); 1388 void movsd(const Operand& dst, XMMRegister src);
1385 void movsd(XMMRegister dst, const Operand& src); 1389 void movsd(XMMRegister dst, const Operand& src);
1386 1390
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 void andpd(XMMRegister dst, XMMRegister src); 1423 void andpd(XMMRegister dst, XMMRegister src);
1420 void orpd(XMMRegister dst, XMMRegister src); 1424 void orpd(XMMRegister dst, XMMRegister src);
1421 void xorpd(XMMRegister dst, XMMRegister src); 1425 void xorpd(XMMRegister dst, XMMRegister src);
1422 void sqrtsd(XMMRegister dst, XMMRegister src); 1426 void sqrtsd(XMMRegister dst, XMMRegister src);
1423 1427
1424 void ucomisd(XMMRegister dst, XMMRegister src); 1428 void ucomisd(XMMRegister dst, XMMRegister src);
1425 void ucomisd(XMMRegister dst, const Operand& src); 1429 void ucomisd(XMMRegister dst, const Operand& src);
1426 void cmpltsd(XMMRegister dst, XMMRegister src); 1430 void cmpltsd(XMMRegister dst, XMMRegister src);
1427 1431
1428 void movmskpd(Register dst, XMMRegister src); 1432 void movmskpd(Register dst, XMMRegister src);
1433 void movmskps(Register dst, XMMRegister src);
1429 1434
1430 // SSE 4.1 instruction 1435 // SSE 4.1 instruction
1431 void extractps(Register dst, XMMRegister src, byte imm8); 1436 void extractps(Register dst, XMMRegister src, byte imm8);
1432 1437
1438 void minps(XMMRegister dst, XMMRegister src);
1439 void minps(XMMRegister dst, const Operand& src);
1440 void maxps(XMMRegister dst, XMMRegister src);
1441 void maxps(XMMRegister dst, const Operand& src);
1442 void rcpps(XMMRegister dst, XMMRegister src);
1443 void rcpps(XMMRegister dst, const Operand& src);
1444 void rsqrtps(XMMRegister dst, XMMRegister src);
1445 void rsqrtps(XMMRegister dst, const Operand& src);
1446 void sqrtps(XMMRegister dst, XMMRegister src);
1447 void sqrtps(XMMRegister dst, const Operand& src);
1448 void movups(XMMRegister dst, XMMRegister src);
1449 void movups(XMMRegister dst, const Operand& src);
1450 void movups(const Operand& dst, XMMRegister src);
1451 void paddd(XMMRegister dst, XMMRegister src);
1452 void paddd(XMMRegister dst, const Operand& src);
1453 void psubd(XMMRegister dst, XMMRegister src);
1454 void psubd(XMMRegister dst, const Operand& src);
1455 void pmulld(XMMRegister dst, XMMRegister src);
1456 void pmulld(XMMRegister dst, const Operand& src);
1457 void pmuludq(XMMRegister dst, XMMRegister src);
1458 void pmuludq(XMMRegister dst, const Operand& src);
1459 void punpackldq(XMMRegister dst, XMMRegister src);
1460 void punpackldq(XMMRegister dst, const Operand& src);
1461 void psrldq(XMMRegister dst, uint8_t shift);
1462 void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle);
1463 void cvtps2dq(XMMRegister dst, XMMRegister src);
1464 void cvtps2dq(XMMRegister dst, const Operand& src);
1465 void cvtdq2ps(XMMRegister dst, XMMRegister src);
1466 void cvtdq2ps(XMMRegister dst, const Operand& src);
1467
1433 enum RoundingMode { 1468 enum RoundingMode {
1434 kRoundToNearest = 0x0, 1469 kRoundToNearest = 0x0,
1435 kRoundDown = 0x1, 1470 kRoundDown = 0x1,
1436 kRoundUp = 0x2, 1471 kRoundUp = 0x2,
1437 kRoundToZero = 0x3 1472 kRoundToZero = 0x3
1438 }; 1473 };
1439 1474
1440 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); 1475 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode);
1441 1476
1477 void cmpps(XMMRegister dst, XMMRegister src, int8_t cmp);
1478 void cmpeqps(XMMRegister dst, XMMRegister src);
1479 void cmpltps(XMMRegister dst, XMMRegister src);
1480 void cmpleps(XMMRegister dst, XMMRegister src);
1481 void cmpneqps(XMMRegister dst, XMMRegister src);
1482 void cmpnltps(XMMRegister dst, XMMRegister src);
1483 void cmpnleps(XMMRegister dst, XMMRegister src);
1484
1442 // Debugging 1485 // Debugging
1443 void Print(); 1486 void Print();
1444 1487
1445 // Check the code size generated from label to here. 1488 // Check the code size generated from label to here.
1446 int SizeOfCodeGeneratedSince(Label* label) { 1489 int SizeOfCodeGeneratedSince(Label* label) {
1447 return pc_offset() - label->pos(); 1490 return pc_offset() - label->pos();
1448 } 1491 }
1449 1492
1450 // Mark address of the ExitJSFrame code. 1493 // Mark address of the ExitJSFrame code.
1451 void RecordJSReturn(); 1494 void RecordJSReturn();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 inline void emit_optional_rex_32(Register reg, XMMRegister base); 1622 inline void emit_optional_rex_32(Register reg, XMMRegister base);
1580 1623
1581 // As for emit_optional_rex_32(Register, const Operand&), except that 1624 // As for emit_optional_rex_32(Register, const Operand&), except that
1582 // the register is an XMM register. 1625 // the register is an XMM register.
1583 inline void emit_optional_rex_32(XMMRegister reg, const Operand& op); 1626 inline void emit_optional_rex_32(XMMRegister reg, const Operand& op);
1584 1627
1585 // Optionally do as emit_rex_32(Register) if the register number has 1628 // Optionally do as emit_rex_32(Register) if the register number has
1586 // the high bit set. 1629 // the high bit set.
1587 inline void emit_optional_rex_32(Register rm_reg); 1630 inline void emit_optional_rex_32(Register rm_reg);
1588 1631
1632 // As for emit_optional_rex_32(Register), except that the register is
1633 // an XMM register.
1634 inline void emit_optional_rex_32(XMMRegister rm_reg);
1635
1589 // Optionally do as emit_rex_32(const Operand&) if the operand register 1636 // Optionally do as emit_rex_32(const Operand&) if the operand register
1590 // numbers have a high bit set. 1637 // numbers have a high bit set.
1591 inline void emit_optional_rex_32(const Operand& op); 1638 inline void emit_optional_rex_32(const Operand& op);
1592 1639
1593 1640
1594 // Emit the ModR/M byte, and optionally the SIB byte and 1641 // Emit the ModR/M byte, and optionally the SIB byte and
1595 // 1- or 4-byte offset for a memory operand. Also encodes 1642 // 1- or 4-byte offset for a memory operand. Also encodes
1596 // the second operand of the operation, a register or operation 1643 // the second operand of the operation, a register or operation
1597 // subcode, into the reg field of the ModR/M byte. 1644 // subcode, into the reg field of the ModR/M byte.
1598 void emit_operand(Register reg, const Operand& adr) { 1645 void emit_operand(Register reg, const Operand& adr) {
(...skipping 18 matching lines...) Expand all
1617 } 1664 }
1618 1665
1619 // Emit the code-object-relative offset of the label's position 1666 // Emit the code-object-relative offset of the label's position
1620 inline void emit_code_relative_offset(Label* label); 1667 inline void emit_code_relative_offset(Label* label);
1621 1668
1622 // The first argument is the reg field, the second argument is the r/m field. 1669 // The first argument is the reg field, the second argument is the r/m field.
1623 void emit_sse_operand(XMMRegister dst, XMMRegister src); 1670 void emit_sse_operand(XMMRegister dst, XMMRegister src);
1624 void emit_sse_operand(XMMRegister reg, const Operand& adr); 1671 void emit_sse_operand(XMMRegister reg, const Operand& adr);
1625 void emit_sse_operand(XMMRegister dst, Register src); 1672 void emit_sse_operand(XMMRegister dst, Register src);
1626 void emit_sse_operand(Register dst, XMMRegister src); 1673 void emit_sse_operand(Register dst, XMMRegister src);
1674 void emit_sse_operand(XMMRegister dst);
1627 1675
1628 // Emit machine code for one of the operations ADD, ADC, SUB, SBC, 1676 // Emit machine code for one of the operations ADD, ADC, SUB, SBC,
1629 // AND, OR, XOR, or CMP. The encodings of these operations are all 1677 // AND, OR, XOR, or CMP. The encodings of these operations are all
1630 // similar, differing just in the opcode or in the reg field of the 1678 // similar, differing just in the opcode or in the reg field of the
1631 // ModR/M byte. 1679 // ModR/M byte.
1632 void arithmetic_op_16(byte opcode, Register reg, Register rm_reg); 1680 void arithmetic_op_16(byte opcode, Register reg, Register rm_reg);
1633 void arithmetic_op_16(byte opcode, Register reg, const Operand& rm_reg); 1681 void arithmetic_op_16(byte opcode, Register reg, const Operand& rm_reg);
1634 void arithmetic_op_32(byte opcode, Register reg, Register rm_reg); 1682 void arithmetic_op_32(byte opcode, Register reg, Register rm_reg);
1635 void arithmetic_op_32(byte opcode, Register reg, const Operand& rm_reg); 1683 void arithmetic_op_32(byte opcode, Register reg, const Operand& rm_reg);
1636 void arithmetic_op(byte opcode, Register reg, Register rm_reg); 1684 void arithmetic_op(byte opcode, Register reg, Register rm_reg);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 private: 1760 private:
1713 Assembler* assembler_; 1761 Assembler* assembler_;
1714 #ifdef DEBUG 1762 #ifdef DEBUG
1715 int space_before_; 1763 int space_before_;
1716 #endif 1764 #endif
1717 }; 1765 };
1718 1766
1719 } } // namespace v8::internal 1767 } } // namespace v8::internal
1720 1768
1721 #endif // V8_X64_ASSEMBLER_X64_H_ 1769 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/v8memory.h ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698