1*07163879Schristos/* Tests instructions l.xor, l.xori.
2*07163879Schristos
3*07163879Schristos   Copyright (C) 2017-2019 Free Software Foundation, Inc.
4*07163879Schristos
5*07163879Schristos   This program is free software; you can redistribute it and/or modify
6*07163879Schristos   it under the terms of the GNU General Public License as published by
7*07163879Schristos   the Free Software Foundation; either version 3 of the License, or
8*07163879Schristos   (at your option) any later version.
9*07163879Schristos
10*07163879Schristos   This program is distributed in the hope that it will be useful,
11*07163879Schristos   but WITHOUT ANY WARRANTY; without even the implied warranty of
12*07163879Schristos   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*07163879Schristos   GNU General Public License for more details.
14*07163879Schristos
15*07163879Schristos   You should have received a copy of the GNU General Public License
16*07163879Schristos   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17*07163879Schristos
18*07163879Schristos# mach: or1k
19*07163879Schristos# output: report(0x00000000);\n
20*07163879Schristos# output: report(0x00000000);\n
21*07163879Schristos# output: report(0x00000000);\n
22*07163879Schristos# output: report(0x00000000);\n
23*07163879Schristos# output: report(0x00000000);\n
24*07163879Schristos# output: report(0x00000000);\n
25*07163879Schristos# output: \n
26*07163879Schristos# output: report(0xffffffff);\n
27*07163879Schristos# output: report(0xffffffff);\n
28*07163879Schristos# output: report(0x00000000);\n
29*07163879Schristos# output: report(0x00000000);\n
30*07163879Schristos# output: report(0x00000000);\n
31*07163879Schristos# output: report(0x00000000);\n
32*07163879Schristos# output: \n
33*07163879Schristos# output: report(0xaaaaaaaa);\n
34*07163879Schristos# output: report(0x00000000);\n
35*07163879Schristos# output: report(0xaaaaaaaa);\n
36*07163879Schristos# output: report(0x00000000);\n
37*07163879Schristos# output: report(0x00000000);\n
38*07163879Schristos# output: report(0x00000000);\n
39*07163879Schristos# output: \n
40*07163879Schristos# output: report(0xaaaaaaaa);\n
41*07163879Schristos# output: report(0xaaaaaaaa);\n
42*07163879Schristos# output: report(0x00000000);\n
43*07163879Schristos# output: report(0x00000000);\n
44*07163879Schristos# output: report(0x00000000);\n
45*07163879Schristos# output: report(0x00000000);\n
46*07163879Schristos# output: \n
47*07163879Schristos# output: report(0x55555555);\n
48*07163879Schristos# output: report(0x00000000);\n
49*07163879Schristos# output: report(0x55555555);\n
50*07163879Schristos# output: report(0x00000000);\n
51*07163879Schristos# output: report(0x00000000);\n
52*07163879Schristos# output: report(0x00000000);\n
53*07163879Schristos# output: \n
54*07163879Schristos# output: report(0x55555555);\n
55*07163879Schristos# output: report(0x55555555);\n
56*07163879Schristos# output: report(0x00000000);\n
57*07163879Schristos# output: report(0x00000000);\n
58*07163879Schristos# output: report(0x00000000);\n
59*07163879Schristos# output: report(0x00000000);\n
60*07163879Schristos# output: \n
61*07163879Schristos# output: report(0xaaaaaaaa);\n
62*07163879Schristos# output: report(0x55555555);\n
63*07163879Schristos# output: report(0xffffffff);\n
64*07163879Schristos# output: report(0x00000000);\n
65*07163879Schristos# output: report(0x00000000);\n
66*07163879Schristos# output: report(0x00000000);\n
67*07163879Schristos# output: \n
68*07163879Schristos# output: report(0x4c70f07c);\n
69*07163879Schristos# output: report(0xb38f0f83);\n
70*07163879Schristos# output: report(0xffffffff);\n
71*07163879Schristos# output: report(0x00000000);\n
72*07163879Schristos# output: report(0x00000000);\n
73*07163879Schristos# output: report(0x00000000);\n
74*07163879Schristos# output: \n
75*07163879Schristos# output: report(0x4c70f07c);\n
76*07163879Schristos# output: report(0xc4c70f07);\n
77*07163879Schristos# output: report(0x88b7ff7b);\n
78*07163879Schristos# output: report(0x00000000);\n
79*07163879Schristos# output: report(0x00000000);\n
80*07163879Schristos# output: report(0x00000000);\n
81*07163879Schristos# output: \n
82*07163879Schristos# output: report(0xb38f0f83);\n
83*07163879Schristos# output: report(0x38f0f83b);\n
84*07163879Schristos# output: report(0x8b7ff7b8);\n
85*07163879Schristos# output: report(0x00000000);\n
86*07163879Schristos# output: report(0x00000000);\n
87*07163879Schristos# output: report(0x00000000);\n
88*07163879Schristos# output: \n
89*07163879Schristos# output: report(0x00000000);\n
90*07163879Schristos# output: report(0x00000000);\n
91*07163879Schristos# output: report(0x00000000);\n
92*07163879Schristos# output: report(0x00000000);\n
93*07163879Schristos# output: report(0x00000000);\n
94*07163879Schristos# output: report(0x00000000);\n
95*07163879Schristos# output: \n
96*07163879Schristos# output: report(0xffffffff);\n
97*07163879Schristos# output: report(0x0000ffff);\n
98*07163879Schristos# output: report(0x00000000);\n
99*07163879Schristos# output: report(0x00000000);\n
100*07163879Schristos# output: report(0x00000000);\n
101*07163879Schristos# output: report(0x00000000);\n
102*07163879Schristos# output: \n
103*07163879Schristos# output: report(0xaaaaaaaa);\n
104*07163879Schristos# output: report(0x00000000);\n
105*07163879Schristos# output: report(0xaaaaaaaa);\n
106*07163879Schristos# output: report(0x00000000);\n
107*07163879Schristos# output: report(0x00000000);\n
108*07163879Schristos# output: report(0x00000000);\n
109*07163879Schristos# output: \n
110*07163879Schristos# output: report(0xaaaaaaaa);\n
111*07163879Schristos# output: report(0x0000aaaa);\n
112*07163879Schristos# output: report(0x55550000);\n
113*07163879Schristos# output: report(0x00000000);\n
114*07163879Schristos# output: report(0x00000000);\n
115*07163879Schristos# output: report(0x00000000);\n
116*07163879Schristos# output: \n
117*07163879Schristos# output: report(0x55555555);\n
118*07163879Schristos# output: report(0x00000000);\n
119*07163879Schristos# output: report(0x55555555);\n
120*07163879Schristos# output: report(0x00000000);\n
121*07163879Schristos# output: report(0x00000000);\n
122*07163879Schristos# output: report(0x00000000);\n
123*07163879Schristos# output: \n
124*07163879Schristos# output: report(0x55555555);\n
125*07163879Schristos# output: report(0x00005555);\n
126*07163879Schristos# output: report(0x55550000);\n
127*07163879Schristos# output: report(0x00000000);\n
128*07163879Schristos# output: report(0x00000000);\n
129*07163879Schristos# output: report(0x00000000);\n
130*07163879Schristos# output: \n
131*07163879Schristos# output: report(0xaaaaaaaa);\n
132*07163879Schristos# output: report(0x00005555);\n
133*07163879Schristos# output: report(0xaaaaffff);\n
134*07163879Schristos# output: report(0x00000000);\n
135*07163879Schristos# output: report(0x00000000);\n
136*07163879Schristos# output: report(0x00000000);\n
137*07163879Schristos# output: \n
138*07163879Schristos# output: report(0x4c70f07c);\n
139*07163879Schristos# output: report(0x00000f83);\n
140*07163879Schristos# output: report(0x4c70ffff);\n
141*07163879Schristos# output: report(0x00000000);\n
142*07163879Schristos# output: report(0x00000000);\n
143*07163879Schristos# output: report(0x00000000);\n
144*07163879Schristos# output: \n
145*07163879Schristos# output: report(0x4c70f07c);\n
146*07163879Schristos# output: report(0x00000f07);\n
147*07163879Schristos# output: report(0x4c70ff7b);\n
148*07163879Schristos# output: report(0x00000000);\n
149*07163879Schristos# output: report(0x00000000);\n
150*07163879Schristos# output: report(0x00000000);\n
151*07163879Schristos# output: \n
152*07163879Schristos# output: report(0xb38f0f83);\n
153*07163879Schristos# output: report(0x0000f83b);\n
154*07163879Schristos# output: report(0x4c70f7b8);\n
155*07163879Schristos# output: report(0x00000000);\n
156*07163879Schristos# output: report(0x00000000);\n
157*07163879Schristos# output: report(0x00000000);\n
158*07163879Schristos# output: \n
159*07163879Schristos# output: exit(0)\n
160*07163879Schristos
161*07163879Schristos#include "or1k-asm-test-helpers.h"
162*07163879Schristos
163*07163879Schristos	STANDARD_TEST_ENVIRONMENT
164*07163879Schristos
165*07163879Schristos	.section .text
166*07163879Schristosstart_tests:
167*07163879Schristos	PUSH LINK_REGISTER_R9
168*07163879Schristos
169*07163879Schristos	/* Always set OVE.  We should never trigger an exception, even if
170*07163879Schristos	   this bit is set.  */
171*07163879Schristos	SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
172*07163879Schristos
173*07163879Schristos	/* Test the l.xor instruction with a range of operands.  */
174*07163879Schristos
175*07163879Schristos	TEST_INST_I32_I32 l.xor, 0x00000000, 0x00000000
176*07163879Schristos	TEST_INST_I32_I32 l.xor, 0xffffffff, 0xffffffff
177*07163879Schristos	TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0x00000000
178*07163879Schristos	TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0xaaaaaaaa
179*07163879Schristos	TEST_INST_I32_I32 l.xor, 0x55555555, 0x00000000
180*07163879Schristos	TEST_INST_I32_I32 l.xor, 0x55555555, 0x55555555
181*07163879Schristos	TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0x55555555
182*07163879Schristos	TEST_INST_I32_I32 l.xor, 0x4c70f07c, 0xb38f0f83
183*07163879Schristos	TEST_INST_I32_I32 l.xor, 0x4c70f07c, 0xc4c70f07
184*07163879Schristos	TEST_INST_I32_I32 l.xor, 0xb38f0f83, 0x38f0f83b
185*07163879Schristos
186*07163879Schristos	/* Test the l.xori instruction with a range of operands.  */
187*07163879Schristos
188*07163879Schristos	TEST_INST_I32_I16 l.xori, 0x00000000, 0x0000
189*07163879Schristos	TEST_INST_I32_I16 l.xori, 0xffffffff, 0xffff
190*07163879Schristos	TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0x0000
191*07163879Schristos	TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0xaaaa
192*07163879Schristos	TEST_INST_I32_I16 l.xori, 0x55555555, 0x0000
193*07163879Schristos	TEST_INST_I32_I16 l.xori, 0x55555555, 0x5555
194*07163879Schristos	TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0x5555
195*07163879Schristos	TEST_INST_I32_I16 l.xori, 0x4c70f07c, 0x0f83
196*07163879Schristos	TEST_INST_I32_I16 l.xori, 0x4c70f07c, 0x0f07
197*07163879Schristos	TEST_INST_I32_I16 l.xori, 0xb38f0f83, 0xf83b
198*07163879Schristos
199*07163879Schristos	POP LINK_REGISTER_R9
200*07163879Schristos	RETURN_TO_LINK_REGISTER_R9
201