OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [frv/] [nudiv.cgs] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# frv testcase for nudiv $GRi,$GRj,$GRk
2
# mach: fr500 fr550 frv
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global nudiv
9
nudiv:
10
        set_spr_immed   0,gner0
11
        set_spr_immed   0,gner1
12
 
13
        ; simple division 12 / 3
14
        set_gr_immed    0x00000003,gr2
15
        set_gr_immed    0x0000000c,gr3
16
        nudiv           gr3,gr2,gr3
17
        test_gr_immed   0x00000003,gr2
18
        test_gr_immed   0x00000004,gr3
19
        test_spr_immed  0,gner0
20
        test_spr_immed  0,gner1
21
 
22
        ; example 1 from the fr30 manual
23
        set_gr_limmed   0x0123,0x4567,gr2
24
        set_gr_limmed   0xfedc,0xba98,gr3
25
        nudiv           gr3,gr2,gr3
26
        test_gr_limmed  0x0123,0x4567,gr2
27
        test_gr_immed   0x000000e0,gr3
28
        test_spr_immed  0,gner0
29
        test_spr_immed  0,gner1
30
 
31
        or_spr_immed    0x20,isr        ; turn on isr.edem
32
        nudiv           gr1,gr0,gr32    ; divide by zero
33
        test_spr_immed  1,gner0
34
        test_spr_immed  0,gner1
35
 
36
        and_spr_immed   -33,isr         ; turn off isr.edem
37
        nudiv           gr1,gr0,gr10    ; divide by zero
38
        test_spr_immed  1,gner0
39
        test_spr_immed  0x00000400,gner1
40
 
41
        ; simple division 12 / 3 -- should turn off ne flag
42
        set_gr_immed    12,gr1
43
        set_gr_immed    3,gr3
44
        nudiv           gr1,gr3,gr10
45
        test_gr_immed   4,gr10
46
        test_spr_immed  1,gner0
47
        test_spr_immed  0,gner1
48
 
49
        pass

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.