summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeun-young Park <keunyoung@google.com>2013-03-26 11:45:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-03-26 11:45:01 -0700
commit9dd8d897d350897eb04e60987bb59b846ea0f154 (patch)
tree37c1a5877acb7482c37f7b4a3fcd5d83725e3c1e
parent437bdbbaec76099b8b4582aa9f965e60b3f3cdb6 (diff)
parent1cd763f123b9f1a2772ddff15ace81ec07b7660c (diff)
downloadframeworks_native-9dd8d897d350897eb04e60987bb59b846ea0f154.zip
frameworks_native-9dd8d897d350897eb04e60987bb59b846ea0f154.tar.gz
frameworks_native-9dd8d897d350897eb04e60987bb59b846ea0f154.tar.bz2
am 1cd763f1: am cd91024c: Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles."
* commit '1cd763f123b9f1a2772ddff15ace81ec07b7660c': [MIPS] Avoid unaligned load/store for 64-bit doubles.
-rw-r--r--libs/binder/Parcel.cpp45
1 files changed, 44 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 4c15913..8f7f7e7 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -627,11 +627,27 @@ status_t Parcel::writeFloat(float val)
return writeAligned(val);
}
+#if defined(__mips__) && defined(__mips_hard_float)
+
+status_t Parcel::writeDouble(double val)
+{
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ u.d = val;
+ return writeAligned(u.ll);
+}
+
+#else
+
status_t Parcel::writeDouble(double val)
{
return writeAligned(val);
}
+#endif
+
status_t Parcel::writeIntPtr(intptr_t val)
{
return writeAligned(val);
@@ -962,17 +978,44 @@ float Parcel::readFloat() const
return readAligned<float>();
}
+#if defined(__mips__) && defined(__mips_hard_float)
+
status_t Parcel::readDouble(double *pArg) const
{
- return readAligned(pArg);
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ status_t status;
+ status = readAligned(&u.ll);
+ *pArg = u.d;
+ return status;
}
+double Parcel::readDouble() const
+{
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ u.ll = readAligned<unsigned long long>();
+ return u.d;
+}
+
+#else
+
+status_t Parcel::readDouble(double *pArg) const
+{
+ return readAligned(pArg);
+}
double Parcel::readDouble() const
{
return readAligned<double>();
}
+#endif
+
status_t Parcel::readIntPtr(intptr_t *pArg) const
{
return readAligned(pArg);