計算機組成原理教學課件:FloatingPoint_第1頁
計算機組成原理教學課件:FloatingPoint_第2頁
計算機組成原理教學課件:FloatingPoint_第3頁
計算機組成原理教學課件:FloatingPoint_第4頁
計算機組成原理教學課件:FloatingPoint_第5頁
已閱讀5頁,還剩45頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

FloatingPointPresentationOutlineFloating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsProgramminglanguagessupportnumberswithfractionCalledfloating-point

numbersExamples: 3.14159265…(π) 2.71828…(e) 0.000000001or1.0×10–9(secondsinananosecond) 86,400,000,000,000or8.64×1013(nanosecondsinaday)

lastnumberisalargeintegerthatcannotfitina32-bitintegerWeuseascientificnotationtorepresentVerysmallnumbers(e.g.1.0×10–9)Verylargenumbers(e.g.8.64×1013)Scientificnotation:±d

.

f1f2f3f4…×10±e1e2e3TheWorldisNotJustIntegersExamplesoffloating-pointnumbersinbase10…5.341×103,0.05341×105,–2.013×10–1,–201.3×10–3Examplesoffloating-pointnumbersinbase2…1.00101×223,0.0100101×225,–1.101101×2–3,–1101.101×2–6ExponentsarekeptindecimalforclarityThebinarynumber(1101.101)2=23+22+20+2–1+2–3=13.625Floating-pointnumbersshouldbenormalizedExactlyonenon-zerodigitshouldappearbeforethepointInadecimalnumber,thisdigitcanbefrom1to9Inabinarynumber,thisdigitshouldbe1NormalizedFPNumbers:5.341×103and–1.101101×2–3NOTNormalized:0.05341×105and–1101.101×2–6Floating-PointNumbersdecimalpointbinarypointAfloating-pointnumberisrepresentedbythetripleSistheSignbit(0ispositiveand1isnegative)RepresentationiscalledsignandmagnitudeEistheExponentfield(signed)VerylargenumbershavelargepositiveexponentsVerysmallclose-to-zeronumbershavenegativeexponentsMorebitsinexponentfieldincreases

rangeofvaluesFistheFractionfield(fractionafterbinarypoint)MorebitsinfractionfieldimprovestheprecisionofFPnumbers Valueofafloating-pointnumber=(-1)S

×val(F)×2val(E)Floating-PointRepresentationSExponentFractionNext...Floating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsIEEE754Floating-PointStandardFoundinvirtuallyeverycomputerinventedsince1980Simplifiedportingoffloating-pointnumbersUnifiedthedevelopmentoffloating-pointalgorithmsIncreasedtheaccuracyoffloating-pointnumbersSinglePrecisionFloatingPointNumbers(32bits)1-bitsign+8-bitexponent+23-bitfractionDoublePrecisionFloatingPointNumbers(64bits)1-bitsign+11-bitexponent+52-bitfractionSExponent8Fraction23SExponent11Fraction52(continued)Foranormalizedfloatingpointnumber(S,E,F)Significandisequalto(1.F)2=(1.f1f2f3f4…)2IEEE754assumeshidden1.

(notstored)fornormalizednumbersSignificandis1bitlongerthanfractionValueofaNormalizedFloatingPointNumberis (–1)S

×(1.F)2×2val(E) (–1)S

×(1.f1f2f3f4…)2×2val(E) (–1)S

×(1+f1×2-1+f2×2-2+f3×2-3+f4×2-4…)2×2val(E)

(–1)S

is1whenSis0(positive),and–1whenSis1(negative)NormalizedFloatingPointNumbersSEF=f1

f2

f3

f4

…BiasedExponentRepresentationHowtorepresentasignedexponent?Choicesare…Sign+magnituderepresentationfortheexponentTwo’scomplementrepresentationBiasedrepresentationIEEE754usesbiasedrepresentationfortheexponentValueofexponent=val(E)=E–Bias(Biasisaconstant)Recallthatexponentfieldis8bitsforsingleprecisionEcanbeintherange0to255E=0andE=255arereservedforspecialuse(discussedlater)E=1to254areusedfornormalizedfloatingpointnumbersBias=127(halfof254),val(E)=E

–127val(E=1)=–126,val(E=127)=0,val(E=254)=127BiasedExponent–Cont’dFordoubleprecision,exponentfieldis11bitsEcanbeintherange0to2047E=0andE=2047arereservedforspecialuseE=1to2046areusedfornormalizedfloatingpointnumbersBias=1023(halfof2046),val(E)=E

