opcodes,gas: associate SPARC ASIs with an architecture level.

With this change an architecture level bump due to assembly ASIs will show
up as a warning/error depending on options passed to gas.

Tested with sparc64-linux-gnu, and it does not introduce any regressions.

gas/ChangeLog:

	Add support for associating SPARC ASIs with an architecture level.
	* config/tc-sparc.c (parse_sparc_asi): New encode SPARC ASIs.

opcodes/ChangeLog:

	Add support for associating SPARC ASIs with an architecture level.
	* include/opcode/sparc.h (sparc_asi): New sparc_asi struct.
	* opcodes/sparc-opc.c (asi_table): Updated asi_table and encoding/
	decoding of SPARC ASIs.
This commit is contained in:
Sheldon Lobo
2017-02-23 07:49:37 -08:00
committed by Jose E. Marchesi
parent 8eaf53202e
commit 1e9d41d49f
5 changed files with 256 additions and 203 deletions

View File

@ -117,6 +117,14 @@ typedef struct sparc_opcode
short architecture; /* Bitmask of sparc_opcode_arch_val's. */
} sparc_opcode;
/* Struct for ASIs - to handle ASIs introduced in a specific architecture */
typedef struct
{
int value;
const char *name;
short architecture;
} sparc_asi;
/* FIXME: Add F_ANACHRONISTIC flag for v9. */
#define F_DELAYED 0x00000001 /* Delayed branch. */
#define F_ALIAS 0x00000002 /* Alias for a "real" instruction. */
@ -296,7 +304,7 @@ typedef struct sparc_opcode
extern const struct sparc_opcode sparc_opcodes[];
extern const int sparc_num_opcodes;
extern int sparc_encode_asi (const char *);
extern const sparc_asi *sparc_encode_asi (const char *);
extern const char *sparc_decode_asi (int);
extern int sparc_encode_membar (const char *);
extern const char *sparc_decode_membar (int);