More branch instructions.

This commit is contained in:
Hans-Kristian Arntzen 2020-01-31 21:03:52 +01:00
parent 9349cd300d
commit 6b2bac5326
5 changed files with 91 additions and 0 deletions

View File

@ -137,7 +137,10 @@ if (PARALLEL_RSP_TESTS)
#rsp_add_test(beq-impossible-delay-slot-both-taken) Hangs the reference implementation :D
rsp_add_test(bne)
rsp_add_test(blez)
rsp_add_test(bltz)
rsp_add_test(bltzal)
rsp_add_test(bgtz)
rsp_add_test(bgezal)
rsp_add_test(j)
rsp_add_test(jal)
rsp_add_test(jr)

22
debug-toolchain/bgez.s Normal file
View File

@ -0,0 +1,22 @@
.text
.set noreorder
.global main
main:
li $t0, -1
bgez $t0, taken1 # This will not be taken.
li $t2, 10
li $t0, 0
bgez $t0, taken1 # This will be taken.
li $t2, 20
li $t0, 1
bgez $t0, taken1 # This will be taken.
li $t2, 30
taken0:
li $t4, 5
break
taken1:
li $t4, 4
break

22
debug-toolchain/bgezal.s Normal file
View File

@ -0,0 +1,22 @@
.text
.set noreorder
.global main
main:
li $t0, -1
bgezal $t0, taken1 # This will not be taken.
li $t2, 10
li $t0, 0
bgezal $t0, taken1 # This will be taken.
li $t2, 20
li $t0, 1
bgezal $t0, taken1 # This will be taken.
li $t2, 30
taken0:
li $t4, 5
break
taken1:
li $t4, 4
break

22
debug-toolchain/bltz.s Normal file
View File

@ -0,0 +1,22 @@
.text
.set noreorder
.global main
main:
li $t0, 1
bltz $t0, taken1 # This will not be taken.
li $t2, 10
li $t0, 0
bltz $t0, taken1 # This will not be taken.
li $t2, 20
li $t0, -1
bltz $t0, taken1 # This will be taken.
li $t2, 30
taken0:
li $t4, 5
break
taken1:
li $t4, 4
break

22
debug-toolchain/bltzal.s Normal file
View File

@ -0,0 +1,22 @@
.text
.set noreorder
.global main
main:
li $t0, 1
bltzal $t0, taken1 # This will not be taken.
li $t2, 10
li $t0, 0
bltzal $t0, taken1 # This will not be taken.
li $t2, 20
li $t0, -1
bltzal $t0, taken1 # This will be taken.
li $t2, 30
taken0:
li $t4, 5
break
taken1:
li $t4, 4
break