4 .c "%s 0x%x = 0x%x (expected 0x%x)\n"
6 .c "%s 0x%x %d %d = 0x%x (expected 0x%x)\n"
8 .c "depi 0x%x 0x%x %d %d = 0x%x (expected 0x%x)\n"
11 .c "%s 0x%lx = 0x%lx (expected 0x%lx)\n"
13 .c "%s 0x%lx %ld %ld = 0x%lx (expected 0x%lx)\n"
15 .c "depi 0x%lx 0x%lx %ld %ld = 0x%lx (expected 0x%lx)\n"
18 .c "%s %.12f = %.12f (expected %.12f)\n"
59 #define CHECKI(OP, I0, I1) \
72 #define CHECKEXT(OP, I0, I1, I2, I3) \
87 #define CHECKDEP(I0, I1, I2, I3, I4) \
103 #define CHECKD(OP, I0, I1) \
105 beqi_d OP##_ok %f0 I1 \
116 #define CHECKF(OP, I0, I1) \
118 beqi_f OP##_ok %f0 I1 \
136 CHECKI(exti_c, 0xfff, -1)
137 CHECKI(exti_uc, 0xfff, 0xff)
138 CHECKI(exti_s, 0xfffff, -1)
139 CHECKI(exti_us, 0xfffff, 0xffff)
140 #if __BYTE_ORDER == __BIG_ENDIAN
141 CHECKI(htoni_us, 0xff1234, 0x1234)
142 CHECKI(ntohi_us, 0x7ffff, 0xffff)
144 CHECKI(htoni_us, 0xff1234, 0x3412)
145 CHECKI(ntohi_us, 0x7ffff, 0xffff)
147 #if __BYTE_ORDER == __BIG_ENDIAN
148 # if __WORDSIZE == 32
149 CHECKI(htoni_ui, 0x12345678, 0x12345678)
150 CHECKI(ntohi_ui, 0x78563412, 0x78563412)
152 CHECKI(htoni_ui, 0x7f12345678, 0x12345678)
153 CHECKI(ntohi_ui, 0xf778563412, 0x78563412)
156 # if __WORDSIZE == 32
157 CHECKI(htoni_ui, 0x12345678, 0x78563412)
158 CHECKI(ntohi_ui, 0x78563412, 0x12345678)
160 CHECKI(htoni_ui, 0x7f12345678, 0x78563412)
161 CHECKI(ntohi_ui, 0xf778563412, 0x12345678)
164 CHECKI(bswapi_us, 0x1234, 0x3412)
165 CHECKI(bswapi_ui, 0x12345678, 0x78563412)
167 # if __BYTE_ORDER == __BIG_ENDIAN
168 CHECKI(htoni, 0x78563412, 0x78563412)
169 CHECKI(ntohi, 0x12345678, 0x12345678)
171 CHECKI(htoni, 0x78563412, 0x12345678)
172 CHECKI(ntohi, 0x12345678, 0x78563412)
174 CHECKI(bswapi, 0x78563412, 0x12345678)
176 # if __BYTE_ORDER == __BIG_ENDIAN
177 CHECKI(htoni_ul, 0xf0debc9a78563412, 0xf0debc9a78563412)
178 CHECKI(ntohi_ul, 0x123456789abcdef0, 0x123456789abcdef0)
179 CHECKI(htoni, 0x123456789abcdef0, 0x123456789abcdef0)
180 CHECKI(ntohi, 0xf0debc9a78563412, 0xf0debc9a78563412)
182 CHECKI(htoni_ul, 0x123456789abcdef0, 0xf0debc9a78563412)
183 CHECKI(ntohi_ul, 0xf0debc9a78563412, 0x123456789abcdef0)
184 CHECKI(htoni, 0xf0debc9a78563412, 0x123456789abcdef0)
185 CHECKI(ntohi, 0x123456789abcdef0, 0xf0debc9a78563412)
187 CHECKI(exti_i, 0x80000000, 0xffffffff80000000)
188 CHECKI(exti_ui, 0x80000000, 0x80000000)
189 CHECKI(bswapi_ul, 0x123456789abcdef0, 0xf0debc9a78563412)
190 CHECKI(bswapi, 0xf0debc9a78563412, 0x123456789abcdef0)
193 CHECKI(cloi, 0xfffffffe, 31)
195 CHECKI(ctoi, 0x7fffffff, 31)
196 CHECKI(ctzi, 0x80000000, 31)
197 CHECKI(rbiti, 0x02468ace, 0x73516240)
198 CHECKI(popcnti, 0x8a13c851, 12)
200 CHECKI(cloi, 0xfffffffffffffffe, 63)
202 CHECKI(ctoi, 0x7fffffffffffffff, 63)
203 CHECKI(ctzi, 0x8000000000000000, 63)
204 CHECKI(rbiti, 0x02468ace013579bd, 0xbd9eac8073516240)
205 CHECKI(popcnti, 0x02468ace013579bd, 28)
208 # if __BYTE_ORDER == __LITTLE_ENDIAN
209 CHECKEXT(exti, 0xa5a5a584, 1, 2, 0xfffffffe)
210 CHECKEXT(exti_u, 0xa5a5a584, 1, 2, 0x00000002)
211 CHECKDEP(0xa5a5a584, 1, 1, 2, 0xa5a5a582)
213 CHECKEXT(exti, 0xa5a5a3b7, 29, 1, 0xffffffff)
214 CHECKEXT(exti_u, 0xa5a5a3b7, 29, 1, 0x00000001)
215 CHECKDEP(0xa5a5a3b7, 0, 29, 1, 0xa5a5a3b3)
218 # if __BYTE_ORDER == __LITTLE_ENDIAN
219 CHECKEXT(exti, 0xa5a5a5a5a5a5a564, 1, 2, 0xfffffffffffffffe)
220 CHECKEXT(exti_u, 0xa5a5a5a5a5a5a564, 1, 2, 0x0000000000000002)
221 CHECKDEP(0xa5a5a5a5a5a5a564, 1, 1, 2, 0xa5a5a5a5a5a5a562)
223 CHECKEXT(exti, 0xa5a5a5a5a5a59dc8, 60, 3, 0xfffffffffffffffc)
224 CHECKEXT(exti_u, 0xa5a5a5a5a5a59dc6, 61, 2, 0x0000000000000002)
225 CHECKDEP(0xa5a5a5a5a5a59dc6, 1, 61, 2, 0xa5a5a5a5a5a59dc2)
228 CHECKF(negi_f, 2.0, -2.0)
229 CHECKF(absi_f, -3.0, 3.0)
230 CHECKF(sqrti_f, 81.0, 9.0)
231 CHECKD(negi_d, -2.0, 2.0)
232 CHECKD(absi_d, -1.0, 1.0)
233 CHECKD(sqrti_d, 9.0, 3.0)