1 / 9

CISC versus RISC

CISC versus RISC. Two competing philosophies for the design of a processor’s instruction-set. The RISC idea. RISC: Reduced Instruction-Set Computer

Download Presentation

CISC versus RISC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CISC versus RISC Two competing philosophies for the design of a processor’s instruction-set

  2. The RISC idea • RISC: Reduced Instruction-Set Computer • There will be a relatively small number of very simple operations that the CPU can execute, which the programmer uses as basic building blocks for constructing complex algorithms • Because there are so few instructions, they can be uniquely identified by only a few bits • Hence these short instructions can be more quickly fetched, decoded, and executed

  3. The CISC idea • CISC: Complex Instruction-Set Computer • Identify the most important operations that a computer will need to perform, then build the circuitry for each one of those operations into its own special-purpose machine-instruction • Instead of fetching a large number of small instructions, it will be more efficient to fetch and execute just one very powerful instruction

  4. Some x86 CISC instructions • The x86’s ‘string-manipulation’ instructions are examples of the CISC philosophy • These instructions are specially designed to do the most common ‘word processing’ operations in an optimized manner (e.g., copying, comparing, and searching long strings of characters stored in memory)

  5. The string operations • Move-string: movs • Compare-strings: cmps • Scan-string: scas • Store-string: stos • Load-string: lods • Output-string: outs • Input-string: ins

  6. Initial setup • Each of the string-instructions requires a certain amount of preparatory setup, but then can repeatedly execute an operation without needing to re-fetch and re-decode • Hence the overall string-operation can be done more efficiently than could be done by using a customary program-loop

  7. Example: ‘strlen’ # # Finding the length of a null-terminated string of ASCII character-codes # mov $msg, %rdi # point RDI to beginning of the string mov $0, %al # setup the null-byte’s value in AL cld # clear the DF-bit in EFLAGS mov $-1, %rcx # maximum unsigned integer in RCX repne scasb # scan string for its first NULL byte sub $msg, %rdi # subtract start to get string length

  8. Midterm question • On a different topic, we show a slide which conveys an idea for solving Question V • Most of the code in our ‘myargs.s’ demo can be reused, but a couple of changes will be needed: • Start from the end of the array of pointers, instead of from the beginning • Decrement the array-index upon each pass through the loop, instead of incrementing it

  9. ‘reorder.s’ command-line: $ ./reorder xx yyy zzzz 0 8 16 24 32 40 argc (=4) argv0 argv1 argv2 argv3 NULL (=0) RSP . / r e o r d e r x x y y y z z z z argc (argument count) = number of strings typed on the command-line mov (%rsp), %rbx dec %rbx mov 8( %rsp, %rbx, 8 ), %rsi  RSI (=argv3)

More Related