diff mbox series

[2/3] target/hppa: sub: fix trap on overflow for narrow mode

Message ID 20240321184228.611897-2-svens@stackframe.org
State New
Headers show
Series [1/3] target/hppa: add unit conditions for wide mode | expand

Commit Message

Sven Schnelle March 21, 2024, 6:42 p.m. UTC
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 target/hppa/translate.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Henderson March 21, 2024, 8:03 p.m. UTC | #1
On 3/21/24 08:42, Sven Schnelle wrote:
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
> ---
>   target/hppa/translate.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index f493e207e1..4d2b96f876 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -1213,6 +1213,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1,
>       if (is_tsv || cond_need_sv(c)) {
>           sv = do_sub_sv(ctx, dest, in1, in2);
>           if (is_tsv) {
> +            if (!d) {
> +                tcg_gen_ext32s_i64(sv, sv);
> +            }
>               gen_helper_tsv(tcg_env, sv);
>           }
>       }

Difficult to pinpoint exactly which patch should have added this.  :-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Sven Schnelle March 21, 2024, 8:08 p.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> writes:

> On 3/21/24 08:42, Sven Schnelle wrote:
>> Signed-off-by: Sven Schnelle <svens@stackframe.org>
>> ---
>>   target/hppa/translate.c | 3 +++
>>   1 file changed, 3 insertions(+)
>> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
>> index f493e207e1..4d2b96f876 100644
>> --- a/target/hppa/translate.c
>> +++ b/target/hppa/translate.c
>> @@ -1213,6 +1213,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1,
>>       if (is_tsv || cond_need_sv(c)) {
>>           sv = do_sub_sv(ctx, dest, in1, in2);
>>           if (is_tsv) {
>> +            if (!d) {
>> +                tcg_gen_ext32s_i64(sv, sv);
>> +            }
>>               gen_helper_tsv(tcg_env, sv);
>>           }
>>       }
>
> Difficult to pinpoint exactly which patch should have added this.  :-)

Yes, after missing the Fixes: tags on all of my patches in the last
patchset, i tried add one but wasn't sure either. :-)

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Thanks!
diff mbox series

Patch

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index f493e207e1..4d2b96f876 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1213,6 +1213,9 @@  static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1,
     if (is_tsv || cond_need_sv(c)) {
         sv = do_sub_sv(ctx, dest, in1, in2);
         if (is_tsv) {
+            if (!d) {
+                tcg_gen_ext32s_i64(sv, sv);
+            }
             gen_helper_tsv(tcg_env, sv);
         }
     }