1
votes

On Ubuntu 17.04, with aarch64-linux-gnu-as installed, compile the following assembly code:

# code.s
_start:
   mrs x0,icc_igrpen0_el1

with

aarch64-linux-gnu-as code.s

gives the following error:

as.s: Assembler messages:
as.s:3: Error: unknown or missing system register name at operand 2 -- `mrs x0,icc_igrpen0_el1'

However, icc_igrpen0_el1 is described in documentation of ARMv8 profile,cortext-a53 TRM and GICv3 specification.

And the same error applies to registers starts with ICC_.Why gnu assembler does not recognize those ICC_* registers?

1
remember that gnu is gnu and the arm documentation is arm, do the arm tools support this shortcut? I know some registers are defined and can be used this way but are all of them? In general the "why" opinion part of your question is they dont have to support them syntax is an assembler specific thing, so no reason to expect them to. - old_timer
for completeness ubuntu version and package is not enough, post aarch64-linux-gnu-as --version, in general for questions like this. - old_timer
This usage is from ARM® Architecture Reference Manual ARMv8, for ARMv8-A architecture profile, those registers should be used to control the GICv3. These registers should be implemented in ARMv8-compitable architecture. - Douglas Fulton Shaw
not relevant what the arm documentation says, the machine code is what matters not the ascii assembly language. assemblers (the programs that read the ascii and make machine code) decide and define what the assembly language syntax is, free to do whatever they want, so long as the machine code is correct they support that processor, its not a standardized language necessarily. The mrs instruction with the op values and cp values is supported, and is also in the arm documentation so you can access those registers without the symbolic shortcuts. - old_timer

1 Answers

4
votes

Apparently, you are supposed to use a header file with the register definitions as macros, mapping them to the generic system register names, perhaps like this:

#define ICC_IGRPEN0_EL1     S3_0_C12_C12_6
#define ICC_IGRPEN1_EL1     S3_0_C12_C12_7
#define ICC_IGRPEN1_EL3     S3_6_C12_C12_7

I don't think there is any expectation that the non-generic names will be added to GAS proper.