pcop = Safe_calloc(1,sizeof(pCodeOpReg) );
pcop->type = PO_DIR;
- /*
- if (offset)
- sprintf(s,"(%s + %d)",
- aop->aopu.aop_dir,
- offset);
- else
- sprintf(s,"%s",aop->aopu.aop_dir);
- pcop->name = Safe_calloc(1,strlen(s)+1);
- strcpy(pcop->name,s);
- */
pcop->name = Safe_calloc(1,strlen(aop->aopu.aop_dir)+1);
strcpy(pcop->name,aop->aopu.aop_dir);
PCOR(pcop)->r = dirregWithName(aop->aopu.aop_dir);
PCOR(pcop)->instance = offset;
pcop->type = PCOR(pcop)->r->pc_type;
//rs = aop->aopu.aop_reg[offset]->name;
- DEBUGpic14_emitcode(";","%d regiser idx = %d ",__LINE__,rIdx);
+ DEBUGpic14_emitcode(";","%d rIdx = r0x%X ",__LINE__,rIdx);
return pcop;
}
case PC_OPCODE:
// If the opcode has a label, print that first
{
- pBranch *pbl = PCI(pc)->label;
+ char str[256];
+ pCodeInstruction *pci = PCI(pc);
+ pBranch *pbl = pci->label;
while(pbl && pbl->pc) {
if(pbl->pc->type == PC_LABEL)
pCodePrintLabel(of, pbl->pc);
pbl = pbl->next;
}
- }
- if(PCI(pc)->cline)
- genericPrint(of,PCODE(PCI(pc)->cline));
+ if(pci->cline)
+ genericPrint(of,PCODE(pci->cline));
- {
- char str[256];
pCode2str(str, 256, pc);
/* Debug */
if(debug_verbose) {
+ pCodeOpReg *pcor = PCOR(pci->pcop);
fprintf(of, "\t;id=%u,key=%03x",pc->id,pc->seq);
- if(PCI(pc)->pcflow)
- fprintf(of,",flow seq=%03x",PCI(pc)->pcflow->pc.seq);
+ if(pci->pcflow)
+ fprintf(of,",flow seq=%03x",pci->pcflow->pc.seq);
+ if (pcor && pcor->pcop.type==PO_GPR_TEMP && !pcor->r->isFixed)
+ fprintf(of,",rIdx=r0x%X",pcor->rIdx);
}
}
#if 0
/*-----------------------------------------------------------------*/
DEFSETFUNC (resetrIdx)
{
- if (!((regs *)item)->isFixed)
- ((regs *)item)->rIdx = 0;
+ regs *r = (regs *)item;
+ if (!r->isFixed) {
+ r->rIdx = 0;
+ }
return 0;
}
(result = OP_SYMBOL (IC_RESULT (ic))) && /* has a result */
result->liveTo > ic->seq && /* and will live beyond this */
result->liveTo <= ebp->lSeq && /* does not go beyond this block */
- result->liveFrom == ic->seq && /* does not start before here */ result->regType == sym->regType && /* same register types */
+ result->liveFrom == ic->seq && /* does not start before here */
+ result->regType == sym->regType && /* same register types */
result->regType == sym->regType && /* same register types */
result->nRegs && /* which needs registers */
!result->isspilt && /* and does not already have them */
short type; /* can have value
* REG_GPR, REG_PTR or REG_CND
* This like the "meta-type" */
- short pc_type; /* pcode type */
- short rIdx; /* index into register table */
- // short otype;
- char *name; /* name */
+ short pc_type; /* pcode type */
+ short rIdx; /* index into register table */
+ char *name; /* name */
unsigned isFree:1; /* is currently unassigned */
unsigned wasUsed:1; /* becomes true if register has been used */