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
use core::arch::x86_64::*;#[target_feature(enable = "sse2")]pubunsafefnis_ascii_sse2(a:&[u8;16]) -> bool{let a = _mm_loadu_si128(a.as_ptr().cast());let m = _mm_movemask_epi8(a);
m == 0}fnmain(){assert!(cfg!(target_feature = "sse2"));let s = b"helloworld123456";assert!(unsafe{ is_ascii_sse2(s)});}
error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits
--> /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:1381:5
|
1381 | simd_bitmask::<_, u16>(a.as_i8x16()) as u32 as i32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `std::arch::x86_64::_mm_movemask_epi8` at /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:1381:5
note: inside `is_ascii_sse2` at src/main.rs:6:13
Sorry for the naive question, but I still have this issue on nightly:
MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-measureme=crox" cargo +nightly miri run
Preparing a sysroot for Miri (target: x86_64-apple-darwin)... done
Finished dev [unoptimized + debuginfo] target(s) in 0.48s
Running `/Users/yannsimon/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo-miri runner target/miri/x86_64-apple-darwin/debug/proto_refexp`
error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits
--> /Users/yannsimon/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/avx2.rs:2004:5
|
2004 | simd_bitmask::<_, u32>(a.as_i8x32()) as i32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits
I don't know if you can help in the rust PR.
It seems that there is a new feature tag:
error: the feature named `gfni` is not valid for this target
--> library/core/src/../../stdarch/crates/core_arch/src/x86/gfni.rs:68:18
|
68 | #[target_feature(enable = "gfni,avx512bw,avx512f")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `gfni` is not valid for this target
Activity
Amanieu commentedon Oct 26, 2022
I commented on the miri issue, I think that one should be reopened.
Fix undefined behavior in movemask_epi8 (#1354)
yanns commentedon Dec 15, 2022
Sorry for the naive question, but I still have this issue on nightly:
from:
although this has been changed by #1354
Do we need some kind of release to use the new code?
Amanieu commentedon Dec 15, 2022
The stdarch submodule in rust-lang/rust needs to be updated.
yanns commentedon Dec 15, 2022
Is it something I can do? Locally? Or it has to be done by the rust-lang?
Amanieu commentedon Dec 15, 2022
You can submit a pull request to rust-lang/rust that updates the submodule.
yanns commentedon Dec 16, 2022
rust-lang/rust#105784
yanns commentedon Dec 16, 2022
I don't know if you can help in the rust PR.
It seems that there is a new feature tag:
update stdarch
Rollup merge of rust-lang#105784 - yanns:update_stdarch, r=Amanieu
Rollup merge of rust-lang#105784 - yanns:update_stdarch, r=Amanieu
update stdarch
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
Fix undefined behavior in movemask_epi8 (#1354)