35 Pages

arith

Course: MGMT 341, Fall 2008
School: New Mexico
Rating:
 
 
 
 
 

Word Count: 3244

Document Preview

4 Chapter Simple Calculations Arthur B. Maccabe Department of Computer Science The University of New Mexico Copyright 19932000, Arthur B. Maccabe and McGraw-Hill, Inc. Overview Slide 1 Preliminaries RISC/CISC registers, load/store architecture SPARC data manipulation instructions registers and data paths arithmetic, logical (bitwise), and shift instructions sethi and synthetic instructions SPARC...

Register Now

Unformatted Document Excerpt

Coursehero >> New Mexico >> New Mexico >> MGMT 341

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
4 Chapter Simple Calculations Arthur B. Maccabe Department of Computer Science The University of New Mexico Copyright 19932000, Arthur B. Maccabe and McGraw-Hill, Inc. Overview Slide 1 Preliminaries RISC/CISC registers, load/store architecture SPARC data manipulation instructions registers and data paths arithmetic, logical (bitwise), and shift instructions sethi and synthetic instructions SPARC Control Flow labels and unconditional branches conditional branching nullication encoding branching instructions translation issues 1 Introduction Slide 2 Slide 3 Architecture: the design of an instruction set Organization: the implementation of an instruction set SPARC (Scalable Processor ARChitecture) RISC (Reduced Instruction Set Computer) architecture an open standard Register windows and resource management Binary compatibility Backward compatibility Preliminaries RISC/CISC reduced/complex instruction set computer the complexity of individual instructions changing role of assembly language programming Kinds of instructions data transfer data mainpulation control ow Statements, operations, and operands single operation per instruction operations include store (e.g., multiply-and-store) source operands provide values destination operand provides a location 2 Preliminaries: Registers Slide 4 Registers Main memory L2 cache CPU L1 cache Preliminaries: Memory/Memory Architecture Slide 5 Memory Registers ALU 3 Preliminaries: Load/Store Architecture Slide 6 Memory load Registers store ALU Data Manipulation Instructions Slide 7 Background Machine language formats Internal data paths Assembly language Arithmetic instructions Logical (bitwise) instructions Shift and 32-bit shift instructions sethi (set high) Synthetic instructions 32-bit multiply and divide instructions 4 SPARC Background Slide 8 31 30 29 Slide 9 Basic sizes 32-bit word 64-bit double (or extended) word Registers 32 64-bit registers %r0 through %r31 %r0 is always zero SPARC Instruction Formats 25 24 19 18 14 13 12 5 4 0 10 rd op3 rs1 0 00000000 rs2 Register-register 10 rd op3 rs1 1 simm13 Register-immediate Field rd op3 rs1 rs2 simm13 Meaning Destination register Op code First source register Second source register Second source value in 13-bit 2s complement representation 5 Internal Data Paths 64 64 64 Slide 10 Sign extend 13 Registers 64 ALU Instruction Register Arithmetic Instructions Operation Integer add Integer subtract 00 0100 op3 00 0000 Assembly syntax add add sub sub 00 1001 rs1 , rs2 , rd rs, siconst13 , rd rs1 , rs2 , rd rs, siconst13 , rd Operation implemented reg[rd]=reg[rs1 ]+reg[rs2 ] reg[rd]=reg[rs]+siconst13 reg[rd]=reg[rs1 ] reg[rs2 ] reg[rd]=reg[rs] siconst13 reg[rd]=reg[rs1 ] reg[rs2 ] reg[rd]=reg[rs] siconst13 reg[rd]=reg[rs1 ] reg[rs2 ] reg[rd]=reg[rs] siconst13 4096 to 4095, inclusive. Slide 11 Integer multiply Integer divide 10 1101 mulx rs1 , rs2 , rd mulx rs, siconst13 , rd sdivx rs1 , rs2 , rd sdivx rs, siconst13 , rd Destination last 6 Note: siconst13 denotes a signed integer constant in the range Encoding Example 1 Slide 12 Slide 13 SPARC instruction: mulx %r1, 2, %r1 Format 31 30 29 25 24 19 18 14 13 12 5 4 0 10 rd op3 rs1 1 simm13 Field values Field rd op3 rs1 simm13 Value %r1 mulx %r1 2 Encoded value 00001 001001 00001 0000000000010 Encoding: 10 00001 001001 00001 1 0000000000010 or 0x82486002 Encoding Example 2 SPARC instruction: add %r1, %r10, %r1 Format 31 30 29 25 24 19 18 14 13 12 5 4 0 10 rd op3 rs1 0 00000000 rs2 Field values Field rd op3 rs1 rs2 Value %r1 add %r1 %r10 Encoded value 00001 000000 00001 01010 Encoding: 10 00001 000000 00001 0 00000000 01010 or 0x8200400A 7 Assembly Language Example Line oriented Comments start with ! Logical (Bitwise) Instructions Operation And op3 00 0001 Assembly syntax and rs1 , rs2 , rd and rs, siconst13 , rd And not 00 0101 andn rs1 , rs2 , rd andn rs, siconst13 , rd or or 10 0110 rs1 , rs2 , rd rs, siconst13 , rd Operation implemented reg[rd]=reg[rs1 ]&reg[rs2 ] reg[rd]=reg[rs]&siconst13 reg[rd]=reg[rs1 ]& reg[rs2 ] reg[rd]=reg[rs]& siconst13 reg[rd]=reg[rs1 ] reg[rs2 ] reg[rd]=reg[rs] s iconst13 reg[rd]=reg[rs] reg[rd]=reg[rs1 ] Slide 15 Exclusive xor Exclusive xor not 00 0011 xor rs1 , rs2 , rd or rs, siconst13 , rd xorn rs1 , rs2 , rd orn rs, siconst13 , rd reg[rd]=reg[rs1 ]reg[rs2 ] reg[rd]=reg[rs]siconst13 reg[rd]=reg[rs1 ] reg[rs2 ] reg[rd]=reg[rs] siconst13 10 0111 8 or not orn rs, siconst13 , rd Inclusive orn rs1 , rs2 , rd or Inclusive 00 0010 Slide 14 a a2 bcd a is in %r1, b is in %r2, c is in %r3, and d is in %r4 mulx mulx mulx add %r1, 2, %r1 %r2, %r3, %r10 %r10, %r4, %r10 %r1, %r10, %r1 ! ! ! ! a=a 2 t1 = b c t1 = t1 d a = a + t1 reg[rs2 ] siconst13 Examples Slide 16 Clear all but the least signicant 10 bits in register %r4 and %r4, 0x3ff, %r4 Set all but the least signicant 10 bits in register %r4 orn %r4, 0x3ff, %r4 Operation left shift logical right shift Slide 17 logical right shift arithmetic 10 0111 Logical shifts ll vacated bit positions with 0 Arithmetic right shifts replicate the sign bit Compute the 8-bit, bitwise logical and for 11100011 and 10101010 11100011 & 10101010 10100010 Compute the 8-bit, bitwise logical or for 11100011 and 10101010 11100011 10101010 11101011 Shift Instructions op3 10 0101 Assembler syntax sllx rs1 , rs2 , rd sllx rs1 , iconst6 , rd 10 0110 srlx rs1 , rs2 , rd srlx rs1 , iconst6 , rd srax rs1 , rs2 , rd srax rs1 , iconst6 , rd Operation implemented reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst6 reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst6 reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst6 Note: iconst6 denotes an integer constant in the range 0 to 63, inclusive. 9 Encoding Shift Instructions 31 30 29 25 24 19 18 14 13 12 11 6 5 4 0 10 rd op3 rs1 01 0000000 rs2 Register-register 10 rd op3 rs1 11 000000 shcnt64 Slide 18 Register-immediate Field rd op3 rs1 rs2 shcnt64 Meaning Destination register Op code First source register Second source register Second source value in 6-bit binary representation 32-bit Shift Instructions Operation left shift logical right shift logical 10 0110 op3 10 0101 Assembler syntax sll rs1 , rs2 , rd sll rs1 , iconst5 , rd srl rs1 , rs2 , rd srl rs1 , iconst5 , rd 10 0111 sra rs1 , rs2 , rd sra rs1 , iconst5 , rd Operation implemented reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst5 reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst5 reg[rd] = reg[rs1 ] reg[rs2 ] reg[rd] = reg[rs1 ] iconst5 Slide 19 right shift arithmetic Note: iconst5 denotes an integer constant in the range 0 to 31, inclusive. sll is sllx with a reduced shift count srl sets the most signicant 32 bits to 0, then acts like srlx sra copies the 32-bit sign bit into most signicant 32 bit, then acts like srax 10 Encoding 32-bit Shift Instructions 31 30 29 25 24 19 18 14 13 12 11 5 4 0 10 rd op3 rs1 00 0000000 rs2 Register-register 10 rd op3 rs1 10 0000000 shcnt32 Slide 20 Register-immediate Field rd op3 rs1 rs2 shcnt32 Meaning Destination register Op code First source register Second source register Second source value in 5-bit binary representation sethi: Motivation Using a sequence of shift and or instructions, set the register %r2 to the 64-bit value 0x1234567887654321. or sllx or sllx or sllx or sllx or sllx or %r0, 0x123, %r2 %r2, 12, %r2 %r2, 0x456, %r2 %r2, 12, %r2 %r2, 0x788, %r2 %r2, 12, %r2 %r2, 0x765, %r2 %r2, 12, %r2 %r2, 0x432, %r2 %r2, 4, %r2 %r2, 0x1, %r2 ! ! ! ! ! ! ! ! ! ! ! start with the most signicant 12 bits make room for the next 12 bits the next 12 bits make room for the next 12 bits the next 12 bits make room for the next 12 bits the next 12 bits make room for the next 12 bits the next 12 bits make room for the next 4 bits the last 4 bits Slide 21 11 sethi Set the register %r2 to the 64-bit value 0x1234567887654321. sethi or sllx sethi or or 0x12345, %r2 %r2, 0x678, %r2 %r2, 32, %r2 0x87654, %r3 %r3, 0x321, %r3 %r2, %r3, %r2 ! ! ! ! ! ! set bits 31 through 12 ll in bits 0 through 11 shift to the most signicant bits set bits 31 through 12 ll in bits 0 through 11 combine the two 32-bit values Slide 22 Encoding sethi Instructions 31 30 29 25 24 22 21 0 00 rd 100 imm22 Slide 23 Field rd imm22 Meaning Destination register The 22-bit immediate value 12 %uhi(), %ulo(), %hi() and %lo() Operator Slide 24 %uhi(val) %ulo(val) %hi(val) %lo(val) Value bits 6342 of val bits 4132 of val bits 3110 of val bits 90 of val Using %uhi(), %ulo(), %hi() and %lo() Set the register %r2 to the 64-bit value 0x1234567887654321. Slide 25 sethi or sllx sethi or or %uhi(0x1234567887654321), %r2 %r2, %ulo(0x1234567887654321), %r2 %r2, 32, %r2 %hi(0x1234567887654321), %r3 %r3, %lo(0x1234567887654321), %r3 %r2, %r3, %r2 ! ! ! ! ! ! set bits 31 through 12 ll in bits 0 through 11 shift to most signif. bits set bits 31 through 12 ll in bits 0 through 11 combine two 32-bit values 13 Synthetic Data Manipulation Instructions Synthetic instr. not rs, rd not rd neg rs, rd neg rd Implementation xnor rs, %r0, rd xnor rd, %r0, rd sub %r0, rs, rd sub %r0, rd, rd add rd, 1, rd add rd, siconst13 , rd sub rd, 1, rd sub rd, siconst13 , rd or or rd, rs, rd rd, siconst13 , rd set bits decrement increment negation Comment invert bits Slide 26 inc rd inc siconst13 , rd dec rd dec siconst13 , rd bset rs, rd bset siconst13 , rd Synthetic Data Manipulation Instructions (continued) Synthetic instr. bclr rs, rd bclr siconst13 , rd Implementation andn rd, rs, rd andn rd, siconst13 , rd xor rd, rs, rd xor rd, siconst13 , rd or or or %r0, %r0, rd %r0, rs, rd %r0, siconst13 , rd clear (zero) a register copy rs to rd set rd to siconst13 toggle bits Comment clear bits Slide 27 btog rs, rd btog siconst13 , rd clr rd mov rs, rd mov siconst13 , rd 14 Synthetic Instructions for 32- and 64-bit Values Synthetic instr. Implementation srl rs, %r0, rd srl rd, %r0, rd sra rs, %r0, rd sra rd, %r0, rd sign extend a 32-bit value Comment clear upper word Slide 28 clruw rs, rd clruw rd signx rs, rd signx rd The set unsigned word Synthetic Instructions Synthetic instr. setuw val, rd set unsigned word Implementation sethi %hi(val), rd or Condition or sethi %hi(val), rd or set val, rd %r0, %lo(val), rd otherwise synonym for setuw 15 Slide 29 or %r0, val, rd 0 val 4095 val&0x3ff 0 The set signed word Synthetic Instructions Synthetic instr. setsw val, rd set signed word or Implementation sethi %hi(val), rd or Condition or sethi %hi(val), rd Slide 30 sra rd, %r0, rd or or %r0, %lo(val), rd or or sra %r0, %lo(val), rd rd, %r0, rd The set extended word Synthetic Instructions Synthetic instr. setx val, tmp, rd Implementation sethi tmp %uhi(val), or tmp, %ulo(val), tmp Condition worst case, optimizations are possible Slide 31 set extended (tmp is a temporary register) sllx tmp, 32, tmp sethi %hi(val), rd or or rd, tmp, rd rd, %lo(val), rd 16 sethi %hi(val), rd otherwise, if val sethi %hi(val), rd otherwise, if val 0 0 val 0 && val & 0x3ff %r0, val, rd 4096 val 4095 0 val && val & 0x3ff 0 0 32-bit Multiply 32 32 32 Slide 32 Sign extend 13 Registers Y 32 32 smul/umul Instruction Register most significant least significant 32-bit Divide 32 least significant 32 most significant 32 Slide 33 32 Sign extend 13 Registers Y 32 32 sdiv/udiv Instruction Register remainder quotient 17 Control Transfer Instructions Slide 34 18 Slide 35 Using simple gotos temp = y; x = 0; top: if( temp z ) goto bottom x = x + 1; temp = temp z; goto top; bottom: Conditional and unconditional branches Labels and unconditional branches on the SPARC Delayed branches Register comparison to zero Condition code registers Encoding branching instructions Loop improvements Complex conditional expressions An Example Using a while loop temp = y; x = 0; while( temp z ) x = x + 1; temp = temp z; Labels Slide 36 Slide 37 A label is an identier (and follows the standard rules for identier formation). The denition of a label occurs when the label appears as the rst non-white space item on a line followed by a colon (:). Each label can have at most one denition. The value of the label is the address of the next instruction (which may be on the same line as the label). Whenever you use a label in a non dening context, the assembler substitutes the value of the label for the label. You may use a label before you give its denition. Delayed Branching Unconditional branch: ba %xcc, label Two program counters: pc and npc An example Code s1: s2: s3: s4: s5: s6: s7: inc ba inc inc inc inc inc %r1 %xcc, s5 %r3 %r4 %r5 %r6 %r7 s5 s6 s6 s7 sequential execution pc s1 s2 s3 npc s2 s3 s5 Comment start sequential execution (delayed) branch to s5 The nop instruction 19 Translating the Unconditional Branch Assume x is stored in %r2, y is stored in %r3, z is stored in %r4, and temp is stored in %r5 mov %r3, %r5 clr %r2 Slide 38 top: inc sub ba nop bottom: ! temp = y; ! x = 0; if( temp z ) goto bottom x = x + 1; temp = temp - z; goto top; delay slot Eliminating the nop mov %r3, %r5 clr %r2 top: inc ba sub bottom: Slide 39 ! temp = y; ! x = 0; if( temp z ) goto bottom x = x + 1; goto top; temp = temp - z; delay slot 20 ! ! %r2 ! %xcc, top ! %r5, %r4, %r5 ! ! ! %r2 ! %r5, %r4, %r5 ! %xcc, top ! ! Conditional Branching Slide 40 Slide 41 brgz rs, label brgez rs, label reg[rs] reg[rs] 21 % $ # brnz rs, label reg[rs] ! brlz rs, label reg[rs] " brlez rs, label reg[rs] Register comparison to zero Condition codes Register Comparison to Zero Assembler syntax brz rs, label Branching condition reg[rs] 0 0 0 0 0 0 Using Comparisons to Zero Using Comparisons to Zero (continued) Avoiding temp2 temp = y z; x = 0; top: if( temp 0 ) goto bottom x = x + 1; temp = temp z; goto top; bottom: Slide 43 22 Slide 42 Simple translation temp = y; x = 0; top: temp2 = temp z; if( temp2 0 ) goto bottom x = x + 1; temp = temp z; goto top; bottom: Translating into SPARC Code top: Slide 44 %r2 %xcc, top %r5, %r4, %r5 bottom: Avoiding the nop Instruction top: Slide 45 bottom: dec %r2 ! make up for the extra inc 23 ! brlz inc ba sub %r5, bottom %r2 %xcc, top %r5, %r4, %r5 ! ! ! ! if( temp 0 ) goto bottom x = x + 1; delay slot goto top; temp = temp - z; delay slot & sub clr %r3, %r4, %r5 %r2 ! temp = y ! x = 0; ! brlz nop inc ba sub %r5, bottom ! ! ! ! ! if( temp 0 ) goto bottom branch delay slot x = x + 1; goto top; temp = temp - z; delay slot & sub clr %r3, %r4, %r5 %r2 ! temp = y ! x = 0; z; z; Condition Codes Slide 46 First translation c = a b; if( c 0 ) goto ; a = a + 1; : Translation to SPARC code sub brlez nop inc : %r2, %r3, %r4 %r4, %r2 24 " Slide 47 ! ! ! ! ' $ & ( Example Condition code bits (ags) Setting the condition codes Conditional branching based on condition codes Another Example The code if( a b ) a = a + 1; c = a b; if( c 0 ) goto ; branch delay slot a = a + 1; Condition Code Bits (Flags) Slide 48 Slide 49 Summarize the result of an earlier operation Four ags: Z, zero N, negative C, carry V, overow Setting the Condition Code Bits Operations that update the condition codes Operation integer addition integer subtraction bitwise and bitwise and not bitwise or bitwise or not bitwise xor bitwise xor not Name addcc subcc andcc andncc orcc orncc xorcc xorncc op3 01 0000 01 0100 01 0001 01 0101 01 0010 01 0110 01 0011 01 0111 Operations that do not affect the condition codes Name add sub and andn or orn xor xorn op3 00 0000 00 0100 00 0001 00 0101 00 0010 00 0110 00 0011 00 0111 25 Synthetic Instructions that Update the Condition Code Synthetic instr. cmp rs1 , rs2 cmp rs, siconst13 tst Slide 50 rs Implementation subcc rs1 , rs2 , %r0 subcc rs, siconst13 , %r0 orcc %r0, rs, %r0 addcc rd, 1, rd addcc rd, siconst13 , rd subcc rd, 1, rd subcc rd, siconst13 , rd andcc rd, rs, rd andcc rd, siconst13 , rd test bits decrement test increment Comment compare inccc rd inccc siconst13 , rd deccc rd deccc siconst13 , rd btst btst rs, rd siconst13 , rd The Condition Codes Slide 51 Two condition codes are updated The 32-bit result: %icc The 64-bit result: %xcc 26 Branching Based on the Condition Codes Name ba bn bne Condition always never Z Z Z Z Comment unconditional branch always unconditional branch never not equal (to zero) nonzero (a synonym for bne) equal (to zero) zero (a synonym for be) greater (than zero) Slide 52 bnz be bz bge bl N xorV N xorV Branching Based on the Condition Codes (continued) Name bgu bleu bcc bgeu Condition C or Z C or Z C C Comment greater (than zero), unsigned less or equal (to zero), unsigned carry clear greater or equal (to zero), unsigned (synonym for bcc) bcs blu bpos bneg bvc bvs C C N N V V carry set less (than zero), unsigned positive negative overow clear overow set Slide 53 0 ) ble Z or N xorV 0 ) bg Z or N xorV Less or equal (to zero) greater or equal (to zero) less (than zero) 27 SPARC Code Examples Slide 54 : Using a cmp synthetic instruction cmp %r2, %r3 ble %xcc, ! if( a b ) goto ; nop ! branch delay slot inc %r2 ! a = a + 1; : Nullication: Motivation Cancelling the effect of an instruction in the branch delay slot Example original cmp %r2, %r3 ble %xcc, ! if( a b ) goto ; nop ! branch delay slot inc %r2 ! a = a + 1; : without using a nop instruction cmp bg inc dec : %r2, %r3 %xcc, ! if( a b ) goto ; %r2 ! a = a + 1; delay slot %r2 ! a = a 1; cancel Slide 55 28 " " & " & $ Basic translation sub %r2, %r3, %r0 ble %xcc, nop inc %r2 ! ! ! ! a b; if( c 0 ) goto ; branch delay slot a = a + 1; Nullication : Encoding Branches Using Register Comparison to Zero 31 30 29 28 27 25 24 22 21 20 19 18 14 13 0 00 a 0 rcond 011 dhi p rs1 Field a rcond dhi p rs1 d16lo Meaning Annul (nullify): 1 to annul the instruction in the delay slot Branching condition Most signicant 2 bits of the displacement Prediction: 1 to predict branch taken, 0 to predict branch not taken Source register Least signicant 14 bits of the displacement Slide 57 Name brz brlez brlz rcond 001 010 011 Name brnz brgz brgez 29 $ Slide 56 For conditional branching instructions: branch taken: instruction in delay slot is executed branch not taken: affect of instruction in delay slot can be nullied For unconditional branching (ba and bn): instruction in delay slot can be nullied Specied by concatenating ,a to the operation name SPARC uses the name annul instead of nullify Example cmp %r2, %r3 bg,a %xcc, inc %r2 ! if( a b ) goto ; ! a = a + 1; delay slot d16lo rcond 101 110 111 Displacement Addressing Displacement Sign extend *4 + Program Counter (PC) Slide 58 Encoding Branches Based on the Condition Codes 31 30 29 28 25 24 22 21 20 19 18 0 00 a cond 001 cc p disp19 Slide 59 Field a cond cc p disp19 Meaning Annul (nullify): 1 to annul the instruction in the delay slot Branching condition Condition code used in branching: 00 for %icc, 10 for %xcc Prediction: 1 to predict branch taken, 0 to predict branch not taken 19-bit displacement 30 Encoding the Condition Name bn be, bz Slide 60 ble bl bleu bcs, blu bneg bvs cond 0000 0001 0010 0011 0100 0101 0110 0111 Name ba bne, bnz bg bge bgu bcc, bgeu bpos bvc cond 1000 1001 1010 1011 1100 1101 1110 1111 Instruction Encoding Examples Slide 61 bot: 31 Code top: brlz inc ba sub %r5, bot %r2 %xcc, top %r5, %r4, %r5 ! ! ! ! if( temp 0 ) goto bot x = x + 1; delay goto top; temp = temp - z; delay Instruction Encoding Examples (Continued) Slide 62 Slide 63 Encoding the brlz instruction Format 31 30 29 28 27 25 24 22 21 20 19 18 14 13 0 00 a 0 rcond 011 dhi p rs1 d16lo Field values Field a rcond dhi p rs1 d16lo Encoding 0 011 00 1 00101 00000000000011 Encoding: 00 0 0 011 011 00 1 00101 00000000000011 or 0x06c94003. Instruction Encoding Examples (Continued) Encoding the ba instruction Format 31 30 29 28 25 24 22 21 20 19 18 0 00 a cond 001 cc p disp19 Field values Field a cond cc p disp19 Encoding 0 1000 10 1 1111111111111111110 Encoding: 00 0 1000 001 10 1 1111111111111111110 or 0x106ffffe. 32 Translating Loops Slide 64 Slide 65 33 & & % Translate to code that uses simple conditional unconditional branches Try to eliminate unconditional branches in loops Translate to SPARC assembly code, using nop instructions in the branch delay slots Put real instructions in the branch delay slots Eliminate Unconditional Branches in Loops Move the test to the bottom of the loop Example temp = y z; x = 0; goto test; top: x = x + 1; temp = temp z; test: if( temp 0 ) goto top; Translate to SPARC Code Slide 66 top: inc sub test: %r2 %r5, %r4, %r5 ! x = x + 1; ! temp = temp - z; ! if( temp 0 ) goto top ! branch delay slot Put Real Instructions in the Branch Delay Slots Slide 67 top: sub test: %r5, %r4, %r5 ! temp = temp - z; ! if( temp 0 ) goto top ! x = x + 1; delay slot 34 % brge,a %r5, top inc %r2 & sub ba clr %r3, %r4, %r5 %xcc, test %r2 ! temp = y z; ! goto test; ! x = 0; delay slot % brge %r5, top nop & sub clr ba nop %r3, %r4, %r5 %r2 %xcc, test ! ! ! ! temp = y z; x = 0; goto test; branch delay slot More Complex Conditional Expressions & % % Slide 68 Translation if( 20 a ) goto fals1; if( a 200 ) goto fals1; b = 100; goto 1; fals1: b = 100; 1: 35 ' ! & ' ! ( ( Example if( 20 a && a b = 100; else b = 100; 200 )
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

