简体   繁体   English

3个ALU +解码器中的每一个同时在“ switch” /“ case”上的3个不同条件分支上行走?

[英]each of 3 ALU+decoders walk on 3 different conditional branches on `switch`/`case` simultaneously?

As known, on Intel x86_64 the Hyper Threading allow to use shared execution units (ALUs, ...) from different threads simultaneously - this is known as Simultaneous multithreading (SMT). 众所周知,在Intel x86_64上 ,超线程允许同时使用来自不同线程的共享执行单元(ALU,...)-这称为同时多线程(SMT)。

And known, that threads, which executed on Hyper Threading virtual cores, can process different sequences of instructions - code of different processes, of different functions, or different branches of one conditional branch of one function, etc. 众所周知,在超线程虚拟内核上执行的线程可以处理不同的指令序列-不同进程,不同功能的代码,或一个功能的一个条件分支的不同分支,等等。

Ie 4 decoders of 1st virtual core can process one sequence of instructions, and other 4 decoders of 2nd virtual core can process other sequence of instructions. 即,第一虚拟核心的四个解码器可以处理一个指令序列,第二虚拟核心的其他四个解码器可以处理其他指令序列。

在此处输入图片说明

But can the single thread simultaneously execute (out-of-order) different branches of one conditional branch , ie can CPU-Core execute two or more conditional branches at the same time, to predict a variety of options conditional jumps? 但是,单线程是否可以同时执行(无序)一个条件分支的不同分支,即CPU-Core是否可以同时执行两个或多个条件分支,以预测各种选项条件跳转?

For example, each of 3 ALU+decoders walk on 3 different conditional branches on switch / case simultaneously. 例如,3个ALU +解码器中的每一个同时在switch / case上的3个不同条件分支上移动。

That picture is not entirely accurate, much less is duplicated. 那张图片并不完全准确,重复的更少。 Almost everything is shared, except: 几乎所有内容都是共享的,除了:

  • the architectural state, obviously 显然是建筑状态
  • on SB and IB, the loop buffer 在SB和IB上,循环缓冲区

In particular, the decoders are shared, and alternate between the threads. 特别地,解码器是共享的,并且在线程之间交替。

In principle you could have hardware threads "go down both paths" at a branch, but that's not what HyperThreading (or anything else in current Intel processors) does. 原则上,您可以在一个分支上让硬件线程“沿着两条路径走”,但这不是HyperThreading(或当前Intel处理器中的其他任何东西)所做的。 One path is chosen, and followed speculatively until either it has to be discarded or it becomes non-speculative. 选择一条路径,然后进行推测性跟踪,直到必须丢弃它或使其变为非推测性。

Executing both paths (aka eager execution, or dual path execution) has been explored, particularly in the 90's, but has never seen serious use. 已经探索了执行两条路径(又名渴望执行,或双路径执行),尤其是在90年代,但是从未真正使用过。 Consider that using the same resources, executing both paths means that the correct one will have been executed less far than if it had been the sole path. 考虑到使用相同的资源,两条路径的执行意味着正确的一条路径的执行距离比唯一的一条路径执行的距离短。 Branch prediction is on average highly effective, more than 90% correct (though also highly variable), so on average it is better to just go for that one path. 分支预测平均而言非常有效,正确率超过90%(尽管变化也很大),因此,平均而言,最好选择一条路径。 Some research has shown promising results for using dual path execution for low-confidence branches. 一些研究显示了对低置信度分支使用双路径执行的有希望的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM