PR sim/12737
[external/binutils.git] / sim / testsuite / sim / arm / iwmmxt / wcmpgt.cgs
1 # Intel(r) Wireless MMX(tm) technology testcase for WCMPGT
2 # mach: xscale
3 # as: -mcpu=xscale+iwmmxt
4 # kfail: sim/12737 *-*-*
5
6         .include "testutils.inc"
7
8         start
9
10         .global wcmpgt
11 wcmpgt:
12         # Enable access to CoProcessors 0 & 1 before
13         # we attempt these instructions.
14
15         mvi_h_gr   r1, 3
16         mcr        p15, 0, r1, cr15, cr1, 0
17
18         # Test Unsigned Byte Wide Compare Greater Than
19         
20         mvi_h_gr   r0, 0x12345678
21         mvi_h_gr   r1, 0x9abcde00
22         mvi_h_gr   r2, 0x11111111
23         mvi_h_gr   r3, 0x22222222
24         mvi_h_gr   r4, 0
25         mvi_h_gr   r5, 0
26
27         tmcrr      wr0, r0, r1
28         tmcrr      wr1, r2, r3
29         tmcrr      wr2, r4, r5
30
31         wcmpgtub   wr2, wr0, wr1
32         
33         tmrrc      r0, r1, wr0
34         tmrrc      r2, r3, wr1
35         tmrrc      r4, r5, wr2
36         
37         test_h_gr  r0, 0x12345678
38         test_h_gr  r1, 0x9abcde00
39         test_h_gr  r2, 0x11111111
40         test_h_gr  r3, 0x22222222
41         test_h_gr  r4, 0xffffffff
42         test_h_gr  r5, 0xffffff00
43         
44         # Test Signed Byte Wide Compare Greater Than
45         
46         mvi_h_gr   r0, 0x12345678
47         mvi_h_gr   r1, 0x9abcde00
48         mvi_h_gr   r2, 0x11111111
49         mvi_h_gr   r3, 0x22222222
50         mvi_h_gr   r4, 0
51         mvi_h_gr   r5, 0
52
53         tmcrr      wr0, r0, r1
54         tmcrr      wr1, r2, r3
55         tmcrr      wr2, r4, r5
56
57         wcmpgtsb   wr2, wr0, wr1
58         
59         tmrrc      r0, r1, wr0
60         tmrrc      r2, r3, wr1
61         tmrrc      r4, r5, wr2
62         
63         test_h_gr  r0, 0x12345678
64         test_h_gr  r1, 0x9abcde00
65         test_h_gr  r2, 0x11111111
66         test_h_gr  r3, 0x22222222
67         test_h_gr  r4, 0xffffffff
68         test_h_gr  r5, 0x00000000
69         
70         # Test Unsigned Half Word Wide Compare Greater Than
71         
72         mvi_h_gr   r0, 0x12345678
73         mvi_h_gr   r1, 0x9abcde00
74         mvi_h_gr   r2, 0x11111111
75         mvi_h_gr   r3, 0x22222222
76         mvi_h_gr   r4, 0
77         mvi_h_gr   r5, 0
78
79         tmcrr      wr0, r0, r1
80         tmcrr      wr1, r2, r3
81         tmcrr      wr2, r4, r5
82
83         wcmpgtuh   wr2, wr0, wr1
84         
85         tmrrc      r0, r1, wr0
86         tmrrc      r2, r3, wr1
87         tmrrc      r4, r5, wr2
88         
89         test_h_gr  r0, 0x12345678
90         test_h_gr  r1, 0x9abcde00
91         test_h_gr  r2, 0x11111111
92         test_h_gr  r3, 0x22222222
93         test_h_gr  r4, 0xffffffff
94         test_h_gr  r5, 0xffffffff
95         
96         # Test Signed Half Word Wide Compare Greater Than
97         
98         mvi_h_gr   r0, 0x12345678
99         mvi_h_gr   r1, 0x9abcde00
100         mvi_h_gr   r2, 0x11111111
101         mvi_h_gr   r3, 0x22222222
102         mvi_h_gr   r4, 0
103         mvi_h_gr   r5, 0
104
105         tmcrr      wr0, r0, r1
106         tmcrr      wr1, r2, r3
107         tmcrr      wr2, r4, r5
108
109         wcmpgtsh   wr2, wr0, wr1
110         
111         tmrrc      r0, r1, wr0
112         tmrrc      r2, r3, wr1
113         tmrrc      r4, r5, wr2
114         
115         test_h_gr  r0, 0x12345678
116         test_h_gr  r1, 0x9abcde00
117         test_h_gr  r2, 0x11111111
118         test_h_gr  r3, 0x22222222
119         test_h_gr  r4, 0xffffffff
120         test_h_gr  r5, 0x00000000
121         
122         # Test Unsigned Word Wide Compare Greater Than
123         
124         mvi_h_gr   r0, 0x12345678
125         mvi_h_gr   r1, 0x9abcde00
126         mvi_h_gr   r2, 0x11111111
127         mvi_h_gr   r3, 0x22222222
128         mvi_h_gr   r4, 0
129         mvi_h_gr   r5, 0
130
131         tmcrr      wr0, r0, r1
132         tmcrr      wr1, r2, r3
133         tmcrr      wr2, r4, r5
134
135         wcmpgtuw   wr2, wr0, wr1
136         
137         tmrrc      r0, r1, wr0
138         tmrrc      r2, r3, wr1
139         tmrrc      r4, r5, wr2
140         
141         test_h_gr  r0, 0x12345678
142         test_h_gr  r1, 0x9abcde00
143         test_h_gr  r2, 0x11111111
144         test_h_gr  r3, 0x22222222
145         test_h_gr  r4, 0xffffffff
146         test_h_gr  r5, 0xffffffff
147         
148         # Test Signed Word Wide Compare Greater Than
149         
150         mvi_h_gr   r0, 0x12345678
151         mvi_h_gr   r1, 0x9abcde00
152         mvi_h_gr   r2, 0x11111111
153         mvi_h_gr   r3, 0x22222222
154         mvi_h_gr   r4, 0
155         mvi_h_gr   r5, 0
156
157         tmcrr      wr0, r0, r1
158         tmcrr      wr1, r2, r3
159         tmcrr      wr2, r4, r5
160
161         wcmpgtsw   wr2, wr0, wr1
162         
163         tmrrc      r0, r1, wr0
164         tmrrc      r2, r3, wr1
165         tmrrc      r4, r5, wr2
166         
167         test_h_gr  r0, 0x12345678
168         test_h_gr  r1, 0x9abcde00
169         test_h_gr  r2, 0x11111111
170         test_h_gr  r3, 0x22222222
171         test_h_gr  r4, 0xffffffff
172         test_h_gr  r5, 0x00000000
173         
174         pass