From 1e9d41d49f7f0b9e7381e8bf8ce848f8a33b8fde Mon Sep 17 00:00:00 2001 From: Sheldon Lobo Date: Thu, 23 Feb 2017 07:49:37 -0800 Subject: 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. --- include/opcode/sparc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/opcode/sparc.h b/include/opcode/sparc.h index c79f20d..6e8d6d7 100644 --- a/include/opcode/sparc.h +++ b/include/opcode/sparc.h @@ -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); -- cgit v1.1