public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/31557] return 0x80000000UL code gen can be improved
[not found] <bug-31557-4@http.gcc.gnu.org/bugzilla/>
@ 2012-08-13 23:03 ` PHHargrove at lbl dot gov
2012-08-14 0:31 ` PHHargrove at lbl dot gov
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: PHHargrove at lbl dot gov @ 2012-08-13 23:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557
Paul H. Hargrove <PHHargrove at lbl dot gov> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |PHHargrove at lbl dot gov
--- Comment #3 from Paul H. Hargrove <PHHargrove at lbl dot gov> 2012-08-13 23:03:06 UTC ---
FWIW, 4.8.0 20120809 w/ -O1 or higher is now using just 4 instructions instead
of 5. So, "half way there".
.L.f:
lis 3,0x8000
ori 3,3,1
rldicl 3,3,0,32
blr
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/31557] return 0x80000000UL code gen can be improved
[not found] <bug-31557-4@http.gcc.gnu.org/bugzilla/>
2012-08-13 23:03 ` [Bug target/31557] return 0x80000000UL code gen can be improved PHHargrove at lbl dot gov
@ 2012-08-14 0:31 ` PHHargrove at lbl dot gov
2024-03-05 0:16 ` bergner at gcc dot gnu.org
2024-03-05 0:20 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 6+ messages in thread
From: PHHargrove at lbl dot gov @ 2012-08-14 0:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557
--- Comment #4 from Paul H. Hargrove <PHHargrove at lbl dot gov> 2012-08-14 00:31:14 UTC ---
(In reply to comment #3)
> FWIW, 4.8.0 20120809 w/ -O1 or higher is now using just 4 instructions instead
> of 5. So, "half way there".
>
>
> .L.f:
> lis 3,0x8000
> ori 3,3,1
> rldicl 3,3,0,32
> blr
That was for a 64-bit target, where the need to zero the upper half of r3
(which is 0xffffffff due to sign extension of 0x8000 by 'lis') accounts for the
4th instruction. So, there is still room for improvement using the originally
proposed 3-instruction sequence (since 'oris' won't sign-extend as 'lis' does).
For a 32-bit target, it appears that GCC 4.8.0 20120809 has reached the desired
three instructions:
f:
lis 3,0x8000
ori 3,3,1
blr
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/31557] return 0x80000000UL code gen can be improved
[not found] <bug-31557-4@http.gcc.gnu.org/bugzilla/>
2012-08-13 23:03 ` [Bug target/31557] return 0x80000000UL code gen can be improved PHHargrove at lbl dot gov
2012-08-14 0:31 ` PHHargrove at lbl dot gov
@ 2024-03-05 0:16 ` bergner at gcc dot gnu.org
2024-03-05 0:20 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 6+ messages in thread
From: bergner at gcc dot gnu.org @ 2024-03-05 0:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
CC| |bergner at gcc dot gnu.org
Status|REOPENED |RESOLVED
--- Comment #7 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #6)
> Actually, huh, *not* fixed on trunk yet.
This was fixed in GCC 13. Marking it as FIXED.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/31557] return 0x80000000UL code gen can be improved
[not found] <bug-31557-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2024-03-05 0:16 ` bergner at gcc dot gnu.org
@ 2024-03-05 0:20 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-05 0:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/31557] New: return 0x80000000UL code gen can be improved
@ 2007-04-12 21:10 pinskia at gcc dot gnu dot org
2007-07-02 21:35 ` [Bug target/31557] " pinskia at gcc dot gnu dot org
2009-05-14 5:19 ` bje at gcc dot gnu dot org
0 siblings, 2 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-12 21:10 UTC (permalink / raw)
To: gcc-bugs
Testcase:
unsigned int f(void)
{
return 0x80000001UL;
}
This should be able to done in three instructions:
.f:
li 3,1
oris 3,3,0x8000
blr
Right now it is done as:
.L.f:
li 3,0
ori 3,3,32768
sldi 3,3,16
ori 3,3,1
blr
Which is (0x8000 << 16) | 1 but (0x8000 << 16) is what is done for oris.
--
Summary: return 0x80000000UL code gen can be improved
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-05 0:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-31557-4@http.gcc.gnu.org/bugzilla/>
2012-08-13 23:03 ` [Bug target/31557] return 0x80000000UL code gen can be improved PHHargrove at lbl dot gov
2012-08-14 0:31 ` PHHargrove at lbl dot gov
2024-03-05 0:16 ` bergner at gcc dot gnu.org
2024-03-05 0:20 ` pinskia at gcc dot gnu.org
2007-04-12 21:10 [Bug target/31557] New: " pinskia at gcc dot gnu dot org
2007-07-02 21:35 ` [Bug target/31557] " pinskia at gcc dot gnu dot org
2009-05-14 5:19 ` bje at gcc dot gnu dot org
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).