From 21883dbd84cdf945a27877ed4e0482acda203599 Mon Sep 17 00:00:00 2001 From: Brendan Haines Date: Mon, 9 Nov 2020 20:22:18 -0700 Subject: [PATCH] passes quick test: bne, bge, bgeu --- test/test.S | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/test/test.S b/test/test.S index f9bf714..18716ad 100644 --- a/test/test.S +++ b/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