gcc doesn't seem to allow VABS instruction

Asked by Dan Lewis

Edit: I found the problem (duh). The instruction must be written as VABS.F32

I'm trying to create the following intrinsic function to take advantage of the floating-point absolute value instruction in the Cortex-M4F processor:

static inline float _fabs(float x)
 {
 asm
  (
  "VABS %[s0],%[s0] "
  : [s0] "+w" (x)
  ) ;

 return x ;
 }

However, I'm getting the following error message from the assembler when I compile my C source code:

    Error: selected FPU does not support instruction -- 'vabs s15,s15'

My gcc command line and options are as follows:

   arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -std=c99 -O3 -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -Iinc -c -o -obj/test.o src/test.c

I know the instruction is available in the Cortex-M4, and I believe I have the correct -mfpu option specified.

I'm using Version 7-2018-q2-update of the GNU ARM Embedded Toolchain.

Does anyone see something I'm doing wrong?

Thanks!
Dan

Question information

Language:
English Edit question
Status:
Expired
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.