OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3590 | 3590 |
3591 XMMRegister input_reg = ToDoubleRegister(input); | 3591 XMMRegister input_reg = ToDoubleRegister(input); |
3592 Register result_reg = ToRegister(result); | 3592 Register result_reg = ToRegister(result); |
3593 | 3593 |
3594 if (instr->truncating()) { | 3594 if (instr->truncating()) { |
3595 // Performs a truncating conversion of a floating point number as used by | 3595 // Performs a truncating conversion of a floating point number as used by |
3596 // the JS bitwise operations. | 3596 // the JS bitwise operations. |
3597 __ cvttsd2siq(result_reg, input_reg); | 3597 __ cvttsd2siq(result_reg, input_reg); |
3598 __ movq(kScratchRegister, V8_INT64_C(0x8000000000000000), RelocInfo::NONE); | 3598 __ movq(kScratchRegister, V8_INT64_C(0x8000000000000000), RelocInfo::NONE); |
3599 __ cmpq(result_reg, kScratchRegister); | 3599 __ cmpq(result_reg, kScratchRegister); |
3600 DeoptimizeIf(equal, instr->environment()); | 3600 DeoptimizeIf(equal, instr->environment()); |
3601 } else { | 3601 } else { |
3602 __ cvttsd2si(result_reg, input_reg); | 3602 __ cvttsd2si(result_reg, input_reg); |
3603 __ cvtlsi2sd(xmm0, result_reg); | 3603 __ cvtlsi2sd(xmm0, result_reg); |
3604 __ ucomisd(xmm0, input_reg); | 3604 __ ucomisd(xmm0, input_reg); |
3605 DeoptimizeIf(not_equal, instr->environment()); | 3605 DeoptimizeIf(not_equal, instr->environment()); |
3606 DeoptimizeIf(parity_even, instr->environment()); // NaN. | 3606 DeoptimizeIf(parity_even, instr->environment()); // NaN. |
3607 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3607 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
3608 NearLabel done; | 3608 NearLabel done; |
3609 // The integer converted back is equal to the original. We | 3609 // The integer converted back is equal to the original. We |
3610 // only have to test if we got -0 as an input. | 3610 // only have to test if we got -0 as an input. |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 RegisterEnvironmentForDeoptimization(environment); | 4096 RegisterEnvironmentForDeoptimization(environment); |
4097 ASSERT(osr_pc_offset_ == -1); | 4097 ASSERT(osr_pc_offset_ == -1); |
4098 osr_pc_offset_ = masm()->pc_offset(); | 4098 osr_pc_offset_ = masm()->pc_offset(); |
4099 } | 4099 } |
4100 | 4100 |
4101 #undef __ | 4101 #undef __ |
4102 | 4102 |
4103 } } // namespace v8::internal | 4103 } } // namespace v8::internal |
4104 | 4104 |
4105 #endif // V8_TARGET_ARCH_X64 | 4105 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |