mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
36bd9ef5a8
Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64 As Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature. Windows 10 requires CMPXCHG16B, LAHF/SAHF, and PrefetchW as stated in the requirements [here](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf). Furthermore, CPUs that meet these requirements also have SSE3 ([see](https://walbourn.github.io/directxmath-sse3-and-ssse3/))
16 lines
342 B
Rust
16 lines
342 B
Rust
//@ only-x86_64
|
|
//@ compile-flags: -Copt-level=3
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#[cfg(target_arch = "x86_64")]
|
|
#[target_feature(enable = "sse4.2")]
|
|
#[no_mangle]
|
|
pub unsafe fn crc32sse(v: u8) -> u32 {
|
|
use std::arch::x86_64::*;
|
|
let out = !0u32;
|
|
_mm_crc32_u8(out, v)
|
|
}
|
|
|
|
// CHECK: attributes #0 {{.*"target-features"=".*\+sse4.2,\+crc32"}}
|