SSE INSTRUCTION SET:
• Packed and scalar single-precision floating-point instructions
• 64-bit SIMD integer instructions
• State management instructions
• Cacheability control, prefetch, and memory ordering instructions
这问题基本上没啥意义。sse1也只在在单精度浮点上混混日子。
搭车请教各位一个以前碰到的问题,怎么才能让libm库的sin/cos系列函数支持sse?
我已经把libm编译成sse支持,简单用objdump检查一下,
objdump -d /lib/libm-2.7.so |grep xmm
35b3: f2 0f 10 4d 08 movsd 0x8(%ebp),%xmm1
35b8: f2 0f 10 45 10 movsd 0x10(%ebp),%xmm0
35c0: f2 0f 11 4d e0 movsd %xmm1,-0x20(%ebp)
35c5: f2 0f 11 45 e8 movsd %xmm0,-0x18(%ebp)
......(很长)
证明已经支持sse ,但是如果检查fsin指令,结果:
a834: d9 fe fsin
a853: d9 fe fsin
c224: d9 fb fsincos
c253: d9 fb fsincos
c34e: d9 fb fsincos
c385: d9 fb fsincos
c3c8: d9 fb fsincos
c425: d9 fb fsincos
13294: d9 fe fsin
.....(比较长)
证明x87的浮点指令仍然不可避免。
三角函数很常用。做不到这一点,没法真正比较x87与sse两个指令集的浮点总体性能(单指令能力+指令集是否完备)。
[ 本帖最后由 紫色 于 2007-12-1 21:17 编辑 ] |