Neon指令,vsub_f32(a, b),是a-b还是b-a?

Neon instruction, vsub_f32(a, b), is it a-b or b-a?

在这条霓虹灯指令中(来自here):

float32x2_t vsub_f32(float32x2_t a, float32x2_t b);  // VSUB.F32 d0,d0,d0

return a - b 还是 b - a?我在 ARM 文档中找不到它...

The VSUB instruction subtracts the value in the second operand register from the value in the first operand register, and places the result in the destination register.

来自 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Bcffigdj.html

所以,它是 a-b

您可能会发现 Neon Intrinsics 的扩展文档更有用。它还提供了从函数参数到指令操作数的映射,可从以下位置获得:

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf

对于 vsub_f32,该文档给出了以下内容:

float32x2_t vsub_f32 (float32x2_t a, float32x2_t b)
a → Vn.2S b → Vm.2S
FSUB Vd.2S,Vn.2S,Vm.2S