Robbepop / apint

Arbitrary precision integers library.
Other
26 stars 4 forks source link

Implement forceful cheap casting methods #4

Open Robbepop opened 6 years ago

Robbepop commented 6 years ago

Currently there are the truncate, zero_extend and sign_extend methods and their siblings into_* for method chaining and strict_* for strict truncation and extension. Besides these a cheap_* sibling might be very useful for operations that shall forcefully be executed with minimal overhead and if it is not possible to truncate or extend an ApInt cheaply the operation will return an Error instead of possibly doing lots of work.

For this the following APIs are required: