Skip to content

Commit a80f527

Browse files
Add shim for llvm.arm.hint
This shim is required for `core::hint::spin_loop` on `arm` targets
1 parent 2a979f8 commit a80f527

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/tools/miri/src/shims/foreign_items.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
885885
}
886886
}
887887
}
888+
"llvm.arm.hint" if this.tcx.sess.target.arch == "arm" => {
889+
let [arg] = this.check_shim(abi, Abi::Unadjusted, link_name, args)?;
890+
let arg = this.read_scalar(arg)?.to_i32()?;
891+
match arg {
892+
// YIELD
893+
1 => {
894+
this.yield_active_thread();
895+
}
896+
_ => {
897+
throw_unsup_format!("unsupported llvm.arm.hint argument {}", arg);
898+
}
899+
}
900+
}
888901

889902
// Platform-specific shims
890903
_ =>

0 commit comments

Comments
 (0)