[comp.os.minix] PIC inferior to regular code

V2057A%TEMPLEVM.BITNET@cornellc.cit.cornell.edu (Juan Jose Noyles) (05/26/90)

Andy (Dr. Tanenbaum?), you mentioned that PIC is inferior to regular code.  In
what ways?  And are you referring to regular as in relocatable code?  Is this
just an architectural phenomenon, or does it affect all Von Neumann CPUs?

ast@cs.vu.nl (Andy Tanenbaum) (05/28/90)

In article <20318@nigel.udel.EDU> V2057A%TEMPLEVM.BITNET@cornellc.cit.cornell.edu (Juan Jose Noyles) writes:
>Andy (Dr. Tanenbaum?), you mentioned that PIC is inferior to regular code.  In
>what ways?  And are you referring to regular as in relocatable code?  Is this
>just an architectural phenomenon, or does it affect all Von Neumann CPUs?

It very much depends on the CPU.  For the 68000, we looked at PIC code
carefully, and concluded that nearly all the time we could generate better
code in space and time if we were not constrained to PIC.  A simple
example.  You can't call subroutines using the normal call instruction
because it puts the ABSOLUTE ADDRESS of the place to return to on the
stack.  If the program is moved in memory before the return is made, when
the RET is done, the program takes off into outer space.  Thus you need
a more complicated linkage mechanism.  It can be done, but it takes more
instructions and more time than the standard call.  Same is true of lots
of other things.

Andy Tanenbaum (ast@cs.vu.nl)

HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) (05/28/90)

This statement must have a particular CPU in mind.
With a convenient instruction set, PIC can be quite a normal thing.
On an 68000, it is awkward, but with 32-bit relative offsets, it might
be better.
C.v.W.

V2057A%TEMPLEVM.BITNET@cornellc.cit.cornell.edu (Juan Jose Noyles) (05/28/90)

What about other machines?  If that's the case with all/most processors, it
seems that PIC is one place small CPUs need some work.