本文介绍了包括对RDTSCP的支持的gcc cpu类型是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用RDTSCP替换LFENCE; RDTSC序列,并且还获得了处理器ID,这样我就知道在将线程重新安排到另一个CPU之后比较TSC值的情况.

I am using RDTSCP to replace LFENCE;RDTSC sequences and also get the processor ID back so that I know when I'm comparing TSC values after the thread was rescheduled to another CPU.

为确保我不会在太旧的计算机上运行RDTSCP,在进行CPUID检查(使用libcpuid)后,我将回退到RDTSC.我想尝试使用gcc多目标属性功能代替CPUID调用:

To ensure I don't run RDTSCP on a too old machine I fallback to RDTSC after a CPUID check (using libcpuid). I'd like to try using the gcc multiple target attribute functionality instead of a CPUID call:

int core2_func (void) __attribute__ ((__target__ ("arch=core2")));

gcc手册列出了一个数字cpu族(haswell,skylake等).我如何找到哪个CPU家族首先引入了RDTSCP?

The gcc manual lists a number of cpu families (haswell, skylake, ...). How would I find which cpu family first introduced RDTSCP?

推荐答案

根据这篇 文章撰写于2006年,RDTSCP指令首次在AMD NPT系列中引入0Fh处理器,现在称为 AMD K8 Hammer .但是,有许多处理器属于该家族,并于2006年或之前发布.我发现了另一个文章,最初是用日语编写的,但是我使用了Google翻译将其翻译成英文.该文章提到系列0Fh的版本F"支持RDTSCP指令.所有标记为修订版F的K8处理器(包括F2和F3)及更高版本均支持RDTSCP.较早的K8处理器(包括某些双核处理器)不支持RDTSCP.

According to this article which was written in 2006, the RDTSCP instruction was first introduced in the AMD NPT Family 0Fh processors, which is now called AMD K8 Hammer. However, there are many processors that belong to this family and were released in or before 2006. I found another article, which was originally written in Japanese, but I used Google Translate to translate it to English. That article mentions that "Rev. F" of Family 0Fh supports the RDTSCP instruction. All K8 processors that are branded as revision F (including F2 and F3) and later revisions support RDTSCP. The older K8 processors (including some of the dual-core ones) don't support RDTSCP.

在Intel处理器上,Nehalem和更高版本,Silvermont和更高版本以及Knights Landing和更高版本都支持RDTSCP.

On Intel processors, RDTSCP is supported on Nehalem and later, Silvermont and later, and Knights Landing and later.

脚注1:我只能使用Wayback Machine和此处.在AMD网站上已经不存在了.

Footnote 1: I could only find the article using the Wayback Machine and here. It is not there anymore on the AMD website.

这篇关于包括对RDTSCP的支持的gcc cpu类型是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-18 00:37