gpt4 book ai didi

cpu-architecture - 是否有任何 CPU 架构使用元数据?

转载 作者:行者123 更新时间:2023-12-03 19:42:22 25 4
gpt4 key购买 nike

我最近一直在研究一种名为 Mill 的 CPU 架构概念。

磨坊(虽然它可能是 Steam 器具)uses metadata对于 CPU 中的各种事物,例如软件推测负载产生标记为非结果的值 ( NaR )。如果后面的指令试图以非推测方式存储该结果,则硬件会检测到该结果并出现故障。

我想知道在架构中使用元数据的意义上是否有任何其他 CPU 类似。

最佳答案

我知道的一些随机示例,当然不是详尽的列表。 IDK,如果有任何使用元数据来处理 Mill 所做的所有事情。 Mill 所做的一些事情是独一无二的,但一些想法已经以类似的形式出现在其他 ISA 中。

是的,IA-64 Itanium 也有 not-a-thing由于与 Mill 相同的软件推测原因,加载结果会出错。它的架构师将其描述为 EPIC ISA。 (EPIC = 显式并行指令计算,与 CISC 或 RISC 相对。它也是 VLIW。)From Wikipedia :

The architecture implements a large number of registers:

  • 128 general integer registers, which are 64-bit plus one trap bit ("NaT", which stands for "not a thing") used for speculative execution. 32 of these are static, the other 96 are stacked using variably-sized register windows, or rotating for pipelined loops. gr0 always reads 0.

  • 128 floating point registers. The floating point registers are 82 bits long to preserve precision for intermediate results. Instead of a dedicated "NaT" trap bit like the integer registers, floating point registers have a trap value called "NaTVal" ("Not a Thing Value"), similar to (but distinct from) NaN. These also have 32 static registers and 96 windowed or rotating registers. fr0 always reads +0.0, and fr1 always reads +1.0.



所以对于整数,确实有单独的元数据。对于 FP,元数据是带内编码的。

与软件可见推测无关的其他元数据示例包括:

x87 FPU 有 8 个架构寄存器,但普通指令将它们作为寄存器堆栈访问,其中底层寄存器为 st(0)由 x87 状态字中的字段确定。 (即元数据在架构上是可见的,可以用 fincstp 修改以旋转“左轮手枪筒”。)见 http://www.ray.masmcode.com/tutorial/fpuchap1.htm一个好的图表和 x87 设计的介绍。此外,x87 对每个寄存器都有一个空闲/使用中标志;尝试加载到已在使用的寄存器中会产生 FP 异常(如果屏蔽了异常,则会产生 NaN)。通常使用 fstp“弹出”寄存器堆栈来清除正在使用的标志。存储和弹出,或其他什么,但还有 ffree 将任何 x87 寄存器标记为免费。

微架构(仅性能影响):

显然,微架构必须保留大量有关正在执行的指令的信息,例如它们是否已完成执行。但是至少有一个关于数据的元数据的有趣案例,而不是代码:

在 AMD Bulldozer 系列和 Bobcat/Jaguar 中,SIMD FPU 显然在实际架构寄存器值旁边保留了一些额外的元数据。 As Agner Fog explains in his microarchitecture PDF , (Bulldozer-family) 19.11 不同执行域之间的数据延迟 :

There is a large penalty when the output of a floating point calculation is input to a floating point calculation with a different precision, for example if the output of a double precision floating point addition is input to a single precision addition. This has hardly any practical significance since such a sequence is most likely to be a programming error, but it indicates that the processor stores extra information about floating point numbers beyond the 128 bits in an XMM register. This effect is not seen on Intel processors.



这可能与 Bulldozer 从 FMA 单元指令转发到另一个 FMA 指令时的 FP 延迟低 1 个周期有关,例如 mulps转发至 addps没有 sqrtpsxorps之间。

此外,各种 AMD uarches 在 L1 I-cache 中标记了指令边界,减少了重复解码/延迟。英特尔 Silvermont 也这样做。

关于cpu-architecture - 是否有任何 CPU 架构使用元数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61702729/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com