简体   繁体   中英

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

In this neon instruction (from here ):

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

Does it return a - b or b - a? I cannot find it in the ARM documentation...

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.

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

So, it´s ab

You may find the expanded documentation for the Neon Intrinsics more useful. It also gives the mapping from functions parameters to instruction operands, and is available from:

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

For vsub_f32 , that document gives the following:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM