1 /* Test MIPS32 DSP instructions */
3 /* { dg-options "-mdsp" } */
8 typedef signed char v4i8
__attribute__ ((vector_size(4)));
9 typedef short v2q15
__attribute__ ((vector_size(4)));
13 typedef unsigned int ui32
;
14 typedef long long a64
;
16 NOMIPS16
void test_MIPS_DSP (void);
25 union { long long ll
; int i
[2]; } endianness_test
;
26 endianness_test
.ll
= 1;
27 little_endian
= endianness_test
.i
[0];
29 for (i
= 0; i
< 100; i
++)
37 NOMIPS16 v2q15
add_v2q15 (v2q15 a
, v2q15 b
)
39 return __builtin_mips_addq_ph (a
, b
);
42 NOMIPS16 v4i8
add_v4i8 (v4i8 a
, v4i8 b
)
44 return __builtin_mips_addu_qb (a
, b
);
47 NOMIPS16 v2q15
sub_v2q15 (v2q15 a
, v2q15 b
)
49 return __builtin_mips_subq_ph (a
, b
);
52 NOMIPS16 v4i8
sub_v4i8 (v4i8 a
, v4i8 b
)
54 return __builtin_mips_subu_qb (a
, b
);
57 NOMIPS16
void test_MIPS_DSP ()
59 v4i8 v4i8_a
,v4i8_b
,v4i8_c
,v4i8_r
,v4i8_s
;
60 v2q15 v2q15_a
,v2q15_b
,v2q15_c
,v2q15_r
,v2q15_s
;
61 q31 q31_a
,q31_b
,q31_c
,q31_r
,q31_s
;
62 /* To protect the multiplication-related tests from being optimized
64 volatile i32 i32_a
,i32_b
,i32_c
,i32_r
,i32_s
;
65 volatile ui32 ui32_a
,ui32_b
,ui32_c
;
66 a64 a64_a
,a64_b
,a64_c
,a64_r
,a64_s
;
72 v2q15_a
= (v2q15
) {0x1234, 0x5678};
73 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
74 v2q15_s
= (v2q15
) {0x81bd, 0x6789};
75 v2q15_r
= add_v2q15 (v2q15_a
, v2q15_b
);
81 v2q15_a
= (v2q15
) {0x1234, 0x5678};
82 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
83 v2q15_s
= (v2q15
) {0x7fff, 0x6789};
84 v2q15_r
= __builtin_mips_addq_s_ph (v2q15_a
, v2q15_b
);
93 q31_r
= __builtin_mips_addq_s_w (q31_a
, q31_b
);
97 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
98 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
99 v4i8_s
= (v4i8
) {0xf1, 0xbd, 0x67, 0x89};
100 v4i8_r
= add_v4i8 (v4i8_a
, v4i8_b
);
106 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
107 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
108 v4i8_s
= (v4i8
) {0xff, 0xbd, 0x67, 0x89};
109 v4i8_r
= __builtin_mips_addu_s_qb (v4i8_a
, v4i8_b
);
115 v2q15_a
= (v2q15
) {0x1234, 0x5678};
116 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
117 v2q15_s
= (v2q15
) {0xa2ab, 0x4567};
118 v2q15_r
= sub_v2q15 (v2q15_a
, v2q15_b
);
124 v2q15_a
= (v2q15
) {0x8000, 0x5678};
125 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
126 v2q15_s
= (v2q15
) {0x8000, 0x4567};
127 v2q15_r
= __builtin_mips_subq_s_ph (v2q15_a
, v2q15_b
);
136 q31_r
= __builtin_mips_subq_s_w (q31_a
, q31_b
);
140 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
141 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
142 v4i8_s
= (v4i8
) {0xf3, 0xab, 0x45, 0x67};
143 v4i8_r
= sub_v4i8 (v4i8_a
, v4i8_b
);
149 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
150 v4i8_b
= (v4i8
) {0xff, 0x89, 0x11, 0x11};
151 v4i8_s
= (v4i8
) {0x0, 0x0, 0x45, 0x67};
152 v4i8_r
= __builtin_mips_subu_s_qb (v4i8_a
, v4i8_b
);
161 i32_r
= __builtin_mips_addsc (i32_a
, i32_b
);
168 i32_r
= __builtin_mips_addwc (i32_a
, i32_b
);
175 i32_r
= __builtin_mips_modsub (i32_a
, i32_b
);
179 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
181 i32_r
= __builtin_mips_raddu_w_qb (v4i8_a
);
185 v2q15_a
= (v2q15
) {0x8000, 0x8134};
186 v2q15_s
= (v2q15
) {0x7fff, 0x7ecc};
187 v2q15_r
= __builtin_mips_absq_s_ph (v2q15_a
);
193 q31_a
= (q31
) 0x80000000;
194 q31_s
= (q31
) 0x7fffffff;
195 q31_r
= __builtin_mips_absq_s_w (q31_a
);
199 v2q15_a
= (v2q15
) {0x9999, 0x5612};
200 v2q15_b
= (v2q15
) {0x5612, 0x3333};
202 v4i8_s
= (v4i8
) {0x56, 0x33, 0x99, 0x56};
204 v4i8_s
= (v4i8
) {0x99, 0x56, 0x56, 0x33};
205 v4i8_r
= __builtin_mips_precrq_qb_ph (v2q15_a
, v2q15_b
);
214 v2q15_s
= (v2q15
) {0x4444, 0x1234};
216 v2q15_s
= (v2q15
) {0x1234, 0x4444};
217 v2q15_r
= __builtin_mips_precrq_ph_w (q31_a
, q31_b
);
226 v2q15_s
= (v2q15
) {0x4444, 0x1235};
228 v2q15_s
= (v2q15
) {0x1235, 0x4444};
229 v2q15_r
= __builtin_mips_precrq_rs_ph_w (q31_a
, q31_b
);
235 v2q15_a
= (v2q15
) {0x9999, 0x5612};
236 v2q15_b
= (v2q15
) {0x5612, 0x3333};
238 v4i8_s
= (v4i8
) {0xac, 0x66, 0x00, 0xac};
240 v4i8_s
= (v4i8
) {0x00, 0xac, 0xac, 0x66};
241 v4i8_r
= __builtin_mips_precrqu_s_qb_ph (v2q15_a
, v2q15_b
);
247 v2q15_a
= (v2q15
) {0x3589, 0x4444};
252 q31_r
= __builtin_mips_preceq_w_phl (v2q15_a
);
256 v2q15_a
= (v2q15
) {0x3589, 0x4444};
261 q31_r
= __builtin_mips_preceq_w_phr (v2q15_a
);
265 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
267 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
269 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
270 v2q15_r
= __builtin_mips_precequ_ph_qbl (v4i8_a
);
276 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
278 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
280 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
281 v2q15_r
= __builtin_mips_precequ_ph_qbr (v4i8_a
);
287 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
289 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
291 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
292 v2q15_r
= __builtin_mips_precequ_ph_qbla (v4i8_a
);
298 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
300 v2q15_s
= (v2q15
) {0x0900, 0x2b00};
302 v2q15_s
= (v2q15
) {0x2b00, 0x1980};
303 v2q15_r
= __builtin_mips_precequ_ph_qbra (v4i8_a
);
309 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
311 v2q15_s
= (v2q15
) {0x56, 0x33};
313 v2q15_s
= (v2q15
) {0x12, 0x56};
314 v2q15_r
= __builtin_mips_preceu_ph_qbl (v4i8_a
);
320 v4i8_a
= (v4i8
) {0x12, 0x56, 0x56, 0x33};
322 v2q15_s
= (v2q15
) {0x12, 0x56};
324 v2q15_s
= (v2q15
) {0x56, 0x33};
325 v2q15_r
= __builtin_mips_preceu_ph_qbr (v4i8_a
);
331 v4i8_a
= (v4i8
) {0x12, 0x99, 0x56, 0x33};
333 v2q15_s
= (v2q15
) {0x99, 0x33};
335 v2q15_s
= (v2q15
) {0x12, 0x56};
336 v2q15_r
= __builtin_mips_preceu_ph_qbla (v4i8_a
);
342 v4i8_a
= (v4i8
) {0x12, 0x99, 0x56, 0x33};
344 v2q15_s
= (v2q15
) {0x12, 0x56};
346 v2q15_s
= (v2q15
) {0x99, 0x33};
347 v2q15_r
= __builtin_mips_preceu_ph_qbra (v4i8_a
);
353 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
354 v4i8_s
= (v4i8
) {0xc8, 0xd0, 0x58, 0xe0};
355 v4i8_r
= __builtin_mips_shll_qb (v4i8_a
, 2);
361 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
363 v4i8_s
= (v4i8
) {0xe4, 0x68, 0xac, 0xf0};
364 v4i8_r
= __builtin_mips_shll_qb (v4i8_a
, i32_b
);
370 v2q15_a
= (v2q15
) {0x1234, 0x5678};
371 v2q15_s
= (v2q15
) {0x48d0, 0x59e0};
372 v2q15_r
= __builtin_mips_shll_ph (v2q15_a
, 2);
378 v2q15_a
= (v2q15
) {0x1234, 0x5678};
380 v2q15_s
= (v2q15
) {0x2468, 0xacf0};
381 v2q15_r
= __builtin_mips_shll_ph (v2q15_a
, i32_b
);
387 v2q15_a
= (v2q15
) {0x1234, 0x5678};
388 v2q15_s
= (v2q15
) {0x48d0, 0x7fff};
389 v2q15_r
= __builtin_mips_shll_s_ph (v2q15_a
, 2);
395 v2q15_a
= (v2q15
) {0x1234, 0x5678};
397 v2q15_s
= (v2q15
) {0x2468, 0x7fff};
398 v2q15_r
= __builtin_mips_shll_s_ph (v2q15_a
, i32_b
);
406 q31_r
= __builtin_mips_shll_s_w (q31_a
, 2);
413 q31_r
= __builtin_mips_shll_s_w (q31_a
, i32_b
);
417 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
418 v4i8_s
= (v4i8
) {0x3c, 0xd, 0x15, 0x1e};
419 v4i8_r
= __builtin_mips_shrl_qb (v4i8_a
, 2);
425 v4i8_a
= (v4i8
) {0xf2, 0x34, 0x56, 0x78};
427 v4i8_s
= (v4i8
) {0x79, 0x1a, 0x2b, 0x3c};
428 v4i8_r
= __builtin_mips_shrl_qb (v4i8_a
, i32_b
);
434 v2q15_a
= (v2q15
) {0x1234, 0x5678};
435 v2q15_s
= (v2q15
) {0x48d, 0x159e};
436 v2q15_r
= __builtin_mips_shra_ph (v2q15_a
, 2);
442 v2q15_a
= (v2q15
) {0x1234, 0x5678};
444 v2q15_s
= (v2q15
) {0x91a, 0x2b3c};
445 v2q15_r
= __builtin_mips_shra_ph (v2q15_a
, i32_b
);
451 v2q15_a
= (v2q15
) {0x1234, 0x5678};
452 v2q15_s
= (v2q15
) {0x48d, 0x159e};
453 v2q15_r
= __builtin_mips_shra_r_ph (v2q15_a
, 2);
459 v2q15_a
= (v2q15
) {0x1234, 0x5678};
461 v2q15_s
= (v2q15
) {0x247, 0xacf};
462 v2q15_r
= __builtin_mips_shra_r_ph (v2q15_a
, i32_b
);
470 q31_r
= __builtin_mips_shra_r_w (q31_a
, 2);
477 q31_r
= __builtin_mips_shra_r_w (q31_a
, i32_b
);
481 v4i8_a
= (v4i8
) {0x1, 0x2, 0x3, 0x4};
482 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
484 v2q15_s
= (v2q15
) {0xffff, 0x4444};
486 v2q15_s
= (v2q15
) {0x6f89, 0x2222};
487 v2q15_r
= __builtin_mips_muleu_s_ph_qbl (v4i8_a
, v2q15_b
);
493 v4i8_a
= (v4i8
) {0x1, 0x2, 0x3, 0x4};
494 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
496 v2q15_s
= (v2q15
) {0x6f89, 0x2222};
498 v2q15_s
= (v2q15
) {0xffff, 0x4444};
499 v2q15_r
= __builtin_mips_muleu_s_ph_qbr (v4i8_a
, v2q15_b
);
505 v2q15_a
= (v2q15
) {0x1234, 0x5678};
506 v2q15_b
= (v2q15
) {0x6f89, 0x1111};
507 v2q15_s
= (v2q15
) {0x0fdd, 0x0b87};
508 v2q15_r
= __builtin_mips_mulq_rs_ph (v2q15_a
, v2q15_b
);
514 v2q15_a
= (v2q15
) {0x8000, 0x8000};
515 v2q15_b
= (v2q15
) {0x8000, 0x8000};
517 q31_r
= __builtin_mips_muleq_s_w_phl (v2q15_a
, v2q15_b
);
521 v2q15_a
= (v2q15
) {0x8000, 0x8000};
522 v2q15_b
= (v2q15
) {0x8000, 0x8000};
524 q31_r
= __builtin_mips_muleq_s_w_phr (v2q15_a
, v2q15_b
);
530 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
531 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
536 a64_r
= __builtin_mips_dpau_h_qbl (a64_a
, v4i8_b
, v4i8_c
);
541 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
542 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
547 a64_r
= __builtin_mips_dpau_h_qbr (a64_a
, v4i8_b
, v4i8_c
);
552 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
553 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
558 a64_r
= __builtin_mips_dpsu_h_qbl (a64_a
, v4i8_b
, v4i8_c
);
563 v4i8_b
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
564 v4i8_c
= (v4i8
) {0xaa, 0x89, 0x11, 0x34};
569 a64_r
= __builtin_mips_dpsu_h_qbr (a64_a
, v4i8_b
, v4i8_c
);
574 v2q15_b
= (v2q15
) {0x8000, 0x5678};
575 v2q15_c
= (v2q15
) {0x8000, 0x1111};
577 a64_r
= __builtin_mips_dpaq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
582 v2q15_b
= (v2q15
) {0x8000, 0x5678};
583 v2q15_c
= (v2q15
) {0x8000, 0x1111};
584 a64_s
= 0xffffffff7478a522LL
;
585 a64_r
= __builtin_mips_dpsq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
590 v2q15_b
= (v2q15
) {0x8000, 0x5678};
591 v2q15_c
= (v2q15
) {0x8000, 0x1111};
593 a64_s
= 0xffffffff8b877d02LL
;
596 a64_r
= __builtin_mips_mulsaq_s_w_ph (a64_a
, v2q15_b
, v2q15_c
);
603 a64_s
= 0x7fffffffffffffffLL
;
604 a64_r
= __builtin_mips_dpaq_sa_l_w (a64_a
, q31_b
, q31_c
);
611 a64_s
= 0x8000000000001112LL
;
612 a64_r
= __builtin_mips_dpsq_sa_l_w (a64_a
, q31_b
, q31_c
);
617 v2q15_b
= (v2q15
) {0x8000, 0x1};
618 v2q15_c
= (v2q15
) {0x8000, 0x2};
623 a64_r
= __builtin_mips_maq_s_w_phl (a64_a
, v2q15_b
, v2q15_c
);
628 v2q15_b
= (v2q15
) {0x8000, 0x1};
629 v2q15_c
= (v2q15
) {0x8000, 0x2};
634 a64_r
= __builtin_mips_maq_s_w_phr (a64_a
, v2q15_b
, v2q15_c
);
639 v2q15_b
= (v2q15
) {0x8000, 0x1};
640 v2q15_c
= (v2q15
) {0x8000, 0x2};
645 a64_r
= __builtin_mips_maq_sa_w_phl (a64_a
, v2q15_b
, v2q15_c
);
650 v2q15_b
= (v2q15
) {0x8000, 0x1};
651 v2q15_c
= (v2q15
) {0x8000, 0x2};
656 a64_r
= __builtin_mips_maq_sa_w_phr (a64_a
, v2q15_b
, v2q15_c
);
663 i32_r
= __builtin_mips_bitrev (i32_a
);
667 i32_a
= 0x00000208; // pos is 8, size is 4
668 __builtin_mips_wrdsp (i32_a
, 31);
672 i32_r
= __builtin_mips_insv (i32_a
, i32_b
);
676 v4i8_s
= (v4i8
) {1, 1, 1, 1};
677 v4i8_r
= __builtin_mips_repl_qb (1);
684 v4i8_s
= (v4i8
) {99, 99, 99, 99};
685 v4i8_r
= __builtin_mips_repl_qb (i32_a
);
691 v2q15_s
= (v2q15
) {30, 30};
692 v2q15_r
= __builtin_mips_repl_ph (30);
699 v2q15_s
= (v2q15
) {0x5612, 0x5612};
700 v2q15_r
= __builtin_mips_repl_ph (i32_a
);
706 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
707 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
712 __builtin_mips_cmpu_eq_qb (v4i8_a
, v4i8_b
);
713 i32_r
= __builtin_mips_rddsp (16);
717 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
718 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
723 __builtin_mips_cmpu_lt_qb (v4i8_a
, v4i8_b
);
724 i32_r
= __builtin_mips_rddsp (16);
728 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
729 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
734 __builtin_mips_cmpu_le_qb (v4i8_a
, v4i8_b
);
735 i32_r
= __builtin_mips_rddsp (16);
739 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
740 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
745 i32_r
=__builtin_mips_cmpgu_eq_qb (v4i8_a
, v4i8_b
);
749 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
750 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
755 i32_r
= __builtin_mips_cmpgu_lt_qb (v4i8_a
, v4i8_b
);
759 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
760 v4i8_b
= (v4i8
) {0x12, 0x34, 0x78, 0x56};
765 i32_r
= __builtin_mips_cmpgu_le_qb (v4i8_a
, v4i8_b
);
769 __builtin_mips_wrdsp (0,31); // Clear all condition code bits.
770 v2q15_a
= (v2q15
) {0x1234, 0x5678};
771 v2q15_b
= (v2q15
) {0x1234, 0x7856};
776 __builtin_mips_cmp_eq_ph (v2q15_a
, v2q15_b
);
777 i32_r
= __builtin_mips_rddsp (16);
781 v2q15_a
= (v2q15
) {0x1234, 0x5678};
782 v2q15_b
= (v2q15
) {0x1234, 0x7856};
787 __builtin_mips_cmp_lt_ph (v2q15_a
, v2q15_b
);
788 i32_r
= __builtin_mips_rddsp (16);
792 v2q15_a
= (v2q15
) {0x1234, 0x5678};
793 v2q15_b
= (v2q15
) {0x1234, 0x7856};
795 __builtin_mips_cmp_le_ph (v2q15_a
, v2q15_b
);
796 i32_r
= __builtin_mips_rddsp (16);
800 i32_a
= 0x0a000000; // cc: 0000 1010
801 __builtin_mips_wrdsp (i32_a
, 31);
802 v4i8_a
= (v4i8
) {0x12, 0x34, 0x56, 0x78};
803 v4i8_b
= (v4i8
) {0x21, 0x43, 0x65, 0x87};
805 v4i8_s
= (v4i8
) {0x21, 0x34, 0x65, 0x78};
807 v4i8_s
= (v4i8
) {0x12, 0x43, 0x56, 0x87};
808 v4i8_r
= __builtin_mips_pick_qb (v4i8_a
, v4i8_b
);
814 i32_a
= 0x02000000; // cc: 0000 0010
815 __builtin_mips_wrdsp (i32_a
, 31);
816 v2q15_a
= (v2q15
) {0x1234, 0x5678};
817 v2q15_b
= (v2q15
) {0x2143, 0x6587};
819 v2q15_s
= (v2q15
) {0x2143, 0x5678};
821 v2q15_s
= (v2q15
) {0x1234, 0x6587};
822 v2q15_r
= __builtin_mips_pick_ph (v2q15_a
, v2q15_b
);
828 v2q15_a
= (v2q15
) {0x1234, 0x5678};
829 v2q15_b
= (v2q15
) {0x1234, 0x7856};
831 v2q15_s
= (v2q15
) {0x7856, 0x1234};
833 v2q15_s
= (v2q15
) {0x5678, 0x1234};
834 v2q15_r
= __builtin_mips_packrl_ph (v2q15_a
, v2q15_b
);
841 a64_a
= 0x1234567887654321LL
;
843 i32_r
= __builtin_mips_extr_w (a64_a
, 4);
847 a64_a
= 0x1234567887658321LL
;
849 i32_r
= __builtin_mips_extr_r_w (a64_a
, 16);
853 a64_a
= 0x12345677fffffff8LL
;
855 i32_r
= __builtin_mips_extr_rs_w (a64_a
, 4);
859 a64_a
= 0x1234567887658321LL
;
861 i32_r
= __builtin_mips_extr_s_h (a64_a
, 16);
865 a64_a
= 0x0000007887658321LL
;
868 i32_r
= __builtin_mips_extr_s_h (a64_a
, i32_b
);
872 a64_a
= 0x1234567887654321LL
;
875 i32_r
= __builtin_mips_extr_w (a64_a
, i32_b
);
879 a64_a
= 0x1234567887658321LL
;
882 i32_r
= __builtin_mips_extr_r_w (a64_a
, i32_b
);
886 a64_a
= 0x12345677fffffff8LL
;
889 i32_r
= __builtin_mips_extr_rs_w (a64_a
, i32_b
);
893 i32_a
= 0x0000021f; // pos is 31
894 __builtin_mips_wrdsp (i32_a
, 31);
895 a64_a
= 0x1234567887654321LL
;
897 i32_r
= __builtin_mips_extp (a64_a
, 3); // extract 4 bits
901 i32_a
= 0x0000021f; // pos is 31
902 __builtin_mips_wrdsp (i32_a
, 31);
903 a64_a
= 0x1234567887654321LL
;
904 i32_b
= 7; // size is 8. NOTE!! we should use 7
906 i32_r
= __builtin_mips_extp (a64_a
, i32_b
);
910 i32_a
= 0x0000021f; // pos is 31
911 __builtin_mips_wrdsp (i32_a
, 31);
912 a64_a
= 0x1234567887654321LL
;
914 i32_r
= __builtin_mips_extpdp (a64_a
, 3); // extract 4 bits
918 i32_s
= 0x0000021b; // pos is 27
919 i32_r
= __builtin_mips_rddsp (31);
923 i32_a
= 0x0000021f; // pos is 31
924 __builtin_mips_wrdsp (i32_a
, 31);
925 a64_a
= 0x1234567887654321LL
;
926 i32_b
= 11; // size is 12. NOTE!!! We should use 11
928 i32_r
= __builtin_mips_extpdp (a64_a
, i32_b
);
932 i32_s
= 0x00000213; // pos is 19
933 i32_r
= __builtin_mips_rddsp (31);
937 a64_a
= 0x1234567887654321LL
;
938 a64_s
= 0x0012345678876543LL
;
939 a64_r
= __builtin_mips_shilo (a64_a
, 8);
943 a64_a
= 0x1234567887654321LL
;
945 a64_s
= 0x5678876543210000LL
;
946 a64_r
= __builtin_mips_shilo (a64_a
, i32_b
);
951 __builtin_mips_wrdsp (i32_a
, 31);
952 a64_a
= 0x1234567887654321LL
;
954 a64_s
= 0x8765432111112222LL
;
955 a64_r
= __builtin_mips_mthlip (a64_a
, i32_b
);
959 i32_r
= __builtin_mips_rddsp (31);
965 __builtin_mips_wrdsp (i32_a
, 63);
967 i32_r
= __builtin_mips_rddsp (63);
974 i32_r
= __builtin_mips_lbux (ptr_a
, i32_b
);
984 i32_r
= __builtin_mips_lhx (ptr_a
, i32_b
);
994 i32_r
= __builtin_mips_lwx (ptr_a
, i32_b
);
998 i32_a
= 0x00000220; // pos is 32, size is 4
999 __builtin_mips_wrdsp (i32_a
, 63);
1001 i32_r
= __builtin_mips_bposge32 ();
1009 a64_s
= 0xF7776EEF12345678LL
;
1010 a64_r
= __builtin_mips_madd (a64_a
, i32_b
, i32_c
);
1017 ui32_b
= 0x80000000;
1018 ui32_c
= 0x11112222;
1019 a64_s
= 0x0888911112345678LL
;
1020 a64_r
= __builtin_mips_maddu (a64_a
, ui32_b
, ui32_c
);
1029 a64_s
= 0x0888911112345678LL
;
1030 a64_r
= __builtin_mips_msub (a64_a
, i32_b
, i32_c
);
1037 ui32_b
= 0x80000000;
1038 ui32_c
= 0x11112222;
1039 a64_s
= 0xF7776EEF12345678LL
;
1040 a64_r
= __builtin_mips_msubu (a64_a
, ui32_b
, ui32_c
);
1048 a64_s
= 0xF7776EEF00000000LL
;
1049 a64_r
= __builtin_mips_mult (i32_a
, i32_b
);
1055 ui32_a
= 0x80000000;
1056 ui32_b
= 0x11112222;
1057 a64_s
= 0x888911100000000LL
;
1058 a64_r
= __builtin_mips_multu (ui32_a
, ui32_b
);