From 7b060062af5da93f0732645e4092958abce0bb83 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Mon, 29 Apr 2019 21:26:01 +0200 Subject: [PATCH] Improve bucketsort by removing redundant INSERTION_BOTTOM --- ucode/sort4.uc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ucode/sort4.uc b/ucode/sort4.uc index b14cef7..1688ab5 100644 --- a/ucode/sort4.uc +++ b/ucode/sort4.uc @@ -222,22 +222,19 @@ mov pc pm mov ar pc $INSERTION -mov pc asr; bls @INSERTION_END_BIGGEST +mov pc asr; incpc; declc; bls @INSERTION_END_BIGGEST mov pm ar sub ir -adn ir; brn @INSERTION_BOTTOM +adn ir; brn @INSERTION -mov ir pm; incpc +mov ir pm $INSERTION_SHIFT -mov pc asr; bls @INSERTION_END_NOTBIGGEST +mov pc asr mov pm ir -mov ar pm +mov ar pm; bls @INSERTION_END_NOTBIGGEST mov ir ar; declc; incpc; bra @INSERTION_SHIFT -$INSERTION_BOTTOM -declc; incpc; bra @INSERTION - $INSERTION_END_BIGGEST mov ir pm