-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Expand file tree
/
Copy pathsimd-abi-checks-s390x.rs
More file actions
156 lines (145 loc) · 4.5 KB
/
simd-abi-checks-s390x.rs
File metadata and controls
156 lines (145 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//@ add-core-stubs
//@ revisions: z10 z13_no_vector z13_soft_float
//@ build-fail
//@[z10] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10
//@[z10] needs-llvm-components: systemz
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector
//@[z13_no_vector] needs-llvm-components: systemz
// FIXME: +soft-float itself doesn't set -vector
//@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float
//@[z13_soft_float] needs-llvm-components: systemz
#![feature(no_core, repr_simd, s390x_target_feature)]
#![no_core]
#![crate_type = "lib"]
#![allow(non_camel_case_types, improper_ctypes_definitions)]
extern crate minicore;
use minicore::*;
#[repr(simd)]
pub struct i8x8([i8; 8]);
#[repr(simd)]
pub struct i8x16([i8; 16]);
#[repr(simd)]
pub struct i8x32([i8; 32]);
#[repr(C)]
pub struct Wrapper<T>(T);
#[repr(transparent)]
pub struct TransparentWrapper<T>(T);
impl Copy for i8x8 {}
impl Copy for i8x16 {}
impl Copy for i8x32 {}
impl<T: Copy> Copy for Wrapper<T> {}
impl<T: Copy> Copy for TransparentWrapper<T> {}
#[no_mangle]
extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
//~^ ERROR requires the `vector` target feature, which is not enabled
*x
}
#[no_mangle]
extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
//~^ ERROR requires the `vector` target feature, which is not enabled
*x
}
#[no_mangle]
extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 {
// Ok
*x
}
#[no_mangle]
#[target_feature(enable = "vector")]
unsafe extern "C" fn vector_ret_target_feature_small(x: &i8x8) -> i8x8 {
// Ok
*x
}
#[no_mangle]
#[target_feature(enable = "vector")]
unsafe extern "C" fn vector_target_feature_ret(x: &i8x16) -> i8x16 {
// Ok
*x
}
#[no_mangle]
#[target_feature(enable = "vector")]
unsafe extern "C" fn vector_ret_target_feature_large(x: &i8x32) -> i8x32 {
// Ok
*x
}
#[no_mangle]
extern "C" fn vector_wrapper_ret_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> {
// Ok
*x
}
#[no_mangle]
extern "C" fn vector_wrapper_ret(x: &Wrapper<i8x16>) -> Wrapper<i8x16> {
// Ok
*x
}
#[no_mangle]
extern "C" fn vector_wrapper_ret_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> {
// Ok
*x
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_ret_small(
x: &TransparentWrapper<i8x8>,
) -> TransparentWrapper<i8x8> {
//~^^^ ERROR requires the `vector` target feature, which is not enabled
*x
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_ret(
x: &TransparentWrapper<i8x16>,
) -> TransparentWrapper<i8x16> {
//~^^^ ERROR requires the `vector` target feature, which is not enabled
*x
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_ret_large(
x: &TransparentWrapper<i8x32>,
) -> TransparentWrapper<i8x32> {
// Ok
*x
}
#[no_mangle]
extern "C" fn vector_arg_small(x: i8x8) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const i8x8 as *const i64) }
}
#[no_mangle]
extern "C" fn vector_arg(x: i8x16) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const i8x16 as *const i64) }
}
#[no_mangle]
extern "C" fn vector_arg_large(x: i8x32) -> i64 {
// Ok
unsafe { *(&x as *const i8x32 as *const i64) }
}
#[no_mangle]
extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const Wrapper<i8x8> as *const i64) }
}
#[no_mangle]
extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const Wrapper<i8x16> as *const i64) }
}
#[no_mangle]
extern "C" fn vector_wrapper_arg_large(x: Wrapper<i8x32>) -> i64 {
// Ok
unsafe { *(&x as *const Wrapper<i8x32> as *const i64) }
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const TransparentWrapper<i8x8> as *const i64) }
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
//~^ ERROR requires the `vector` target feature, which is not enabled
unsafe { *(&x as *const TransparentWrapper<i8x16> as *const i64) }
}
#[no_mangle]
extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper<i8x32>) -> i64 {
// Ok
unsafe { *(&x as *const TransparentWrapper<i8x32> as *const i64) }
}