Computer Architecture Lab/SS2014/group 4 lab 2

< Computer Architecture Lab < SS2014

Proposals for ISAs

Proposal 1

A MIPS processor extended such that r1,r2 behave as windows into the top 2 elements of a return stack and r3,r4 behave as windows into a data stack. This should eliminate the performance decrease from function calls. The instruction set does not need to, but could, be changed from the standard MIPS32 ISA as common stack operations can already interpreted from the current instruction set.

For example ( using forth notation stack( before -- after ) )

  • dup ( a -- a a ): add $4 $4 $0
  • drop ( a -- ): add $0 $4 $0
  • swap ( a b -- b a ): add $4 $3 $0
  • over ( a b -- a b a ): add $5 $3 $0; add $4 $5 $0

Proposal 2

A stack machine with a data stack, return stack, variable stack, floating point stack and 28 temporary registers. Functional units are wired to the data stack.

Most instructions are 5-bit wide and are packed inside 32-bit words. Instructions that load an immediate value or jump are a full word wide and use 27 bits for the value. Instructions that can operate on a different stack than the data stack are 5-bit wide and use the following 5-bit to determine the point of operation.

mnemonicEffectDetails
nop----
over[s]s( a b -- a b a )Performs over operation on stack specified by s
dup[s]s( a -- a a )Performs over operation on stack specified by s
swap[s]s( a b -- b a )Performs swap operation on stack specified by s
limD( -- x )Loads an immediate x
>[sr]D( x -- )Pops an item from data stack and pushes it to another stack or scratch register
[sr]>D( -- [sr] )Pops an item from a stack or scratch register and places it on the data stack
@[sr]D( -- MEM[ sr ] )Pushes MEM[ sr ] to the data stack
@[sr]+D( -- MEM[ sr++ ] )Pushes MEM[ sr++ ] to the data stack
 ![sr]D( x -- )Pops top of data stack to MEM[ sr ]
 ![sr]+D( x -- )Pops top of data stack to MEM[ sr++ ]
addD( x y -- x+y )adds two top members of data stack
subD( x y -- x - y )subtracts two top members of data stack
mulD( x y -- x * y )multiplies the two top members of the data stack
divD( x y -- x%y x/y )divides the two top members of the data stack placing x mod y and x/y on the stack
sllD( x y -- x<<y )Shifts the top of stack to the left
slrD( x y -- x>>y )Shifts the top of stack to the right
andD( x y -- x AND y )Bitwise and
orD( x y -- x OR y )Bitwise or
notD( x -- ~x )negation
xorD( x y -- x XOR y )bitwise xor
jmpD( -- )Unconditional jump
bezD( x -- )Pops stack and branches on 0
brpD( x -- )Pops stack and branches on positive value
callR( -- x )Subroutine call, pushes return address on return stack
retR( x -- )Pop return stack and return from subroutine