diff --git a/src/codegen/x64/assembler-x64.h b/src/codegen/x64/assembler-x64.h index 206c59acc4..6509094083 100644 --- a/src/codegen/x64/assembler-x64.h +++ b/src/codegen/x64/assembler-x64.h @@ -1433,9 +1433,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { vinstr(0x0b, dst, src1, src2, k66, k0F3A, kWIG); emit(static_cast(mode) | 0x8); // Mask precision exception. } - void vroundps(XMMRegister dst, XMMRegister src1, XMMRegister src2, - RoundingMode mode) { - vinstr(0x08, dst, src1, src2, k66, k0F3A, kWIG); + void vroundps(XMMRegister dst, XMMRegister src, RoundingMode mode) { + vinstr(0x08, dst, xmm0, src, k66, k0F3A, kWIG); emit(static_cast(mode) | 0x8); // Mask precision exception. } diff --git a/src/codegen/x64/macro-assembler-x64.h b/src/codegen/x64/macro-assembler-x64.h index ab1745a760..18674f9f54 100644 --- a/src/codegen/x64/macro-assembler-x64.h +++ b/src/codegen/x64/macro-assembler-x64.h @@ -174,9 +174,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_OP(Cmpneqpd, cmpneqpd) AVX_OP(Cmpnltpd, cmpnltpd) AVX_OP(Cmpnlepd, cmpnlepd) - AVX_OP(Roundss, roundss) - AVX_OP(Roundsd, roundsd) - AVX_OP(Roundps, roundps) AVX_OP(Sqrtss, sqrtss) AVX_OP(Sqrtsd, sqrtsd) AVX_OP(Sqrtps, sqrtps) @@ -284,6 +281,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_OP_SSE4_1(Pmovzxwd, pmovzxwd) AVX_OP_SSE4_1(Pmovzxdq, pmovzxdq) AVX_OP_SSE4_1(Pextrq, pextrq) + AVX_OP_SSE4_1(Roundps, roundps) + AVX_OP_SSE4_1(Roundss, roundss) + AVX_OP_SSE4_1(Roundsd, roundsd) AVX_OP_SSE4_2(Pcmpgtq, pcmpgtq) #undef AVX_OP diff --git a/src/diagnostics/x64/disasm-x64.cc b/src/diagnostics/x64/disasm-x64.cc index 4d0760b17c..2251e0d7b4 100644 --- a/src/diagnostics/x64/disasm-x64.cc +++ b/src/diagnostics/x64/disasm-x64.cc @@ -947,6 +947,11 @@ int DisassemblerX64::AVXInstruction(byte* data) { int mod, regop, rm, vvvv = vex_vreg(); get_modrm(*current, &mod, ®op, &rm); switch (opcode) { + case 0x08: + AppendToBuffer("vroundps %s,", NameOfXMMRegister(regop)); + current += PrintRightXMMOperand(current); + AppendToBuffer(",0x%x", *current++); + break; case 0x0A: AppendToBuffer("vroundss %s,%s,", NameOfXMMRegister(regop), NameOfXMMRegister(vvvv)); @@ -1840,6 +1845,12 @@ int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) { current += PrintRightOperand(current); AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3); current += 1; + } else if (third_byte == 0x08) { + get_modrm(*current, &mod, ®op, &rm); + AppendToBuffer("roundps %s,", NameOfXMMRegister(regop)); + current += PrintRightXMMOperand(current); + AppendToBuffer(",0x%x", (*current) & 3); + current += 1; } else if (third_byte == 0x0A) { get_modrm(*current, &mod, ®op, &rm); AppendToBuffer("roundss %s,", NameOfXMMRegister(regop)); diff --git a/test/cctest/test-disasm-x64.cc b/test/cctest/test-disasm-x64.cc index 8e9eadca25..0bd7605a98 100644 --- a/test/cctest/test-disasm-x64.cc +++ b/test/cctest/test-disasm-x64.cc @@ -588,6 +588,7 @@ TEST(DisasmX64) { __ blendvpd(xmm5, xmm1); __ blendvpd(xmm5, Operand(rdx, 4)); + __ roundps(xmm8, xmm3, kRoundUp); __ roundss(xmm8, xmm3, kRoundDown); __ roundsd(xmm8, xmm3, kRoundDown); @@ -648,6 +649,7 @@ TEST(DisasmX64) { __ vmovdqu(xmm9, Operand(rbx, rcx, times_4, 10000)); __ vmovdqu(Operand(rbx, rcx, times_4, 10000), xmm0); + __ vroundps(xmm9, xmm2, kRoundUp); __ vroundss(xmm9, xmm1, xmm2, kRoundDown); __ vroundsd(xmm8, xmm3, xmm0, kRoundDown); __ vucomisd(xmm9, xmm1);