<reponame>kevintmcdonnell/stars<filename>src/stars/tests/instructions/instructions.py
BASE = """
.text
main:

target:
label:

"""

INSTRUCTION_TEST_SET = [
    "abs $t1,$t2",
    "abs.d $f2,$f4",
    "abs.s $f0,$f1",
    "add $t1,$t2,$t3",
    "add.d $f2,$f4,$f6",
    "add.s $f0,$f1,$f3",
    "addi $t1,$t2,-100",
    "addi $t1,$t2,100000",
    "addiu $t1,$t2,-100",
    "addiu $t1,$t2,100000",
    "addu $t1,$t2,$t3",
    "and $t1,$t2,$t3",
    "andi $t1,$t2,100",
    "andi $t1,$t2,100000",
    "b label",
    "bc1f 1,label",
    "bc1f label",
    "bc1t 1,label",
    "bc1t label",
    "beq $t1,$t2,label",
    "beqz $t1,label",
    "bge $t1,$t2,label",
    "bgeu $t1,$t2,label",
    "bgez $t1,label",
    "bgezal $t1,label",
    "bgt $t1,$t2,label",
    "bgtu $t1,$t2,label",
    "bgtz $t1,label",
    "ble $t1,$t2,label",
    "bleu $t1,$t2,label",
    "blez $t1,label",
    "blt $t1,$t2,label",
    "bltu $t1,$t2,label",
    "bltz $t1,label",
    "bltzal $t1,label",
    "bne $t1,$t2,label",
    "bnez $t1,label",
    "break"
    "c.eq.d $f2,$f4",
    "c.eq.d 1,$f2,$f4",
    "c.eq.s $f0,$f1",
    "c.eq.s 1,$f0,$f1",
    "c.le.d $f2,$f4",
    "c.le.d 1,$f2,$f4",
    "c.le.s $f0,$f1",
    "c.le.s 1,$f0,$f1",
    "c.lt.d $f2,$f4",
    "c.lt.d 1,$f2,$f4",
    "c.lt.s $f0,$f1",
    "c.lt.s 1,$f0,$f1",
    "ceil.w.d $f1,$f2",
    "ceil.w.s $f0,$f1",
    "clo $t1,$t2",
    "clz $t1,$t2",
    "cvt.d.s $f2,$f1",
    "cvt.d.w $f2,$f1",
    "cvt.s.d $f1,$f2",
    "cvt.s.w $f0,$f1",
    "cvt.w.d $f1,$f2",
    "cvt.w.s $f0,$f1",
    "div $t1,$t2",
    "div.d $f2,$f4,$f6",
    "div.s $f0,$f1,$f3",
    "divu $t1,$t2",
    "floor.w.d $f1,$f2",
    "floor.w.s $f0,$f1",
    "j target",
    "jal target",
    "jalr $t1",
    "jalr $t1,$t2",
    "jr $t1",
    "l.d $f2,($t2)",
    "l.d $f2,100000($t2)",
    "l.s $f1,($t2)",
    "l.s $f1,100000($t2)",
    "la $t1,label",
    "lb $t1,($t2)",
    "lbu $t1,($t2)",
    "lh $t1,($t2)",
    "lhu $t1,($t2)",
    "li $t1,-100",
    "lui $t1,100",
    "lw $t1,($t2)",
    "lwl $t1,($t2)",
    "lwr $t1,($t2",
    "madd $t1,$t2",
    "maddu $t1,$t2",
    "mfc1 $t1,$f1",
    "mfhi $t1",
    "mflo $t1",
    "mov.d $f2,$f4",
    "mov.s $f0,$f1",
    "move $t1,$t2",
    "movf $t1,$t2",
    "movf $t1,$t2,1",
    "movf.d $f2,$f4",
    "movf.d $f2,$f4,1",
    "movf.s $f0,$f1",
    "movf.s $f0,$f1,1",
    "movn $t1,$t2,$t3",
    "movn.d $f2,$f4,$t3",
    "movn.s $f0,$f1,$t3",
    'movt $t1,$t2',
    "movt $t1,$t2,1",
    "movt.d $f2,$f4",
    "movt.d $f2,$f4,1",
    'movt.s $f0,$f1',
    "movt.s $f0,$f1,1",
    "movz $t1,$t2,$t3",
    "movz.d $f2,$f4,$t3",
    "movz.s $f0,$f1,$t3",
    "msub $t1,$t2",
    "msubu $t1,$t2",
    "mtc1 $t1,$f1",
    "mthi $t1",
    "mtlo $t1",
    "mul $t1,$t2,$t3",
    "mul.d $f2,$f4,$f6",
    "mul.s $f0,$f1,$f3",
    "mult $t1, $t2",
    "multu $t1, $t2",
    "neg $t1,$t2",
    "neg.d $f2,$f4",
    "neg.s $f0,$f1",
    "nop",
    "nor $t1,$t2,$t3",
    "not $t1,$t2",
    "or $t1,$t2,$t3",
    "ori $t1,$t2,100",
    "ori $t1,$t2,100000",
    "rol $t1,$t2,10",
    "ror $t1,$t2,10",
    "round.w.d $f1,$f2",
    "round.w.s $f0,$f1",
    "s.d $f2,($t2)",
    "s.d $f2,100000($t2)",
    "s.s $f1,($t2)",
    "s.s $f1,100000($t2)",
    "sb $t1,($t2)",
    "seq $t1,$t2,$t3",
    "sge $t1,$t2,$t3",
    "sgeu $t1,$t2,$t3",
    "sgt $t1,$t2,$t3",
    "sgtu $t1,$t2,$t3",
    "sh $t1,($t2)",
    "sle $t1,$t2,$t3",
    "sleu $t1,$t2,$t3",
    "sll $t1,$t2,10",
    "sllv $t1,$t2,$t3",
    "slt $t1,$t2,$t3",
    "slti $t1,$t2,-100",
    "sltiu $t1,$t2,-100",
    "sltu $t1,$t2,$t3",
    "sne $t1,$t2,$t3",
    "sqrt.d $f2,$f4",
    "sqrt.s $f0,$f1",
    "sra $t1,$t2,10",
    "srav $t1,$t2,$t3",
    "srl $t1,$t2,10",
    "srlv $t1,$t2,$t3",
    "sub $t1,$t2,$t3",
    "sub.d $f2,$f4,$f6",
    "sub.s $f0,$f1,$f3",
    "subu $t1,$t2,$t3",
    "sw $t1,($t2)",
    'swl $t1,($t2)',
    'swr $t1,($t2)',
    "syscall",
    "trunc.w.d $f1,$f2",
    "trunc.w.s $f0,$f1",
    "xor $t1,$t2,$t3",
    "xori $t1,$t2,100",
    "xori $t1,$t2,100000",
]
BASE = """
.text
main:

target:
label:

"""

