public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org
Subject: Re: Reorganise machmode.h headers
Date: Thu, 29 Jun 2017 22:39:00 -0000	[thread overview]
Message-ID: <8c8cc5ac-a13d-663d-f187-280f9e751e36@redhat.com> (raw)
In-Reply-To: <87zie2xq37.fsf@linaro.org>

On 05/24/2017 08:54 AM, Richard Sandiford wrote:
> Jeff Law <law@redhat.com> writes:
>> On 11/16/2016 09:32 AM, Richard Sandiford wrote:
>>> Later patches will make machmode.h rely on wide-int.h and the
>>> new poly-int.h, so it needs to appear later in the coretypes.h
>>> include list.
>>>
>>> Previously machmode.h included insn-modes.h, which as well as
>>> the main mode enum contains configuration information like
>>> MAX_BITSIZE_MODE_ANY_INT.  This still needs to come first,
>>> since files like wide-int.h depend on the configuration
>>> information.
>>>
>>> Similarly, later patches will make the auto-generated inline
>>> mode size functions use poly-int.h, so the patch splits them
>>> out into their own header file and includes it after the
>>> integer utilities.
>>>
>>> The patch also makes the generator files include machmode.h
>>> via coretypes.h.  Previously they did it by more indirect means.
>>>
>>> Finally, the patch makes wide-int-print.h available via coretypes.h
>>> too.  There didn't seem to be any reason to force only the print
>>> routines to be included directly, and it would be painful to extend
>>> that approach to the new polynomial integer classes.
>>>
>>> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?
>>>
>>> Thanks,
>>> Richard
>>>
>>>
>>> [ This patch is part of the SVE series posted here:
>>>   https://gcc.gnu.org/ml/gcc/2016-11/msg00030.html ]
>>>
>>> gcc/
>>> 2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
>>> 	    Alan Hayward  <alan.hayward@arm.com>
>>> 	    David Sherwood  <david.sherwood@arm.com>
>>>
>>> 	* Makefile.in (MACHMODE_H): Remove insn-modes.h
>>> 	(CORETYPES_H): New define.
>>> 	(MOSTLYCLEANFILES): Add insn-modes-inline.h.
>>> 	(insn-modes-inline.h, s-modes-inline-h): New rules.
>>> 	(generated_files): Add insn-modes-inline.h.
>>> 	(RTL_BASE_H, TREE_CORE_H): Use CORETYPES_H instead of coretypes.h.
>>> 	(build/gensupport.o, build/print-rtl.o, build/read-md.o): Likewise.
>>> 	(build/read-rtl.o, build/rtl.o, build/vec.o, build/hash-table.o)
>>> 	(build/inchash.o, build/gencondmd.o, build/genattr.o): Likewise.
>>> 	(build/genattr-common.o, build/genattrtab.o, build/genautomata.o)
>>> 	(build/gencheck.o, build/gencodes.o, build/genconditions.o): Likewise.
>>> 	(build/genconfig.o, build/genconstants.o, build/genemit.o): Likewise.
>>> 	(build/genenums.o, build/genextract.o, build/genflags.o): Likewise.
>>> 	(build/gentarget-def.o, build/genmddeps.o, build/genopinit.o)
>>> 	(build/genoutput.o, build/genpeep.o, build/genpreds.o): Likewise.
>>> 	(build/genrecog.o, build/genmddump.o, build/genmatch.o): Likewise.
>>> 	(build/gencfn-macros.o, build/gcov-iov.o): Likewise.
>>> 	* coretypes.h: Include everything up to real.h for generators.
>>> 	Include insn-modes.h first.  Include wide-int-print.h after
>>> 	wide-int.h.  Include insn-modes-inline.h and then machmode.h.
>>> 	* machmode.h: Don't include insn-modes.h here.
>>> 	* function-tests.c: Remove includes of signop.h, machmode.h,
>>> 	double-int.h and wide-int.h.
>>> 	* rtl.h: Likewise.
>>> 	* gcc-rich-location.c: Remove includes of machmode.h, double-int.h
>>> 	and wide-int.h.
>>> 	* optc-save-gen.awk: Likewise.
>>> 	* gencheck.c (BITS_PER_UNIT): Delete dummy definition.
>>> 	* godump.c: Remove include of wide-int-print.h.
>>> 	* pretty-print.h: Likewise.
>>> 	* wide-int-print.cc: Likewise.
>>> 	* wide-int.cc: Likewise.
>>> 	* hash-map-tests.c: Remove include of signop.h.
>>> 	* hash-set-tests.c: Likewise.
>>> 	* rtl-tests.c: Likewise.
>>> 	* mkconfig.sh: Remove include of machmode.h.
>>> 	* genmodes.c (emit_insn_modes_h): Split emission of inline functions
>>> 	into...
>>> 	(emit_insn_modes_inline_h): ...this new function.  Emit the code
>>> 	into an insn-modes-inline.h header file, adding appropriate
>>> 	include guards and end comments.
>>> 	(emit_insn_modes_c_header): Remove include of machmode.h.
>>> 	(emit_min_insn_modes_c_header): Include coretypes.h rather than
>>> 	machmode.h.
>>> 	(main): Handle -i flag and call emit_insn_modes_inline_h when
>>> 	it is passed.
>> So I don't see anything here particularly problematical.  My question is 
>> whether or not there's anything significant to be gained to moving 
>> forward with this kit, assuming the 67 piece kit is not likely to move 
>> forward.
>>
>> I do think you'll need some tweaks to the contrib/header-tools which 
>> know about the core headers and dependencies.  Hopefully what's in there 
>> is easy enough to figure out how to twiddle appropriately.
> 
> OK, thanks for the pointer.  I think this patch should do that.
> 
> gcc-order-headers seems to have bitrotted a bit, since it gives:
> 
> Traceback (most recent call last):
>   File "../contrib/header-tools/gcc-order-headers", line 267, in <module>
>     process_known_dups ()
>   File "../contrib/header-tools/gcc-order-headers", line 101, in process_known_dups
>     if dups[i] and "rtl.h" in dups[i]:
> KeyError: 'dumpfile.h'
> 
> But the change itself looks obvious.
> 
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  Also tested by
> compiling one target for each cpu directory.  OK to install?
> 
> Thanks,
> Richard
> 
> 
> [Based on the code ARM contributed in branches/ARM/sve-branch@242100]
> 
> 2016-11-16  Richard Sandiford  <richard.sandiford@linaro.org>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@arm.com>
> 
> contrib/header-tools/
> 	* graph-header-logs (ignore): Update coretypes.h header list.
> 
> gcc/
> 	* Makefile.in (MACHMODE_H): Remove insn-modes.h
> 	(CORETYPES_H): New define.
> 	(MOSTLYCLEANFILES): Add insn-modes-inline.h.
> 	(insn-modes-inline.h, s-modes-inline-h): New rules.
> 	(generated_files): Add insn-modes-inline.h.
> 	(RTL_BASE_H, TREE_CORE_H): Use CORETYPES_H instead of coretypes.h.
> 	(build/gensupport.o, build/ggc-none.o, build/print-rtl.o): Likewise.
> 	(build/read-md.o, build/read-rtl.o, build/rtl.o): Likewise.
> 	(build/vec.o, build/hash-table.o, build/inchash.o): Likewise.
> 	(build/gencondmd.o, build/genattr.o, build/genattr-common.o): Likewise.
> 	(build/genattrtab.o, build/genautomata.o, build/gencheck.o): Likewise.
> 	(build/gencodes.o, build/genconditions.o): Likewise.
> 	(build/genconfig.o, build/genconstants.o, build/genemit.o): Likewise.
> 	(build/genenums.o, build/genextract.o, build/genflags.o): Likewise.
> 	(build/gentarget-def.o, build/genmddeps.o, build/genopinit.o)
> 	(build/genoutput.o, build/genpeep.o, build/genpreds.o): Likewise.
> 	(build/genrecog.o, build/genmddump.o, build/genmatch.o): Likewise.
> 	(build/gencfn-macros.o, build/gcov-iov.o): Likewise.
> 	* coretypes.h: Include everything up to real.h for generators.
> 	Include insn-modes.h first.  Include wide-int-print.h after
> 	wide-int.h.  Include insn-modes-inline.h and then machmode.h.
> 	* machmode.h: Don't include insn-modes.h here.
> 	* function-tests.c: Remove includes of signop.h, machmode.h,
> 	double-int.h and wide-int.h.
> 	* rtl.h: Likewise.
> 	* gcc-rich-location.c: Remove includes of machmode.h, double-int.h
> 	and wide-int.h.
> 	* optc-save-gen.awk: Likewise.
> 	* gencheck.c (BITS_PER_UNIT): Delete dummy definition.
> 	* godump.c: Remove include of wide-int-print.h.
> 	* pretty-print.h: Likewise.
> 	* wide-int-print.cc: Likewise.
> 	* wide-int.cc: Likewise.
> 	* hash-map-tests.c: Remove include of signop.h.
> 	* hash-set-tests.c: Likewise.
> 	* rtl-tests.c: Likewise.
> 	* mkconfig.sh: Remove include of machmode.h.
> 	* genmodes.c (emit_insn_modes_h): Split emission of inline functions
> 	into...
> 	(emit_insn_modes_inline_h): ...this new function.  Emit the code
> 	into an insn-modes-inline.h header file, adding appropriate
> 	include guards and end comments.
> 	(emit_insn_modes_c_header): Remove include of machmode.h.
> 	(emit_min_insn_modes_c_header): Include coretypes.h rather than
> 	machmode.h.
> 	(main): Handle -i flag and call emit_insn_modes_inline_h when
> 	it is passed.
OK.

Jeff

      parent reply	other threads:[~2017-06-29 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 16:32 Richard Sandiford
2016-12-20  0:43 ` Jeff Law
2016-12-22 16:19   ` Richard Sandiford
2017-05-24 15:08   ` Richard Sandiford
2017-06-12  6:37     ` Richard Sandiford
2017-06-22 11:34       ` Richard Sandiford
2017-06-29 22:39     ` Jeff Law [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c8cc5ac-a13d-663d-f187-280f9e751e36@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).