1 # frv testcase to generate interrupts for bad register alignment
3 .include "testutils.inc"
9 and_spr_immed -4081,tbr ; clear tbr.tt
11 inc_gr_immed 0x080,gr17 ; address of exception handler
13 inc_gr_immed 0x050,gr17 ; address of exception handler
19 ; Make the the register number odd at bad[1-4], bad9 and bada.
20 ; We can't simply code an odd register number because the assembler
21 ; will catch the error.
23 or_gr_immed 0x02000000,gr10
28 or_gr_immed 0x02000000,gr10
33 or_gr_immed 0x02000000,gr10
38 or_gr_immed 0x02000000,gr10
43 or_gr_immed 0x02000000,gr10
48 or_gr_immed 0x02000000,gr10
53 set_gr_immed 4,gr20 ; PC increment
55 inc_gr_immed -12,sp ; for memory alignment
58 bad1: stdi gr0,@(sp,0) ; misaligned reg
62 bad2: lddi @(sp,0),gr8 ; misaligned reg
66 bad3: stdc cpr0,@(sp,gr0) ; misaligned reg
70 bad4: lddc @(sp,gr0),cpr8 ; misaligned reg
74 bad5: stqi gr2,@(sp,0) ; misaligned reg
78 bad6: ldqi @(sp,0),gr10 ; misaligned reg
82 bad7: stqc cpr2,@(sp,gr0) ; misaligned reg
86 bad8: ldqc @(sp,gr0),cpr10 ; misaligned reg
89 set_gr_immed 0,gr20 ; PC increment
91 bad9: stdfi fr0,@(sp,0) ; misaligned reg
95 bada: lddfi @(sp,0),fr8 ; misaligned reg
99 badb: stqfi fr2,@(sp,0) ; misaligned reg
100 test_gr_immed 11,gr15
102 set_gr_addr badc,gr17
103 badc: ldqfi @(sp,0),fr10 ; misaligned reg
104 test_gr_immed 12,gr15
113 ; check register_exception
114 test_spr_immed 0x1,esfr1 ; esr0 is active
115 test_spr_gr epcr0,gr17
116 test_spr_bits 0x0001,0,0x1,esr0 ; esr0 is valid
117 test_spr_bits 0x003e,1,0xc,esr0 ; esr0.ec is set
118 test_spr_bits 0x00c0,6,0x1,esr0 ; esr0.rec is set
119 test_spr_bits 0x0800,11,0x0,esr0 ; esr0.eav is not set
126 test_spr_immed 0,esfr1 ; no esr's active