Intel C++ Compiler强奸AMD CPU的证据

本文揭示了Intel C++ Compiler在libirc.lib中的代码片段,这些代码用于检测CPU制造商,若非"GenuineIntel"则会跳过某些功能。作者提供了perl脚本`icc_hack`来移除这一检查,使得SSE/SSE2等指令在AMD CPU上也能正常工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

Update 2010/01/04

 

http://www.osnews.com/story/22683/Intel_Forced_to_Remove_quot_Cripple_AMD_quot_Function_from_Compiler_

 

但我测试Intel C++的最新版本11.1.054时发现intel并没有修正该问题

 

------------------------------------------------------------------

 反汇编Intel C++ 安装目录中的lib中的libirc.lib会得到如下输出:

 00000000 <___intel_cpu_indicator_init>:

   0: 50                   push   %eax

   1: 52                   push   %edx

   2: 51                   push   %ecx

   3: 53                   push   %ebx

   4: 57                   push   %edi

   5: 56                   push   %esi

   6: 55                   push   %ebp

   7: 8b ec                mov    %esp,%ebp

   9: 83 ec 50             sub    $0x50,%esp

   c: 9c                   pushf  

   d: 58                   pop    %eax

   e: 8b c8                mov    %eax,%ecx

  10: 35 00 00 20 00       xor    $0x200000,%eax

  15: 50                   push   %eax

  16: 9d                   popf   

  17: 9c                   pushf  

  18: 58                   pop    %eax

  19: 3b c1                cmp    %ecx,%eax

  1b: 74 27                je     44 <___intel_cpu_indicator_init+0x44>

  1d: 51                   push   %ecx

  1e: 9d                   popf   

  1f: 33 c0                xor    %eax,%eax

  21: 0f a2                cpuid  

  23: 89 45 f8             mov    %eax,-0x8(%ebp)

  26: 89 5d fc             mov    %ebx,-0x4(%ebp)

  29: 89 4d ec             mov    %ecx,-0x14(%ebp)

  2c: 89 55 f4             mov    %edx,-0xc(%ebp)

  2f: b8 01 00 00 00       mov    $0x1,%eax

  34: 0f a2                cpuid  

  36: 89 45 f0             mov    %eax,-0x10(%ebp)

  39: 89 5d dc             mov    %ebx,-0x24(%ebp)

  3c: 89 4d e4             mov    %ecx,-0x1c(%ebp)

  3f: 89 55 e8             mov    %edx,-0x18(%ebp)

  42: eb 1a                jmp    5e <___intel_cpu_indicator_init+0x5e>

  44: 33 c0                xor    %eax,%eax

  46: 89 45 f8             mov    %eax,-0x8(%ebp)

  49: 89 45 fc             mov    %eax,-0x4(%ebp)

  4c: 89 45 ec             mov    %eax,-0x14(%ebp)

  4f: 89 45 f4             mov    %eax,-0xc(%ebp)

  52: 89 45 f0             mov    %eax,-0x10(%ebp)

  55: 89 45 dc             mov    %eax,-0x24(%ebp)

  58: 89 45 e4             mov    %eax,-0x1c(%ebp)

  5b: 89 45 e8             mov    %eax,-0x18(%ebp)

  5e: 81 7d fc 47 65 6e 75 cmpl   $0x756e6547,-0x4(%ebp)

  65: 75 19                jne    80 <___intel_cpu_indicator_init+0x80>

  67: 81 7d f4 69 6e 65 49 cmpl   $0x49656e69,-0xc(%ebp)

  6e: 75 10                jne    80 <___intel_cpu_indicator_init+0x80>

  70: 81 7d ec 6e 74 65 6c cmpl   $0x6c65746e,-0x14(%ebp)

  77: 75 07                jne    80 <___intel_cpu_indicator_init+0x80>

  79: b8 01 00 00 00       mov    $0x1,%eax

  7e: eb 02                jmp   &nbs

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值