...

Princeton University COS 217: Introduction to Programming Systems SPARC Architecture Summary

by user

on
Category:

chemistry

3

views

Report

Comments

Transcript

Princeton University COS 217: Introduction to Programming Systems SPARC Architecture Summary
Princeton University
COS 217: Introduction to Programming Systems
SPARC Architecture Summary
Registers
%r0
%r1
%r2
%r3
%r4
%r5
%r6
%r7
%g0
%g1
%g2
%g3
%g4
%g5
%g6
%g7
%r8
%r9
%r10
%r11
%r12
%r13
%r14
%r15
%o0
%o1
%o2
%o3
%o4
%o5
%o6
%o7
%r16
%r17
%r18
%r19
%r20
%r21
%r22
%r23
%l0
%l1
%l2
%l3
%l4
%l5
%l6
%l7
%r24
%r25
%r26
%r27
%r28
%r29
%r30
%r31
%i0
%i1
%i2
%i3
%i4
%i5
%i6
%i7
%f0
...
%f31
%sp
%fp
Global Registers:
Zero
Temporary value (destroyed)
Global variable (saved?)
Global variable (saved?)
Global variable (saved?)
Global variable (saved?)
Global variable (saved?)
Global variable (saved?)
Output Registers:
Function actual parameter or return value from caller (destroyed)
Function actual parameter (destroyed)
Function actual parameter (destroyed)
Function actual parameter (destroyed)
Function actual parameter (destroyed)
Function actual parameter (destroyed)
Stack pointer (saved)
Addr of call instruction / temporary value (destroyed)
Local Registers:
Local variable (saved) (used by interrupt handler)
Local variable (saved) (used by interrupt handler)
Local variable (saved)
Local variable (saved)
Local variable (saved)
Local variable (saved)
Local variable (saved)
Local variable (saved)
Input Registers:
Function formal parameter or return value to caller (saved)
Function formal parameter (saved)
Function formal parameter (saved)
Function formal parameter (saved)
Function formal parameter (saved)
Function formal parameter (saved)
Frame pointer (saved)
Return addr – 8 (saved)
Floating-Point Registers:
Floating-point value (saved)
...
Floating-point value (saved)
Page 1 of 3
Stack Structure
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
%sp
...
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
%fp
...
register window
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
4
8
12
16
20
24
28
32
36
40
44
48
52
56
60
64
68
72
76
80
84
88
92
- 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
4
8
12
16
20
24
28
32
36
40
44
48
52
56
60
64
68
72
76
80
84
88
92
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
structure pointer
actual parameter 1 (often unused)
actual parameter 2 (often unused)
actual parameter 3 (often unused)
actual parameter 4 (often unused)
actual parameter 5 (often unused)
actual parameter 6 (often unused)
additional actual parameters and
saved floating-point registers
...
local variables
register window
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
register window (cont.)
structure pointer
formal parameter 1 (often unused)
formal parameter 2 (often unused)
formal parameter 3 (often unused)
formal parameter 4 (often unused)
formal parameter 5 (often unused)
formal parameter 6 (often unused)
additional formal parameters and
saved floating-point registers
...
Page 2 of 3
92
bytes
Current
Function’s
Stack
Frame
???
bytes
92
bytes
Calling
Function’s
Stack
Frame
Instruction Format 1 (call)
31-30
29-0
Op code (01)
Displacement
Instruction Format 2 (sethi)
31-30
29-25
24-22
21-0
Op code (00)
Destination register
Op code continued (100)
Immediate operand
Instruction Format 2 (branches and nop)
31-30
29
28-25
24-22
21-0
Op code (00)
Annul bit
Condition
Op code continued
Displacement
Instruction Format 3
(all other instructions, two source registers)
31-30
29-25
24-19
18-14
13
12-5
4-0
Op code (10 or 11)
Destination register
Op code continued
Source register 1
0
(unused)
Source register 2
Instruction Format 3
(all other instructions, source register and immediate operand)
31-30
29-25
24-19
18-14
13
12-0
Op code (10 or 11)
Destination register
Op code continued
Source register 1
1
Source immediate constant
Copyright  2001 by Robert M. Dondero, Jr.
Page 3 of 3
Fly UP