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

Unified Diff: src/ia32/assembler-ia32.h

Issue 2695613004: Add several SIMD opcodes to IA32 (Closed)
Patch Set: Adjust Pextrd and use pinsrd instead of Pinsrd 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 side-by-side diff with in-line comments
Download patch
Index: src/ia32/assembler-ia32.h
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index 7ca50786922306522dcbaf1b655081d56c1dceee..5e2a40b64f58e65263019f12d0b940d9352b14d4 100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -40,6 +40,7 @@
#include <deque>
#include "src/assembler.h"
+#include "src/ia32/sse-instr.h"
#include "src/isolate.h"
#include "src/utils.h"
@@ -1417,6 +1418,30 @@ class Assembler : public AssemblerBase {
void vpd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
void vpd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
+// Other SSE and AVX instructions
+#define DECLARE_SSE2_INSTRUCTION(instruction, prefix, escape, opcode) \
+ void instruction(XMMRegister dst, XMMRegister src) { \
+ instruction(dst, Operand(src)); \
+ } \
+ void instruction(XMMRegister dst, const Operand& src) { \
+ sse2_instr(dst, src, 0x##prefix, 0x##escape, 0x##opcode); \
+ }
+
+ SSE2_INSTRUCTION_LIST(DECLARE_SSE2_INSTRUCTION)
+#undef DECLARE_SSE2_INSTRUCTION
+
+#define DECLARE_SSE2_AVX_INSTRUCTION(instruction, prefix, escape, opcode) \
+ void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) { \
+ v##instruction(dst, src1, Operand(src2)); \
+ } \
+ void v##instruction(XMMRegister dst, XMMRegister src1, \
+ const Operand& src2) { \
+ vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0); \
+ }
+
+ SSE2_INSTRUCTION_LIST(DECLARE_SSE2_AVX_INSTRUCTION)
+#undef DECLARE_SSE2_AVX_INSTRUCTION
+
// Prefetch src position into cache level.
// Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a
// non-temporal
@@ -1547,6 +1572,10 @@ class Assembler : public AssemblerBase {
inline void emit_disp(Label* L, Displacement::Type type);
inline void emit_near_disp(Label* L);
+ void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape,
+ byte opcode);
+ void vinstr(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2,
+ SIMDPrefix pp, LeadingOpcode m, VexW w);
// Most BMI instructions are similiar.
void bmi1(byte op, Register reg, Register vreg, const Operand& rm);
void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg,

Powered by Google App Engine
This is Rietveld 408576698