Skip to content

Commit 751f30f

Browse files
committed
Auto merge of #150357 - ZuseZ4:zusez4-stdarch-push, r=sayantan
stdarch subtree update Subtree update of `stdarch` to rust-lang/stdarch@6111906. Created using https://github.com/rust-lang/josh-sync. r? `@sayantn` My first josh sync, it lgtm, but let me know if I missed something. I'm especially looking forward to the amd GPU module, which we want to use for the offload project.
2 parents 8d405cc + 1c262da commit 751f30f

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

  • tests

tests/source/cfg_if/detect/os/x86.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ fn detect_features() -> cache::Initializer {
6666
ecx: proc_info_ecx,
6767
edx: proc_info_edx,
6868
..
69-
} = unsafe { __cpuid(0x0000_0001_u32) };
69+
} = __cpuid(0x0000_0001_u32);
7070

7171
// EAX = 7, ECX = 0: Queries "Extended Features";
7272
// Contains information about bmi,bmi2, and avx2 support.
7373
let (extended_features_ebx, extended_features_ecx) = if max_basic_leaf >= 7
7474
{
75-
let CpuidResult { ebx, ecx, .. } = unsafe { __cpuid(0x0000_0007_u32) };
75+
let CpuidResult { ebx, ecx, .. } = __cpuid(0x0000_0007_u32);
7676
(ebx, ecx)
7777
} else {
7878
(0, 0) // CPUID does not support "Extended Features"
@@ -84,12 +84,12 @@ fn detect_features() -> cache::Initializer {
8484
let CpuidResult {
8585
eax: extended_max_basic_leaf,
8686
..
87-
} = unsafe { __cpuid(0x8000_0000_u32) };
87+
} = __cpuid(0x8000_0000_u32);
8888

8989
// EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature
9090
// Bits"
9191
let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 {
92-
let CpuidResult { ecx, .. } = unsafe { __cpuid(0x8000_0001_u32) };
92+
let CpuidResult { ecx, .. } = __cpuid(0x8000_0001_u32);
9393
ecx
9494
} else {
9595
0
@@ -182,7 +182,7 @@ fn detect_features() -> cache::Initializer {
182182
let CpuidResult {
183183
eax: proc_extended_state1_eax,
184184
..
185-
} = unsafe { __cpuid_count(0xd_u32, 1) };
185+
} = __cpuid_count(0xd_u32, 1);
186186
enable(proc_extended_state1_eax, 0, Feature::xsaveopt);
187187
enable(proc_extended_state1_eax, 1, Feature::xsavec);
188188
enable(proc_extended_state1_eax, 3, Feature::xsaves);

tests/target/cfg_if/detect/os/x86.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ fn detect_features() -> cache::Initializer {
6666
ecx: proc_info_ecx,
6767
edx: proc_info_edx,
6868
..
69-
} = unsafe { __cpuid(0x0000_0001_u32) };
69+
} = __cpuid(0x0000_0001_u32);
7070

7171
// EAX = 7, ECX = 0: Queries "Extended Features";
7272
// Contains information about bmi,bmi2, and avx2 support.
7373
let (extended_features_ebx, extended_features_ecx) = if max_basic_leaf >= 7 {
74-
let CpuidResult { ebx, ecx, .. } = unsafe { __cpuid(0x0000_0007_u32) };
74+
let CpuidResult { ebx, ecx, .. } = __cpuid(0x0000_0007_u32);
7575
(ebx, ecx)
7676
} else {
7777
(0, 0) // CPUID does not support "Extended Features"
@@ -83,12 +83,12 @@ fn detect_features() -> cache::Initializer {
8383
let CpuidResult {
8484
eax: extended_max_basic_leaf,
8585
..
86-
} = unsafe { __cpuid(0x8000_0000_u32) };
86+
} = __cpuid(0x8000_0000_u32);
8787

8888
// EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature
8989
// Bits"
9090
let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 {
91-
let CpuidResult { ecx, .. } = unsafe { __cpuid(0x8000_0001_u32) };
91+
let CpuidResult { ecx, .. } = __cpuid(0x8000_0001_u32);
9292
ecx
9393
} else {
9494
0
@@ -181,7 +181,7 @@ fn detect_features() -> cache::Initializer {
181181
let CpuidResult {
182182
eax: proc_extended_state1_eax,
183183
..
184-
} = unsafe { __cpuid_count(0xd_u32, 1) };
184+
} = __cpuid_count(0xd_u32, 1);
185185
enable(proc_extended_state1_eax, 0, Feature::xsaveopt);
186186
enable(proc_extended_state1_eax, 1, Feature::xsavec);
187187
enable(proc_extended_state1_eax, 3, Feature::xsaves);

0 commit comments

Comments
 (0)