INSTRUCTION_TEST_SET = [
    "abs $t1,$t2",
    "abs.d $f2,$f4",
    "abs.s $f0,$f1",
    "add $t1,$t2,$t3",
    "add.d $f2,$f4,$f6",
    "add.s $f0,$f1,$f3",
    "addi $t1,$t2,-100",
    "addi $t1,$t2,100000",
    "addiu $t1,$t2,-100",
    "addiu $t1,$t2,100000",
    "addu $t1,$t2,$t3",
    "and $t1,$t2,$t3",
    "andi $t1,$t2,100",
    "andi $t1,$t2,100000",
    "b label",
    "bc1f 1,label",
    "bc1f label",
    "bc1t 1,label",
    "bc1t label",
    "beq $t1,$t2,label",
    "beqz $t1,label",
    "bge $t1,$t2,label",
    "bgeu $t1,$t2,label",
    "bgez $t1,label",
    "bgezal $t1,label",
    "bgt $t1,$t2,label",
    "bgtu $t1,$t2,label",
    "bgtz $t1,label",
    "ble $t1,$t2,label",
    "bleu $t1,$t2,label",
    "blez $t1,label",
    "blt $t1,$t2,label",
    "bltu $t1,$t2,label",
    "bltz $t1,label",
    "bltzal $t1,label",
    "bne $t1,$t2,label",
    "bnez $t1,label",
    "break"
    "c.eq.d $f2,$f4",
    "c.eq.d 1,$f2,$f4",
    "c.eq.s $f0,$f1",
    "c.eq.s 1,$f0,$f1",
    "c.le.d $f2,$f4",
    "c.le.d 1,$f2,$f4",
    "c.le.s $f0,$f1",
    "c.le.s 1,$f0,$f1",
    "c.lt.d $f2,$f4",
    "c.lt.d 1,$f2,$f4",
    "c.lt.s $f0,$f1",
    "c.lt.s 1,$f0,$f1",
    "ceil.w.d $f1,$f2",
    "ceil.w.s $f0,$f1",
    "clo $t1,$t2",
    "clz $t1,$t2",
    "cvt.d.s $f2,$f1",
    "cvt.d.w $f2,$f1",
    "cvt.s.d $f1,$f2",
    "cvt.s.w $f0,$f1",
    "cvt.w.d $f1,$f2",
    "cvt.w.s $f0,$f1",
    "div $t1,$t2",
    "div.d $f2,$f4,$f6",
    "div.s $f0,$f1,$f3",
    "divu $t1,$t2",
    "floor.w.d $f1,$f2",
    "floor.w.s $f0,$f1",
    "j target",
    "jal target",
    "jalr $t1",
    "jalr $t1,$t2",
    "jr $t1",
    "l.d $f2,($t2)",
    "l.d $f2,100000($t2)",
    "l.s $f1,($t2)",
    "l.s $f1,100000($t2)",
    "la $t1,label",
    "lb $t1,($t2)",
    "lbu $t1,($t2)",
    "lh $t1,($t2)",
    "lhu $t1,($t2)",
    "li $t1,-100",
    "lui $t1,100",
    "lw $t1,($t2)",
    "lwl $t1,($t2)",
    "lwr $t1,($t2",
    "madd $t1,$t2",
    "maddu $t1,$t2",
    "mfc1 $t1,$f1",
    "mfhi $t1",
    "mflo $t1",
    "mov.d $f2,$f4",
    "mov.s $f0,$f1",
    "move $t1,$t2",
    "movf $t1,$t2",
    "movf $t1,$t2,1",
    "movf.d $f2,$f4",
    "movf.d $f2,$f4,1",
    "movf.s $f0,$f1",
    "movf.s $f0,$f1,1",
    "movn $t1,$t2,$t3",
    "movn.d $f2,$f4,$t3",
    "movn.s $f0,$f1,$t3",
    'movt $t1,$t2',
    "movt $t1,$t2,1",
    "movt.d $f2,$f4",
    "movt.d $f2,$f4,1",
    'movt.s $f0,$f1',
    "movt.s $f0,$f1,1",
    "movz $t1,$t2,$t3",
    "movz.d $f2,$f4,$t3",
    "movz.s $f0,$f1,$t3",
    "msub $t1,$t2",
    "msubu $t1,$t2",
    "mtc1 $t1,$f1",
    "mthi $t1",
    "mtlo $t1",
    "mul $t1,$t2,$t3",
    "mul.d $f2,$f4,$f6",
    "mul.s $f0,$f1,$f3",
    "mult $t1, $t2",
    "multu $t1, $t2",
    "neg $t1,$t2",
    "neg.d $f2,$f4",
    "neg.s $f0,$f1",
    "nop",
    "nor $t1,$t2,$t3",
    "not $t1,$t2",
    "or $t1,$t2,$t3",
    "ori $t1,$t2,100",
    "ori $t1,$t2,100000",
    "rol $t1,$t2,10",
    "ror $t1,$t2,10",
    "round.w.d $f1,$f2",
    "round.w.s $f0,$f1",
    "s.d $f2,($t2)",
    "s.d $f2,100000($t2)",
    "s.s $f1,($t2)",
    "s.s $f1,100000($t2)",
    "sb $t1,($t2)",
    "seq $t1,$t2,$t3",
    "sge $t1,$t2,$t3",
    "sgeu $t1,$t2,$t3",
    "sgt $t1,$t2,$t3",
    "sgtu $t1,$t2,$t3",
    "sh $t1,($t2)",
    "sle $t1,$t2,$t3",
    "sleu $t1,$t2,$t3",
    "sll $t1,$t2,10",
    "sllv $t1,$t2,$t3",
    "slt $t1,$t2,$t3",
    "slti $t1,$t2,-100",
    "sltiu $t1,$t2,-100",
    "sltu $t1,$t2,$t3",
    "sne $t1,$t2,$t3",
    "sqrt.d $f2,$f4",
    "sqrt.s $f0,$f1",
    "sra $t1,$t2,10",
    "srav $t1,$t2,$t3",
    "srl $t1,$t2,10",
    "srlv $t1,$t2,$t3",
    "sub $t1,$t2,$t3",
    "sub.d $f2,$f4,$f6",
    "sub.s $f0,$f1,$f3",
    "subu $t1,$t2,$t3",
    "sw $t1,($t2)",
    'swl $t1,($t2)',
    'swr $t1,($t2)',
    "syscall",
    "trunc.w.d $f1,$f2",
    "trunc.w.s $f0,$f1",
    "xor $t1,$t2,$t3",
    "xori $t1,$t2,100",
    "xori $t1,$t2,100000",
]
.text main:  target: label: