Falcon-E: Introduction: (I.e., 4 Byte Chunks)
Falcon-E: Introduction: (I.e., 4 Byte Chunks)
Falcon-E: Introduction: (I.e., 4 Byte Chunks)
2
CS501
Advanced Computer
Architecture
Lecture10
31 0
R0 7 0 7 0
R1 0
: 1
R7 2
Register file :
BP :
:
SP
IR 232-1
PC
7 0
8 M[8] One memory “word”
9 M[9]
31 24 23 16 15 8 7 0
10 M[10]
M[11] M[10] M[9] M[8]
11 M[11]
MS Byte LS Byte
6
Falcon-E : instruction formats
31 27 26 0
Type A O pcode D is p la c e m e n t / N o t U s e d
31 27 26 24 23 0
Type B O pcode ra D is p la c e m e n t / Im m e d ia te
31 27 26 24 23 21 20 0
Type C O pcode ra rb D is p la c e m e n t / Im m e d ia te
31 27 26 24 23 21 20 18 17 4 3 0
7
Encoding for the GPRs
to be used in place of ra, rb, or rc
Register Code Register Code
R0 000 R4 100
R1 001 R5 101
R2 010 R6 110
R3 011 R7 111
8
Encoding for the SPRs
to be used in place of rb in lds and sts instructions
Register Code
SP 000
BP 001
9
31 27 26 0
Type A O pcode D is p la c e m e n t / N o t U s e d
nop (op-code = 0)
useful in pipelining
ret (op-code = 15)
iret (op-code = 17)
near jmp (op-code = 18)
10
Type B
31 27 26 24 23 0
O pcode ra D is p la c e m e n t / Im m e d ia te
pop R7
ld (op-code = 10)
ld R7, [1254h]
st (op-code = 12)
st R7, [1254h]
11
Type C
31 27 26 24 23 21 20 0
O pcode ra rb D is p la c e m e n t / Im m e d ia te
O pcode
27 26
ra
24 23
rb
21 20
Im m e d ia te
4 3
fu n c
0
If the constant
addi (op-code = 2) immediate 2’s complement additionis negative,
this becomes
addi R3, R4, 56 R[3] R[4] + 56 a subtract
instruction
13
Type D
31 27 26 24 23 21 20 18 17 4 3 0
O pcode ra rb rc U nused fu n c
Opcode Function
Control Instructions Mnemonic
Dec Bin Dec Bin
15
FUNCTIONAL GROUPS OF
INSTRUCTIONS
Opcode Function
Arithmetic Instructions Mnemonic
Dec Bin Dec Bin
16
FUNCTIONAL GROUPS OF
INSTRUCTIONS
Opcode Function
Logic Instructions Mnemonic
Dec Bin Dec Bin
Or or 1 00001 5 0101
17
FUNCTIONAL GROUPS OF
INSTRUCTIONS
Opcode Function
Shift and Rotate
Mnemonic
Instructions Dec Bin Dec Bin
20
FUNCTIONAL GROUPS OF
INSTRUCTIONS
Opcode Function
Branch Instructions Mnemonic
Dec Bin Dec Bin
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Instruction Length
• Fixed versus variable
• 16 bit versus 32 bit
36
Instruction Types and Sub-types
Types 4 4 4 4
Sub-types - 2 4 3
37
Maximum Number of Operands
EAGLE FALCON-A FALCON-E SRC
2 3 3 3
38
Number and Size of GPR
39
Memory Specs.
Memory EAGLE FALCON-A FALCON-E SRC
Specs.
Memory
216 216 232 232
Space
Memory
216 x 8 216 x 8 232 x 8 232 x 8
Organization
Memory
Word Size
16 bit 16 bit 32 bit 32 bit
Memory
16 bits 16 bits 32 bits 32 bits
Access
Memory to - - - -
Memory
42
Control Flow Instructions
• Branches (conditional)
• Jumps (unconditional)
• Calls (procedure calls)
• Returns (procedure returns)
43
Branch Options
• Condition Codes
– test special bits set by ALU
– specific ordering of instructions required
– EAGLE uses condition codes for branch condition evaluation
• Condition Register
– tests arbitrary registers
– special register required.
– none of our processors allocate a specific register for storing branch
results.
• Compare and Branch
– comparison is part of branch
– complex
– all the processors, SRC, FALCON-E, FALCON-A & EAGLE have
compare and branch instructions.
44
Size of Jumps
45
Addressing Modes
Specify a constant, a register or a location
in memory.
Common addressing modes are
– Immediate 123
– Register R3
– Direct [123]
– Register Indirect M[R3]
– Displacement M[R3+123]
– Relative [PC+123]
– Indexed or scaled
– Auto increment/ decrement
46
Addressing Modes
EAGLE FALCON-A FALCON-E SRC
Immediate Immediate Immediate Immediate
- - Direct Direct
- - - Relative
47
Size of Displacement Field
Processor Number of bits in displacement field
EAGLE 8 bits
FALCON-A 5 or 8 bits
49
Similar Instructions
(Arithmetic)
Instruction EAGLE FALCON-A FALCON-E SRC
Add add add add add
53
Similar Instructions
(Branch)
Instruction EAGLE FALCON-A FALCON-E SRC
Unconditional br jump jmp br
branch
Branch if zero brz jz - brzr
54
Similar Instructions
(Calls and Interrupts)
55
Similar Instructions
(Data Movement)
Instruction EAGLE FALCON-A FALCON-E SRC
Load ldacc load ld ld
57
Instructions Unique to FALCON-A
ret
PC R[ra];
58
Instructions Unique to FALCON-E
• push
• pop
• ldr
• str
• bl
• bg
• muli
• divi
• xor, xori
• ror,rori
59
Instructions Unique to SRC
• ldr
• lar
• str
• brlnv
• brlpl
• brlmi
• brlzr
• brlnz
60
Problem Comparison
Given is the code for a simple C statement, a=(b-2)+4c and its implementation
in all the four processors.