This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH 0/2] [PUSHED/OBV] gas/arc: Add nps400 support to .cpu directive
- From: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, Nick Clifton <nickc at redhat dot com>
- Cc: Claudiu Zissulescu <claziss at gmail dot com>, Binutils <binutils at sourceware dot org>, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- Date: Wed, 20 Apr 2016 09:07:18 +0000
- Subject: RE: [PATCH 0/2] [PUSHED/OBV] gas/arc: Add nps400 support to .cpu directive
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1460822027 dot git dot andrew dot burgess at embecosm dot com> <CAL0iMy1eDXHNYZS_B=zNvV+FMnp09yPHo2gxYLTiHEYgk=LG+A at mail dot gmail dot com> <20160417203517 dot GC6589 at embecosm dot com> <CAL0iMy0iDrUA_2U1WDnsym1z6a-wATDWyY932Mr5maK5dt_dPg at mail dot gmail dot com> <20160417223058 dot GD6589 at embecosm dot com> <5714C000 dot 7080505 at redhat dot com> <20160419185401 dot GH6589 at embecosm dot com>
Hi Andrew,
> +/* Maximum number of CPU aliases in the cpu_type table. */
> +#define MAX_NUMBER_OF_ALIASES 2
> +
> /* A table of CPU names and opcode sets. */
> static const struct cpu_type
> {
> const char *name;
> + const char *alises [MAX_NUMBER_OF_ALIASES + 1];
Instead of this list of aliases, I would list all the alternatives in cpu_types[]. On the expense of more used memory, we will get rid of the MAX_NUMBER _OF_ALIASES and the need to maintain it whenever we want to add a new cpu alias. Also the support routines will look much cleaner, we will have a single scanning loop instead of two. Please take it as recommendation. Regardless the decision you take, the patch seems alright to me.
Best,
Claudiu