




版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 湖南生物機電職業(yè)技術學院《現(xiàn)代設備管理》2023-2024學年第二學期期末試卷
- 上海旅游高等專科學?!痘Q性與技術測量B》2023-2024學年第二學期期末試卷
- 2025年福建省龍巖市溪南教育集團數(shù)學四下期末檢測試題含解析
- 惠州學院《合唱與指揮》2023-2024學年第二學期期末試卷
- 云南師范大學《數(shù)理統(tǒng)計理論與方法》2023-2024學年第二學期期末試卷
- 上海電氣簽約合同范本
- 湖南省懷化市2025屆四年級數(shù)學第二學期期末監(jiān)測試題含解析
- 做賬實操-個人所得稅綜合所得匯算清繳的操作指南
- 快簽工程合同范本
- 國開《金融學》單元測試一
- 金融知識普及
- (100題)2024時事政治考試題庫
- 新概念英語第二冊-Lesson18-同步習題含答案
- 中國兒童幽門螺桿菌感染診治專家共識2022
- 全國大學英語六級詞匯表
- 2024年3月江蘇海洋大學招考聘用專職輔導員和工作人員5人筆試參考題庫附帶答案詳解
- 垂線課件人教版數(shù)學七年級下冊
- 建設法規(guī)(全套課件)
- 東來順牛羊肉培訓
- 心衰患者的容量管理中國專家共識-共識解讀
- 外用激素合理使用
評論
0/150
提交評論