OLD | NEW |
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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 void ucomisd(XMMRegister dst, XMMRegister src) { ucomisd(dst, Operand(src)); } | 1020 void ucomisd(XMMRegister dst, XMMRegister src) { ucomisd(dst, Operand(src)); } |
1021 void ucomisd(XMMRegister dst, const Operand& src); | 1021 void ucomisd(XMMRegister dst, const Operand& src); |
1022 | 1022 |
1023 void roundss(XMMRegister dst, XMMRegister src, RoundingMode mode); | 1023 void roundss(XMMRegister dst, XMMRegister src, RoundingMode mode); |
1024 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); | 1024 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); |
1025 | 1025 |
1026 void movmskpd(Register dst, XMMRegister src); | 1026 void movmskpd(Register dst, XMMRegister src); |
1027 void movmskps(Register dst, XMMRegister src); | 1027 void movmskps(Register dst, XMMRegister src); |
1028 | 1028 |
1029 void cmpltsd(XMMRegister dst, XMMRegister src); | 1029 void cmpltsd(XMMRegister dst, XMMRegister src); |
1030 void pcmpeqd(XMMRegister dst, XMMRegister src); | |
1031 | |
1032 void punpckldq(XMMRegister dst, XMMRegister src); | |
1033 void punpckhdq(XMMRegister dst, XMMRegister src); | |
1034 | 1030 |
1035 void maxsd(XMMRegister dst, XMMRegister src) { maxsd(dst, Operand(src)); } | 1031 void maxsd(XMMRegister dst, XMMRegister src) { maxsd(dst, Operand(src)); } |
1036 void maxsd(XMMRegister dst, const Operand& src); | 1032 void maxsd(XMMRegister dst, const Operand& src); |
1037 void minsd(XMMRegister dst, XMMRegister src) { minsd(dst, Operand(src)); } | 1033 void minsd(XMMRegister dst, XMMRegister src) { minsd(dst, Operand(src)); } |
1038 void minsd(XMMRegister dst, const Operand& src); | 1034 void minsd(XMMRegister dst, const Operand& src); |
1039 | 1035 |
1040 void movdqa(XMMRegister dst, const Operand& src); | 1036 void movdqa(XMMRegister dst, const Operand& src); |
1041 void movdqa(const Operand& dst, XMMRegister src); | 1037 void movdqa(const Operand& dst, XMMRegister src); |
1042 void movdqu(XMMRegister dst, const Operand& src); | 1038 void movdqu(XMMRegister dst, const Operand& src); |
1043 void movdqu(const Operand& dst, XMMRegister src); | 1039 void movdqu(const Operand& dst, XMMRegister src); |
(...skipping 12 matching lines...) Expand all Loading... |
1056 void movsd(XMMRegister dst, XMMRegister src) { movsd(dst, Operand(src)); } | 1052 void movsd(XMMRegister dst, XMMRegister src) { movsd(dst, Operand(src)); } |
1057 void movsd(XMMRegister dst, const Operand& src); | 1053 void movsd(XMMRegister dst, const Operand& src); |
1058 void movsd(const Operand& dst, XMMRegister src); | 1054 void movsd(const Operand& dst, XMMRegister src); |
1059 | 1055 |
1060 | 1056 |
1061 void movss(XMMRegister dst, const Operand& src); | 1057 void movss(XMMRegister dst, const Operand& src); |
1062 void movss(const Operand& dst, XMMRegister src); | 1058 void movss(const Operand& dst, XMMRegister src); |
1063 void movss(XMMRegister dst, XMMRegister src) { movss(dst, Operand(src)); } | 1059 void movss(XMMRegister dst, XMMRegister src) { movss(dst, Operand(src)); } |
1064 void extractps(Register dst, XMMRegister src, byte imm8); | 1060 void extractps(Register dst, XMMRegister src, byte imm8); |
1065 | 1061 |
1066 void pand(XMMRegister dst, XMMRegister src); | |
1067 void pxor(XMMRegister dst, XMMRegister src); | |
1068 void por(XMMRegister dst, XMMRegister src); | |
1069 void ptest(XMMRegister dst, XMMRegister src); | 1062 void ptest(XMMRegister dst, XMMRegister src); |
1070 | 1063 |
1071 void pslld(XMMRegister reg, int8_t shift); | 1064 void pslld(XMMRegister reg, int8_t shift); |
1072 void psrld(XMMRegister reg, int8_t shift); | 1065 void psrld(XMMRegister reg, int8_t shift); |
1073 void psllq(XMMRegister reg, int8_t shift); | 1066 void psllq(XMMRegister reg, int8_t shift); |
1074 void psllq(XMMRegister dst, XMMRegister src); | 1067 void psllq(XMMRegister dst, XMMRegister src); |
1075 void psrlq(XMMRegister reg, int8_t shift); | 1068 void psrlq(XMMRegister reg, int8_t shift); |
1076 void psrlq(XMMRegister dst, XMMRegister src); | 1069 void psrlq(XMMRegister dst, XMMRegister src); |
1077 void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle); | 1070 void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle); |
1078 void pextrd(Register dst, XMMRegister src, int8_t offset) { | 1071 void pextrd(Register dst, XMMRegister src, int8_t offset) { |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 v##instruction(dst, src1, Operand(src2)); \ | 1431 v##instruction(dst, src1, Operand(src2)); \ |
1439 } \ | 1432 } \ |
1440 void v##instruction(XMMRegister dst, XMMRegister src1, \ | 1433 void v##instruction(XMMRegister dst, XMMRegister src1, \ |
1441 const Operand& src2) { \ | 1434 const Operand& src2) { \ |
1442 vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0); \ | 1435 vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0); \ |
1443 } | 1436 } |
1444 | 1437 |
1445 SSE2_INSTRUCTION_LIST(DECLARE_SSE2_AVX_INSTRUCTION) | 1438 SSE2_INSTRUCTION_LIST(DECLARE_SSE2_AVX_INSTRUCTION) |
1446 #undef DECLARE_SSE2_AVX_INSTRUCTION | 1439 #undef DECLARE_SSE2_AVX_INSTRUCTION |
1447 | 1440 |
| 1441 #define DECLARE_SSE4_INSTRUCTION(instruction, prefix, escape1, escape2, \ |
| 1442 opcode) \ |
| 1443 void instruction(XMMRegister dst, XMMRegister src) { \ |
| 1444 instruction(dst, Operand(src)); \ |
| 1445 } \ |
| 1446 void instruction(XMMRegister dst, const Operand& src) { \ |
| 1447 sse4_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \ |
| 1448 } |
| 1449 |
| 1450 SSE4_INSTRUCTION_LIST(DECLARE_SSE4_INSTRUCTION) |
| 1451 #undef DECLARE_SSE4_INSTRUCTION |
| 1452 |
| 1453 #define DECLARE_SSE4_AVX_INSTRUCTION(instruction, prefix, escape1, escape2, \ |
| 1454 opcode) \ |
| 1455 void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) { \ |
| 1456 v##instruction(dst, src1, Operand(src2)); \ |
| 1457 } \ |
| 1458 void v##instruction(XMMRegister dst, XMMRegister src1, \ |
| 1459 const Operand& src2) { \ |
| 1460 vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape1##escape2, kW0); \ |
| 1461 } |
| 1462 |
| 1463 SSE4_INSTRUCTION_LIST(DECLARE_SSE4_AVX_INSTRUCTION) |
| 1464 #undef DECLARE_SSE4_AVX_INSTRUCTION |
| 1465 |
1448 // Prefetch src position into cache level. | 1466 // Prefetch src position into cache level. |
1449 // Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a | 1467 // Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a |
1450 // non-temporal | 1468 // non-temporal |
1451 void prefetch(const Operand& src, int level); | 1469 void prefetch(const Operand& src, int level); |
1452 // TODO(lrn): Need SFENCE for movnt? | 1470 // TODO(lrn): Need SFENCE for movnt? |
1453 | 1471 |
1454 // Check the code size generated from label to here. | 1472 // Check the code size generated from label to here. |
1455 int SizeOfCodeGeneratedSince(Label* label) { | 1473 int SizeOfCodeGeneratedSince(Label* label) { |
1456 return pc_offset() - label->pos(); | 1474 return pc_offset() - label->pos(); |
1457 } | 1475 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 void bind_to(Label* L, int pos); | 1588 void bind_to(Label* L, int pos); |
1571 | 1589 |
1572 // displacements | 1590 // displacements |
1573 inline Displacement disp_at(Label* L); | 1591 inline Displacement disp_at(Label* L); |
1574 inline void disp_at_put(Label* L, Displacement disp); | 1592 inline void disp_at_put(Label* L, Displacement disp); |
1575 inline void emit_disp(Label* L, Displacement::Type type); | 1593 inline void emit_disp(Label* L, Displacement::Type type); |
1576 inline void emit_near_disp(Label* L); | 1594 inline void emit_near_disp(Label* L); |
1577 | 1595 |
1578 void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape, | 1596 void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape, |
1579 byte opcode); | 1597 byte opcode); |
| 1598 void sse4_instr(XMMRegister dst, const Operand& src, byte prefix, |
| 1599 byte escape1, byte escape2, byte opcode); |
1580 void vinstr(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2, | 1600 void vinstr(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2, |
1581 SIMDPrefix pp, LeadingOpcode m, VexW w); | 1601 SIMDPrefix pp, LeadingOpcode m, VexW w); |
1582 // Most BMI instructions are similiar. | 1602 // Most BMI instructions are similiar. |
1583 void bmi1(byte op, Register reg, Register vreg, const Operand& rm); | 1603 void bmi1(byte op, Register reg, Register vreg, const Operand& rm); |
1584 void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg, | 1604 void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg, |
1585 const Operand& rm); | 1605 const Operand& rm); |
1586 | 1606 |
1587 // record reloc info for current pc_ | 1607 // record reloc info for current pc_ |
1588 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 1608 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
1589 | 1609 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 Assembler* assembler_; | 1644 Assembler* assembler_; |
1625 #ifdef DEBUG | 1645 #ifdef DEBUG |
1626 int space_before_; | 1646 int space_before_; |
1627 #endif | 1647 #endif |
1628 }; | 1648 }; |
1629 | 1649 |
1630 } // namespace internal | 1650 } // namespace internal |
1631 } // namespace v8 | 1651 } // namespace v8 |
1632 | 1652 |
1633 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1653 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
OLD | NEW |