[PATCH] Reallow unrestricted use od .set mipsX
Thiemo Seufer
ica2_ts@csv.ica.uni-stuttgart.de
Thu Sep 6 21:05:00 GMT 2001
Hi All,
this patch re-allows to use .set mipsX pseudo-op without getting
hindered by an -mgp32/-mfp32/-mabi=32 option, which currently
restrict register size and usable insn's over the whole file.
This restores the old behaviour, which is also the way
traditional mips assemblers work. Currently e.g. a
.set mips3
in a -mabi=32 file is rendered useless.
Thiemo
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/config/tc-mips.c src/gas/config/tc-mips.c
--- src-orig/gas/config/tc-mips.c Fri Aug 31 22:00:08 2001
+++ src/gas/config/tc-mips.c Thu Sep 6 21:58:05 2001
@@ -10385,12 +10844,57 @@ s_mipsset (x)
else if (strncmp (name, "mips", 4) == 0)
{
int isa;
+ static int saved_mips_gp32;
+ static int saved_mips_fp32;
+ static int saved_mips_32bit_abi;
+ static int is_saved;
/* Permit the user to change the ISA on the fly. Needless to
say, misuse can cause serious problems. */
isa = atoi (name + 4);
switch (isa)
{
+ case 0:
+ mips_gp32 = saved_mips_gp32;
+ mips_fp32 = saved_mips_fp32;
+ mips_32bit_abi = saved_mips_32bit_abi;
+ is_saved = 0;
+ break;
+ case 1:
+ case 2:
+ case 32:
+ if (! is_saved)
+ {
+ saved_mips_gp32 = mips_gp32;
+ saved_mips_fp32 = mips_fp32;
+ saved_mips_32bit_abi = mips_32bit_abi;
+ }
+ mips_gp32 = 1;
+ mips_fp32 = 1;
+ is_saved = 1;
+ break;
+ case 3:
+ case 4:
+ case 5:
+ case 64:
+ if (! is_saved)
+ {
+ saved_mips_gp32 = mips_gp32;
+ saved_mips_fp32 = mips_fp32;
+ saved_mips_32bit_abi = mips_32bit_abi;
+ }
+ mips_gp32 = 0;
+ mips_fp32 = 0;
+ mips_32bit_abi = 0;
+ is_saved = 1;
+ break;
+ default:
+ as_bad (_("unknown ISA level"));
+ break;
+ }
+
+ switch (isa)
+ {
case 0: mips_opts.isa = file_mips_isa; break;
case 1: mips_opts.isa = ISA_MIPS1; break;
case 2: mips_opts.isa = ISA_MIPS2; break;
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-abi32-pic.s src/gas/testsuite/gas/mips/mips-abi32-pic.s
--- src-orig/gas/testsuite/gas/mips/mips-abi32-pic.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-abi32-pic.s Tue Sep 4 11:54:27 2001
@@ -13,7 +13,6 @@ unshared:
.text
.ent func
func:
- .set mips4
.set noreorder
.cpload $25 # 0000 lui gp,hi(_gp_disp)
# 0004 addiu gp,gp,lo(_gp_disp)
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-abi32.s src/gas/testsuite/gas/mips/mips-abi32.s
--- src-orig/gas/testsuite/gas/mips/mips-abi32.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-abi32.s Tue Sep 4 11:54:22 2001
@@ -13,7 +13,6 @@ unshared:
.text
func:
.set noreorder
- .set mips4
li $4, 0x12345678 # 0000 lui a0,0x1234
# 0004 ori a0,a0,0x5678
la $4, shared # 0008 addiu a0,gp,shared
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s src/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s
--- src-orig/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s Tue Sep 4 11:54:16 2001
@@ -13,7 +13,6 @@ unshared:
.text
.ent func
func:
- .set mips4
.set noreorder
.cpload $25 # 0000 lui gp,hi(_gp_disp)
# 0004 addiu gp,gp,lo(_gp_disp)
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp32-fp32.s src/gas/testsuite/gas/mips/mips-gp32-fp32.s
--- src-orig/gas/testsuite/gas/mips/mips-gp32-fp32.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp32-fp32.s Tue Sep 4 11:54:11 2001
@@ -13,7 +13,6 @@ unshared:
.text
func:
.set noreorder
- .set mips4
li $4, 0x12345678 # 0000 lui a0,0x1234
# 0004 ori a0,a0,0x5678
la $4, shared # 0008 addiu a0,gp,shared
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s src/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s
--- src-orig/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s Tue Sep 4 11:54:07 2001
@@ -13,7 +13,6 @@ unshared:
.text
.ent func
func:
- .set mips4
.set noreorder
.cpload $25 # 0000 lui gp,hi(_gp_disp)
# 0004 addiu gp,gp,lo(_gp_disp)
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp32-fp64.s src/gas/testsuite/gas/mips/mips-gp32-fp64.s
--- src-orig/gas/testsuite/gas/mips/mips-gp32-fp64.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp32-fp64.s Tue Sep 4 11:54:03 2001
@@ -13,7 +13,6 @@ unshared:
.text
func:
.set noreorder
- .set mips4
li $4, 0x12345678 # 0000 lui a0,0x1234
# 0004 ori a0,a0,0x5678
la $4, shared # 0008 addiu a0,gp,shared
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s src/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s
--- src-orig/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s Tue Sep 4 11:53:58 2001
@@ -13,7 +13,6 @@ unshared:
.text
.ent func
func:
- .set mips4
.set noreorder
.cpload $25 # 0000 lui gp,hi(_gp_disp)
# 0004 addiu gp,gp,lo(_gp_disp)
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp64-fp32.s src/gas/testsuite/gas/mips/mips-gp64-fp32.s
--- src-orig/gas/testsuite/gas/mips/mips-gp64-fp32.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp64-fp32.s Tue Sep 4 11:53:53 2001
@@ -13,7 +13,6 @@ unshared:
.text
func:
.set noreorder
- .set mips4
li $4, 0x12345678 # 0000 lui a0,0x1234
# 0004 ori a0,a0,0x5678
la $4, shared # 0008 daddiu a0,gp,shared
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s src/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s
--- src-orig/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s Tue Sep 4 11:53:49 2001
@@ -13,7 +13,6 @@ unshared:
.text
.ent func
func:
- .set mips4
.set noreorder
.cpload $25 # 0000 lui gp,hi(_gp_disp)
# 0004 addiu gp,gp,lo(_gp_disp)
diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/testsuite/gas/mips/mips-gp64-fp64.s src/gas/testsuite/gas/mips/mips-gp64-fp64.s
--- src-orig/gas/testsuite/gas/mips/mips-gp64-fp64.s Tue Aug 7 17:20:30 2001
+++ src/gas/testsuite/gas/mips/mips-gp64-fp64.s Tue Sep 4 11:53:44 2001
@@ -13,7 +13,6 @@ unshared:
.text
func:
.set noreorder
- .set mips4
li $4, 0x12345678 # 0000 lui a0,0x1234
# 0004 ori a0,a0,0x5678
la $4, shared # 0008 daddiu a0,gp,shared
More information about the Binutils
mailing list