[ydl-gen] String instructions emulation on PPC970MP

Patrice Bouchand pbfwdlist at gmail.com
Wed Dec 9 21:32:40 JST 2009


Hello,

Actually, when I run the code with dlmzb on the 970 cpu, I get a SIGILL and
what I would love to do is actually to add a hook on it to be able to run
the code compiled with mcpu=440fp directly on the power-station. I do not
think it's already done and as you said, it seems quite complicated to do
that.

I use the power-station to host chrooted build environments. I'm currently
able to build more than 300 Fedora srpms without any modification in them.
This was true when I used gcc 4.0. gcc 4.4 is much better to optimized for
amcc440 cpu and it is able to manage dlmzb instruction. My goal is to do as
less modification as possible on the srpms, and thus cross-compilation would
not be a good solution since most of the packages are not able to manage the
HOSTCC parameter natively. I have only the problem with srpms that need to
use their own built binary at compile time. Till now, I just remove the
mcpu=440fp option when I build those srpms. Luckily, those rpms are not big
cpu consumers and then, it is not a big deal if they are compiled with or
wihout the 440fp option.

I like your solution of using -mcpu=440fp and -mno-dlmzb option, this is
less drastic than what I was doing till now.

The target CPU is a low power amcc 440 EPX:
http://www.appliedmicro.com/MyAMCC/jsp/public/productDetail/product_detail.jsp?productID=PPC440EPx

   Thanks for your time and your help

              Patrice


> Is there a way to emulate those instructions on a Power Station (which
> > currently runs YDL 6.0)
> ...
> Eh, sorry, was suggesting work-arounds, didn't address your direct
> question...
>
> I suppose it is possible to emulate in theory. I believe all powerpcs
> will generate an exception when they attempt to execute an invalid
> instruction that does not translate to the equivalent of a NOP.
>
> I guess it is possible in theory to get an exception handler written
> (ie probably within the kernel) to translate dlmzb and related string
> opcodes implemented on the 440 but not the 970.
>
> However, I recall something about powerpc's in general that can treat
> quite a few hex words as NOPs. If this instruction actually translates
> to a NOP on a 970 it may get a little trickier, but if you're already
> getting an illegal instruction error, then, maybe an exception handler
> like that can be written.
>
> I do not however know if this is already done, or how easy it will be
> to do this. Presumably, one has to write the equivalent translation
> assembly code and then find a way to hook it up to the exception
> handler that already exists - and find a place for this code to live.
> And then debug it :)
>
> It looks to me like you've got to hack the kernel, if you want to try
> this, unless someone's already done this.
>
> Given the wide variation and differing degrees of implementation of
> the powerpc instruction set on the various processors, it may not be
> such idea to try implement some form of a kernel level handler to deal
> with unimplemented instructions - of course, this is a compromise.
>
> Again, perhaps just trying to cross-compile and run the resultant code
> on the target itself may be the simplest solution (otherwise you could
> turn off generation of the dlmzb instruction as I suggeested earlier
> if you want to try and run the code on your 970).
>
> What sort of target is this 440 on out of curiosity?  I am assuming if
> you could run prior builds from older gccs it must be some sort of
> environment not too dissimilar to your build environment?
>
> >        Patrice
> > _______________________________________________
> > yellowdog-general mailing list - yellowdog-general at lists.fixstars.com
> > Unsuscribe info:
> http://lists.fixstars.com/mailman/listinfo/yellowdog-general
> > HINT: to Google archives, try  '<keywords> site:us.fixstars.com'
>
> Robert Spykerman
>
> --
> chown -R us ./base
> _______________________________________________
> yellowdog-general mailing list - yellowdog-general at lists.fixstars.com
> Unsuscribe info:
> http://lists.fixstars.com/mailman/listinfo/yellowdog-general
> HINT: to Google archives, try  '<keywords> site:us.fixstars.com'
>
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fixstars.com/pipermail/yellowdog-general/attachments/20091209/9bada18a/attachment-0001.html>


More information about the yellowdog-general mailing list