ARM base instruction -- bfi

Bitfield Insert copies a bitfield of <width> bits from the least significant bits of the source register to bit position <lsb> of the destination register, leaving the other destination bits unchanged.

位域插入将<width>位的位域从源寄存器的最低有效位复制到目标寄存器的位位置<lsb>,保持其他目标位不变。

32-bit variant

Applies when sf == 0 && N == 0.

BFI <Wd>, <Wn>, #<lsb>, #<width>

is equivalent to

BFM <Wd>, <Wn>, #(-<lsb> MOD 32), #(<width>-1)

and is the preferred disassembly when UInt(imms) < UInt(immr).

64-bit variant

Applies when sf == 1 && N == 1.

BFI <Xd>, <Xn>, #<lsb>, #<width>

is equivalent to

BFM <Xd>, <Xn>, #(-<lsb> MOD 64), #(<width>-1)

and is the preferred disassembly when UInt(imms) < UInt(immr).

4005a0: d2800000 mov x0, #0x0 // #0

4005a4: b94023e1 ldr w1, sp, #32

4005a8: b3407c20 bfxil x0, x1, #0, #32

4005ac: b94027e1 ldr w1, sp, #36

4005b0: b3607c20 bfi x0, x1, #32, #32 // x0=取x1的高32位

相关推荐
水饺编程33 分钟前
第2章:Linux 基础,whoami 命令
linux·c语言·汇编
水饺编程1 天前
第2章:Linux 基础,pwd 命令
linux·c语言·汇编
半杯咖啡半行码2 天前
STM32之ARM通用汇编指令详解:从指令格式到寻址方式
汇编·arm开发·stm32
Seeing52 天前
音乐111111
汇编
Funlang2 天前
从汇编到Fun语言
汇编
l1t2 天前
DeepSeek总结的有符号、无符号、未对齐:从汇编到 SQL 的教训
汇编·数据库·sql
Hi202402178 天前
同一个 NMS 算子,两种语言实现:CUDA C 与 Rust 生成 LLVM IR 和 Vortex 汇编的差异
c语言·汇编·rust·gpgpu·vortex·cudac
lhbweilai8 天前
深挖FreeRTOS内核实现(二)
c语言·汇编·stm32·单片机
水饺编程8 天前
第1章:开发环境搭建,在 Windows 中安装 VS 2019
linux·c语言·汇编·visual studio
水饺编程9 天前
第1章:下载 Linux 0.12 内核
linux·c语言·汇编·ubuntu