@@ -595,9 +595,6 @@ static int gen_postprocess(DisasContext *dc, int slot)
595
595
gen_io_start ();
596
596
}
597
597
gen_helper_check_interrupts (cpu_env );
598
- if (tb_cflags (dc -> base .tb ) & CF_USE_ICOUNT ) {
599
- gen_io_end ();
600
- }
601
598
}
602
599
#endif
603
600
if (op_flags & XTENSA_OP_SYNC_REGISTER_WINDOW ) {
@@ -2191,7 +2188,11 @@ static void translate_rsil(DisasContext *dc, const OpcodeArg arg[],
2191
2188
static void translate_rsr (DisasContext * dc , const OpcodeArg arg [],
2192
2189
const uint32_t par [])
2193
2190
{
2194
- tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2191
+ if (sr_name [par [0 ]]) {
2192
+ tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2193
+ } else {
2194
+ tcg_gen_movi_i32 (arg [0 ].out , 0 );
2195
+ }
2195
2196
}
2196
2197
2197
2198
static void translate_rsr_ccount (DisasContext * dc , const OpcodeArg arg [],
@@ -2363,9 +2364,10 @@ static bool test_ill_simcall(DisasContext *dc, const OpcodeArg arg[],
2363
2364
#ifdef CONFIG_USER_ONLY
2364
2365
bool ill = true;
2365
2366
#else
2366
- bool ill = !semihosting_enabled ();
2367
+ /* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
2368
+ bool ill = dc -> config -> hw_version <= 250002 && !semihosting_enabled ();
2367
2369
#endif
2368
- if (ill ) {
2370
+ if (ill || ! semihosting_enabled () ) {
2369
2371
qemu_log_mask (LOG_GUEST_ERROR , "SIMCALL but semihosting is disabled\n" );
2370
2372
}
2371
2373
return ill ;
@@ -2375,7 +2377,9 @@ static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
2375
2377
const uint32_t par [])
2376
2378
{
2377
2379
#ifndef CONFIG_USER_ONLY
2378
- gen_helper_simcall (cpu_env );
2380
+ if (semihosting_enabled ()) {
2381
+ gen_helper_simcall (cpu_env );
2382
+ }
2379
2383
#endif
2380
2384
}
2381
2385
@@ -2563,13 +2567,17 @@ static void translate_wrmsk_expstate(DisasContext *dc, const OpcodeArg arg[],
2563
2567
static void translate_wsr (DisasContext * dc , const OpcodeArg arg [],
2564
2568
const uint32_t par [])
2565
2569
{
2566
- tcg_gen_mov_i32 (cpu_SR [par [0 ]], arg [0 ].in );
2570
+ if (sr_name [par [0 ]]) {
2571
+ tcg_gen_mov_i32 (cpu_SR [par [0 ]], arg [0 ].in );
2572
+ }
2567
2573
}
2568
2574
2569
2575
static void translate_wsr_mask (DisasContext * dc , const OpcodeArg arg [],
2570
2576
const uint32_t par [])
2571
2577
{
2572
- tcg_gen_andi_i32 (cpu_SR [par [0 ]], arg [0 ].in , par [2 ]);
2578
+ if (sr_name [par [0 ]]) {
2579
+ tcg_gen_andi_i32 (cpu_SR [par [0 ]], arg [0 ].in , par [2 ]);
2580
+ }
2573
2581
}
2574
2582
2575
2583
static void translate_wsr_acchi (DisasContext * dc , const OpcodeArg arg [],
@@ -2775,23 +2783,31 @@ static void translate_xor(DisasContext *dc, const OpcodeArg arg[],
2775
2783
static void translate_xsr (DisasContext * dc , const OpcodeArg arg [],
2776
2784
const uint32_t par [])
2777
2785
{
2778
- TCGv_i32 tmp = tcg_temp_new_i32 ();
2786
+ if (sr_name [par [0 ]]) {
2787
+ TCGv_i32 tmp = tcg_temp_new_i32 ();
2779
2788
2780
- tcg_gen_mov_i32 (tmp , arg [0 ].in );
2781
- tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2782
- tcg_gen_mov_i32 (cpu_SR [par [0 ]], tmp );
2783
- tcg_temp_free (tmp );
2789
+ tcg_gen_mov_i32 (tmp , arg [0 ].in );
2790
+ tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2791
+ tcg_gen_mov_i32 (cpu_SR [par [0 ]], tmp );
2792
+ tcg_temp_free (tmp );
2793
+ } else {
2794
+ tcg_gen_movi_i32 (arg [0 ].out , 0 );
2795
+ }
2784
2796
}
2785
2797
2786
2798
static void translate_xsr_mask (DisasContext * dc , const OpcodeArg arg [],
2787
2799
const uint32_t par [])
2788
2800
{
2789
- TCGv_i32 tmp = tcg_temp_new_i32 ();
2801
+ if (sr_name [par [0 ]]) {
2802
+ TCGv_i32 tmp = tcg_temp_new_i32 ();
2790
2803
2791
- tcg_gen_mov_i32 (tmp , arg [0 ].in );
2792
- tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2793
- tcg_gen_andi_i32 (cpu_SR [par [0 ]], tmp , par [2 ]);
2794
- tcg_temp_free (tmp );
2804
+ tcg_gen_mov_i32 (tmp , arg [0 ].in );
2805
+ tcg_gen_mov_i32 (arg [0 ].out , cpu_SR [par [0 ]]);
2806
+ tcg_gen_andi_i32 (cpu_SR [par [0 ]], tmp , par [2 ]);
2807
+ tcg_temp_free (tmp );
2808
+ } else {
2809
+ tcg_gen_movi_i32 (arg [0 ].out , 0 );
2810
+ }
2795
2811
}
2796
2812
2797
2813
static void translate_xsr_ccount (DisasContext * dc , const OpcodeArg arg [],
@@ -2819,7 +2835,11 @@ static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
2819
2835
{ \
2820
2836
TCGv_i32 tmp = tcg_temp_new_i32(); \
2821
2837
\
2822
- tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
2838
+ if (sr_name[par[0]]) { \
2839
+ tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
2840
+ } else { \
2841
+ tcg_gen_movi_i32(tmp, 0); \
2842
+ } \
2823
2843
translate_wsr_##name(dc, arg, par); \
2824
2844
tcg_gen_mov_i32(arg[0].out, tmp); \
2825
2845
tcg_temp_free(tmp); \
0 commit comments