mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
implement add saturated for the dev backend
This commit is contained in:
parent
736b7c6a83
commit
8770668688
2 changed files with 44 additions and 0 deletions
|
@ -860,6 +860,9 @@ trait Backend<'a> {
|
|||
);
|
||||
self.build_num_add(sym, &args[0], &args[1], ret_layout)
|
||||
}
|
||||
LowLevel::NumAddSaturated => {
|
||||
self.build_num_add_saturated(*sym, args[0], args[1], *ret_layout);
|
||||
}
|
||||
LowLevel::NumAddWrap => {
|
||||
debug_assert_eq!(
|
||||
2,
|
||||
|
@ -1856,6 +1859,15 @@ trait Backend<'a> {
|
|||
/// build_num_add stores the sum of src1 and src2 into dst.
|
||||
fn build_num_add(&mut self, dst: &Symbol, src1: &Symbol, src2: &Symbol, layout: &InLayout<'a>);
|
||||
|
||||
/// build_num_add_saturated stores the sum of src1 and src2 into dst.
|
||||
fn build_num_add_saturated(
|
||||
&mut self,
|
||||
dst: Symbol,
|
||||
src1: Symbol,
|
||||
src2: Symbol,
|
||||
layout: InLayout<'a>,
|
||||
);
|
||||
|
||||
/// build_num_add_checked stores the sum of src1 and src2 into dst.
|
||||
fn build_num_add_checked(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue