Index: src/compiler/x87/code-generator-x87.cc |
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc |
index 6ac3ec16c567f2ac00efcaa49ce947451558fd5c..ded530f7d9d199e6ae08022848830ea045d87a96 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -1091,11 +1091,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
case kX87Float64Round: { |
RoundingMode mode = |
static_cast<RoundingMode>(MiscField::decode(instr->opcode())); |
- if (mode == MiscField::encode(kRoundDown)) { |
- __ X87SetRC(0x0400); |
- } else { |
- __ X87SetRC(0x0c00); |
- } |
+ // Set the correct round mode in x87 control register |
+ __ X87SetRC((mode << 10)); |
if (!instr->InputAt(0)->IsDoubleRegister()) { |
InstructionOperand* input = instr->InputAt(0); |