From 612e4b99b0462586f32e4a337ab9367e9bc1661c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 30 Jun 2009 21:07:39 -0500 Subject: [PATCH] compiler.cfg.linear-scan.assignment: insert-copy did the wrong thing if the second interval had been split. Fixes compilation of 'trilerp' --- basis/compiler/cfg/linear-scan/assignment/assignment.factor | 5 ++++- basis/math/vectors/vectors-tests.factor | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/basis/compiler/cfg/linear-scan/assignment/assignment.factor b/basis/compiler/cfg/linear-scan/assignment/assignment.factor index ea717f9218..ab03882757 100644 --- a/basis/compiler/cfg/linear-scan/assignment/assignment.factor +++ b/basis/compiler/cfg/linear-scan/assignment/assignment.factor @@ -50,9 +50,12 @@ ERROR: already-spilled ; : handle-spill ( live-interval -- ) dup spill-to>> [ [ record-spill ] [ insert-spill ] bi ] [ drop ] if ; +: next-interval ( live-interval -- live-interval' ) + split-next>> dup split-before>> [ next-interval ] [ ] ?if ; + : insert-copy ( live-interval -- ) { - [ split-next>> reg>> ] + [ next-interval reg>> ] [ reg>> ] [ vreg>> reg-class>> ] [ end>> ] diff --git a/basis/math/vectors/vectors-tests.factor b/basis/math/vectors/vectors-tests.factor index 968af6a3aa..3e56644d3e 100644 --- a/basis/math/vectors/vectors-tests.factor +++ b/basis/math/vectors/vectors-tests.factor @@ -16,3 +16,5 @@ USING: math.vectors tools.test ; [ { 1.75 2.125 } ] [ { 1.0 2.5 } { 2.5 1.0 } { 0.5 0.25 } vlerp ] unit-test [ 1.125 ] [ 0.0 1.0 2.0 4.0 { 0.5 0.25 } bilerp ] unit-test + +[ 17 ] [ 0 1 2 3 4 5 6 7 { 1 2 3 } trilerp ] unit-test \ No newline at end of file