llvm-mc support for .cpu directive or AArch64

All, we’ve been running some internal tests with the various LLVM backend utilities. In running some simply assembler tests for llvm-mc (3.5 release tree), we’ve found that the “.cpu” directive is not currently supported. We generated an assembly file using the GNU-Linaro GCC 4.8.0 for AArch64 that contains this directive. The assembly looks similar to the following:

.cpu generic+fp+simd
        .file "arm.c"
        .align 2
        .global __arm_function
        .type __arm_function, %function
        sub sp, sp, #16

llvm-mc complains when we attempt to assemble it:
arm.s:1:2: error: unknown directive
        .cpu generic+fp+simd

It seems somewhat logical that this directive wouldn’t be inherently necessary given the way that the backends (et.al. assembler, dissasmbler templates) are functionally organized in LLVM. However, does anyone have any plans to implement this directive? I would prefer not to parse+ignore it. Are there any other known common directives from other codegens that don’t work?


—John D. Leidel

To whomever plan to implement that, please be wary of this bug:


and add a FIXME to that effect, as we did on ARM.

Also, we're planning on implementing a push/pop mechanism to make it
sane to use cpu/fpu directives.