How is it possible for one computer with a low MIPS rating to have a better performance in practice than a computer with a high MIPS rating?
What will be an ideal response?
MIPs measure only instruction execution rates and not the work done. If two systems are almost identical (hardware, ISA, software), the MIPS rating may well allow a comparison.
Let’s look at a hypothetical example (the code fragments A and B are given below). Code fragment A runs on a computer that supports byte?length operations. We have a simple loop that multiplies a byte element by 4 and adds 1. We’ve assumed that the index register is not automatically updated. In Code fragment B, we have assumed that the processor loads 4 bytes at once and supports SIMD?style operations that can be applied to data, plus a post?incrementing register indirect addressing mode. Code B also has a COUNT instruction that performs a decrement and branch back on non?zero.
The number of operations performed by code A is 2 + 256 × 7 = 1794. The number of operations performed by code B is 2 + 64 × 5 = 324. In this case, we have two fragments of code that perform the same action. However, one executes approximately 5.53 times more instructions than the other. Consequently, the MIPS rating of a computer running code B could be five time slower than that of Code A and execution would still be faster.
Code A
MOV r0,#256
LDRB r1,Table
Loop LDRB r2,[r1] ;load a byte
LSLB r2,r2,#2 ;multiply if by 4
ADDB r2,r2,#1 ;add 1
STRB r2,[r1] ;store it
ADDB r1,r1,#1 ;increment the pointer
SUBS r0,r0,#1 ;subtract 1 from the loop count
BNE Loop ;repeat
Code B
MOV r0,#64
LDR r1,Table
Loop PLDRB r2,[r1] ;parallel load 4 bytes
PADDAB r2,#1 ;parallel add 1 to each byte
PLSLB r2,#2 ;parallel shift 4 bytes
STRB r2,[r1,#1]! ;store it
COUNT r0,Loop
You might also like to view...
When you upload pages to your remote or testing server, you must also upload ____ files.
A. absolute B. relative C. dependent D. indexed
Pressing the Increase List Level button promotes text in an outline
Indicate whether the statement is true or false
The most robust level of security that can be achieved today for wireless LANs is using the ____ model.
A. personal security B. transitional security C. temporal security D. enterprise security
Which of the following are likely to be poor choices for an identifier in a program? Why?
a) x b) RATE c) data d) _abc e) A