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

Subversion Repositories openrisc

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

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

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

powered by: WebSVN 2.1.0

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