1 # frv testcase for udivi $GRi,$s12,$GRk
4 .include "../testutils.inc"
10 ; simple division 12 / 3
11 set_gr_immed 0x0000000c,gr3
13 test_gr_immed 0x00000004,gr3
16 set_gr_limmed 0xfedc,0xba98,gr3
18 test_gr_limmed 0x001f,0xdf93,gr3
21 set_gr_limmed 0xffff,0xffff,gr3
25 ; set up exception handler
27 and_spr_immed -4081,tbr ; clear tbr.tt
29 inc_gr_immed 0x170,gr17 ; address of exception handler
36 e1: udivi gr1,0,gr2 ; divide by zero
41 ok1: ; exception handler for divide by zero
42 test_spr_bits 0x18,3,0x1,isr ; isr.dtt is set
43 test_spr_bits 0x0001,0,0x1,esr0 ; esr0 is valid
44 test_spr_bits 0x003e,1,0x13,esr0 ; esr0.ec is set