文稿adi tigersharc培訓ts201處理器l1shifter_第1頁
文稿adi tigersharc培訓ts201處理器l1shifter_第2頁
文稿adi tigersharc培訓ts201處理器l1shifter_第3頁
文稿adi tigersharc培訓ts201處理器l1shifter_第4頁
文稿adi tigersharc培訓ts201處理器l1shifter_第5頁
已閱讀5頁,還剩17頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領

文檔簡介

1、SHIFTERShifter2Comp block XShifter - OverviewShifter operationsShifts and rotates,off-scale left to off-scale rightBit manipulation; bit set, clear, toggle, and testBit field manipulation; field extract and depositConversionsscaling factor in 16-bit block floating-pointexponent extract number of lea

2、ding 1s or 0sShifter operates only on fixed-point dataOne 64-bit operandOne or two 32-bit operandsTwo or four 16-bit operandsFour or eight 8-bit operandsComp Block XReg FileALUMACSFTShifter3Shifter - Operations Operand - Syntax conventionsRn operand is the data on which the Shifter operates. Rm oper

3、and specifies shift magnitudes, bit field lengths, or bit positions.Rs operand read-modify-write (RMW) data that is operated on and updated.Note: Only one option available for shifter: instructions - Sign Extension - (SE) Shifter4Shifter - Shift/Rotate (I)The shift and rotate:ASHIFTPerforms arithmet

4、ic shifts.LSHIFTPerforms logical shifts.ROTPerforms rotated shifts.All shift and rotate values are plement signed numbers. A positive value for Rm -LEFT shift or rotateA negative value for Rm -RIGHT shift or rotateShifter computes shift magnitude using the immediate value in the instruction or the L

5、SBs in RmShifter50001 0010 0011 0100 0101 0110 1110 1111 0000 0001 0010 0011 0100 0101 0110 11100010 0011 0100 0101 0110 1110 1111 0000 xxxx xxxx xxxx xxxx xxxx xxxx xxxx 0100RmShift magnitude = 4RnRsRsShift left by 4 bitsShift right by 4 bitsZero fill bits in MSBsZero fill bits in LSBs0 x123456EF0

6、x0123456E0 x000000040 x23456EF0Shifter - Shift/Rotate (II)Example of a logical shift. The contents of Rm are shifted by the number of bits specified in Rm (4) and the result is placed in Rs Rs = LSHIFT Rn BY RmNote for right shift Rm = -4 and for left shift Rm = +4Shifter61001 0010 0011 0100 0101 01

7、10 1110 1111 xxxx xxxx xxxx xxxx xxxx xxxx x111 1000RmRnRsShift right by 8 bitsSign extended MSBs1111 1111 1001 0010 0011 0100 0101 01101110 1111 deleted LSBsArithmetic left shift is identical to Logical left shift0 x923456EF0 xFFFFFFF80 xFF923456Shift value = -8Shifter - Shift/Rotate - ExampleExamp

8、le of an arithmetic shift right by 8 bits. Rm contains the magnitude of the shift (-8)Rs = ASHIFT Rn BY Rm Shifter7The shift magnitude for register file-based operations is specified by the LSBs of the Rm register. The number of bits of Rm used depends on the size of the data:Long words8 bitsNormal

9、words7 bitsShort words6 bitsBytes5 bitsFor immediate-based operations, the number of bits required are:Long words7 bitsNormal words6 bitsShort words5 bitsBytes4 bitsShifter - Shift / Rotate (II)Shift and rotateShift and rotateShift onlyShift onlyShifter8Shifter - Bit ManipulationThe bit manipulation

10、 operations are:BCLRClears a bit.BSETSets a bit.BTGLToggles (XOR with 1) a bit.BITESTTests a bit.Examples:Rs = BCLR Rn By RmRsd = BSET Rnd By RmShifter90001 0010 0011 0100 0101 0111 1110 1111xxxx xxxx xxxx xxxx xxxx xxxx xx00 1000RmRnRs0001 0010 0011 0100 0101 0110 1110 1111Eighth bit in Rn clearedV

11、alue = 80 x000000080 x123456EF0 x123457EF31031318th bitShifter - Bit Manipulation - bit clearExample of a bit manipulation BCLR. The eighth bit (Specified by Rm) of register Rn is cleared and the result placed in RsRs = BCLR Rn By Rm;Shifter10Shifter - Bit Field Manipulation (I)The bit field manipul

