aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-15 21:28:19 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-15 21:28:19 -0800
commit7a955491e580b574ac0fc382c6fb0a7011cf4c42 (patch)
treeaca7e8e5a6322bf5e9456c71bbf4cf57c69327f9 /lib/Target/CppBackend/CPPBackend.cpp
parent2e9c92a3fa82e44d9c6af871e61ff7f1a8e51732 (diff)
fix coercions in bitcast
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 9f967977f5..2fd1c511f6 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1825,10 +1825,10 @@ std::string CppWriter::generateInstruction(const Instruction *I) {
std::string V = getValueAsStr(I->getOperand(0));
if (InType->isIntegerTy() && OutType->isFloatingPointTy()) {
assert(InType->getIntegerBitWidth() == 32);
- text = "HEAP32[tempDoublePtr>>2]=" + V + ";" + text + "HEAPF32[tempDoublePtr>>2];";
+ text = "HEAP32[tempDoublePtr>>2]=" + V + ";" + text + "+HEAPF32[tempDoublePtr>>2];";
} else if (OutType->isIntegerTy() && InType->isFloatingPointTy()) {
assert(OutType->getIntegerBitWidth() == 32);
- text = "HEAPF32[tempDoublePtr>>2]=" + V + ";" + text + "HEAP32[tempDoublePtr>>2];";
+ text = "HEAPF32[tempDoublePtr>>2]=" + V + ";" + text + "HEAP32[tempDoublePtr>>2]|0;";
} else {
text += V + ";";
}