Beispiel #1
0
def sll(dest, operand1, immediate):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=operand1,
                        shift_type=pips.SHIFT_LEFT,
                        shift_amt=immediate)
Beispiel #2
0
def srl(dest, op1, immediate):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=op1,
                        shift_type=pips.SHIFT_RIGHT_LOGICAL,
                        shift_amt=immediate)
Beispiel #3
0
def sra(dest, shift_reg, shift):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=shift_reg,
                        shift_type=pips.SHIFT_RIGHT_ARITHMETIC,
                        shift_amt=shift)
Beispiel #4
0
def sra(dest, operand1, immediate):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=operand1,
                        shift_type=pips.SHIFT_RIGHT_ARITHMETIC,
                        shift_amt=immediate)
Beispiel #5
0
def srl(dest, shift_reg, shift):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=shift_reg,
                        shift_type=pips.SHIFT_RIGHT_LOGICAL,
                        shift_amt=shift)
Beispiel #6
0
def sll(dest, shift_reg, shift):
    return pips.rformat(opcode='add',
                        r0=dest,
                        r1='$zero',
                        r2=shift_reg,
                        shift_type=pips.SHIFT_LEFT,
                        shift_amt=shift)
Beispiel #7
0
def nand_instr(dest, operand1, operand2):
    return pips.rformat(opcode='nand', r0=dest, r1=operand1, r2=operand2)
Beispiel #8
0
def nor(dest, op1, op2):
    return pips.rformat(opcode='nor', r0=dest, r1=op1, r2=op2)
Beispiel #9
0
def nand(dest, op1, op2):
    return pips.rformat(opcode='nand', r0=dest, r1=op1, r2=op2)
Beispiel #10
0
def or_instr(dest, op1, op2):
    return pips.rformat(opcode='or', r0=dest, r1=op1, r2=op2)
Beispiel #11
0
def and_instr(dest, op1, op2):
    return pips.rformat(opcode='and', r0=dest, r1=op1, r2=op2)
Beispiel #12
0
def srl(operand1, operand2, shift_amt):
  return pips.rformat(opcode='add', r0=operand1, r1='$zero', r2=operand2,
          shift_type=pips.SHIFT_RIGHT_LOGICAL, shift_amt=shift_amt)
Beispiel #13
0
def xor(dest, operand1, operand2):
    return pips.rformat(opcode='xor', r0=dest, r1=operand1, r2=operand2)
Beispiel #14
0
def jr(dest):
    return pips.rformat(opcode='j', r0='$zero', r1='$zero', r2=dest)
Beispiel #15
0
def sub_instr(dest, operand1, operand2):
    return pips.rformat(opcode='sub', r0=dest, r1=operand1, r2=operand2)
Beispiel #16
0
def jump_register(register):
    return pips.rformat(opcode='j', r0='$zero', r1='$zero', r2=register)
Beispiel #17
0
def sra(operand1, operand2, shift_amt):
  return pips.rformat(opcode='add', r0=operand1, r1='$zero', r2=operand2,
          shift_type=pips.SHIFT_RIGHT_ARITHMETIC, shift_amt=shift_amt)
Beispiel #18
0
def sub(dest, op1, op2):
    return pips.rformat(opcode='sub', r0=dest, r1=op1, r2=op2)
Beispiel #19
0
def sltu(dest, op1, op2):
    return pips.rformat(opcode='sltu', r0=dest, r1=op1, r2=op2)
Beispiel #20
0
def add(dest, operand1, operand2):
    return pips.rformat(opcode='add', r0=dest, r1=operand1, r2=operand2)
Beispiel #21
0
def jr(op1):
    return pips.rformat(opcode='j', r0='$zero', r1='$zero', r2=op1)
Beispiel #22
0
def slt(dest, operand1, operand2):
    return pips.rformat(opcode='slt', r0=dest, r1=operand1, r2=operand2)
Beispiel #23
0
def sll(operand1, operand2, shift_amt):
  return pips.rformat(opcode='add', r0=operand1, r1='$zero', r2=operand2,
          shift_type=pips.SHIFT_LEFT, shift_amt=shift_amt)