@@ -380,14 +380,9 @@ impl<'c> Translation<'c> {
380380 } )
381381 }
382382
383- "__builtin_ia32_pause" | "__builtin_arm_yield" => {
383+ "__builtin_ia32_pause" => {
384384 // `spin_loop()` is implemented as `_mm_pause()` (the `pause` instruction) on `x86`/`x86_64`,
385385 // but it's the safe and cross-platform version of it, so prefer it.
386- // On `arm`, it's implemented as `yield`, although on `aarch64`,
387- // it's implemented as `isb` instead as this is more efficient.
388- // See <https://github.com/rust-lang/rust/commit/c064b6560b7ce0adeb9bbf5d7dcf12b1acb0c807>.
389- // `core::arch::aarch64::__yield()` could be used instead,
390- // but it's unstable (`#![feature(stdarch_arm_hints)]`), so it's not ideal.
391386 let spin_loop = mk ( ) . abs_path_expr ( vec ! [ "core" , "hint" , "spin_loop" ] ) ;
392387 let call = mk ( ) . call_expr ( spin_loop, vec ! [ ] ) ;
393388 self . convert_side_effects_expr (
@@ -397,6 +392,18 @@ impl<'c> Translation<'c> {
397392 )
398393 }
399394
395+ "__builtin_arm_yield" => {
396+ let fn_name = "__yield" ;
397+ self . import_simd_function ( fn_name) ?;
398+ let ident = mk ( ) . ident_expr ( fn_name) ;
399+ let call = mk ( ) . call_expr ( ident, vec ! [ ] ) ;
400+ self . convert_side_effects_expr (
401+ ctx,
402+ WithStmts :: new_val ( call) ,
403+ "Builtin is not supposed to be used" ,
404+ )
405+ }
406+
400407 // SIMD builtins:
401408 "__builtin_ia32_aeskeygenassist128" => {
402409 self . convert_simd_builtin ( ctx, "_mm_aeskeygenassist_si128" , args)
0 commit comments