From ae3d25bf6512bd45603919f355f4626eaa6453a7 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Mon, 29 Apr 2019 23:16:26 +0200 Subject: [PATCH] Optimize sort4 based on practical tests --- ucode/sort4.uc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ucode/sort4.uc b/ucode/sort4.uc index 1688ab5..bd6fdcc 100644 --- a/ucode/sort4.uc +++ b/ucode/sort4.uc @@ -214,11 +214,12 @@ mov ar asr; bra @PREPARE_SORT - +// Actual bucketsort $PREPARE_SORT -mov pm pc; mov pm lc -sub gr; incpc -mov pc pm +mov pm pc; mov pm lc // Load bucket length +sub gr; incpc // Increment bucket length +mov pc pm // Store new length +//mov ar asr; bls @INSERTION_END_BIGGEST mov ar pc $INSERTION @@ -239,5 +240,5 @@ $INSERTION_END_BIGGEST mov ir pm $INSERTION_END_NOTBIGGEST -mov hr ar; mov hr pc +mov hr pc mov pc asr; ret