Simple question about powerpc asm.
Valentine
vbarshak at ru.mvista.com
Sat Jul 18 20:31:41 EST 2009
HongWoo Lee wrote:
> Hi all,
>
> I was reading kernel level source and found this macro.
>
> #define SET_REG_TO_LABEL(reg, label) \
> lis reg,(label)@highest; \
> ori reg,reg,(label)@higher; \
> rldicr reg,reg,32,31; \
> oris reg,reg,(label)@h; \
> ori reg,reg,(label)@l;
>
> But, I couldn't find any clue related with @highest, @higher, @h, @l.
>
> If anybody know about this directives(?), please explain it.
> Or just let me know the keyword, so I can search with those keyword.
>
PowerPC instructions are 32-bit long. So, there are only 16 bits
available within the instruction for constant values. Since address can
be up to 64 bits, we have to load it a piece at a time. The "@" within
the assembler instruct it to give a specially-processed form of a symbol
value:
@highest -- refers to bits 48-63 of a constant
@higher -- refers to bits 32-47 of a constant
@h -- refers to bits 16-31 of a constant
@l -- refers to bits 0-15 of a constant
> Thanks in advance.
>
> HongWoo.
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
More information about the Linuxppc-dev
mailing list