Esempio n. 1
0
static void tcg_opt_gen_mov(TCGContext *s, int op_index, TCGArg *gen_args,
                            TCGOpcode old_op, TCGArg dst, TCGArg src)
{
    struct tcg_temp_info *temps = s->temps2;
    TCGOpcode new_op = op_to_mov(s, old_op);
    tcg_target_ulong mask;

    s->gen_opc_buf[op_index] = new_op;

    reset_temp(s, dst);
    mask = temps[src].mask;
    if (TCG_TARGET_REG_BITS > 32 && new_op == INDEX_op_mov_i32) {
        /* High bits of the destination are now garbage.  */
        mask |= ~0xffffffffull;
    }
    temps[dst].mask = mask;

    assert(temps[src].state != TCG_TEMP_CONST);

    if (s->temps[src].type == s->temps[dst].type) {
        if (temps[src].state != TCG_TEMP_COPY) {
            temps[src].state = TCG_TEMP_COPY;
            temps[src].next_copy = src;
            temps[src].prev_copy = src;
        }
        temps[dst].state = TCG_TEMP_COPY;
        temps[dst].next_copy = temps[src].next_copy;
        temps[dst].prev_copy = src;
        temps[temps[dst].next_copy].prev_copy = dst;
        temps[src].next_copy = dst;
    }

    gen_args[0] = dst;
    gen_args[1] = src;
}
Esempio n. 2
0
main() {

   init_temp();
   lcd_init();
   delay_ms(6);
   
   reset_temp();

   while(TRUE)
   {
      current_temp = read_temp();

      if(input(RESET_BUTTON)==0)
         reset_temp();
      else if(current_temp>max_temp)
         max_temp=current_temp;
      else if(current_temp<min_temp)
         min_temp=current_temp;

      printf(lcd_putc,"\fCurrent Temp: %U F\nMin: %U Max: %U",                        current_temp,min_temp,max_temp);
      delay_ms(500);
   }
}
Esempio n. 3
0
static void tcg_opt_gen_movi(TCGContext *s, int op_index, TCGArg *gen_args,
                             TCGOpcode old_op, TCGArg dst, TCGArg val)
{
    struct tcg_temp_info *temps = s->temps2;
    TCGOpcode new_op = op_to_movi(s, old_op);
    tcg_target_ulong mask;

    s->gen_opc_buf[op_index] = new_op;

    reset_temp(s, dst);
    temps[dst].state = TCG_TEMP_CONST;
    temps[dst].val = val;
    mask = val;
    if (TCG_TARGET_REG_BITS > 32 && new_op == INDEX_op_mov_i32) {
        /* High bits of the destination are now garbage.  */
        mask |= ~0xffffffffull;
    }
    temps[dst].mask = mask;

    gen_args[0] = dst;
    gen_args[1] = val;
}