Lines Matching full:pc
15 unsigned long pc = regs->csr_era; in simu_pc() local
19 if (pc & 3) { in simu_pc()
20 pr_warn("%s: invalid pc 0x%lx\n", __func__, pc); in simu_pc()
26 regs->regs[rd] = pc + sign_extend64(imm << 2, 21); in simu_pc()
29 regs->regs[rd] = pc + sign_extend64(imm << 12, 31); in simu_pc()
32 regs->regs[rd] = pc + sign_extend64(imm << 18, 37); in simu_pc()
35 regs->regs[rd] = pc + sign_extend64(imm << 12, 31); in simu_pc()
49 unsigned long pc = regs->csr_era; in simu_branch() local
51 if (pc & 3) { in simu_branch()
52 pr_warn("%s: invalid pc 0x%lx\n", __func__, pc); in simu_branch()
60 regs->csr_era = pc + sign_extend64((imm_h << 16 | imm_l) << 2, 27); in simu_branch()
63 regs->csr_era = pc + sign_extend64((imm_h << 16 | imm_l) << 2, 27); in simu_branch()
64 regs->regs[1] = pc + LOONGARCH_INSN_SIZE; in simu_branch()
74 regs->csr_era = pc + sign_extend64((imm_h << 16 | imm_l) << 2, 22); in simu_branch()
76 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
80 regs->csr_era = pc + sign_extend64((imm_h << 16 | imm_l) << 2, 22); in simu_branch()
82 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
92 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
94 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
98 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
100 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
104 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
106 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
110 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
112 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
116 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
118 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
122 regs->csr_era = pc + sign_extend64(imm << 2, 17); in simu_branch()
124 regs->csr_era = pc + LOONGARCH_INSN_SIZE; in simu_branch()
128 regs->regs[rd] = pc + LOONGARCH_INSN_SIZE; in simu_branch()
226 u32 larch_insn_gen_b(unsigned long pc, unsigned long dest) in larch_insn_gen_b() argument
228 long offset = dest - pc; in larch_insn_gen_b()
241 u32 larch_insn_gen_bl(unsigned long pc, unsigned long dest) in larch_insn_gen_bl() argument
243 long offset = dest - pc; in larch_insn_gen_bl()