| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3467 } | 3467 } |
| 3468 } | 3468 } |
| 3469 | 3469 |
| 3470 | 3470 |
| 3471 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { | 3471 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
| 3472 XMMRegister xmm_scratch = xmm0; | 3472 XMMRegister xmm_scratch = xmm0; |
| 3473 Register output_reg = ToRegister(instr->result()); | 3473 Register output_reg = ToRegister(instr->result()); |
| 3474 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3474 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 3475 | 3475 |
| 3476 if (CpuFeatures::IsSupported(SSE4_1)) { | 3476 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 3477 CpuFeatures::Scope scope(SSE4_1); | 3477 CpuFeatureScope scope(masm(), SSE4_1); |
| 3478 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3478 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 3479 // Deoptimize if minus zero. | 3479 // Deoptimize if minus zero. |
| 3480 __ movq(output_reg, input_reg); | 3480 __ movq(output_reg, input_reg); |
| 3481 __ subq(output_reg, Immediate(1)); | 3481 __ subq(output_reg, Immediate(1)); |
| 3482 DeoptimizeIf(overflow, instr->environment()); | 3482 DeoptimizeIf(overflow, instr->environment()); |
| 3483 } | 3483 } |
| 3484 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); | 3484 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); |
| 3485 __ cvttsd2si(output_reg, xmm_scratch); | 3485 __ cvttsd2si(output_reg, xmm_scratch); |
| 3486 __ cmpl(output_reg, Immediate(0x80000000)); | 3486 __ cmpl(output_reg, Immediate(0x80000000)); |
| 3487 DeoptimizeIf(equal, instr->environment()); | 3487 DeoptimizeIf(equal, instr->environment()); |
| (...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5834 FixedArray::kHeaderSize - kPointerSize)); | 5834 FixedArray::kHeaderSize - kPointerSize)); |
| 5835 __ bind(&done); | 5835 __ bind(&done); |
| 5836 } | 5836 } |
| 5837 | 5837 |
| 5838 | 5838 |
| 5839 #undef __ | 5839 #undef __ |
| 5840 | 5840 |
| 5841 } } // namespace v8::internal | 5841 } } // namespace v8::internal |
| 5842 | 5842 |
| 5843 #endif // V8_TARGET_ARCH_X64 | 5843 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |