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

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

Issue 2695613004: Add several SIMD opcodes to IA32 (Closed)
Patch Set: Address comments: Inline sse-instr.h Created 3 years, 10 months 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
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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 void v##name##pd(XMMRegister dst, XMMRegister src1, const Operand& src2) { \ 1410 void v##name##pd(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
1411 vpd(opcode, dst, src1, src2); \ 1411 vpd(opcode, dst, src1, src2); \
1412 } 1412 }
1413 1413
1414 PACKED_OP_LIST(AVX_PACKED_OP_DECLARE); 1414 PACKED_OP_LIST(AVX_PACKED_OP_DECLARE);
1415 void vps(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2); 1415 void vps(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
1416 void vps(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2); 1416 void vps(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
1417 void vpd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2); 1417 void vpd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
1418 void vpd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2); 1418 void vpd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
1419 1419
1420 // Other SSE and AVX instructions
1421 #define SSE2_INSTRUCTION_LIST(V) \
1422 V(paddd, 66, 0F, FE) \
1423 V(psubd, 66, 0F, FA)
1424
1425 #define DECLARE_SSE2_INSTRUCTION(instruction, prefix, escape, opcode) \
1426 void instruction(XMMRegister dst, XMMRegister src) { \
1427 instruction(dst, Operand(src)); \
1428 } \
1429 void instruction(XMMRegister dst, const Operand& src) { \
1430 sse2_instr(dst, src, 0x##prefix, 0x##escape, 0x##opcode); \
bbudge 2017/02/18 00:02:25 Rather than gluing the literals together here, cou
Jing 2017/02/20 15:28:13 Since the list is also used in DECLARE_SSE2_AVX_IN
bbudge 2017/02/22 21:51:10 In that case, this is OK.
1431 }
1432
1433 SSE2_INSTRUCTION_LIST(DECLARE_SSE2_INSTRUCTION)
1434 #undef DECLARE_SSE2_INSTRUCTION
1435
1420 // Prefetch src position into cache level. 1436 // Prefetch src position into cache level.
1421 // Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a 1437 // Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a
1422 // non-temporal 1438 // non-temporal
1423 void prefetch(const Operand& src, int level); 1439 void prefetch(const Operand& src, int level);
1424 // TODO(lrn): Need SFENCE for movnt? 1440 // TODO(lrn): Need SFENCE for movnt?
1425 1441
1426 // Check the code size generated from label to here. 1442 // Check the code size generated from label to here.
1427 int SizeOfCodeGeneratedSince(Label* label) { 1443 int SizeOfCodeGeneratedSince(Label* label) {
1428 return pc_offset() - label->pos(); 1444 return pc_offset() - label->pos();
1429 } 1445 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 // labels 1556 // labels
1541 void print(Label* L); 1557 void print(Label* L);
1542 void bind_to(Label* L, int pos); 1558 void bind_to(Label* L, int pos);
1543 1559
1544 // displacements 1560 // displacements
1545 inline Displacement disp_at(Label* L); 1561 inline Displacement disp_at(Label* L);
1546 inline void disp_at_put(Label* L, Displacement disp); 1562 inline void disp_at_put(Label* L, Displacement disp);
1547 inline void emit_disp(Label* L, Displacement::Type type); 1563 inline void emit_disp(Label* L, Displacement::Type type);
1548 inline void emit_near_disp(Label* L); 1564 inline void emit_near_disp(Label* L);
1549 1565
1566 void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape,
1567 byte opcode);
1550 // Most BMI instructions are similiar. 1568 // Most BMI instructions are similiar.
1551 void bmi1(byte op, Register reg, Register vreg, const Operand& rm); 1569 void bmi1(byte op, Register reg, Register vreg, const Operand& rm);
1552 void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg, 1570 void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg,
1553 const Operand& rm); 1571 const Operand& rm);
1554 1572
1555 // record reloc info for current pc_ 1573 // record reloc info for current pc_
1556 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); 1574 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
1557 1575
1558 friend class CodePatcher; 1576 friend class CodePatcher;
1559 friend class EnsureSpace; 1577 friend class EnsureSpace;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 Assembler* assembler_; 1610 Assembler* assembler_;
1593 #ifdef DEBUG 1611 #ifdef DEBUG
1594 int space_before_; 1612 int space_before_;
1595 #endif 1613 #endif
1596 }; 1614 };
1597 1615
1598 } // namespace internal 1616 } // namespace internal
1599 } // namespace v8 1617 } // namespace v8
1600 1618
1601 #endif // V8_IA32_ASSEMBLER_IA32_H_ 1619 #endif // V8_IA32_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698