Download presentation
Presentation is loading. Please wait.
Published bySara Simpson Modified over 9 years ago
2
Control Transfer and Arithmetic Conditional/Unconditional branches Delayed Control Transfer –Increases the efficiency of pipelining Annulled branches Usual arithmetic and logical operations
3
5. Data Types and Addressing Eleven Data Types –unsigned byte (8 bits) to extended precision floating point (128 bit)
4
SPARC Data Types TypeSize (bits) Corresponding C Data Type Range Unsigned Byte8 unsigned char 0 … 256 Byte8 char –128 … 127 Unsigned Halfword16 unsigned short 0 … 65 535 Halfword16 short –32 768 … 32 767 Unsigned Word32 unsigned int/long 0 … 4 294 967 295 Word32 int/long –2 147 483 648 … 2 147 483 647 Doubleword64N/AVery large! Tagged Data30 + 2N/A0 … 1 073 741 823 Single Precision Floating Point 32 float s = 1, e = 8, f = 23 Double Precision Floating Point 64 double s = 1, e = 11, f = 52 Extended Precision Floating Point 128N/As = 1, e = 15, j = 1, f = 63
5
Registers and Memory Registers –All 32 bits Big-Endian Convention Data Alignment
6
Addressing Modes Four addressing modes: –Two register –Register + (13-bit) immediate –30-bit PC-relative –22-bit PC-relative
7
Register Windows save and restore Window over/under flow
8
Register Windows
9
Variables Accessed using ld and st –ld [%fp - 4], %l0
10
Some Useful m4 Macros define(local_vars, `define(last_sym, 0)’) define(var, `$1 = last_sym - $2 & -$2 define(`last_sym’, $1)’) define(begin, `.globalmain main: save%sp, -92 + last_sym & -8, %sp’) define(end, `mov1, %g1 t0’)
11
Using the Macros include(macro_defs.m) local_vars var(x, 4) var(y, 4) begin ld[%fp + x], %l0! l0 <- x st%l0, [%fp + y]! y <- l0 end
12
Expansion x = 0 - 4 & -4 y = x - 4 & -4.global main main: save %sp, -92 + y & -8, %sp ld [%fp + x], %l0 ! l0 <- x st %l0, [%fp + y] ! y <- l0 mov 1, %g1 t 0
13
Global Variables Use data definition pseudo-ops.data ! Start of data segment x:.word 12 ! int x = 12; y:.byte 'a' ! char y = 'a';.align 2 ! Get alignment correct z:.half 0xffff ! short z = 0xffff;.align 4 ! Get alignment correct lst:.skip 4 * 100 ! int lst[100];.text ! Start of program segment...
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.