New Mexico - MGMT - 343
1.1 Upload/Download to your UNM Account A. Desktop B. Click on the Quick Connect button, or click on File, Quick Connect. C. In the dialog box type in ftp.unm.edu for the "Host Name" and your UNM NetID for your "User Name" and hit the enter key (or c
New Mexico - MGMT - 343
IRS Link and Learn Web-Address: http:/www.irs.gov/app/vita/intro.jsp
New Mexico - MGMT - 343
SCHEDULE E (Form 1040)Department of the Treasury Internal Revenue Service (99)Supplemental Income and Loss(From rental real estate, royalties, partnerships, S corporations, estates, trusts, REMICs, etc.)Attach to Form 1040 or Form 1041. See Inst
New Mexico - MGMT - 362
MEDIA MANAGEMENTThe University of New MexicoDennis F. Herrick, M.A. 277-3437, C&J Room 241 herrick@unm.eduC&J 362Spring 2005 11 a.m. to 12:15 p.m. Tuesdays and Thursdays, MH 119Ofce Hours: C&J 2411 to 4 p .m. Wednesdays, or appointment. Drop-i
New Mexico - MGMT - 433
Service Operations OverviewChapters of Little Importance Chapter 1 The Service Economy Chapter 15 Quality and Productivity Improvement (Not covered) Chapter 17 Forecasting (Not covered)Chapter 2 Nature of Services The Service Package
New Mexico - MGMT - 433
Managing Service ProjectsLearning Objectives Describe the nature of project management. Construct a project network. Perform critical path analysis on a project network. Allocate limited resources to a project. Crash activities to reduce the p
New Mexico - MGMT - 433
Queuing Models and Capacity PlanningLearning Objectivess s sssDiscuss the strategic role of capacity planning. Describe a queuing model using A/B/C notation. Use queuing models to calculate system performance measures. Describe the relations
New Mexico - MGMT - 434
MGT 434 WEEK #9CHAPTER 9 LEAN THINKING VS. GERMAN TECHNIKGERMAN TECHNIKPorsche July 27,1994 the first defect free Porsche Carrera came off the assembly line in the Stuttgart Germany. This was the result of the German tradition for quality that is
New Mexico - MGMT - 434
MGT 434-FALL 2008 WEEK #9LEAN THINKING CH 8 & 9 THE ACID TEST & LEAN THINKING VS. GERMAN TECHNIKTHE ACID TESTPRATT WHITNEYS EXPERIENCEGlobal Competitors(GE AND ROLLS-ROYCE)inventories instead of ordering new engines. 1989 new orders were 1,66
New Mexico - MGMT - 449
Chapter 4 IDENTIFYING RISKS AND CONTROLS IN BUSINESS PROCESSESInternal Control and Accountants RolesAccountants as Managers Sarbanes-Oxley Act of 2002 and Standard No. 2 of the Public Company Accounting Oversight Board (PCAOB) requires: Manageme
New Mexico - MGMT - 449
Ch. 4 Identified Risks and Controls in Business Processes SM 4-1Chapter 4 Identifying Risks and Controls in Business Processes REVIEW QUESTIONS1. The five internal control components are: 1. Control environment refers to broad factors that set the
New Mexico - MGMT - 462
Overview of the Quality MovementDouglas M. Stewart, Ph.D. Anderson Schools of Management University of New MexicoModern Importance of QualityThe first job we have is to turn out quality merchandise that consumers will buy and keep on buying. If
New Mexico - MGMT - 462
Leadership, Strategy and DeploymentDouglas M. Stewart, Ph.D. The Anderson Schools of Management University of New MexicoLeadership Theability to positively influence people and systems to have a meaningful impact and achieve resultsStrategic
New Mexico - MGMT - 462
Metrics and the Cost of QualityDouglas M. Stewart, Ph.D. The Anderson Schools of Management University of New MexicoWhy Metrics! A strategy without metrics is just a wish. And metrics that are not aligned with strategic objectives are a waste of
New Mexico - MGMT - 462
Reengineering, Poka-Yoke Process Improvement & Kaizen EventsDouglas M. Stewart, Ph.D. Anderson Schools of Management University of New MexicoReengineeringWhat is Reengineering? Radical change Starting over from scratch, rethinking how things h
New Mexico - MGMT - 464
MGT 464 Human Resource Management (from a strategic perspective) SPEAK UP! SHOW UP! Respect others opinions Learn something and HAVE FUN!Chapter 1Meeting Present and Emerging Strategic Human Resource ChallengesHRFree AssociateBasic func
New Mexico - MGMT - 464
MGT 464 Human Resource Management: Theory & PracticeSpring 2005 ASM 1068 12:30-3:00 P.M. Thursdays Instructor: Robert G. DelCampo, Ph. D. Office: ASM 2128 Phone: (505) 277-0018 Email: delcampo@mgt.unm.edu Line #: 16695 Office Hours: Tuesday 2:00-4:0
New Mexico - MGMT - 464
Managing Diversity 2001 by Prentice Hall4STAR POWERDiversity Exercise .an introduction 2001 by Prentice HallChallenges Link affirmative action programs to employee diversity programs to ensure that the two support each other. Identify the
New Mexico - MGMT - 464
Developing Employee Relations and Communications13The Communication Process within an OrganizationNoise Communication Channel Sender (Encodes Message) Receiver (Decodes Message)Feedback NoiseHow to Communicate Useful Feedback to Employees F
New Mexico - MGMT - 465
DSpaceUNM FAQThe Universitys Institutional repositoryWhat is a Digital Institutional Repository?A university-based institutional repository is a set of services that a university offers to the members of its community for the management and disse
New Mexico - MGMT - 470
New Mexico - MGMT - 476
Civil Practice ManualFor The Clinical Law Program University of New Mexico School of LawProfessor Jos L. Martinez Professor April I. Land July, 2003TABLE OF CONTENTSCivil Practice Manual.. 1University of New Mexico School of Law . 1 Intro
New Mexico - MGMT - 488
UNIVERSITY of NEW MEXICO ANDERSON SCHOOLS OF MANAGEMENT Course Syllabus Fall 2004COURSE: 488 Materials and Supply Chain ManagementCLASS MEETING ROOM/TIME: MW 1400- 1515, ASM 1065 INSTRUCTOR: OFFICE: OFFICE HOURS: CONTACT INFORMATION: REQUIRED TEX
New Mexico - MGMT - 488
Supply Chain ManagementChapter 1 & 2 (cont) 2004 Prentice-Hall, Inc.2-1Competitive and Supply Chain Strategiesx x x xCompetitive strategy Product development strategy Marketing and sales strategy Supply chain strategy 2004 Prentice-Hall,
New Mexico - MGMT - 489
MANAGEMENT 489 MARKETING OF SERVICES ANDERSON SCHOOL OF MGT FALL 2004McGraw-Hill/Irwin2003. The McGraw-Hill Companies. All Rights ReservedMcGraw-Hill/Irwin2003. The McGraw-Hill Companies. All Rights ReservedChapter1Introduction to Servi
New Mexico - MGMT - 489
MANAGEMENT 489 ANDERSON SCHOOL OF MANAGEMENT FALL 2004 CHAPTERS 3-4McGraw-Hill/Irwin2003. The McGraw-Hill Companies. All Rights ReservedCustomer Expectations of Service Customer Services Expectations More: quality, options, service Lower:
New Mexico - MGMT - 489
MGT 489 QUESTIONS FROM CUSTOMER SERVICE SKILLS FOR SUCCESS SOME QUESTIONS I CAME UP WITH WHEN READING CHAPTER 1 AND 2QUESTIONS What do you enjoy about dealing with customers? What do you dislike about dealing with customers? Does customer servic
New Mexico - MGMT - 490
Mgt 490, Corporate Governance Fall 2003Donald G. Simonson, PhDNOTES ON SHAREHOLDERS AND OWNERSHIP INTRODUCTION: Fiduciary standard: addresses the basic problem of governance: Open and fair resolution of conflict, especially between informed, moti
New Mexico - MGMT - 490
Mgt 490: Corporate Governance Donald G. Simonson, PhDFall 2003NOTES ON BOARDS OF DIRECTORS I. INTRODUCTION 1. Board has strict and absolute fiduciary duty to ensure that a company is run in the long-term interests of the owners (shareholders). 2.
New Mexico - MGMT - 490
Board of Directors:represent shareholders Shareholders Board of Directors ManagementComplex OperationsLegally responsible for the firm, but mgt has time, expertise, infrastructureTheory: mgt serves the board. Reality?Board Composition Siz
New Mexico - MGMT - 490
Seminar in Corporate Governance Fall 2003 Donald G. Simonson, Professor emeritus, Senior Research ScholarEXERCISES FOR WEEK 2 (SEPTEMBER 3)(due September 8)1.REVIEW / RE-READ IN CHAPTER 1 OF ROSS, WESTERFIELD AND JAFFE (RWJ), 5 EDITION. SECTIO
New Mexico - MGMT - 496
COURSE SYLLABUS MGT 496-001 ENTREPRENEURIAL FINANCIAL MANAGEMENT SPRING 2005Professor: Office: Phone/VM: Email:Howard (Ward) J. Hickey Jr. Room 2135 @ ASM 2nd Floor (Messages) 715-1355 (H) 888-0076whickey@unm.edu hjhickeyjr@yahoo.comClassroom:
New Mexico - MGMT - 498
MGMT498ReadingsList:ToaccessreadingsfromtheWallStreetJournal(WSJ).GoTo:UNMLibraries online;Select:ElectronicReferenceShelf;Newspapers;WallStreetJournal;Enter:ArticleTitle 1. Export Boom Fuels Factory Town's Revival; Plants Thrive, Reopen in Manitowo
New Mexico - MGMT - 504
Section 504OIEP National Early Childhood Meeting November 2004From John Copenhaver/Catherine BenitzMountain Plains Regional Resource Center Utah State University www.usu.edu/mprrcCivil Rights Section 504 is often referred to as the first civil
New Mexico - MGMT - 504
Chapter 7The Cost of ProductionIntroductionProduction technology measures the relationship between input and output Production technology, together with prices of factor inputs, determine the firms cost of production Given the production technolo
New Mexico - MGMT - 506
MGT 504Microeconomics for Managers Fall 2008 GSM 230 Mondays and Wednesdays 9:30 10:45 am Instructor: Kevin Stevenson Office: Scholes Hall 327 Phone: (505) 277-0955 Email: kevings@unm.edu Office Hours: Mondays and Wednesdays 8:15am 9:15 am and by
New Mexico - MGMT - 509
LEGAL TOPICS IN MANAGEMENTMGMT 509 ANDERSON SCHOOLS OF MANAGEMENT THE UNIVERSITY OF NEW MEXICO SPRING 2008 INSTRUCTOR: Nikki Mann, J.D. PHONE: 277-4631 OFFICE: ASM 2054 E-MAIL: nmann@unm.edu.OFFICE HOURS: Mondays and Wednesdays 3:30-5:00 and by app
New Mexico - MGMT - 509
ACAM 100-509 Fall 2008Instructor: E-mail: Time: Place: Book: Website: Office Hours: Course Description: Course Overview: Materials: Students will learn to: Attendance Policy: Classroom Environment: Students with disabilities: Support Service
New Mexico - MGMT - 511
Mgt. 511 Innovation and Technology ManagementDr. Steven WalshOutlineDeveloping an Innovation and Technology Strategy Review selected week 1 tools Innovation and Materials - Physical Products Innovation and F&A - Physical Products Innovation
New Mexico - MGMT - 511
Mgt 511 - Management of Technology & Innovation - ExamEach Question is worth 25 points This is a closed book, closed note test. It should take about one hour, but you have a full two hours of class time to complete it. This quiz requires you to answ
New Mexico - MGMT - 513
Technology Forecasting and Assessment week 13MGT 513Outline 1. Marie Garcia and Olin Bray, Fundamentals of Technology Roadmapping Sandia report 97-0665. 2.Sibylle Breiner, Kerstin Cuhls and Harioff Grupp, Technology Foresight using a Del
New Mexico - MGMT - 514
Mgt. 514 TECHNOLOGICAL ENTREPRENEURSHIP Fall 2008 Instructor: Office: Phone (Voice Mail): Fax e-mail address: Office Hours: Sul Kassicieh ASM 2110 505.277.8881 505.277.9868 sul@unm.edu M 1:30-2:30 and by appointmentBook Jeffry A. Timmons and Stephe
New Mexico - MGMT - 514
Business PlansSul Kassicieh Anderson School of ManagementIntroductionFocus your thinking Establish realistic strategy Improve operations Financing and other support Reaction by othersNew Ventures2ResourcesExperience of successful entr
New Mexico - MGMT - 514
Chapter7The Founder and TeamMcGraw-Hill/Irwin New Venture Creation, 7/e 2007 The McGraw-Hill Companies, Inc., All Rights Reserved.7-1Exhibit 7.17-2Exhibit 7.27-3Exhibit 7.37-4Exhibit 7.47-5Exhibit 7.57-6Traits Character
New Mexico - MGMT - 520
1The McGraw-Hill Companies, Inc., 20042Chapter 2Operations Strategy and CompetitivenessThe McGraw-Hill Companies, Inc., 20043OBJECTIVES Operations Strategy Competitive Dimensions Order Qualifiers and Winners Strategy Design Process
New Mexico - MGMT - 523
Welcome to Service Operations ManagementDouglas M. Stewart, Ph.D.Associate Professor of Operations Management Anderson Schools of Management University of New MexicoThe Role of Services in an EconomyLearning Objectives Describe the central rol
New Mexico - MGMT - 523
Managing Capacity and DemandLearning ObjectivesDescribe the strategies for matching supply and demand for services. Recommend an overbooking strategy. Use Linear Programming to prepare a weekly workshift schedule. Prepare a work schedule for pa
New Mexico - MGMT - 523
Designing Robust ServicesDouglas M. Stewart, Ph.D.Associate Professor Anderson Schools of Management University of New MexicoOverview The 3Ts of the service encounter Task Treatment Tangibles Robustness to service failure Interrelationship
New Mexico - MGMT - 525
Management of 525k Funds Approved August 29, 2007 1. Background The UNM Cancer Research & Treatment Center (CRTC) was founded by the New Mexico State Legislature in 1971 as a State Research and Public Service Project (RPSP). In the early 1980s, the C
New Mexico - MGMT - 532
V. Simulation Management and Output AnalysisM. Peter Jurkat CS452/Mgt532 Simulation for Managerial Decisions The Robert O. Anderson Schools of Management University of New Mexico01/17/09 UNM/MPJ CS452/Mgt532 V. Output Analysis 1Simulation Managem
New Mexico - MGMT - 532
III. Statistical ModelsM. Peter Jurkat CS452/Mgt532 Simulation for Managerial Decisions The Robert O. Anderson Schools of Management University of New Mexico01/17/09 UNM/MPJ CS452/Mgt532 III. Statistical Models 1Why Stochastic Variables?q qq
New Mexico - MGMT - 532
I. IntroductionM. Peter Jurkat CS452/Mgt532 Simulation for Managerial Decisions The Robert O. Anderson Schools of Management University of New Mexico01/17/09 MPJ/UNM CS452/Mgt 532 I. Introduction 1DefinitionsqSimulation: process of experiment
New Mexico - MGMT - 540
Final exam: Mgmt 540 Fall 2008Name_Answer every question. Show and label all calculations for full credit. 110 possible points 1. (eight points) Freedman Inc. reported the following: Net income for 2005 was $61000. Depreciation expense for 200
New Mexico - MGMT - 540
1ADDITIONAL INVENTORY ISSUESI. Lower of Cost or MarketDeparture from historical cost basis when the revenue producing ability of the asset falls below its acquisition cost How is the cost calculated?How is market calculated? Market is the repla
New Mexico - MGMT - 540
1INVENTORIES-Cost Measurement and Cost Flow AssumptionsI. Definition and Other A. Assets of the company 1) held for sale in the normal course of business and/or 2) used and consumed in the production of goods to be soldB. Systems- Perpetual and
New Mexico - MGMT - 542
Economics 542 Environmental and Natural Resource Economics: Survey Spring 2006 Instructor: Professor Jennifer Thacher, Econ 2005, 277-1965, email: jthacher@unm.edu. Website: www.unm.edu/jthacher/index.html Time and Location: T, Th 12:30 - 1:45, SSCI
New Mexico - MGMT - 542
New Mexico - MGMT - 542
Future Directions of Stated Choice Methods for Environment ValuationVic Adamowicz and Peter Boxall Department of Rural Economy, University of Alberta, Edmonton, Alberta, Canada March 15, 2001Paper prepared for: Choice Experiments: A New Approach
New Mexico - MGMT - 542
Environmental & Resource Economics (2006) 34: 173188 DOI 10.1007/s10640-005-4817-0 Springer 2006What You Dont Know Might Hurt You: Some Unresolved Issues in the Design and Analysis of Discrete Choice ExperimentsJORDAN J. LOUVIERECentre for the
New Mexico - MGMT - 543
Management 543 Tax Return Project IILobo Corporation (C Corporation) and Bill Richardson (Individual) are 50/50 profit, loss, and ownership of capital partners in the Texico general partnership. Lobo Corporation is on a fiscal year beginning Septemb