計算機組織與結(jié)構:版7-13-RISC_第1頁
計算機組織與結(jié)構:版7-13-RISC_第2頁
計算機組織與結(jié)構:版7-13-RISC_第3頁
計算機組織與結(jié)構:版7-13-RISC_第4頁
計算機組織與結(jié)構:版7-13-RISC_第5頁
已閱讀5頁,還剩43頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

WilliamStallings

ComputerOrganization

andArchitecture

7thEditionChapter13ReducedInstructionSetComputers1Chapter13

ReducedInstructionSetComputersKeytermsCISCcomplexinstructionsetcomputerRISCreducedinstructionsetcomputerDelayedbranchDelayedloadHLLhigh-levellanguageRegisterfileRegisterwindowSPARC2MajorAdvancesinComputers(1)ThefamilyconceptIBMSystem/3601964DECPDP-8SeparatesarchitecturefromimplementationMicroporgrammedcontrolunitIdeabyWilkes1951ProducedbyIBMS/3601964CachememoryIBMS/360model8519693MajorAdvancesinComputers(2)SolidStateRAM(Seememorynotes)MicroprocessorsIntel40041971PipeliningIntroducesparallelismintofetchexecutecycleMultipleprocessors4TheNextStep-RISCReducedInstructionSetComputerKeyfeaturesLargenumberofgeneralpurposeregistersoruseofcompilertechnologytooptimizeregisteruseLimitedandsimpleinstructionsetEmphasisonoptimisingtheinstructionpipeline5Comparisonofprocessors6DrivingforceforCISCSoftwarecostsfarexceedhardwarecostsIncreasinglycomplexhighlevellanguagesSemanticgapLeadsto:LargeinstructionsetsMoreaddressingmodesHardwareimplementationsofHLLstatementse.g.CASE(switch)onVAXSemantic:語義的;語義學的

Gap英音:[g?p]豁口,裂口

7IntentionofCISCEasecompilerwritingImproveexecutionefficiencyComplexoperationsinmicrocodeSupportmorecomplexHLLsease減輕

HLL

縮寫詞abbr.

high-levellanguage【電腦】高級語言8ExecutionCharacteristicsOperationsperformedOperandsusedExecutionsequencingStudieshavebeendonebasedonprogramswritteninHLLsDynamicstudiesaremeasuredduringtheexecutionoftheprogram9OperationsAssignmentsMovementofdataConditionalstatements(IF,LOOP)SequencecontrolProcedurecall-returnisverytimeconsumingSomeHLLinstructionleadtomanymachinecodeoperationsAssignment

分配;指派,選派10WeightedRelativeDynamicFrequencyofHLLOperations[PATT82a]

DynamicOccurrenceMachine-InstructionWeightedMemory-ReferenceWeighted

PascalCPascalCPascalCASSIGN45%38%13%13%14%15%LOOP5%3%42%32%33%26%CALL15%12%31%33%44%45%IF29%43%11%21%7%13%GOTO—3%————OTHER6%1%3%1%2%1%11OperandsMainlylocalscalarvariablesOptimisationshouldconcentrateonaccessinglocalvariables

PascalCAverageIntegerConstant16%23%20%ScalarVariable58%53%55%Array/Structure26%24%25%12ProcedureCallsVerytimeconsumingDependsonnumberofparameterspassedDependsonlevelofnestingMostprogramsdonotdoalotofcallsfollowedbylotsofreturnsMostvariablesarelocal(c.f.localityofreference)13ImplicationsBestsupportisgivenbyoptimisingmostusedandmosttimeconsumingfeaturesLargenumberofregistersOperandreferencingCarefuldesignofpipelinesBranchpredictionetc.Simplified(reduced)instructionset14LargeRegisterFileSoftwaresolutionRequirecompilertoallocateregistersAllocatebasedonmostusedvariablesinagiventimeRequiressophisticatedprogramanalysisHardwaresolutionHavemoreregistersThusmorevariableswillbeinregisters15RegistersforLocalVariablesStorelocalscalarvariablesinregistersReducesmemoryaccessEveryprocedure(function)callchangeslocalityParametersmustbepassedResultsmustbereturnedVariablesfromcallingprogramsmustberestored16RegisterWindowsOnlyfewparametersLimitedrangeofdepthofcallUsemultiplesmallsetsofregistersCallsswitchtoadifferentsetofregistersReturnsswitchbacktoapreviouslyusedsetofregisters17RegisterWindowscont.ThreeareaswithinaregistersetParameterregistersLocalregistersTemporaryregistersTemporaryregistersfromonesetoverlapparameterregistersfromthenextThisallowsparameterpassingwithoutmovingdatacont.

