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位

相关推荐
菜菜why2 天前
详细解析单片机启动汇编文件:以startup_stm32f407xx.s为例
汇编·单片机·嵌入式硬件·嵌入式软件
马里奥的蘑菇云3 天前
ARM GCC内联汇编
汇编·arm
AI迅剑4 天前
模块三:现代C++工程实践(4篇)第二篇《性能调优:Profile驱动优化与汇编级分析》
汇编·c++
代码改变世界ctw5 天前
ARM汇编编程(AArch64架构)第13课:多核启动与调度
汇编·arm开发·架构
代码改变世界ctw5 天前
ARM汇编编程(AArch64架构)课程 - 第9章:原子操作与同步
汇编·arm开发·架构
代码改变世界ctw6 天前
2.2 TF-A在ARM生态系统中的角色
汇编·arm开发·安全·trustzone·atf·optee
baynk6 天前
逆向入门(9)汇编篇-bound指令的学习
汇编·学习
无小道7 天前
c++--typedef和#define的用法及区别
c语言·开发语言·汇编·c++
代码改变世界ctw9 天前
ARM汇编编程(AArch64架构)课程 - 第5章函数调用规范
汇编·arm开发·架构
liulilittle9 天前
C/C++ inline-hook(x86)高级函数内联钩子
c语言·开发语言·汇编·c++·hook·底层·钩子