版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Floating-Point Unit,Copyright 2009 Texas Instruments. All rights reserved.,Appendix E TMS320C28x MCU Workshop,Learning Objectives,Architecture floating-point format, registers, and pipeline Instructions instruction types, delay slots, parallel instructions, RPTB, floating-point flags Instruction Sum
2、mary,IEEE Single-Precision Floating-Point Format,* Normal Positive and Negative Values are Calculated as: ( -1 ) s x 2 (E-127) x 1.M+/- 1.7 x 10 -38 to +/- 3.4 x 10 +38,The Normalized IEEE numbers have a hidden 1; thus the equivalent signed integer resolution is the number of mantissa bits + sign +
3、1,23-bit Mantissa (Implicit Leading Bit + Fraction Bits),8-bit Exponent (Biased),1 Sign Bit (0 = Positive, 1 = Negative),IEEE Single-Precision Floating-Point Format (IEEE 754),Most widely used standard for floating-point Standard number formats, Special values (NaN, Infinity) Rounding modes 2p instr
4、uction NOP ; 1 cycle delay ; ; Can use R2H ;,MPYF32 R2H, R1H, R0H ; 2p instruction NOP ; 1 cycle delay for MPYF32 ; ; Can use R2H ; ;,MPYF32 R2H, R1H, R0H ; 2p instruction ADDF32 R3H, R3H, R1H ; 1 cycle delay for MPYF32 ; - MPYF32 completes, R2H valid NOP ; 1 cycle delay for ADDF32 ; - ADDF32 comple
5、te, R3H valid ;,MPYF32 R2H, R1H, R0H ; 2p instruction ADDF32 R3H, R3H, R1H ; 1 cycle delay for MPYF32 ; - MPYF32 completes, R2H valid MOV32 *XAR7, R2H ; 1 cycle delay for ADDF32 ; - ADDF32 complete, R3H valid ;,MPYF32 R2H, R1H, R0H ; 2p instruction ADDF32 R3H, R3H, R1H ; 1 cycle delay for MPYF32 ; -
6、 MPYF32 completes, R2H valid MOV32 *XAR7, R2H ; 1 cycle delay for ADDF32 ; - ADDF32 complete, R3H valid ; - MOV32 complete,Math Operations: 2p (2 pipelined) cycles Can be launched every cycle Result is valid 2 instructions later,Move Operation: 1 cycle,Parallel Instructions,ADDF32 R3H, R3H, R1H | MO
7、V32 *XAR7, R3H,Single Instruction Single Opcode Performs 2 Operations Example: Add + Parallel Store,Parallel Bars Indicate A Parallel Instruction,Note: cycle information is given for both operation,Multiply and Store Parallel Instruction,MPYF32 R2H, R1H, R0H | MOV32 *XAR3, R2H,; 2p/1 instruction ; ;
8、 Can use R2H,; Before: R0H = 2.0, R1H = 3.0, R2H = 10.0 MPYF32 R2H, R1H, R0H ; 2p/1 instruction | MOV32 *XAR3, R2H ; ; Can use R2H ; After: R2H = ? *XAR3 = ?,; Before: R0H = 2.0, R1H = 3.0, R2H = 10.0 MPYF32 R2H, R1H, R0H ; 2p/1 instruction | MOV32 *XAR3, R2H ; ; Can use R2H ; After: R2H = R1H * R0H
9、 = 3.0 * 2.0 ; *XAR3 = 10.0,Math Operations: 2p (2 pipelined) cycles Can be launched every cycle Result is valid 2 instructions later Move Operation: 1 cycle,Parallel Instruction: MOV32 used the value of R2H before the MPY32 update,Multiply and Store Parallel Instruction,; MPYF32 R2H, R1H, R0H ; 2p/
10、1 instruction | MOV32 *XAR3, R2H ; - MOV32 complete MOV32 R1H, *XAR4 ; Delay for MPYF32 ; - R2H updated, R1H updated ADDF32 R2H, R2H, R1H ; Can use R2H ;,Math Operations: 2p (2 pipelined) cycles Can be launched every cycle Result is valid 2 instructions later Move Operation: 1 cycle,Parallel Instruc
11、tion: MOV32 used the value of R2H before the MPY32 update,Using Floating-Point Status Flags,LVF,LUF,NF,ZF,rsvd,TF,ZI,Floating-Point Status Register STF (32-bits),NI,RND F32,rsvd,SHDWS,Latched overflow Loop if (R1H R0H),Program control is through the C28x status register (ST0) flags Use MOVST0 to cop
12、y FPU flags to ST0,Repeat Block,Improves performance of block algorithms (FFT, IIR) 0 cycles after the first iteration,; find the largest element and ; put its address in XAR6 .align 2 NOP RPTB VECTOR_MAX_END, AR7 MOVL ACC,XAR0 MOV32 R1H,*XAR0+ MAXF32 R0H,R1H MOVST0 NF,ZF MOVL XAR6,ACC,LT VECTOR_MAX
13、_END:,RC(15),RE(7),RSIZE(7),30,Repeat Block Register RB (32),RA,RAS,29:23,22:16,15:0,31,RC: Repeat CountBlock Executes RC+1,RA = 1 RPTB Active,RE: End address,RSIZE: RPTB Block Size Max: 127 x 16 WordsMin: 8 words (odd aligned) 9 words (even aligned),RA = 0,Hardware Manages RB,Assembler Checks Size
14、Align stack PUSH RB ; Save RB if used PUSH AR1H:AR0H ; Save if used PUSH XAR2 PUSH XAR3 PUSH XAR4 PUSH XAR5 PUSH XAR6 PUSH XAR7 PUSH XT SPM 0 ; Set C28 modes CLRC AMODE CLRC PAGE0,OVM SAVE RNDF32=1 ; FPU registers ; set FPU mode . .,Full Context Save,. . RESTORE ; FPU registers POP XT ; Restore regi
15、sters POP XAR7 POP XAR6 POP XAR5 POP XAR4 POP XAR3 POP XAR2 POP AR1H:AR0H POP RB ; Restore RB NASP ; Un-align stack IRET ; Return,Full Context Restore,22 Cycles (worst case if all registers are saved),19 Cycles (worst case if all registers are restored),Note: The following critical registers are aut
16、omatically saved on an interrupt: ACC, P, XT, ST0, ST1, IER, DP, AR0, AR1, PC,. . MOV32 R7H,*-SP ; Restore R0H to R7H . . MOV32 R0H,*-SP MOV32 STF,*-SP ; Restore STF POP XT ; Restore XT POP XAR7 ; Restore XAR0 to XAR7 POP XAR6 POP XAR5 POP XAR4 POP XAR3 POP XAR2 POP AR1H:AR0H MOVW DP,#PIE SETC INTM
17、; Disable Interrupts POP RB ; Restore RB NASP ; Un-align Stack Pointer MOV AL,*-SP MOV PIEIERn,AL ; Restore PIE Interrupt Priority IRET ; Return From Interrupt,Full Context Restore,_LowerPriorityISR: MOVW DP,#PIE ; Set PIE Interrupt Priority MOV AL,PIEIERn OR IER,#INTn_PRIORITY_MASK AND IER,#IER_PRI
18、ORITY_MASK MOV PIEIERn,#PIEIERn_PRIORITY_MASK MOV PIEACK,#0 xFFFF MOV *SP+,AL ASP ; Align Stack Pointer PUSH RB ; Save RB CLRC INTM ; Enable Interrupts PUSH AR1H:AR0H ; Save XAR0 to XAR7 PUSH XAR2 PUSH XAR3 PUSH XAR4 PUSH XAR5 PUSH XAR6 PUSH XAR7 PUSH XT ; Save XT MOV32 *SP+,STF ; Save STF MOV32 *SP
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2030衢州府治孔子廟及祭祀場(chǎng)所行業(yè)文化遺產(chǎn)保護(hù)與開(kāi)發(fā)投資規(guī)劃分析
- 2025-2030葡萄牙葡萄酒產(chǎn)業(yè)競(jìng)爭(zhēng)力分析及特色飲料酒類(lèi)投資
- 常州常州大學(xué)2025年公開(kāi)招聘專(zhuān)職輔導(dǎo)員(博士)筆試歷年參考題庫(kù)附帶答案詳解
- 山東山東藝術(shù)學(xué)院2025年公開(kāi)招聘4人筆試歷年參考題庫(kù)附帶答案詳解
- 安徽2025年安徽無(wú)為市事業(yè)單位選調(diào)10名事業(yè)單位工作人員筆試歷年參考題庫(kù)附帶答案詳解
- 寧波浙江寧波市鄞州人民醫(yī)院醫(yī)共體東吳分院編外工作人員招聘筆試歷年參考題庫(kù)附帶答案詳解
- 寧德2025年福建寧德福鼎市中小學(xué)幼兒園新任教師招聘97人筆試歷年參考題庫(kù)附帶答案詳解
- 天津2025年天津市第一商業(yè)學(xué)校招聘7人筆試歷年參考題庫(kù)附帶答案詳解
- 天津2025年天津市北辰區(qū)中醫(yī)醫(yī)院招聘筆試歷年參考題庫(kù)附帶答案詳解
- 四川川北醫(yī)學(xué)院2025年11月公開(kāi)招聘22人筆試歷年參考題庫(kù)附帶答案詳解
- 郵政服務(wù)操作流程與規(guī)范(標(biāo)準(zhǔn)版)
- 2025年年輕人生活方式洞察報(bào)告-海惟智庫(kù)
- 2026昆山鈔票紙業(yè)有限公司校園招聘15人備考題庫(kù)及1套完整答案詳解
- 2026年重慶市江津區(qū)社區(qū)專(zhuān)職人員招聘(642人)考試參考題庫(kù)及答案解析
- 統(tǒng)編版(2024)七年級(jí)上冊(cè)道德與法治期末復(fù)習(xí)必背知識(shí)點(diǎn)考點(diǎn)清單
- 新華資產(chǎn)招聘筆試題庫(kù)2026
- 造口常用護(hù)理用品介紹
- 小米銷(xiāo)售新人培訓(xùn)
- (新教材)2025年秋期部編人教版二年級(jí)上冊(cè)語(yǔ)文第七單元復(fù)習(xí)課件
- 康定情歌音樂(lè)鑒賞
- 銀行安全保衛(wèi)基礎(chǔ)知識(shí)考試試題及答案
評(píng)論
0/150
提交評(píng)論