]>
Commit | Line | Data |
---|---|---|
04454e1e FG |
1 | // compile-flags: -C no-prepopulate-passes |
2 | // only-64bit (because the LLVM type of i64 for usize shows up) | |
3 | // | |
4 | ||
5 | #![crate_type = "lib"] | |
6 | #![feature(repr_simd, platform_intrinsics)] | |
7 | ||
8 | extern "platform-intrinsic" { | |
9 | pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T; | |
10 | } | |
11 | ||
12 | /// A vector of *const T. | |
13 | #[derive(Debug, Copy, Clone)] | |
14 | #[repr(simd)] | |
15 | pub struct SimdConstPtr<T, const LANES: usize>([*const T; LANES]); | |
16 | ||
17 | #[derive(Debug, Copy, Clone)] | |
18 | #[repr(simd)] | |
19 | pub struct Simd<T, const LANES: usize>([T; LANES]); | |
20 | ||
21 | // CHECK-LABEL: smoke | |
22 | #[no_mangle] | |
23 | pub fn smoke(ptrs: SimdConstPtr<u8, 8>, offsets: Simd<usize, 8>) -> SimdConstPtr<u8, 8> { | |
923072b8 | 24 | // CHECK: getelementptr i8, <8 x {{i8\*|ptr}}> %_3, <8 x i64> %_4 |
04454e1e FG |
25 | unsafe { simd_arith_offset(ptrs, offsets) } |
26 | } |