SSE(Streaming SIMD Extensions)是英特尔在AMD的3D Now!发布一年之后,在其计算机芯片Pentium III中引入的指令集,是MMX的超集。AMD后来在Athlon XP中加入了对这个指令集的支持。这个指令集增加了对8个128位寄存器XMM0-XMM7的支持,每个寄存器可以存储4个单精度浮点数。使用这些寄存器的程序必须使用FXSAVE和FXRSTR指令来保持和恢复状态。但是在Pentium III对SSE的实现中,浮点数寄存器又一次被新的指令集占用了,但是这一次切换运算模式不是必要的了,只是SSE和浮点数指令不能同时进入CPU的处理线而已。
库文件说明
#ifndef __METHOD
#define __METHOD
void ScaleValue1(float *pArray, DWORD dwCount, float fScale);//乘法
void ScaleValue2(float *pArray, DWORD dwCount, float fScale);
void Add1(float *pArray, DWORD dwCount, float fScale);//加法
void Add2(float *pArray, DWORD dwCount, float fScale);
void Sqrt1(float *pArray, DWORD dwCount, float fScale);//平方
void Sqrt2(float *pArray, DWORD dwCount, float fScale);
void Min1(float *pArray, DWORD dwCount, float fScale);//最小值
void Min2(float *pArray, DWORD dwCount, float fScale);//最小值
void Max1(float *pArray, DWORD dwCount, float fScale);//最小值
void Max2(float *pArray, DWORD dwCount, float fScale);//最小值
void And1(float *pArray, DWORD dwCount, float fScale);//与操作
void And2(float *pArray, DWORD dwCount, float fScale);//与操作
#endif
#include <xmmintrin.h>
#include <Windows.h>
#include <math.h>
void ScaleValue1(float *pArray, DWORD dwCount, float fScale)