diff mbox series

[07/17] target/avr: Use do_stb in avr_cpu_do_interrupt

Message ID 20250323173730.3213964-8-richard.henderson@linaro.org
State Superseded
Headers show
Series target/avr: Increase page size | expand

Commit Message

Richard Henderson March 23, 2025, 5:37 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/avr/helper.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Philippe Mathieu-Daudé March 23, 2025, 9:31 p.m. UTC | #1
On 23/3/25 18:37, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/avr/helper.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Pierrick Bouvier March 25, 2025, 1:09 a.m. UTC | #2
On 3/23/25 10:37, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/avr/helper.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/target/avr/helper.c b/target/avr/helper.c
> index 7cfd3d1093..9608e59584 100644
> --- a/target/avr/helper.c
> +++ b/target/avr/helper.c
> @@ -88,14 +88,14 @@ void avr_cpu_do_interrupt(CPUState *cs)
>       }
>   
>       if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> -        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
> -        cpu_stb_data(env, env->sp--, (ret & 0xff0000) >> 16);
> +        do_stb(env, env->sp--, ret, 0);
> +        do_stb(env, env->sp--, ret >> 8, 0);
> +        do_stb(env, env->sp--, ret >> 16, 0);
>       } else if (avr_feature(env, AVR_FEATURE_2_BYTE_PC)) {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> -        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
> +        do_stb(env, env->sp--, ret, 0);
> +        do_stb(env, env->sp--, ret >> 8, 0);
>       } else {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> +        do_stb(env, env->sp--, ret, 0);
>       }
>   
>       env->pc_w = base + vector * size;

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/target/avr/helper.c b/target/avr/helper.c
index 7cfd3d1093..9608e59584 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -88,14 +88,14 @@  void avr_cpu_do_interrupt(CPUState *cs)
     }
 
     if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
-        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
-        cpu_stb_data(env, env->sp--, (ret & 0xff0000) >> 16);
+        do_stb(env, env->sp--, ret, 0);
+        do_stb(env, env->sp--, ret >> 8, 0);
+        do_stb(env, env->sp--, ret >> 16, 0);
     } else if (avr_feature(env, AVR_FEATURE_2_BYTE_PC)) {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
-        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
+        do_stb(env, env->sp--, ret, 0);
+        do_stb(env, env->sp--, ret >> 8, 0);
     } else {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
+        do_stb(env, env->sp--, ret, 0);
     }
 
     env->pc_w = base + vector * size;