Files
rust/tests/codegen-llvm/simd/simd_arith_offset.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
627 B
Rust
Raw Normal View History

2022-04-12 22:25:52 -04:00
//@ compile-flags: -C no-prepopulate-passes
//@ only-64bit (because the LLVM type of i64 for usize shows up)
//
#![crate_type = "lib"]
2025-02-24 18:55:26 +01:00
#![feature(repr_simd, core_intrinsics)]
2022-04-12 22:25:52 -04:00
2025-07-12 02:33:42 -07:00
#[path = "../../auxiliary/minisimd.rs"]
mod minisimd;
use std::intrinsics::simd::simd_arith_offset;
2022-04-12 22:25:52 -04:00
2025-07-12 02:33:42 -07:00
use minisimd::*;
2022-04-12 22:25:52 -04:00
2025-07-12 02:33:42 -07:00
/// A vector of *const T.
pub type SimdConstPtr<T, const LANES: usize> = Simd<*const T, LANES>;
2022-04-12 22:25:52 -04:00
// CHECK-LABEL: smoke
#[no_mangle]
pub fn smoke(ptrs: SimdConstPtr<u8, 8>, offsets: Simd<usize, 8>) -> SimdConstPtr<u8, 8> {
2023-07-27 14:44:13 -07:00
// CHECK: getelementptr i8, <8 x ptr> %0, <8 x i64> %1
2022-04-12 22:25:52 -04:00
unsafe { simd_arith_offset(ptrs, offsets) }
}