Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvflogb_s.c

raw
1 /* { dg-options "-mlasx -w -fno-strict-aliasing" } */
2 #include "../simd_correctness_check.h"
3 #include <lasxintrin.h>
4
5 int
6 main ()
7 {
8 __m256i __m256i_op0, __m256i_op1, __m256i_op2, __m256i_out, __m256i_result;
9 __m256 __m256_op0, __m256_op1, __m256_op2, __m256_out, __m256_result;
10 __m256d __m256d_op0, __m256d_op1, __m256d_op2, __m256d_out, __m256d_result;
11
12 int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
13 long int long_op0, long_op1, long_op2, lont_out, lont_result;
14 long int long_int_out, long_int_result;
15 unsigned int unsigned_int_out, unsigned_int_result;
16 unsigned long int unsigned_long_int_out, unsigned_long_int_result;
17
18 *((int *)&__m256_op0[7]) = 0xffffffff;
19 *((int *)&__m256_op0[6]) = 0xffffffff;
20 *((int *)&__m256_op0[5]) = 0xffffffff;
21 *((int *)&__m256_op0[4]) = 0xffffffff;
22 *((int *)&__m256_op0[3]) = 0xffffffff;
23 *((int *)&__m256_op0[2]) = 0xffffffff;
24 *((int *)&__m256_op0[1]) = 0xffffffff;
25 *((int *)&__m256_op0[0]) = 0xffffffff;
26 *((int *)&__m256_result[7]) = 0xffffffff;
27 *((int *)&__m256_result[6]) = 0xffffffff;
28 *((int *)&__m256_result[5]) = 0xffffffff;
29 *((int *)&__m256_result[4]) = 0xffffffff;
30 *((int *)&__m256_result[3]) = 0xffffffff;
31 *((int *)&__m256_result[2]) = 0xffffffff;
32 *((int *)&__m256_result[1]) = 0xffffffff;
33 *((int *)&__m256_result[0]) = 0xffffffff;
34 __m256_out = __lasx_xvflogb_s (__m256_op0);
35 ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
36
37 *((int *)&__m256_op0[7]) = 0x10101010;
38 *((int *)&__m256_op0[6]) = 0x10101012;
39 *((int *)&__m256_op0[5]) = 0x10101010;
40 *((int *)&__m256_op0[4]) = 0x10101012;
41 *((int *)&__m256_op0[3]) = 0x10101010;
42 *((int *)&__m256_op0[2]) = 0x10101093;
43 *((int *)&__m256_op0[1]) = 0x11111111;
44 *((int *)&__m256_op0[0]) = 0x11111113;
45 *((int *)&__m256_result[7]) = 0xc2be0000;
46 *((int *)&__m256_result[6]) = 0xc2be0000;
47 *((int *)&__m256_result[5]) = 0xc2be0000;
48 *((int *)&__m256_result[4]) = 0xc2be0000;
49 *((int *)&__m256_result[3]) = 0xc2be0000;
50 *((int *)&__m256_result[2]) = 0xc2be0000;
51 *((int *)&__m256_result[1]) = 0xc2ba0000;
52 *((int *)&__m256_result[0]) = 0xc2ba0000;
53 __m256_out = __lasx_xvflogb_s (__m256_op0);
54 ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
55
56 *((int *)&__m256_op0[7]) = 0x00000000;
57 *((int *)&__m256_op0[6]) = 0x00000000;
58 *((int *)&__m256_op0[5]) = 0x00000000;
59 *((int *)&__m256_op0[4]) = 0x00000000;
60 *((int *)&__m256_op0[3]) = 0x00000000;
61 *((int *)&__m256_op0[2]) = 0x00000000;
62 *((int *)&__m256_op0[1]) = 0x00000000;
63 *((int *)&__m256_op0[0]) = 0x00000000;
64 *((int *)&__m256_result[7]) = 0xff800000;
65 *((int *)&__m256_result[6]) = 0xff800000;
66 *((int *)&__m256_result[5]) = 0xff800000;
67 *((int *)&__m256_result[4]) = 0xff800000;
68 *((int *)&__m256_result[3]) = 0xff800000;
69 *((int *)&__m256_result[2]) = 0xff800000;
70 *((int *)&__m256_result[1]) = 0xff800000;
71 *((int *)&__m256_result[0]) = 0xff800000;
72 __m256_out = __lasx_xvflogb_s (__m256_op0);
73 ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
74
75 *((int *)&__m256_op0[7]) = 0x00000000;
76 *((int *)&__m256_op0[6]) = 0x00000000;
77 *((int *)&__m256_op0[5]) = 0x00000000;
78 *((int *)&__m256_op0[4]) = 0x00000000;
79 *((int *)&__m256_op0[3]) = 0x00000000;
80 *((int *)&__m256_op0[2]) = 0x00000000;
81 *((int *)&__m256_op0[1]) = 0x00000000;
82 *((int *)&__m256_op0[0]) = 0x00000000;
83 *((int *)&__m256_result[7]) = 0xff800000;
84 *((int *)&__m256_result[6]) = 0xff800000;
85 *((int *)&__m256_result[5]) = 0xff800000;
86 *((int *)&__m256_result[4]) = 0xff800000;
87 *((int *)&__m256_result[3]) = 0xff800000;
88 *((int *)&__m256_result[2]) = 0xff800000;
89 *((int *)&__m256_result[1]) = 0xff800000;
90 *((int *)&__m256_result[0]) = 0xff800000;
91 __m256_out = __lasx_xvflogb_s (__m256_op0);
92 ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
93
94 *((int *)&__m256_op0[7]) = 0x00000000;
95 *((int *)&__m256_op0[6]) = 0x00000000;
96 *((int *)&__m256_op0[5]) = 0x00000087;
97 *((int *)&__m256_op0[4]) = 0x00000000;
98 *((int *)&__m256_op0[3]) = 0x00000000;
99 *((int *)&__m256_op0[2]) = 0x00000000;
100 *((int *)&__m256_op0[1]) = 0x00000087;
101 *((int *)&__m256_op0[0]) = 0x00000000;
102 *((int *)&__m256_result[7]) = 0xff800000;
103 *((int *)&__m256_result[6]) = 0xff800000;
104 *((int *)&__m256_result[5]) = 0xc30e0000;
105 *((int *)&__m256_result[4]) = 0xff800000;
106 *((int *)&__m256_result[3]) = 0xff800000;
107 *((int *)&__m256_result[2]) = 0xff800000;
108 *((int *)&__m256_result[1]) = 0xc30e0000;
109 *((int *)&__m256_result[0]) = 0xff800000;
110 __m256_out = __lasx_xvflogb_s (__m256_op0);
111 ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
112
113 return 0;
114 }