我知道较旧的 Mac 配备了 PPC 处理器,这非常完美,但是哪些特定型号适合将 Linux 发行版放入其中呢?我已经 10 多年没有使用 Mac 了,所以我不知道该买哪一个。我特别询问那些接受 Linux 的人,因为我相信 Apple 会要求你付费在他们的机器上进行开发,或者是否可以在 Mac 上免费使用带有 gcc 的 c++ 和 LLVM?
我需要能够在有序 risc 处理器上分析代码,PPC 似乎是最好的起点,但是还有哪些其他 CPU 可以提供类似的编码体验呢?也就是说,在指令集大大减少的情况下,在浮点/整数/向量表示之间切换时,分支时会出现停顿、微代码指令和加载命中存储问题。
I know that older Macs have PPC processors in them, which is perfect, but which specific models are suitable for dropping a linux distribution onto? I've not used a Mac in over 10 years now so I have no idea which to go for. In particular, I ask about ones that accept Linux because I believe Apple ask you to pay to develop on their machines or is it possible to use c++ with gcc and the LLVM for free on the mac?
I need to be able to profile code on an in-order risc processor, and the PPC seems like the best place to start, but what other CPUs offer similar coding experience? That is, with a much reduced instruction set, stalls when branching, microcode instructions and load-hit-store problems when switching between float/int/vector representations.
发布评论
评论(3)
在 Mac 上进行开发是免费的。在 iPhone 上安装 iOS 产品需要付费,通过 App Store 销售 Mac 产品需要付费。但您可以在 Mac 上免费构建 C++ 应用程序。 Xcode 本身是免费的。
任何 PowerBook G4 都适合这种工作,如果您想这样做,有很多关于在 PowerBook G4 上安装 Linux 的页面(尽管我可能只选择 Xcode,而不是经历这个麻烦)。
There is no charge to develop on Mac. There is a charge to install iOS products on an iPhone, and there is a charge to sell Mac products through App Store. But you can build c++ apps for free on Mac. Xcode itself is free.
Any PowerBook G4 is fine for this kind of work, and there are many pages on installing Linux on a PowerBook G4 if you wanted to do that (though I'd probably just Xcode rather than go through the hassle).
使用 Mac OS X 并获取 Apple 提供的免费
Xcode
开发人员工具 (Xcode 3.x
) 以及免费的CHUD
性能工具包,其中包括Shark
,一个非常的采样分析器,您会发现它非常有用。Use Mac OS X and get the free
Xcode
developer tools from Apple (Xcode 3.x
) and also the freeCHUD
performance tools package which includesShark
, a very good sampling profiler which you will find extremely useful.有点偏离主题,但是
符合顺序
这完全取决于你所说的有序是什么意思! PowerPC 有多种同步指令,例如
sync
、lwsync
和eieio
来强制执行(不同类型的!)内存排序,以及>isync
刷新指令管道。 IBM 有一个不错的总结。RISC处理器
我真的不会称 PPC“降低”;)
分支时停顿
IIRC,一个正确预测的分支,其目标位于指令缓存中,不会使 G4 停止(我忘记了不同型号的 G4 有什么不同)。 OTOH,如果分支目标是 16 字节对齐的(与分支目标缓冲区有关),G5 的性能会更好。
微码指令
我认为 RISC 的一半意义是为了避免微代码?无论如何,我不知道微代码更新。
在浮点/整数/向量表示之间切换时出现加载命中存储问题
我不知道这意味着什么......
“传统”ARM可能更接近您正在寻找的内容,但是我怀疑较新的处理器具有一些更“现代”的处理器功能。我选择的 ARM 盒子可能是 SheevaPlug 或类似的,不过如果你不介意被限制在 64 MB 的话,WZR-HP-G300NH 路由器更便宜(并且带有 Wi-Fi)。
Slightly off-topic, but
in-order
It depends on precisely what you mean by in-order! PowerPC has a variety of synchronizing instructions like like
sync
,lwsync
, andeieio
to enforce (different types of!) memory ordering, andisync
which flushes the instruction pipeline. IBM has a decent summary.risc processor
I really wouldn't call the PPC "reduced" ;)
stalls when branching
IIRC, a correctly-predicted branch with its target in the instruction cache does not stall the G4 (I forget how the different models of G4 differ). OTOH, the G5 performs better if branch targets are 16-byte aligned (something about the branch target buffer).
microcode instructions
I thought half the point of RISC was to avoid microcode? I'm not aware of microcode updates, at any rate.
load-hit-store problems when switching between float/int/vector representations
I'm not sure what this means...
"Traditional" ARM might is probably closer to what you're looking for, but I suspect the more recent processors have some of the more "modern" processor features. My ARM box of choice is probably the SheevaPlug or similar, though the WZR-HP-G300NH router is cheaper (and comes with Wi-Fi) if you don't mind being constrained to 64 MB.