public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108073] New: [rs6000] sub-optimal float member accessing on struct parameter
@ 2022-12-12 12:15 guojiufu at gcc dot gnu.org
2022-12-12 12:30 ` [Bug middle-end/108073] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: guojiufu at gcc dot gnu.org @ 2022-12-12 12:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108073
Bug ID: 108073
Summary: [rs6000] sub-optimal float member accessing on struct
parameter
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: guojiufu at gcc dot gnu.org
Target Milestone: ---
For the below code:
typedef struct DF {double a[4]; long l; } DF;
double __attribute__ ((noipa)) foo_df (DF arg){return arg.a[3];}
At -O2, with gcc trunk(13.0), we get below sequence:
std 6,-24(1)
ori 2,2,0
lfd 1,-24(1)
blr
Actually, just one "mtvsrd 1, 6" is enough.
In this case, the argument is passed through integer registers.
For below code, it is similar:
typedef struct SF {float a[4];short l; } SF;
float foo (SF arg){return arg.a[3];}
std 4,-24(1)
ori 2,2,0
lfs 1,-20(1)
vs. below seq seems faster.
rldicr 4,4,0,31
mtvsrd 1,4
xscvspdpn 1,1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/108073] [rs6000] sub-optimal float member accessing on struct parameter
2022-12-12 12:15 [Bug c/108073] New: [rs6000] sub-optimal float member accessing on struct parameter guojiufu at gcc dot gnu.org
@ 2022-12-12 12:30 ` pinskia at gcc dot gnu.org
2022-12-20 8:59 ` jskumari at gcc dot gnu.org
2022-12-21 6:46 ` guojiufu at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-12 12:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108073
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/108073] [rs6000] sub-optimal float member accessing on struct parameter
2022-12-12 12:15 [Bug c/108073] New: [rs6000] sub-optimal float member accessing on struct parameter guojiufu at gcc dot gnu.org
2022-12-12 12:30 ` [Bug middle-end/108073] " pinskia at gcc dot gnu.org
@ 2022-12-20 8:59 ` jskumari at gcc dot gnu.org
2022-12-21 6:46 ` guojiufu at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: jskumari at gcc dot gnu.org @ 2022-12-20 8:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108073
Surya Kumari Jangala <jskumari at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jskumari at gcc dot gnu.org
--- Comment #1 from Surya Kumari Jangala <jskumari at gcc dot gnu.org> ---
Hi Jiu Fu Guo, are you working on this bug? If not, I would like to take this
up.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/108073] [rs6000] sub-optimal float member accessing on struct parameter
2022-12-12 12:15 [Bug c/108073] New: [rs6000] sub-optimal float member accessing on struct parameter guojiufu at gcc dot gnu.org
2022-12-12 12:30 ` [Bug middle-end/108073] " pinskia at gcc dot gnu.org
2022-12-20 8:59 ` jskumari at gcc dot gnu.org
@ 2022-12-21 6:46 ` guojiufu at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: guojiufu at gcc dot gnu.org @ 2022-12-21 6:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108073
--- Comment #2 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
(In reply to Surya Kumari Jangala from comment #1)
> Hi Jiu Fu Guo, are you working on this bug? If not, I would like to take
> this up.
Thanks for your asking!
I drafted an experimental patch. Welcome for any comments or refactoring :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-21 6:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 12:15 [Bug c/108073] New: [rs6000] sub-optimal float member accessing on struct parameter guojiufu at gcc dot gnu.org
2022-12-12 12:30 ` [Bug middle-end/108073] " pinskia at gcc dot gnu.org
2022-12-20 8:59 ` jskumari at gcc dot gnu.org
2022-12-21 6:46 ` guojiufu at gcc dot gnu.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).