From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F21AB3858414; Wed, 24 May 2023 11:57:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F21AB3858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684929441; bh=Z+IVOp/swEBfrReWclxbBIuaFsAJUcaFY+jp+mafrU8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rLt5REUPds1j/k+jHnJCT/7xqRaCQEuf7Yzw3DIpu4ueVqUkodDPjoguvbxYh5Lz0 Iq/+yQdtITJ3dIbzNu8qNIpp5l4mLK0AYco1bKrLHrqJJb5BHKuy5vK42XzAMGHiWF +J5sUZg8SbyerFbf/O+BzbzXpC0kbFtZUq/QmzMo= From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49263] SH Target: underutilized "TST #imm, R0" instruction Date: Wed, 24 May 2023 11:57:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.6.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: olegendo at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49263 --- Comment #36 from Oleg Endo --- (In reply to Alexander Klepikov from comment #35) >=20 > As I understand, you meant the following (I added new functions at the end > of file): >=20 > $ cat f.c > #define ADDR 0xFFFF0000 > #define P ((unsigned char *)ADDR) > #define FLAG 0x40 > #define S 7 > .... Yes, that's what I meant, thanks. Can you also compile for little endian, and most of all, use -O2 optimizati= on level. Some optimizations are not done below -O2. >=20 > I choose that name because I wanted to disable dynamic shift instructions > for all CPUs. I did not hope that it will affect SH-2E code in such way. >=20 > I can rewrite the patch so that it only affects CPUs that do not support > dynamic shifts and disables library call for dynamic shifts. I'll do it > anyway because I need it badly. How do you think, what name of option wou= ld > be better: '-mdisable-dynshift-libcall' or '-mhw-shift'? Or if you want, > please suggest another one. Thank you! '-mdisable-dynshift-libcall' would be more appropriate for what it tries to= do, I think. Although that is a whole different issue ... but what is it going= to do for real dynamic shifts on SH2? What kind of code is it supposed to emit for things like unsigned int dyn_shift (unsigned int x, unsigned int y) { return x << (y & 31); }=