@@ -14,7 +14,7 @@ unsafe fn test_vpmin_s8() {
14
14
let a = i8x8:: from ( [ 1 , -2 , 3 , -4 , 5 , 6 , 7 , 8 ] ) ;
15
15
let b = i8x8:: from ( [ 0 , 3 , 2 , 5 , 4 , 7 , 6 , 9 ] ) ;
16
16
let e = i8x8:: from ( [ -2 , -4 , 5 , 7 , 0 , 2 , 4 , 6 ] ) ;
17
- let r: i8x8 = transmute ( vpmin_s8 ( transmute ( a) , transmute ( b) ) ) ;
17
+ let r: i8x8 = unsafe { transmute ( vpmin_s8 ( transmute ( a) , transmute ( b) ) ) } ;
18
18
assert_eq ! ( r, e) ;
19
19
}
20
20
@@ -23,7 +23,7 @@ unsafe fn test_vpmin_s16() {
23
23
let a = i16x4:: from ( [ 1 , 2 , 3 , -4 ] ) ;
24
24
let b = i16x4:: from ( [ 0 , 3 , 2 , 5 ] ) ;
25
25
let e = i16x4:: from ( [ 1 , -4 , 0 , 2 ] ) ;
26
- let r: i16x4 = transmute ( vpmin_s16 ( transmute ( a) , transmute ( b) ) ) ;
26
+ let r: i16x4 = unsafe { transmute ( vpmin_s16 ( transmute ( a) , transmute ( b) ) ) } ;
27
27
assert_eq ! ( r, e) ;
28
28
}
29
29
@@ -32,7 +32,7 @@ unsafe fn test_vpmin_s32() {
32
32
let a = i32x2:: from ( [ 1 , -2 ] ) ;
33
33
let b = i32x2:: from ( [ 0 , 3 ] ) ;
34
34
let e = i32x2:: from ( [ -2 , 0 ] ) ;
35
- let r: i32x2 = transmute ( vpmin_s32 ( transmute ( a) , transmute ( b) ) ) ;
35
+ let r: i32x2 = unsafe { transmute ( vpmin_s32 ( transmute ( a) , transmute ( b) ) ) } ;
36
36
assert_eq ! ( r, e) ;
37
37
}
38
38
@@ -41,7 +41,7 @@ unsafe fn test_vpmin_u8() {
41
41
let a = u8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) ;
42
42
let b = u8x8:: from ( [ 0 , 3 , 2 , 5 , 4 , 7 , 6 , 9 ] ) ;
43
43
let e = u8x8:: from ( [ 1 , 3 , 5 , 7 , 0 , 2 , 4 , 6 ] ) ;
44
- let r: u8x8 = transmute ( vpmin_u8 ( transmute ( a) , transmute ( b) ) ) ;
44
+ let r: u8x8 = unsafe { transmute ( vpmin_u8 ( transmute ( a) , transmute ( b) ) ) } ;
45
45
assert_eq ! ( r, e) ;
46
46
}
47
47
@@ -50,7 +50,7 @@ unsafe fn test_vpmin_u16() {
50
50
let a = u16x4:: from ( [ 1 , 2 , 3 , 4 ] ) ;
51
51
let b = u16x4:: from ( [ 0 , 3 , 2 , 5 ] ) ;
52
52
let e = u16x4:: from ( [ 1 , 3 , 0 , 2 ] ) ;
53
- let r: u16x4 = transmute ( vpmin_u16 ( transmute ( a) , transmute ( b) ) ) ;
53
+ let r: u16x4 = unsafe { transmute ( vpmin_u16 ( transmute ( a) , transmute ( b) ) ) } ;
54
54
assert_eq ! ( r, e) ;
55
55
}
56
56
@@ -59,7 +59,7 @@ unsafe fn test_vpmin_u32() {
59
59
let a = u32x2:: from ( [ 1 , 2 ] ) ;
60
60
let b = u32x2:: from ( [ 0 , 3 ] ) ;
61
61
let e = u32x2:: from ( [ 1 , 0 ] ) ;
62
- let r: u32x2 = transmute ( vpmin_u32 ( transmute ( a) , transmute ( b) ) ) ;
62
+ let r: u32x2 = unsafe { transmute ( vpmin_u32 ( transmute ( a) , transmute ( b) ) ) } ;
63
63
assert_eq ! ( r, e) ;
64
64
}
65
65
@@ -68,7 +68,7 @@ unsafe fn test_vpmin_f32() {
68
68
let a = f32x2:: from ( [ 1. , -2. ] ) ;
69
69
let b = f32x2:: from ( [ 0. , 3. ] ) ;
70
70
let e = f32x2:: from ( [ -2. , 0. ] ) ;
71
- let r: f32x2 = transmute ( vpmin_f32 ( transmute ( a) , transmute ( b) ) ) ;
71
+ let r: f32x2 = unsafe { transmute ( vpmin_f32 ( transmute ( a) , transmute ( b) ) ) } ;
72
72
assert_eq ! ( r, e) ;
73
73
}
74
74
@@ -77,7 +77,7 @@ unsafe fn test_vpmax_s8() {
77
77
let a = i8x8:: from ( [ 1 , -2 , 3 , -4 , 5 , 6 , 7 , 8 ] ) ;
78
78
let b = i8x8:: from ( [ 0 , 3 , 2 , 5 , 4 , 7 , 6 , 9 ] ) ;
79
79
let e = i8x8:: from ( [ 1 , 3 , 6 , 8 , 3 , 5 , 7 , 9 ] ) ;
80
- let r: i8x8 = transmute ( vpmax_s8 ( transmute ( a) , transmute ( b) ) ) ;
80
+ let r: i8x8 = unsafe { transmute ( vpmax_s8 ( transmute ( a) , transmute ( b) ) ) } ;
81
81
assert_eq ! ( r, e) ;
82
82
}
83
83
@@ -86,7 +86,7 @@ unsafe fn test_vpmax_s16() {
86
86
let a = i16x4:: from ( [ 1 , 2 , 3 , -4 ] ) ;
87
87
let b = i16x4:: from ( [ 0 , 3 , 2 , 5 ] ) ;
88
88
let e = i16x4:: from ( [ 2 , 3 , 3 , 5 ] ) ;
89
- let r: i16x4 = transmute ( vpmax_s16 ( transmute ( a) , transmute ( b) ) ) ;
89
+ let r: i16x4 = unsafe { transmute ( vpmax_s16 ( transmute ( a) , transmute ( b) ) ) } ;
90
90
assert_eq ! ( r, e) ;
91
91
}
92
92
@@ -95,7 +95,7 @@ unsafe fn test_vpmax_s32() {
95
95
let a = i32x2:: from ( [ 1 , -2 ] ) ;
96
96
let b = i32x2:: from ( [ 0 , 3 ] ) ;
97
97
let e = i32x2:: from ( [ 1 , 3 ] ) ;
98
- let r: i32x2 = transmute ( vpmax_s32 ( transmute ( a) , transmute ( b) ) ) ;
98
+ let r: i32x2 = unsafe { transmute ( vpmax_s32 ( transmute ( a) , transmute ( b) ) ) } ;
99
99
assert_eq ! ( r, e) ;
100
100
}
101
101
@@ -104,7 +104,7 @@ unsafe fn test_vpmax_u8() {
104
104
let a = u8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) ;
105
105
let b = u8x8:: from ( [ 0 , 3 , 2 , 5 , 4 , 7 , 6 , 9 ] ) ;
106
106
let e = u8x8:: from ( [ 2 , 4 , 6 , 8 , 3 , 5 , 7 , 9 ] ) ;
107
- let r: u8x8 = transmute ( vpmax_u8 ( transmute ( a) , transmute ( b) ) ) ;
107
+ let r: u8x8 = unsafe { transmute ( vpmax_u8 ( transmute ( a) , transmute ( b) ) ) } ;
108
108
assert_eq ! ( r, e) ;
109
109
}
110
110
@@ -113,7 +113,7 @@ unsafe fn test_vpmax_u16() {
113
113
let a = u16x4:: from ( [ 1 , 2 , 3 , 4 ] ) ;
114
114
let b = u16x4:: from ( [ 0 , 3 , 2 , 5 ] ) ;
115
115
let e = u16x4:: from ( [ 2 , 4 , 3 , 5 ] ) ;
116
- let r: u16x4 = transmute ( vpmax_u16 ( transmute ( a) , transmute ( b) ) ) ;
116
+ let r: u16x4 = unsafe { transmute ( vpmax_u16 ( transmute ( a) , transmute ( b) ) ) } ;
117
117
assert_eq ! ( r, e) ;
118
118
}
119
119
@@ -122,7 +122,7 @@ unsafe fn test_vpmax_u32() {
122
122
let a = u32x2:: from ( [ 1 , 2 ] ) ;
123
123
let b = u32x2:: from ( [ 0 , 3 ] ) ;
124
124
let e = u32x2:: from ( [ 2 , 3 ] ) ;
125
- let r: u32x2 = transmute ( vpmax_u32 ( transmute ( a) , transmute ( b) ) ) ;
125
+ let r: u32x2 = unsafe { transmute ( vpmax_u32 ( transmute ( a) , transmute ( b) ) ) } ;
126
126
assert_eq ! ( r, e) ;
127
127
}
128
128
@@ -131,55 +131,55 @@ unsafe fn test_vpmax_f32() {
131
131
let a = f32x2:: from ( [ 1. , -2. ] ) ;
132
132
let b = f32x2:: from ( [ 0. , 3. ] ) ;
133
133
let e = f32x2:: from ( [ 1. , 3. ] ) ;
134
- let r: f32x2 = transmute ( vpmax_f32 ( transmute ( a) , transmute ( b) ) ) ;
134
+ let r: f32x2 = unsafe { transmute ( vpmax_f32 ( transmute ( a) , transmute ( b) ) ) } ;
135
135
assert_eq ! ( r, e) ;
136
136
}
137
137
138
138
#[ cfg( target_arch = "aarch64" ) ]
139
139
unsafe fn test_vpadd_s16 ( ) {
140
140
let a = i16x4:: from ( [ 1 , 2 , 3 , 4 ] ) ;
141
141
let b = i16x4:: from ( [ 0 , -1 , -2 , -3 ] ) ;
142
- let r: i16x4 = transmute ( vpadd_s16 ( transmute ( a) , transmute ( b) ) ) ;
142
+ let r: i16x4 = unsafe { transmute ( vpadd_s16 ( transmute ( a) , transmute ( b) ) ) } ;
143
143
let e = i16x4:: from ( [ 3 , 7 , -1 , -5 ] ) ;
144
144
assert_eq ! ( r, e) ;
145
145
}
146
146
#[ cfg( target_arch = "aarch64" ) ]
147
147
unsafe fn test_vpadd_s32 ( ) {
148
148
let a = i32x2:: from ( [ 1 , 2 ] ) ;
149
149
let b = i32x2:: from ( [ 0 , -1 ] ) ;
150
- let r: i32x2 = transmute ( vpadd_s32 ( transmute ( a) , transmute ( b) ) ) ;
150
+ let r: i32x2 = unsafe { transmute ( vpadd_s32 ( transmute ( a) , transmute ( b) ) ) } ;
151
151
let e = i32x2:: from ( [ 3 , -1 ] ) ;
152
152
assert_eq ! ( r, e) ;
153
153
}
154
154
#[ cfg( target_arch = "aarch64" ) ]
155
155
unsafe fn test_vpadd_s8 ( ) {
156
156
let a = i8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) ;
157
157
let b = i8x8:: from ( [ 0 , -1 , -2 , -3 , -4 , -5 , -6 , -7 ] ) ;
158
- let r: i8x8 = transmute ( vpadd_s8 ( transmute ( a) , transmute ( b) ) ) ;
158
+ let r: i8x8 = unsafe { transmute ( vpadd_s8 ( transmute ( a) , transmute ( b) ) ) } ;
159
159
let e = i8x8:: from ( [ 3 , 7 , 11 , 15 , -1 , -5 , -9 , -13 ] ) ;
160
160
assert_eq ! ( r, e) ;
161
161
}
162
162
#[ cfg( target_arch = "aarch64" ) ]
163
163
unsafe fn test_vpadd_u16 ( ) {
164
164
let a = u16x4:: from ( [ 1 , 2 , 3 , 4 ] ) ;
165
165
let b = u16x4:: from ( [ 30 , 31 , 32 , 33 ] ) ;
166
- let r: u16x4 = transmute ( vpadd_u16 ( transmute ( a) , transmute ( b) ) ) ;
166
+ let r: u16x4 = unsafe { transmute ( vpadd_u16 ( transmute ( a) , transmute ( b) ) ) } ;
167
167
let e = u16x4:: from ( [ 3 , 7 , 61 , 65 ] ) ;
168
168
assert_eq ! ( r, e) ;
169
169
}
170
170
#[ cfg( target_arch = "aarch64" ) ]
171
171
unsafe fn test_vpadd_u32 ( ) {
172
172
let a = u32x2:: from ( [ 1 , 2 ] ) ;
173
173
let b = u32x2:: from ( [ 30 , 31 ] ) ;
174
- let r: u32x2 = transmute ( vpadd_u32 ( transmute ( a) , transmute ( b) ) ) ;
174
+ let r: u32x2 = unsafe { transmute ( vpadd_u32 ( transmute ( a) , transmute ( b) ) ) } ;
175
175
let e = u32x2:: from ( [ 3 , 61 ] ) ;
176
176
assert_eq ! ( r, e) ;
177
177
}
178
178
#[ cfg( target_arch = "aarch64" ) ]
179
179
unsafe fn test_vpadd_u8 ( ) {
180
180
let a = u8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) ;
181
181
let b = u8x8:: from ( [ 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 ] ) ;
182
- let r: u8x8 = transmute ( vpadd_u8 ( transmute ( a) , transmute ( b) ) ) ;
182
+ let r: u8x8 = unsafe { transmute ( vpadd_u8 ( transmute ( a) , transmute ( b) ) ) } ;
183
183
let e = u8x8:: from ( [ 3 , 7 , 11 , 15 , 61 , 65 , 69 , 73 ] ) ;
184
184
assert_eq ! ( r, e) ;
185
185
}
@@ -188,7 +188,7 @@ unsafe fn test_vpadd_u8() {
188
188
unsafe fn test_vqsub_u8 ( ) {
189
189
let a = u8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0xff ] ) ;
190
190
let b = u8x8:: from ( [ 30 , 1 , 1 , 1 , 34 , 0xff , 36 , 37 ] ) ;
191
- let r: u8x8 = transmute ( vqsub_u8 ( transmute ( a) , transmute ( b) ) ) ;
191
+ let r: u8x8 = unsafe { transmute ( vqsub_u8 ( transmute ( a) , transmute ( b) ) ) } ;
192
192
let e = u8x8:: from ( [ 0 , 1 , 2 , 3 , 0 , 0 , 0 , 218 ] ) ;
193
193
assert_eq ! ( r, e) ;
194
194
}
@@ -197,7 +197,7 @@ unsafe fn test_vqsub_u8() {
197
197
unsafe fn test_vqadd_u8 ( ) {
198
198
let a = u8x8:: from ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0xff ] ) ;
199
199
let b = u8x8:: from ( [ 30 , 1 , 1 , 1 , 34 , 0xff , 36 , 37 ] ) ;
200
- let r: u8x8 = transmute ( vqadd_u8 ( transmute ( a) , transmute ( b) ) ) ;
200
+ let r: u8x8 = unsafe { transmute ( vqadd_u8 ( transmute ( a) , transmute ( b) ) ) } ;
201
201
let e = u8x8:: from ( [ 31 , 3 , 4 , 5 , 39 , 0xff , 43 , 0xff ] ) ;
202
202
assert_eq ! ( r, e) ;
203
203
}
@@ -208,7 +208,7 @@ unsafe fn test_vmaxq_f32() {
208
208
let a = f32x4:: from ( [ 0. , -1. , 2. , -3. ] ) ;
209
209
let b = f32x4:: from ( [ -4. , 5. , -6. , 7. ] ) ;
210
210
let e = f32x4:: from ( [ 0. , 5. , 2. , 7. ] ) ;
211
- let r: f32x4 = transmute ( vmaxq_f32 ( transmute ( a) , transmute ( b) ) ) ;
211
+ let r: f32x4 = unsafe { transmute ( vmaxq_f32 ( transmute ( a) , transmute ( b) ) ) } ;
212
212
assert_eq ! ( r, e) ;
213
213
}
214
214
@@ -218,7 +218,7 @@ unsafe fn test_vminq_f32() {
218
218
let a = f32x4:: from ( [ 0. , -1. , 2. , -3. ] ) ;
219
219
let b = f32x4:: from ( [ -4. , 5. , -6. , 7. ] ) ;
220
220
let e = f32x4:: from ( [ -4. , -1. , -6. , -3. ] ) ;
221
- let r: f32x4 = transmute ( vminq_f32 ( transmute ( a) , transmute ( b) ) ) ;
221
+ let r: f32x4 = unsafe { transmute ( vminq_f32 ( transmute ( a) , transmute ( b) ) ) } ;
222
222
assert_eq ! ( r, e) ;
223
223
}
224
224
@@ -227,7 +227,7 @@ unsafe fn test_vaddvq_f32() {
227
227
// AArch64 llvm intrinsic: llvm.aarch64.neon.faddv.f32.v4f32
228
228
let a = f32x4:: from ( [ 0. , 1. , 2. , 3. ] ) ;
229
229
let e = 6f32 ;
230
- let r = vaddvq_f32 ( transmute ( a) ) ;
230
+ let r = unsafe { vaddvq_f32 ( transmute ( a) ) } ;
231
231
assert_eq ! ( r, e) ;
232
232
}
233
233
@@ -236,7 +236,7 @@ unsafe fn test_vrndnq_f32() {
236
236
// llvm intrinsic: llvm.roundeven.v4f32
237
237
let a = f32x4:: from ( [ 0.1 , -1.9 , 4.5 , 5.5 ] ) ;
238
238
let e = f32x4:: from ( [ 0. , -2. , 4. , 6. ] ) ;
239
- let r: f32x4 = transmute ( vrndnq_f32 ( transmute ( a) ) ) ;
239
+ let r: f32x4 = unsafe { transmute ( vrndnq_f32 ( transmute ( a) ) ) } ;
240
240
assert_eq ! ( r, e) ;
241
241
}
242
242
0 commit comments