This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] PR 57071, some power optimizations
- From: Tobias Burnus <burnus at net-b dot de>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 28 Apr 2013 20:12:02 +0200
- Subject: Re: [patch, fortran] PR 57071, some power optimizations
- References: <517CDE9C dot 2020301 at netcologne dot de> <517CF581 dot 9010705 at net-b dot de> <517D26A2 dot 8020402 at netcologne dot de>
Thomas Koenig wrote:
Regarding PR 57073, the real case - I have never worked with
GIMPLE, so I have no real idea how to start this.
Any volunteers? Or should we handle this in the Fortran front
end after all?
I think one should do it in the middle end. Actually, it shouldn't be
that difficult. The starting point is gcc/builtins.c's fold_builtin_powi
- all ingredients are there; (1.0)**k, x**0, x**1 and x**(-1) are
already handled. Thus, only (-1)**k is missing. For "= (a)?(b):(c)"
one uses "fold_build3_loc (loc, COND_EXPR, ..." and to check whether a
real argument is -1, you can use "real_minus_onep".
How about writing your first middle end patch?