3DNow!指令简明参考
指令 说明 算法
FEMMS 快速切换3DNow!/MMX指令和浮点指令状态。
PAVGUSB mmreg1, mmreg2/mem64 8位的无符号压缩整数求平均值。 mmreg1[63:56] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[55:48] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[47:40] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[39:32] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[31:24] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[23:16] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[15:08] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
mmreg1[07:00] = (mmreg1[63:56] + mmreg2/mem64[63:56] + 1) / 2
PF2ID mmreg1, mmreg2/mem64 把压缩浮点数转化为32位压缩整数。 if (mmreg2/mem64[31:0] >= 231)
mmreg1[31:0] = 7FFF_FFFFh
else
{
if (mmreg2/mem64[31:0] <= –231)
mmreg1[31:0] = 8000_0000h
else
mmreg1[31:0] = int(mmreg2/mem64[31:0])
}
if (mmreg2/mem64[63:32] >= 231)
mmreg1[63:32] = 7FFF_FFFFh
else
{
if (mmreg2/mem64[63:32] <= –231)
mmreg1[63:32] = 8000_0000h
else
mmreg1[63:32] = int(mmreg2/mem64[63:32])
}
PFACC mmreg1, mmreg2/mem64 压缩浮点数累加。 mmreg1[31:00] = mmreg1[31:00] + mmreg1[63:32]
mmreg1[63:32] = mmreg2/mem64[31:00] + mmreg2/mem64[63:32]
PFADD mmreg1, mmreg2/mem64 压缩浮点数相加。 mmreg1[31:00] = mmreg1[31:00] + mmreg2/mem64[31:00]
mmreg1[63:32] = mmreg1[63:32] + mmreg2/mem64[63:32]
PFCMPEQ mmreg1, mmreg2/mem64 比较压缩浮点数是否相等。 if (mmreg1[31:00] == mmreg2/mem64[31:00])
mmreg1[31:00] = FFFF_FFFFh
else
mmreg1[31:00] = 0000_0000h
if (mmreg1[63:32] == mmreg2/mem64[63:32])
mmreg1[63:32] = FFFF_FFFFh
else
mmreg1[63:32] = 0000_0000h
PFCMPGE mmreg1, mmreg2/mem64 对压缩浮点数作“大于等于”的判断。 if (mmreg1[31:00] >= mmreg2/mem64[31:00])
mmreg1[31:00] = FFFF_FFFFh
else
mmreg1[31:00] = 0000_0000h
if (mmreg1[63:32] >= mmreg2/mem64[63:32])
mmreg1[63:32] = FFFF_FFFFh
else
mmreg1[63:32] = 0000_0000h
PFCMPGT mmreg1, mmreg2/mem64 对压缩浮点数作是否“大于”的判断。 if (mmreg1[31:00] > mmreg2/mem64[31:00])
mmreg1[31:00] = FFFF_FFFFh
else
mmreg1[31:00] = 0000_0000h
if (mmreg1[63:32] > mmreg2/mem64[63:32])
mmreg1[63:32] = FFFF_FFFFh
else
mmreg1[63:32] = 0000_0000h
PFMAX mmreg1, mmreg2/mem64 压缩浮点数求最大值。 if (mmreg1[31:00] > mmreg2/mem64[31:00])
mmreg1[31:00] = mmreg1[31:00]
else
mmreg1[31:00] = mmreg2/mem64[31:00]
if (mmreg1[63:32] > mmreg2/mem64[63:32])
reg1[63:32] = mmreg1[63:32]
else
reg1[63:32] = mmreg2/mem64[63:32]
PFMIN mmreg1, mmreg2/mem64 压缩浮点数求最小值。 if (mmreg1[31:00] < mmreg2/mem64[31:00])
mmreg1[31:00] = mmreg1[31:00]
else
mmreg1[31:00] = mmreg2/mem64[31:00]
if (mmreg1[63:32] < mmreg2/mem64[63:32])
mmreg1[63:32] = mmreg1[63:32]
else
mmreg1[63:32] = mmreg2/mem64[63:32]
PFMUL mmreg1, mmreg2/mem64 压缩浮点数乘法运算。 mmreg1[31:00] = mmreg1[31:00] * mmreg2/mem64[31:00]
mmreg1[63:32] = mmreg1[63:32] * mmreg2/mem64[63:32]
PFRCP mmreg1, mmreg2/mem64 压缩浮点数倒数的近似值。 mmreg1[31:00] = 1.0f / mmreg2/mem64[31:00]
mmreg1[63:32] = 1.0f / mmreg2/mem64[31:00]
PFRCPIT1 mmreg1, mmreg2/mem64 压缩浮点数到数迭代的第一步。
PFRCPIT2 mmreg1, mmreg2/mem64 压缩浮点数的倒数(或浮点数平方根的倒数)的迭代的第二步。
PFRSQIT1 mmreg1,mmreg2/mem64 压缩浮点数的平方根的倒数的迭代的第一步。
PFRSQRT mmreg1, mmreg2/mem64 求浮点数平方根的倒数的近似值。 mmreg1[31:00] = 1.0f / sqrt(mmreg2/mem64[31:00])
mmreg1[63:32] = 1.0f / sqrt(mmreg2/mem64[31:00])
PFSUB mmreg1, mmreg2/mem64 压缩浮点数减法运算。 mmreg1[31:00] = mmreg1[31: 0] - mmreg2/mem64[31:00]
mmreg1[63:32] = mmreg1[63:32] - mmreg2/mem64[63:32]
PFSUBR mmreg1, mmreg2/mem64 压缩浮点数反向减法运算。 mmreg1[31:00] = mmreg2/mem64[31:00] - mmreg1[31:00]
mmreg1[63:32] = mmreg2/mem64[63:32] - mmreg1[63:32]
PI2FD mmreg1, mmreg2/mem64 将压缩的32位整数转化成浮点数。 mmreg1[31:00] = float(mmreg2 / mem64[31:00])
mmreg1[63:32] = float(mmreg2 / mem64[63:32])
PMULHRW mmreg1, mreg2/mem64 将16位有符号压缩整数相乘,并作循环处理。保存结果的高16位。 mmreg1[63:48] = (mmreg1[63:48] * mmreg2/mem64[63:48] + 8000h) >> 16
mmreg1[47:32] = (mmreg1[47:32] * mmreg2/mem64[47:32] + 8000h) >> 16
mmreg1[31:16] = (mmreg1[31:16] * mmreg2/mem64[31:16] + 8000h) >> 16
mmreg1[15:00] = (mmreg1[15:00] * mmreg2/mem64[15:00] + 8000h) >> 16
PREFETCH(W) mem8 数据预取指令,把将要用到的数据置入L1数据缓存。
3DNow!扩展指令简明参考
指令 说明 算法
PF2IW memreg1, memreg2/mem64 把压缩浮点数转化为16位整数。 if (mmreg2/mem64[31:00] >= 215)
mmreg1[31:00] = 0000_7FFFh
else
{
if (mmreg2/mem64[31:00] <= -215)
mmreg1[31:00] = FFFF_8000h
else
mmreg1[31:00] = int(mmreg2/mem64[31:00])
}
if (mmreg2/mem64[63:32] >= 215)
mmreg1[63:32] = 0000_7FFFh
else
{
if (mmreg2/mem64[63:32] <= -215)
mmreg1[63:32] = FFFF_8000h
else
mmreg1[63:32] = int(mmreg2/mem64[63:32])
}
PFNACC mmreg1, mmreg2/mem64 压缩浮点数累减 mmreg1[31:00] = mmreg1[31:00] - mmreg1[63:32]
mmreg1[63:32] = memreg2/mem64[31:0] - memreg2/mem64[63:32]
PFPNACC mmreg1, mreg2/mem64 压缩浮点数混合加减 mmreg1[31:00] = mmreg1[31:00] - mmreg1[63:32]
mmreg1[63:32] = memreg2/mem64[31:00] + memreg2/mem64[63:32]
PI2FW mmreg1, mmreg2/mem64 压缩16位整数转化成浮点数 mmreg1[31:00] = float(mmreg2/mem64[15:00])
mmreg1[63:32] = float(mmreg2/mem64[47:32])
PSWAPD mmreg1, mmreg2/mem64 压缩交换双字 mmreg1[63:32] = mmreg2/mem64[31:00]
mmreg1[31:00] = mmreg2/mem64[63:32]
本文地址:http://com.8s8s.com/it/it23713.htm