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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [frv/] [nsdivi.cgs] - Blame information for rev 157

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# frv testcase for nsdivi $GRi,$s12,$GRk
2
# mach: fr500 fr550 frv
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global nsdivi
9
nsdivi:
10
        set_spr_immed   0,gner0
11
        set_spr_immed   0,gner1
12
 
13
        ; simple division 12 / 3
14
        set_gr_immed    12,gr1
15
        nsdivi          gr1,3,gr2
16
        test_gr_immed   4,gr2
17
        test_spr_immed  0,gner0
18
        test_spr_immed  0,gner1
19
 
20
        ; Random example
21
        set_gr_limmed   0xfedc,0xba98,gr1
22
        nsdivi          gr1,0x7ff,gr2
23
        test_gr_limmed  0xffff,0xdb93,gr2
24
        test_spr_immed  0,gner0
25
        test_spr_immed  0,gner1
26
 
27
        ; Random negative example
28
        set_gr_limmed   0xfedc,0xba98,gr1
29
        nsdivi          gr1,-2048,gr2
30
        test_gr_immed   0x2468,gr2
31
        test_spr_immed  0,gner0
32
        test_spr_immed  0,gner1
33
 
34
        or_spr_immed    0x20,isr        ; turn on isr.edem
35
        set_gr_limmed   0x8000,0x0000,gr1
36
        nsdivi          gr1,-1,gr2
37
        test_gr_limmed  0x7fff,0xffff,gr2
38
        test_spr_immed  0,gner0
39
        test_spr_immed  0,gner1
40
 
41
        nsdivi          gr1,0,gr32      ; divide by zero
42
        test_spr_immed  1,gner0
43
        test_spr_immed  0,gner1
44
 
45
        ; Special case from the Arch Spec Vol 2
46
        and_spr_immed   -33,isr         ; turn off isr.edem
47
        set_gr_limmed   0x8000,0x0000,gr1
48
        nsdivi          gr1,-1,gr2
49
        test_gr_limmed  0x8000,0x0000,gr2
50
        test_spr_immed  1,gner0
51
        test_spr_immed  4,gner1
52
 
53
        nsdivi          gr1,0,gr10      ; divide by zero
54
        test_spr_immed  1,gner0
55
        test_spr_immed  0x00000404,gner1
56
 
57
        ; simple division 12 / 3 -- should turn off ne flag
58
        set_gr_immed    12,gr1
59
        nsdivi          gr1,3,gr2
60
        test_gr_immed   4,gr2
61
        test_spr_immed  1,gner0
62
        test_spr_immed  0x00000400,gner1
63
 
64
        pass

powered by: WebSVN 2.1.0

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