aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-13 17:50:54 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-13 17:50:54 -0800
commit4415b57405525e543d46564b7b8f064f56cb98de (patch)
tree0db17d1e985adabd669654c6984cc3426db048e8 /lib/Target/CppBackend/CPPBackend.cpp
parent2baeecf4cfa05a044106e0a7f4db48086761f804 (diff)
fix unaligned reads
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 44b092f831..6ff05b5ed7 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1023,14 +1023,14 @@ std::string CppWriter::getLoad(std::string Assign, const Value *P, const Type *T
if (T->isIntegerTy()) {
switch (Alignment) {
case 2: {
- text = Assign + "HEAP16[" + PS + ">>1]&" +
+ text = Assign + "HEAP16[" + PS + ">>1]|" +
"(HEAP16[" + PS + "+2>>1]<<2)";
break;
}
case 1: {
- text = Assign + "HEAP8[" + PS + "]&" +
- "(HEAP8[" + PS + "+1|0]<<1)&" +
- "(HEAP8[" + PS + "+2|0]<<2)&" +
+ text = Assign + "HEAP8[" + PS + "]|" +
+ "(HEAP8[" + PS + "+1|0]<<1)|" +
+ "(HEAP8[" + PS + "+2|0]<<2)|" +
"(HEAP8[" + PS + "+3|0]<<3)";
break;
}