OLD | NEW |
1 // Copyright 2006-2008 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 return false; | 198 return false; |
199 } | 199 } |
200 | 200 |
201 | 201 |
202 // Simple helper function to detect whether the C code is compiled with | 202 // Simple helper function to detect whether the C code is compiled with |
203 // option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register | 203 // option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register |
204 // pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then | 204 // pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then |
205 // calling this will return 1.0 and otherwise 0.0. | 205 // calling this will return 1.0 and otherwise 0.0. |
206 static void ArmUsingHardFloatHelper() { | 206 static void ArmUsingHardFloatHelper() { |
207 asm("mov r0, #0"); | 207 asm("mov r0, #0"); |
208 asm("mov r1, #0"); | 208 #if defined(__VFP_FP__) && !defined(__SOFTFP__) |
209 asm("movt r1, #16368"); | 209 // Load 0x3ff00000 into r1 using instructions available in both ARM |
| 210 // and Thumb mode. |
| 211 asm("mov r1, #3"); |
| 212 asm("mov r2, #255"); |
| 213 asm("lsl r1, r1, #8"); |
| 214 asm("orr r1, r1, r2"); |
| 215 asm("lsl r1, r1, #16"); |
| 216 // For vmov d0, r0, r1 use ARM mode. |
| 217 #ifdef __thumb__ |
| 218 asm volatile( |
| 219 "@ Enter ARM Mode \n\t" |
| 220 " adr r3, 1f \n\t" |
| 221 " bx r3 \n\t" |
| 222 " .ALIGN 4 \n\t" |
| 223 " .ARM \n" |
| 224 "1: vmov d0, r0, r1 \n\t" |
| 225 "@ Enter THUMB Mode\n\t" |
| 226 " adr r3, 2f+1 \n\t" |
| 227 " bx r3 \n\t" |
| 228 " .THUMB \n" |
| 229 "2: \n\t"); |
| 230 #else |
210 asm("vmov d0, r0, r1"); | 231 asm("vmov d0, r0, r1"); |
211 asm("mov r0, #0"); | 232 #endif // __thumb__ |
| 233 #endif // defined(__VFP_FP__) && !defined(__SOFTFP__) |
212 asm("mov r1, #0"); | 234 asm("mov r1, #0"); |
213 } | 235 } |
214 | 236 |
215 | 237 |
216 bool OS::ArmUsingHardFloat() { | 238 bool OS::ArmUsingHardFloat() { |
217 // Cast helper function from returning void to returning double. | 239 // Cast helper function from returning void to returning double. |
218 typedef double (*F)(); | 240 typedef double (*F)(); |
219 F f = FUNCTION_CAST<F>(FUNCTION_ADDR(ArmUsingHardFloatHelper)); | 241 F f = FUNCTION_CAST<F>(FUNCTION_ADDR(ArmUsingHardFloatHelper)); |
220 return f() == 1.0; | 242 return f() == 1.0; |
221 } | 243 } |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 | 1147 |
1126 void Sampler::Stop() { | 1148 void Sampler::Stop() { |
1127 ASSERT(IsActive()); | 1149 ASSERT(IsActive()); |
1128 SignalSender::RemoveActiveSampler(this); | 1150 SignalSender::RemoveActiveSampler(this); |
1129 SetActive(false); | 1151 SetActive(false); |
1130 } | 1152 } |
1131 | 1153 |
1132 #endif // ENABLE_LOGGING_AND_PROFILING | 1154 #endif // ENABLE_LOGGING_AND_PROFILING |
1133 | 1155 |
1134 } } // namespace v8::internal | 1156 } } // namespace v8::internal |
OLD | NEW |