From c84e5117321e3cb97f782629612f85786bbf815d Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Tue, 22 Oct 2002 23:15:59 +0000 Subject: [PATCH] * gas/cris/rd-pcrel1.d, gas/cris/rd-pcrel1.s, gas/cris/rd-pcrel2.d, gas/cris/rd-pcrel2.s: New tests. --- gas/testsuite/ChangeLog | 5 ++++ gas/testsuite/gas/cris/rd-pcrel1.d | 45 ++++++++++++++++++++++++++++ gas/testsuite/gas/cris/rd-pcrel1.s | 55 ++++++++++++++++++++++++++++++++++ gas/testsuite/gas/cris/rd-pcrel2.d | 40 +++++++++++++++++++++++++ gas/testsuite/gas/cris/rd-pcrel2.s | 60 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 205 insertions(+) create mode 100644 gas/testsuite/gas/cris/rd-pcrel1.d create mode 100644 gas/testsuite/gas/cris/rd-pcrel1.s create mode 100644 gas/testsuite/gas/cris/rd-pcrel2.d create mode 100644 gas/testsuite/gas/cris/rd-pcrel2.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index d6ec0cc..383276b 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-10-23 Hans-Peter Nilsson + + * gas/cris/rd-pcrel1.d, gas/cris/rd-pcrel1.s, + gas/cris/rd-pcrel2.d, gas/cris/rd-pcrel2.s: New tests. + 2002-10-21 Richard Sandiford * gas/mips/elf-rel7.[sd]: New test. diff --git a/gas/testsuite/gas/cris/rd-pcrel1.d b/gas/testsuite/gas/cris/rd-pcrel1.d new file mode 100644 index 0000000..4614c43 --- /dev/null +++ b/gas/testsuite/gas/cris/rd-pcrel1.d @@ -0,0 +1,45 @@ +#objdump: -dr + +.*: file format .*-cris + +Disassembly of section \.text: +#... +[ ]+28:[ ]+6fae 6e00 0000[ ]+move.d 6e ,r10 +[ ]+2e:[ ]+6fae dcff ffff[ ]+move.d 0xffffffdc,r10 +[ ]+34:[ ]+6fae 5c00 0000[ ]+move.d 5c ,r10 +[ ]+3a:[ ]+6fae caff ffff[ ]+move.d 0xffffffca,r10 +[ ]+40:[ ]+6fae 5000 0000[ ]+move.d 50 ,r10 +[ ]+46:[ ]+6fae beff ffff[ ]+move.d 0xffffffbe,r10 +[ ]+4c:[ ]+3ef1 633a[ ]+move.d \[pc\+62\],r3 +[ ]+50:[ ]+b8f1 633a[ ]+move.d \[pc-72\],r3 +[ ]+54:[ ]+40f1 633a[ ]+move.d \[pc\+64\],r3 +0+58 : +[ ]+58:[ ]+b0f1 633a[ ]+move.d \[pc-80\],r3 +0+5c : +[ ]+5c:[ ]+38f1 633a[ ]+move.d \[pc\+56\],r3 +0+60 : +[ ]+60:[ ]+a8f1 633a[ ]+move.d \[pc-88\],r3 +0+64 : +#... +[ ]+480:[ ]+5ffd 0a04 633a[ ]+move.d \[pc\+1034\],r3 +[ ]+486:[ ]+5ffd 82fb 633a[ ]+move.d \[pc-1150\],r3 +[ ]+48c:[ ]+5ffd fc03 633a[ ]+move.d \[pc\+1020\],r3 +0+492 : +[ ]+492:[ ]+5ffd 74fb 633a[ ]+move.d \[pc-1164\],r3 +0+498 : +[ ]+498:[ ]+5ffd f003 633a[ ]+move.d \[pc\+1008\],r3 +0+49e : +[ ]+49e:[ ]+5ffd 68fb 633a[ ]+move.d \[pc-1176\],r3 +#... +[ ]+18f2e:[ ]+6ffd ce86 0100 633a[ ]+move.d \[pc\+186ce \],r3 +[ ]+18f36:[ ]+6ffd d270 feff 633a[ ]+move.d \[pc\+fffe70d2 \],r3 +[ ]+18f3e:[ ]+6ffd ba86 0100 633a[ ]+move.d \[pc\+186ba \],r3 +0+18f46 : +[ ]+18f46:[ ]+6ffd be70 feff 633a[ ]+move.d \[pc\+fffe70be \],r3 +0+18f4e : +[ ]+18f4e:[ ]+6ffd aa86 0100 633a[ ]+move.d \[pc\+186aa \],r3 +0+18f56 : +[ ]+18f56:[ ]+6ffd ae70 feff 633a[ ]+move.d \[pc\+fffe70ae \],r3 +#... +0+315fe : +[ ]+315fe:[ ]+0f05[ ]+nop diff --git a/gas/testsuite/gas/cris/rd-pcrel1.s b/gas/testsuite/gas/cris/rd-pcrel1.s new file mode 100644 index 0000000..3920f4b --- /dev/null +++ b/gas/testsuite/gas/cris/rd-pcrel1.s @@ -0,0 +1,55 @@ +; Test that pc-relative expressions give expected results for +; various expressions. + .text + .space 10 +x: + .space 30 +xx: + move.d y-.,r10 + move.d x-.,r10 + move.d y-(.+6),r10 + move.d x-(.+6),r10 + move.d y-.-6,r10 + move.d x-.-6,r10 + move.d [pc+y-(.+12)],r3 + move.d [pc+x-(.+2)],r3 + move.d [pc+y-(y00-2)],r3 +y00: + move.d [pc+x-(y01-2)],r3 +y01: + move.d [pc+y-y02+2],r3 +y02: + move.d [pc+x-y03+2],r3 +y03: + .space 50 +y: + nop + .space 1000 + move.d [pc+yy-(.+2)],r3 + move.d [pc+x-(.+2)],r3 + move.d [pc+yy-(yy00-2)],r3 +yy00: + move.d [pc+x-(yy01-2)],r3 +yy01: + move.d [pc+yy-yy02+2],r3 +yy02: + move.d [pc+x-yy03+2],r3 +yy03: + .space 1000 +yy: + nop + .space 100000 + move.d [pc+z-(.+2)],r3 + move.d [pc+x-(.+2)],r3 + move.d [pc+z-(z00-2)],r3 +z00: + move.d [pc+x-(z01-2)],r3 +z01: + move.d [pc+z-z02+2],r3 +z02: + move.d [pc+x-z03+2],r3 +z03: + .space 100000 +z: + nop + diff --git a/gas/testsuite/gas/cris/rd-pcrel2.d b/gas/testsuite/gas/cris/rd-pcrel2.d new file mode 100644 index 0000000..6359865 --- /dev/null +++ b/gas/testsuite/gas/cris/rd-pcrel2.d @@ -0,0 +1,40 @@ +#objdump: -dr + +.*: file format .*-cris + +Disassembly of section \.text: + +0+ : +[ ]+0:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8 +[ ]+4:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8 +[ ]+a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8 +[ ]+e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8 +[ ]+14:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8 +[ ]+1a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd \],r8 +[ ]+22:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8 +[ ]+28:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 \],r8 +0+30 : +[ ]+30:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8 +0+34 : +[ ]+34:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8 +0+3a : +[ ]+3a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8 +0+3e : +[ ]+3e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8 +0+44 : +[ ]+44:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8 +0+4a : +[ ]+4a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd \],r8 +0+52 : +[ ]+52:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8 +0+58 : +[ ]+58:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 \],r8 +0+60 : +[ ]+60:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8 +[ ]+64:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8 +[ ]+6a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8 +[ ]+6e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8 +[ ]+74:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8 +[ ]+7a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd \],r8 +[ ]+82:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8 +[ ]+88:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 \],r8 diff --git a/gas/testsuite/gas/cris/rd-pcrel2.s b/gas/testsuite/gas/cris/rd-pcrel2.s new file mode 100644 index 0000000..922560a --- /dev/null +++ b/gas/testsuite/gas/cris/rd-pcrel2.s @@ -0,0 +1,60 @@ +; Test border-cases for relaxation of pc-relative expressions. + + .macro relaxcode + .endm + + .text + +; Region of relaxation is after insn, same segment +z: + move.d [pc-(x1-x+128-4)],r8 ; 4 + move.d [pc-(x2-x+129-8)],r8 ; 6 + move.d [pc+x3-x+127-14],r8 ; 4 + move.d [pc+x4-x+128-18],r8 ; 6 + move.d [pc-(x5-x+32768-26)],r8 ; 6 + move.d [pc-(x6-x+32769-32)],r8 ; 8 + move.d [pc+x7-x+32767-40],r8 ; 6 + move.d [pc+x8-x+32768-46],r8 ; 8 + + .p2align 1 + +; Region of relaxation is around insn, same segment +x: + move.d [pc-(x1-x+128-4)],r8 ; 4 +x1: + move.d [pc-(x2-x+129-8)],r8 ; 6 +x2: + move.d [pc+x3-x+127-14],r8 ; 4 +x3: + move.d [pc+x4-x+128-18],r8 ; 6 +x4: + move.d [pc-(x5-x+32768-26)],r8 ; 6 +x5: + move.d [pc-(x6-x+32769-32)],r8 ; 8 +x6: + move.d [pc+x7-x+32767-40],r8 ; 6 +x7: + move.d [pc+x8-x+32768-46],r8 ; 8 +x8: + +; Region of relaxation is before insn, same segment. + move.d [pc-(x1-x+128-4)],r8 ; 4 + move.d [pc-(x2-x+129-8)],r8 ; 6 + move.d [pc+x3-x+127-14],r8 ; 4 + move.d [pc+x4-x+128-18],r8 ; 6 + move.d [pc-(x5-x+32768-26)],r8 ; 6 + move.d [pc-(x6-x+32769-32)],r8 ; 8 + move.d [pc+x7-x+32767-40],r8 ; 6 + move.d [pc+x8-x+32768-46],r8 ; 8 + +; Region of relaxation is in other segment. + .section .text.other +y: + move.d [pc-(x1-x+128-4)],r8 ; 4 + move.d [pc-(x2-x+129-8)],r8 ; 6 + move.d [pc+x3-x+127-14],r8 ; 4 + move.d [pc+x4-x+128-18],r8 ; 6 + move.d [pc-(x5-x+32768-26)],r8 ; 6 + move.d [pc-(x6-x+32769-32)],r8 ; 8 + move.d [pc+x7-x+32767-40],r8 ; 6 + move.d [pc+x8-x+32768-46],r8 ; 8 -- 2.7.4