From: Jacob Lifshay Date: Tue, 26 Apr 2022 05:28:34 +0000 (-0700) Subject: format code X-Git-Tag: opf_rfc_ls005_v1~2588 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59f157d6cf3a67b9066f129c791b07c2ca1f0335;p=libreriscv.git format code --- diff --git a/openpower/sv/biginteger/divgnu64.c b/openpower/sv/biginteger/divgnu64.c index ebb46d1cc..6a94c66ca 100644 --- a/openpower/sv/biginteger/divgnu64.c +++ b/openpower/sv/biginteger/divgnu64.c @@ -56,8 +56,8 @@ void dumpit(char *msg, int n, unsigned v[]) printf("\n"); } -bool bigmul(unsigned long long qhat, unsigned product[], unsigned vn[], - int m, int n) +bool bigmul(unsigned long long qhat, unsigned product[], unsigned vn[], int m, + int n) { long long t, k; int s, i; @@ -75,8 +75,8 @@ bool bigmul(unsigned long long qhat, unsigned product[], unsigned vn[], return carry != 0; } -bool bigadd(unsigned result[], unsigned vn[], unsigned un[], - int m, int n, bool ca) +bool bigadd(unsigned result[], unsigned vn[], unsigned un[], int m, int n, + bool ca) { // VL = n + 1 // sv.subfe un_j.v, product.v, un_j.v @@ -89,8 +89,8 @@ bool bigadd(unsigned result[], unsigned vn[], unsigned un[], return ca; } -bool bigsub(unsigned result[], unsigned vn[], unsigned un[], - int m, int n, bool ca) +bool bigsub(unsigned result[], unsigned vn[], unsigned un[], int m, int n, + bool ca) { // VL = n + 1 // sv.subfe un_j.v, product.v, un_j.v @@ -103,8 +103,8 @@ bool bigsub(unsigned result[], unsigned vn[], unsigned un[], return ca; } -bool bigmulsub(unsigned long long qhat, unsigned vn[], unsigned un[], - int j, int m, int n) +bool bigmulsub(unsigned long long qhat, unsigned vn[], unsigned un[], int j, + int m, int n) { // Multiply and subtract. uint32_t product[n + 1]; @@ -140,11 +140,11 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], int m, int n) { - const unsigned long long b = 1LL<<32; // Number base (2**32). - 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. + const unsigned long long b = 1LL << 32; // Number base (2**32). + 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; diff --git a/openpower/sv/biginteger/divmnu64.c b/openpower/sv/biginteger/divmnu64.c index a243bcd96..8783f8d1a 100644 --- a/openpower/sv/biginteger/divmnu64.c +++ b/openpower/sv/biginteger/divmnu64.c @@ -97,10 +97,10 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], { // Take care of k = 0; // the case of a for (j = m - 1; j >= 0; j--) - { // single-digit - uint64_t dig2 = (k << 32 ) | u[j]; + { // single-digit + uint64_t dig2 = (k << 32) | u[j]; q[j] = dig2 / v[0]; // divisor here. - k = dig2 % v[0]; // modulo back into next loop + k = dig2 % v[0]; // modulo back into next loop } if (r != NULL) r[0] = k; @@ -132,8 +132,8 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], qhat = dig1 / vn[n - 1]; rhat = dig1 % vn[n - 1]; uint64_t dig2 = ((uint64_t)rhat << 32) | un[j + n - 1]; - qhat = dig2 / vn[n - 1] | (qhat<<32); - rhat = dig2 % vn[n - 1] | (rhat<<32); + qhat = dig2 / vn[n - 1] | (qhat << 32); + rhat = dig2 % vn[n - 1] | (rhat << 32); again: // use 3rd-from-top digit to obtain better accuracy if (qhat >= b || qhat * vn[n - 2] > b * rhat + un[j + n - 2])