| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3026 | 3026 |
| 3027 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 3027 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || |
| 3028 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 3028 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
| 3029 CpuFeatures::Scope scope(VFP3); | 3029 CpuFeatures::Scope scope(VFP3); |
| 3030 DwVfpRegister result = ToDoubleRegister(instr->result()); | 3030 DwVfpRegister result = ToDoubleRegister(instr->result()); |
| 3031 Operand operand = key_is_constant | 3031 Operand operand = key_is_constant |
| 3032 ? Operand(constant_key << element_size_shift) | 3032 ? Operand(constant_key << element_size_shift) |
| 3033 : Operand(key, LSL, shift_size); | 3033 : Operand(key, LSL, shift_size); |
| 3034 __ add(scratch0(), external_pointer, operand); | 3034 __ add(scratch0(), external_pointer, operand); |
| 3035 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { | 3035 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
| 3036 __ vldr(result.low(), scratch0(), additional_offset); | 3036 __ vldr(DwVfpRegister::ScratchReg().low(), scratch0(), additional_offset); |
| 3037 __ vcvt_f64_f32(result, result.low()); | 3037 __ vcvt_f64_f32(result, DwVfpRegister::ScratchReg().low()); |
| 3038 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS | 3038 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS |
| 3039 __ vldr(result, scratch0(), additional_offset); | 3039 __ vldr(result, scratch0(), additional_offset); |
| 3040 } | 3040 } |
| 3041 } else { | 3041 } else { |
| 3042 Register result = ToRegister(instr->result()); | 3042 Register result = ToRegister(instr->result()); |
| 3043 MemOperand mem_operand = PrepareKeyedOperand( | 3043 MemOperand mem_operand = PrepareKeyedOperand( |
| 3044 key, external_pointer, key_is_constant, constant_key, | 3044 key, external_pointer, key_is_constant, constant_key, |
| 3045 element_size_shift, shift_size, | 3045 element_size_shift, shift_size, |
| 3046 instr->additional_index(), additional_offset); | 3046 instr->additional_index(), additional_offset); |
| 3047 switch (elements_kind) { | 3047 switch (elements_kind) { |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3697 // Note that according to ECMA-262 15.8.2.13: | 3697 // Note that according to ECMA-262 15.8.2.13: |
| 3698 // Math.pow(-Infinity, 0.5) == Infinity | 3698 // Math.pow(-Infinity, 0.5) == Infinity |
| 3699 // Math.sqrt(-Infinity) == NaN | 3699 // Math.sqrt(-Infinity) == NaN |
| 3700 Label done; | 3700 Label done; |
| 3701 __ vmov(temp, -V8_INFINITY, scratch0()); | 3701 __ vmov(temp, -V8_INFINITY, scratch0()); |
| 3702 __ VFPCompareAndSetFlags(input, temp); | 3702 __ VFPCompareAndSetFlags(input, temp); |
| 3703 __ vneg(result, temp, eq); | 3703 __ vneg(result, temp, eq); |
| 3704 __ b(&done, eq); | 3704 __ b(&done, eq); |
| 3705 | 3705 |
| 3706 // Add +0 to convert -0 to +0. | 3706 // Add +0 to convert -0 to +0. |
| 3707 __ vadd(result, input, kDoubleRegZero); | 3707 __ vadd(result, input, DwVfpRegister::ZeroReg()); |
| 3708 __ vsqrt(result, result); | 3708 __ vsqrt(result, result); |
| 3709 __ bind(&done); | 3709 __ bind(&done); |
| 3710 } | 3710 } |
| 3711 | 3711 |
| 3712 | 3712 |
| 3713 void LCodeGen::DoPower(LPower* instr) { | 3713 void LCodeGen::DoPower(LPower* instr) { |
| 3714 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3714 Representation exponent_type = instr->hydrogen()->right()->representation(); |
| 3715 // Having marked this as a call, we can use any registers. | 3715 // Having marked this as a call, we can use any registers. |
| 3716 // Just make sure that the input/output registers are the expected ones. | 3716 // Just make sure that the input/output registers are the expected ones. |
| 3717 ASSERT(!instr->right()->IsDoubleRegister() || | 3717 ASSERT(!instr->right()->IsDoubleRegister() || |
| (...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5796 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5796 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5797 __ ldr(result, FieldMemOperand(scratch, | 5797 __ ldr(result, FieldMemOperand(scratch, |
| 5798 FixedArray::kHeaderSize - kPointerSize)); | 5798 FixedArray::kHeaderSize - kPointerSize)); |
| 5799 __ bind(&done); | 5799 __ bind(&done); |
| 5800 } | 5800 } |
| 5801 | 5801 |
| 5802 | 5802 |
| 5803 #undef __ | 5803 #undef __ |
| 5804 | 5804 |
| 5805 } } // namespace v8::internal | 5805 } } // namespace v8::internal |
| OLD | NEW |