5.7.1.11 Libc-variant Option
The -mlibc-variant=variant
option specifies whether speed- or
size-orientated string functions are linked in with the program. Size-orientated functions are
linked in if this option is not used.
Many of the library functions provided by
<string.h>
are available in two variants. The size-orientated
functions require less code to implement. These can be explicitly selected by using a
size
argument to the option, for example
-mlibc-variant=size
. The speed-orientated functions might be larger, but
they execute quickly, resulting in improved program performance. They can be selected by using
a speed
argument to the option.
Arm architecture | memset() |
memcpy() |
strlen() |
strcmp() |
memmove() |
memchr() |
---|---|---|---|---|---|---|
ARMv6-M | + speed | + speed | + speed | |||
ARMv7E-M | + speed | + speed | + speed | + speed | + speed | + speed |
ARMv7E-M+DP | + speed | + speed | + speed | + speed | + speed | + speed |
ARMv7E-M+FP | + speed | + speed | + speed | + speed | + speed | + speed |
ARMv7VE+SIMD | + speed | + speed | + speed | + speed | + speed | |
ARMv7-A | + speed | + speed | + speed | + speed | + speed | |
ARMv7-A+FP | + speed | + speed | + speed | + speed | + speed | |
ARMv7-A+SIMD | + speed | + speed | + speed | + speed | + speed | |
ARMv8-M Baseline | + speed | + speed | + speed | |||
ARMv8-M Mainline | + speed | + speed | + speed | + speed | ||
ARMv8-M Mainline+FP | + speed | + speed | + speed | + speed |