2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2018-03-16 18:42:42 +00:00
|
|
|
|
2025-02-24 16:26:56 +00:00
|
|
|
#![feature(repr_simd, core_intrinsics)]
|
2017-07-25 02:31:59 +00:00
|
|
|
|
|
|
|
#[repr(simd)]
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
2024-08-22 08:28:20 +00:00
|
|
|
pub struct Char3(pub [i8; 3]);
|
2017-07-25 02:31:59 +00:00
|
|
|
|
|
|
|
#[repr(simd)]
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
2024-08-22 08:28:20 +00:00
|
|
|
pub struct Short3(pub [i16; 3]);
|
2017-07-25 02:31:59 +00:00
|
|
|
|
|
|
|
fn main() {
|
2025-02-24 16:26:56 +00:00
|
|
|
let cast: Short3 = unsafe { std::intrinsics::simd::simd_cast(Char3([10, -3, -9])) };
|
2017-07-25 02:31:59 +00:00
|
|
|
|
|
|
|
println!("{:?}", cast);
|
|
|
|
}
|