mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Fix some unary ops
This commit is contained in:
parent
3309270747
commit
dd8dff0f9e
3 changed files with 19 additions and 39 deletions
|
@ -1671,7 +1671,7 @@ fn build_int_unary_op<'a, 'ctx, 'env>(
|
|||
let bd = env.builder;
|
||||
|
||||
match op {
|
||||
NumAdd => bd.build_int_neg(arg, "negate_int").into(),
|
||||
NumNeg => bd.build_int_neg(arg, "negate_int").into(),
|
||||
NumAbs => {
|
||||
todo!("build_int_unary_op for integer absolute value. (possibly bitwise AND with 0b0111_1111_...)");
|
||||
}
|
||||
|
@ -1692,7 +1692,7 @@ fn build_float_unary_op<'a, 'ctx, 'env>(
|
|||
let bd = env.builder;
|
||||
|
||||
match op {
|
||||
NumAdd => bd.build_float_neg(arg, "negate_float").into(),
|
||||
NumNeg => bd.build_float_neg(arg, "negate_float").into(),
|
||||
NumAbs => call_intrinsic(LLVM_FABS_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumSqrt => call_intrinsic(LLVM_SQRT_F64, env, &[(arg.into(), arg_layout)]),
|
||||
NumRound => call_intrinsic(LLVM_LROUND_I64_F64, env, &[(arg.into(), arg_layout)]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue