首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

PowerPC 体系结构开发者指南(3)

PowerPC 体系结构开发者指南(3)

整数运算指令
很多指令用于执行运算操作,包括 add、substract、negate、compare、multiply 和 divide。很多格式用于立即值、溢出检测以及进位和借位。各实现中 multiply 和 divide 的执行是不同的,因为这些通常是多周期指令。表 4 列出了 PowerPC 整数运算指令。            
表 4. PowerPC 整数运算指令
助记符指令名add[o][.]add [& record OV] [& record CR0]addc[o][.]add carrying [& record OV] [& record CR0]adde[o][.]add extended [& record OV] [& record CR0]addiadd immediateaddisadd immediate shiftedaddic[.]add immediate carrying [& record CR0]addme[o][.]add to minus one [& record OV] [& record CR0]addze[o][.]add to zero [& record OV] [& record CR0]divd[o][.]divide doubleword [& record OV] [& record CR0]divdu[o][.]divide doubleword unsigned [& record OV] [& record CR0]divw[o][.]divide word [& record OV] [& record CR0]divwu[o][.]divide word unsigned [& record OV] [& record CR0]mulhd[.]multiply high doubleword [& record CR0]mulhdu[.]multiply high doubleword unsigned [& record CR0]mulhw[.]multiply high word [& record CR0]mulhwu[.]multiply high word unsigned [& record CR0]mulld[o][.]multiply low doubleword [& record OV] [& record CR0]mullimultiply low immediatemullw[o][.]multiply low word [& record OV] [& record CR0]neg[o][.]negate [& record OV] [& record CR0]subf[o][.]subtract from [& record OV] [& record CR0]subfc[o][.]subtract from carrying [& record OV] [& record CR0]subfe[o][.]subtract from extended [& record OV] [& record CR0]subfisubtract from immediatesubfissubtract from immediate shiftedsubfic[.]subtract from immediate carrying [& record CR0]subfme[o][.]subtract from to minus one [& record OV] [& record CR0]subfze[o][.]subtract from to zero [& record OV] [& record CR0]
逻辑、循环和移位指令
PowerPC 提供了一组完整的逻辑操作(指令),还支持对符号的扩展以及对 GPR 中前置零的统计。表 5 列出了 PowerPC 逻辑指令。            
表 5. PowerPC 逻辑指令
助记符指令名and[.]and [& record CR0]andc[.]and with complement [& record CR0]andi.and immediate & record CR0andis.and immediate shifted & record CR0eqv[.]equivalent [& record CR0]nand[.]not and [& record CR0]nor[.]not or [& record CR0]or[.]or [& record CR0]orc[.]or with complement [& record CR0]orisor immediate shiftedorior immediatexor[.]xor [& record CR0]xorisxor immediate shiftedxorixor immediatecntlzd[.]count leading zeros doubleword [& record CR0]cntlzw[.]count leading zeros word [& record CR0]extsb[.]extend sign byte [& record CR0]extsh[.]extend sign halfword [& record CR0]extsw[.]extend sign word [& record CR0]
PowerPC 提供了一组健壮而强大的循环和移位操作(指令),如表 6 所列。
表 6. PowerPC 循环和移位指令
助记符指令名rldc[.]rotate left doubleword then clear [& record CR0]rldcl[.]rotate left doubleword then clear left [& record CR0]rldcr[.]rotate left doubleword then clear right [& record CR0]rldicl[.]rotate left doubleword immediate then clear left [& record CR0]rldicr[.]rotate left doubleword immediate then clear right [& record CR0]rldimi[.]rotate left doubleword immediate then mask insert [& record CR0]rlwimi[.]rotate left word immediate then mask insert [& record CR0]rlwinm[.]rotate left word immediate then and with mask [& record CR0]rlwnm[.]rotate left word then and with mask [& record CR0]sld[.]shift left doubleword [& record CR0]slw[.]shift left word [& record CR0]srad[.]shift right doubleword [& record CR0]sradi[.]shift right doubleword immediate [& record CR0]sraw[.]shift right word [& record CR0]srawi[.]shift right word immediate [& record CR0]srd[.]shift right doubleword [& record CR0]srw[.]shift right word [& record CR0]
浮点指令
PowerPC 提供了一组健壮的浮点运算、比较和转换操作(指令)。与软件支持一道,PowerPC 浮点运算完全符合 ANSI/IEEE 标准 754-1985 规范。在所有运算和比较操作中都支持单精度和双精度浮点格式。            
虽然浮点数以双精度格式存储于 FPR 中,但是,有一组单精度运算指令,可以执行运算操作并将最终结果舍入为单精度,同时检测进行单精度操作时可能会发生的异常(比如指数溢出、下溢和失去精度)。
  • 一组                    Load Floating-point Single指令可以访问存储器中的字,并在将其放入目标 FPR 前把单精度值转换为双精度值。
  • 一组                    Store Floating-point Single指令可以将源 FPR 中的源操作数在存储到存储器中目标字之前转换为单精度格式。
可以启用或禁用具体种类的浮点异常来支持设陷(trapping) 环境。表 7 列出了基本的和可选的 PowerPC 浮点指令集。
表 7. PowerPC 浮点指令
助记符指令名fmr[.]FP move [& record CR1]fneg[.]FP negate [& record CR1]fabs[.]FP absolute value [& record CR1]fnabs[.]FP negative absolute value [& record CR1]fadd[s][.]FP add [single] [& record CR1]fsub[s][.]FP subtract [single] [& record CR1]fmul[s][.]FP multiply [single] [& record CR1]fdiv[s][.]FP divide [single] [& record CR1]fsqrt[s][.]FP square root [single] [& record CR1]fmadd[s][.]FP multiply-add [single] [& record CR1]fmsub[s][.]FP multiply-subtract [single] [& record CR1]fnmadd[s][.]FP negative multiply-add [single] [& record CR1]fnmsub[s][.]FP negative multiply-subtract [single] [& record CR1]fcmpoFP compare orderedfcmpuFP compare unorderedfsel[.]FP select [& record CR1]frsp[.]FP round to single [& record CR1]fcfid[.]FP convert from integer doubleword [& record CR1]fctid[z][.]FP convert to integer doubleword [& round to zero] [& record CR1]fctiw[z][.]FP convert to integer word [& round to zero] [& record CR1]fres[.]FP reciprocal estimate single [& record CR1]frsqrte[.]FP reciprocal square root estimate [& record CR1]
返回列表