SSE 程序在 AMD 上比在 Intel 上花费的时间要长得多

发布于 2024-11-15 22:33:15 字数 397 浏览 4 评论 0原文

我正在使用 SSE2 指令优化算法。但我在测试性能时遇到了这个问题:

I) Intel e6750

  1. 执行 4 次非 SSE2 算法需要 14.85 秒
  2. 执行 1 次 SSE2 算法(处理相同的数据)需要 6.89 秒

II) Phenom II x4 2.8 Ghz

  1. 执行 4 次非 SSE2 算法需要 11.43 秒
  2. 执行 1 次 SSE2 算法(处理相同data)需要 12.15 秒

任何人都可以帮助我为什么会发生这种情况?我对结果真的很困惑。

在这两种情况下,我都使用 -O3 作为标志使用 g++ 进行编译。

PS:该算法不使用浮点数学,它使用 SSE 的整数指令。

I am working in the optimization of an algorithm using SSE2 instructions. But I have run into this problem when I was testing the performance:

I) Intel e6750

  1. Doing 4 times the non-SSE2 algorithm takes 14.85 seconds
  2. Doing 1 time the SSE2 algorithm(processes the same data) takes 6.89 seconds

II) Phenom II x4 2.8Ghz

  1. Doing 4 times the non-SSE2 algorithm takes 11.43 seconds
  2. Doing 1 time the SSE2 algorithm(processes the same data) takes 12.15 seconds

Anyone can help me why this is happening? I'm really confused about the results.

In both cases I'm compiling with g++ using -O3 as flag.

PS: The algorithm doesn't use floating point math, it uses the SSE's integer instructions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2024-11-22 22:33:15

在过去 5 年左右的时间里,英特尔对其 SSE 实施进行了重大改进,而 AMD 并没有真正跟上。最初,两者实际上都只是 64 位执行单元,128 位操作被分解为 2 个微操作。不过,自从推出 Core 和 Core 2 以来,Intel CPU 就拥有完整的 128 位 SSE 实现,这意味着 128 位操作有效地获得了 2 倍的吞吐量提升(1 个微操作与 2 个微操作)。较新的 Intel CPU 还具有多个 SSE 执行单元,这意味着您可以获得 > 128 位 SIMD 指令每时钟吞吐量 1 条指令。

Intel has made big improvements to their SSE implementation over the last 5 years or so, which AMD has not really kept up with. Originally both were really just 64 bit execution units, and 128 bit operations were broken down into 2 micro-ops. Ever since Core and Core 2 were introduced though, Intel CPUs have had a full 128 bit SSE implementation, which means that 128 bit operations effectively got a 2x throughput boost (1 micro op versus 2). More recent Intel CPUs also have multiple SSE execution units which means you can get > 1 instruction per clock throughput for 128 bit SIMD instructions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文