All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentine <vbarshak@ru.mvista.com>
To: HongWoo Lee <hongwoo7@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: Simple question about powerpc asm.
Date: Sat, 18 Jul 2009 14:31:41 +0400	[thread overview]
Message-ID: <4A61A48D.8060601@ru.mvista.com> (raw)
In-Reply-To: <4A6194D8.9090602@gmail.com>

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@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  reply	other threads:[~2009-07-18 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-18  9:24 Simple question about powerpc asm HongWoo Lee
2009-07-18 10:31 ` Valentine [this message]
2009-07-18 12:54   ` Wolfgang Denk
2009-07-18 13:55     ` Valentine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A61A48D.8060601@ru.mvista.com \
    --to=vbarshak@ru.mvista.com \
    --cc=hongwoo7@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.