diff --git a/debugger/assets/ui/code/code-tab.html b/debugger/assets/ui/code/code-tab.html
index e4d58d23d..b81d68ef3 100644
--- a/debugger/assets/ui/code/code-tab.html
+++ b/debugger/assets/ui/code/code-tab.html
@@ -37,7 +37,7 @@
@@ -122,14 +122,13 @@
{{v|exp8}}
-
diff --git a/src/alloy/frontend/ppc/ppc_emit_control.cc b/src/alloy/frontend/ppc/ppc_emit_control.cc
index 99540a993..186a32cd7 100644
--- a/src/alloy/frontend/ppc/ppc_emit_control.cc
+++ b/src/alloy/frontend/ppc/ppc_emit_control.cc
@@ -32,9 +32,9 @@ int InstrEmit_branch(
// The docs say always, though...
// Note that we do the update before we branch/call as we need it to
// be correct for returns.
- Value* return_address = f.LoadConstant(cia + 4);
- f.SetReturnAddress(return_address);
if (lk) {
+ Value* return_address = f.LoadConstant(cia + 4);
+ f.SetReturnAddress(return_address);
f.StoreLR(return_address);
}
diff --git a/src/alloy/frontend/ppc/ppc_emit_memory.cc b/src/alloy/frontend/ppc/ppc_emit_memory.cc
index be3ee65c3..3b4c72a48 100644
--- a/src/alloy/frontend/ppc/ppc_emit_memory.cc
+++ b/src/alloy/frontend/ppc/ppc_emit_memory.cc
@@ -22,14 +22,20 @@ namespace alloy {
namespace frontend {
namespace ppc {
+#define TRUNCATE_ADDRESSES 0
Value* CalculateEA(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
+#if TRUNCATE_ADDRESSES
return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE),
f.Truncate(f.LoadGPR(rb), INT32_TYPE)), INT64_TYPE);
+#else
+ return f.Add(f.LoadGPR(ra), f.LoadGPR(rb));
+#endif // TRUNCATE_ADDRESSES
}
Value* CalculateEA_0(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
+#if TRUNCATE_ADDRESSES
if (ra) {
return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE),
@@ -37,15 +43,27 @@ Value* CalculateEA_0(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
} else {
return f.ZeroExtend(f.Truncate(f.LoadGPR(rb), INT32_TYPE), INT64_TYPE);
}
+#else
+ if (ra) {
+ return f.Add(f.LoadGPR(ra), f.LoadGPR(rb));
+ } else {
+ return f.LoadGPR(rb);
+ }
+#endif // TRUNCATE_ADDRESSES
}
Value* CalculateEA_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
+#if TRUNCATE_ADDRESSES
return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE),
f.LoadConstant((int32_t)imm)), INT64_TYPE);
+#else
+ return f.Add(f.LoadGPR(ra), f.LoadConstant(imm));
+#endif // TRUNCATE_ADDRESSES
}
Value* CalculateEA_0_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
+#if TRUNCATE_ADDRESSES
if (ra) {
return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE),
@@ -53,6 +71,13 @@ Value* CalculateEA_0_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
} else {
return f.ZeroExtend(f.LoadConstant((int32_t)imm), INT64_TYPE);
}
+#else
+ if (ra) {
+ return f.Add(f.LoadGPR(ra), f.LoadConstant(imm));
+ } else {
+ return f.LoadConstant(imm);
+ }
+#endif // TRUNCATE_ADDRESSES
}
diff --git a/src/alloy/hir/function_builder.cc b/src/alloy/hir/function_builder.cc
index 801606b52..637712fa9 100644
--- a/src/alloy/hir/function_builder.cc
+++ b/src/alloy/hir/function_builder.cc
@@ -137,7 +137,7 @@ void FunctionBuilder::Dump(StringBuffer* str) {
while (block) {
if (block == block_head_) {
str->Append(":\n");
- } else {
+ } else if (!block->label_head) {
str->Append(":\n", block_ordinal);
}
block_ordinal++;