1 # frv testcase for nsdiv $GRi,$GRj,$GRk
2 # mach: fr500 fr550 frv
4 .include "testutils.inc"
13 ; simple division 12 / 3
18 test_spr_immed 0,gner0
19 test_spr_immed 0,gner1
22 set_gr_limmed 0x0123,0x4567,gr3
23 set_gr_limmed 0xfedc,0xba98,gr1
26 test_spr_immed 0,gner0
27 test_spr_immed 0,gner1
29 ; Special case from the Arch Spec Vol 2
30 or_spr_immed 0x20,isr ; turn on isr.edem
32 set_gr_limmed 0x8000,0x0000,gr1
33 set_spr_immed 4,gner1 ; turn on NE bit for gr2
34 nsdiv gr1,gr3,gr2 ; overflow is masked
35 test_gr_limmed 0x7fff,0xffff,gr2
36 test_spr_bits 0x4,2,1,isr ; isr.aexc is set
37 test_spr_immed 0,gner0
38 test_spr_immed 0,gner1
40 nsdiv gr1,gr0,gr32 ; divide by zero
41 test_spr_immed 1,gner0
42 test_spr_immed 0,gner1
44 and_spr_immed -33,isr ; turn off isr.edem
46 set_gr_limmed 0x8000,0x0000,gr1
48 test_gr_limmed 0x8000,0x0000,gr2
49 test_spr_immed 1,gner0
50 test_spr_immed 4,gner1
52 nsdiv gr1,gr0,gr10 ; divide by zero
53 test_spr_immed 1,gner0
54 test_spr_immed 0x00000404,gner1
56 ; simple division 12 / 3 -- should turn off ne flag
61 test_spr_immed 1,gner0
62 test_spr_immed 0x00000400,gner1