Pregunta

The issue I am having is with some neon instructions which I believe are supported on the arm7 architecture. I am using the default compiler (Apple LLVM 5.0), it recognises other neon instructions although it does not like the half-float instruction.

Here is the code:

vcvt.f32.f16, q0, d1

This has compiled on gcc although the apple compiler does not like this instruction and gives the error: Instruction requires: half-float

Is there a compiler flag I can give to XCode? I can't find out how to enable the half float instructions googling around.

Thanks!

¿Fue útil?

Solución

The half-float format is actually not supported on all ARM v7 implementations. See the ARM manual here. It's required by vfp4, so if your chip supports that, that's a good start. In general I would recommend using run-time detection and dispatching. To enable the instruction in general, you would need to use one of several floating point support options, in general "fp16" is the keyword, for example:

-mfpu=neon-fp16 if you are sure that your target supports it for neon. I couldn't find all of the examples for llvm either, but I think they are generally compatible with the GCC options, found in the GCC manual.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top