From 12750e62cde67479ff0f26028afc9a3d1a26753e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 23 Jan 2019 03:01:43 +0000 Subject: [PATCH] Fix UNSIGNED-LESS-THAN-FIXNUM? branch condition. Add some condition code aliases while here and clarify comments. --- src/compiler/machines/aarch64/insutl.scm | 32 ++++++++++++------------ src/compiler/machines/aarch64/rulfix.scm | 5 ++-- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/compiler/machines/aarch64/insutl.scm b/src/compiler/machines/aarch64/insutl.scm index 7bc3a52e4..ddc75e82f 100644 --- a/src/compiler/machines/aarch64/insutl.scm +++ b/src/compiler/machines/aarch64/insutl.scm @@ -111,22 +111,22 @@ USA. ;; .v = overflow ;; Branch if... (case condition - ((EQ) #b0000) ;equal (z) - ((NE) #b0001) ;not equal (!z) - ((CS) #b0010) ;carry set (c) - ((CC) #b0011) ;carry clear (!c) - ((MI) #b0100) ;negative `minus' (n) - ((PL) #b0101) ;nonnegative `plus' (!n) - ((VS) #b0110) ;overflow set (v) - ((VC) #b0111) ;overflow clear (!v) - ((HI) #b1000) ;carry and nonzero (c & !z) - ((LS) #b1001) ;!carry or zero (!c | z) - ((GE) #b1010) ;greater or equal (n = v) - ((LT) #b1011) ;less (n != v) - ((GT) #b1100) ;greater ((n = v) & !z) - ((LE) #b1101) ;less or equal ((n != v) | z) - ((AL) #b1110) ;always - ;(() #b1111) ;never? + ((EQ) #b0000) ;equal (z) + ((NE) #b0001) ;not equal (!z) + ((CS HS) #b0010) ;carry set / unsigned higher|same (c) + ((CC LO) #b0011) ;carry clear / unsigned lower (!c) + ((MI) #b0100) ;negative `minus' (n) + ((PL) #b0101) ;nonnegative `plus' (!n) + ((VS) #b0110) ;overflow set (v) + ((VC) #b0111) ;overflow clear (!v) + ((HI) #b1000) ;carry&nonzero / unsigned higher (c & !z) + ((LS) #b1001) ;(!carry)|zero / unsigned lower|same (!c | z) + ((GE) #b1010) ;greater or equal (n = v) + ((LT) #b1011) ;less (n != v) + ((GT) #b1100) ;greater ((n = v) & !z) + ((LE) #b1101) ;less or equal ((n != v) | z) + ((AL) #b1110) ;always + ;(() #b1111) ;never? (else #f))) (define (invert-branch-condition condition) diff --git a/src/compiler/machines/aarch64/rulfix.scm b/src/compiler/machines/aarch64/rulfix.scm index ae0930d79..8662ed72e 100644 --- a/src/compiler/machines/aarch64/rulfix.scm +++ b/src/compiler/machines/aarch64/rulfix.scm @@ -256,9 +256,8 @@ USA. ((GREATER-THAN-FIXNUM?) (set-condition-branches! 'GT 'LE)) ((UNSIGNED-LESS-THAN-FIXNUM?) - (set-condition-branches! 'MI 'PL)) - #; ;XXX broken but not sure this ever appears + (set-condition-branches! 'LO 'HS)) ((UNSIGNED-GREATER-THAN-FIXNUM?) - (set-condition-branches! 'PL 'MI)) + (set-condition-branches! 'HI 'LS)) (else (error "Unknown fixnum predicate:" predicate)))) -- 2.25.1