Skip to content

Commit 1848d25

Browse files
committed
Add shim for core::hint::spin_loop() on riscv64
1 parent 78cd77f commit 1848d25

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/inline_asm.rs

+10
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ pub(crate) fn codegen_inline_asm<'tcx>(
149149
return;
150150
}
151151

152+
// Used by core::hint::spin_loop()
153+
if template[0]
154+
== InlineAsmTemplatePiece::String(".insn i 0x0F, 0, x0, x0, 0x010".to_string())
155+
&& template.len() == 1
156+
{
157+
let destination_block = fx.get_block(destination.unwrap());
158+
fx.bcx.ins().jump(destination_block, &[]);
159+
return;
160+
}
161+
152162
// Used by measureme
153163
if template[0] == InlineAsmTemplatePiece::String("xor %eax, %eax".to_string())
154164
&& template[1] == InlineAsmTemplatePiece::String("\n".to_string())

0 commit comments

Comments
 (0)