public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52934] New: enhancement: cshift0 should be inlined
@ 2012-04-11 12:45 matz at gcc dot gnu.org
2012-04-11 12:51 ` [Bug fortran/52934] " burnus at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: matz at gcc dot gnu.org @ 2012-04-11 12:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52934
Bug #: 52934
Summary: enhancement: cshift0 should be inlined
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: matz@gcc.gnu.org
polyhedrons protein would improve quite a bit when the cshift0 intrinsic
would be inlined. With the patch below on my machine the runtime for
protein drops from 0m21.367s to 0m19.227s (i.e. by 10%). Inlining a generic
cshift probably wouldn't bring the same improvement, but still.
(a bit related is my patch to improve cshift0 at
http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00533.html )
--- protein.f90.mm 2011-12-02 16:22:47.000000000 +0100
+++ protein.f90 2011-12-02 16:16:38.000000000 +0100
@@ -250,7 +250,20 @@ out3: do n1 = 1, polypeptide_len
!
total_surface_energy = 0
true_total_surface_energy = 0.0_LONGreal
- shifted_surface_sequence = cshift(surface_sequence(:,l),m-1)
+ if (m == 1) then
+ shifted_surface_sequence = surface_sequence(:,l)
+ else if (m == 2) then
+ shifted_surface_sequence(1:3) = surface_sequence(2:4,l)
+ shifted_surface_sequence(4) = surface_sequence(1,l)
+ else if (m == 3) then
+ shifted_surface_sequence(1:2) = surface_sequence(3:4,l)
+ shifted_surface_sequence(3:4) = surface_sequence(1:2,l)
+ else if (m == 4) then
+ shifted_surface_sequence(1) = surface_sequence(4,l)
+ shifted_surface_sequence(2:4) = surface_sequence(1:3,l)
+ else
+ shifted_surface_sequence = cshift(surface_sequence(:,l),m-1)
+ end if
do k = 1, number_of_polypeptides
surface_energy = 0
true_surface_energy = 0.0_LONGreal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-11 12:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 12:45 [Bug fortran/52934] New: enhancement: cshift0 should be inlined matz at gcc dot gnu.org
2012-04-11 12:51 ` [Bug fortran/52934] " burnus 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).