diff options
author | mfortune <matthew.fortune@imgtec.com> | 2014-05-07 22:37:00 +0100 |
---|---|---|
committer | mfortune <matthew.fortune@imgtec.com> | 2014-05-08 15:09:35 +0100 |
commit | 263b257428741e10dc4a127cc46c57379307f421 (patch) | |
tree | 6d60ee48f0ce4e47f69e57e9d5a7d7a04d36d561 /gas/config/tc-mips.c | |
parent | 68e0f6b16d6ce24c912affec6b049a5452c7df3e (diff) | |
download | gdb-263b257428741e10dc4a127cc46c57379307f421.zip gdb-263b257428741e10dc4a127cc46c57379307f421.tar.gz gdb-263b257428741e10dc4a127cc46c57379307f421.tar.bz2 |
Implement CONVERT_SYMBOLIC_ATTRIBUTE for MIPS.
gas/
* config/tc-mips.c (streq): Define.
(mips_convert_symbolic_attribute): New function.
* config/tc-mips.h (CONVERT_SYMBOLIC_ATTRIBUTE): Define.
(mips_convert_symbolic_attribute): New prototype
gas/testsuite/
* gas/mips/attr-gnu-abi-fp-1.s: New.
* gas/mips/attr-gnu-abi-fp-1.d: New.
* gas/mips/attr-gnu-abi-msa-1.s: New.
* gas/mips/attr-gnu-abi-msa-1.d: New.
* gas/mips/mips.exp: Add new tests.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r-- | gas/config/tc-mips.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 1c950a7..edbab71 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -42,6 +42,8 @@ typedef char static_assert2[sizeof (valueT) < 8 ? -1 : 1]; #define DBG(x) #endif +#define streq(a, b) (strcmp (a, b) == 0) + #define SKIP_SPACE_TABS(S) \ do { while (*(S) == ' ' || *(S) == '\t') ++(S); } while (0) @@ -18342,3 +18344,34 @@ tc_mips_regname_to_dw2regnum (char *regname) return regnum; } + +/* Implement CONVERT_SYMBOLIC_ATTRIBUTE. + Given a symbolic attribute NAME, return the proper integer value. + Returns -1 if the attribute is not known. */ + +int +mips_convert_symbolic_attribute (const char *name) +{ + static const struct + { + const char * name; + const int tag; + } + attribute_table[] = + { +#define T(tag) {#tag, tag} + T (Tag_GNU_MIPS_ABI_FP), + T (Tag_GNU_MIPS_ABI_MSA), +#undef T + }; + unsigned int i; + + if (name == NULL) + return -1; + + for (i = 0; i < ARRAY_SIZE (attribute_table); i++) + if (streq (name, attribute_table[i].name)) + return attribute_table[i].tag; + + return -1; +} |