6.11 Inline assembler Vector Floating-Point (VFP) restrictions in C and C++ code

The inline assembler provides direct support for VFPv2 instructions.

For example:
float foo(float f, float g)
{
  float h;
  __asm
  {
      VADD h, f, 0.5*g; // h = f + 0.5*g
  }
  return h;
}
In inline assembly code you cannot use the VFP instruction VMOV to transfer between an ARM register and half of a doubleword extension register. Instead, you can use the instruction VMOV to transfer between an ARM register and a single-precision VFP register.
If you change the FPSCR register using inline assembley code, it produces runtime effects on the inline VFP code and on subsequent compiler-generated VFP code.

Note

  • Do not use inline assembly code to change VFP vector mode. Inline assembly code must not be used for this purpose, and VFP vector mode is deprecated.
  • ARM strongly discourages the use of inline assembly coprocessor instructions to interact with VFP in any way.
Related concepts
6.7 Restrictions on inline assembly operations in C and C++ code
6.8 Inline assembler register restrictions in C and C++ code
6.9 Inline assembler processor mode restrictions in C and C++ code
6.10 Inline assembler Thumb instruction set restrictions in C and C++ code
6.12 Inline assembler instruction restrictions in C and C++ code
6.13 Miscellaneous inline assembler restrictions in C and C++ code
4.40 Compiler support for floating-point arithmetic
Related information
VMOV (between one ARM register and single precision VFP)
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.