6 years, 1 month ago.

FPU instrinsics?


First off, let me say that I love the convenience of the mbed online compiler. I'm very grateful for the tools that ARM and mbed are making available, so please don't lump this post into the "unnecessary grumbling" pile. However, given the lack of inlining of library functions, and the compiler's seemingly mediocre optimisation abilities, I find myself wishing for more "bare metal" opportunities.

Inline assembly with GNU syntax is not available. I realise there is a new syntax for inline assembly, but it lacks GNU's powerful register constraints, which are essential if the compiler's register allocator is to do a good job. I know that I could link separate assembly files, but that imposes calling conventions (again making life hard for the register allocator), and worse, the compiler can't inline simple functions.

When targeting the EA LPC4088 QuickStart Board, I can happily use integer intrinsics (UADD8, SADD8, QADD8, UQADD8, etc...) so I can leverage the M4's integer SIMD instructions.

The LPC4088 supposedly features the ARM Cortex M4f (which features the onboard FPU). However, none of the headers in "mbed/TARGET_LPC4088" define intrinsics for FPU instructions. I realise that the compiler will emit native FPU instructions when compiling C++ code, but what if I simply want to call VABS? Do I really have to call ::std::abs (which won't be inlined)? An even bigger concern is getting at the intrinsics for fused multiply-accumulate instructions... I'm loath to trust the compiler to optimise "a += b * c" into one FMA, and there doesn't seem to be a way to view the generated assembly to verify this.

Any ideas? Is there a header file I'm missing that defines the FPU intrinsics?

Thanks in advance, Chris

Comment on this question
Be the first to answer this question.

You need to log in to post a question