This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52473] CSHIFT slow - inline it?
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Jun 2017 16:55:31 +0000
- Subject: [Bug fortran/52473] CSHIFT slow - inline it?
- Auto-submitted: auto-generated
- References: <bug-52473-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52473
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Created attachment 41508
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41508&action=edit
What an unrolled cshift could look like
This is what an unrolled version of cshift could look like,
for a simple one-dimensional case.
If the shifts are constants, all the if statements are
optimized away at compile-time, so it is quite efficient.