--- trunk/src/cpus/cpu_arm_instr_loadstore.c 2007/10/08 16:19:11 18 +++ trunk/src/cpus/cpu_arm_instr_loadstore.c 2007/10/08 16:19:23 20 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: cpu_arm_instr_loadstore.c,v 1.15 2005/10/27 14:01:13 debug Exp $ + * $Id: cpu_arm_instr_loadstore.c,v 1.19 2005/11/19 18:53:07 debug Exp $ * * * TODO: Many things... @@ -110,10 +110,9 @@ low_pc = ((size_t)ic - (size_t)cpu->cd.arm. cur_ic_page) / sizeof(struct arm_instr_call); - cpu->cd.arm.r[ARM_PC] &= ~((ARM_IC_ENTRIES_PER_PAGE-1) + cpu->pc &= ~((ARM_IC_ENTRIES_PER_PAGE-1) << ARM_INSTR_ALIGNMENT_SHIFT); - cpu->cd.arm.r[ARM_PC] += (low_pc << ARM_INSTR_ALIGNMENT_SHIFT); - cpu->pc = cpu->cd.arm.r[ARM_PC]; + cpu->pc += (low_pc << ARM_INSTR_ALIGNMENT_SHIFT); addr = reg(ic->arg[0]) #ifdef A__P @@ -233,8 +232,8 @@ * is_userpage array. If it is set, then we're ok. Otherwise: use the * generic function. */ - unsigned char x = cpu->cd.arm.is_userpage[addr >> 15]; - if (!(x & (1 << ((addr >> 12) & 7)))) + uint32_t x = cpu->cd.arm.is_userpage[addr >> 17]; + if (!(x & (1 << ((addr >> 12) & 31)))) A__NAME__general(cpu, ic); else #endif @@ -327,7 +326,7 @@ uint32_t low_pc, tmp; low_pc = ((size_t)ic - (size_t) cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call); - tmp = cpu->cd.arm.r[ARM_PC] & ~((ARM_IC_ENTRIES_PER_PAGE-1) << + tmp = cpu->pc & ~((ARM_IC_ENTRIES_PER_PAGE-1) << ARM_INSTR_ALIGNMENT_SHIFT); tmp += (low_pc << ARM_INSTR_ALIGNMENT_SHIFT); cpu->cd.arm.tmp_pc = tmp + 8; @@ -335,9 +334,9 @@ A__NAME(cpu, ic); if (ic->arg[2] == (size_t)(&cpu->cd.arm.r[ARM_PC])) { cpu->pc = cpu->cd.arm.r[ARM_PC]; + quick_pc_to_pointers(cpu); if (cpu->machine->show_trace_tree) cpu_functioncall_trace(cpu, cpu->pc); - quick_pc_to_pointers(cpu); } #else /* Store: */ @@ -345,7 +344,7 @@ /* Calculate tmp from this instruction's PC + 12 */ low_pc = ((size_t)ic - (size_t) cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call); - tmp = cpu->cd.arm.r[ARM_PC] & ~((ARM_IC_ENTRIES_PER_PAGE-1) << + tmp = cpu->pc & ~((ARM_IC_ENTRIES_PER_PAGE-1) << ARM_INSTR_ALIGNMENT_SHIFT); tmp += (low_pc << ARM_INSTR_ALIGNMENT_SHIFT); cpu->cd.arm.tmp_pc = tmp + 12; @@ -357,82 +356,82 @@ #ifndef A__NOCONDITIONS /* Load/stores with all registers except the PC register: */ void A__NAME__eq(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_Z) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_Z) A__NAME(cpu, ic); } void A__NAME__ne(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME(cpu, ic); } void A__NAME__cs(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_C) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_C) A__NAME(cpu, ic); } void A__NAME__cc(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_C)) A__NAME(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_C)) A__NAME(cpu, ic); } void A__NAME__mi(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_N) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_N) A__NAME(cpu, ic); } void A__NAME__pl(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_N)) A__NAME(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_N)) A__NAME(cpu, ic); } void A__NAME__vs(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_V) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_V) A__NAME(cpu, ic); } void A__NAME__vc(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_V)) A__NAME(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_V)) A__NAME(cpu, ic); } void A__NAME__hi(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_C && -!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_C && +!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME(cpu, ic); } void A__NAME__ls(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_Z || -!(cpu->cd.arm.cpsr & ARM_FLAG_C)) A__NAME(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_Z || +!(cpu->cd.arm.flags & ARM_F_C)) A__NAME(cpu, ic); } void A__NAME__ge(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) == -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0)) A__NAME(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) == +((cpu->cd.arm.flags & ARM_F_V)?1:0)) A__NAME(cpu, ic); } void A__NAME__lt(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) != -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0)) A__NAME(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) != +((cpu->cd.arm.flags & ARM_F_V)?1:0)) A__NAME(cpu, ic); } void A__NAME__gt(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) == -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0) && -!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) == +((cpu->cd.arm.flags & ARM_F_V)?1:0) && +!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME(cpu, ic); } void A__NAME__le(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) != -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0) || -(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) != +((cpu->cd.arm.flags & ARM_F_V)?1:0) || +(cpu->cd.arm.flags & ARM_F_Z)) A__NAME(cpu, ic); } /* Load/stores with the PC register: */ void A__NAME_PC__eq(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_Z) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_Z) A__NAME_PC(cpu, ic); } void A__NAME_PC__ne(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME_PC(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME_PC(cpu, ic); } void A__NAME_PC__cs(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_C) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_C) A__NAME_PC(cpu, ic); } void A__NAME_PC__cc(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_C)) A__NAME_PC(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_C)) A__NAME_PC(cpu, ic); } void A__NAME_PC__mi(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_N) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_N) A__NAME_PC(cpu, ic); } void A__NAME_PC__pl(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_N)) A__NAME_PC(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_N)) A__NAME_PC(cpu, ic); } void A__NAME_PC__vs(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_V) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_V) A__NAME_PC(cpu, ic); } void A__NAME_PC__vc(struct cpu *cpu, struct arm_instr_call *ic) -{ if (!(cpu->cd.arm.cpsr & ARM_FLAG_V)) A__NAME_PC(cpu, ic); } +{ if (!(cpu->cd.arm.flags & ARM_F_V)) A__NAME_PC(cpu, ic); } void A__NAME_PC__hi(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_C && -!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_C && +!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME_PC(cpu, ic); } void A__NAME_PC__ls(struct cpu *cpu, struct arm_instr_call *ic) -{ if (cpu->cd.arm.cpsr & ARM_FLAG_Z || -!(cpu->cd.arm.cpsr & ARM_FLAG_C)) A__NAME_PC(cpu, ic); } +{ if (cpu->cd.arm.flags & ARM_F_Z || +!(cpu->cd.arm.flags & ARM_F_C)) A__NAME_PC(cpu, ic); } void A__NAME_PC__ge(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) == -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0)) A__NAME_PC(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) == +((cpu->cd.arm.flags & ARM_F_V)?1:0)) A__NAME_PC(cpu, ic); } void A__NAME_PC__lt(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) != -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0)) A__NAME_PC(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) != +((cpu->cd.arm.flags & ARM_F_V)?1:0)) A__NAME_PC(cpu, ic); } void A__NAME_PC__gt(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) == -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0) && -!(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME_PC(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) == +((cpu->cd.arm.flags & ARM_F_V)?1:0) && +!(cpu->cd.arm.flags & ARM_F_Z)) A__NAME_PC(cpu, ic); } void A__NAME_PC__le(struct cpu *cpu, struct arm_instr_call *ic) -{ if (((cpu->cd.arm.cpsr & ARM_FLAG_N)?1:0) != -((cpu->cd.arm.cpsr & ARM_FLAG_V)?1:0) || -(cpu->cd.arm.cpsr & ARM_FLAG_Z)) A__NAME_PC(cpu, ic); } +{ if (((cpu->cd.arm.flags & ARM_F_N)?1:0) != +((cpu->cd.arm.flags & ARM_F_V)?1:0) || +(cpu->cd.arm.flags & ARM_F_Z)) A__NAME_PC(cpu, ic); } #endif