This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][1/2] Move mult synthesis definitions into a separate file


Hi Richard,

On 13/06/16 15:07, Richard Biener wrote:
On Mon, Jun 13, 2016 at 2:23 PM, Kyrill Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
Hi all,

There are other places besides expand where we might want to synthesize an
integer
multiplication by a constant.  Thankfully the algorithm selection code in
expmed.c
is already quite well separated from the RTL implementation, so if we can
just factor
out the prototype of choose_mult_variant and some enums and structs that it
needs into
a separate header file we can reuse them from other parts of the compiler.

I need this for patch 2/2 which hooks up the vectorizer to synthesize vector
multiplications using sequences of shifts and other arithmetic ops when
appropriate.

The new header is called mult-synthesis.h. Should I add it to some makefile?
grepping around for a bit I'm not sure what to do about it.
Possibly PLUGIN_HEADERS.

Ok.

You could have included expmed.h from the vectorizer, no?  After all this
patch now breaks that things declared in A.h are defined in A.c as you
didn't move choose_mult_variant itself.

I think including expmed.h would work. I thought it defined too many
irrelevant RTL-specific things that you wouldn't want in the vectoriser.
If you don't mind I'm happy to just include expmed.h.
Do we have a rule for defining things delcared in A.h in A.c?
I notice we declare various extern things in rtl.h that aren't defined in
rtl.c, though I suppose that would be an exception...

Thanks,
Kyrill

Thanks,
Richard.

Bootstrapped and tested on arm, aarch64, x86_64.

Thanks,
Kyrill

2016-06-13  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * mult-synthesis.h: New file.  Add choose_mult_variant prototype.
     * expmed.h: Include mult-synthesis.h
     (enum alg_code): Move to mult-synthesis.h
     (struct mult_cost): Likewise.
     (struct algorithm): Likewise.
     * expmed.c (enum mult_variant): Move to mult-synthesis.h
     (choose_mult_variant): Delete prototype.  Remove static qualifier.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]