qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
To: Peter Maydell <peter.maydell@linaro.org>, Stefan Weil <sw@weilnetz.de>
Cc: QEMU Developer <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-tricore: Fix two helper functions (clang warnings)
Date: Sat, 07 Mar 2015 14:36:28 +0000	[thread overview]
Message-ID: <54FB0CEC.8090207@mail.uni-paderborn.de> (raw)
In-Reply-To: <CAFEAcA8CWHytsbR9iKZY0FUKd=q=RiYae5CKeVMmaQP0ihnWTg@mail.gmail.com>



On 03/07/2015 12:34 PM, Peter Maydell wrote:
> On 7 March 2015 at 18:33, Stefan Weil <sw@weilnetz.de> wrote:
>> diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
>> index ed26b30..52ad80b 100644
>> --- a/target-tricore/op_helper.c
>> +++ b/target-tricore/op_helper.c
>> @@ -1244,9 +1244,9 @@ uint64_t helper_dvinit_b_13(CPUTriCoreState *env, uint32_t r1, uint32_t r2)
>>           quotient_sign = 1;
>>       }
>>
>> -    abs_sig_dividend = abs(r1) >> 7;
>> -    abs_base_dividend = abs(r1) & 0x7f;
>> -    abs_divisor = abs(r1);
>> +    abs_sig_dividend = abs((int32_t)r1) >> 7;
>> +    abs_base_dividend = abs((int32_t)r1) & 0x7f;
>> +    abs_divisor = abs((int32_t)r1);
> Also, surely some of these should be using r2, not r1?
> At the moment we seem to use r1 for both dividend and
> divisor, which does not look right at all...
>
> -- PMM
Thats correct, it should be:

abs_divisor = abs((int32_t)r2);

My test suit did not get this, because I was only testing with a ISA 
version 1.3.1 cpu and this is 1.3 exclusive. Thanks for finding those.

Cheers,
Bastian

      reply	other threads:[~2015-03-07 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07  9:33 [Qemu-devel] [PATCH] target-tricore: Fix two helper functions (clang warnings) Stefan Weil
2015-03-07 10:44 ` Bastian Koppelmann
2015-03-07 12:34 ` Peter Maydell
2015-03-07 14:36   ` Bastian Koppelmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FB0CEC.8090207@mail.uni-paderborn.de \
    --to=kbastian@mail.uni-paderborn.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).