12、ation operations are:FEXTExtracts a field from a register according to the length and position specified by another register.FDEPDeposits a right-justified field into a register according to the length and position specified by another register. MASKCopies a 32- or 64-bit field created by a mask.XYS

13、TATLoads or stores all bits or 14 LSBs only of the X/YSTAT register. For field extract and deposit operations, the Rm operand contains the control information in two fields: and . Location of these fields depends on whether Rm is a single- or dual-word register.Shifter1163 32 0 RmdRm31 15 8 6 0 Len

14、specifies the number of bits to extractPos specifies the starting position in RnExtracted bits are stored right-justified in RsShifter - Bit Field Manipulation (II)FEXT extracts a field from a register according to the length and position specified by another register.Rm operand contains the control

15、 information in two fields: and . The location of fields depends if Rm is a single- or dual-word register.Shifter12Rm31 15 8 0 xxxx xxxx xxxx xxxx 0000 0101 x000 1000Length 8 bitsStart at bit 50 x0000050831 15 0 xxxx xxxx xxxx xxxx 0001 0010 0011 010031 15 0 xxxx xxxx xxxx xxxx xxxx xxxx 1001 0001 R

16、nRs0 x000012340 x00000091bit 5Shifter - Bit Field Manipulation (III)Example of a Field Extract (FEXT) 8 bits from Rn, starting at 6th bit are copied and placed in LSBs of Rs. Rs = FEXT Rn By Rm;Shifter13Shifter - Conversion OperationsThe floating-point conversion support operations are:BKFPTDetermin

17、es scaling factor used in 16-bit block floating-point.EXPExtracts the exponent.LDxExtracts leading zeros (0) or ones (1)Shifter14Shifter - Bit Stream Manipulation (I)The bit stream manipulation operations are:GETBITSExtracts bits from a bit stream.PUTBITSDeposits bits in a bit stream.BFOTMPTemporari

18、ly stores or returns overflow from GETBITS and PUTBITS instructions.The bit stream manipulation operations, in conjunction with the ALU BFOINC instruction, implement a bit FIFO used for modifying the bits in a contiguous bit stream.For bit stream extract and deposit operations, the Rmd operand conta

19、ins the control information in two fields: and . These fields form a register pair, RmdShifter1531 0 31 0BFP6Len6RmdRbRbBFP - 6-bit field the current Bit FIFO Pointer and points to the location of the bitstream in Rnq where extraction/insertion starts Len - 6-bit field - specifies the number of bits

20、 to extract Note: Bit FIFO Pointer must be incremented using the BFOINC ALU instructionShifter - Bit Stream Manipulation (II)GETBITS - Extracts bits from a bit streamRsd = GETBITS Rnq BY RmdDouble Rmd contains the control information for the GETBITS / PUTBITS operationsShifter16Shifter places extrac

21、ted bits in Rsd right justified starting at bit 0. SE option - sign extend - fills bits with the same value as the MSB of the extracted data 31 0RnqRfBFP6Len6RsReRdRcRkRhShifter - Bit Stream Manipulation (III)Rsd = GETBITS Rnq BY RmdQuad register Rnq is the source register , Rs is the destination re

22、gisterShifter17Shifter - Status Flags The Shifter updates two flags in the XSTAT and YSTAT status registers at the end of each operation. The flags are:BFBlock floating-point flag. Updated for the BKFPT instruction only.SNShifter result negative.SZShifter result zeroSF0 and SF1 are the computation b

23、lock static flag 0 and flag 1 conditionsShifter18Shifter - ConditionsShifter conditionsConditionDescription Flags setSEQ Equal to zeroSZSLT Less than zeroSN and SZNSEQ Not equal to zeroSZNSLT Not less than zeroSN and SZ Examplesif XSLT, Jump Label_10;if NYSLT, Jump Label_12;if NSLT; DO R3=R5+R6; SHIFTER Reference MaterialShifter20Shifter - Instruction Summary (I)Shifter instructions X|Y|XY S|B Rs = LSHIFT|ASHIFT Rn BY Rm|X|Y|XY L|S|BRsd= LSHIFT|ASHIFT Rnd BY Rm|X|Y|XY

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論