如何在 ubuntu 中开始针对 mips32 r2000 进行开发?

发布于 2024-10-01 15:31:49 字数 60 浏览 1 评论 0原文

我有一个紧急项目,我应该在其中实施bignum。我只有 IA-32 的工作经验,任何基本建议都会有所帮助。

I have an urgent project in which I'm supposed to implement bignum. I only have experience working in IA-32, any basic advice would be helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沫离伤花 2024-10-08 15:31:49

如果您没有硬件来学习架构,也许 SPIM 可以帮助。

If you don't have hardware to learn the architecture on, perhaps SPIM can help.

披肩女神 2024-10-08 15:31:49

我会用 CC++ 编写它,并使用编译器生成汇编代码。您可以寻找需要修复的地方(如果它不是一流的编译器),在此过程中,您将了解汇编语言的工作原理、CPU 功能等。

I'd write it in C or C++ and use the compiler to generate assembly code. You can look for things to fix (if it's not a stellar compiler), and along the way, you'll learn how the assembly language works, the CPU features, etc.

云归处 2024-10-08 15:31:49

首先,不要这样做。相反,请使用现有的库,例如 GMP。维基百科引用了此类库的完整列表,并具有各种许可证。有些甚至在公共领域下发布。

现在,让我们假设您由于某种原因无法容忍使用现有的库。那么我的建议是:用 C 语言来做。MIPS32 是一种类似 RISC 的架构,旨在提高编译效率。由于 C 编译器并不完美,因此通过手动汇编可以实现一些性能提升,但增益不会很大(根据经验,与优化的 C 相比,优化汇编的速度预计会提高 30%,而且开发规模要大得多)成本也)。

话虽这么说,您可能想知道 MIPS32 可以做什么,以便您可以更好地优化 C 源代码,并检查编译器生成的内容,以确定您做得是否正确。 “MIPS32® Architecture for Programmers”是一个很好的来源,可以从此页面。您会想看看第一卷和第二卷。

First, do not do it. Instead, use an existing library, such as GMP. Wikipedia references a whole list of such libraries, with various licenses. Some are even released under public domain.

Now, let us suppose that you cannot tolerate using an existing library for some reason. Then my advice is: do it in C. MIPS32 is a RISC-like architecture designed to make compilation efficient. Since C compilers are not perfect, some performance gain can be achieved by doing manual assembly, but not a big gain (as a rule of thumb, expect a +30% speed for optimized assembly compared to optimized C -- and an awfully larger development cost, too).

That being said, you may want to know what a MIPS32 can do, so that you can better optimize C source code, and inspect what the compiler produces, to decide whether you are doing it right or not. A good source is the "MIPS32® Architecture for Programmers" which can be downloaded from this page. You will want to have a look at volumes I and II.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文