pike.git / src / code / amd64.c

version» Context lines:

pike.git/src/code/amd64.c:2165:       LABEL_C; /* Branch or not? */    test_reg( REG_RAX );    return jnz_imm_rel32(0);       case F_BRANCH_WHEN_EQ: /* sp[-2] != sp[-1] */    case F_BRANCH_WHEN_NE: /* sp[-2] != sp[-1] */   /* START_JUMP();*/    ins_debug_instr_prologue(op, 0, 0);    amd64_load_sp_reg(); -  mov_mem16_reg( sp_reg, -sizeof(struct svalue), REG_RAX ); +  mov_mem16_reg( sp_reg, -sizeof(struct svalue), REG_RCX );    mov_mem16_reg( sp_reg, -sizeof(struct svalue)*2,REG_RBX ); -  cmp_reg_reg( REG_RAX, REG_RBX ); +  cmp_reg_reg( REG_RCX, REG_RBX );    jnz( &label_A ); /* Types differ */ -  cmp_reg32_imm( REG_RAX, PIKE_T_OBJECT ); -  je( &label_A ); /* Do not even bother with objects.. */ +     -  +  /* Fallback to C for functions, objects and floats. */ +  mov_imm_reg(1, REG_RBX); +  shl_reg32_reg(REG_RBX, REG_RCX); +  and_reg_imm(REG_RBX, (BIT_FUNCTION|BIT_OBJECT|BIT_FLOAT)); +  jnz( &label_A ); +     mov_mem_reg( sp_reg, -sizeof(struct svalue)+8, REG_RBX );    sub_reg_mem( REG_RBX, sp_reg, -sizeof(struct svalue)*2+8);    /* RBX will now be 0 if they are equal.*/       /* Optimization: The types are equal, pop_stack can be greatly -  * simplified if they are < max_reg_type */ -  cmp_reg32_imm( REG_RAX,MAX_REF_TYPE+1); +  * simplified if they are <= max_ref_type */ +  cmp_reg32_imm( REG_RCX,MAX_REF_TYPE+1);    jl( &label_B ); -  /* cheap pop. We know that both are >= max_ref_type */ +  /* cheap pop. We know that both are > max_ref_type */    amd64_add_sp( -2 );    jmp( &label_D );       LABEL_A; /* Fallback - call opcode. */    amd64_call_c_opcode( instrs[F_BRANCH_WHEN_NE-F_OFFSET].address,    instrs[F_BRANCH_WHEN_NE-F_OFFSET].flags );    amd64_load_sp_reg();    /* Opcode returns 0 if equal, -1 if not. */    mov_reg_reg(REG_RAX, REG_RBX);    jmp(&label_D);