| 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 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { | 3090 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
| 3091 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); | 3091 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
| 3092 DoubleRegister result = ToDoubleRegister(instr->result()); | 3092 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3093 __ vsqrt(result, input); | 3093 __ vsqrt(result, input); |
| 3094 } | 3094 } |
| 3095 | 3095 |
| 3096 | 3096 |
| 3097 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { | 3097 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { |
| 3098 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); | 3098 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
| 3099 DoubleRegister result = ToDoubleRegister(instr->result()); | 3099 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3100 DoubleRegister temp = ToDoubleRegister(instr->TempAt(0)); |
| 3100 | 3101 |
| 3101 // Note that according to ECMA-262 15.8.2.13: | 3102 // Note that according to ECMA-262 15.8.2.13: |
| 3102 // Math.pow(-Infinity, 0.5) == Infinity | 3103 // Math.pow(-Infinity, 0.5) == Infinity |
| 3103 // Math.sqrt(-Infinity) == NaN | 3104 // Math.sqrt(-Infinity) == NaN |
| 3104 Label done; | 3105 Label done; |
| 3105 __ VFPCompareAndSetFlags(input, -V8_INFINITY); | 3106 __ vmov(temp, -V8_INFINITY); |
| 3106 __ vneg(result, input, eq); | 3107 __ VFPCompareAndSetFlags(input, temp); |
| 3108 __ vneg(result, temp, eq); |
| 3107 __ b(&done, eq); | 3109 __ b(&done, eq); |
| 3108 | 3110 |
| 3109 // Add +0 to convert -0 to +0. | 3111 // Add +0 to convert -0 to +0. |
| 3110 __ vadd(result, input, kDoubleRegZero); | 3112 __ vadd(result, input, kDoubleRegZero); |
| 3111 __ vsqrt(result, result); | 3113 __ vsqrt(result, result); |
| 3112 __ bind(&done); | 3114 __ bind(&done); |
| 3113 } | 3115 } |
| 3114 | 3116 |
| 3115 | 3117 |
| 3116 void LCodeGen::DoPower(LPower* instr) { | 3118 void LCodeGen::DoPower(LPower* instr) { |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4725 ASSERT(osr_pc_offset_ == -1); | 4727 ASSERT(osr_pc_offset_ == -1); |
| 4726 osr_pc_offset_ = masm()->pc_offset(); | 4728 osr_pc_offset_ = masm()->pc_offset(); |
| 4727 } | 4729 } |
| 4728 | 4730 |
| 4729 | 4731 |
| 4730 | 4732 |
| 4731 | 4733 |
| 4732 #undef __ | 4734 #undef __ |
| 4733 | 4735 |
| 4734 } } // namespace v8::internal | 4736 } } // namespace v8::internal |
| OLD | NEW |