xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/sh/pshar.s (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1*4b169a6bSchristos# sh testcase for psha <reg>
2*4b169a6bSchristos# mach: shdsp
3*4b169a6bSchristos# as(shdsp):	-defsym sim_cpu=1 -dsp
4*4b169a6bSchristos
5*4b169a6bSchristos	.include "testutils.inc"
6*4b169a6bSchristos
7*4b169a6bSchristos	start
8*4b169a6bSchristos
9*4b169a6bSchristospsha_reg:			! shift arithmetic, register operand
10*4b169a6bSchristos	set_grs_a5a5
11*4b169a6bSchristos	lds	r0, a0
12*4b169a6bSchristos	pcopy	a0, a1
13*4b169a6bSchristos	lds	r0, x0
14*4b169a6bSchristos	lds	r0, x1
15*4b169a6bSchristos	lds	r0, y0
16*4b169a6bSchristos	lds	r0, y1
17*4b169a6bSchristos	pcopy	x0, m0
18*4b169a6bSchristos	pcopy	y1, m1
19*4b169a6bSchristos
20*4b169a6bSchristos	set_sreg 0x1, x0
21*4b169a6bSchristos	set_sreg 0x0, y0
22*4b169a6bSchristos	psha	x0, y0, x0
23*4b169a6bSchristos	assert_sreg	0x1, x0
24*4b169a6bSchristos	pneg	y0, y0
25*4b169a6bSchristos	psha	x0, y0, x0
26*4b169a6bSchristos	assert_sreg	0x1, x0
27*4b169a6bSchristos
28*4b169a6bSchristos	set_sreg 0x10000, y0
29*4b169a6bSchristos	psha	x0, y0, x0
30*4b169a6bSchristos	assert_sreg	0x2, x0
31*4b169a6bSchristos	pneg	y0, y0
32*4b169a6bSchristos	psha	x0, y0, x0
33*4b169a6bSchristos	assert_sreg	0x1, x0
34*4b169a6bSchristos
35*4b169a6bSchristos	set_sreg 0x20000, y0
36*4b169a6bSchristos	psha	x0, y0, x0
37*4b169a6bSchristos	assert_sreg	0x4, x0
38*4b169a6bSchristos	pneg	y0, y0
39*4b169a6bSchristos	psha	x0, y0, x0
40*4b169a6bSchristos	assert_sreg	0x1, x0
41*4b169a6bSchristos
42*4b169a6bSchristos	set_sreg 0x30000, y0
43*4b169a6bSchristos	psha	x0, y0, x0
44*4b169a6bSchristos	assert_sreg	0x8, x0
45*4b169a6bSchristos	pneg	y0, y0
46*4b169a6bSchristos	psha	x0, y0, x0
47*4b169a6bSchristos	assert_sreg	0x1, x0
48*4b169a6bSchristos
49*4b169a6bSchristos	set_sreg 0x40000, y0
50*4b169a6bSchristos	psha	x0, y0, x0
51*4b169a6bSchristos	assert_sreg	0x10, x0
52*4b169a6bSchristos	pneg	y0, y0
53*4b169a6bSchristos	psha	x0, y0, x0
54*4b169a6bSchristos	assert_sreg	0x1, x0
55*4b169a6bSchristos
56*4b169a6bSchristos	set_sreg 0x50000, y0
57*4b169a6bSchristos	psha	x0, y0, x0
58*4b169a6bSchristos	assert_sreg	0x20, x0
59*4b169a6bSchristos	pneg	y0, y0
60*4b169a6bSchristos	psha	x0, y0, x0
61*4b169a6bSchristos	assert_sreg	0x1, x0
62*4b169a6bSchristos
63*4b169a6bSchristos	set_sreg 0x60000, y0
64*4b169a6bSchristos	psha	x0, y0, x0
65*4b169a6bSchristos	assert_sreg	0x40, x0
66*4b169a6bSchristos	pneg	y0, y0
67*4b169a6bSchristos	psha	x0, y0, x0
68*4b169a6bSchristos	assert_sreg	0x1, x0
69*4b169a6bSchristos
70*4b169a6bSchristos	set_sreg 0x70000, y0
71*4b169a6bSchristos	psha	x0, y0, x0
72*4b169a6bSchristos	assert_sreg	0x80, x0
73*4b169a6bSchristos	pneg	y0, y0
74*4b169a6bSchristos	psha	x0, y0, x0
75*4b169a6bSchristos	assert_sreg	0x1, x0
76*4b169a6bSchristos
77*4b169a6bSchristos	set_sreg 0x80000, y0
78*4b169a6bSchristos	psha	x0, y0, x0
79*4b169a6bSchristos	assert_sreg	0x100, x0
80*4b169a6bSchristos	pneg	y0, y0
81*4b169a6bSchristos	psha	x0, y0, x0
82*4b169a6bSchristos	assert_sreg	0x1, x0
83*4b169a6bSchristos
84*4b169a6bSchristos	set_sreg 0x90000, y0
85*4b169a6bSchristos	psha	x0, y0, x0
86*4b169a6bSchristos	assert_sreg	0x200, x0
87*4b169a6bSchristos	pneg	y0, y0
88*4b169a6bSchristos	psha	x0, y0, x0
89*4b169a6bSchristos	assert_sreg	0x1, x0
90*4b169a6bSchristos
91*4b169a6bSchristos	set_sreg 0xa0000, y0
92*4b169a6bSchristos	psha	x0, y0, x0
93*4b169a6bSchristos	assert_sreg	0x400, x0
94*4b169a6bSchristos	pneg	y0, y0
95*4b169a6bSchristos	psha	x0, y0, x0
96*4b169a6bSchristos	assert_sreg	0x1, x0
97*4b169a6bSchristos
98*4b169a6bSchristos	set_sreg 0xb0000, y0
99*4b169a6bSchristos	psha	x0, y0, x0
100*4b169a6bSchristos	assert_sreg	0x800, x0
101*4b169a6bSchristos	pneg	y0, y0
102*4b169a6bSchristos	psha	x0, y0, x0
103*4b169a6bSchristos	assert_sreg	0x1, x0
104*4b169a6bSchristos
105*4b169a6bSchristos	set_sreg 0xc0000, y0
106*4b169a6bSchristos	psha	x0, y0, x0
107*4b169a6bSchristos	assert_sreg	0x1000, x0
108*4b169a6bSchristos	pneg	y0, y0
109*4b169a6bSchristos	psha	x0, y0, x0
110*4b169a6bSchristos	assert_sreg	0x1, x0
111*4b169a6bSchristos
112*4b169a6bSchristos	set_sreg 0xd0000, y0
113*4b169a6bSchristos	psha	x0, y0, x0
114*4b169a6bSchristos	assert_sreg	0x2000, x0
115*4b169a6bSchristos	pneg	y0, y0
116*4b169a6bSchristos	psha	x0, y0, x0
117*4b169a6bSchristos	assert_sreg	0x1, x0
118*4b169a6bSchristos
119*4b169a6bSchristos	set_sreg 0xe0000, y0
120*4b169a6bSchristos	psha	x0, y0, x0
121*4b169a6bSchristos	assert_sreg	0x4000, x0
122*4b169a6bSchristos	pneg	y0, y0
123*4b169a6bSchristos	psha	x0, y0, x0
124*4b169a6bSchristos	assert_sreg	0x1, x0
125*4b169a6bSchristos
126*4b169a6bSchristos	set_sreg 0xf0000, y0
127*4b169a6bSchristos	psha	x0, y0, x0
128*4b169a6bSchristos	assert_sreg	0x8000, x0
129*4b169a6bSchristos	pneg	y0, y0
130*4b169a6bSchristos	psha	x0, y0, x0
131*4b169a6bSchristos	assert_sreg	0x1, x0
132*4b169a6bSchristos
133*4b169a6bSchristos	set_sreg 0x100000, y0
134*4b169a6bSchristos	psha	x0, y0, x0
135*4b169a6bSchristos	assert_sreg	0x10000, x0
136*4b169a6bSchristos	pneg	y0, y0
137*4b169a6bSchristos	psha	x0, y0, x0
138*4b169a6bSchristos	assert_sreg	0x1, x0
139*4b169a6bSchristos
140*4b169a6bSchristos	set_sreg 0x110000, y0
141*4b169a6bSchristos	psha	x0, y0, x0
142*4b169a6bSchristos	assert_sreg	0x20000, x0
143*4b169a6bSchristos	pneg	y0, y0
144*4b169a6bSchristos	psha	x0, y0, x0
145*4b169a6bSchristos	assert_sreg	0x1, x0
146*4b169a6bSchristos
147*4b169a6bSchristos	set_sreg 0x120000, y0
148*4b169a6bSchristos	psha	x0, y0, x0
149*4b169a6bSchristos	assert_sreg	0x40000, x0
150*4b169a6bSchristos	pneg	y0, y0
151*4b169a6bSchristos	psha	x0, y0, x0
152*4b169a6bSchristos	assert_sreg	0x1, x0
153*4b169a6bSchristos
154*4b169a6bSchristos	set_sreg 0x130000, y0
155*4b169a6bSchristos	psha	x0, y0, x0
156*4b169a6bSchristos	assert_sreg	0x80000, x0
157*4b169a6bSchristos	pneg	y0, y0
158*4b169a6bSchristos	psha	x0, y0, x0
159*4b169a6bSchristos	assert_sreg	0x1, x0
160*4b169a6bSchristos
161*4b169a6bSchristos	set_sreg 0x140000, y0
162*4b169a6bSchristos	psha	x0, y0, x0
163*4b169a6bSchristos	assert_sreg	0x100000, x0
164*4b169a6bSchristos	pneg	y0, y0
165*4b169a6bSchristos	psha	x0, y0, x0
166*4b169a6bSchristos	assert_sreg	0x1, x0
167*4b169a6bSchristos
168*4b169a6bSchristos	set_sreg 0x150000, y0
169*4b169a6bSchristos	psha	x0, y0, x0
170*4b169a6bSchristos	assert_sreg	0x200000, x0
171*4b169a6bSchristos	pneg	y0, y0
172*4b169a6bSchristos	psha	x0, y0, x0
173*4b169a6bSchristos	assert_sreg	0x1, x0
174*4b169a6bSchristos
175*4b169a6bSchristos	set_sreg 0x160000, y0
176*4b169a6bSchristos	psha	x0, y0, x0
177*4b169a6bSchristos	assert_sreg	0x400000, x0
178*4b169a6bSchristos	pneg	y0, y0
179*4b169a6bSchristos	psha	x0, y0, x0
180*4b169a6bSchristos	assert_sreg	0x1, x0
181*4b169a6bSchristos
182*4b169a6bSchristos	set_sreg 0x170000, y0
183*4b169a6bSchristos	psha	x0, y0, x0
184*4b169a6bSchristos	assert_sreg	0x800000, x0
185*4b169a6bSchristos	pneg	y0, y0
186*4b169a6bSchristos	psha	x0, y0, x0
187*4b169a6bSchristos	assert_sreg	0x1, x0
188*4b169a6bSchristos
189*4b169a6bSchristos	set_sreg 0x180000, y0
190*4b169a6bSchristos	psha	x0, y0, x0
191*4b169a6bSchristos	assert_sreg	0x1000000, x0
192*4b169a6bSchristos	pneg	y0, y0
193*4b169a6bSchristos	psha	x0, y0, x0
194*4b169a6bSchristos	assert_sreg	0x1, x0
195*4b169a6bSchristos
196*4b169a6bSchristos	set_sreg 0x190000, y0
197*4b169a6bSchristos	psha	x0, y0, x0
198*4b169a6bSchristos	assert_sreg	0x2000000, x0
199*4b169a6bSchristos	pneg	y0, y0
200*4b169a6bSchristos	psha	x0, y0, x0
201*4b169a6bSchristos	assert_sreg	0x1, x0
202*4b169a6bSchristos
203*4b169a6bSchristos	set_sreg 0x1a0000, y0
204*4b169a6bSchristos	psha	x0, y0, x0
205*4b169a6bSchristos	assert_sreg	0x4000000, x0
206*4b169a6bSchristos	pneg	y0, y0
207*4b169a6bSchristos	psha	x0, y0, x0
208*4b169a6bSchristos	assert_sreg	0x1, x0
209*4b169a6bSchristos
210*4b169a6bSchristos	set_sreg 0x1b0000, y0
211*4b169a6bSchristos	psha	x0, y0, x0
212*4b169a6bSchristos	assert_sreg	0x8000000, x0
213*4b169a6bSchristos	pneg	y0, y0
214*4b169a6bSchristos	psha	x0, y0, x0
215*4b169a6bSchristos	assert_sreg	0x1, x0
216*4b169a6bSchristos
217*4b169a6bSchristos	set_sreg 0x1c0000, y0
218*4b169a6bSchristos	psha	x0, y0, x0
219*4b169a6bSchristos	assert_sreg	0x10000000, x0
220*4b169a6bSchristos	pneg	y0, y0
221*4b169a6bSchristos	psha	x0, y0, x0
222*4b169a6bSchristos	assert_sreg	0x1, x0
223*4b169a6bSchristos
224*4b169a6bSchristos	set_sreg 0x1d0000, y0
225*4b169a6bSchristos	psha	x0, y0, x0
226*4b169a6bSchristos	assert_sreg	0x20000000, x0
227*4b169a6bSchristos	pneg	y0, y0
228*4b169a6bSchristos	psha	x0, y0, x0
229*4b169a6bSchristos	assert_sreg	0x1, x0
230*4b169a6bSchristos
231*4b169a6bSchristos	set_sreg 0x1e0000, y0
232*4b169a6bSchristos	psha	x0, y0, x0
233*4b169a6bSchristos	assert_sreg	0x40000000, x0
234*4b169a6bSchristos	pneg	y0, y0
235*4b169a6bSchristos	psha	x0, y0, x0
236*4b169a6bSchristos	assert_sreg	0x1, x0
237*4b169a6bSchristos
238*4b169a6bSchristos	set_sreg 0x1f0000, y0
239*4b169a6bSchristos	psha	x0, y0, x0
240*4b169a6bSchristos	assert_sreg	0x80000000, x0
241*4b169a6bSchristos	pneg	y0, y0
242*4b169a6bSchristos	psha	x0, y0, x0
243*4b169a6bSchristos	assert_sreg	0xffffffff, x0
244*4b169a6bSchristos
245*4b169a6bSchristos	set_sreg 0x200000, y0
246*4b169a6bSchristos	psha	x0, y0, x0
247*4b169a6bSchristos	assert_sreg	0x00000000, x0
248*4b169a6bSchristos#	I don't grok what should happen here...
249*4b169a6bSchristos#	pneg	y0, y0
250*4b169a6bSchristos#	psha	x0, y0, x0
251*4b169a6bSchristos#	assert_sreg	0x0, x0
252*4b169a6bSchristos
253*4b169a6bSchristos	test_grs_a5a5
254*4b169a6bSchristos	assert_sreg	0xa5a5a5a5, a0
255*4b169a6bSchristos	assert_sreg2	0xa5a5a5a5, a1
256*4b169a6bSchristos	assert_sreg	0xa5a5a5a5, x1
257*4b169a6bSchristos	assert_sreg	0xa5a5a5a5, y1
258*4b169a6bSchristos	assert_sreg2	0xa5a5a5a5, m0
259*4b169a6bSchristos	assert_sreg2	0xa5a5a5a5, m1
260*4b169a6bSchristos
261*4b169a6bSchristos
262*4b169a6bSchristos	pass
263*4b169a6bSchristos	exit 0
264*4b169a6bSchristos
265