| 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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 | 2984 |
| 2985 // The following conversion will not work with numbers | 2985 // The following conversion will not work with numbers |
| 2986 // outside of ]-2^32, 2^32[. | 2986 // outside of ]-2^32, 2^32[. |
| 2987 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32)); | 2987 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32)); |
| 2988 DeoptimizeIf(ge, instr->environment()); | 2988 DeoptimizeIf(ge, instr->environment()); |
| 2989 | 2989 |
| 2990 // Save the original sign for later comparison. | 2990 // Save the original sign for later comparison. |
| 2991 __ and_(scratch, result, Operand(HeapNumber::kSignMask)); | 2991 __ and_(scratch, result, Operand(HeapNumber::kSignMask)); |
| 2992 | 2992 |
| 2993 __ Vmov(double_scratch0(), 0.5); | 2993 __ Vmov(double_scratch0(), 0.5); |
| 2994 __ vadd(input, input, double_scratch0()); | 2994 __ vadd(double_scratch0(), input, double_scratch0()); |
| 2995 | 2995 |
| 2996 // Check sign of the result: if the sign changed, the input | 2996 // Check sign of the result: if the sign changed, the input |
| 2997 // value was in ]0.5, 0[ and the result should be -0. | 2997 // value was in ]0.5, 0[ and the result should be -0. |
| 2998 __ vmov(result, input.high()); | 2998 __ vmov(result, double_scratch0().high()); |
| 2999 __ eor(result, result, Operand(scratch), SetCC); | 2999 __ eor(result, result, Operand(scratch), SetCC); |
| 3000 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3000 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 3001 DeoptimizeIf(mi, instr->environment()); | 3001 DeoptimizeIf(mi, instr->environment()); |
| 3002 } else { | 3002 } else { |
| 3003 __ mov(result, Operand(0), LeaveCC, mi); | 3003 __ mov(result, Operand(0), LeaveCC, mi); |
| 3004 __ b(mi, &done); | 3004 __ b(mi, &done); |
| 3005 } | 3005 } |
| 3006 | 3006 |
| 3007 __ EmitVFPTruncate(kRoundToMinusInf, | 3007 __ EmitVFPTruncate(kRoundToMinusInf, |
| 3008 double_scratch0().low(), | 3008 double_scratch0().low(), |
| 3009 input, | 3009 double_scratch0(), |
| 3010 result, | 3010 result, |
| 3011 scratch); | 3011 scratch); |
| 3012 DeoptimizeIf(ne, instr->environment()); | 3012 DeoptimizeIf(ne, instr->environment()); |
| 3013 __ vmov(result, double_scratch0().low()); | 3013 __ vmov(result, double_scratch0().low()); |
| 3014 | 3014 |
| 3015 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3015 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 3016 // Test for -0. | 3016 // Test for -0. |
| 3017 __ cmp(result, Operand(0)); | 3017 __ cmp(result, Operand(0)); |
| 3018 __ b(ne, &done); | 3018 __ b(ne, &done); |
| 3019 __ bind(&check_sign_on_zero); | 3019 __ bind(&check_sign_on_zero); |
| (...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4508 ASSERT(osr_pc_offset_ == -1); | 4508 ASSERT(osr_pc_offset_ == -1); |
| 4509 osr_pc_offset_ = masm()->pc_offset(); | 4509 osr_pc_offset_ = masm()->pc_offset(); |
| 4510 } | 4510 } |
| 4511 | 4511 |
| 4512 | 4512 |
| 4513 | 4513 |
| 4514 | 4514 |
| 4515 #undef __ | 4515 #undef __ |
| 4516 | 4516 |
| 4517 } } // namespace v8::internal | 4517 } } // namespace v8::internal |
| OLD | NEW |