From: Jeff Law <jeffreyalaw@gmail.com>
To: Andrew Burgess <aburgess@redhat.com>,
apinski--- via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Fwd: Yet another fix for mcore-sim
Date: Mon, 18 Dec 2023 22:09:21 -0700 [thread overview]
Message-ID: <fd0485f1-e54c-4762-8d44-d5e6b3263fd8@gmail.com> (raw)
In-Reply-To: <87plz34qnv.fsf@redhat.com>
On 12/18/23 05:54, Andrew Burgess wrote:
> Jeff Law <jeffreyalaw@gmail.com> writes:
>
>> Someday I'll type "sourceware.org" correctly on a consistent basis.
>>
>>
>>
>> -------- Forwarded Message --------
>> Subject: Yet another fix for mcore-sim
>> Date: Sat, 16 Dec 2023 21:52:12 -0700
>> From: Jeff Law <jeffreyalaw@gmail.com>
>> To: gdb-patches@sourcware.org
>>
>>
>> This came up testing the CRC optimization work from Mariam@RAU.
>> Basically to optimize some CRC loops into table lookups or carryless
>> multiplies, we may need to do a bit reflection, which on the mcore
>> processor is done using a rotate instruction.
>>
>> Unfortunately the simulator implementation of rotates has the exact same
>> problem as we saw with right shifts. The input value may have been sign
>> extended from 32 to 64 bits. When we rotate the extended value, we get
>> those sign extension bits and thus the wrong result.
>>
>> The fix is the same. Rather than using a "long", use a uint32_t for the
>> type of the temporary. This fixes a handful of tests in the GCC testsuite:
>>
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O0 execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O1 execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O3 -g execution test
>>> mcore-sim: gcc.c-torture/execute/20100805-1.c -Os execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O0 execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O1 execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O3 -g execution test
>>> mcore-sim: gcc.c-torture/execute/20180112-1.c -Os execution test
>>> mcore-sim: gcc.dg/20050922-1.c execution test
>>> mcore-sim: gcc.dg/crc-25.c execution test
>>> mcore-sim: gcc.dg/crc-26.c execution test
>>> mcore-sim: gcc.dg/crc-8.c execution test
>>> mcore-sim: gcc.dg/pr57233.c execution test
>>
>>
>> The crc-* tests are Mariam's CRC optimizer tests. The rest are
>> regression tests already in the GCC testsuite.
>>
>> OK for the trunk?
>
> It would be nice if there were some tests added to the simulator tree.
> Could you create one similar to sim/testsuite/mcore/lsr.s maybe?
>
> (Pre-)Approved with a test:
Test added. Fix and test pushed to the trunk.
Thanks,
jeff
ps. Hadn't realized you'd moved to Red Hat. Looks like we missed each
other by about ~6 months.
prev parent reply other threads:[~2023-12-19 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f575f00a-a283-4d48-8477-495767e701f0@gmail.com>
2023-12-17 4:54 ` Jeff Law
2023-12-18 12:54 ` Andrew Burgess
2023-12-19 5:09 ` Jeff Law [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=fd0485f1-e54c-4762-8d44-d5e6b3263fd8@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).