creachadair / imath

Arbitrary precision integer and rational arithmetic library
Other
129 stars 20 forks source link

Added big-endian support to mpz_import and mpz_export in gmp_compat.c #12

Closed jrtc27 closed 8 years ago

jrtc27 commented 8 years ago

The mpz_import/export functions no longer assume little-endian, and fully support big-endian modes too. I removed the if (order != 1) order = -1; and turned it into an assert, since GMP asserts that it's either 1 or -1. With this change I see no regressions when running the test suite for Polly (http://polly.llvm.org) in the Debian package on amd64, and it also now passes on sparc64 (where previously about half the tests failed).

tobiasgrosser commented 8 years ago

@jrtc27 : Hi James, thank you for this fix. I will pull this as soon as it is merged.

tobiasgrosser commented 7 years ago

@jrtc27 : This patch has been included in isl and committed to Polly in http://llvm.org/svn/llvm-project/polly/trunk@285993

Would be great if you could confirm that the debian sparc packages now work without problem.