From 2cf8f53cc9cc54e4b5c129d3a24525aedd3a4462 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Thu, 3 Dec 1998 22:38:13 +0000 Subject: [PATCH] Thu Dec 3 14:20:03 1998 Dave Brolley * 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 | 36 +++++++++++++++ sim/testsuite/sim/fr30/ld.cgs | 68 ++++++++++++++++++++++++++-- sim/testsuite/sim/fr30/testutils.inc | 15 ++++++ 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 sim/testsuite/sim/fr30/call.cgs diff --git a/sim/testsuite/sim/fr30/call.cgs b/sim/testsuite/sim/fr30/call.cgs new file mode 100644 index 00000000000..da0d4504b9a --- /dev/null +++ b/sim/testsuite/sim/fr30/call.cgs @@ -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 diff --git a/sim/testsuite/sim/fr30/ld.cgs b/sim/testsuite/sim/fr30/ld.cgs index 56846396e02..1d7ae0751ca 100644 --- a/sim/testsuite/sim/fr30/ld.cgs +++ b/sim/testsuite/sim/fr30/ld.cgs @@ -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 diff --git a/sim/testsuite/sim/fr30/testutils.inc b/sim/testsuite/sim/fr30/testutils.inc index 7f9bbc45301..06b106347dc 100644 --- a/sim/testsuite/sim/fr30/testutils.inc +++ b/sim/testsuite/sim/fr30/testutils.inc @@ -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) -- 2.30.2