mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/openrisc: Use identical sizes for ITLB and DTLB
The sizes are already the same, however, we can improve things if they are identical by design. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Stafford Horne <shorne@gmail.com>
This commit is contained in:
parent
b9bed1b9ab
commit
56c3a14156
4 changed files with 16 additions and 18 deletions
|
@ -80,7 +80,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
|
|||
env->shadow_gpr[idx / 32][idx % 32] = rb;
|
||||
break;
|
||||
|
||||
case TO_SPR(1, 512) ... TO_SPR(1, 512+DTLB_SIZE-1): /* DTLBW0MR 0-127 */
|
||||
case TO_SPR(1, 512) ... TO_SPR(1, 512 + TLB_SIZE - 1): /* DTLBW0MR 0-127 */
|
||||
idx = spr - TO_SPR(1, 512);
|
||||
mr = env->tlb.dtlb[idx].mr;
|
||||
if (mr & 1) {
|
||||
|
@ -91,7 +91,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
|
|||
}
|
||||
env->tlb.dtlb[idx].mr = rb;
|
||||
break;
|
||||
case TO_SPR(1, 640) ... TO_SPR(1, 640+DTLB_SIZE-1): /* DTLBW0TR 0-127 */
|
||||
case TO_SPR(1, 640) ... TO_SPR(1, 640 + TLB_SIZE - 1): /* DTLBW0TR 0-127 */
|
||||
idx = spr - TO_SPR(1, 640);
|
||||
env->tlb.dtlb[idx].tr = rb;
|
||||
break;
|
||||
|
@ -103,7 +103,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
|
|||
case TO_SPR(1, 1408) ... TO_SPR(1, 1535): /* DTLBW3TR 0-127 */
|
||||
break;
|
||||
|
||||
case TO_SPR(2, 512) ... TO_SPR(2, 512+ITLB_SIZE-1): /* ITLBW0MR 0-127 */
|
||||
case TO_SPR(2, 512) ... TO_SPR(2, 512 + TLB_SIZE - 1): /* ITLBW0MR 0-127 */
|
||||
idx = spr - TO_SPR(2, 512);
|
||||
mr = env->tlb.itlb[idx].mr;
|
||||
if (mr & 1) {
|
||||
|
@ -114,7 +114,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
|
|||
}
|
||||
env->tlb.itlb[idx].mr = rb;
|
||||
break;
|
||||
case TO_SPR(2, 640) ... TO_SPR(2, 640+ITLB_SIZE-1): /* ITLBW0TR 0-127 */
|
||||
case TO_SPR(2, 640) ... TO_SPR(2, 640 + TLB_SIZE - 1): /* ITLBW0TR 0-127 */
|
||||
idx = spr - TO_SPR(2, 640);
|
||||
env->tlb.itlb[idx].tr = rb;
|
||||
break;
|
||||
|
@ -247,11 +247,11 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
|
|||
idx = (spr - 1024);
|
||||
return env->shadow_gpr[idx / 32][idx % 32];
|
||||
|
||||
case TO_SPR(1, 512) ... TO_SPR(1, 512+DTLB_SIZE-1): /* DTLBW0MR 0-127 */
|
||||
case TO_SPR(1, 512) ... TO_SPR(1, 512 + TLB_SIZE - 1): /* DTLBW0MR 0-127 */
|
||||
idx = spr - TO_SPR(1, 512);
|
||||
return env->tlb.dtlb[idx].mr;
|
||||
|
||||
case TO_SPR(1, 640) ... TO_SPR(1, 640+DTLB_SIZE-1): /* DTLBW0TR 0-127 */
|
||||
case TO_SPR(1, 640) ... TO_SPR(1, 640 + TLB_SIZE - 1): /* DTLBW0TR 0-127 */
|
||||
idx = spr - TO_SPR(1, 640);
|
||||
return env->tlb.dtlb[idx].tr;
|
||||
|
||||
|
@ -263,11 +263,11 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
|
|||
case TO_SPR(1, 1408) ... TO_SPR(1, 1535): /* DTLBW3TR 0-127 */
|
||||
break;
|
||||
|
||||
case TO_SPR(2, 512) ... TO_SPR(2, 512+ITLB_SIZE-1): /* ITLBW0MR 0-127 */
|
||||
case TO_SPR(2, 512) ... TO_SPR(2, 512 + TLB_SIZE - 1): /* ITLBW0MR 0-127 */
|
||||
idx = spr - TO_SPR(2, 512);
|
||||
return env->tlb.itlb[idx].mr;
|
||||
|
||||
case TO_SPR(2, 640) ... TO_SPR(2, 640+ITLB_SIZE-1): /* ITLBW0TR 0-127 */
|
||||
case TO_SPR(2, 640) ... TO_SPR(2, 640 + TLB_SIZE - 1): /* ITLBW0TR 0-127 */
|
||||
idx = spr - TO_SPR(2, 640);
|
||||
return env->tlb.itlb[idx].tr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue