Hi! On Wed, Feb 05, 2020 at 08:57:16AM +0100, Richard Biener wrote: > On Tue, Feb 4, 2020 at 6:40 PM Segher Boessenkool > <seg...@kernel.crashing.org> wrote: > > On Mon, Feb 03, 2020 at 08:26:01PM -0600, Bill Schmidt wrote: > > > My intent is to make adding new built-in functions as simple as adding > > > a few lines to a couple of files, and automatically generating as much > > > of the initialization, overload resolution, and expansion logic as > > > possible. This patch series establishes the format of the input files > > > and creates a new program (rs6000-genbif) to: > > > > Let's call it rs6000-gen-builtins or similar. Not as cryptic. > > I believe we talked about this a few years ago. Any reason this is powerpc > specific? If sufficiently generic most targets would benefit and maybe even > frontends and the middle-end could make use of this. The generator > program, that is. (disclaimer: I didn't look into the patches at all)
Absolutely, but we first want to solve the urgent problem for Power (because that is what it is); it's a huge job with that reduction of scope, already. After *that* is done, it will be clearer how to do things for what is wanted generically, will be clearer what is wanted in the first place :-) > I always wondered if we can make our C frontend spit out things from > C declarations (with maybe extra #pragmas for some of the more obscure > details) and how to fit that into the bootstrap. I think there will be too many problem cases, a direct description of the builtins will work better (but is more verbose of course). In any case, Bill's patches keep the exact same approach in rs6000 as we had before, just with some more pre-processing and macros etc.; which results in a much shorter description, many cases folded into one, which as a bonus also fixes bugs (directly, when two things you fold should be the same but are not, at least one of them is wrong; and maybe more importantly indirectly: a reader of the tables will spot errors much more easily if they fit on one screen, if you have similar entries on the screen at the same time so you *can* compare; and there will be more readers as well even, people are actually scared of having to look at it currently). So, yes, this same approach might be a good fit generically, but we'll do it for rs6000 only, in the interest of ever getting it done ;-) The generator programs etc. can move to generic code later, if that helps and there is interest in it, there isn't much (if anything) in here that is specific to our arch. Segher