–1023val(E=1)=–1022,val(E=1023)=0,val(E=2046)=1023ValueofaNormalizedFloatingPointNumberis (–1)S

×(1.F)2×2E–Bias (–1)S

×(1.f1f2f3f4…)2×2E–Bias (–1)S×(1+f1×2-1+f2×2-2+f3×2-3+f4×2-4…)2×2E–Bias

ExamplesofSinglePrecisionFloatWhatisthedecimalvalueofthisSinglePrecisionfloat?Solution:Sign=1isnegativeExponent=(01111100)2=124,E–bias=124–127=–3Significand=(1.0100…0)2=1+2-2=1.25(1.isimplicit)Valueindecimal=–1.25×2–3=–0.15625Whatisthedecimalvalueof?Solution:Valueindecimal=+(1.01001100…0)2×2130–127= (1.01001100…0)2×23=(1010.01100…0)2=10.3751011111000100000000000000000000001000001001001100000000000000000implicitExamplesofDoublePrecisionFloatWhatisthedecimalvalueofthisDoublePrecisionfloat?Solution:Valueofexponent=(10000000101)2–Bias=1029–1023=6Valueofdoublefloat=(1.00101010…0)2×26(1.isimplicit)=

(1001010.10…0)2=74.5Whatisthedecimalvalueof?Doityourself!

(answershouldbe–1.5×2–7=–0.01171875)01000000010100101010000000000000000000000000000000000000000000001011111110001000000000000000000000000000000000000000000000000000ConvertingFPDecimaltoBinaryConvert–0.8125tobinaryinsingleanddoubleprecisionSolution:Fractionbitscanbeobtainedusingmultiplicationby20.8125×2 =1.6250.625×2 =1.250.25×2 =0.50.5×2 =1.0Stopwhenfractionalpartis0Fraction=(0.1101)2=(1.101)2×2–1

(Normalized)Exponent=–1+Bias=

126(singleprecision)

and1022(double)0.8125=(0.1101)2=?+?+1/16=13/16101111110101000000000000000000001011111111101010000000000000000000000000000000000000000000000000SinglePrecisionDoublePrecisionLargestNormalizedFloatWhatistheLargestnormalized

float?SolutionforSinglePrecision:Exponent–bias=254–127=127(largestexponentforSP)Significand=(1.111…1)2=almost2Valueindecimal≈2×2127≈2128≈3.4028…×1038

SolutionforDoublePrecision:Valueindecimal≈2×21023≈21024≈1.79769…×10308Overflow:exponentistoolargetofitintheexponentfield011111110111111111111111111111110111111111101111111111111111111111111111111111111111111111111111SmallestNormalizedFloatWhatisthesmallest(inabsolutevalue)normalized

float?SolutionforSinglePrecision:Exponent–bias=1–127=–126(smallestexponentforSP)Significand=(1.000…0)2=1Valueindecimal=1×2–126=1.17549…×10–38

SolutionforDoublePrecision:Valueindecimal=1×2–1022=2.22507…×10–308Underflow:exponentistoosmalltofitinexponentfield000000001000000000000000000000000000000000010000000000000000000000000000000000000000000000000000Zero,Infinity,andNaNZeroExponentfieldE=0andfractionF=0+0and–0arepossibleaccordingtosignbitS

InfinityInfinityisaspecialvaluerepresentedwithmaximumEandF

=0Forsingleprecision

with8-bitexponent:maximumE=255Fordoubleprecision

with11-bitexponent:maximumE=2047Infinitycanresultfromoverflowordivisionbyzero+∞and–∞arepossibleaccordingtosignbitSNaN(NotaNumber)NaNisaspecialvaluerepresentedwithmaximumEandF≠0Resultfromexceptionalsituations,suchas0/0orsqrt(negative)OperationonaNaNresultsisNaN:Op(X,NaN)=NaNDenormalizedNumbersIEEEstandardusesdenormalizednumbersto…Fillthegapbetween0andthesmallestnormalizedfloatProvidegradualunderflowtozeroDenormalized:exponentfieldEis0andfractionF

≠0Implicit1.beforethefractionnowbecomes0.(notnormalized)Valueofdenormalizednumber(S,0,F) Singleprecision: (–1)

