Package compiler.frames

Examples of compiler.frames.Label


    // jedro:
    LinkedList<ImcStmt> stmts = ((ImcSEQ)(chunk.lincode)).stmts;
    int PC = 0;
    while (PC < stmts.size()) {
      Label newLabel = execStmt(stmts.get(PC));
      if (newLabel != null) {
        // Razveljavimo cevovod:
        PC = stmts.indexOf(new ImcLABEL(newLabel));
      }
      else PC++;
View Full Code Here


    LinkedList<Temp> defs = new LinkedList<Temp>();
    defs.add(dest);
   
    if (mem.expr instanceof ImcNAME)
    {
      Label label = ((ImcNAME)mem.expr).label;
     
      LinkedList<Label> lbls = new LinkedList<Label>();
      lbls.add(label);
     
      instructions.add(new AsmOPER("ldr `d0, =" + label.name(), defs, new LinkedList<Temp>(), lbls));
    }
    else if (mem.expr instanceof ImcBINOP && ((ImcBINOP)mem.expr).rimc instanceof ImcCONST)
    {
      Temp left = munch(((ImcBINOP)mem.expr).limc);
      LinkedList<Temp> src = new LinkedList<Temp>();
View Full Code Here

    // Put bit 1 in temp register
    // MOV R3, #1
    instructions.add(new AsmOPER("mov `d0, #1", defs, new LinkedList<Temp>()));
   
    // Start label
    Label start = Label.newLabel();
    instructions.add(new AsmLABEL(start.name() + ":", start));
   
    // CMP R2, R1
    uses.add(val1);
    uses.add(val2);
    instructions.add(new AsmOPER("cmp `s0, `s1", new LinkedList<Temp>(), uses));
   
    // MOVLS R2, R2, LSL #1
    defs = new LinkedList<Temp>();
    defs.add(val2);
    uses = new LinkedList<Temp>();
    uses.add(val2);
   
    instructions.add(new AsmOPER("movls `d0, `s0, lsl #1", defs, uses));
   
    // MOVLS R3, R3, LSL #1
    defs = new LinkedList<Temp>();
    defs.add(tmp);
    uses = new LinkedList<Temp>();
    uses.add(tmp);
    instructions.add(new AsmOPER("movls `d0, `s0, lsl #1", defs, uses));
   
    // BLS start
    LinkedList<Label> lbls = new LinkedList<Label>();
    lbls.add(start);
    instructions.add(new AsmOPER("bls " + start.name(), new LinkedList<Temp>(), new LinkedList<Temp>(), lbls));
   
    // Next label
    Label next = Label.newLabel();
    instructions.add(new AsmLABEL(next.name() + ":", next));
   
    // CMP R1, R2
    uses = new LinkedList<Temp>();
    uses.add(val1);
    uses.add(val2);
    instructions.add(new AsmOPER("cmp `s0, `s1", new LinkedList<Temp>(), uses));
   
    // SUBCS R1, R1, R2
    defs = new LinkedList<Temp>();
    defs.add(val1);
    instructions.add(new AsmOPER("subcs `d0, `s0, `s1", defs, uses));
   
    // ADDCS R0, R0, R3
    defs = new LinkedList<Temp>();
    defs.add(result);
    uses = new LinkedList<Temp>();
    uses.add(result);
    uses.add(tmp);
    instructions.add(new AsmOPER("addcs `d0, `s0, `s1", defs, uses));
   
    // MOVS R3, R3, LSR #1
    defs = new LinkedList<Temp>();
    defs.add(tmp);
    uses = new LinkedList<Temp>();
    uses.add(tmp);
    instructions.add(new AsmOPER("movs `d0, `s0, LSR #1", defs, uses));
   
    // MOVCC R2, R2, LSR #1
    defs = new LinkedList<Temp>();
    defs.add(val2);
    uses = new LinkedList<Temp>();
    uses.add(val2);
    instructions.add(new AsmOPER("movcc `d0, `s0, LSR #1", defs, uses));
   
    // BCC next
    lbls = new LinkedList<Label>();
    lbls.add(next);
    instructions.add(new AsmOPER("bcc " + next.name(), new LinkedList<Temp>(), new LinkedList<Temp>(), lbls));
   
    // Done
    return result;
  }
View Full Code Here

TOP

Related Classes of compiler.frames.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.