public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/26525] New: missed opportunity to use value in fp reg
@ 2006-03-02 2:40 amodra at bigpond dot net dot au
2006-03-02 3:07 ` [Bug target/26525] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: amodra at bigpond dot net dot au @ 2006-03-02 2:40 UTC (permalink / raw)
To: gcc-bugs
The following compiled with -m64 -O2 -S
double f1 (double xh)
{
long long hi = (long long) xh;
if (hi == __LONG_LONG_MAX__)
{
xh += -__LONG_LONG_MAX__ - 1;
xh += 1.0;
}
else
xh -= hi;
return xh;
}
generates
fctidz 0,1
li 0,-1
rldicl 0,0,0,1
stfd 0,-16(1)
ld 9,-16(1)
cmpd 7,9,0
beq 7,.L7
std 9,-16(1) #
nop #
nop #
nop #
lfd 13,-16(1) #
fcfid 0,13 #
fsub 1,1,0
blr
.p2align 4,,15
.L7:
lfs 0,.LC1@toc(2)
lfs 13,.LC3@toc(2)
fsub 0,1,0
fadd 1,0,13
blr
The sequence marked with # could be replaced with just one insn,
fcfid 0,0
because HI is in fr0 at that point.
A similar function
double f2 (double xh)
{
long long hi = (long long) xh;
xh -= hi;
if (hi == __LONG_LONG_MAX__)
{
xh += hi;
xh += -__LONG_LONG_MAX__ - 1;
xh += 1.0;
}
return xh;
}
does use the value in th fp reg
fctidz 0,1
li 0,-1
rldicl 0,0,0,1
stfd 0,-16(1)
fcfid 0,0 <== here
fsub 1,1,0
ld 9,-16(1)
cmpd 7,9,0
bnelr 7
fadd 0,0,1
lfs 13,.LC5@toc(2)
lfs 12,.LC7@toc(2)
fsub 0,0,13
fadd 1,0,12
blr
--
Summary: missed opportunity to use value in fp reg
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amodra at bigpond dot net dot au
GCC target triplet: powerpc64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/26525] missed opportunity to use value in fp reg
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
@ 2006-03-02 3:07 ` pinskia at gcc dot gnu dot org
2006-06-23 1:41 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-02 3:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-03-02 03:07 -------
This is definitely a RA issue.
(insn:HI 12 65 15 2 (set (reg/v:DI 121 [ hi ])
(fix:DI (reg/v:DF 123 [ xh ]))) 265 {fix_truncdfdi2}
(insn_list:REG_DEP_TRUE 6 (nil))
(nil))
(insn:HI 15 12 16 2 (set (reg:CC 125)
(compare:CC (reg/v:DI 121 [ hi ])
(reg:DI 124))) 412 {*cmpdi_internal1} (insn_list:REG_DEP_TRUE 65
(insn_list:REG_DEP_TRUE 12 (nil)))
(expr_list:REG_DEAD (reg:DI 124)
(expr_list:REG_EQUAL (compare:CC (reg/v:DI 121 [ hi ])
(const_int 9223372036854775807 [0x7fffffffffffffff]))
(nil))))
...
(insn:HI 36 34 37 4 (set (reg:DF 132)
(float:DF (reg/v:DI 121 [ hi ]))) 262 {floatdidf2} (nil)
(expr_list:REG_DEAD (reg/v:DI 121 [ hi ])
(nil)))
The problem is that we need to put 121 into an integer register for the compare
but also in a fp register for the int-to-float.
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |missed-optimization, ra
Last reconfirmed|0000-00-00 00:00:00 |2006-03-02 03:07:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/26525] missed opportunity to use value in fp reg
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
2006-03-02 3:07 ` [Bug target/26525] " pinskia at gcc dot gnu dot org
@ 2006-06-23 1:41 ` pinskia at gcc dot gnu dot org
2007-10-23 17:13 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-23 1:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-06-23 01:41 -------
I knew when I filed PR 27946, I saw it before. The reason why I am closing
this one as a dup of that is because PR 27946 has a simple testcase and
mentions that YARA already fixes the problem.
*** This bug has been marked as a duplicate of 27946 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/26525] missed opportunity to use value in fp reg
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
2006-03-02 3:07 ` [Bug target/26525] " pinskia at gcc dot gnu dot org
2006-06-23 1:41 ` pinskia at gcc dot gnu dot org
@ 2007-10-23 17:13 ` pinskia at gcc dot gnu dot org
2008-09-14 3:28 ` pinskia at gcc dot gnu dot org
2009-05-14 3:19 ` bje at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-23 17:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-10-23 17:13 -------
Actually this is not fully the same issue as the other PR as I can make the
other PR work if I use "?f#r" as the constaint but not this one. So reope
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/26525] missed opportunity to use value in fp reg
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
` (2 preceding siblings ...)
2007-10-23 17:13 ` pinskia at gcc dot gnu dot org
@ 2008-09-14 3:28 ` pinskia at gcc dot gnu dot org
2009-05-14 3:19 ` bje at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-14 3:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-09-14 03:27 -------
This still happens with IRA.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/26525] missed opportunity to use value in fp reg
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
` (3 preceding siblings ...)
2008-09-14 3:28 ` pinskia at gcc dot gnu dot org
@ 2009-05-14 3:19 ` bje at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: bje at gcc dot gnu dot org @ 2009-05-14 3:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from bje at gcc dot gnu dot org 2009-05-14 03:19 -------
Still present in GCC: (GNU) 4.5.0 20090513 (experimental) [trunk revision
147498].
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26525
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-14 3:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-02 2:40 [Bug target/26525] New: missed opportunity to use value in fp reg amodra at bigpond dot net dot au
2006-03-02 3:07 ` [Bug target/26525] " pinskia at gcc dot gnu dot org
2006-06-23 1:41 ` pinskia at gcc dot gnu dot org
2007-10-23 17:13 ` pinskia at gcc dot gnu dot org
2008-09-14 3:28 ` pinskia at gcc dot gnu dot org
2009-05-14 3: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).