Re: Reorganise machmode.h headers
On 05/24/2017 08:54 AM, Richard Sandiford wrote: > Jeff Law 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 >>> Alan Hayward >>> David Sherwood >>> >>> * 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 > 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' > > B
Re: Reorganise machmode.h headers
Ping*2 Richard Sandiford writes: > Ping > > Richard Sandiford writes: >> Jeff Law 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 Alan Hayward David Sherwood * 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 >> process_known_dups () >> File "../contrib/header-tools/gcc-order-headers", line 101, in > process_known_dups
Re: Reorganise machmode.h headers
Ping Richard Sandiford writes: > Jeff Law 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 >>> Alan Hayward >>> David Sherwood >>> >>> * 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 > 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
Re: Reorganise machmode.h headers
Jeff Law 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 >> Alan Hayward >> David Sherwood >> >> * 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 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
Re: Reorganise machmode.h headers
Jeff Law 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 >> Alan Hayward >> David Sherwood >> >> * 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. Yeah, I agree it's not worth it now that those patches won't go in. > 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. Thanks for the pointer, will make a note to look at that for GCC 8. Richard
Re: Reorganise machmode.h headers
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 Alan Hayward David Sherwood * 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. Jeff
Reorganise machmode.h headers
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 Alan Hayward David Sherwood * 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. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7ecd1e4..2daa6a6 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -896,14 +896,15 @@ COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF) COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF) -MACHMODE_H = machmode.h mode-classes.def insn-modes.h +MACHMODE_H = machmode.h mode-classes.def HOOKS_H = hooks.h $(MACHMODE_H) HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H) TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \ $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h -RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \ +CORETYPES_H = coretypes.h insn-modes.h insn-modes-inline.h +RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def $(MACHMODE_H) reg-notes.def \ insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \ $(FIXED_VALUE_H) alias.h $(HASHT