diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-02-02 17:06:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-02-02 17:06:24 +0000 |
commit | 1051c97f630bf96febe9e0029ba8df161d3a4db1 (patch) | |
tree | 453a4b9b20a21fb3f27b89087386f582a5aa0d52 /gas/config | |
parent | 950df4212c15a8d64bece1a7e5b9873a1f787577 (diff) | |
download | gdb-1051c97f630bf96febe9e0029ba8df161d3a4db1.zip gdb-1051c97f630bf96febe9e0029ba8df161d3a4db1.tar.gz gdb-1051c97f630bf96febe9e0029ba8df161d3a4db1.tar.bz2 |
* config/tc-mips.c (file_mips_isa): New static variable.
(md_begin): Set it.
(s_mipsset): Add support for .set mipN to set the ISA level.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index e597b3d..d99f2a1 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -96,9 +96,13 @@ const char *mips_target_format = DEFAULT_TARGET_FORMAT; unsigned long mips_gprmask; unsigned long mips_cprmask[4]; -/* MIPS ISA (Instruction Set Architecture) level. */ +/* MIPS ISA (Instruction Set Architecture) level (may be changed + temporarily using .set mipsN). */ static int mips_isa = -1; +/* MIPS ISA we are using for this output file. */ +static int file_mips_isa; + /* MIPS PIC level. 0 is normal, non-PIC code. 2 means to generate SVR4 ABI PIC calls. 1 doesn't mean anything. */ static int mips_pic; @@ -490,6 +494,8 @@ md_begin () if (! ok) as_warn ("Could not set architecture and machine"); + file_mips_isa = mips_isa; + op_hash = hash_new (); for (i = 0; i < NUMOPCODES;) @@ -5198,6 +5204,20 @@ s_mipsset (x) { mips_nobopt = 1; } + else if (strncmp (name, "mips", 4) == 0) + { + int isa; + + /* Permit the user to change the ISA on the fly. Needless to + say, misuse can cause serious problems. */ + isa = atoi (name + 4); + if (isa == 0) + mips_isa = file_mips_isa; + else if (isa < 1 || isa > 3) + as_bad ("unknown ISA level"); + else + mips_isa = isa; + } else { as_warn ("Tried to set unrecognized symbol: %s\n", name); |