1 / 7

Microprocessors

Microprocessors. The SPARC Architecture (User Level Instruction Set) Apr 16th, 2002. Main Characteristics. 32 x 32-bit integer registers With register windows Total registers defined by implementation Typically a couple of hundred Now extended to 32 x 64-bits

Télécharger la présentation

Microprocessors

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. Microprocessors The SPARC Architecture (User Level Instruction Set) Apr 16th, 2002

  2. Main Characteristics • 32 x 32-bit integer registers • With register windows • Total registers defined by implementation • Typically a couple of hundred • Now extended to 32 x 64-bits • 8-bit addressable bytes, big-endian • Now data access can be little-endian

  3. Register Windows • Global registers (R0-R7) %g0 - %g7 • Not affected by windowing • Out registers (R8-R15) %o0 - %o7 • Become In registers when window shifted • Local registers (R16-R23) %l0 - %l7 • Saved automatically when window shifted • In registers (R24-R31) %i0 - %i7 • Correspond to out registers of caller

  4. How Window Shift Works • Caller Callee r31..r24 (ins) r23..r16 (locals) r15..r8 (outs) r31..r24 (ins) r23..r16 (locals) r15..r8 (outs)

  5. The SAVE Instruction • SAVE source-reg,immed-or-reg,dest-reg • Subtract 1 from CWP (mod NWINDOWS) • Check bit in WIM • If window invalid trap • If OK, then add immed-or-reg to source-reg (addressed in old window) and put result in dest-reg (addressed in new window) • Source-reg is (old) stack pointer (an out register) • Dest-reg is (new) stack pointer • Frame pointer automatically set to old stack pointer

  6. The RESTORE Instruction • RESTORE reg-src, reg-or-imm, reg-dest • Add 1 to CWP (mod NWINDOWS) • Check bit in WIM • If window is invalid, trap • Else add reg-or-imm to reg-src (in old window) and store result in reg-dest (in new window).

  7. Software (ABI) Conventions • Frame pointer is %i6 (or %fp) • Stack pointer is %o6 (or %sp) • Moving the window makes the new frame pointer correspond to the old stack pointer • The old frame pointer is saved • The addition from SAV sets the new stack pointer to the old stack pointer – frame size • The RESTORE restores the old stack pointer and frame pointer (no addition needed normally but could use to pop caller stack)

More Related