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,39 @@ 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 { }
54+ impl Copy for i128 { }
3755impl Copy for f32 { }
3856impl Copy for f64 { }
57+ impl Copy for f128 { }
3958impl Copy for ptr { }
59+ impl Copy for i8x16 { }
60+ impl Copy for i16x8 { }
61+ impl Copy for i32x4 { }
62+ impl Copy for i64x2 { }
63+ impl Copy for f32x4 { }
64+ impl Copy for f64x2 { }
4065
4166extern "C" {
4267 fn extern_func ( ) ;
@@ -65,7 +90,6 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => {
6590// CHECK: #APP
6691// CHECK: brasl %r14, extern_func
6792// CHECK: #NO_APP
68- #[ cfg( s390x) ]
6993#[ no_mangle]
7094pub unsafe fn sym_fn_32 ( ) {
7195 asm ! ( "brasl %r14, {}" , sym extern_func) ;
@@ -146,6 +170,90 @@ check!(reg_f64, f64, freg, "ldr");
146170// CHECK: #NO_APP
147171check ! ( reg_ptr, ptr, reg, "lgr" ) ;
148172
173+ // s390x_vector-LABEL: vreg_i8x16:
174+ // s390x_vector: #APP
175+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
176+ // s390x_vector: #NO_APP
177+ #[ cfg( s390x_vector) ]
178+ check ! ( vreg_i8x16, i8x16, vreg, "vlr" ) ;
179+
180+ // s390x_vector-LABEL: vreg_i16x8:
181+ // s390x_vector: #APP
182+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
183+ // s390x_vector: #NO_APP
184+ #[ cfg( s390x_vector) ]
185+ check ! ( vreg_i16x8, i16x8, vreg, "vlr" ) ;
186+
187+ // s390x_vector-LABEL: vreg_i32x4:
188+ // s390x_vector: #APP
189+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
190+ // s390x_vector: #NO_APP
191+ #[ cfg( s390x_vector) ]
192+ check ! ( vreg_i32x4, i32x4, vreg, "vlr" ) ;
193+
194+ // s390x_vector-LABEL: vreg_i64x2:
195+ // s390x_vector: #APP
196+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
197+ // s390x_vector: #NO_APP
198+ #[ cfg( s390x_vector) ]
199+ check ! ( vreg_i64x2, i64x2, vreg, "vlr" ) ;
200+
201+ // s390x_vector-LABEL: vreg_f32x4:
202+ // s390x_vector: #APP
203+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
204+ // s390x_vector: #NO_APP
205+ #[ cfg( s390x_vector) ]
206+ check ! ( vreg_f32x4, f32x4, vreg, "vlr" ) ;
207+
208+ // s390x_vector-LABEL: vreg_f64x2:
209+ // s390x_vector: #APP
210+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
211+ // s390x_vector: #NO_APP
212+ #[ cfg( s390x_vector) ]
213+ check ! ( vreg_f64x2, f64x2, vreg, "vlr" ) ;
214+
215+ // s390x_vector-LABEL: vreg_i32:
216+ // s390x_vector: #APP
217+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
218+ // s390x_vector: #NO_APP
219+ #[ cfg( s390x_vector) ]
220+ check ! ( vreg_i32, i32 , vreg, "vlr" ) ;
221+
222+ // s390x_vector-LABEL: vreg_i64:
223+ // s390x_vector: #APP
224+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
225+ // s390x_vector: #NO_APP
226+ #[ cfg( s390x_vector) ]
227+ check ! ( vreg_i64, i64 , vreg, "vlr" ) ;
228+
229+ // s390x_vector-LABEL: vreg_i128:
230+ // s390x_vector: #APP
231+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
232+ // s390x_vector: #NO_APP
233+ #[ cfg( s390x_vector) ]
234+ check ! ( vreg_i128, i128 , vreg, "vlr" ) ;
235+
236+ // s390x_vector-LABEL: vreg_f32:
237+ // s390x_vector: #APP
238+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
239+ // s390x_vector: #NO_APP
240+ #[ cfg( s390x_vector) ]
241+ check ! ( vreg_f32, f32 , vreg, "vlr" ) ;
242+
243+ // s390x_vector-LABEL: vreg_f64:
244+ // s390x_vector: #APP
245+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
246+ // s390x_vector: #NO_APP
247+ #[ cfg( s390x_vector) ]
248+ check ! ( vreg_f64, f64 , vreg, "vlr" ) ;
249+
250+ // s390x_vector-LABEL: vreg_f128:
251+ // s390x_vector: #APP
252+ // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}}
253+ // s390x_vector: #NO_APP
254+ #[ cfg( s390x_vector) ]
255+ check ! ( vreg_f128, f128, vreg, "vlr" ) ;
256+
149257// CHECK-LABEL: r0_i8:
150258// CHECK: #APP
151259// CHECK: lr %r0, %r0
@@ -181,3 +289,87 @@ check_reg!(f0_f32, f32, "f0", "ler");
181289// CHECK: ldr %f0, %f0
182290// CHECK: #NO_APP
183291check_reg ! ( f0_f64, f64 , "f0" , "ldr" ) ;
292+
293+ // s390x_vector-LABEL: v0_i8x16:
294+ // s390x_vector: #APP
295+ // s390x_vector: vlr %v0, %v0
296+ // s390x_vector: #NO_APP
297+ #[ cfg( s390x_vector) ]
298+ check_reg ! ( v0_i8x16, i8x16, "v0" , "vlr" ) ;
299+
300+ // s390x_vector-LABEL: v0_i16x8:
301+ // s390x_vector: #APP
302+ // s390x_vector: vlr %v0, %v0
303+ // s390x_vector: #NO_APP
304+ #[ cfg( s390x_vector) ]
305+ check_reg ! ( v0_i16x8, i16x8, "v0" , "vlr" ) ;
306+
307+ // s390x_vector-LABEL: v0_i32x4:
308+ // s390x_vector: #APP
309+ // s390x_vector: vlr %v0, %v0
310+ // s390x_vector: #NO_APP
311+ #[ cfg( s390x_vector) ]
312+ check_reg ! ( v0_i32x4, i32x4, "v0" , "vlr" ) ;
313+
314+ // s390x_vector-LABEL: v0_i64x2:
315+ // s390x_vector: #APP
316+ // s390x_vector: vlr %v0, %v0
317+ // s390x_vector: #NO_APP
318+ #[ cfg( s390x_vector) ]
319+ check_reg ! ( v0_i64x2, i64x2, "v0" , "vlr" ) ;
320+
321+ // s390x_vector-LABEL: v0_f32x4:
322+ // s390x_vector: #APP
323+ // s390x_vector: vlr %v0, %v0
324+ // s390x_vector: #NO_APP
325+ #[ cfg( s390x_vector) ]
326+ check_reg ! ( v0_f32x4, f32x4, "v0" , "vlr" ) ;
327+
328+ // s390x_vector-LABEL: v0_f64x2:
329+ // s390x_vector: #APP
330+ // s390x_vector: vlr %v0, %v0
331+ // s390x_vector: #NO_APP
332+ #[ cfg( s390x_vector) ]
333+ check_reg ! ( v0_f64x2, f64x2, "v0" , "vlr" ) ;
334+
335+ // s390x_vector-LABEL: v0_i32:
336+ // s390x_vector: #APP
337+ // s390x_vector: vlr %v0, %v0
338+ // s390x_vector: #NO_APP
339+ #[ cfg( s390x_vector) ]
340+ check_reg ! ( v0_i32, i32 , "v0" , "vlr" ) ;
341+
342+ // s390x_vector-LABEL: v0_i64:
343+ // s390x_vector: #APP
344+ // s390x_vector: vlr %v0, %v0
345+ // s390x_vector: #NO_APP
346+ #[ cfg( s390x_vector) ]
347+ check_reg ! ( v0_i64, i64 , "v0" , "vlr" ) ;
348+
349+ // s390x_vector-LABEL: v0_i128:
350+ // s390x_vector: #APP
351+ // s390x_vector: vlr %v0, %v0
352+ // s390x_vector: #NO_APP
353+ #[ cfg( s390x_vector) ]
354+ check_reg ! ( v0_i128, i128 , "v0" , "vlr" ) ;
355+
356+ // s390x_vector-LABEL: v0_f32:
357+ // s390x_vector: #APP
358+ // s390x_vector: vlr %v0, %v0
359+ // s390x_vector: #NO_APP
360+ #[ cfg( s390x_vector) ]
361+ check_reg ! ( v0_f32, f32 , "v0" , "vlr" ) ;
362+
363+ // s390x_vector-LABEL: v0_f64:
364+ // s390x_vector: #APP
365+ // s390x_vector: vlr %v0, %v0
366+ // s390x_vector: #NO_APP
367+ #[ cfg( s390x_vector) ]
368+ check_reg ! ( v0_f64, f64 , "v0" , "vlr" ) ;
369+
370+ // s390x_vector-LABEL: v0_f128:
371+ // s390x_vector: #APP
372+ // s390x_vector: vlr %v0, %v0
373+ // s390x_vector: #NO_APP
374+ #[ cfg( s390x_vector) ]
375+ check_reg ! ( v0_f128, f128, "v0" , "vlr" ) ;
0 commit comments