什么是Psyco的移植到64位可能的陷阱? [英] What are the possible pitfalls in porting Psyco to 64-bit?

查看:172
本文介绍了什么是Psyco的移植到64位可能的陷阱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Psyco的文档说:

The Psyco docs say:

仅供参考,使用Psyco不   在所有的任何64位系统上运行。   这一事实是值得被再次指出,   现在,最新的Mac OS / X 10.6   雪Leopart带有默认   Python的是64位64位   机器。使用的Psyco上的唯一方法   OS / X 10.6是通过重新编译自定义   蟒在32位模式

Just for reference, Psyco does not work on any 64-bit systems at all. This fact is worth being noted again, now that the latest Mac OS/X 10.6 "Snow Leopart" comes with a default Python that is 64-bit on 64-bit machines. The only way to use Psyco on OS/X 10.6 is by recompiling a custom Python in 32-bit mode.

在一般情况下,从32位到64位移植的方案是唯一一个真正的问题时,code假设具有一定规模的指针类型,其他类似的小(ISH)的问题。考虑到使用Psyco是不是一大堆的code(〜的C线32K +〜8K线的Python),如何努力,会是什么?有没有人尝试这样做撞墙?我还没有真正有机会好好看一看Psyco的来源还没有,所以我真的AP preciate知道,如果我在浪费我的时间寻找到这...

In general, porting programs from 32 to 64 bits is only really an issue when the code assumes a certain size for a pointer type and other similarly small(ish) issues. Considering that Psyco isn't a whole lot of code (~32K lines of C + ~8K lines of Python), how hard could it be? Has anyone tried this and hit a wall? I haven't really had a chance to take a good look at the Psyco sources yet, so I'd really appreciate knowing if I'm wasting my time looking into this...

推荐答案

由于Psyco的是一个编译器,它需要了解底层汇编语言产生有用的code。这将意味着它需要了解的8个新的寄存器,新的运算codeS 64位code等。

Since psyco is a compiler, it would need to be aware of the underlying assembly language to generate useful code. That would mean it would need to know about the 8 new registers, new opcodes for 64 bit code, etc.

此外,为了互操作与现有的code,那就需要使用相同的调用约定64位code。在AMD-64调用约定类似于旧快速调用约定一些参数在寄存器中传递(在64位的情况下RCX,RDX,R8,R9的指针和XMM0,XMM3浮点),其余的推送到堆栈上溢出空间。不像86,这个额外的空间常常被分配一次的所有可能的呼叫。在IA64公约和汇编语言是不同的呢。

Furthermore, to interop with the existing code, it would need to use the same calling conventions as 64 bit code. The AMD-64 calling convention is similar to the old fast-call conventions in that some parameters are passed in registers (in the 64 bit case rcx,rdx,r8,r9 for pointers and Xmm0-Xmm3 for floating point) and the rest are pushed onto spill space on the stack. Unlike x86, this extra space is usually allocated once for all of the possible calls. The IA64 conventions and assembly language are different yet.

因此​​,在短期,我觉得这可能不是那么简单,因为它的声音。

So in short, I think this is probably not as simple as it sounds.

这篇关于什么是Psyco的移植到64位可能的陷阱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