mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Merge pull request #7314 from shua/wrapped
impl add/sub/mul wrapped for u128/i128
This commit is contained in:
commit
6675734c16
6 changed files with 387 additions and 295 deletions
|
@ -940,8 +940,7 @@ impl<'a> LowLevelCall<'a> {
|
|||
NumAddWrap => match self.ret_layout_raw {
|
||||
LayoutRepr::Builtin(Builtin::Int(width)) => match width {
|
||||
IntWidth::I128 | IntWidth::U128 => {
|
||||
// TODO: don't panic
|
||||
self.load_args_and_call_zig(backend, &bitcode::NUM_ADD_OR_PANIC_INT[width])
|
||||
self.load_args_and_call_zig(backend, &bitcode::NUM_ADD_WRAP_INT[width])
|
||||
}
|
||||
IntWidth::I64 | IntWidth::U64 => {
|
||||
self.load_args(backend);
|
||||
|
@ -1031,8 +1030,7 @@ impl<'a> LowLevelCall<'a> {
|
|||
NumSubWrap => match self.ret_layout_raw {
|
||||
LayoutRepr::Builtin(Builtin::Int(width)) => match width {
|
||||
IntWidth::I128 | IntWidth::U128 => {
|
||||
// TODO: don't panic
|
||||
self.load_args_and_call_zig(backend, &bitcode::NUM_SUB_OR_PANIC_INT[width])
|
||||
self.load_args_and_call_zig(backend, &bitcode::NUM_SUB_WRAP_INT[width])
|
||||
}
|
||||
IntWidth::I64 | IntWidth::U64 => {
|
||||
self.load_args(backend);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue