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位

相关推荐
索端阳4 小时前
初识 ARM Cortex-A7,嵌入式底层入门总结
汇编·嵌入式硬件
ThornArmor1 天前
重铸1996|肉体渲染:关节的裂缝:分段模型积木拼装与未成熟的 RSP 矩阵骨骼动画形变
c语言·汇编·c++·python·硬件架构·游戏机
星栖与芯1 天前
LiteOS-M 切换汇编逐行图解(1):汇编是什么·寄存器与栈
汇编·stm32·嵌入式硬件·harmonyos·鸿蒙系统
yume_sibai1 天前
11-Rust 不安全编程(unsafe 关键字 + 裸指针 + FFI + 内联汇编 + 内存安全保证)
汇编·安全·rust
小杨不想秃头3 天前
信息安全工程师 历年真题原题汇编(2016–2025)
汇编
2601_9622965112 天前
C/C++:编译全过程——预处理、编译、汇编、链接(包含预处理指令:宏定义,文件包括、条件编译)
汇编·预处理·链接·c/c++·编译过程
Freak嵌入式13 天前
Pico PIO 汇编语法深度详解:标识符、指令、伪指令全解析
汇编·stm32·单片机·嵌入式硬件·fpga开发·硬件架构
kyle~18 天前
x86 汇编LOCK前缀 --- 硬件架构向软件提供的核心同步原语
汇编·c++·性能优化·硬件架构·实时系统
典典分享指南19 天前
飞书 + 企业微信 + 微信文档多端协同实践指南
汇编·flask·intellij-idea·fastapi
极客互动API24 天前
企业微信 iPad 协议服务搭建与 AI 回调实战
网络·汇编·人工智能·微信·企业微信·ipad