OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4691 // Compare exponent with -0.5. | 4691 // Compare exponent with -0.5. |
4692 __ cmp(scratch1, Operand(0xbfe00000)); | 4692 __ cmp(scratch1, Operand(0xbfe00000)); |
4693 __ b(ne, ¬_minus_half); | 4693 __ b(ne, ¬_minus_half); |
4694 | 4694 |
4695 // Get the double value from the base into vfp register d0. | 4695 // Get the double value from the base into vfp register d0. |
4696 __ ObjectToDoubleVFPRegister(base, d0, | 4696 __ ObjectToDoubleVFPRegister(base, d0, |
4697 scratch1, scratch2, heap_number_map, s0, | 4697 scratch1, scratch2, heap_number_map, s0, |
4698 runtime.entry_label(), | 4698 runtime.entry_label(), |
4699 AVOID_NANS_AND_INFINITIES); | 4699 AVOID_NANS_AND_INFINITIES); |
4700 | 4700 |
| 4701 // Convert -0 into +0 by adding +0. |
| 4702 __ vmov(d2, 0.0); |
| 4703 __ vadd(d0, d2, d0); |
4701 // Load 1.0 into d2. | 4704 // Load 1.0 into d2. |
4702 __ vmov(d2, 1.0); | 4705 __ vmov(d2, 1.0); |
4703 | 4706 |
4704 // Calculate the reciprocal of the square root. 1/sqrt(x) = sqrt(1/x). | 4707 // Calculate the reciprocal of the square root. |
| 4708 __ vsqrt(d0, d0); |
4705 __ vdiv(d0, d2, d0); | 4709 __ vdiv(d0, d2, d0); |
4706 __ vsqrt(d0, d0); | |
4707 | 4710 |
4708 __ b(&allocate_return); | 4711 __ b(&allocate_return); |
4709 | 4712 |
4710 __ bind(¬_minus_half); | 4713 __ bind(¬_minus_half); |
4711 // Compare exponent with 0.5. | 4714 // Compare exponent with 0.5. |
4712 __ cmp(scratch1, Operand(0x3fe00000)); | 4715 __ cmp(scratch1, Operand(0x3fe00000)); |
4713 runtime.Branch(ne); | 4716 runtime.Branch(ne); |
4714 | 4717 |
4715 // Get the double value from the base into vfp register d0. | 4718 // Get the double value from the base into vfp register d0. |
4716 __ ObjectToDoubleVFPRegister(base, d0, | 4719 __ ObjectToDoubleVFPRegister(base, d0, |
4717 scratch1, scratch2, heap_number_map, s0, | 4720 scratch1, scratch2, heap_number_map, s0, |
4718 runtime.entry_label(), | 4721 runtime.entry_label(), |
4719 AVOID_NANS_AND_INFINITIES); | 4722 AVOID_NANS_AND_INFINITIES); |
| 4723 // Convert -0 into +0 by adding +0. |
| 4724 __ vmov(d2, 0.0); |
| 4725 __ vadd(d0, d2, d0); |
4720 __ vsqrt(d0, d0); | 4726 __ vsqrt(d0, d0); |
4721 | 4727 |
4722 __ bind(&allocate_return); | 4728 __ bind(&allocate_return); |
4723 Register scratch3 = r5; | 4729 Register scratch3 = r5; |
4724 __ AllocateHeapNumberWithValue(scratch3, d0, scratch1, scratch2, | 4730 __ AllocateHeapNumberWithValue(scratch3, d0, scratch1, scratch2, |
4725 heap_number_map, runtime.entry_label()); | 4731 heap_number_map, runtime.entry_label()); |
4726 __ mov(base, scratch3); | 4732 __ mov(base, scratch3); |
4727 done.Jump(); | 4733 done.Jump(); |
4728 | 4734 |
4729 runtime.Bind(); | 4735 runtime.Bind(); |
(...skipping 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7363 BinaryOpIC::GetName(runtime_operands_type_)); | 7369 BinaryOpIC::GetName(runtime_operands_type_)); |
7364 return name_; | 7370 return name_; |
7365 } | 7371 } |
7366 | 7372 |
7367 | 7373 |
7368 #undef __ | 7374 #undef __ |
7369 | 7375 |
7370 } } // namespace v8::internal | 7376 } } // namespace v8::internal |
7371 | 7377 |
7372 #endif // V8_TARGET_ARCH_ARM | 7378 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |