Haswell,Sandy Bridge,Ivy Bridge和Skylake的BTB尺寸?

sam*_*ira 5 cpu x86 intel cpu-architecture branch-prediction

有没有办法确定或任何资源,我可以找到Haswell,Sandy Bridge,Ivy Bridge和Skylake Intel处理器的分支目标缓冲区大小?

osg*_*sgx 8

通过Agner Fog检查软件优化资源,http: //www.agner.org/optimize/

BTB应该出现在"Intel,AMD和VIA CPU的微体系结构:汇编程序员和编译器制造商的优化指南"中,http://www.agner.org/optimize/microarchitecture.pdf

3.7英特尔Sandy Bridge和Ivy Bridge的分支预测

BTB组织.根据非官方的传闻,Sandy Bridge的分支目标缓冲区比Nehalem大.目前尚不清楚它是否有一个级别,如Core 2和更早的处理器,或Nehalem中的两个级别.它每16字节代码最多可处理四个调用指令.如果每16字节代码有超过3个分支指令,则条件跳转效率较低.

3.8英特尔Haswell,Broadwell和Skylake的分支预测

BTB组织.分支目标缓冲区的组织未知.它看起来相当大.

英特尔可能会在"英特尔64和IA-32架构优化参考手册"中描述一些数据http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures- optimization-manual.html围绕"3.4.1分支预测优化",但仍然没有大小.

它可能看起来很奇怪,但在1998-2000的cpuid中没有关于BTB的信息:http://www.installaware.com/forums/oldattachments/02142006163/tstcpuid.c(德国蒂宾根大学的Gerald J. Heim ).仍未在http://www.felixcloutier.com/x86/CPUID.html或英特尔工作人员的一些公共材料中列出......

 * This table describes the possible cache and TLB configurations
 * as documented by Intel. For now AMD doesn't use this but gives
 * exact cache layout data on CPUID 0x8000000x.
 *
 * MAX_CACHE_FEATURES_ITERATIONS limits the possible cache information
 * to 80 bytes (of which 16 bytes are used in generic Pentii2).
 * With 80 possible caches we are on the safe side for one or two years.
 *
 * Strange enough no BHT, BTB or return stack data is given this way...
Run Code Online (Sandbox Code Playgroud)

BTB应该有一些性能监控单元(PMU)计数器,并且有实验可以使BTB大小不能运行特殊测试程序,请查看Matt Godbolt的http://xania.org/201602/haswell-and-ivy-btb

结论

从这些结果来看,似乎Ivy Bridge(因此可能是Sandy Bridge)对无条件分支的BTB查找使用了几乎相同的策略,尽管有更大的表大小:4096个条目分为1024组4种方式.

对于Haswell来说,似乎采用了一种新的方法来确定集合,以及一种驱逐条目的新方法.

以及关于分支预测及其事件的更多帖子:

他的代码是公开的,基于昂纳的测试:https://github.com/mattgodbolt/agner: https://github.com/mattgodbolt/agner/blob/master/tests/btb_size.py,https://开头github上. COM/mattgodbolt /瓦格纳/斑点/主/测试/ branch.py

  • 分支预测似乎是CPU公司不发布细节的"秘密酱"的一部分.可能是因为害怕帮助他们的竞争对手.我们所知道的大多数似乎都是基于关于事物如何运作的理论的实验测试.绝对有趣的是有多大可能弄明白. (3认同)
  • ..以及如何为开源OOO cpu核心实现良好的分支预测,如https://github.com/ucb-bar/riscv-boom/blob/master/src/main/scala/bpd_pipeline.scala http:// riscv.org/wp-content/uploads/2016/01/Wed1345-RISCV-Workshop-3-BOOM.pdf#page=20 https://ccelio.github.io/riscv-boom-doc/第3章 (2认同)