@@ -13,194 +13,195 @@ use crate::core_arch::aarch64::*;
1313use crate :: core_arch:: simd:: * ;
1414use std:: mem;
1515use stdarch_test:: simd_test;
16+
1617#[ simd_test( enable = "neon" ) ]
17- unsafe fn test_vld1_s8 ( ) {
18+ fn test_vld1_s8 ( ) {
1819 let a: [ i8 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
1920 let e = i8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
20- let r: i8x8 = transmute ( vld1_s8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
21+ let r = unsafe { i8x8 :: from ( vld1_s8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
2122 assert_eq ! ( r, e)
2223}
2324
2425#[ simd_test( enable = "neon" ) ]
25- unsafe fn test_vld1q_s8 ( ) {
26+ fn test_vld1q_s8 ( ) {
2627 let a: [ i8 ; 17 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ] ;
2728 let e = i8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
28- let r: i8x16 = transmute ( vld1q_s8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
29+ let r = unsafe { i8x16 :: from ( vld1q_s8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
2930 assert_eq ! ( r, e)
3031}
3132
3233#[ simd_test( enable = "neon" ) ]
33- unsafe fn test_vld1_s16 ( ) {
34+ fn test_vld1_s16 ( ) {
3435 let a: [ i16 ; 5 ] = [ 0 , 1 , 2 , 3 , 4 ] ;
3536 let e = i16x4:: new ( 1 , 2 , 3 , 4 ) ;
36- let r: i16x4 = transmute ( vld1_s16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
37+ let r = unsafe { i16x4 :: from ( vld1_s16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
3738 assert_eq ! ( r, e)
3839}
3940
4041#[ simd_test( enable = "neon" ) ]
41- unsafe fn test_vld1q_s16 ( ) {
42+ fn test_vld1q_s16 ( ) {
4243 let a: [ i16 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
4344 let e = i16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
44- let r: i16x8 = transmute ( vld1q_s16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
45+ let r = unsafe { i16x8 :: from ( vld1q_s16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
4546 assert_eq ! ( r, e)
4647}
4748
4849#[ simd_test( enable = "neon" ) ]
49- unsafe fn test_vld1_s32 ( ) {
50+ fn test_vld1_s32 ( ) {
5051 let a: [ i32 ; 3 ] = [ 0 , 1 , 2 ] ;
5152 let e = i32x2:: new ( 1 , 2 ) ;
52- let r: i32x2 = transmute ( vld1_s32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
53+ let r = unsafe { i32x2 :: from ( vld1_s32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
5354 assert_eq ! ( r, e)
5455}
5556
5657#[ simd_test( enable = "neon" ) ]
57- unsafe fn test_vld1q_s32 ( ) {
58+ fn test_vld1q_s32 ( ) {
5859 let a: [ i32 ; 5 ] = [ 0 , 1 , 2 , 3 , 4 ] ;
5960 let e = i32x4:: new ( 1 , 2 , 3 , 4 ) ;
60- let r: i32x4 = transmute ( vld1q_s32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
61+ let r = unsafe { i32x4 :: from ( vld1q_s32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
6162 assert_eq ! ( r, e)
6263}
6364
6465#[ simd_test( enable = "neon" ) ]
65- unsafe fn test_vld1_s64 ( ) {
66+ fn test_vld1_s64 ( ) {
6667 let a: [ i64 ; 2 ] = [ 0 , 1 ] ;
6768 let e = i64x1:: new ( 1 ) ;
68- let r: i64x1 = transmute ( vld1_s64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
69+ let r = unsafe { i64x1 :: from ( vld1_s64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
6970 assert_eq ! ( r, e)
7071}
7172
7273#[ simd_test( enable = "neon" ) ]
73- unsafe fn test_vld1q_s64 ( ) {
74+ fn test_vld1q_s64 ( ) {
7475 let a: [ i64 ; 3 ] = [ 0 , 1 , 2 ] ;
7576 let e = i64x2:: new ( 1 , 2 ) ;
76- let r: i64x2 = transmute ( vld1q_s64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
77+ let r = unsafe { i64x2 :: from ( vld1q_s64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
7778 assert_eq ! ( r, e)
7879}
7980
8081#[ simd_test( enable = "neon" ) ]
81- unsafe fn test_vld1_u8 ( ) {
82+ fn test_vld1_u8 ( ) {
8283 let a: [ u8 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
8384 let e = u8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
84- let r: u8x8 = transmute ( vld1_u8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
85+ let r = unsafe { u8x8 :: from ( vld1_u8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
8586 assert_eq ! ( r, e)
8687}
8788
8889#[ simd_test( enable = "neon" ) ]
89- unsafe fn test_vld1q_u8 ( ) {
90+ fn test_vld1q_u8 ( ) {
9091 let a: [ u8 ; 17 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ] ;
9192 let e = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
92- let r: u8x16 = transmute ( vld1q_u8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
93+ let r = unsafe { u8x16 :: from ( vld1q_u8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
9394 assert_eq ! ( r, e)
9495}
9596
9697#[ simd_test( enable = "neon" ) ]
97- unsafe fn test_vld1_u16 ( ) {
98+ fn test_vld1_u16 ( ) {
9899 let a: [ u16 ; 5 ] = [ 0 , 1 , 2 , 3 , 4 ] ;
99100 let e = u16x4:: new ( 1 , 2 , 3 , 4 ) ;
100- let r: u16x4 = transmute ( vld1_u16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
101+ let r = unsafe { u16x4 :: from ( vld1_u16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
101102 assert_eq ! ( r, e)
102103}
103104
104105#[ simd_test( enable = "neon" ) ]
105- unsafe fn test_vld1q_u16 ( ) {
106+ fn test_vld1q_u16 ( ) {
106107 let a: [ u16 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
107108 let e = u16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
108- let r: u16x8 = transmute ( vld1q_u16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
109+ let r = unsafe { u16x8 :: from ( vld1q_u16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
109110 assert_eq ! ( r, e)
110111}
111112
112113#[ simd_test( enable = "neon" ) ]
113- unsafe fn test_vld1_u32 ( ) {
114+ fn test_vld1_u32 ( ) {
114115 let a: [ u32 ; 3 ] = [ 0 , 1 , 2 ] ;
115116 let e = u32x2:: new ( 1 , 2 ) ;
116- let r: u32x2 = transmute ( vld1_u32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
117+ let r = unsafe { u32x2 :: from ( vld1_u32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
117118 assert_eq ! ( r, e)
118119}
119120
120121#[ simd_test( enable = "neon" ) ]
121- unsafe fn test_vld1q_u32 ( ) {
122+ fn test_vld1q_u32 ( ) {
122123 let a: [ u32 ; 5 ] = [ 0 , 1 , 2 , 3 , 4 ] ;
123124 let e = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
124- let r: u32x4 = transmute ( vld1q_u32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
125+ let r = unsafe { u32x4 :: from ( vld1q_u32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
125126 assert_eq ! ( r, e)
126127}
127128
128129#[ simd_test( enable = "neon" ) ]
129- unsafe fn test_vld1_u64 ( ) {
130+ fn test_vld1_u64 ( ) {
130131 let a: [ u64 ; 2 ] = [ 0 , 1 ] ;
131132 let e = u64x1:: new ( 1 ) ;
132- let r: u64x1 = transmute ( vld1_u64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
133+ let r = unsafe { u64x1 :: from ( vld1_u64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
133134 assert_eq ! ( r, e)
134135}
135136
136137#[ simd_test( enable = "neon" ) ]
137- unsafe fn test_vld1q_u64 ( ) {
138+ fn test_vld1q_u64 ( ) {
138139 let a: [ u64 ; 3 ] = [ 0 , 1 , 2 ] ;
139140 let e = u64x2:: new ( 1 , 2 ) ;
140- let r: u64x2 = transmute ( vld1q_u64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
141+ let r = unsafe { u64x2 :: from ( vld1q_u64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
141142 assert_eq ! ( r, e)
142143}
143144
144145#[ simd_test( enable = "neon" ) ]
145- unsafe fn test_vld1_p8 ( ) {
146+ fn test_vld1_p8 ( ) {
146147 let a: [ p8 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
147148 let e = u8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
148- let r: u8x8 = transmute ( vld1_p8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
149+ let r = unsafe { u8x8 :: from ( vld1_p8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
149150 assert_eq ! ( r, e)
150151}
151152
152153#[ simd_test( enable = "neon" ) ]
153- unsafe fn test_vld1q_p8 ( ) {
154+ fn test_vld1q_p8 ( ) {
154155 let a: [ p8 ; 17 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ] ;
155156 let e = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
156- let r: u8x16 = transmute ( vld1q_p8 ( a[ 1 ..] . as_ptr ( ) ) ) ;
157+ let r = unsafe { u8x16 :: from ( vld1q_p8 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
157158 assert_eq ! ( r, e)
158159}
159160
160161#[ simd_test( enable = "neon" ) ]
161- unsafe fn test_vld1_p16 ( ) {
162+ fn test_vld1_p16 ( ) {
162163 let a: [ p16 ; 5 ] = [ 0 , 1 , 2 , 3 , 4 ] ;
163164 let e = u16x4:: new ( 1 , 2 , 3 , 4 ) ;
164- let r: u16x4 = transmute ( vld1_p16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
165+ let r = unsafe { u16x4 :: from ( vld1_p16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
165166 assert_eq ! ( r, e)
166167}
167168
168169#[ simd_test( enable = "neon" ) ]
169- unsafe fn test_vld1q_p16 ( ) {
170+ fn test_vld1q_p16 ( ) {
170171 let a: [ p16 ; 9 ] = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
171172 let e = u16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
172- let r: u16x8 = transmute ( vld1q_p16 ( a[ 1 ..] . as_ptr ( ) ) ) ;
173+ let r = unsafe { u16x8 :: from ( vld1q_p16 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
173174 assert_eq ! ( r, e)
174175}
175176
176177#[ simd_test( enable = "neon,aes" ) ]
177- unsafe fn test_vld1_p64 ( ) {
178+ fn test_vld1_p64 ( ) {
178179 let a: [ p64 ; 2 ] = [ 0 , 1 ] ;
179180 let e = u64x1:: new ( 1 ) ;
180- let r: u64x1 = transmute ( vld1_p64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
181+ let r = unsafe { u64x1 :: from ( vld1_p64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
181182 assert_eq ! ( r, e)
182183}
183184
184185#[ simd_test( enable = "neon,aes" ) ]
185- unsafe fn test_vld1q_p64 ( ) {
186+ fn test_vld1q_p64 ( ) {
186187 let a: [ p64 ; 3 ] = [ 0 , 1 , 2 ] ;
187188 let e = u64x2:: new ( 1 , 2 ) ;
188- let r: u64x2 = transmute ( vld1q_p64 ( a[ 1 ..] . as_ptr ( ) ) ) ;
189+ let r = unsafe { u64x2 :: from ( vld1q_p64 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
189190 assert_eq ! ( r, e)
190191}
191192
192193#[ simd_test( enable = "neon" ) ]
193- unsafe fn test_vld1_f32 ( ) {
194+ fn test_vld1_f32 ( ) {
194195 let a: [ f32 ; 3 ] = [ 0. , 1. , 2. ] ;
195196 let e = f32x2:: new ( 1. , 2. ) ;
196- let r: f32x2 = transmute ( vld1_f32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
197+ let r = unsafe { f32x2 :: from ( vld1_f32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
197198 assert_eq ! ( r, e)
198199}
199200
200201#[ simd_test( enable = "neon" ) ]
201- unsafe fn test_vld1q_f32 ( ) {
202+ fn test_vld1q_f32 ( ) {
202203 let a: [ f32 ; 5 ] = [ 0. , 1. , 2. , 3. , 4. ] ;
203204 let e = f32x4:: new ( 1. , 2. , 3. , 4. ) ;
204- let r: f32x4 = transmute ( vld1q_f32 ( a[ 1 ..] . as_ptr ( ) ) ) ;
205+ let r = unsafe { f32x4 :: from ( vld1q_f32 ( a[ 1 ..] . as_ptr ( ) ) ) } ;
205206 assert_eq ! ( r, e)
206207}
0 commit comments