7.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 (NEON scalar). 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 assembly 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.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.