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

Richard Biener richard.guenther@gmail.com
Mon Jun 13 14:07:00 GMT 2016

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.


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.


> 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.

More information about the Gcc-patches mailing list