From fd0b11087ee70d15867c15b64ac0bbfdb350dd65 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 11 Oct 2021 08:18:52 +0800 Subject: [PATCH] nac3core: use round instead of rint. Closes #61 --- nac3core/src/toplevel/composer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nac3core/src/toplevel/composer.rs b/nac3core/src/toplevel/composer.rs index 32230729..c0da44f8 100644 --- a/nac3core/src/toplevel/composer.rs +++ b/nac3core/src/toplevel/composer.rs @@ -228,10 +228,10 @@ impl TopLevelComposer { codegen_callback: Some(Arc::new(GenCall::new(Box::new(|ctx, _, _, args| { let arg = args[0].1; let round_intrinsic = - ctx.module.get_function("llvm.rint.f64").unwrap_or_else(|| { + ctx.module.get_function("llvm.round.f64").unwrap_or_else(|| { let float = ctx.ctx.f64_type(); let fn_type = float.fn_type(&[float.into()], false); - ctx.module.add_function("llvm.rint.f64", fn_type, None) + ctx.module.add_function("llvm.round.f64", fn_type, None) }); let val = ctx .builder @@ -265,10 +265,10 @@ impl TopLevelComposer { codegen_callback: Some(Arc::new(GenCall::new(Box::new(|ctx, _, _, args| { let arg = args[0].1; let round_intrinsic = - ctx.module.get_function("llvm.rint.f64").unwrap_or_else(|| { + ctx.module.get_function("llvm.round.f64").unwrap_or_else(|| { let float = ctx.ctx.f64_type(); let fn_type = float.fn_type(&[float.into()], false); - ctx.module.add_function("llvm.rint.f64", fn_type, None) + ctx.module.add_function("llvm.round.f64", fn_type, None) }); let val = ctx .builder