Usage of DLX Instructions

Usage of DLX Instructions - 04-1 04-1 InstructionUsage

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 04-1 04-1 InstructionUsage UsageofDLXInstructionsBySPEC92IntegerCode load int conditional branch add int compare int store int or shift and 26% 16% 0% 5% 10% 15% 20% 25% 14% 13% 9% 5% 4% 3% eqntott espresso gcc li compress Total dynamic count FIGURE 2.28 Graphical display of instructions executed of the five programs from SPECint92 in Figure 2.26. 04-1 EE4720LectureTransparency.Formatted10:07,4October2004fromlsli04. 04-1 04-2 04-2 InstructionUsage UsageofDLXInstructionsBySPEC92Floating-PointCode load FP mul FP add int store FP conditional branch add FP sub FP compare FP 23% 13% 0% 5% 10% 15% 20% 25% 11% 9% 8% 8% 6% 6% ear hydro2d mdljdp2 su2cor doduc mov reg FP 2% shift 2% Total dynamic count FIGURE 2.29 Graphical display of instructions executed of the five programs from SPECfp92 in Figure 2.27. 04-2 EE4720LectureTransparency.Formatted10:07,4October2004fromlsli04. 04-2 04-3 04-3 ControlTransfer(Flow)Instructions beq r1,$0SKIP !Ifr1=0gotoSKIP nop add r2,r2,r5 SKIP: add r2,r3,r4 Controltransfer(controlflow)instructions(CTIs) ... ... maycausenextinstructiontobefetchedfrom ... ... somewhereotherthanPC+4(assuming4-byteinstructions). Programswouldbetrivialwithoutthem. Occurfrequentlyinprograms. Oftenaperformancebottleneck. 04-3 EE4720LectureTransparency.Formatted10:07,4October2004fromlsli04. 04-3 04-4 04-4 Namesusedbelowarecommon: Branch : Conditionalcontroltransfer. Jump : Unconditionalcontroltransfer. Sometimesspecialcaseofbranch. JumpandLink : Unconditional,returnaddress(PC)savedinregister. Call : Unconditionalcontroltransfer,PC,etc.saved. Sometimesspecialcaseofjumpandlink. Return : Unconditional,PC,etc.frommostrecentcallrestored. Sometimesspecialcaseofjumpandlink. 04-4 EE4720LectureTransparency.Formatted10:07,4October2004fromlsli04. 04-4 04-5 04-5 CTIExamples CCode if(t2==t3)gotoTARGET1; t4=t5+t6; gotoTARGET2; TARGET1: t4=t5*t6; TARGET2: PROCNAME(); return; MIPSAssemblerCode sub $t1,$t2,$t3 !$t1=$t2-$t3 beq $t1,$0TARGET1 !Branchif$t1=0. nop add $t4,$t5,$t6 !$t4=$t5+$t6 j TARGET2 !Jumpunconditionally. nop TARGET1: !Label.(Assemblerandlinkerfindaddress.) mult$t5,$t6 !{hi,lo}=$t5*$t6 mflo$t4 TARGET2: !Anotherlabel. sw 16($t7),$ra !Savereturnaddress(ofcallertothisproc.) jal PROCNAME !CallPROCNAME,storethisreturnaddrin$ra. nop lw $ra,16($t7) !Restorereturnaddress(overwrittenbyjal). jr$ra !Return(fromthisprocedure). nop 04-5 EE4720LectureTransparency.Formatted10:07,4October2004fromlsli04. 04-5 04-6 04-6 sub $t1,$t2,$t3 !$t1=$t2-$t3 beq $t1,$0TARGET1 !Branchif$t1=0. nop add $t4,$t5,$t6 !$t4=$t5+$t6 j TARGET2 !Jumpunconditionally. nop TARGET1: !Label.(Assemblerandlinkerfindaddress.) mult$t5,$t6 !{hi,lo}=$t5*$t6 mflo$t4 TARGET2: !Anotherlabel. sw 16($t7),$ra !Savereturnaddress(ofcallertothisproc.) jal PROCNAME !CallPROCNAME,storethisreturnaddrin$ra. nop lw $ra,16($t7) !Restorereturnaddress(overwrittenbyjal). jr$ra !Return(fromthisprocedure). nop Branchinstruction: beq . Jumpinstruction: j . Callinstruction: jal . Returninstruction: jr .....
View Full Document

This note was uploaded on 08/01/2009 for the course EE 4720 taught by Professor Staff during the Spring '08 term at LSU.

Page1 / 10

Usage of DLX Instructions - 04-1 04-1 InstructionUsage

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online