Minor tweaks.

This commit is contained in:
Ben Vanik 2013-12-28 19:48:02 -08:00
parent f6f8be9080
commit 6b17ead43b
4 changed files with 32 additions and 8 deletions

View File

@ -37,7 +37,7 @@
<div class="debugger-fnlist-body"> <div class="debugger-fnlist-body">
<div class="debugger-fnlist-list"> <div class="debugger-fnlist-list">
<table class="table table-hover"> <table class="table table-hover">
<tr ng-repeat="fn in functionList track by $index | filter:functionFilter | orderBy:'address'"> <tr ng-repeat="fn in functionList track by $index | orderBy:'address'">
<td><a xe-coderef="{{fn.address|hex32}}">{{fn.name}}</a></td> <td><a xe-coderef="{{fn.address|hex32}}">{{fn.name}}</a></td>
</tr> </tr>
</table> </table>
@ -45,7 +45,7 @@
</div> </div>
<div class="debugger-fnlist-footer"> <div class="debugger-fnlist-footer">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="Filter" ng-model="functionFilter" ui-escape="functionFilter = ''"> <input type="text" class="form-control" placeholder="Filter" ng-model="functionFilter.$" ui-escape="functionFilter = ''">
</div> </div>
</div> </div>
</div> </div>
@ -122,14 +122,13 @@
<span class="value" tooltip="{{app.session.activeThread.context.fh[$index]}}">{{v|exp8}}</span> <span class="value" tooltip="{{app.session.activeThread.context.fh[$index]}}">{{v|exp8}}</span>
</div> </div>
</div> </div>
<!--
<div class="debugger-tools-registers-container"> <div class="debugger-tools-registers-container">
<div ng-repeat="v in app.session.activeThread.context.v track by $index" <div ng-repeat="v in app.session.activeThread.context.v track by $index"
class="debugger-tools-registers-entry vec"> class="debugger-tools-registers-entry vec">
<span class="name">v{{$index}}</span> <span class="value">{{v}}</span> <span class="name">v{{$index}}</span>
</div> <span class="value">{{v}}</span>
</div> </div>
--> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -32,9 +32,9 @@ int InstrEmit_branch(
// The docs say always, though... // The docs say always, though...
// Note that we do the update before we branch/call as we need it to // Note that we do the update before we branch/call as we need it to
// be correct for returns. // be correct for returns.
if (lk) {
Value* return_address = f.LoadConstant(cia + 4); Value* return_address = f.LoadConstant(cia + 4);
f.SetReturnAddress(return_address); f.SetReturnAddress(return_address);
if (lk) {
f.StoreLR(return_address); f.StoreLR(return_address);
} }

View File

@ -22,14 +22,20 @@ namespace alloy {
namespace frontend { namespace frontend {
namespace ppc { namespace ppc {
#define TRUNCATE_ADDRESSES 0
Value* CalculateEA(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) { Value* CalculateEA(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
#if TRUNCATE_ADDRESSES
return f.ZeroExtend(f.Add( return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE), f.Truncate(f.LoadGPR(ra), INT32_TYPE),
f.Truncate(f.LoadGPR(rb), INT32_TYPE)), INT64_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) { Value* CalculateEA_0(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
#if TRUNCATE_ADDRESSES
if (ra) { if (ra) {
return f.ZeroExtend(f.Add( return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE), f.Truncate(f.LoadGPR(ra), INT32_TYPE),
@ -37,15 +43,27 @@ Value* CalculateEA_0(PPCFunctionBuilder& f, uint32_t ra, uint32_t rb) {
} else { } else {
return f.ZeroExtend(f.Truncate(f.LoadGPR(rb), INT32_TYPE), INT64_TYPE); 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) { Value* CalculateEA_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
#if TRUNCATE_ADDRESSES
return f.ZeroExtend(f.Add( return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE), f.Truncate(f.LoadGPR(ra), INT32_TYPE),
f.LoadConstant((int32_t)imm)), INT64_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) { Value* CalculateEA_0_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
#if TRUNCATE_ADDRESSES
if (ra) { if (ra) {
return f.ZeroExtend(f.Add( return f.ZeroExtend(f.Add(
f.Truncate(f.LoadGPR(ra), INT32_TYPE), f.Truncate(f.LoadGPR(ra), INT32_TYPE),
@ -53,6 +71,13 @@ Value* CalculateEA_0_i(PPCFunctionBuilder& f, uint32_t ra, uint64_t imm) {
} else { } else {
return f.ZeroExtend(f.LoadConstant((int32_t)imm), INT64_TYPE); 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
} }

View File

@ -137,7 +137,7 @@ void FunctionBuilder::Dump(StringBuffer* str) {
while (block) { while (block) {
if (block == block_head_) { if (block == block_head_) {
str->Append("<entry>:\n"); str->Append("<entry>:\n");
} else { } else if (!block->label_head) {
str->Append("<block%d>:\n", block_ordinal); str->Append("<block%d>:\n", block_ordinal);
} }
block_ordinal++; block_ordinal++;