summaryrefslogtreecommitdiffstats
path: root/vm/Misc.h
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2009-06-29 17:04:04 -0700
committerAndy McFadden <fadden@android.com>2009-06-30 11:22:29 -0700
commit87cf7312247b341b54be26904e3600e98967d695 (patch)
tree6efc33ac43398472e7e7ed0c4b36f06b8deab1e7 /vm/Misc.h
parent44d7864f79a22fe110b8e6187ac21e908f41fb1d (diff)
downloadandroid_dalvik-87cf7312247b341b54be26904e3600e98967d695.tar.gz
android_dalvik-87cf7312247b341b54be26904e3600e98967d695.tar.bz2
android_dalvik-87cf7312247b341b54be26904e3600e98967d695.zip
Inline some java.lang.Math functions.
For a first pass, I inlined the various flavors of abs(), min()/max() on integers, sqrt(), cos(), and sin(). These were selected based on a static analysis of a few of our jar files. A test of repeated sin/cos/sqrt calls on a G1-class device showed an improvement of 28%. This would improve more on devices with VFP support if the VM is compiled with -mfpu=vfp. Also: clarified a warning and removed some "#if 0" stuff.
Diffstat (limited to 'vm/Misc.h')
-rw-r--r--vm/Misc.h22
1 files changed, 0 insertions, 22 deletions
diff --git a/vm/Misc.h b/vm/Misc.h
index 9b506276b..1566161c3 100644
--- a/vm/Misc.h
+++ b/vm/Misc.h
@@ -52,28 +52,6 @@ INLINE u4 dvmFloatToU4(float val) {
conv.in = val;
return conv.out;
}
-#if 0
-INLINE float dvmU8ToFloat(u8 val) {
- union { u8 in; float out; } conv;
- conv.in = val;
- return conv.out;
-}
-INLINE u8 dvmFloatToU8(float val) {
- union { float in; u8 out; } conv;
- conv.in = val;
- return conv.out;
-}
-INLINE double dvmU8ToDouble(u8 val) {
- union { u8 in; double out; } conv;
- conv.in = val;
- return conv.out;
-}
-INLINE u8 dvmDoubleToU8(double val) {
- union { double in; u8 out; } conv;
- conv.in = val;
- return conv.out;
-}
-#endif
/*
* Print a hex dump to the log file.