微处理器的发展是否保证了编译器和语言标准的发展?

发布于 2024-10-17 04:01:28 字数 92 浏览 2 评论 0原文

随着芯片制造商向新芯片添加新功能、指令等,我们是否需要相应更新版本的编译器来使用芯片的这些新指令和功能?这是否意味着编程语言也需要新的操作码、语法等才能使用芯片的新功能?

As chip makers add new functions, instructions etc to new chips, do we need newer versions of the compilers accordingly to use those new instructions and features of the chip? Also does it mean that programming language also needs new opcodes,syntax etc to use the new features of the chip?

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

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

发布评论

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

评论(2

我最亲爱的 2024-10-24 04:01:28

是的,新的硬件功能反映在语言扩展和新语言中。例如,请参阅反映 SIMD 指令可用性的 C 和 C++ 的各种向量扩展,以及新派生的数据并行语言(如 CUDA 和 OpenCL)。

如果硬件与其他硬件显着不同,则它很可能需要自己的不同编程语言,请参阅晚期的 Transputers 及其 Occam 语言。

Yes, new hardware features are reflected in language extensions and in new languages. For example, see the various vector extensions for C and C++ that reflects the availability of SIMD instructions, and the new derived data-parallel languages like CUDA and OpenCL.

If the hardware is significantly different from the others, it is likely that it will require its own, different programming language, see the late Transputers and their Occam language.

幽蝶幻影 2024-10-24 04:01:28

编译为机器代码(而不是虚拟机)的编译器可能需要在其目标架构发生变化时进行更改(尽管理想情况下所有更改都将向后兼容,因此添加仅意味着可能有新的优化,但旧编译器仍然可以工作) 。

编程语言不需要改变,但如果通过机器功能的改变使所需的功能成为可能,则可能会改变。除非,“编程语言”指的是汇编/机器语言,在这种情况下,可能应该(但不是必须)添加汇编/机器指令的一对一芯片指令。

注意所有的“可能”。除非您从事汇编、机器代码、编译器设计或编程语言设计,否则您很可能看不到这些更改。如果你不是,那么担心这些事情就是浪费你的时间。

Compilers that compile to machine code (not to a VM) might need to change any time its target architecture changes (although ideally all changes would be backward compatible, so that additions just mean there's new optimizations possible, but that old compilers would still work).

Programming languages don't need to change, but might if a desirable feature is made newly possible by a change in the machine's capabilities. Unless, by "programming languges" you mean assembly/machine language, in which case a one to one chip-instruction to assembly/machine instruction probably ought to be (but doesn't have to be) be added.

Notice all the "might"s. Chances are that these changes are invisible to you unless you're working in Assembly, Machine code, compiler design, or programming language design. If you're not, then worrying yourself about these things is a waste of your time.

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