am adb6aa13: am 9dd8d897: am 1cd763f1: am cd91024c: Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles."

* commit 'adb6aa130aa6e3a343c0fb1a1e1cfdf6f86cca52':
  [MIPS] Avoid unaligned load/store for 64-bit doubles.
This commit is contained in:
Keun-young Park 2013-03-26 12:17:56 -07:00 committed by Android Git Automerger
commit 4e06e0bcb9

View File

@ -627,11 +627,27 @@ status_t Parcel::writeFloat(float val)
return writeAligned(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) status_t Parcel::writeDouble(double val)
{ {
return writeAligned(val); return writeAligned(val);
} }
#endif
status_t Parcel::writeIntPtr(intptr_t val) status_t Parcel::writeIntPtr(intptr_t val)
{ {
return writeAligned(val); return writeAligned(val);
@ -962,17 +978,44 @@ float Parcel::readFloat() const
return readAligned<float>(); return readAligned<float>();
} }
#if defined(__mips__) && defined(__mips_hard_float)
status_t Parcel::readDouble(double *pArg) const
{
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 status_t Parcel::readDouble(double *pArg) const
{ {
return readAligned(pArg); return readAligned(pArg);
} }
double Parcel::readDouble() const double Parcel::readDouble() const
{ {
return readAligned<double>(); return readAligned<double>();
} }
#endif
status_t Parcel::readIntPtr(intptr_t *pArg) const status_t Parcel::readIntPtr(intptr_t *pArg) const
{ {
return readAligned(pArg); return readAligned(pArg);