You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![feature(repr_simd)]#[repr(simd)]structA(isize,isize);// ERROR#[cfg(target_pointer_width = "64")]typeisize_ = i64;#[cfg(target_pointer_width = "32")]typeisize_ = i32;#[repr(simd)]structB(isize_,isize_);// Q: Is this ok?
produces
error[E0077]: SIMD vector element type should be machine type
--> src/main.rs:3:15
|
3 | #[repr(simd)] struct A(isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
I am wondering why aren't isize and usize allowed ? I currently work around this to implement simd vectors of pointers, but maybe that's broken for reason I don't understand?
The text was updated successfully, but these errors were encountered:
I think this can be made a thing (size type variables are just differences in memory addresses under the hood, after all), but the better question is if it should. In particular, what are the use cases of performing bulk arithmetic operations on structs of size types?
what are the use cases of performing bulk arithmetic operations on size type structs?
The same as for normal pointers:
// vector of pointers#[repr(simd)]structx2<T>(T,T);typeconst_ptr_x2 = x2<*constT>;let a = const_ptr_x2(...);let b = const_ptr_x2(...);let c: ??? = a - b;/// ??? should be a vector of isizelet d: ??? = ???(...);// wrapping_add takes a vector of usizelet e = a.wrapping_add(d);
Centril
added
the
T-lang
Relevant to the language team, which will review and decide on the RFC.
label
Oct 14, 2018
Repro (playground: https://play.rust-lang.org/?gist=efa6e5caf752ccca651014ae5009feb8&version=nightly&mode=debug&edition=2015):
produces
I am wondering why aren't
isize
andusize
allowed ? I currently work around this to implement simd vectors of pointers, but maybe that's broken for reason I don't understand?The text was updated successfully, but these errors were encountered: