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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [frv/] [mcpxrs.cgs] - Blame information for rev 227

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
# frv testcase for mcpxrs $GRi,$GRj,$ACCk
2
# mach: all
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global mcpxrs
9
mcpxrs:
10
        ; Positive operands
11
        set_fr_iimmed   2,4,fr7         ; multiply small numbers
12
        set_fr_iimmed   3,5,fr8
13
        mcpxrs          fr7,fr8,acc0
14
        test_accg_immed         0xff,accg0
15
        test_acc_immed  -14,acc0
16
 
17
        set_fr_iimmed   3,1,fr7         ; multiply by 0
18
        set_fr_iimmed   2,0,fr8
19
        mcpxrs          fr7,fr8,acc0
20
        test_accg_immed         0,accg0
21
        test_acc_immed  6,acc0
22
 
23
        set_fr_iimmed   2,1,fr7         ; multiply by 1
24
        set_fr_iimmed   1,1,fr8
25
        mcpxrs          fr7,fr8,acc0
26
        test_accg_immed         0,accg0
27
        test_acc_immed  1,acc0
28
 
29
        set_fr_iimmed   0x3fff,2,fr7    ; 15 bit result
30
        set_fr_iimmed   2,0x0007,fr8
31
        mcpxrs          fr7,fr8,acc0
32
        test_accg_immed         0,accg0
33
        test_acc_limmed 0,0x7ff0,acc0
34
 
35
        set_fr_iimmed   0x4000,2,fr7    ; 16 bit result
36
        set_fr_iimmed   2,0x2000,fr8
37
        mcpxrs          fr7,fr8,acc0
38
        test_accg_immed         0,accg0
39
        test_acc_limmed 0x0000,0x4000,acc0
40
 
41
        set_fr_iimmed   0x7fff,0x0000,fr7       ; max positive result
42
        set_fr_iimmed   0x7fff,0x7fff,fr8
43
        mcpxrs          fr7,fr8,acc0
44
        test_accg_immed         0,accg0
45
        test_acc_limmed 0x3fff,0x0001,acc0
46
 
47
        ; Mixed operands
48
        set_fr_iimmed   2,0xfffd,fr7            ; multiply small numbers
49
        set_fr_iimmed   0xfffd,1,fr8
50
        mcpxrs          fr7,fr8,acc0
51
        test_accg_immed         0xff,accg0
52
        test_acc_immed  -3,acc0
53
 
54
        set_fr_iimmed   0xfffe,2,fr7            ; multiply by 1
55
        set_fr_iimmed   1,0xfffe,fr8
56
        mcpxrs          fr7,fr8,acc0
57
        test_accg_immed         0,accg0
58
        test_acc_immed  2,acc0
59
 
60
        set_fr_iimmed   0xfffe,0,fr7            ; multiply by 0
61
        set_fr_iimmed   1,0xfffe,fr8
62
        mcpxrs          fr7,fr8,acc0
63
        test_accg_immed         0xff,accg0
64
        test_acc_immed  -2,acc0
65
 
66
        set_fr_iimmed   0x2001,0xfffe,fr7       ; 15 bit result
67
        set_fr_iimmed   0xfffe,0xfff9,fr8
68
        mcpxrs          fr7,fr8,acc0
69
        test_accg_immed         0xff,accg0
70
        test_acc_limmed 0xffff,0xbff0,acc0
71
 
72
        set_fr_iimmed   0x4000,0xfffe,fr7       ; 16 bit result
73
        set_fr_iimmed   0xfffe,0x0003,fr8
74
        mcpxrs          fr7,fr8,acc0
75
        test_accg_immed         0xff,accg0
76
        test_acc_limmed 0xffff,0x8006,acc0
77
 
78
        set_fr_iimmed   0x7fff,0x8000,fr7       ; max negative result
79
        set_fr_iimmed   0x8000,0x8000,fr8
80
        mcpxrs          fr7,fr8,acc0
81
        test_accg_immed         0xff,accg0
82
        test_acc_limmed 0x8000,0x8000,acc0
83
 
84
        set_fr_iimmed   0x8000,0x7fff,fr7       ; max positive result
85
        set_fr_iimmed   0x8000,0x8000,fr8
86
        mcpxrs          fr7,fr8,acc0
87
        test_accg_immed         0,accg0
88
        test_acc_limmed 0x7fff,0x8000,acc0
89
 
90
        ; Negative operands
91
        set_fr_iimmed   0xfffe,0xfffc,fr7               ; multiply small numbers
92
        set_fr_iimmed   0xfffd,0xfffb,fr8
93
        mcpxrs          fr7,fr8,acc0
94
        test_accg_immed         0xff,accg0
95
        test_acc_immed  -14,acc0
96
 
97
        set_fr_iimmed   0xffff,0xffff,fr7               ; multiply by -1
98
        set_fr_iimmed   0xfffe,0xffff,fr8
99
        mcpxrs          fr7,fr8,acc0
100
        test_accg_immed         0,accg0
101
        test_acc_immed  1,acc0
102
 
103
        set_fr_iimmed   0x7fff,0x0000,fr7       ; almost max positive result
104
        set_fr_iimmed   0x7fff,0x8001,fr8
105
        mcpxrs          fr7,fr8,acc0
106
        test_accg_immed         0,accg0
107
        test_acc_immed  0x3fff0001,acc0
108
 
109
        set_fr_iimmed   0x8000,0x0000,fr7       ; max positive result
110
        set_fr_iimmed   0x8000,0x8000,fr8
111
        mcpxrs          fr7,fr8,acc0
112
        test_accg_immed         0,accg0
113
        test_acc_immed  0x40000000,acc0
114
 
115
        pass

powered by: WebSVN 2.1.0

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