From 9e5ecc81707ee9fa5a9370cf655ea4d5c735b3eb Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 26 Apr 2022 18:14:40 -0700 Subject: [PATCH] clean up code --- openpower/sv/biginteger/divgnu64.c | 7 ++----- openpower/sv/biginteger/divmnu64.c | 16 +++++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/openpower/sv/biginteger/divgnu64.c b/openpower/sv/biginteger/divgnu64.c index fafd01ee3..f2422933d 100644 --- a/openpower/sv/biginteger/divgnu64.c +++ b/openpower/sv/biginteger/divgnu64.c @@ -85,8 +85,6 @@ long bigdiv(unsigned v, unsigned q[], unsigned const u[], int m) bool bigmul(unsigned long long qhat, unsigned product[], unsigned vn[], int m, int n) { - long long t, k; - int s, i; // Multiply and subtract. uint32_t carry = 0; // VL = n + 1 @@ -170,9 +168,8 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], unsigned *un, *vn; // Normalized form of u, v. unsigned long long qhat; // Estimated quotient digit. unsigned long long rhat; // A remainder. - unsigned long long p; // Product of two digits. - long long t, k; - int s, i, j; + long long k; + int s, j; if (m < n || n <= 0 || v[n - 1] == 0) return 1; // Return if invalid param. diff --git a/openpower/sv/biginteger/divmnu64.c b/openpower/sv/biginteger/divmnu64.c index f2e0eea48..330e06d1a 100644 --- a/openpower/sv/biginteger/divmnu64.c +++ b/openpower/sv/biginteger/divmnu64.c @@ -76,8 +76,6 @@ divrem_t divrem_64_by_32(uint64_t n, uint32_t d) bool bigmul(uint32_t qhat, unsigned product[], unsigned vn[], int m, int n) { - long long t, k; - int s, i; uint32_t carry = 0; // VL = n + 1 // sv.madded product.v, vn.v, qhat.s, carry.s @@ -236,7 +234,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], un[j + n] = t; bool need_fixup = t < 0; #elif defined(SUB_MUL_BORROW) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t borrow = 0; @@ -249,7 +247,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = borrow != 0; #elif defined(MUL_RSUB_CARRY) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t carry = 1; @@ -265,7 +263,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = carry != 1; #elif defined(SUB_MUL_BORROW_2_STAGE) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t borrow = 0; @@ -292,7 +290,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = borrow != 0; #elif defined(MUL_RSUB_CARRY_2_STAGE) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t carry = 1; @@ -316,7 +314,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = carry != 1; #elif defined(MUL_RSUB_CARRY_2_STAGE1) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t carry = 1; @@ -345,7 +343,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = carry != 1; #elif defined(MUL_RSUB_CARRY_2_STAGE2) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t carry = 0; @@ -375,7 +373,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], } bool need_fixup = carry != 0; #elif defined(MADDED_SUBFE) - (void)p; // shut up unused variable warning + (void)p, (void)t; // shut up unused variable warning // Multiply and subtract. uint32_t carry = 0; -- 2.30.2