1- //@ revisions: s390x
1+ //@ revisions: s390x s390x_vector
22//@ assembly-output: emit-asm
33//@[s390x] compile-flags: --target s390x-unknown-linux-gnu
44//@[s390x] needs-llvm-components: systemz
5+ //@[s390x_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector
6+ //@[s390x_vector] needs-llvm-components: systemz
57//@ compile-flags: -Zmerge-functions=disabled
68
7- #![ feature( no_core, lang_items, rustc_attrs, repr_simd) ]
9+ #![ feature( no_core, lang_items, rustc_attrs, repr_simd, f128 ) ]
810#![ crate_type = "rlib" ]
911#![ no_core]
1012#![ allow( asm_sub_register, non_camel_case_types) ]
@@ -27,16 +29,38 @@ trait Sized {}
2729#[ lang = "copy" ]
2830trait Copy { }
2931
32+ impl < T : Copy , const N : usize > Copy for [ T ; N ] { }
33+
3034type ptr = * const i32 ;
3135
36+ #[ repr( simd) ]
37+ pub struct i8x16 ( [ i8 ; 16 ] ) ;
38+ #[ repr( simd) ]
39+ pub struct i16x8 ( [ i16 ; 8 ] ) ;
40+ #[ repr( simd) ]
41+ pub struct i32x4 ( [ i32 ; 4 ] ) ;
42+ #[ repr( simd) ]
43+ pub struct i64x2 ( [ i64 ; 2 ] ) ;
44+ #[ repr( simd) ]
45+ pub struct f32x4 ( [ f32 ; 4 ] ) ;
46+ #[ repr( simd) ]
47+ pub struct f64x2 ( [ f64 ; 2 ] ) ;
48+
3249impl Copy for i8 { }
3350impl Copy for u8 { }
3451impl Copy for i16 { }
3552impl Copy for i32 { }
3653impl Copy for i64 { }
3754impl Copy for f32 { }
3855impl Copy for f64 { }
56+ impl Copy for f128 { }
3957impl Copy for ptr { }
58+ impl Copy for i8x16 { }
59+ impl Copy for i16x8 { }
60+ impl Copy for i32x4 { }
61+ impl Copy for i64x2 { }
62+ impl Copy for f32x4 { }
63+ impl Copy for f64x2 { }
4064
4165extern "C" {
4266 fn extern_func ( ) ;
@@ -65,7 +89,6 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => {
6589// CHECK: #APP
6690// CHECK: brasl %r14, extern_func
6791// CHECK: #NO_APP
68- #[ cfg( s390x) ]
6992#[ no_mangle]
7093pub unsafe fn sym_fn_32 ( ) {
7194 asm ! ( "brasl %r14, {}" , sym extern_func) ;
@@ -146,6 +169,69 @@ check!(reg_f64, f64, freg, "ldr");
146169// CHECK: #NO_APP
147170check ! ( reg_ptr, ptr, reg, "lgr" ) ;
148171
172+ // s390x_vector-LABEL: vreg_i8x16:
173+ // s390x_vector: #APP
174+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
175+ // s390x_vector: #NO_APP
176+ #[ cfg( s390x_vector) ]
177+ check ! ( vreg_i8x16, i8x16, vreg, "vlr" ) ;
178+
179+ // s390x_vector-LABEL: vreg_i16x8:
180+ // s390x_vector: #APP
181+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
182+ // s390x_vector: #NO_APP
183+ #[ cfg( s390x_vector) ]
184+ check ! ( vreg_i16x8, i16x8, vreg, "vlr" ) ;
185+
186+ // s390x_vector-LABEL: vreg_i32x4:
187+ // s390x_vector: #APP
188+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
189+ // s390x_vector: #NO_APP
190+ #[ cfg( s390x_vector) ]
191+ check ! ( vreg_i32x4, i32x4, vreg, "vlr" ) ;
192+
193+ // s390x_vector-LABEL: vreg_i64x2:
194+ // s390x_vector: #APP
195+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
196+ // s390x_vector: #NO_APP
197+ #[ cfg( s390x_vector) ]
198+ check ! ( vreg_i64x2, i64x2, vreg, "vlr" ) ;
199+
200+ // s390x_vector-LABEL: vreg_f32x4:
201+ // s390x_vector: #APP
202+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
203+ // s390x_vector: #NO_APP
204+ #[ cfg( s390x_vector) ]
205+ check ! ( vreg_f32x4, f32x4, vreg, "vlr" ) ;
206+
207+ // s390x_vector-LABEL: vreg_f64x2:
208+ // s390x_vector: #APP
209+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
210+ // s390x_vector: #NO_APP
211+ #[ cfg( s390x_vector) ]
212+ check ! ( vreg_f64x2, f64x2, vreg, "vlr" ) ;
213+
214+ // s390x_vector-LABEL: vreg_f32:
215+ // s390x_vector: #APP
216+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
217+ // s390x_vector: #NO_APP
218+ #[ cfg( s390x_vector) ]
219+ check ! ( vreg_f32, f32 , vreg, "vlr" ) ;
220+
221+ // s390x_vector-LABEL: vreg_f64:
222+ // s390x_vector: #APP
223+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
224+ // s390x_vector: #NO_APP
225+ #[ cfg( s390x_vector) ]
226+ check ! ( vreg_f64, f64 , vreg, "vlr" ) ;
227+
228+ // s390x_vector-LABEL: vreg_f128:
229+ // s390x_vector: #APP
230+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
231+ // s390x_vector: #NO_APP
232+ #[ cfg( s390x_vector) ]
233+ check ! ( vreg_f128, f128, vreg, "vlr" ) ;
234+
149235// CHECK-LABEL: r0_i8:
150236// CHECK: #APP
151237// CHECK: lr %r0, %r0
@@ -181,3 +267,66 @@ check_reg!(f0_f32, f32, "f0", "ler");
181267// CHECK: ldr %f0, %f0
182268// CHECK: #NO_APP
183269check_reg ! ( f0_f64, f64 , "f0" , "ldr" ) ;
270+
271+ // s390x_vector-LABEL: v0_i8x16:
272+ // s390x_vector: #APP
273+ // s390x_vector: vlr %v0, %v0
274+ // s390x_vector: #NO_APP
275+ #[ cfg( s390x_vector) ]
276+ check_reg ! ( v0_i8x16, i8x16, "v0" , "vlr" ) ;
277+
278+ // s390x_vector-LABEL: v0_i16x8:
279+ // s390x_vector: #APP
280+ // s390x_vector: vlr %v0, %v0
281+ // s390x_vector: #NO_APP
282+ #[ cfg( s390x_vector) ]
283+ check_reg ! ( v0_i16x8, i16x8, "v0" , "vlr" ) ;
284+
285+ // s390x_vector-LABEL: v0_i32x4:
286+ // s390x_vector: #APP
287+ // s390x_vector: vlr %v0, %v0
288+ // s390x_vector: #NO_APP
289+ #[ cfg( s390x_vector) ]
290+ check_reg ! ( v0_i32x4, i32x4, "v0" , "vlr" ) ;
291+
292+ // s390x_vector-LABEL: v0_i64x2:
293+ // s390x_vector: #APP
294+ // s390x_vector: vlr %v0, %v0
295+ // s390x_vector: #NO_APP
296+ #[ cfg( s390x_vector) ]
297+ check_reg ! ( v0_i64x2, i64x2, "v0" , "vlr" ) ;
298+
299+ // s390x_vector-LABEL: v0_f32x4:
300+ // s390x_vector: #APP
301+ // s390x_vector: vlr %v0, %v0
302+ // s390x_vector: #NO_APP
303+ #[ cfg( s390x_vector) ]
304+ check_reg ! ( v0_f32x4, f32x4, "v0" , "vlr" ) ;
305+
306+ // s390x_vector-LABEL: v0_f64x2:
307+ // s390x_vector: #APP
308+ // s390x_vector: vlr %v0, %v0
309+ // s390x_vector: #NO_APP
310+ #[ cfg( s390x_vector) ]
311+ check_reg ! ( v0_f64x2, f64x2, "v0" , "vlr" ) ;
312+
313+ // s390x_vector-LABEL: v0_f32:
314+ // s390x_vector: #APP
315+ // s390x_vector: vlr %v0, %v0
316+ // s390x_vector: #NO_APP
317+ #[ cfg( s390x_vector) ]
318+ check_reg ! ( v0_f32, f32 , "v0" , "vlr" ) ;
319+
320+ // s390x_vector-LABEL: v0_f64:
321+ // s390x_vector: #APP
322+ // s390x_vector: vlr %v0, %v0
323+ // s390x_vector: #NO_APP
324+ #[ cfg( s390x_vector) ]
325+ check_reg ! ( v0_f64, f64 , "v0" , "vlr" ) ;
326+
327+ // s390x_vector-LABEL: v0_f128:
328+ // s390x_vector: #APP
329+ // s390x_vector: vlr %v0, %v0
330+ // s390x_vector: #NO_APP
331+ #[ cfg( s390x_vector) ]
332+ check_reg ! ( v0_f128, f128, "v0" , "vlr" ) ;
0 commit comments