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 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 // Convert 32 random bits in r0 to 0.(32 random bits) in a double | 3046 // Convert 32 random bits in r0 to 0.(32 random bits) in a double |
3047 // by computing: | 3047 // by computing: |
3048 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 3048 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
3049 if (CpuFeatures::IsSupported(VFP2)) { | 3049 if (CpuFeatures::IsSupported(VFP2)) { |
3050 __ PrepareCallCFunction(1, r0); | 3050 __ PrepareCallCFunction(1, r0); |
3051 __ ldr(r0, | 3051 __ ldr(r0, |
3052 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); | 3052 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); |
3053 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); | 3053 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); |
3054 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 3054 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
3055 | 3055 |
3056 CpuFeatures::Scope scope(VFP2); | 3056 CpuFeatureScope scope(masm(), VFP2); |
3057 // 0x41300000 is the top half of 1.0 x 2^20 as a double. | 3057 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
3058 // Create this constant using mov/orr to avoid PC relative load. | 3058 // Create this constant using mov/orr to avoid PC relative load. |
3059 __ mov(r1, Operand(0x41000000)); | 3059 __ mov(r1, Operand(0x41000000)); |
3060 __ orr(r1, r1, Operand(0x300000)); | 3060 __ orr(r1, r1, Operand(0x300000)); |
3061 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. | 3061 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. |
3062 __ vmov(d7, r0, r1); | 3062 __ vmov(d7, r0, r1); |
3063 // Move 0x4130000000000000 to VFP. | 3063 // Move 0x4130000000000000 to VFP. |
3064 __ mov(r0, Operand::Zero()); | 3064 __ mov(r0, Operand::Zero()); |
3065 __ vmov(d8, r0, r1); | 3065 __ vmov(d8, r0, r1); |
3066 // Subtract and store the result in the heap number. | 3066 // Subtract and store the result in the heap number. |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4602 *context_length = 0; | 4602 *context_length = 0; |
4603 return previous_; | 4603 return previous_; |
4604 } | 4604 } |
4605 | 4605 |
4606 | 4606 |
4607 #undef __ | 4607 #undef __ |
4608 | 4608 |
4609 } } // namespace v8::internal | 4609 } } // namespace v8::internal |
4610 | 4610 |
4611 #endif // V8_TARGET_ARCH_ARM | 4611 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |