-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nontemporal_store: make sure that the intrinsic is truly just a hint
- Loading branch information
Showing
5 changed files
with
49 additions
and
15 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
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 |
---|---|---|
@@ -1,13 +1,28 @@ | ||
//@ compile-flags: -O | ||
//@ compile-flags: --target aarch64-unknown-linux-gnu | ||
//@ needs-llvm-components: aarch64 | ||
|
||
#![feature(core_intrinsics)] | ||
#![feature(no_core, lang_items, intrinsics)] | ||
#![no_core] | ||
#![crate_type = "lib"] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
#[lang = "copy"] | ||
pub trait Copy {} | ||
|
||
impl Copy for u32 {} | ||
impl<T> Copy for *mut T {} | ||
|
||
extern "rust-intrinsic" { | ||
pub fn nontemporal_store<T>(ptr: *mut T, val: T); | ||
} | ||
|
||
#[no_mangle] | ||
pub fn a(a: &mut u32, b: u32) { | ||
// CHECK-LABEL: define{{.*}}void @a | ||
// CHECK: store i32 %b, ptr %a, align 4, !nontemporal | ||
unsafe { | ||
std::intrinsics::nontemporal_store(a, b); | ||
nontemporal_store(a, b); | ||
} | ||
} |