标准委员会关心的异国架构 [英] Exotic architectures the standards committees care about
问题描述
我知道 C 和 C++ 标准留下了语言实现定义的许多方面,只是因为如果存在具有其他特征的架构,则很难或不可能为其编写符合标准的编译器.
I know that the C and C++ standards leave many aspects of the language implementation-defined just because if there is an architecture with other characteristics, it would be very difficult or impossible to write a standard conforming compiler for it.
我知道 40 年前,任何计算机都有自己独特的规格.但是,我不知道今天使用的任何架构在哪里:
I know that 40 years ago any computer had its own unique specification. However, I don't know of any architectures used today where:
CHAR_BIT != 8
signed
不是二进制补码(我听说 Java 有这个问题).- 浮点数不符合 IEEE 754(我的意思是不在 IEEE 754 二进制编码中").
CHAR_BIT != 8
signed
is not two's complement (I heard Java had problems with this one).- Floating point is not IEEE 754 compliant ( I meant "not in IEEE 754 binary encoding").
我之所以这么问,是因为我经常向人们解释说,C++ 不强制要求任何其他低级方面(例如固定大小的类型)是件好事†.这很好,因为与其他语言"不同,它使您的代码在正确使用时可移植(因为它可以移植到更多架构,而无需模拟机器的低级方面,例如符号 + 幅度架构上的二进制补码算法).但是我很遗憾我自己不能指向任何特定的架构.
The reason I'm asking is that I often explain to people that it's good that C++ doesn't mandate any other low-level aspects like fixed sized types†. It's good because unlike 'other languages' it makes your code portable when used correctly ( because it can be ported to more architectures without requiring emulation of low-level aspects of the machine, like e.g. two's complement arithmetic on sign+magnitude architecture). But I feel bad that I cannot point to any specific architecture myself.
那么问题是:哪些架构表现出上述特性?
So the question is: what architectures exhibit the above properties?
† uint*_t
是可选的.
推荐答案
看看这个
为尚未迁移所有 Univac 软件的用户提供向后兼容性.
offering backward compatibility for people who have not yet migrated all their Univac software.
要点:
- 36 位字
CHAR_BIT == 9
- 一个人的补体
- 72 位非 IEEE 浮点
- 代码和数据的独立地址空间
- 字地址
- 没有专用的堆栈指针
虽然不知道他们是否提供 C++ 编译器,但他们可以.
Don't know if they offer a C++ compiler though, but they could.
现在他们的 C 手册最新版本的链接已经浮出水面:
And now a link to a recent edition of their C manual has surfaced:
第 4.5 节有一个包含 9、18、36 和 72 位数据类型的表.
Section 4.5 has a table of data types with 9, 18, 36, and 72 bits.
这篇关于标准委员会关心的异国架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!