PowerPC 24-bit branch question...

Hi,

The PowerPC has a well-known unfortunate pb. with branch instructions, in that
it has a 24-bit relative address - can make branching to distant memory tricky…

This has a good prospect of ours a bit nervous - they are used to using VxWorks
which is constrained by using physical addresses - and they would like to
understand exactly how we have resolved this issue, so they can be confident
that it’s really gone. VxWorks has not really got around this problem, although
intermediate jump tables can help a bit. There was a notorious problem with PPC
VxWorks…

I’m confident that we don’t have this problem, since I’ve never seen it since I
got here, or heard anyone complain.

I’m thinking that virtual memory gets us out of most of the issues - but can I
get a definitive answer - do we use intermediate jump tables as well to link to
e.g. shared library code - or some other method to ensure that we are not
code-size limited to (if I recall) ~64MB ?

I’d like to give the customer a real answer, and not one I made up that sounds
plausible :wink:

Thanks

Dave

Dave Bott <dbott@qnx.com> wrote in message news:3E91E66C.2040703@qnx.com

Hi,

The PowerPC has a well-known unfortunate pb. with branch instructions, in
that
it has a 24-bit relative address - can make branching to distant memory
tricky…

It’s not really a design problem, rather a limitation with sticking with
fixed sized instructions (makes other things much easier). This is common
across RISC architectures in general; since you have 32bits for opcode, some
of which has to distinguish the operation itself, you’ll never get full 32
bit target in a branch (there are alignment constraits which can give you
more bits… etc etc).

This has a good prospect of ours a bit nervous - they are used to using
VxWorks
which is constrained by using physical addresses - and they would like to
understand exactly how we have resolved this issue, so they can be
confident
that it’s really gone. VxWorks has not really got around this problem,
although
intermediate jump tables can help a bit. There was a notorious problem
with PPC
VxWorks…

I’m confident that we don’t have this problem, since I’ve never seen it
since I
got here, or heard anyone complain.

Well since everything sits in a common process vaddr, branching 24bits worth
with in one shot isn’t common. And when you do, you can still load a
register and branch indirectly, so it’s not really that much of an issue
(short of code gen).

I’m thinking that virtual memory gets us out of most of the issues - but
can I
get a definitive answer - do we use intermediate jump tables as well to
link to
e.g. shared library code - or some other method to ensure that we are not
code-size limited to (if I recall) ~64MB ?

You don’t really need jump table, just register indirect branch - but
someone in tools will have to comment on the user code gen.

-Adam

Dave Bott wrote:

I’d like to give the customer a real answer, and not one I made up that
sounds plausible > :wink:

I’m soooo glad you guys don’t just make “up stuff that sounds plausible” :slight_smile:)

Rennie