Revision 548f66db

b/target-sparc/translate.c
1286 1286
}
1287 1287
#endif
1288 1288

  
1289
/* XXX: potentially incorrect if dynamic npc */
1290 1289
static void do_branch(DisasContext *dc, int32_t offset, uint32_t insn, int cc,
1291 1290
                      TCGv r_cond)
1292 1291
{
......
1321 1320
        } else {
1322 1321
            dc->pc = dc->npc;
1323 1322
            dc->jump_pc[0] = target;
1324
            dc->jump_pc[1] = dc->npc + 4;
1325
            dc->npc = JUMP_PC;
1323
            if (unlikely(dc->npc == DYNAMIC_PC)) {
1324
                dc->jump_pc[1] = DYNAMIC_PC;
1325
                tcg_gen_addi_tl(cpu_pc, cpu_npc, 4);
1326
            } else {
1327
                dc->jump_pc[1] = dc->npc + 4;
1328
                dc->npc = JUMP_PC;
1329
            }
1326 1330
        }
1327 1331
    }
1328 1332
}
1329 1333

  
1330
/* XXX: potentially incorrect if dynamic npc */
1331 1334
static void do_fbranch(DisasContext *dc, int32_t offset, uint32_t insn, int cc,
1332 1335
                      TCGv r_cond)
1333 1336
{
......
1362 1365
        } else {
1363 1366
            dc->pc = dc->npc;
1364 1367
            dc->jump_pc[0] = target;
1365
            dc->jump_pc[1] = dc->npc + 4;
1366
            dc->npc = JUMP_PC;
1368
            if (unlikely(dc->npc == DYNAMIC_PC)) {
1369
                dc->jump_pc[1] = DYNAMIC_PC;
1370
                tcg_gen_addi_tl(cpu_pc, cpu_npc, 4);
1371
            } else {
1372
                dc->jump_pc[1] = dc->npc + 4;
1373
                dc->npc = JUMP_PC;
1374
            }
1367 1375
        }
1368 1376
    }
1369 1377
}
1370 1378

  
1371 1379
#ifdef TARGET_SPARC64
1372
/* XXX: potentially incorrect if dynamic npc */
1373 1380
static void do_branch_reg(DisasContext *dc, int32_t offset, uint32_t insn,
1374 1381
                          TCGv r_cond, TCGv r_reg)
1375 1382
{
......
1384 1391
    } else {
1385 1392
        dc->pc = dc->npc;
1386 1393
        dc->jump_pc[0] = target;
1387
        dc->jump_pc[1] = dc->npc + 4;
1388
        dc->npc = JUMP_PC;
1394
        if (unlikely(dc->npc == DYNAMIC_PC)) {
1395
            dc->jump_pc[1] = DYNAMIC_PC;
1396
            tcg_gen_addi_tl(cpu_pc, cpu_npc, 4);
1397
        } else {
1398
            dc->jump_pc[1] = dc->npc + 4;
1399
            dc->npc = JUMP_PC;
1400
        }
1389 1401
    }
1390 1402
}
1391 1403

  

Also available in: Unified diff