首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 汇编语言 >

hadoop native库汇编代码编译有关问题

2013-08-04 
hadoop native库汇编代码编译问题hadoop 2的如下文件hadoop-common-project/hadoop-common/src/main/nativ

hadoop native库汇编代码编译问题
hadoop 2的如下文件hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/util/bulk_crc32.c存在如下代码:

inline uint64_t _mm_crc32_u64(uint64_t crc, uint64_t value) {
  asm("crc32q %[value], %[crc]\n" : [crc] "+r" (crc) : [value] "rm" (value));
  return crc;
}
#  endif

inline uint32_t _mm_crc32_u32(uint32_t crc, uint32_t value) {
  asm("crc32l %[value], %[crc]\n" : [crc] "+r" (crc) : [value] "rm" (value));
  return crc;
}

inline uint32_t _mm_crc32_u16(uint32_t crc, uint16_t value) {
  asm("crc32w %[value], %[crc]\n" : [crc] "+r" (crc) : [value] "rm" (value));
  return crc;
}

inline uint32_t _mm_crc32_u8(uint32_t crc, uint8_t value) {
  asm("crc32b %[value], %[crc]\n" : [crc] "+r" (crc) : [value] "rm" (value));
  return crc;
}

在开发机器上可以正常编译,但是在运营机器上无法编译,貌似是cpu内核不支持,错误提示:
/tmp/ccCSuKMW.s: Assembler messages:
/tmp/ccCSuKMW.s:360: Error: no such instruction: `crc32q %rsi,%rdi'
/tmp/ccCSuKMW.s:378: Error: no such instruction: `crc32l %esi,%edi'
/tmp/ccCSuKMW.s:396: Error: no such instruction: `crc32w %si,%edi'
/tmp/ccCSuKMW.s:414: Error: no such instruction: `crc32b %sil,%edi'
/tmp/ccCSuKMW.s:712: Error: no such instruction: `crc32q (%rcx),%rax'
/tmp/ccCSuKMW.s:761: Error: no such instruction: `crc32b %al,%ecx'
/tmp/ccCSuKMW.s:772: Error: no such instruction: `crc32w %ax,%ecx'
/tmp/ccCSuKMW.s:804: Error: no such instruction: `crc32b %al,%ecx'
/tmp/ccCSuKMW.s:823: Error: no such instruction: `crc32w %ax,%ecx'
/tmp/ccCSuKMW.s:833: Error: no such instruction: `crc32l (%rsi),%ecx'
/tmp/ccCSuKMW.s:847: Error: no such instruction: `crc32l (%rsi),%ecx'
/tmp/ccCSuKMW.s:868: Error: no such instruction: `crc32b %al,%ecx'
cpu信息是:
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Xeon(R) CPU           E5506  @ 2.13GHz


stepping        : 5
cpu MHz         : 2133.000
cache size      : 32 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca popcnt lahf_lm
bogomips        : 4266.82
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual

求大神支招。。。。
[解决办法]
好奇怪的参数,cpu核心竟然是1,缓存大小也不对。
相应的,flags里面显示的指令集只有sse和sse2,真奇怪,E5506是支持到sse4.2的。
你编译出错也就是这个地方,CRC校验指令需要sse4。

你这个参数看起来很奇怪,找个系管问问,看是怎么回事。
[解决办法]
四核cpu应该cpu cores的值是4,而上面是1,4条信息应该是core id分别为0 1 2 3
cache size只有32kb先不说
最后一个processor 标号是3,但core id是0
cpu cores的值是1,而siblings的值却又是4... 
难道这是传说中的单核超4线程???!!!...

热点排行