Skip to content

Commit 848be1b

Browse files
committed
implement aarch64 hint 'intrinsic'
1 parent 36ce776 commit 848be1b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/shims/foreign_items.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
484484
let &[] = check_arg_count(args)?;
485485
this.yield_active_thread();
486486
}
487+
"llvm.aarch64.hint" if this.tcx.sess.target.arch == "aarch64" => {
488+
let &[hint] = check_arg_count(args)?;
489+
let hint = this.read_scalar(hint)?.to_i32()?;
490+
match hint {
491+
1 => { // HINT_YIELD
492+
this.yield_active_thread();
493+
}
494+
_ => {
495+
throw_unsup_format!("unsupported llvm.aarch64.hint argument {}", hint);
496+
}
497+
}
498+
}
487499

488500
// Platform-specific shims
489501
_ => match this.tcx.sess.target.os.as_str() {

0 commit comments

Comments
 (0)