一个核心可以同时进行多个 compare/add 操作吗?
Can a single core do multiple compare/add operations at once?
我想知道 CPU 核心是否可以同时进行多个 x86 比较和添加操作。
所以如果我写了类似
的东西
Compare X y
Compare y z
Add X y
Add q p
是否会同时比较运行?会同时添加运行吗?
是的,前提是CPU有2个空闲的comparers/2加法器,数据相互独立,指令调度器可以同时传递给两个单元。这就是 superscalar CPUs 的工作原理。来自 P5 Pentium 的所有 x86 CPU 以及所有现代 CPU 都是超标量的。
这就是新微架构 运行 比旧微架构更快的原因之一,即使时钟周期和内核数量仍然相同,因为它们可以有更多的执行单元、更大的单元、更大的缓存,运行 同时提供更多指令以及许多其他改进。例如
Current x86 processors can deliver 3 instructions per clock cycle. Conroe, however, has been architected to fetch, dispatch, execute and retire up to four full instructions simultaneously, offering a 33% boost over, say, a Pentium 4 CPU
https://hexus.net/tech/tech-explained/cpu/17976-intel-core-2-duo-conroe/
由于微操作和宏融合的使用,很难定义一个明确的值。然而,对于一些粗略的比较,Sandy Bridge is able to achieve 6 micro-ops per cycle。例如对于一个由两个 add
指令组成的循环,它可以维持每个时钟吞吐量 1 次迭代,这些指令具有内存源、一个乘法和一个宏融合的 dec-and-branch。
另见
- Out-of-order execution
- Exactly how "fast" are modern CPUs?
- How could a CPU execute more than one instruction per clock cycle?
- Difference between superscalar and multi-core?
- superscalar and VLIW
- Instructions per cycle
- How many CPU cycles are needed for each assembly instruction?
- How can a CPU deliver more than one instruction per cycle?
- Superscalar Processor
- 现代微处理器
90 分钟指南! 一篇介绍流水线、超标量和乱序执行的好文章。
- David Kanter's Sandybridge microarchitecture deep dive,附框图。 (他为早期的 Intel uarches 和 Haswell 写过文章。还有一些 AMD 微架构。)
我想知道 CPU 核心是否可以同时进行多个 x86 比较和添加操作。
所以如果我写了类似
的东西Compare X y
Compare y z
Add X y
Add q p
是否会同时比较运行?会同时添加运行吗?
是的,前提是CPU有2个空闲的comparers/2加法器,数据相互独立,指令调度器可以同时传递给两个单元。这就是 superscalar CPUs 的工作原理。来自 P5 Pentium 的所有 x86 CPU 以及所有现代 CPU 都是超标量的。
这就是新微架构 运行 比旧微架构更快的原因之一,即使时钟周期和内核数量仍然相同,因为它们可以有更多的执行单元、更大的单元、更大的缓存,运行 同时提供更多指令以及许多其他改进。例如
Current x86 processors can deliver 3 instructions per clock cycle. Conroe, however, has been architected to fetch, dispatch, execute and retire up to four full instructions simultaneously, offering a 33% boost over, say, a Pentium 4 CPU
https://hexus.net/tech/tech-explained/cpu/17976-intel-core-2-duo-conroe/
由于微操作和宏融合的使用,很难定义一个明确的值。然而,对于一些粗略的比较,Sandy Bridge is able to achieve 6 micro-ops per cycle。例如对于一个由两个 add
指令组成的循环,它可以维持每个时钟吞吐量 1 次迭代,这些指令具有内存源、一个乘法和一个宏融合的 dec-and-branch。
另见
- Out-of-order execution
- Exactly how "fast" are modern CPUs?
- How could a CPU execute more than one instruction per clock cycle?
- Difference between superscalar and multi-core?
- superscalar and VLIW
- Instructions per cycle
- How many CPU cycles are needed for each assembly instruction?
- How can a CPU deliver more than one instruction per cycle?
- Superscalar Processor
- 现代微处理器 90 分钟指南! 一篇介绍流水线、超标量和乱序执行的好文章。
- David Kanter's Sandybridge microarchitecture deep dive,附框图。 (他为早期的 Intel uarches 和 Haswell 写过文章。还有一些 AMD 微架构。)