ARM SIMD instruction -- fcvt

Floating-point Convert precision (scalar). This instruction converts the floating-point value in the SIMD&FP source register to the precision for the destination register data type using the rounding mode that is determined by the FPCR and writes the result to the SIMD&FP destination register.

浮点转换精度(标量)。此指令使用FPCR确定的舍入模式将SIMD&FP源寄存器中的浮点值转换为目标寄存器数据类型的精度,并将结果写入SIMD&FPP目标寄存器。

Half-precision to single-precision variant

Applies when type == 11 && opc == 00.

FCVT <Sd>, <Hn>

Half-precision to double-precision variant

Applies when type == 11 && opc == 01.

FCVT <Dd>, <Hn>

Single-precision to half-precision variant

Applies when type == 00 && opc == 11.

FCVT <Hd>, <Sn>

Single-precision to double-precision variant

Applies when type == 00 && opc == 01.

FCVT <Dd>, <Sn>

Double-precision to half-precision variant

Applies when type == 01 && opc == 11.

FCVT <Hd>, <Dn>

Double-precision to single-precision variant

Applies when type == 01 && opc == 00.

FCVT <Sd>, <Dn>

int main()

{

char s[16];

int a;

float f;

strcpy(&s[0], "Hello, xiaozhi!");

a = 0x666;

f = 6.6;

printf("%s %x %f.\n", &s[0], a, f);

}

/*

Hello, xiaozhi! 666 6.600000.

*/

#if 0

/*

* arm

*/

000000000040055c <main>:

40055c: a9bd7bfd stp x29, x30, [sp, #-48]!

400560: 910003fd mov x29, sp // x29=fp=sp

400564: 910063a2 add x2, x29, #0x18 // x2=x29+0x18

400568: 90000000 adrp x0, 400000 <_init-0x3e8> // x0=400000

40056c: 9119a000 add x0, x0, #0x668 // x0=400668

400570: a9400400 ldp x0, x1, [x0] // x0=[x0], x1=[x0+8]

400574: a9000440 stp x0, x1, [x2] // [x2]=x0, [x2+8]=x1

400578: 5280ccc0 mov w0, #0x666 // #1638 w0=0x666

40057c: b9002fa0 str w0, [x29, #44] // x29+44=w0

400580: 52866660 mov w0, #0x3333 // #13107 w0=0x3333

400584: 72a81a60 movk w0, #0x40d3, lsl #16 // w0=0x40d3<<16

400588: 1e270000 fmov s0, w0 // s0=w0

40058c: bd002ba0 str s0, [x29, #40] // x29+40=s0

400590: bd402ba0 ldr s0, [x29, #40] // s0=x29+40

400594: 1e22c000 fcvt d0, s0 // d0=s0

400598: 910063a1 add x1, x29, #0x18 // x1=x29+0x18

40059c: 90000000 adrp x0, 400000 <_init-0x3e8>

4005a0: 9119e000 add x0, x0, #0x678

4005a4: b9402fa2 ldr w2, [x29, #44] // w2=x29+44

4005a8: 97ffffaa bl 400450 <printf@plt> // printf()

4005ac: 52800000 mov w0, #0x0 // #0

4005b0: a8c37bfd ldp x29, x30, [sp], #48

4005b4: d65f03c0 ret

#endif

相关推荐
JiaWen技术圈16 小时前
内核子系统 nf_tables 深度解析
linux·服务器·安全·运维开发
计算机安禾16 小时前
【Linux从入门到精通】第32篇:Nginx入门——高性能Web服务器搭建
linux·服务器·nginx
ZenosDoron16 小时前
Linux 中,rm -r 和 -f
linux·运维·服务器
Hello.Reader16 小时前
Ubuntu 上正确安装 Kali 虚拟机、Docker 与 kail 工具指南
linux·ubuntu·docker
原来是猿16 小时前
Linux UDP Socket 编程入门:Echo Server/Client实现
linux·运维·udp
中微子16 小时前
突然爆火的Warp 终端,开源1天破 4w Stars
linux·人工智能·开源
计算机安禾17 小时前
【Linux从入门到精通】第33篇:数据库MySQL/MariaDB安装与基础调优
linux·数据库·mysql
楼兰公子17 小时前
读取rpi摄像头
linux·服务器·算法
李景琰17 小时前
Debian12安装配置Mqtt之EMQX
linux·运维·服务器
测试员周周17 小时前
【AI测试系统】第1篇:LangGraph 实战:用 State Graph 搭建 AI测试流水线(4 步编排 + RAG 增强 + 完整代码)
linux·windows·python·功能测试·microsoft·单元测试·多轮对话