示例#1
0
文件: r1c.c 项目: ShaneRyanKelly/r1d
//-----------------------------------------
int mult(int left, int right)
{
   int temp;
   emitLoad(left);
   emitInstructionSI("mult", right);
   freeTemp(left);
   freeTemp(right);
   temp = getTemp();
   emitInstructionSI("st", temp);
   return temp;
}
示例#2
0
文件: r1c.c 项目: ShaneRyanKelly/r1d
//-----------------------------------------
void println(int expVal)
{
   emitLoad(expVal);
   freeTemp(expVal);
   emitInstruction1("dout");
   emitInstructionSS("ldc", "'\\n'");
   emitInstruction1("aout");
}
示例#3
0
void moveCR2(Context* con, unsigned size, lir::Constant* src,
        lir::Register* dst, Promise* callOffset)
{
  if (isFpr(dst)) { // floating-point
    lir::Register tmp = size > 4 ? makeTemp64(con) :
                                         makeTemp(con);
    moveCR(con, size, src, size, &tmp);
    moveRR(con, size, &tmp, size, dst);
    freeTemp(con, tmp);
  } else if (size > 4) { 
    uint64_t value = (uint64_t)src->value->value();
    ResolvedPromise loBits(value & MASK_LO32);
    lir::Constant srcLo(&loBits);
    ResolvedPromise hiBits(value >> 32); 
    lir::Constant srcHi(&hiBits);
    lir::Register dstHi(dst->high);
    moveCR(con, 4, &srcLo, 4, dst);
    moveCR(con, 4, &srcHi, 4, &dstHi);
  } else if (src->value->resolved() and isOfWidth(getValue(src), 8)) {
示例#4
0
文件: r1c.c 项目: ShaneRyanKelly/r1d
//-----------------------------------------
void assign(int left, int expVal)
{
   emitLoad(expVal);
   freeTemp(expVal);
   emitInstructionSI("st", left);
}