summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-24 18:16:17 +0000
committerDale Johannesen <dalej@apple.com>2009-03-24 18:16:17 +0000
commit4d7e4ee799440218761fa27a09d119849c8a84ad (patch)
treea18268c2490da7e67327f2bff36e5b89e6ab5f9d /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parentd9eb41177a866bf96d815d7e40665e386461b7f6 (diff)
downloadbcm5719-llvm-4d7e4ee799440218761fa27a09d119849c8a84ad.tar.gz
bcm5719-llvm-4d7e4ee799440218761fa27a09d119849c8a84ad.zip
fix one more fp80 case (used only by Interpreter)
and streamline code here a bit. llvm-svn: 67636
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 4e182d49835..e74fc329ae0 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -748,17 +748,9 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
case Type::DoubleTyID:
*((double*)Ptr) = Val.DoubleVal;
break;
- case Type::X86_FP80TyID: {
- uint16_t *Dest = (uint16_t*)Ptr;
- const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData();
- // This is endian dependent, but it will only work on x86 anyway.
- Dest[0] = Src[0];
- Dest[1] = Src[1];
- Dest[2] = Src[2];
- Dest[3] = Src[3];
- Dest[4] = Src[4];
- break;
- }
+ case Type::X86_FP80TyID:
+ memcpy(Ptr, Val.IntVal.getRawData(), 10);
+ break;
case Type::PointerTyID:
// Ensure 64 bit target pointers are fully initialized on 32 bit hosts.
if (StoreBytes != sizeof(PointerTy))
@@ -835,16 +827,8 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result,
case Type::X86_FP80TyID: {
// This is endian dependent, but it will only work on x86 anyway.
// FIXME: Will not trap if loading a signaling NaN.
- uint16_t *p = (uint16_t*)Ptr;
- union {
- uint16_t x[8];
- uint64_t y[2];
- };
- x[0] = p[1];
- x[1] = p[2];
- x[2] = p[3];
- x[3] = p[4];
- x[4] = p[0];
+ uint64_t y[2];
+ memcpy(y, Ptr, 10);
Result.IntVal = APInt(80, 2, y);
break;
}
OpenPOWER on IntegriCloud