Robbepop/apint

Implement forceful cheap casting methods

Robbepop opened this issue · 0 comments

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:

  • into_cheap_truncate
  • cheap_truncate
  • into_cheap_zero_extend
  • cheap_zero_extend
  • into_cheap_sign_extend
  • cheap_sign_extend
  • into_cheap_zero_resize
  • cheap_zero_resize
  • into_cheap_sign_resize
  • cheap_sign_resize