Index: src/ia32/assembler-ia32.cc |
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc |
index 50c834f7c22138962c6ad9f8679dc0f2bcf1eb44..59698038746e7906c6036ed1cf9a65642bc64f98 100644 |
--- a/src/ia32/assembler-ia32.cc |
+++ b/src/ia32/assembler-ia32.cc |
@@ -60,11 +60,17 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { |
if (cpu.has_sse41() && FLAG_enable_sse4_1) supported_ |= 1u << SSE4_1; |
if (cpu.has_sse3() && FLAG_enable_sse3) supported_ |= 1u << SSE3; |
+ if (cpu.has_avx() && FLAG_enable_avx) supported_ |= 1u << AVX; |
+ if (cpu.has_fma3() && FLAG_enable_fma3) supported_ |= 1u << FMA3; |
} |
void CpuFeatures::PrintTarget() { } |
-void CpuFeatures::PrintFeatures() { } |
+void CpuFeatures::PrintFeatures() { |
+ printf("SSE3=%d SSE4_1=%d AVX=%d FMA3=%d\n", CpuFeatures::IsSupported(SSE3), |
+ CpuFeatures::IsSupported(SSE4_1), CpuFeatures::IsSupported(AVX), |
+ CpuFeatures::IsSupported(FMA3)); |
+} |
// ----------------------------------------------------------------------------- |
@@ -2437,6 +2443,16 @@ void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t offset) { |
} |
+void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, |
+ const Operand& src2) { |
+ DCHECK(IsEnabled(AVX)); |
+ EnsureSpace ensure_space(this); |
+ emit_vex_prefix(src1, kLIG, kF2, k0F, kWIG); |
+ EMIT(op); |
+ emit_sse_operand(dst, src2); |
+} |
+ |
+ |
void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { |
Register ireg = { reg.code() }; |
emit_operand(ireg, adr); |
@@ -2458,6 +2474,19 @@ void Assembler::emit_sse_operand(XMMRegister dst, Register src) { |
} |
+void Assembler::emit_vex_prefix(XMMRegister vreg, VectorLength l, SIMDPrefix pp, |
+ LeadingOpcode mm, VexW w) { |
+ if (mm != k0F || w != kW0) { |
+ EMIT(0xc4); |
+ EMIT(0xc0 | mm); |
+ EMIT(w | ((~vreg.code() & 0xf) << 3) | l | pp); |
+ } else { |
+ EMIT(0xc5); |
+ EMIT(((~vreg.code()) << 3) | l | pp); |
+ } |
+} |
+ |
+ |
void Assembler::RecordJSReturn() { |
positions_recorder()->WriteRecordedPositions(); |
EnsureSpace ensure_space(this); |