forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#83841 - Amanieu:asm_clobber_feature, r=nagisa
Allow clobbering unsupported registers in asm! Previously registers could only be marked as clobbered if the target feature for that register was enabled. This restriction is now removed. cc rust-lang#81092 r? ``@nagisa``
- Loading branch information
Showing
4 changed files
with
104 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// only-x86_64 | ||
// revisions: base avx512 | ||
// [avx512]compile-flags: -C target-feature=+avx512f | ||
|
||
#![crate_type = "rlib"] | ||
#![feature(asm)] | ||
|
||
// CHECK-LABEL: @avx512_clobber | ||
// base: call void asm sideeffect inteldialect "", "~{xmm31}"() | ||
// avx512: call float asm sideeffect inteldialect "", "=&{xmm31}"() | ||
#[no_mangle] | ||
pub unsafe fn avx512_clobber() { | ||
asm!("", out("zmm31") _, options(nostack, nomem, preserves_flags)); | ||
} | ||
|
||
// CHECK-LABEL: @eax_clobber | ||
// CHECK: call i32 asm sideeffect inteldialect "", "=&{ax}"() | ||
#[no_mangle] | ||
pub unsafe fn eax_clobber() { | ||
asm!("", out("eax") _, options(nostack, nomem, preserves_flags)); | ||
} |