Thu Dec 3 14:20:03 1998 Dave Brolley <brolley@cygnus.com>
authorDave Brolley <brolley@redhat.com>
Thu, 3 Dec 1998 22:38:13 +0000 (22:38 +0000)
committerDave Brolley <brolley@redhat.com>
Thu, 3 Dec 1998 22:38:13 +0000 (22:38 +0000)
* sim/fr30/ld.cgs: Implement more loads.
* sim/fr30/call.cgs: New testcase.
* sim/fr30/testutils.inc (testr_h_dr): New macro.
(set_s_user,set_s_system): New macros.

sim/testsuite/sim/fr30/call.cgs [new file with mode: 0644]
sim/testsuite/sim/fr30/ld.cgs
sim/testsuite/sim/fr30/testutils.inc

diff --git a/sim/testsuite/sim/fr30/call.cgs b/sim/testsuite/sim/fr30/call.cgs
new file mode 100644 (file)
index 0000000..da0d450
--- /dev/null
@@ -0,0 +1,36 @@
+# fr30 testcase for call @$Ri
+# mach(): fr30
+
+       .include "testutils.inc"
+
+       START
+
+       .text
+       .global call
+
+       ; Test call $Ri
+       mvi_h_gr        #func1,r0
+       set_cc          0x0f            ; condition codes shouldn't change
+call1:
+       call            @r0
+       fail
+func1:
+       test_cc         1 1 1 1
+       mvi_h_gr        #call1,r7
+       inci_h_gr       2,r7
+       testr_h_dr      r7,rp
+
+       mvi_h_gr        #func2,r0
+       set_cc          0x0f            ; condition codes shouldn't change
+call2:
+       call:d          @r0
+       ldi:8           1,r0            ; Must assume this works
+       fail
+func2:
+       test_cc         1 1 1 1
+       mvi_h_gr        #call2,r7
+       inci_h_gr       4,r7
+       testr_h_dr      r7,rp
+       testr_h_gr      1,r0
+
+       pass
index 56846396e027ad350aba823ad2065ad7aee1a88e..1d7ae0751ca299afba191d6cc1e4a6d8f605a30c 100644 (file)
@@ -5,6 +5,7 @@
 # ld @($R14,$disp10),$Ri
 # ld @($R15,$udisp6),$Ri
 # ld @$R15+,$Ri
+# ld @$R15+,$Rs
 
        .include "testutils.inc"
 
@@ -143,16 +144,77 @@ ld:
        inci_h_gr       4,r9            ; original stack pointer + 4
        mvi_h_mem       #0xdeadbeef,sp  ; prime memory
 
+       mvr_h_gr        r8,sp           ; restore original stack pointer
        set_cc          0x0f            ; condition codes should not change
        ld              @r15+,r7
        test_cc         1 1 1 1
        test_h_gr       0xdeadbeef,r7
        testr_h_gr      sp,r9           ; should have been incremented
 
-       mvr_h_gr        r8,sp           ; save original stack pointer
+       ; Test ld @$R15+,$Rs
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,tbr
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,tbr
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,rp
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,rp
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,mdh
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,mdh
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,mdl
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,mdl
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       ; Failing tests moved to the bottom
+       set_s_user
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,ssp
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,ssp
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,usp
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,usp
+       test_h_gr       0xdeadbeef,sp   ; should not have been incremented
+
+       set_s_system
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,usp
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,usp
+       testr_h_gr      sp,r9           ; should have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
+       ld              @r15+,ssp
+       test_cc         1 1 1 1
+       test_h_dr       0xdeadbeef,ssp
+       test_h_gr       0xdeadbeef,sp   ; should not have been incremented
+
+       mvr_h_gr        r8,sp           ; restore original stack pointer
+       set_cc          0x0f            ; condition codes should not change
        ld              @r15+,sp
        test_cc         1 1 1 1
-       test_h_gr       0xdeadbeef,sp
-       testr_h_gr      sp,r8           ; should not have been incremented
+       test_h_gr       0xdeadbeef,sp   ; should not have been incremented
 
        pass
index 7f9bbc45301ff9c8b954ffbb4745912b2e37780e..06b106347dc6629e42430315b21c398ea6d5750d 100644 (file)
@@ -108,6 +108,12 @@ testr_gr\@:
        test_h_gr \val r5
        .endm
 
+; Test the value of an general register against a dedicated register
+       .macro testr_h_dr gr dr
+       mov \dr,r5
+       testr_h_gr \gr r5
+       .endm
+
 ; Compare an immediate with word in memory
        .macro test_h_mem val addr
        ldmem_h_gr \addr r5
@@ -120,6 +126,15 @@ testr_gr\@:
        orccr   \mask
        .endm
 
+; Set the stack mode
+       .macro set_s_user
+       orccr   0x10
+       .endm
+
+       .macro set_s_system
+       andccr  0xef
+       .endm
+
 ; Test the condition codes
        .macro test_cc N Z V C
        .if (\N == 1)