1 /* Test MIPS32 DSP instructions */
2 /* { dg-do compile } */
3 /* { dg-mips-options "-march=mips32 -mdsp" } */
4 /* { dg-final { scan-assembler "addq.ph" } } */
5 /* { dg-final { scan-assembler "addq_s.ph" } } */
6 /* { dg-final { scan-assembler "addq_s.w" } } */
7 /* { dg-final { scan-assembler "addu.qb" } } */
8 /* { dg-final { scan-assembler "addu_s.qb" } } */
9 /* { dg-final { scan-assembler "subq.ph" } } */
10 /* { dg-final { scan-assembler "subq_s.ph" } } */
11 /* { dg-final { scan-assembler "subq_s.w" } } */
12 /* { dg-final { scan-assembler "subu.qb" } } */
13 /* { dg-final { scan-assembler "subu_s.qb" } } */
14 /* { dg-final { scan-assembler "addsc" } } */
15 /* { dg-final { scan-assembler "addwc" } } */
16 /* { dg-final { scan-assembler "modsub" } } */
17 /* { dg-final { scan-assembler "raddu.w.qb" } } */
18 /* { dg-final { scan-assembler "absq_s.ph" } } */
19 /* { dg-final { scan-assembler "absq_s.w" } } */
20 /* { dg-final { scan-assembler "precrq.qb.ph" } } */
21 /* { dg-final { scan-assembler "precrq.ph.w" } } */
22 /* { dg-final { scan-assembler "precrq_rs.ph.w" } } */
23 /* { dg-final { scan-assembler "precrqu_s.qb.ph" } } */
24 /* { dg-final { scan-assembler "preceq.w.phl" } } */
25 /* { dg-final { scan-assembler "preceq.w.phr" } } */
26 /* { dg-final { scan-assembler "precequ.ph.qbl" } } */
27 /* { dg-final { scan-assembler "precequ.ph.qbr" } } */
28 /* { dg-final { scan-assembler "precequ.ph.qbla" } } */
29 /* { dg-final { scan-assembler "precequ.ph.qbra" } } */
30 /* { dg-final { scan-assembler "preceu.ph.qbl" } } */
31 /* { dg-final { scan-assembler "preceu.ph.qbr" } } */
32 /* { dg-final { scan-assembler "preceu.ph.qbla" } } */
33 /* { dg-final { scan-assembler "preceu.ph.qbra" } } */
34 /* { dg-final { scan-assembler "shllv?.qb" } } */
35 /* { dg-final { scan-assembler "shllv?.ph" } } */
36 /* { dg-final { scan-assembler "shllv?_s.ph" } } */
37 /* { dg-final { scan-assembler "shllv?_s.w" } } */
38 /* { dg-final { scan-assembler "shrlv?.qb" } } */
39 /* { dg-final { scan-assembler "shrav?.ph" } } */
40 /* { dg-final { scan-assembler "shrav?_r.ph" } } */
41 /* { dg-final { scan-assembler "shrav?_r.w" } } */
42 /* { dg-final { scan-assembler "muleu_s.ph.qbl" } } */
43 /* { dg-final { scan-assembler "muleu_s.ph.qbr" } } */
44 /* { dg-final { scan-assembler "mulq_rs.ph" } } */
45 /* { dg-final { scan-assembler "muleq_s.w.phl" } } */
46 /* { dg-final { scan-assembler "muleq_s.w.phr" } } */
47 /* { dg-final { scan-assembler "dpau.h.qbl" } } */
48 /* { dg-final { scan-assembler "dpau.h.qbr" } } */
49 /* { dg-final { scan-assembler "dpsu.h.qbl" } } */
50 /* { dg-final { scan-assembler "dpsu.h.qbr" } } */
51 /* { dg-final { scan-assembler "dpaq_s.w.ph" } } */
52 /* { dg-final { scan-assembler "dpsq_s.w.ph" } } */
53 /* { dg-final { scan-assembler "mulsaq_s.w.ph" } } */
54 /* { dg-final { scan-assembler "dpaq_sa.l.w" } } */
55 /* { dg-final { scan-assembler "dpsq_sa.l.w" } } */
56 /* { dg-final { scan-assembler "maq_s.w.phl" } } */
57 /* { dg-final { scan-assembler "maq_s.w.phr" } } */
58 /* { dg-final { scan-assembler "maq_sa.w.phl" } } */
59 /* { dg-final { scan-assembler "maq_sa.w.phr" } } */
60 /* { dg-final { scan-assembler "bitrev" } } */
61 /* { dg-final { scan-assembler "insv" } } */
62 /* { dg-final { scan-assembler "replv?.qb" } } */
63 /* { dg-final { scan-assembler "repl.ph" } } */
64 /* { dg-final { scan-assembler "replv.ph" } } */
65 /* { dg-final { scan-assembler "cmpu.eq.qb" } } */
66 /* { dg-final { scan-assembler "cmpu.lt.qb" } } */
67 /* { dg-final { scan-assembler "cmpu.le.qb" } } */
68 /* { dg-final { scan-assembler "cmpgu.eq.qb" } } */
69 /* { dg-final { scan-assembler "cmpgu.lt.qb" } } */
70 /* { dg-final { scan-assembler "cmpgu.le.qb" } } */
71 /* { dg-final { scan-assembler "cmp.eq.ph" } } */
72 /* { dg-final { scan-assembler "cmp.lt.ph" } } */
73 /* { dg-final { scan-assembler "cmp.le.ph" } } */
74 /* { dg-final { scan-assembler "pick.qb" } } */
75 /* { dg-final { scan-assembler "pick.ph" } } */
76 /* { dg-final { scan-assembler "packrl.ph" } } */
77 /* { dg-final { scan-assembler "extrv?.w" } } */
78 /* { dg-final { scan-assembler "extrv?_s.h" } } */
79 /* { dg-final { scan-assembler "extrv?_r.w" } } */
80 /* { dg-final { scan-assembler "extrv?_rs.w" } } */
81 /* { dg-final { scan-assembler "extpv?" } } */
82 /* { dg-final { scan-assembler "extpdpv?" } } */
83 /* { dg-final { scan-assembler "shilov?" } } */
84 /* { dg-final { scan-assembler "mthlip" } } */
85 /* { dg-final { scan-assembler "mfhi" } } */
86 /* { dg-final { scan-assembler "mflo" } } */
87 /* { dg-final { scan-assembler "mthi" } } */
88 /* { dg-final { scan-assembler "mtlo" } } */
89 /* { dg-final { scan-assembler "wrdsp" } } */
90 /* { dg-final { scan-assembler "rddsp" } } */
91 /* { dg-final { scan-assembler "lbux?" } } */
92 /* { dg-final { scan-assembler "lhx?" } } */
93 /* { dg-final { scan-assembler "lwx?" } } */
94 /* { dg-final { scan-assembler "bposge32" } } */
99 typedef signed char v4i8
__attribute__ ((vector_size(4)));
100 typedef short v2q15
__attribute__ ((vector_size(4)));
104 typedef long long a64
;
106 NOMIPS16
void test_MIPS_DSP (void);
115 union { long long ll
; int i
[2]; } endianness_test
;
116 endianness_test
.ll
= 1;
117 little_endian
= endianness_test
.i
[0];
119 for (i
= 0; i
< 100; i
++)
127 NOMIPS16 v2q15
add_v2q15 (v2q15 a
, v2q15 b
)
129 return __builtin_mips_addq_ph (a
, b
);
132 NOMIPS16 v4i8
add_v4i8 (v4i8 a
, v4i8 b
)
134 return __builtin_mips_addu_qb (a
, b
);
137 NOMIPS16 v2q15
sub_v2q15 (v2q15 a
, v2q15 b
)
139 return __builtin_mips_subq_ph (a
, b
);
142 NOMIPS16 v4i8
sub_v4i8 (v4i8 a
, v4i8 b
)
144 return __builtin_mips_subu_qb (a
, b
);
147 NOMIPS16
void test_MIPS_DSP ()
149 v4i8 v4i8_a
,v4i8_b
,v4i8_c
,v4i8_r
,v4i8_s
;
150 v2q15 v2q15_a
,v2q15_b
,v2q15_c
,v2q15_r
,v2q15_s
;
151 q31 q31_a
,q31_b
,q31_c
,q31_r
,q31_s
;
152 i32 i32_a
,i32_b
,i32_c
,i32_r
,i32_s
;
153 a64 a64_a
,a64_b
,a64_c
,a64_r
,a64_s
;
159 v2q15_a
= (v2q15
) {0x1234, 0x5678};
160 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
161 v2q15_s
= (v2q15
) {0x81bd, 0x6789};
162 v2q15_r
= add_v2q15 (v2q15_a
, v2q15_b
);
168 v2q15_a
= (v2q15
) {0x1234, 0x5678};
169 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
170 v2q15_s
= (v2q15
) {0x7fff, 0x6789};
171 v2q15_r
= __builtin_mips_addq_s_ph (v2q15_a
, v2q15_b
);
180 q31_r
= __builtin_mips_addq_s_w (q31_a
, q31_b
);
184 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
185 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
186 v4i8_s
= (v4i8
) {0xf1, 0xbd, 0x67, 0x89};
187 v4i8_r
= add_v4i8 (v4i8_a
, v4i8_b
);
193 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
194 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
195 v4i8_s
= (v4i8
) {0xff, 0xbd, 0x67, 0x89};
196 v4i8_r
= __builtin_mips_addu_s_qb (v4i8_a
, v4i8_b
);
202 v2q15_a
= (v2q15
) {0x1234, 0x5678};
203 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
204 v2q15_s
= (v2q15
) {0xa2ab, 0x4567};
205 v2q15_r
= sub_v2q15 (v2q15_a
, v2q15_b
);
211 v2q15_a
= (v2q15
) {0x8000, 0x5678};
212 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
213 v2q15_s
= (v2q15
) {0x8000, 0x4567};
214 v2q15_r
= __builtin_mips_subq_s_ph (v2q15_a
, v2q15_b
);
223 q31_r
= __builtin_mips_subq_s_w (q31_a
, q31_b
);
227 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
228 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
229 v4i8_s
= (v4i8
) {0xf3, 0xab, 0x45, 0x67};
230 v4i8_r
= sub_v4i8 (v4i8_a
, v4i8_b
);
236 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
237 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
238 v4i8_s
= (v4i8
) {0x0, 0x0, 0x45, 0x67};
239 v4i8_r
= __builtin_mips_subu_s_qb (v4i8_a
, v4i8_b
);
248 i32_r
= __builtin_mips_addsc (i32_a
, i32_b
);
255 i32_r
= __builtin_mips_addwc (i32_a
, i32_b
);
262 i32_r
= __builtin_mips_modsub (i32_a
, i32_b
);
266 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
268 i32_r
= __builtin_mips_raddu_w_qb (v4i8_a
);
272 v2q15_a
= (v2q15
) {0x8000, 0x8134};
273 v2q15_s
= (v2q15
) {0x7fff, 0x7ecc};
274 v2q15_r
= __builtin_mips_absq_s_ph (v2q15_a
);
280 q31_a
= (q31
) 0x80000000;
281 q31_s
= (q31
) 0x7fffffff;
282 q31_r
= __builtin_mips_absq_s_w (q31_a
);
286 v2q15_a
= (v2q15
) {0x9999, 0x5612};
287 v2q15_b
= (v2q15
) {0x5612, 0x3333};
289 v4i8_s
= (v4i8
) {0x56, 0x33, 0x99, 0x56};
291 v4i8_s
= (v4i8
) {0x99, 0x56, 0x56, 0x33};
292 v4i8_r
= __builtin_mips_precrq_qb_ph (v2q15_a
, v2q15_b
);
301 v2q15_s
= (v2q15
) {0x4444, 0x1234};
303 v2q15_s
= (v2q15
) {0x1234, 0x4444};
304 v2q15_r
= __builtin_mips_precrq_ph_w (q31_a
, q31_b
);
313 v2q15_s
= (v2q15
) {0x4444, 0x1235};
315 v2q15_s
= (v2q15
) {0x1235, 0x4444};
316 v2q15_r
= __builtin_mips_precrq_rs_ph_w (q31_a
, q31_b
);
322 v2q15_a
= (v2q15
) {0x9999, 0x5612};
323 v2q15_b
= (v2q15
) {0x5612, 0x3333};
325 v4i8_s
= (v4i8
) {0xac, 0x66, 0x00, 0xac};
327 v4i8_s
= (v4i8
) {0x00, 0xac, 0xac, 0x66};
328 v4i8_r
= __builtin_mips_precrqu_s_qb_ph (v2q15_a
, v2q15_b
);
334 v2q15_a
= (v2q15
) {0x3589, 0x4444};
339 q31_r
= __builtin_mips_preceq_w_phl (v2q15_a
);
343 v2q15_a
= (v2q15
) {0x3589, 0x4444};
348 q31_r
= __builtin_mips_preceq_w_phr (v2q15_a
);
352 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
354 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
356 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
357 v2q15_r
= __builtin_mips_precequ_ph_qbl (v4i8_a
);
363 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
365 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
367 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
368 v2q15_r
= __builtin_mips_precequ_ph_qbr (v4i8_a
);
374 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
376 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
378 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
379 v2q15_r
= __builtin_mips_precequ_ph_qbla (v4i8_a
);
385 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
387 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
389 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
390 v2q15_r
= __builtin_mips_precequ_ph_qbra (v4i8_a
);
396 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
398 v2q15_s
= (v2q15
) {0x56, 0x33};
400 v2q15_s
= (v2q15
) {0x12, 0x56};
401 v2q15_r
= __builtin_mips_preceu_ph_qbl (v4i8_a
);
407 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
409 v2q15_s
= (v2q15
) {0x12, 0x56};
411 v2q15_s
= (v2q15
) {0x56, 0x33};
412 v2q15_r
= __builtin_mips_preceu_ph_qbr (v4i8_a
);
418 v4i8_a
= (v4i8
) {0x12, 0x99, 0x56, 0x33};
420 v2q15_s
= (v2q15
) {0x99, 0x33};
422 v2q15_s
= (v2q15
) {0x12, 0x56};
423 v2q15_r
= __builtin_mips_preceu_ph_qbla (v4i8_a
);
429 v4i8_a
= (v4i8
) {0x12, 0x99, 0x56, 0x33};
431 v2q15_s
= (v2q15
) {0x12, 0x56};
433 v2q15_s
= (v2q15
) {0x99, 0x33};
434 v2q15_r
= __builtin_mips_preceu_ph_qbra (v4i8_a
);
440 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
441 v4i8_s
= (v4i8
) {0xc8, 0xd0, 0x58, 0xe0};
442 v4i8_r
= __builtin_mips_shll_qb (v4i8_a
, 2);
448 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
450 v4i8_s
= (v4i8
) {0xe4, 0x68, 0xac, 0xf0};
451 v4i8_r
= __builtin_mips_shll_qb (v4i8_a
, i32_b
);
457 v2q15_a
= (v2q15
) {0x1234, 0x5678};
458 v2q15_s
= (v2q15
) {0x48d0, 0x59e0};
459 v2q15_r
= __builtin_mips_shll_ph (v2q15_a
, 2);
465 v2q15_a
= (v2q15
) {0x1234, 0x5678};
467 v2q15_s
= (v2q15
) {0x2468, 0xacf0};
468 v2q15_r
= __builtin_mips_shll_ph (v2q15_a
, i32_b
);
474 v2q15_a
= (v2q15
) {0x1234, 0x5678};
475 v2q15_s
= (v2q15
) {0x48d0, 0x7fff};
476 v2q15_r
= __builtin_mips_shll_s_ph (v2q15_a
, 2);
482 v2q15_a
= (v2q15
) {0x1234, 0x5678};
484 v2q15_s
= (v2q15
) {0x2468, 0x7fff};
485 v2q15_r
= __builtin_mips_shll_s_ph (v2q15_a
, i32_b
);
493 q31_r
= __builtin_mips_shll_s_w (q31_a
, 2);
500 q31_r
= __builtin_mips_shll_s_w (q31_a
, i32_b
);
504 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
505 v4i8_s
= (v4i8
) {0x3c, 0xd, 0x15, 0x1e};
506 v4i8_r
= __builtin_mips_shrl_qb (v4i8_a
, 2);
512 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
514 v4i8_s
= (v4i8
) {0x79, 0x1a, 0x2b, 0x3c};
515 v4i8_r
= __builtin_mips_shrl_qb (v4i8_a
, i32_b
);
521 v2q15_a
= (v2q15
) {0x1234, 0x5678};
522 v2q15_s
= (v2q15
) {0x48d, 0x159e};
523 v2q15_r
= __builtin_mips_shra_ph (v2q15_a
, 2);
529 v2q15_a
= (v2q15
) {0x1234, 0x5678};
531 v2q15_s
= (v2q15
) {0x91a, 0x2b3c};
532 v2q15_r
= __builtin_mips_shra_ph (v2q15_a
, i32_b
);
538 v2q15_a
= (v2q15
) {0x1234, 0x5678};
539 v2q15_s
= (v2q15
) {0x48d, 0x159e};
540 v2q15_r
= __builtin_mips_shra_r_ph (v2q15_a
, 2);
546 v2q15_a
= (v2q15
) {0x1234, 0x5678};
548 v2q15_s
= (v2q15
) {0x247, 0xacf};
549 v2q15_r
= __builtin_mips_shra_r_ph (v2q15_a
, i32_b
);
557 q31_r
= __builtin_mips_shra_r_w (q31_a
, 2);
564 q31_r
= __builtin_mips_shra_r_w (q31_a
, i32_b
);
568 v4i8_a
= (v4i8
) {0x1, 0x2, 0x3, 0x4};
569 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
571 v2q15_s
= (v2q15
) {0xffff, 0x4444};
573 v2q15_s
= (v2q15
) {0x6f89, 0x2222};
574 v2q15_r
= __builtin_mips_muleu_s_ph_qbl (v4i8_a
, v2q15_b
);
580 v4i8_a
= (v4i8
) {0x1, 0x2, 0x3, 0x4};
581 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
583 v2q15_s
= (v2q15
) {0x6f89, 0x2222};
585 v2q15_s
= (v2q15
) {0xffff, 0x4444};
586 v2q15_r
= __builtin_mips_muleu_s_ph_qbr (v4i8_a
, v2q15_b
);
592 v2q15_a
= (v2q15
) {0x1234, 0x5678};
593 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
594 v2q15_s
= (v2q15
) {0x0fdd, 0x0b87};
595 v2q15_r
= __builtin_mips_mulq_rs_ph (v2q15_a
, v2q15_b
);
601 v2q15_a
= (v2q15
) {0x8000, 0x8000};
602 v2q15_b
= (v2q15
) {0x8000, 0x8000};
604 q31_r
= __builtin_mips_muleq_s_w_phl (v2q15_a
, v2q15_b
);
608 v2q15_a
= (v2q15
) {0x8000, 0x8000};
609 v2q15_b
= (v2q15
) {0x8000, 0x8000};
611 q31_r
= __builtin_mips_muleq_s_w_phr (v2q15_a
, v2q15_b
);
617 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
618 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
623 a64_r
= __builtin_mips_dpau_h_qbl (a64_a
, v4i8_b
, v4i8_c
);
628 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
629 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
634 a64_r
= __builtin_mips_dpau_h_qbr (a64_a
, v4i8_b
, v4i8_c
);
639 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
640 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
645 a64_r
= __builtin_mips_dpsu_h_qbl (a64_a
, v4i8_b
, v4i8_c
);
650 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
651 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
656 a64_r
= __builtin_mips_dpsu_h_qbr (a64_a
, v4i8_b
, v4i8_c
);
661 v2q15_b
= (v2q15
) {0x8000, 0x5678};
662 v2q15_c
= (v2q15
) {0x8000, 0x1111};
664 a64_r
= __builtin_mips_dpaq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
669 v2q15_b
= (v2q15
) {0x8000, 0x5678};
670 v2q15_c
= (v2q15
) {0x8000, 0x1111};
671 a64_s
= 0xffffffff7478a522LL
;
672 a64_r
= __builtin_mips_dpsq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
677 v2q15_b
= (v2q15
) {0x8000, 0x5678};
678 v2q15_c
= (v2q15
) {0x8000, 0x1111};
680 a64_s
= 0xffffffff8b877d02LL
;
683 a64_r
= __builtin_mips_mulsaq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
690 a64_s
= 0x7fffffffffffffffLL
;
691 a64_r
= __builtin_mips_dpaq_sa_l_w (a64_a
, q31_b
, q31_c
);
698 a64_s
= 0x8000000000001112LL
;
699 a64_r
= __builtin_mips_dpsq_sa_l_w (a64_a
, q31_b
, q31_c
);
704 v2q15_b
= (v2q15
) {0x8000, 0x1};
705 v2q15_c
= (v2q15
) {0x8000, 0x2};
710 a64_r
= __builtin_mips_maq_s_w_phl (a64_a
, v2q15_b
, v2q15_c
);
715 v2q15_b
= (v2q15
) {0x8000, 0x1};
716 v2q15_c
= (v2q15
) {0x8000, 0x2};
721 a64_r
= __builtin_mips_maq_s_w_phr (a64_a
, v2q15_b
, v2q15_c
);
726 v2q15_b
= (v2q15
) {0x8000, 0x1};
727 v2q15_c
= (v2q15
) {0x8000, 0x2};
732 a64_r
= __builtin_mips_maq_sa_w_phl (a64_a
, v2q15_b
, v2q15_c
);
737 v2q15_b
= (v2q15
) {0x8000, 0x1};
738 v2q15_c
= (v2q15
) {0x8000, 0x2};
743 a64_r
= __builtin_mips_maq_sa_w_phr (a64_a
, v2q15_b
, v2q15_c
);
750 i32_r
= __builtin_mips_bitrev (i32_a
);
754 i32_a
= 0x00000208; // pos is 8, size is 4
755 __builtin_mips_wrdsp (i32_a
, 31);
759 i32_r
= __builtin_mips_insv (i32_a
, i32_b
);
763 v4i8_s
= (v4i8
) {1, 1, 1, 1};
764 v4i8_r
= __builtin_mips_repl_qb (1);
771 v4i8_s
= (v4i8
) {99, 99, 99, 99};
772 v4i8_r
= __builtin_mips_repl_qb (i32_a
);
778 v2q15_s
= (v2q15
) {30, 30};
779 v2q15_r
= __builtin_mips_repl_ph (30);
786 v2q15_s
= (v2q15
) {0x5612, 0x5612};
787 v2q15_r
= __builtin_mips_repl_ph (i32_a
);
793 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
794 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
799 __builtin_mips_cmpu_eq_qb (v4i8_a
, v4i8_b
);
800 i32_r
= __builtin_mips_rddsp (16);
804 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
805 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
810 __builtin_mips_cmpu_lt_qb (v4i8_a
, v4i8_b
);
811 i32_r
= __builtin_mips_rddsp (16);
815 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
816 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
821 __builtin_mips_cmpu_le_qb (v4i8_a
, v4i8_b
);
822 i32_r
= __builtin_mips_rddsp (16);
826 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
827 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
832 i32_r
=__builtin_mips_cmpgu_eq_qb (v4i8_a
, v4i8_b
);
836 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
837 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
842 i32_r
= __builtin_mips_cmpgu_lt_qb (v4i8_a
, v4i8_b
);
846 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
847 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
852 i32_r
= __builtin_mips_cmpgu_le_qb (v4i8_a
, v4i8_b
);
856 __builtin_mips_wrdsp (0,31); // Clear all condition code bits.
857 v2q15_a
= (v2q15
) {0x1234, 0x5678};
858 v2q15_b
= (v2q15
) {0x1234, 0x7856};
863 __builtin_mips_cmp_eq_ph (v2q15_a
, v2q15_b
);
864 i32_r
= __builtin_mips_rddsp (16);
868 v2q15_a
= (v2q15
) {0x1234, 0x5678};
869 v2q15_b
= (v2q15
) {0x1234, 0x7856};
874 __builtin_mips_cmp_lt_ph (v2q15_a
, v2q15_b
);
875 i32_r
= __builtin_mips_rddsp (16);
879 v2q15_a
= (v2q15
) {0x1234, 0x5678};
880 v2q15_b
= (v2q15
) {0x1234, 0x7856};
882 __builtin_mips_cmp_le_ph (v2q15_a
, v2q15_b
);
883 i32_r
= __builtin_mips_rddsp (16);
887 i32_a
= 0x0a000000; // cc: 0000 1010
888 __builtin_mips_wrdsp (i32_a
, 31);
889 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
890 v4i8_b
= (v4i8
) {0x21, 0x43, 0x65, 0x87};
892 v4i8_s
= (v4i8
) {0x21, 0x34, 0x65, 0x78};
894 v4i8_s
= (v4i8
) {0x12, 0x43, 0x56, 0x87};
895 v4i8_r
= __builtin_mips_pick_qb (v4i8_a
, v4i8_b
);
901 i32_a
= 0x02000000; // cc: 0000 0010
902 __builtin_mips_wrdsp (i32_a
, 31);
903 v2q15_a
= (v2q15
) {0x1234, 0x5678};
904 v2q15_b
= (v2q15
) {0x2143, 0x6587};
906 v2q15_s
= (v2q15
) {0x2143, 0x5678};
908 v2q15_s
= (v2q15
) {0x1234, 0x6587};
909 v2q15_r
= __builtin_mips_pick_ph (v2q15_a
, v2q15_b
);
915 v2q15_a
= (v2q15
) {0x1234, 0x5678};
916 v2q15_b
= (v2q15
) {0x1234, 0x7856};
918 v2q15_s
= (v2q15
) {0x7856, 0x1234};
920 v2q15_s
= (v2q15
) {0x5678, 0x1234};
921 v2q15_r
= __builtin_mips_packrl_ph (v2q15_a
, v2q15_b
);
928 a64_a
= 0x1234567887654321LL
;
930 i32_r
= __builtin_mips_extr_w (a64_a
, 4);
934 a64_a
= 0x1234567887658321LL
;
936 i32_r
= __builtin_mips_extr_r_w (a64_a
, 16);
940 a64_a
= 0x12345677fffffff8LL
;
942 i32_r
= __builtin_mips_extr_rs_w (a64_a
, 4);
946 a64_a
= 0x1234567887658321LL
;
948 i32_r
= __builtin_mips_extr_s_h (a64_a
, 16);
952 a64_a
= 0x0000007887658321LL
;
955 i32_r
= __builtin_mips_extr_s_h (a64_a
, i32_b
);
959 a64_a
= 0x1234567887654321LL
;
962 i32_r
= __builtin_mips_extr_w (a64_a
, i32_b
);
966 a64_a
= 0x1234567887658321LL
;
969 i32_r
= __builtin_mips_extr_r_w (a64_a
, i32_b
);
973 a64_a
= 0x12345677fffffff8LL
;
976 i32_r
= __builtin_mips_extr_rs_w (a64_a
, i32_b
);
980 i32_a
= 0x0000021f; // pos is 31
981 __builtin_mips_wrdsp (i32_a
, 31);
982 a64_a
= 0x1234567887654321LL
;
984 i32_r
= __builtin_mips_extp (a64_a
, 3); // extract 4 bits
988 i32_a
= 0x0000021f; // pos is 31
989 __builtin_mips_wrdsp (i32_a
, 31);
990 a64_a
= 0x1234567887654321LL
;
991 i32_b
= 7; // size is 8. NOTE!! we should use 7
993 i32_r
= __builtin_mips_extp (a64_a
, i32_b
);
997 i32_a
= 0x0000021f; // pos is 31
998 __builtin_mips_wrdsp (i32_a
, 31);
999 a64_a
= 0x1234567887654321LL
;
1001 i32_r
= __builtin_mips_extpdp (a64_a
, 3); // extract 4 bits
1005 i32_s
= 0x0000021b; // pos is 27
1006 i32_r
= __builtin_mips_rddsp (31);
1010 i32_a
= 0x0000021f; // pos is 31
1011 __builtin_mips_wrdsp (i32_a
, 31);
1012 a64_a
= 0x1234567887654321LL
;
1013 i32_b
= 11; // size is 12. NOTE!!! We should use 11
1015 i32_r
= __builtin_mips_extpdp (a64_a
, i32_b
);
1019 i32_s
= 0x00000213; // pos is 19
1020 i32_r
= __builtin_mips_rddsp (31);
1024 a64_a
= 0x1234567887654321LL
;
1025 a64_s
= 0x0012345678876543LL
;
1026 a64_r
= __builtin_mips_shilo (a64_a
, 8);
1030 a64_a
= 0x1234567887654321LL
;
1032 a64_s
= 0x5678876543210000LL
;
1033 a64_r
= __builtin_mips_shilo (a64_a
, i32_b
);
1038 __builtin_mips_wrdsp (i32_a
, 31);
1039 a64_a
= 0x1234567887654321LL
;
1041 a64_s
= 0x8765432111112222LL
;
1042 a64_r
= __builtin_mips_mthlip (a64_a
, i32_b
);
1046 i32_r
= __builtin_mips_rddsp (31);
1052 __builtin_mips_wrdsp (i32_a
, 63);
1054 i32_r
= __builtin_mips_rddsp (63);
1061 i32_r
= __builtin_mips_lbux (ptr_a
, i32_b
);
1071 i32_r
= __builtin_mips_lhx (ptr_a
, i32_b
);
1081 i32_r
= __builtin_mips_lwx (ptr_a
, i32_b
);
1085 i32_a
= 0x00000220; // pos is 32, size is 4
1086 __builtin_mips_wrdsp (i32_a
, 63);
1088 i32_r
= __builtin_mips_bposge32 ();