Revert non-power-of-two vector restriction
This commit is contained in:
parent
4f20caa625
commit
79c5fa1f0c
|
@ -732,11 +732,6 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
|||
// Can't be caught in typeck if the array length is generic.
|
||||
if e_len == 0 {
|
||||
tcx.sess.fatal(&format!("monomorphising SIMD type `{}` of zero length", ty));
|
||||
} else if !e_len.is_power_of_two() {
|
||||
tcx.sess.fatal(&format!(
|
||||
"monomorphising SIMD type `{}` of non-power-of-two length",
|
||||
ty
|
||||
));
|
||||
} else if e_len > MAX_SIMD_LANES {
|
||||
tcx.sess.fatal(&format!(
|
||||
"monomorphising SIMD type `{}` of length greater than {}",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// run-pass
|
||||
#![feature(repr_simd)]
|
||||
|
||||
#[repr(simd)]
|
||||
struct T(f64, f64, f64);
|
||||
//~^ ERROR SIMD vector length must be a power of two
|
||||
|
||||
static X: T = T(0.0, 0.0, 0.0);
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
error[E0075]: SIMD vector length must be a power of two
|
||||
--> $DIR/issue-17170.rs:4:1
|
||||
|
|
||||
LL | struct T(f64, f64, f64);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: monomorphising SIMD type `T` of non-power-of-two length
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0075`.
|
|
@ -1,3 +1,4 @@
|
|||
// run-pass
|
||||
// ignore-emscripten FIXME(#45351)
|
||||
|
||||
#![feature(repr_simd, platform_intrinsics)]
|
||||
|
@ -5,12 +6,10 @@
|
|||
#[repr(simd)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct Char3(pub i8, pub i8, pub i8);
|
||||
//~^ ERROR SIMD vector length must be a power of two
|
||||
|
||||
#[repr(simd)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct Short3(pub i16, pub i16, pub i16);
|
||||
//~^ ERROR SIMD vector length must be a power of two
|
||||
|
||||
extern "platform-intrinsic" {
|
||||
fn simd_cast<T, U>(x: T) -> U;
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
error[E0075]: SIMD vector length must be a power of two
|
||||
--> $DIR/issue-39720.rs:7:1
|
||||
|
|
||||
LL | pub struct Char3(pub i8, pub i8, pub i8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0075]: SIMD vector length must be a power of two
|
||||
--> $DIR/issue-39720.rs:12:1
|
||||
|
|
||||
LL | pub struct Short3(pub i16, pub i16, pub i16);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0075`.
|
|
@ -10,12 +10,6 @@ error[E0075]: SIMD vector cannot be empty
|
|||
LL | struct empty2([f32; 0]);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0075]: SIMD vector length must be a power of two
|
||||
--> $DIR/simd-type.rs:13:1
|
||||
|
|
||||
LL | struct pow2([f32; 7]);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0076]: SIMD vector should be homogeneous
|
||||
--> $DIR/simd-type.rs:16:1
|
||||
|
|
||||
|
|
Loading…
Reference in New Issue