From: HongWoo Lee <hongwoo7@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Question about powerpc branch instructions
Date: Fri, 07 Aug 2009 17:47:00 +0900 [thread overview]
Message-ID: <4A7BEA04.7030006@gmail.com> (raw)
Hi~
I want to know about bl instruction and the difference between branch
instructions.
I found this code segment.
{{{
....
bl go_to_real
insrdi r18, r19, 32, 0
....
}}}
And I found the explanation about branch instructions in PowerISA 2.06
document.
{{{
b target_addr (AA=0 LK=0)
ba target_addr (AA=1 LK=0)
bl target_addr (AA=0 LK=1)
bla target_addr (AA=1 LK=1)
If AA=0 then the branch target address is the sum of LI || 0b00
sign-extended and the address of this instruction,
with the high-order 32 bits of the branch target address set to 0 in
32-bit mode.
If AA=1 then the branch target address is the value LI || 0b00
sign-extended,
with the high-order 32 bits of the branch target address set to 0 in
32-bit mode.
If LK=1 then the effective address of the instruction following the
Branch instruction is placed into the Link Register.
}}}
Questions
#1: Is there any special reason to concatenate 0b00 ? Why 0b00 ??
#2: Is b similar to the jmp in x86 ? and bl is similar to the call in x86 ?
Thanks in advance.
HongWoo.
next reply other threads:[~2009-08-07 8:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-07 8:47 HongWoo Lee [this message]
2009-08-07 8:52 ` Question about powerpc branch instructions Benjamin Herrenschmidt
2009-08-07 19:37 ` Scott Wood
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=4A7BEA04.7030006@gmail.com \
--to=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.