From bccb92dd7abb72205fb3835f746145d271d2b998 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 4 Apr 2006 17:17:45 +0100 Subject: [PATCH] mpreduce: Don't stop bit scanner too early. The code generation decomposition pass stopped too early, and failed to note a change in the next-to-top bit. --- mpreduce.c | 2 +- tests/mpreduce | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mpreduce.c b/mpreduce.c index 52e86a1..02ce2cf 100644 --- a/mpreduce.c +++ b/mpreduce.c @@ -105,7 +105,7 @@ int mpreduce_create(mpreduce *r, mp *p) st = Z; #endif - for (i = 0, mp_scan(&sc, p); i < d - 1 && mp_step(&sc); i++) { + for (i = 0, mp_scan(&sc, p); i < d && mp_step(&sc); i++) { switch (st | mp_bit(&sc)) { case Z | 1: st = Z1; break; case Z1 | 0: st = Z; op = MPRI_SUB; goto instr; diff --git a/tests/mpreduce b/tests/mpreduce index 9a74b99..4caad8b 100644 --- a/tests/mpreduce +++ b/tests/mpreduce @@ -3,6 +3,8 @@ # Tests for efficient reduction reduce { + 0xc000 0x16cb3 0xacb3; + 0x72e2c37447f8bca34c4a39b130ea8e5c9a7d8b54564aa88ea773 0x367aa8f5ba9ac4e8e2ea198b8af2c3b3081deab392ffc05715783b245a62a6fa 0x08e8c03ebf398c63d71d8fd7ca4ece12367a8dde180ca650afb6; -- 2.11.0