pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:2834:    test_reg(P_REG_RBX);    return jnz_imm_rel32(0);       case F_LOOP:    START_JUMP();    /* counter in pike_sp-1 */    /* decrement until 0. */    /* if not 0, branch */    /* otherwise, pop */    amd64_load_sp_reg(); -  mov_mem32_reg( sp_reg, -sizeof(struct svalue), P_REG_RAX ); +  mov_mem32_reg( sp_reg, SVAL(-1).type, P_REG_RAX );    /* Is it a normal integer? subtype -> 0, type -> PIKE_T_INT */    cmp_reg32_imm( P_REG_RAX, PIKE_T_INT );    jne( &label_A );    -  /* if it is, is it 0? */ -  mov_mem_reg( sp_reg, -sizeof(struct svalue)+8, P_REG_RAX ); -  test_reg(P_REG_RAX); -  jz( &label_B ); /* it is. */ +  /* if it is, is it <= 0? */ +  mov_mem_reg( sp_reg, SVAL(-1).value, P_REG_RAX ); +  cmp_reg_imm(P_REG_RAX,0); +  jle(&label_B); /* it is. */    -  add_reg_imm( P_REG_RAX, -1 ); -  mov_reg_mem( P_REG_RAX, sp_reg, -sizeof(struct svalue)+8); -  mov_imm_reg( 1, P_REG_RAX ); +  /* add_reg_imm( P_REG_RAX, -1 ); */ +  /* mov_reg_mem( P_REG_RAX, sp_reg, -sizeof(struct svalue)+8); */ +  add_mem_imm( sp_reg, SVAL(-1).value, -1 ); +  /* REG_RAX known true, so no need to set it to 1. */ +  /* mov_imm_reg( 1, P_REG_RAX ); */    /* decremented. Jump -> true. */       /* This is where we would really like to have two instances of    * the target returned from this function...    */    jmp( &label_C );       LABEL_A; /* Not an integer. */    amd64_call_c_opcode(instrs[F_LOOP-F_OFFSET].address,    instrs[F_LOOP-F_OFFSET].flags );