Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 4b9115d43bc4abef4fdcbb74236fa968f4e89f4b..48f9a9a18364157a77769d60dc2d9564155ec8fa 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -2890,6 +2890,18 @@ void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t imm8) { |
emit(imm8); |
} |
+void Assembler::insertps(XMMRegister dst, XMMRegister src, byte imm8) { |
+ DCHECK(CpuFeatures::IsSupported(SSE4_1)); |
+ DCHECK(is_uint8(imm8)); |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x3A); |
+ emit(0x21); |
+ emit_sse_operand(dst, src); |
+ emit(imm8); |
+} |
void Assembler::movsd(const Operand& dst, XMMRegister src) { |
DCHECK(!IsEnabled(AVX)); |
@@ -3211,6 +3223,38 @@ void Assembler::psrld(XMMRegister reg, byte imm8) { |
emit(imm8); |
} |
+void Assembler::cmpps(XMMRegister dst, XMMRegister src, int8_t cmp) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xC2); |
+ emit_sse_operand(dst, src); |
+ emit(cmp); |
+} |
+ |
+void Assembler::cmpeqps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x0); |
+} |
+ |
+void Assembler::cmpltps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x1); |
+} |
+ |
+void Assembler::cmpleps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x2); |
+} |
+ |
+void Assembler::cmpneqps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x4); |
+} |
+ |
+void Assembler::cmpnltps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x5); |
+} |
+ |
+void Assembler::cmpnleps(XMMRegister dst, XMMRegister src) { |
+ cmpps(dst, src, 0x6); |
+} |
void Assembler::cvttss2si(Register dst, const Operand& src) { |
DCHECK(!IsEnabled(AVX)); |
@@ -4192,6 +4236,263 @@ void Assembler::rorxl(Register dst, const Operand& src, byte imm8) { |
emit(imm8); |
} |
+void Assembler::minps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5D); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::minps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5D); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::maxps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5F); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::maxps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5F); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::rcpps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x53); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::rcpps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x53); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::rsqrtps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x52); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::rsqrtps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x52); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::sqrtps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x51); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::sqrtps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x51); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5B); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::cvtdq2ps(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5B); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::movups(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ if (src.low_bits() == 4) { |
+ // Try to avoid an unnecessary SIB byte. |
+ emit_optional_rex_32(src, dst); |
+ emit(0x0F); |
+ emit(0x11); |
+ emit_sse_operand(src, dst); |
+ } else { |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x10); |
+ emit_sse_operand(dst, src); |
+ } |
+} |
+ |
+void Assembler::movups(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x10); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::movups(const Operand& dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit_optional_rex_32(src, dst); |
+ emit(0x0F); |
+ emit(0x11); |
+ emit_sse_operand(src, dst); |
+} |
+ |
+void Assembler::paddd(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xFE); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::paddd(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xFE); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::psubd(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xFA); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::psubd(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xFA); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::pmulld(XMMRegister dst, XMMRegister src) { |
+ DCHECK(IsEnabled(SSE4_1)); |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x38); |
+ emit(0x40); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::pmulld(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xF4); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::pmuludq(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xF4); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::pmuludq(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0xF4); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::punpackldq(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x62); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::punpackldq(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x62); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::psrldq(XMMRegister dst, uint8_t shift) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst); |
+ emit(0x0F); |
+ emit(0x73); |
+ emit_sse_operand(dst); |
+ emit(shift); |
+} |
+ |
+void Assembler::cvtps2dq(XMMRegister dst, XMMRegister src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5B); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::cvtps2dq(XMMRegister dst, const Operand& src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x5B); |
+ emit_sse_operand(dst, src); |
+} |
+ |
+void Assembler::pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(dst, src); |
+ emit(0x0F); |
+ emit(0x70); |
+ emit_sse_operand(dst, src); |
+ emit(shuffle); |
+} |
void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { |
Register ireg = { reg.code() }; |
@@ -4219,6 +4520,10 @@ void Assembler::emit_sse_operand(Register dst, XMMRegister src) { |
emit(0xC0 | (dst.low_bits() << 3) | src.low_bits()); |
} |
+void Assembler::emit_sse_operand(XMMRegister dst) { |
+ emit(0xD8 | dst.low_bits()); |
+} |
+ |
void Assembler::db(uint8_t data) { |
EnsureSpace ensure_space(this); |