[llvmlinux] AARCH64 unit tests for clang

Tim Northover t.p.northover at gmail.com
Tue Oct 29 08:28:12 UTC 2013

Hi Mark,

Just thought I'd add my perspective on these:

> 1. msr and mrs can pass a 32bit variable for gcc but it must be 64bit for
> clang

Tricky one. It doesn't seem to be an officially sanctioned alias
(though I may have missed that section), but you could certainly argue
it would be a good thing for some registers on convenience grounds.
You couldn't blindly add it as an alias for all of them, of course;
that would be very misleading.

> 2. prfm pldl1keep and prfm pstl1keep fail for clang

We didn't support the "%aN" operand modifier. Should be fixed in r193593.

> 3. The bfi instruction in the following code fails with the error indicated:

This is a worrying inconsistency in GCC: both ARM and x86 seem to
print the immediate token ('#' and '$' respectively) by default for
"i" constraints. There is a modifier 'c' which suppresses it:

    asm volatile("MY_INST %0, %c0" : : "i"(32))

produces just 'MY_INST #32, 32' on ARM and 'MY_INST $32, 32' on X86.
This is the approach Clang has taken in AArch64 (and Apple's ARM64,
incidentally). It would seem to be better if we could convince GCC
that they actually want some consistency.

AArch64 GCC doesn't support %cN currently, as an interim measure the
'#' isn't needed by GCC: both compilers should support "bfi %0, %1,
%2, #8".



More information about the LLVMLinux mailing list