369
370 // Intrinsics make gcc generate code for these.
371 float SharedRuntime::fneg(float f) {
372 return -f;
373 }
374
375 double SharedRuntime::dneg(double f) {
376 return -f;
377 }
378
379 #endif // __SOFTFP__
380
381 #if defined(__SOFTFP__) || defined(E500V2)
382 // Intrinsics make gcc generate code for these.
383 double SharedRuntime::dabs(double f) {
384 return (f <= (double)0.0) ? (double)0.0 - f : f;
385 }
386
387 #endif
388
389 #if defined(__SOFTFP__) || defined(PPC32)
390 double SharedRuntime::dsqrt(double f) {
391 return sqrt(f);
392 }
393 #endif
394
395 JRT_LEAF(jint, SharedRuntime::f2i(jfloat x))
396 if (g_isnan(x))
397 return 0;
398 if (x >= (jfloat) max_jint)
399 return max_jint;
400 if (x <= (jfloat) min_jint)
401 return min_jint;
402 return (jint) x;
403 JRT_END
404
405
406 JRT_LEAF(jlong, SharedRuntime::f2l(jfloat x))
407 if (g_isnan(x))
408 return 0;
409 if (x >= (jfloat) max_jlong)
|
369
370 // Intrinsics make gcc generate code for these.
371 float SharedRuntime::fneg(float f) {
372 return -f;
373 }
374
375 double SharedRuntime::dneg(double f) {
376 return -f;
377 }
378
379 #endif // __SOFTFP__
380
381 #if defined(__SOFTFP__) || defined(E500V2)
382 // Intrinsics make gcc generate code for these.
383 double SharedRuntime::dabs(double f) {
384 return (f <= (double)0.0) ? (double)0.0 - f : f;
385 }
386
387 #endif
388
389 #if defined(__SOFTFP__) || defined(PPC)
390 double SharedRuntime::dsqrt(double f) {
391 return sqrt(f);
392 }
393 #endif
394
395 JRT_LEAF(jint, SharedRuntime::f2i(jfloat x))
396 if (g_isnan(x))
397 return 0;
398 if (x >= (jfloat) max_jint)
399 return max_jint;
400 if (x <= (jfloat) min_jint)
401 return min_jint;
402 return (jint) x;
403 JRT_END
404
405
406 JRT_LEAF(jlong, SharedRuntime::f2l(jfloat x))
407 if (g_isnan(x))
408 return 0;
409 if (x >= (jfloat) max_jlong)
|