S

×(0.F)2×2–126 Doubleprecision: (–1)

S

×(0.F)2×2–1022DenormDenorm+∞PositiveOverflow-∞NegativeOverflowNegativeUnderflowPositiveUnderflowNormalized(–ve)Normalized(+ve)2–12621280-2128-2–126IEEE754floatingpointnumbersareorderedBecauseexponentusesabiasedrepresentation…ExponentvalueanditsbinaryrepresentationhavesameorderingPlacingexponentbeforethefractionfieldordersthemagnitudeLargerexponentlargermagnitudeForequalexponents,Largerfractionlargermagnitude0<(0.F)2×2Emin

<(1.F)2

×2E–Bias<∞(Emin=1–Bias)Becausesignbitismostsignificantquicktestof

signed<

IntegercomparatorcancomparemagnitudesIntegerMagnitudeComparatorX<YX=YX>YX=(EX

,FX)Y=(EY

,FY)Floating-PointComparisonSummaryofIEEE754EncodingSingle-PrecisionExponent=8Fraction=23ValueNormalizedNumber1to254Anything±(1.F)2×2E

–127DenormalizedNumber0nonzero±(0.F)2×2–126Zero00±0Infinity2550±∞NaN255nonzeroNaNDouble-PrecisionExponent=11Fraction=52ValueNormalizedNumber1to2046Anything±(1.F)2×2E

–1023DenormalizedNumber0nonzero±(0.F)2×2–1022Zero00±0Infinity20470±∞NaN2047nonzeroNaNNext...Floating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsFloatingPointAdditionExampleConsideradding:(1.111)2×2–1+(1.011)2×2–3Forsimplicity,weassume4bitsofprecision(or3bitsoffraction)Cannotaddsignificands…Why?BecauseexponentsarenotequalHowtomakeexponentsequal?Shiftthesignificandofthelesserexponentright untilitsexponentmatchesthelargernumber(1.011)2×2–3

=

(0.1011)2×2–2

=

(0.01011)2×2–1

Differencebetweenthetwoexponents=–1–(–3)=2So,shiftrightby2bitsNow,addthesignificands:Carry1.1110.01011

10.00111+AdditionExample–cont’dSo,(1.111)2×2–1+(1.011)2×2–3=(10.00111)2×2–1However,result(10.00111)2×2–1isNOTnormalizedNormalize

result:

(10.00111)2×2–1=(1.000111)2×20

Inthisexample,wehaveacarrySo,shiftrightby1bitandincrementtheexponentRoundthesignificand

tofitinappropriatenumberofbitsWeassumed4bitsofprecisionor3bitsoffractionRoundtonearest:(1.000111)2≈(1.001)2RenormalizeifroundinggeneratesacarryDetectoverflow/underflowIfexponentbecomestoolarge(overflow)

ortoosmall

(underflow)1.000111

11.001+FloatingPointSubtractionExampleConsider:(1.000)2×2–3

–(1.000)2×22Weassumeagain:4bitsofprecision(or3bitsoffraction)ShiftsignificandofthelesserexponentrightDifferencebetweenthetwoexponents=2–(–3)=5Shiftrightby5bits:(1.000)2×2–3

=

(0.00001000)2×22Convertsubtractionintoadditionto2'scomplement+0.00001×22–1.00000×2200.00001×2211.00000×2211.00001×22SignSinceresultisnegative,convertresultfrom2'scomplementtosign-magnitude2’sComplement–0.11111×222’sComplementSubtractionExample–cont’dSo,(1.000)2×2–3

–(1.000)2×22

=–0.111112×22Normalize

result:

0.111112×22=–1.11112×21

Forsubtraction,wecanhaveleadingzerosCountnumberzofleadingzeros

(inthiscasez=1)ShiftleftanddecrementexponentbyzRoundthesignificand

tofitinappropriatenumberofbitsWeassumed4bitsofprecisionor3bitsoffractionRoundtonearest:(1.1111)2≈(10.000)2Renormalize:roundinggeneratedacarry –1.11112×21≈–10.0002×21=–1.0002×22Resultwouldhavebeenaccurateifmorefractionbitsareused1.111

1

