Does ARM support SIMD operations for 64 bit floating point numbers?

天大地大妈咪最大 提交于 2019-12-10 19:31:58

问题


NEON can do SIMD operations for 32 bit float numbers. But does not do SIMD operations for 64 bit float numbers. VFU is not SIMD. It can do 32 bit or 64 bit floating point operations only on one element.

Does ARM support SIMD operations for 64 bit floating point numbers?


回答1:


This is only possible on processors supporting ARMv8, and only when running Aarch64 instruction set. This is not possible in Aarch32 instruction set.

However most processors support 32-bit and 64-bit scalar floating-point operations (ie floating-point unit).




回答2:


ARMv8

In ARMv8, it is possible:

fadd v2.2d, v0.2d, v1.2d

Minimal runnable example with an assert and QEMU user setup.

The analogous ARMv7 does not work:

vadd.f64 q2, q0, q1

assembly fails with:

bad type in Neon instruction -- `vadd.f64 q2,q0,q1'

Minimal runnable 32-bit float v7 code for comparison.

Manual

https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf A1.5 "Advanced SIMD and floating-point support" says:

The SIMD instructions provide packed Single Instruction Multiple Data (SIMD) and single-element scalar operations, and support:

  • Single-precision and double-precision arithmetic in AArch64 state.

For ARMv7, F6.1.27 "VADD (floating-point)" says:

<dt> Is the data type for the elements of the vectors, encoded in the "sz" field. It can have the following values:

F32 when sz = 0 F16 when sz = 1

but there is no F64, which suggests that it is not possible.



来源:https://stackoverflow.com/questions/36052564/does-arm-support-simd-operations-for-64-bit-floating-point-numbers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!