mirror of
https://gitlab.com/brendanhaines/cpu.git
synced 2024-12-25 18:46:53 -07:00
passes quick test: bne, bge, bgeu
This commit is contained in:
parent
6e0d9c96a1
commit
21883dbd84
40
test/test.S
40
test/test.S
|
@ -155,7 +155,7 @@ test2:
|
|||
j fail
|
||||
|
||||
test3:
|
||||
#blt
|
||||
# blt
|
||||
addi x30, x0, 3 # x30 = 3
|
||||
blt x8, x9, fail # x8 == x9
|
||||
blt x7, x8, fail # x7 > x8
|
||||
|
@ -164,14 +164,48 @@ test3:
|
|||
j fail
|
||||
|
||||
test4:
|
||||
#bltu
|
||||
# bltu
|
||||
addi x30, x0, 4 # x30 = 4
|
||||
bltu x8, x9, fail # x8 == x9
|
||||
bltu x8, x7, fail # x8 < x7
|
||||
bltu x7, x8, fail # x7 > x8
|
||||
bltu x30, x8, test5 # x30 < x8 unsigned
|
||||
j fail
|
||||
|
||||
test5:
|
||||
addi x30, x0, 5 # x30 = 5
|
||||
bltu x8, x7, test6 # x8 < x7
|
||||
j fail
|
||||
|
||||
test6:
|
||||
# bne
|
||||
addi x30, x0, 6 # x30 = 6
|
||||
bne x0, x0, fail # 0 == 0
|
||||
bne x8, x9, fail # 0 == 0
|
||||
bne x8, x0, test7 # x8 != 0
|
||||
j fail
|
||||
|
||||
test7:
|
||||
# bge
|
||||
addi x30, x0, 7 # x30 = 7
|
||||
bge x8, x7, fail # x8 < x7
|
||||
bge x7, x7, test8 # x7 == x7
|
||||
j fail
|
||||
|
||||
test8:
|
||||
addi x30, x0, 8 # x30 = 8
|
||||
bge x8, x0, fail # x8 < 0
|
||||
bge x7, x8, test9 # x7 > x8
|
||||
j fail
|
||||
|
||||
test9:
|
||||
# bgeu
|
||||
addi x30, x0, 9 # x30 = 9
|
||||
bgeu x8, x7, fail # x8 < x7
|
||||
bgeu x0, x8, fail # 0 < x8 unsigned
|
||||
bgeu x8, x0, test10 # x8 > 0 unsigned
|
||||
j fail
|
||||
|
||||
test10:
|
||||
|
||||
|
||||
# set registers to known values before loop
|
||||
|
|
Loading…
Reference in New Issue
Block a user