This adds test cases to ensure, to a reasonably high degree of certainty, that the magic-number generators `magic_u32`, `magic_s32`, `magic_u64` and `magic_s64` work correctly. This is done by iterating through a large number of `(n, d)` pairs, generating the magic numbers for `d`, interpreting the magic numbers so as to perform the division, and comparing against the result produced directly by the hardware. The distribution of numbers is arranged so that particular emphasis is given to corner cases -- the range ends and midpoints -- but also so that there is at least some cover for values away from those areas. In total 50,148,000 tests are performed.
This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.