diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2001-08-02 10:16:50 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2001-08-02 10:16:50 +0000 |
commit | dc4622162a5bac6ee500af8e853b775cf10951fc (patch) | |
tree | e96cda33a42afe1223f063d3bb10a0ca96f2e813 /gas | |
parent | ca4e0257d13e433e5ab6f5eb7fa6f7ec71355300 (diff) | |
download | gdb-dc4622162a5bac6ee500af8e853b775cf10951fc.zip gdb-dc4622162a5bac6ee500af8e853b775cf10951fc.tar.gz gdb-dc4622162a5bac6ee500af8e853b775cf10951fc.tar.bz2 |
* gas/mips/mips-gp32-fp32,
* gas/mips/mips-gp32-fp64,
* gas/mips/mips-gp64-fp32,
* gas/mips/mips-gp64-fp64,
* gas/mips/mips-abi32,
* gas/mips/mips-gp32-fp32-pic,
* gas/mips/mips-gp32-fp64-pic,
* gas/mips/mips-gp64-fp32-pic,
* gas/mips/mips-gp64-fp64-pic,
* gas/mips/mips-abi32-pic: New testcases.
* gas/mips/mips.exp: Run them.
Diffstat (limited to 'gas')
22 files changed, 2329 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index a7acad5..2f48ad8 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2001-08-02 Richard Sandiford <rsandifo@redhat.com> + + * gas/mips/mips-gp32-fp32, + * gas/mips/mips-gp32-fp64, + * gas/mips/mips-gp64-fp32, + * gas/mips/mips-gp64-fp64, + * gas/mips/mips-abi32, + * gas/mips/mips-gp32-fp32-pic, + * gas/mips/mips-gp32-fp64-pic, + * gas/mips/mips-gp64-fp32-pic, + * gas/mips/mips-gp64-fp64-pic, + * gas/mips/mips-abi32-pic: New testcases. + + * gas/mips/mips.exp: Run them. + 2001-08-01 Alan Modra <amodra@bigpond.net.au> * gas/elf/section2.l: Adjust warning message comparison. diff --git a/gas/testsuite/gas/mips/mips-abi32-pic.d b/gas/testsuite/gas/mips/mips-abi32-pic.d new file mode 100644 index 0000000..77fe665 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-abi32-pic.d @@ -0,0 +1,114 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mabi=32 -KPIC +#name: MIPS -mabi=32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002825 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 3c013ff0 lui at,0x3ff0 + 180: 44810800 mtc1 at,\$f1 + 184: 44800000 mtc1 zero,\$f0 + 188: 8f810000 lw at,0\(gp\) + 18c: d4200008 ldc1 \$f0,8\(at\) + 190: 24a40064 addiu a0,a1,100 + 194: 2c840001 sltiu a0,a0,1 + 198: 24a40064 addiu a0,a1,100 + 19c: 0004202b sltu a0,zero,a0 + 1a0: 00a02025 move a0,a1 diff --git a/gas/testsuite/gas/mips/mips-abi32-pic.s b/gas/testsuite/gas/mips/mips-abi32-pic.s new file mode 100644 index 0000000..f6b27ec --- /dev/null +++ b/gas/testsuite/gas/mips/mips-abi32-pic.s @@ -0,0 +1,140 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lui at,0x3ff0 + # 0180 mtc1 at,$f1 + # 0184 mtc1 zero,$f0 + li.d $f0, 1.9 # 0188 lw at,got(.rodata)(gp) + # 018c ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 0190 addiu a0,a1,100 + # 0194 sltiu a0,a0,1 + sne $4, $5, -100 # 0198 addiu a0,a1,100 + # 019c sltu a0,zero,a0 + move $4, $5 # 01a0 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-abi32.d b/gas/testsuite/gas/mips/mips-abi32.d new file mode 100644 index 0000000..7de8b9f --- /dev/null +++ b/gas/testsuite/gas/mips/mips-abi32.d @@ -0,0 +1,75 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mabi=32 +#name: MIPS -mabi=32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840108 addiu a0,a0,264 + 1c: 08000042 j 108 <[^>]*> + 20: 0c000042 jal 108 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840108 lw a0,264\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240108 lw a0,264\(at\) + 54: 8c25010c lw a1,268\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002825 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: 3c013ff0 lui at,0x3ff0 + e8: 44810800 mtc1 at,\$f1 + ec: 44800000 mtc1 zero,\$f0 + f0: d780c000 ldc1 \$f0,-16384\(gp\) + f4: 24a40064 addiu a0,a1,100 + f8: 2c840001 sltiu a0,a0,1 + fc: 24a40064 addiu a0,a1,100 + 100: 0004202b sltu a0,zero,a0 + 104: 00a02025 move a0,a1 diff --git a/gas/testsuite/gas/mips/mips-abi32.s b/gas/testsuite/gas/mips/mips-abi32.s new file mode 100644 index 0000000..61d9140 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-abi32.s @@ -0,0 +1,99 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .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 + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 lui at,0x3ff0 + # 00e8 mtc1 at,$f1 + # 00ec mtc1 zero,$f0 + li.d $f0, 1.9 # 00f0 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltiu a0,a0,1 + sne $4, $5, -100 # 00fc addiu a0,a1,100 + # 0100 sltu a0,zero,a0 + move $4, $5 # 0104 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d b/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d new file mode 100644 index 0000000..be6e32e --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d @@ -0,0 +1,114 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -mfp32 -KPIC +#name: MIPS -mgp32 -mfp32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002825 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 3c013ff0 lui at,0x3ff0 + 180: 44810800 mtc1 at,\$f1 + 184: 44800000 mtc1 zero,\$f0 + 188: 8f810000 lw at,0\(gp\) + 18c: d4200008 ldc1 \$f0,8\(at\) + 190: 24a40064 addiu a0,a1,100 + 194: 2c840001 sltiu a0,a0,1 + 198: 24a40064 addiu a0,a1,100 + 19c: 0004202b sltu a0,zero,a0 + 1a0: 00a02025 move a0,a1 diff --git a/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s b/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s new file mode 100644 index 0000000..f6b27ec --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s @@ -0,0 +1,140 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lui at,0x3ff0 + # 0180 mtc1 at,$f1 + # 0184 mtc1 zero,$f0 + li.d $f0, 1.9 # 0188 lw at,got(.rodata)(gp) + # 018c ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 0190 addiu a0,a1,100 + # 0194 sltiu a0,a0,1 + sne $4, $5, -100 # 0198 addiu a0,a1,100 + # 019c sltu a0,zero,a0 + move $4, $5 # 01a0 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp32-fp32.d b/gas/testsuite/gas/mips/mips-gp32-fp32.d new file mode 100644 index 0000000..cae6b9a --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp32.d @@ -0,0 +1,75 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -mfp32 +#name: MIPS -mgp32 -mfp32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840108 addiu a0,a0,264 + 1c: 08000042 j 108 <[^>]*> + 20: 0c000042 jal 108 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840108 lw a0,264\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240108 lw a0,264\(at\) + 54: 8c25010c lw a1,268\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002825 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: 3c013ff0 lui at,0x3ff0 + e8: 44810800 mtc1 at,\$f1 + ec: 44800000 mtc1 zero,\$f0 + f0: d780c000 ldc1 \$f0,-16384\(gp\) + f4: 24a40064 addiu a0,a1,100 + f8: 2c840001 sltiu a0,a0,1 + fc: 24a40064 addiu a0,a1,100 + 100: 0004202b sltu a0,zero,a0 + 104: 00a02025 move a0,a1 diff --git a/gas/testsuite/gas/mips/mips-gp32-fp32.s b/gas/testsuite/gas/mips/mips-gp32-fp32.s new file mode 100644 index 0000000..61d9140 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp32.s @@ -0,0 +1,99 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .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 + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 lui at,0x3ff0 + # 00e8 mtc1 at,$f1 + # 00ec mtc1 zero,$f0 + li.d $f0, 1.9 # 00f0 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltiu a0,a0,1 + sne $4, $5, -100 # 00fc addiu a0,a1,100 + # 0100 sltu a0,zero,a0 + move $4, $5 # 0104 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d b/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d new file mode 100644 index 0000000..529fea9 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d @@ -0,0 +1,114 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -KPIC +#name: MIPS -mgp32 -mfp64 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002825 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 8f810000 lw at,0\(gp\) + 180: d4200008 ldc1 \$f0,8\(at\) + 184: 8f810000 lw at,0\(gp\) + 188: d4200010 ldc1 \$f0,16\(at\) + 18c: 24a40064 addiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 24a40064 addiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a02025 move a0,a1 + 1a0: 46231040 add.d \$f1,\$f2,\$f3 diff --git a/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s b/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s new file mode 100644 index 0000000..4dad471 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s @@ -0,0 +1,139 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lw at,got(.rodata)(gp) + # 0180 ldc1 $f0,lo(L1.0)(at) + li.d $f0, 1.9 # 0184 lw at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c addiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 addiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 + add.d $f1, $f2, $f3 # 01a0 add.d $f1,$f2,$f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp32-fp64.d b/gas/testsuite/gas/mips/mips-gp32-fp64.d new file mode 100644 index 0000000..6a5d294 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp64.d @@ -0,0 +1,74 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 +#name: MIPS -mgp32 -mfp64 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840104 addiu a0,a0,260 + 1c: 08000041 j 104 <[^>]*> + 20: 0c000041 jal 104 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840104 lw a0,260\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240104 lw a0,260\(at\) + 54: 8c250108 lw a1,264\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002825 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: d780c000 ldc1 \$f0,-16384\(gp\) + e8: d780c008 ldc1 \$f0,-16376\(gp\) + ec: 24a40064 addiu a0,a1,100 + f0: 2c840001 sltiu a0,a0,1 + f4: 24a40064 addiu a0,a1,100 + f8: 0004202b sltu a0,zero,a0 + fc: 00a02025 move a0,a1 + 100: 46231040 add.d \$f1,\$f2,\$f3 diff --git a/gas/testsuite/gas/mips/mips-gp32-fp64.s b/gas/testsuite/gas/mips/mips-gp32-fp64.s new file mode 100644 index 0000000..e377ecc --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp32-fp64.s @@ -0,0 +1,96 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .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 + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 ldc1 $f0,L1.0(gp) + li.d $f0, 1.9 # 00e8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00ec addiu a0,a1,100 + # 00f0 sltiu a0,a0,1 + sne $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltu a0,zero,a0 + move $4, $5 # 00fc move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + + add.d $f1, $f2, $f3 # 0100 add.d $f1,$f2,$f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d new file mode 100644 index 0000000..1daf415 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d @@ -0,0 +1,147 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mfp32 -KPIC +#name: MIPS -mgp64 -mfp32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: ffbc0008 sd gp,8\(sp\) + 10: 009c202d daddu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 64840000 daddiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 64840000 daddiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 64840228 daddiu a0,a0,552 + 40: 10000079 b 228 <[^>]*> + 44: 00000000 nop + 48: df990000 ld t9,0\(gp\) + 4c: 00000000 nop + 50: 67390228 daddiu t9,t9,552 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: dfbc0008 ld gp,8\(sp\) + 60: df840000 ld a0,0\(gp\) + 64: 00000000 nop + 68: 64840000 daddiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: df840000 ld a0,0\(gp\) + 74: 00000000 nop + 78: 64840000 daddiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: df840000 ld a0,0\(gp\) + 84: 00000000 nop + 88: 64840228 daddiu a0,a0,552 + 8c: 8c840000 lw a0,0\(a0\) + 90: df840000 ld a0,0\(gp\) + 94: 00000000 nop + 98: 64840000 daddiu a0,a0,0 + 9c: dc840000 ld a0,0\(a0\) + a0: df840000 ld a0,0\(gp\) + a4: 00000000 nop + a8: 64840000 daddiu a0,a0,0 + ac: dc840000 ld a0,0\(a0\) + b0: df840000 ld a0,0\(gp\) + b4: 00000000 nop + b8: 64840228 daddiu a0,a0,552 + bc: dc840000 ld a0,0\(a0\) + c0: df810000 ld at,0\(gp\) + c4: 00000000 nop + c8: 64210000 daddiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: df810000 ld at,0\(gp\) + d4: 00000000 nop + d8: 64210000 daddiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: df810000 ld at,0\(gp\) + e4: 00000000 nop + e8: 64210000 daddiu at,at,0 + ec: fc240000 sd a0,0\(at\) + f0: df810000 ld at,0\(gp\) + f4: 00000000 nop + f8: 64210000 daddiu at,at,0 + fc: fc240000 sd a0,0\(at\) + 100: df810000 ld at,0\(gp\) + 104: 00000000 nop + 108: 64210000 daddiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: df810000 ld at,0\(gp\) + 120: 00000000 nop + 124: 64210000 daddiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: df810000 ld at,0\(gp\) + 144: 00000000 nop + 148: 64210000 daddiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: df810000 ld at,0\(gp\) + 158: 00000000 nop + 15c: 64210000 daddiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3404ffc0 li a0,0xffc0 + 16c: 000423bc dsll32 a0,a0,0xe + 170: df810000 ld at,0\(gp\) + 174: dc240000 ld a0,0\(at\) + 178: 3c013ff0 lui at,0x3ff0 + 17c: 44810800 mtc1 at,\$f1 + 180: 44800000 mtc1 zero,\$f0 + 184: df810000 ld at,0\(gp\) + 188: d4200008 ldc1 \$f0,8\(at\) + 18c: 64a40064 daddiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 64a40064 daddiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a0202d move a0,a1 + 1a0: df840000 ld a0,0\(gp\) + 1a4: 00000000 nop + 1a8: 64840000 daddiu a0,a0,0 + 1ac: df840000 ld a0,0\(gp\) + 1b0: 00000000 nop + 1b4: 64840000 daddiu a0,a0,0 + 1b8: df810000 ld at,0\(gp\) + 1bc: 00000000 nop + 1c0: 64210000 daddiu at,at,0 + 1c4: 68240000 ldl a0,0\(at\) + 1c8: 6c240007 ldr a0,7\(at\) + 1cc: df810000 ld at,0\(gp\) + 1d0: 00000000 nop + 1d4: 64210000 daddiu at,at,0 + 1d8: b0240000 sdl a0,0\(at\) + 1dc: b4240007 sdr a0,7\(at\) + 1e0: 3c018000 lui at,0x8000 + 1e4: 0081082a slt at,a0,at + 1e8: 1020000f beqz at,228 <[^>]*> + 1ec: 00000000 nop + 1f0: 34018000 li at,0x8000 + 1f4: 00010c78 dsll at,at,0x11 + 1f8: 0081082b sltu at,a0,at + 1fc: 1020000a beqz at,228 <[^>]*> + 200: 00000000 nop + 204: 3c018000 lui at,0x8000 + 208: 0081082a slt at,a0,at + 20c: 14200006 bnez at,228 <[^>]*> + 210: 00000000 nop + 214: 34018000 li at,0x8000 + 218: 00010c78 dsll at,at,0x11 + 21c: 0081082b sltu at,a0,at + 220: 14200001 bnez at,228 <[^>]*> + 224: 00000000 nop diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s new file mode 100644 index 0000000..339fb78 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s @@ -0,0 +1,163 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sd gp,8(sp) + .cpadd $4 # 0010 daddu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 daddiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 daddiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c daddiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 ld t9,got(.text)(gp) + # 004c nop + # 0050 daddiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c ld gp,8(sp) + lw $4, shared # 0060 ld a0,got(.sdata)(gp) + # 0064 nop + # 0068 daddiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 ld a0,got(.data)(gp) + # 0074 nop + # 0078 daddiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 ld a0,got(.text)(gp) + # 0084 nop + # 0088 daddiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 ld a0,got(.sdata)(gp) + # 0094 nop + # 0098 daddiu a0,a0,lo(shared) + # 009c ld a0,(a0) + ld $4, unshared # 00a0 ld a0,got(.data)(gp) + # 00a4 nop + # 00a8 daddiu a0,a0,lo(unshared) + # 00ac ld a0,(a0) + ld $4, end # 00b0 ld a0,got(.text)(gp) + # 00b4 nop + # 00b8 daddiu a0,a0,lo(end) + # 00bc ld a0,(a0) + sw $4, shared # 00c0 ld at,got(.sdata)(gp) + # 00c4 nop + # 00c8 daddiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 ld at,got(.data)(gp) + # 00d4 nop + # 00d8 daddiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 ld at,got(.sdata)(gp) + # 00e4 nop + # 00e8 daddiu at,at,lo(shared) + # 00ec sd a0,(at) + sd $4, unshared # 00f0 ld at,got(.data)(gp) + # 00f4 nop + # 00f8 daddiu at,at,lo(unshared) + # 00fc sd a0,(at) + ulh $4, unshared # 0100 ld at,got(.data)(gp) + # 0104 nop + # 0108 daddiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c ld at,got(.data)(gp) + # 0120 nop + # 0124 daddiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 ld at,got(.data)(gp) + # 0144 nop + # 0148 daddiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 ld at,got(.data)(gp) + # 0158 nop + # 015c daddiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 li a0,0xffc0 + # 016c dsll32 a0,a0,14 + li.d $4, 1.9 # 0170 ld at,got(.rodata)(gp) + # 0174 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 0178 lui at,0x3ff0 + # 017c mtc1 at,$f1 + # 0180 mtc1 zero,$f0 + li.d $f0, 1.9 # 0184 ld at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c daddiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 daddiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + + dla $4, shared # 01a0 ld a0,got(.sdata)(gp) + # 01a4 nop + # 01a8 daddiu a0,a0,lo(shared) + dla $4, unshared # 01ac ld a0,got(.data)(gp) + # 01b0 nop + # 01b4 daddiu a0,a0,lo(unshared) + uld $4, unshared # 01b8 ld at,got(.data)(gp) + # 01bc nop + # 01c0 daddiu at,at,lo(unshared) + # 01c4 ldl a0,0(at) + # 01c8 ldr a0,7(at) + usd $4, unshared # 01cc ld at,got(.data)(gp) + # 01d0 nop + # 01d4 daddiu at,at,lo(unshared) + # 01d8 sdl a0,0(at) + # 01dc sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 01e0 lui at,0x8000 + # 01e4 slt at,a0,at + # 01e8 beqz at,end + # 01ec nop + bgtu $4, 0xffffffff, end # 01f0 li at,0x8000 + # 01f4 dsll at,at,17 + # 01f8 sltu at,a0,at + # 01fc beqz at,end + # 0200 nop + ble $4, 0x7fffffff, end # 0204 lui at,0x8000 + # 0208 slt at,a0,at + # 020c bnez at,end + # 0210 nop + bleu $4, 0xffffffff, end # 0214 li at,0x8000 + # 0218 dsll at,at,17 + # 021c sltu at,a0,at + # 0220 bnez at,end + # 0224 nop + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32.d b/gas/testsuite/gas/mips/mips-gp64-fp32.d new file mode 100644 index 0000000..6dd2217 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp32.d @@ -0,0 +1,94 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mfp32 +#name: MIPS -mgp64 -mfp32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 6784c000 daddiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 64840000 daddiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 64840154 daddiu a0,a0,340 + 1c: 08000055 j 154 <[^>]*> + 20: 0c000055 jal 154 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840154 lw a0,340\(a0\) + 38: df84c000 ld a0,-16384\(gp\) + 3c: 3c040000 lui a0,0x0 + 40: dc840000 ld a0,0\(a0\) + 44: 3c040000 lui a0,0x0 + 48: dc840154 ld a0,340\(a0\) + 4c: af84c000 sw a0,-16384\(gp\) + 50: 3c010000 lui at,0x0 + 54: ac240000 sw a0,0\(at\) + 58: ff84c000 sd a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: fc240000 sd a0,0\(at\) + 64: 3c010000 lui at,0x0 + 68: 64210000 daddiu at,at,0 + 6c: 80240000 lb a0,0\(at\) + 70: 90210001 lbu at,1\(at\) + 74: 00042200 sll a0,a0,0x8 + 78: 00812025 or a0,a0,at + 7c: 3c010000 lui at,0x0 + 80: 64210000 daddiu at,at,0 + 84: a0240001 sb a0,1\(at\) + 88: 00042202 srl a0,a0,0x8 + 8c: a0240000 sb a0,0\(at\) + 90: 90210001 lbu at,1\(at\) + 94: 00042200 sll a0,a0,0x8 + 98: 00812025 or a0,a0,at + 9c: 3c010000 lui at,0x0 + a0: 64210000 daddiu at,at,0 + a4: 88240000 lwl a0,0\(at\) + a8: 98240003 lwr a0,3\(at\) + ac: 3c010000 lui at,0x0 + b0: 64210000 daddiu at,at,0 + b4: a8240000 swl a0,0\(at\) + b8: b8240003 swr a0,3\(at\) + bc: 3404ffc0 li a0,0xffc0 + c0: 000423bc dsll32 a0,a0,0xe + c4: 3c010000 lui at,0x0 + c8: dc240000 ld a0,0\(at\) + cc: 3c013ff0 lui at,0x3ff0 + d0: 44810800 mtc1 at,\$f1 + d4: 44800000 mtc1 zero,\$f0 + d8: d780c000 ldc1 \$f0,-16384\(gp\) + dc: 64a40064 daddiu a0,a1,100 + e0: 2c840001 sltiu a0,a0,1 + e4: 64a40064 daddiu a0,a1,100 + e8: 0004202b sltu a0,zero,a0 + ec: 00a0202d move a0,a1 + f0: 6784c000 daddiu a0,gp,-16384 + f4: 3c040000 lui a0,0x0 + f8: 64840000 daddiu a0,a0,0 + fc: 3c010000 lui at,0x0 + 100: 64210000 daddiu at,at,0 + 104: 68240000 ldl a0,0\(at\) + 108: 6c240007 ldr a0,7\(at\) + 10c: 3c010000 lui at,0x0 + 110: 64210000 daddiu at,at,0 + 114: b0240000 sdl a0,0\(at\) + 118: b4240007 sdr a0,7\(at\) + 11c: 3c018000 lui at,0x8000 + 120: 0081082a slt at,a0,at + 124: 1020000b beqz at,154 <[^>]*> + 128: 34018000 li at,0x8000 + 12c: 00010c78 dsll at,at,0x11 + 130: 0081082b sltu at,a0,at + 134: 10200007 beqz at,154 <[^>]*> + 138: 3c018000 lui at,0x8000 + 13c: 0081082a slt at,a0,at + 140: 14200004 bnez at,154 <[^>]*> + 144: 34018000 li at,0x8000 + 148: 00010c78 dsll at,at,0x11 + 14c: 0081082b sltu at,a0,at + 150: 14200000 bnez at,154 <[^>]*> diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32.s b/gas/testsuite/gas/mips/mips-gp64-fp32.s new file mode 100644 index 0000000..8a5f1d7 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp32.s @@ -0,0 +1,108 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .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 + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 daddiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 daddiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 ld a0,shared(gp) + ld $4, unshared # 003c lui a0,hi(unshared) + # 0040 ld a0,lo(unshared)(a0) + ld $4, end # 0044 lui a0,hi(end) + # 0048 ld a0,lo(end)(a0) + sw $4, shared # 004c sw a0,shared(gp) + sw $4, unshared # 0050 lui at,hi(unshared) + # 0054 sw a0,lo(unshared)(at) + sd $4, shared # 0058 sd a0,shared(gp) + sd $4, unshared # 005c lui at,hi(unshared) + # 0060 sd a0,lo(unshared)(at) + ulh $4, unshared # 0064 lui at,hi(unshared) + # 0068 daddiu at,at,lo(unshared) + # 006c lb a0,0(at) + # 0070 lbu at,1(at) + # 0074 sll a0,a0,8 + # 0078 or a0,a0,at + ush $4, unshared # 007c lui at,hi(unshared) + # 0080 daddiu at,at,lo(unshared) + # 0084 sb a0,1(at) + # 0088 srl a0,a0,8 + # 008c sb a0,0(at) + # 0090 lbu at,1(at) + # 0094 sll a0,a0,8 + # 0098 or a0,a0,at + ulw $4, unshared # 009c lui at,hi(unshared) + # 00a0 daddiu at,at,lo(unshared) + # 00a4 lwl a0,0(at) + # 00a8 lwr a0,3(at) + usw $4, unshared # 00ac lui at,hi(unshared) + # 00b0 daddiu at,at,lo(unshared) + # 00b4 swl a0,0(at) + # 00b8 swr a0,3(at) + li.d $4, 1.0 # 00bc li a0,0xffc0 + # 00c0 dsll32 a0,a0,14 # giving 0x3ff00000... + li.d $4, 1.9 # 00c4 lui at,hi(F1.9) + # 00c8 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 00cc lui at,0x3ff0 + # 00d0 mtc1 at,$f1 + # 00d4 mtc1 zero,$f0 + li.d $f0, 1.9 # 00d8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00dc daddiu a0,a1,100 + # 00e0 sltiu a0,a0,1 + sne $4, $5, -100 # 00e4 daddiu a0,a1,100 + # 00e8 sltu a0,zero,a0 + move $4, $5 # 00ec move a0,a1 + + dla $4, shared # 00f0 daddiu a0,gp,shared + dla $4, unshared # 00f4 lui a0,hi(unshared) + # 00f8 daddiu a0,a0,lo(unshared) + uld $4, unshared # 00fc lui at,hi(unshared) + # 0100 daddiu at,at,lo(unshared) + # 0104 ldl a0,0(at) + # 0108 ldr a0,7(at) + usd $4, unshared # 010c lui at,hi(unshared) + # 0110 daddiu at,at,lo(unshared) + # 0114 sdl a0,0(at) + # 0118 sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 011c lui at,0x8000 + # 0120 slt at,a0,at + # 0124 beqz at,end + bgtu $4, 0xffffffff, end # 0128 li at,0x8000 + # 012c dsll at,at,17 + # 0130 sltu at,a0,at + # 0134 beqz at,end + ble $4, 0x7fffffff, end # 0138 lui at,0x8000 + # 013c slt at,a0,at + # 0140 bnez at,end + bleu $4, 0xffffffff, end # 0144 li at,0x8000 + # 0148 dsll at,at,17 + # 014c sltu at,a0,at + # 0150 bnez at,end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d b/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d new file mode 100644 index 0000000..076d48b --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d @@ -0,0 +1,148 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -KPIC +#name: MIPS -mgp64 -mfp64 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: ffbc0008 sd gp,8\(sp\) + 10: 009c202d daddu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 64840000 daddiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 64840000 daddiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 6484022c daddiu a0,a0,556 + 40: 1000007a b 22c <[^>]*> + 44: 00000000 nop + 48: df990000 ld t9,0\(gp\) + 4c: 00000000 nop + 50: 6739022c daddiu t9,t9,556 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: dfbc0008 ld gp,8\(sp\) + 60: df840000 ld a0,0\(gp\) + 64: 00000000 nop + 68: 64840000 daddiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: df840000 ld a0,0\(gp\) + 74: 00000000 nop + 78: 64840000 daddiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: df840000 ld a0,0\(gp\) + 84: 00000000 nop + 88: 6484022c daddiu a0,a0,556 + 8c: 8c840000 lw a0,0\(a0\) + 90: df840000 ld a0,0\(gp\) + 94: 00000000 nop + 98: 64840000 daddiu a0,a0,0 + 9c: dc840000 ld a0,0\(a0\) + a0: df840000 ld a0,0\(gp\) + a4: 00000000 nop + a8: 64840000 daddiu a0,a0,0 + ac: dc840000 ld a0,0\(a0\) + b0: df840000 ld a0,0\(gp\) + b4: 00000000 nop + b8: 6484022c daddiu a0,a0,556 + bc: dc840000 ld a0,0\(a0\) + c0: df810000 ld at,0\(gp\) + c4: 00000000 nop + c8: 64210000 daddiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: df810000 ld at,0\(gp\) + d4: 00000000 nop + d8: 64210000 daddiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: df810000 ld at,0\(gp\) + e4: 00000000 nop + e8: 64210000 daddiu at,at,0 + ec: fc240000 sd a0,0\(at\) + f0: df810000 ld at,0\(gp\) + f4: 00000000 nop + f8: 64210000 daddiu at,at,0 + fc: fc240000 sd a0,0\(at\) + 100: df810000 ld at,0\(gp\) + 104: 00000000 nop + 108: 64210000 daddiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: df810000 ld at,0\(gp\) + 120: 00000000 nop + 124: 64210000 daddiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: df810000 ld at,0\(gp\) + 144: 00000000 nop + 148: 64210000 daddiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: df810000 ld at,0\(gp\) + 158: 00000000 nop + 15c: 64210000 daddiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3404ffc0 li a0,0xffc0 + 16c: 000423bc dsll32 a0,a0,0xe + 170: df810000 ld at,0\(gp\) + 174: dc240000 ld a0,0\(at\) + 178: 3401ffc0 li at,0xffc0 + 17c: 00010bbc dsll32 at,at,0xe + 180: 44a10000 dmtc1 at,\$f0 + 184: df810000 ld at,0\(gp\) + 188: d4200008 ldc1 \$f0,8\(at\) + 18c: 64a40064 daddiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 64a40064 daddiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a0202d move a0,a1 + 1a0: df840000 ld a0,0\(gp\) + 1a4: 00000000 nop + 1a8: 64840000 daddiu a0,a0,0 + 1ac: df840000 ld a0,0\(gp\) + 1b0: 00000000 nop + 1b4: 64840000 daddiu a0,a0,0 + 1b8: df810000 ld at,0\(gp\) + 1bc: 00000000 nop + 1c0: 64210000 daddiu at,at,0 + 1c4: 68240000 ldl a0,0\(at\) + 1c8: 6c240007 ldr a0,7\(at\) + 1cc: df810000 ld at,0\(gp\) + 1d0: 00000000 nop + 1d4: 64210000 daddiu at,at,0 + 1d8: b0240000 sdl a0,0\(at\) + 1dc: b4240007 sdr a0,7\(at\) + 1e0: 3c018000 lui at,0x8000 + 1e4: 0081082a slt at,a0,at + 1e8: 10200010 beqz at,22c <[^>]*> + 1ec: 00000000 nop + 1f0: 34018000 li at,0x8000 + 1f4: 00010c78 dsll at,at,0x11 + 1f8: 0081082b sltu at,a0,at + 1fc: 1020000b beqz at,22c <[^>]*> + 200: 00000000 nop + 204: 3c018000 lui at,0x8000 + 208: 0081082a slt at,a0,at + 20c: 14200007 bnez at,22c <[^>]*> + 210: 00000000 nop + 214: 34018000 li at,0x8000 + 218: 00010c78 dsll at,at,0x11 + 21c: 0081082b sltu at,a0,at + 220: 14200002 bnez at,22c <[^>]*> + 224: 00000000 nop + 228: 46231040 add.d \$f1,\$f2,\$f3 diff --git a/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s b/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s new file mode 100644 index 0000000..24f07d6 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s @@ -0,0 +1,162 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sd gp,8(sp) + .cpadd $4 # 0010 daddu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 daddiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 daddiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c daddiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 ld t9,got(.text)(gp) + # 004c nop + # 0050 daddiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c ld gp,8(sp) + lw $4, shared # 0060 ld a0,got(.sdata)(gp) + # 0064 nop + # 0068 daddiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 ld a0,got(.data)(gp) + # 0074 nop + # 0078 daddiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 ld a0,got(.text)(gp) + # 0084 nop + # 0088 daddiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 ld a0,got(.sdata)(gp) + # 0094 nop + # 0098 daddiu a0,a0,lo(shared) + # 009c ld a0,(a0) + ld $4, unshared # 00a0 ld a0,got(.data)(gp) + # 00a4 nop + # 00a8 daddiu a0,a0,lo(unshared) + # 00ac ld a0,(a0) + ld $4, end # 00b0 ld a0,got(.text)(gp) + # 00b4 nop + # 00b8 daddiu a0,a0,lo(end) + # 00bc ld a0,(a0) + sw $4, shared # 00c0 ld at,got(.sdata)(gp) + # 00c4 nop + # 00c8 daddiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 ld at,got(.data)(gp) + # 00d4 nop + # 00d8 daddiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 ld at,got(.sdata)(gp) + # 00e4 nop + # 00e8 daddiu at,at,lo(shared) + # 00ec sd a0,(at) + sd $4, unshared # 00f0 ld at,got(.data)(gp) + # 00f4 nop + # 00f8 daddiu at,at,lo(unshared) + # 00fc sd a0,(at) + ulh $4, unshared # 0100 ld at,got(.data)(gp) + # 0104 nop + # 0108 daddiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c ld at,got(.data)(gp) + # 0120 nop + # 0124 daddiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 ld at,got(.data)(gp) + # 0144 nop + # 0148 daddiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 ld at,got(.data)(gp) + # 0158 nop + # 015c daddiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 li a0,0xffc0 + # 016c dsll32 a0,a0,14 + li.d $4, 1.9 # 0170 ld at,got(.rodata)(gp) + # 0174 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 0178 li at,0xffc0 + # 017c dsll32 at,at,14 + # 0180 dmtc1 at,$f0 + li.d $f0, 1.9 # 0184 ld at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c daddiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 daddiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + + dla $4, shared # 01a0 ld a0,got(.sdata)(gp) + # 01a4 nop + # 01a8 daddiu a0,a0,lo(shared) + dla $4, unshared # 01ac ld a0,got(.data)(gp) + # 01b0 nop + # 01b4 daddiu a0,a0,lo(unshared) + uld $4, unshared # 01b8 ld at,got(.data)(gp) + # 01bc nop + # 01c0 daddiu at,at,lo(unshared) + # 01c4 ldl a0,0(at) + # 01c8 ldr a0,7(at) + usd $4, unshared # 01cc ld at,got(.data)(gp) + # 01d0 nop + # 01d4 daddiu at,at,lo(unshared) + # 01d8 sdl a0,0(at) + # 01dc sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 01e0 lui at,0x8000 + # 01e4 slt at,a0,at + # 01e8 beqz at,end + # 01ec nop + bgtu $4, 0xffffffff, end # 01f0 li at,0x8000 + # 01f4 dsll at,at,17 + # 01f8 sltu at,a0,at + # 01fc beqz at,end + # 0200 nop + ble $4, 0x7fffffff, end # 0204 lui at,0x8000 + # 0208 slt at,a0,at + # 020c bnez at,end + # 0210 nop + bleu $4, 0xffffffff, end # 0214 li at,0x8000 + # 0218 dsll at,at,17 + # 021c sltu at,a0,at + # 0220 bnez at,end + # 0224 nop + + add.d $f1, $f2, $f3 # 0228 add.d $f1,$f2,$f3 + +end: diff --git a/gas/testsuite/gas/mips/mips-gp64-fp64.d b/gas/testsuite/gas/mips/mips-gp64-fp64.d new file mode 100644 index 0000000..5caef53 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp64.d @@ -0,0 +1,95 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB +#name: MIPS -mgp64 -mfp64 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 6784c000 daddiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 64840000 daddiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 64840158 daddiu a0,a0,344 + 1c: 08000056 j 158 <[^>]*> + 20: 0c000056 jal 158 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840158 lw a0,344\(a0\) + 38: df84c000 ld a0,-16384\(gp\) + 3c: 3c040000 lui a0,0x0 + 40: dc840000 ld a0,0\(a0\) + 44: 3c040000 lui a0,0x0 + 48: dc840158 ld a0,344\(a0\) + 4c: af84c000 sw a0,-16384\(gp\) + 50: 3c010000 lui at,0x0 + 54: ac240000 sw a0,0\(at\) + 58: ff84c000 sd a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: fc240000 sd a0,0\(at\) + 64: 3c010000 lui at,0x0 + 68: 64210000 daddiu at,at,0 + 6c: 80240000 lb a0,0\(at\) + 70: 90210001 lbu at,1\(at\) + 74: 00042200 sll a0,a0,0x8 + 78: 00812025 or a0,a0,at + 7c: 3c010000 lui at,0x0 + 80: 64210000 daddiu at,at,0 + 84: a0240001 sb a0,1\(at\) + 88: 00042202 srl a0,a0,0x8 + 8c: a0240000 sb a0,0\(at\) + 90: 90210001 lbu at,1\(at\) + 94: 00042200 sll a0,a0,0x8 + 98: 00812025 or a0,a0,at + 9c: 3c010000 lui at,0x0 + a0: 64210000 daddiu at,at,0 + a4: 88240000 lwl a0,0\(at\) + a8: 98240003 lwr a0,3\(at\) + ac: 3c010000 lui at,0x0 + b0: 64210000 daddiu at,at,0 + b4: a8240000 swl a0,0\(at\) + b8: b8240003 swr a0,3\(at\) + bc: 3404ffc0 li a0,0xffc0 + c0: 000423bc dsll32 a0,a0,0xe + c4: 3c010000 lui at,0x0 + c8: dc240000 ld a0,0\(at\) + cc: 3401ffc0 li at,0xffc0 + d0: 00010bbc dsll32 at,at,0xe + d4: 44a10000 dmtc1 at,\$f0 + d8: d780c000 ldc1 \$f0,-16384\(gp\) + dc: 64a40064 daddiu a0,a1,100 + e0: 2c840001 sltiu a0,a0,1 + e4: 64a40064 daddiu a0,a1,100 + e8: 0004202b sltu a0,zero,a0 + ec: 00a0202d move a0,a1 + f0: 6784c000 daddiu a0,gp,-16384 + f4: 3c040000 lui a0,0x0 + f8: 64840000 daddiu a0,a0,0 + fc: 3c010000 lui at,0x0 + 100: 64210000 daddiu at,at,0 + 104: 68240000 ldl a0,0\(at\) + 108: 6c240007 ldr a0,7\(at\) + 10c: 3c010000 lui at,0x0 + 110: 64210000 daddiu at,at,0 + 114: b0240000 sdl a0,0\(at\) + 118: b4240007 sdr a0,7\(at\) + 11c: 3c018000 lui at,0x8000 + 120: 0081082a slt at,a0,at + 124: 1020000c beqz at,158 <[^>]*> + 128: 34018000 li at,0x8000 + 12c: 00010c78 dsll at,at,0x11 + 130: 0081082b sltu at,a0,at + 134: 10200008 beqz at,158 <[^>]*> + 138: 3c018000 lui at,0x8000 + 13c: 0081082a slt at,a0,at + 140: 14200005 bnez at,158 <[^>]*> + 144: 34018000 li at,0x8000 + 148: 00010c78 dsll at,at,0x11 + 14c: 0081082b sltu at,a0,at + 150: 14200001 bnez at,158 <[^>]*> + 154: 46231040 add.d \$f1,\$f2,\$f3 diff --git a/gas/testsuite/gas/mips/mips-gp64-fp64.s b/gas/testsuite/gas/mips/mips-gp64-fp64.s new file mode 100644 index 0000000..a926256 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-gp64-fp64.s @@ -0,0 +1,106 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .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 + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 daddiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 daddiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 ld a0,shared(gp) + ld $4, unshared # 003c lui a0,hi(unshared) + # 0040 ld a0,lo(unshared)(a0) + ld $4, end # 0044 lui a0,hi(end) + # 0048 ld a0,lo(end)(a0) + sw $4, shared # 004c sw a0,shared(gp) + sw $4, unshared # 0050 lui at,hi(unshared) + # 0054 sw a0,lo(unshared)(at) + sd $4, shared # 0058 sd a0,shared(gp) + sd $4, unshared # 005c lui at,hi(unshared) + # 0060 sd a0,lo(unshared)(at) + ulh $4, unshared # 0064 lui at,hi(unshared) + # 0068 daddiu at,at,lo(unshared) + # 006c lb a0,0(at) + # 0070 lbu at,1(at) + # 0074 sll a0,a0,8 + # 0078 or a0,a0,at + ush $4, unshared # 007c lui at,hi(unshared) + # 0080 daddiu at,at,lo(unshared) + # 0084 sb a0,1(at) + # 0088 srl a0,a0,8 + # 008c sb a0,0(at) + # 0090 lbu at,1(at) + # 0094 sll a0,a0,8 + # 0098 or a0,a0,at + ulw $4, unshared # 009c lui at,hi(unshared) + # 00a0 daddiu at,at,lo(unshared) + # 00a4 lwl a0,0(at) + # 00a8 lwr a0,3(at) + usw $4, unshared # 00ac lui at,hi(unshared) + # 00b0 daddiu at,at,lo(unshared) + # 00b4 swl a0,0(at) + # 00b8 swr a0,3(at) + li.d $4, 1.0 # 00bc li a0,0xffc0 + # 00c0 dsll32 a0,a0,14 # giving 0x3ff00000... + li.d $4, 1.9 # 00c4 lui at,hi(F1.9) + # 00c8 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 00cc li at,0xffc0 + # 00d0 dsll32 at,at,14 + # 00d4 dmtc1 at,$f0 + li.d $f0, 1.9 # 00d8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00dc daddiu a0,a1,100 + # 00e0 sltiu a0,a0,1 + sne $4, $5, -100 # 00e4 daddiu a0,a1,100 + # 00e8 sltu a0,zero,a0 + move $4, $5 # 00ec move a0,a1 + + dla $4, shared # 00f0 daddiu a0,gp,shared + dla $4, unshared # 00f4 lui a0,hi(unshared) + # 00f8 daddiu a0,a0,lo(unshared) + uld $4, unshared # 00fc lui at,hi(unshared) + # 0100 daddiu at,at,lo(unshared) + # 0104 ldl a0,0(at) + # 0108 ldr a0,7(at) + usd $4, unshared # 010c lui at,hi(unshared) + # 0110 daddiu at,at,lo(unshared) + # 0114 sdl a0,0(at) + # 0118 sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 011c lui at,0x8000 + # 0120 slt at,a0,at + # 0124 beqz at,end + bgtu $4, 0xffffffff, end # 0128 li at,0x8000 + # 012c dsll at,at,17 + # 0130 sltu at,a0,at + # 0134 beqz at,end + ble $4, 0x7fffffff, end # 0138 lui at,0x8000 + # 013c slt at,a0,at + # 0140 bnez at,end + bleu $4, 0xffffffff, end # 0144 li at,0x8000 + # 0148 dsll at,at,17 + # 014c sltu at,a0,at + # 0150 bnez at,end + + add.d $f1, $f2, $f3 # 0154 add.d $f1,$f2,$f3 +end: diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index d693dfe..00344ce 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -124,6 +124,12 @@ if { [istarget mips*-*-*] } then { run_list_test "illegal" "" + run_dump_test "mips-gp32-fp32" + run_dump_test "mips-gp32-fp64" + run_dump_test "mips-gp64-fp32" + run_dump_test "mips-gp64-fp64" + run_dump_test "mips-abi32" + if $svr4pic { # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file # containing 4650-specific instructions with -m4650 and -mcpu=4650, @@ -135,6 +141,12 @@ if { [istarget mips*-*-*] } then { run_dump_test "elf_e_flags2" run_dump_test "elf_e_flags3" run_dump_test "elf_e_flags4" + + run_dump_test "mips-gp32-fp32-pic" + run_dump_test "mips-gp32-fp64-pic" + run_dump_test "mips-gp64-fp32-pic" + run_dump_test "mips-gp64-fp64-pic" + run_dump_test "mips-abi32-pic" run_dump_test "elf${el}-rel" if [istarget mips64*-*-*] { |