1.內(nèi)容,所含之物(contents)2.繼續(xù)的;不斷的;連續(xù)的18OverlappingRegisterWindows……19CircularBufferdiagram主程序1子程序A2子程序B3子程序C4子程序D5子程序E6子程序F7子程序G20OperationofCircularBufferWhenacallismade,acurrentwindowpointerismovedtoshowthecurrentlyactiveregisterwindowIfallwindowsareinuse,aninterruptisgeneratedandtheoldestwindow(theonefurthestbackinthecallnesting)issavedtomemoryAsavedwindowpointerindicateswherethenextsavedwindowsshouldrestoreto21GlobalVariablesAllocatedbythecompilertomemoryInefficientforfrequentlyaccessedvariablesHaveasetofregistersforglobalvariables22RegistersvCacheLargeRegisterFileCacheAlllocalscalarsRecently-usedlocalscalarsIndividualvariablesBlocksofmemoryCompiler-assignedglobalvariablesRecently-usedglobalvariablesSave/RestorebasedonprocedurenestingdepthSave/RestorebasedoncachereplacementalgorithmRegisteraddressingMemoryaddressing23ReferencingaScalar-

WindowBasedRegisterFile24ReferencingaScalar-Cache25ReferencingaScalar-

WindowBasedRegisterFile26CompilerBasedRegisterOptimizationAssumesmallnumberofregisters(16-32)OptimizinguseisuptocompilerHLLprogramshavenoexplicitreferencestoregistersusually-thinkaboutC-registerintAssignsymbolicorvirtualregistertoeachcandidatevariableMap(unlimited)symbolicregisterstorealregistersSymbolicregistersthatdonotoverlapcansharerealregistersIfyourunoutofrealregisterssomevariablesusememory27GraphColoringGivenagraphofnodesandedgesAssignacolortoeachnodeAdjacentnodeshavedifferentcolorsUseminimumnumberofcolorsNodesaresymbolicregistersTworegistersthatareliveinthesameprogramfragmentarejoinedbyanedgeTrytocolorthegraphwithn

colors,wherenisthenumberofrealregistersNodesthatcannotbecoloredareplacedinmemory28GraphColoringApproach29GraphColoringApproach30WhyCISC(1)?Compilersimplification?

Disputed…ComplexmachineinstructionshardertoexploitOptimizationmoredifficult

(開發(fā))Smallerprograms?Programtakesuplessmemorybut…MemoryisnowcheapMaynotoccupylessbits,justlookshorterinsymbolicformMoreinstructionsrequirelongerop-codesRegisterreferencesrequirefewerbits

dispute

英音:[di‘spju:t]爭論;爭執(zhí)

simplification

1.單純化2.簡單化31WhyCISC(2)?Fasterprograms?BiastowardsuseofsimplerinstructionsMorecomplexcontrolunitMicroprogramcontrolstorelargerthussimpleinstructionstakelongertoexecuteItisfarfromclearthatCISCistheappropriatesolution

Bias傾向,趨勢32RISCCharacteristicsOneinstructionpercycleRegistertoregisteroperationsFew,simpleaddressingmodesFew,simpleinstructionformatsHardwireddesign(nomicrocode)FixedinstructionformatMorecompiletime/effort33RISCvCISCNotclearcutManydesignsborrowfrombothphilosophiese.g.PowerPCandPentiumIIphilosophies

哲學;觀點34RISCPipeliningMostinstructionsareregistertoregisterTwophasesofexecutionI:InstructionfetchE:ExecuteALUoperationwithregisterinputandoutputForloadandstoreI:InstructionfetchE:ExecuteCalculatememoryaddressD:MemoryRegistertomemoryormemorytoregisteroperation35Figure13.6cFigure13.6c,threeinstructionscanbeoverlapped,andtheimprovementisasmuchasafactorof3.I36Figure13.6dE1:RegisterfilereadE2:ALUoperationandregisterwriteI37EffectsofPipelining38OptimizationofPipeliningDelayedbranchDelayedLoadLoopUnrollingunroll

展開,打開(卷著的東西)39OptimizationofPipelining

(1)LoopUnrollingReplicatebodyofloopanumberoftimesIterateloopfewertimesReducesloopoverheadIncreasesinstructionparallelismImprovedregister,datacacheorTLBlocality

unroll

展開,打開(卷著的東西)

replicate

英音:[‘replikeit]折疊;復制

iterate

英音:['it?reit]反復,重復

overhead英音:[‘?uv?’hed]日常開支,額外開銷40OptimizationofPipelining

(2)DelayedbranchDoesnottakeeffectuntilafterexecutionoffollowinginstructionThisfollowinginstructionisthedelayslot41NormalandDelayedBranchAddressNormalBranchDelayedBranchOptimizedDelayedBranch100LOAD X,rALOAD X,rALOADX,rA101ADD 1,rAADD 1,rAJUMP 105102JUMP 105JUMP 106ADD 1,rA103ADD rA,rBNOOP

ADD rA,rB104SUB rC,rBADD rA,rBSUB rC,rB105STORErA,Z

SUB rC,rBSTORErA,Z

106

STORErA,Z

42UseofDelayed

BranchAddressNormalBranchDelayedBranchOptimizedDelayedBranch100LOAD X,rALOADX,rALOADX,rA101ADD1,rAADD1,rAJUMP105102JUMP105JUMP106ADD1,rA103ADDrA,rBNOOP ADDrA,rB104SUBrC,rBADDrA,rBSUBrC,rB105STORErA,Z

溫馨提示

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

評論

0/150

提交評論