110.000+FloatingPointAddition/Subtraction1. Comparetheexponentsofthetwonumbers.Shiftthesmallernumbertotherightuntilitsexponentwouldmatchthelargerexponent.2. Add/Subtractthesignificandsaccordingtothesignbits.3. Normalizethesum,eithershiftingrightandincrementingtheexponentorshiftingleftanddecrementingtheexponent4. Roundthesignificandtotheappropriatenumberofbits,andrenormalizeifroundinggeneratesacarryStartDoneOverfloworunderflow?ExceptionyesnoShiftsignificandrightbyd=|EX–EY

|AddsignificandswhensignsofXandYareidentical,SubtractwhendifferentX–YbecomesX+(–Y)Normalizationshiftsrightby1ifthereisacarry,orshiftsleftbythenumberofleadingzerosinthecaseofsubtractionRoundingeithertruncatesfraction,oraddsa1toleastsignificantfractionbitFloatingPointAdderBlockDiagramczEZEXFXShiftRight/LeftInc/DecEYSwapFYShiftRightExponentSubtractorSignificandAdder/Subtractor11signSignComputationd=|EX–EY|max(EX,EY)add/subtractRoundingLogicsignSYadd/subFZSZcSXzDetectcarry,orCountleading0’sc01Next...Floating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsFloatingPointMultiplicationExampleConsidermultiplying:1.0102×2–1by–1.1102×2–2Asbefore,weassume4bitsofprecision(or3bitsoffraction)Unlikeaddition,weaddtheexponentsoftheoperandsResultexponentvalue=(–1)+(–2)=–3Usingthebiasedrepresentation:EZ=EX+EY–BiasEX=(–1)+127=126(Bias=127forSP)EY=(–2)+127=125EZ=126+125–127=124(value=–3)Now,multiplythesignificands: (1.010)2×(1.110)2=(10.001100)21.0101.110

000010101010101010001100×3-bitfraction3-bitfraction6-bitfractionMultiplicationExample–cont’dSincesignSX≠SY,signofproductSZ=1(negative)So,1.0102×2–1×–1.1102×2–2

=–10.0011002×2–3However,result:–10.0011002×2–3isNOTnormalizedNormalize:

10.0011002×2–3=1.00011002×2–2

Shiftrightby1bitandincrementtheexponentAtmost1bitcanbeshiftedright…Why?Round

thesignificand

tonearest: 1.00011002≈1.0012(3-bitfraction) Result≈–1.0012×2–2

(normalized)Detectoverflow/underflowNooverflow/underflow

becauseexponentiswithinrange1.0001100

11.001+FloatingPointMultiplication1. Addthebiasedexponentsofthetwonumbers,subtractingthebiasfromthesumtogetthenewbiasedexponentMultiplythesignificands.Settheresultsigntopositiveifoperandshavesamesign,andnegativeotherwise3. Normalizetheproductifnecessary,shiftingitssignificandrightandincrementingtheexponent4. Roundthesignificandtotheappropriatenumberofbits,andrenormalizeifroundinggeneratesacarryStartDoneOverfloworunderflow?ExceptionyesnoBiasedExponentAdditionEZ

=EX+EY

–BiasResultsignSZ=SX

xor

SYcanbecomputedindependentlySincetheoperandsignificands1.FXand1.FYare≥1and<2,theirproductis≥1and<4.Tonormalizeproduct,weneedtoshiftrightby1bitonlyandincrementexponentRoundingeithertruncatesfraction,oraddsa1toleastsignificantfractionbitNext...Floating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsExtraBitstoMaintainPrecisionFloating-pointnumbersareapproximationsfor…RealnumbersthattheycannotrepresentInfinitevarietyofrealnumbersexistbetween1.0and2.0However,exactly223fractionscanberepresentedinSP,andExactly252fractionscanberepresentedinDP(doubleprecision)Extrabitsaregeneratedinintermediateresultswhen…Shiftingandadding/subtractingap-bitsignificandMultiplyingtwop-bitsignificands(productcanbe2pbits)Butwhenpackingresultfraction,extrabitsarediscardedWeonlyneedfewextrabitsinanintermediateresultMinimizinghardwarebutwithoutcompromisingprecisionGuardBitGuardbit:guardsagainstlossofasignificantbitOnlyoneguardbitisneededtomaintainaccuracyofresultShiftedleft(ifneeded)duringnormalizationaslastfractionbitExampleontheneedofaguardbit:1.00000000101100010001101×25–

1.00000000000000010011010×2-2

(subtraction)1.00000000101100010001101×25–

