1 # frv testcase for udiv $GRi,$GRj,$GRk
4 .include "../testutils.inc"
10 ; simple division 12 / 3
11 set_gr_immed 0x00000003,gr2
12 set_gr_immed 0x0000000c,gr3
14 test_gr_immed 0x00000003,gr2
15 test_gr_immed 0x00000004,gr3
17 ; example 1 from udiv in the fr30 manual
18 set_gr_limmed 0x0123,0x4567,gr2
19 set_gr_limmed 0xfedc,0xba98,gr3
21 test_gr_limmed 0x0123,0x4567,gr2
22 test_gr_immed 0x000000e0,gr3
24 ; set up exception handler
26 and_spr_immed -4081,tbr ; clear tbr.tt
28 inc_gr_immed 0x170,gr17 ; address of exception handler
36 e1: udiv gr1,gr0,gr2 ; divide by zero
41 ok1: ; exception handler for divide by zero
42 test_spr_bits 0x18,3,0x3,isr ; isr.dtt is set
43 test_spr_gr epcr0,gr17 ; return address set
44 test_spr_bits 0x0001,0,0x1,esr0 ; esr0 is valid
45 test_spr_bits 0x003e,1,0x13,esr0 ; esr0.ec is set