0.000000100000000000000010011010×25

(shiftright7bits)

1.00000000101100010001101×2511.111111011111111111111101100110×25(2'scomplement)

00.111111101011000100010111100110×25(addsignificands)

+1.11111101011000100010111100010×24(normalized)Guardbit–donotdiscardRoundandStickyBitsTwoextrabitsareneededforroundingJustafternormalizingaresultsignificandRoundbit: appearsjustafterthenormalizedsignificandStickybit: appearsaftertheroundbit(ORofalladditionalbits)ReducethehardwareandstillachieveaccuratearithmeticAsifresultsignificandwascomputedexactlyandroundedConsiderthesameexampleofpreviousslide:1.00000000101100010001101×2511.111111011111111111111101100110×25(2'scomplement)

00.11111110101100010001011111×25(sum)

+1.1111110101100010001011111×24(normalized)RoundbitStickybitOR-reduceFourRoundingModesNormalizedresulthastheform:1.f1

f2…fl

r

sTheroundbit

randstickybit

sappearafterthelastfractionbitflIEEE754standardspecifiesfourmodesofroundingRoundtoNearestEven:defaultroundingmodeIncrementresultif:rs=“11”or(rs=“10”andfl=‘1’)Otherwise,truncateresultsignificandto1.f1

f2…fl

Roundtoward+∞:resultisroundedupIncrementresultifsignispositiveandrors=‘1’Roundtoward–∞:resultisroundeddownIncrementresultifsignisnegativeandrors=‘1’Roundtoward0:alwaystruncateresultRoundfollowingresultusingIEEE754roundingmodes:

–1.1111111111111111111111101×2-7RoundtoNearestEven:Truncateresultsincer=‘0’TruncatedResult:–1.11111111111111111111111×2-7Roundtowards+∞:Roundtowards–∞:Incrementedresult:

–10.00000000000000000000000×2-7Renormalizeandincrementexponent(becauseofcarry)Finalroundedresult:

–1.00000000000000000000000×2-6Roundtowards0:ExampleonRoundingRoundBitStickyBitTruncateresultsincenegativeIncrement

sincenegativeands=‘1’TruncatealwaysAdvantagesofIEEE754StandardUsedpredominantlybytheindustryEncodingofexponentandfractionsimplifiescomparisonIntegercomparatorusedtocomparemagnitudeofFPnumbersIncludesspecialexceptionalvalues:NaNand±∞Specialrulesareusedsuchas:0/0isNaN,sqrt(–1)isNaN,1/0is∞,and1/∞is0ComputationmaycontinueinthefaceofexceptionalconditionsDenormalizednumberstofillthegapBetweensmallestnormalizednumber1.0×2EminandzeroDenormalizednumbers,values0.F×2Emin

,areclosertozeroGradualunderflow

tozeroOperationsaresomewhatmorecomplicatedInadditiontooverflowwecanhaveunderflowAccuracycanbeabigproblemExtrabitstomaintainprecision:guard,round,andstickyFourroundingmodesDivisionbyzeroyieldsInfinityZerodividebyzeroyieldsNot-a-NumberOthercomplexitiesImplementingthestandardcanbetrickySeetextfordescriptionof80x86andPentiumbug!NotusingthestandardcanbeevenworseFloatingPointComplexitiesNext...Floating-PointNumbersIEEE754Floating-PointStandardFloating-PointAdditionandSubtractionFloating-PointMultiplicationExtraBitsandRoundingMIPSFloating-PointInstructionsCalledCoprocessor1ortheFloatingPointUnit(FPU)32separatefloatingpointregisters:$f0,$f1,…,$f31FPregistersare32bitsforsingleprecisionnumbersEven-oddregisterpairformadoubleprecisionregisterUsetheevennumberfordoubleprecisionregisters$f0,$f2,$f4,…,$f30areusedfordoubleprecisionSeparateFPinstructionsforsingle/doubleprecisionSingleprecision: add.s,sub.s,mul.s,div.s

(.sextension)Doubleprecision:add.d,sub.d,mul.d,div.d

(.dextension)FPinstructionsaremorecomplexthantheintegeronesTakemorecyclestoexecuteMIPSFloatingPointCoprocessorFPArithmeticInstructionsInstructionMeaningFormatadd.s fd,fs,ft(fd)=(fs)+(ft)0x110ft5fs5fd50add.d fd,fs,ft(fd)=(fs)+(ft)0x111ft5fs5fd50sub.s fd,fs,ft(fd)=(fs)–(ft)0x110ft5fs5fd51sub.d fd,fs,ft(fd)=(fs)–(ft)0x111ft5fs5fd51mul.s fd,fs,ft(fd)=(fs)×(ft)0x110ft5fs5fd52mul.d fd,fs,ft(fd)=(fs)×(ft)0x111ft5fs5fd52div.s fd,fs,ft(fd)=(fs)/(ft)0x110ft5fs5fd53div.d fd,fs,ft(fd)=(fs)/(ft)0x111ft5fs5fd53sqrt.s fd,fs(fd)=sqrt(fs)0x1100fs5fd54sqrt.d fd,fs(fd)=sqrt(fs)0x1110fs5fd54abs.s fd,fs(fd)=abs(fs)0x1100fs5fd55abs.d fd,fs(fd)=abs(fs)0x1110fs5fd55neg.s fd,fs(fd)=–(fs)0x1100fs5fd57neg.d fd,fs(fd)=–(fs)0x1110fs5fd57Separatefloatingpointload/storeinstructionslwc1: loadwordcoprocessor1ldc1: loaddoublecoprocessor1swc1: storewordcoprocessor1sdc1: storedoublecoprocessor1Betternamescanbeusedfortheaboveinstructionsl.s=lwc1(loadFPsingle), l.d=ldc1(loadFPdouble)s.s=swc1(storeFPsingle), s.d=sdc1(storeFPdouble)FPLoad/StoreInstructionsInstructionMeaningFormatlwc1 $f2,40($t0)($f2)=Mem[($t0)+40]0x31$t0$f2im16=40ldc1 $f2,40($t0)($f2)=Mem[($t0)+40]0x35$t0$f2im16=40swc1 $f2,40($t0)Mem[($t0)+40]=($f2)0x39$t0$f2im16=40sdc1 $f2,40($t0)Mem[($t0)+40]=($f2)0x3d$t0$f2im16=40GeneralpurposeregisterisusedasthebaseregisterMovingdatabetweengeneralpurposeandFPregistersmfc1: movefromcoprocessor1 (togeneralpurposeregister)mtc1: movetocoprocessor1 (fromgeneralpurposeregister)MovingdatabetweenFPregistersmov.s: movesingleprecisionfloatmov.d: movedoubleprecisionfloat=even/oddpairofregistersFPDataMovementInstructionsInstructionMeaningFormatmfc1 $t0,$f2($t0)=($f2)0x110$t0$f200mtc1 $t0,$f2($f2)=($t0)0x114$t0$f200mov.s $f4,$f2($f4)=($f2)0x1100$f2$f46mov.d $f4,$f2($f4)=($f2)0x1110$f2$f46FPConvertInstructionsInstructionMeaningFormatcvt.s.w fd,fstosinglefrominteger0x1100fs5fd50x20cvt.s.d fd,fstosinglefromdouble0x1110fs5fd50x20cvt.d.w fd,fstodoublefrominteger0x1100fs5fd50x21cvt.d.s fd,fstodoublefromsingle0x1110fs5fd50x21cvt.w.s fd,fstointegerfromsingle0x1100fs5fd50x24cvt.w.d fd,fstointegerfromdouble0x1110fs5fd50x24Convertinstruction:cvt.x.yConverttodestinationformatxfromsourceformatySupportedformatsSingleprecisionfloat =.s (singleprecisionfloatinFPregister)Doubleprecisionfloat =.d (doublefloatineven-oddFPregister)Signedintegerword =.w (signedintegerinFPregister)FPCompareandBranchInstructionsInstructionMeaningFormatc.eq.s fs,ftcflag=((fs)==(ft))0x110ft5fs500x32c.eq.d fs,ftcflag=((fs)==(ft))0x111ft5fs500x32c.lt.s fs,ftcflag=((fs)<=(ft))0x110ft5fs500x3cc.lt.d fs,ftcflag=((fs)<=(ft))0x111ft5fs500x3cc.le.s fs,ftcflag=((fs)<=(ft))0x110ft5fs500x3ec.le.d fs,ftcflag=((fs)<=(ft))0x111ft5fs500x3ebc1f Labelbranchif(cflag==0)0x1180im16bc1t Labelbranchif(cflag==1)0x1181im16

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 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

提交評論